Fix termination sequence on Windows wrt interval timers.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
f0e5f225
EZ
12012-10-01 Eli Zaretskii <eliz@gnu.org>
2
3 * w32proc.c <disable_itimers>: New static flag.
4 (init_timers): Initialize it to zero, after creating the critical
5 sections used by the timer threads.
6 (term_timers): Set to 1 before deleting the critical sections.
7 (getitimer, setitimer): If disable_itimers is non-zero, return an
8 error indication without doing anything. Reported by Fabrice
9 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
10
11 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
12 term_ntproc after all the other bookkeeping, to get timers working
13 as long as possible.
14
82ef37c1
PE
152012-10-01 Paul Eggert <eggert@cs.ucla.edu>
16
b3a4c387
PE
17 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
18 Suggested by Juri Linkov in
19 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
20
b0ab8123
PE
21 Prefer plain 'static' to 'static inline' (Bug#12541).
22 With static functions, modern compilers inline pretty well by
23 themselves; advice from programmers often hurts as much as it helps.
24 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
25 this change shrinks the text size of the Emacs executable by 1.1%
26 without affecting CPU significantly in my benchmark.
27 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
28 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
29 (mark_maybe_object, mark_maybe_pointer, bounded_number):
30 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
31 (bset_auto_fill_function, bset_auto_save_file_format)
32 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
33 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
34 (bset_cache_long_line_scans, bset_case_fold_search)
35 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
36 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
37 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
38 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
39 (bset_header_line_format, bset_indicate_buffer_boundaries)
40 (bset_indicate_empty_lines, bset_invisibility_spec)
41 (bset_left_fringe_width, bset_major_mode, bset_mark)
42 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
43 (bset_name, bset_overwrite_mode, bset_pt_marker)
44 (bset_right_fringe_width, bset_save_length)
45 (bset_scroll_bar_width, bset_scroll_down_aggressively)
46 (bset_scroll_up_aggressively, bset_selective_display)
47 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
48 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
49 (set_buffer_overlays_after):
50 * category.c (bset_category_table):
51 * charset.c (read_hex):
52 * coding.c (produce_composition, produce_charset)
53 (handle_composition_annotation, handle_charset_annotation)
54 (char_encodable_p):
55 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
56 (assign_row, set_frame_matrix_frame, make_current)
57 (add_row_entry):
58 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
59 * fns.c (maybe_resize_hash_table):
60 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
61 * gmalloc.c (register_heapinfo):
62 * image.c (lookup_image_type):
63 * intervals.c (set_interval_object, set_interval_left)
64 (set_interval_right, copy_interval_parent, rotate_right)
65 (rotate_left, balance_possible_root_interval):
66 * keyboard.c (kset_echo_string, kset_kbd_queue)
67 (kset_keyboard_translate_table, kset_last_prefix_arg)
68 (kset_last_repeatable_command, kset_local_function_key_map)
69 (kset_overriding_terminal_local_map, kset_real_last_command)
70 (kset_system_key_syms, clear_event, set_prop):
71 * lread.c (digit_to_number):
72 * marker.c (attach_marker, live_buffer, set_marker_internal):
73 * nsterm.m (ns_compute_glyph_string_overhangs):
74 * process.c (pset_buffer, pset_command)
75 (pset_decode_coding_system, pset_decoding_buf)
76 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
77 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
78 (pset_status, pset_tty_name, pset_type, pset_write_queue):
79 * syntax.c (bset_syntax_table, dec_bytepos):
80 * terminal.c (tset_param_alist):
81 * textprop.c (interval_has_some_properties)
82 (interval_has_some_properties_list):
83 * window.c (wset_combination_limit, wset_dedicated)
84 (wset_display_table, wset_hchild, wset_left_fringe_width)
85 (wset_left_margin_cols, wset_new_normal, wset_new_total)
86 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
87 (wset_right_fringe_width, wset_right_margin_cols)
88 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
89 (wset_vertical_scroll_bar_type, wset_window_parameters):
90 * xdisp.c (wset_base_line_number, wset_base_line_pos)
91 (wset_column_number_displayed, wset_region_showing)
92 (window_box_edges, run_window_scroll_functions)
93 (append_glyph_string_lists, prepend_glyph_string_lists)
94 (append_glyph_string, set_glyph_string_background_width)
95 (append_glyph, append_composite_glyph)
96 (take_vertical_position_into_account):
97 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
98 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
99 (lface_hash, lface_same_font_attributes_p, lookup_face):
100 * xml.c (libxml2_loaded_p):
101 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
102 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
103 Now 'static', not 'static inline'.
104
05584c31
PE
105 * bidi.c: Tune.
106 (bidi_copy_it): Do the whole copy with a single memcpy.
107 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
108
86ec63ba
PE
109 Revert the FOLLOW-SYMLINKS change for file-attributes.
110 Doing it right would require several changes to Tramp, and there's
111 not enough time to get that tested before the freeze today.
112 * dired.c (directory_files_internal, Ffile_attributes):
113 Undo last change.
114
82ef37c1
PE
115 * frame.c (x_report_frame_params): Port better to wider ints.
116 Do not assume that EMACS_UINT is the same width as uprintmax_t,
117 or that pointers can be printed in 15 decimal digits.
118 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
119
62aba0d4
FP
1202012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
121
122 Support x64 build on MS-Windows.
123 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
124 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
125 compatibility with x64.
5e4daaf3 126 (x_get_focus_frame): Add prototype.
62aba0d4
FP
127
128 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
129 defining an XRectangle structure.
130
131 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
132 arithmetics for compatibility with x64.
133
134 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
135 compatibility with x64.
136
137 * w32heap.h: Adjust prototypes and declarations.
138
139 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
140 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
141 DWORD, long, and unsigned long, for compatibility with x64.
142 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
143 (sbrk): Argument is now of type ptrdiff_t.
144
145 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
146 less than 0x0500.
147 (w32_msg_pump): Use WPARAM type for 'result'.
148
149 * w32.c (init_environment, get_emacs_configuration): Support AMD64
150 architecture.
151 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
152 compatibility with x64.
153
154 * vm-limit.c (lim_data): Now size_t.
155 (check_memory_limits): Adjust prototypes of real_morecore and
156 __morecore to receive argument of type ptrdiff_t. Use size_t for
157 five_percent and data_size.
158
159 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
160 variables, for compatibility with x64.
161 (rva_to_section, offset_to_section, relocate_offset)
162 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
163 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
164 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
165 for compatibility with x64.
166
167 * sysdep.c (STDERR_FILENO): Define if not already defined.
168
169 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
170 (__morecore): Argument type is now ptrdiff_t.
171 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
172 (relinquish): Use ptrdiff_t type for 'excess'.
173 (r_alloc_sbrk): Argument type is now ptrdiff_t.
174
175 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
176 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
177 instead of a literal number.
178
179 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
180 (min): Define only if not already defined.
181
182 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
183 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
184 hosts.
185
186 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
187 'bitmaps' is a pointer.
188
189 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
190
191 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
192
e7a2937b
PE
1932012-09-30 Paul Eggert <eggert@cs.ucla.edu>
194
195 file-attributes has a new optional arg FOLLOW-SYMLINKS.
196 * dired.c (directory_files_internal, Ffile_attributes):
197 New arg follow_symlinks. All uses changed.
198
b43d62ae
SM
1992012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
200
201 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
202
c06c382a
EZ
2032012-09-30 Eli Zaretskii <eliz@gnu.org>
204
205 Support atimers and CPU profiler via profile.c on MS-Windows.
206 * w32proc.c (sig_mask, crit_sig): New static variables.
207 (sys_signal): Support SIGALRM and SIGPROF.
208 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 209 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
210 sigfillset, and sigprocmask are no longer no-ops.
211 (sigismember): New function.
212 (struct itimer_data): New definition.
213 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
214 (crit_prof): New static variables.
215 (MAX_SINGLE_SLEEP): New definition.
216 (timer_loop, stop_timer_thread, term_timers, init_timers)
217 (start_timer_thread, getitimer, setitimer): New functions.
218 (alarm): No longer a no-op, calls setitimer.
219
220 * w32.c (term_ntproc): Call term_timers.
221 (init_ntproc): Make sure all signals are unblocked at startup, to
222 erase any traces of dumping. Call init_timers.
223
224 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
225 Windows-specific code to display the hourglass mouse pointer is no
226 longer used.
227 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
228 to hourglass timer expiration.
229 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
230 Remove, no longer used.
b43d62ae
SM
231 (w32_note_current_window, show_hourglass, hide_hourglass):
232 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
233 window systems.
234 (syms_of_w32fns): Don't initialize hourglass_timer.
235
236 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
237 WINDOWSNT as well.
238 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
239
240 * w32.h (init_timers, term_timers): Add prototypes.
241
95402d5f
KH
2422012-09-30 Kenichi Handa <handa@gnu.org>
243
244 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
245 to the buffer relocation which may be caused by ccl_driver.
246
dd946752
JD
2472012-09-30 Jan Djärv <jan.h.d@swipnet.se>
248
d7e642cc
JD
249 * xfns.c (Fx_file_dialog): Update comment.
250
251 * w32fns.c (Fx_file_dialog): Update comment.
252
253 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
254 Initialize panel name field if OSX >= 10.6.
255
256 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
257
dd946752
JD
258 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
259
260 * nsterm.m (NEW_STYLE_FS): New define.
261 (ns_fullscreen_hook, windowWillEnterFullScreen)
262 (windowDidEnterFullScreen, windowWillExitFullScreen)
263 (windowDidExitFullScreen, toggleFullScreen, handleFS)
264 (setFSValue): New functions.
265 (EmacsFSWindow): New implementation.
266 (canBecomeKeyWindow): New function for EmacsFSWindow.
267 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
268 (dealloc): Release nonfs_window if in fullscreen.
269 (updateFrameSize:): Call windowDidMove to update top/left.
270 (windowWillResize:toSize:): Check if frame is still maximized.
271 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
272 next_maximized, maximized_width, maximized_height and nonfs_window.
273 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
274 tbar_height.
275 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
276 fullscreen. Set maximized_width/height. Act on next_maximized.
277
278 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
279 (EmacsView): Add variables for fullscreen.
280 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
281 (EmacsFSWindow): New interface for fullscreen.
282
427730eb
JB
2832012-09-30 Juanma Barranquero <lekktu@gmail.com>
284
285 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
286
48de8b12
CY
2872012-09-30 Chong Yidong <cyd@gnu.org>
288
289 * fns.c (Frandom): Doc fix.
290
5938d519
MR
2912012-09-30 Martin Rudalics <rudalics@gmx.at>
292
293 * window.c (Vwindow_combination_limit): New default value.
294 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
295
cb5b0266
PE
2962012-09-30 Paul Eggert <eggert@cs.ucla.edu>
297
298 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
299 Suggested by Eli Zaretskii in
300 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
301
84f72efd
EZ
3022012-09-30 Eli Zaretskii <eliz@gnu.org>
303
304 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
305 HAVE_TIMER_SETTIME is defined.
306
9d4dcdc9
PE
3072012-09-30 Paul Eggert <eggert@cs.ucla.edu>
308
d89460ed
PE
309 Profiler improvements: more-accurate timers, overflow checks.
310 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
311 signal.h, setjmp.h. Include systime.h instead.
312 (saturated_add): New function.
313 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
314 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
315 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
316 New static vars.
84f72efd 317 (enum profiler_cpu_running): New enum.
d89460ed
PE
318 (profiler_cpu_running): Now of that enum type, not bool.
319 All uses changed to store the new value.
320 (handle_profiler_signal): Rename from sigprof_handler_1,
321 for consistency with other handlers. Do not check whether
322 cpu_log is a hash-table if garbage collecting, since it
323 doesn't matter in that case.
324 (deliver_profiler_signal): Rename from sigprof_handler,
325 for consistency with other handlers.
326 (setup_cpu_timer): New function, with much of what used to be in
327 Fprofiler_cpu_start. Check for out-of-range argument.
328 Prefer timer_settime if available, and prefer
329 thread cputime clocks, then process cputime clocks, then
330 monotonic clocks, to the old realtime clock. Use make_timeval
331 to round more-correctly when falling back to setitimer.
332 (Fprofiler_cpu_start): Use it.
333 (Fprofiler_cpu_stop): Prefer timer_settime if available.
334 Don't assume that passing NULL as the 2nd argument of setitimer
335 is the same as passing a pointer to all-zero storage.
336 Ignore SIGPROF afterwards.
337 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
338 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
339 non-fatal signal handlers. Ignore SIGPROF on startup.
340 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
341 in profiler.c, since sysdep.c now uses it.
342
9d4dcdc9
PE
343 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
344 Suggested by Eli Zaretskii in
345 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
346
8e5691a0
JB
3472012-09-29 Juanma Barranquero <lekktu@gmail.com>
348
349 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
350
e7c1b6ef
SM
3512012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
352
353 * lisp.h (struct backtrace): Remove indirection for `function' field.
354 * xdisp.c (redisplay_internal):
355 * profiler.c (record_backtrace, sigprof_handler_1):
356 * alloc.c (Fgarbage_collect):
357 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
358 (Fbacktrace_frame): Adjust accordingly.
359
e61d39cd 3602012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
361
362 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
363 (Frun_hook_with_args_until_failure): Doc fixes.
364
404043ea
EZ
3652012-09-28 Eli Zaretskii <eliz@gnu.org>
366
367 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
368 Qautomatic_redisplay and change the symbol name. All users changed.
369
704d3f45
TM
3702012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
371
372 * profiler.c (sigprof_handler): Fix race condition.
373
757140ff
GM
3742012-09-28 Glenn Morris <rgm@gnu.org>
375
376 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
377
a615a3ae
PE
3782012-09-27 Paul Eggert <eggert@cs.ucla.edu>
379
380 Check more robustly for timer_settime.
89d17fd0
PE
381 * Makefile.in (LIB_TIMER_TIME): New macro.
382 (LIBES): Add it.
a615a3ae
PE
383 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
384 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
385 call timer_settime.
386
3670daf7
TM
3872012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
388
389 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
390
6a586b7f
JB
3912012-09-26 Juanma Barranquero <lekktu@gmail.com>
392
393 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
394
41c8bfcf
PE
3952012-09-26 Paul Eggert <eggert@cs.ucla.edu>
396
397 * character.h (MAYBE_UNIFY_CHAR): Remove.
398 * charset.c, charset.h (maybe_unify_char): Now static.
399 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
400 Since this stuff is now private to charset.c, there's no need for
401 a public macro and no need to inline by hand.
402
3a880af4
SM
4032012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
404 Stefan Monnier <monnier@iro.umontreal.ca>
405 Juanma Barranquero <lekktu@gmail.com>
611b7507 406
3a880af4
SM
407 * profiler.c: New file.
408 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
409 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
410 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
411 * emacs.c (main): Call syms_of_profiler.
412 * alloc.c (Qautomatic_gc): New constant.
413 (MALLOC_PROBE): New macro.
414 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
415 (total_bytes_of_live_objects): New function.
416 (Fgarbage_collect): Use it. Record itself in backtrace_list.
417 Call malloc_probe for the memory profiler.
418 (syms_of_alloc): Define Qautomatic_gc.
419 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
420 race condition.
421 (struct backtrace): Move definition...
422 * lisp.h (struct backtrace): ..here.
423 (Qautomatic_gc, profiler_memory_running): Declare vars.
424 (malloc_probe, syms_of_profiler): Declare functions.
425 * xdisp.c (Qautomatic_redisplay): New constant.
426 (redisplay_internal): Record itself in backtrace_list.
427 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 428
5938d519 4292012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
4302012-09-25 Juanma Barranquero <lekktu@gmail.com>
431
432 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
433
e26fd2e4
PE
4342012-09-25 Paul Eggert <eggert@cs.ucla.edu>
435
436 Prefer POSIX timers if available.
437 They avoid a race if the timer is too close to the current time.
438 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
439 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 440 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 441
eedec3ee
EZ
4422012-09-25 Eli Zaretskii <eliz@gnu.org>
443
444 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
445 CHAR_STRING_ADVANCE.
446 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
447 STRING_CHAR_ADVANCE.
448
aa15c6bb
JB
4492012-09-25 Juanma Barranquero <lekktu@gmail.com>
450
451 Move Vlibrary_cache to emacs.c and reset before dumping.
452
453 * lisp.h (reset_image_types): Declare.
454 [WINDOWSNT] (Vlibrary_cache): Declare.
455
456 * image.c (reset_image_types): New function.
457
458 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
459 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
460 (Fdump_emacs): Reset Vlibrary_cache and image_types.
461
462 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
463 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
464
465 * w32.h (Vlibrary_cache): Do not declare.
466
54d629be
EZ
4672012-09-25 Eli Zaretskii <eliz@gnu.org>
468
16b22fef
EZ
469 * w32proc.c (sys_signal): Handle all signals defined by the
470 MS-Windows runtime, not just SIGCHLD. Actually install the signal
471 handlers for signals supported by Windows. Don't override
472 term_ntproc as the handler for SIGABRT.
473 (sigaction): Rewrite to call sys_signal instead of duplicating its
474 code.
475 (sys_kill): Improve commentary.
476
477 * w32.c (term_ntproc): Accept (and ignore) one argument, for
478 consistency with a signature of a signal handler. All callers
479 changed.
480 (init_ntproc): Accept an argument DUMPING. If dumping, don't
481 install term_ntproc as a signal handler for SIGABRT, as that
482 should be done by the dumped Emacs.
483
484 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
485
486 * w32select.c (term_w32select): Protect against repeated
487 invocation by setting clipboard_owner to NULL after calling
488 DestroyWindow.
489
490 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
491 and term_ntproc to their modified signatures.
492
54d629be
EZ
493 * character.c (char_string, string_char): Remove calls to
494 MAYBE_UNIFY_CHAR. See the discussion starting at
495 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
496 for the details.
497
59f7af81
CY
4982012-09-25 Chong Yidong <cyd@gnu.org>
499
500 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
501
22e8cf4a
SM
5022012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
503
504 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
505 when encountering an unknown bytecode.
506
578098f3
PE
5072012-09-24 Paul Eggert <eggert@cs.ucla.edu>
508
509 image.c, indent.c: Use bool for booleans.
510 * dispextern.h (struct image_type): Members valid_p, load, init
511 now return bool, not int. All uses changed.
512 * image.c: Omit unnecessary static decls.
513 (x_create_bitmap_mask, x_build_heuristic_mask):
514 Return void, not int, since callers don't care about the return value.
515 (x_create_bitmap_mask, define_image_type, valid_image_p)
516 (struct image_keyword, parse_image_spec, image_spec_value)
517 (check_image_size, image_background)
518 (image_background_transparent, x_clear_image_1)
519 (postprocess_image, lookup_image, x_check_image_size)
520 (x_create_x_image_and_pixmap, xbm_image_p)
521 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
522 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
523 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
524 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
525 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
526 (png_image_p, init_png_functions, png_load_body, png_load)
527 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
528 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
529 (init_gif_functions, gif_load, imagemagick_image_p)
530 (imagemagick_load_image, imagemagick_load, svg_image_p)
531 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
532 (gs_load):
533 * nsimage.m (ns_load_image):
534 * nsterm.m (ns_defined_color):
535 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
536 * xfns.c (x_defined_color):
537 * xterm.c (x_alloc_lighter_color_for_widget)
538 (x_alloc_nearest_color_1, x_alloc_nearest_color)
539 (x_alloc_lighter_color):
540 * indent.c (disptab_matches_widthtab, current_column)
541 (scan_for_column, string_display_width, indented_beyond_p)
542 (compute_motion, vmotion, Fvertical_motion):
543 Use bool for booleans.
544
a5f2b6ec
CY
5452012-09-24 Chong Yidong <cyd@gnu.org>
546
547 * chartab.c (Fset_char_table_default): Obsolete function removed.
548
18e27ea8
PE
5492012-09-23 Paul Eggert <eggert@cs.ucla.edu>
550
afea8a8a
PE
551 Move pid_t related decls out of lisp.h.
552 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
553 (interruptible_wait_for_termination):
554 Move these decls from lisp.h to syswait.h, since they use pid_t.
555 Needed on FreeBSD; see Herbert J. Skuhra in
556 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
557 * callproc.c: Include syswait.h.
558
18e27ea8
PE
559 gnutls.c, gtkutil.c: Use bool for boolean.
560 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
561 (emacs_gnutls_handle_error):
562 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
563 (xg_hide_tooltip, xg_create_frame_widgets)
564 (create_dialog, xg_uses_old_file_dialog)
565 (xg_get_file_with_chooser, xg_get_file_with_selection)
566 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
567 (xg_item_label_same_p, xg_update_menubar)
568 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
569 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
570 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
571 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
572 (update_frame_tool_bar, free_frame_tool_bar):
573 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
574 * nsmenu.m (ns_update_menubar):
575 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
576 * xfns.c (Fx_show_tip) [USE_GTK]:
577 Use bool for boolean.
578 * gtkutil.c (xg_update_frame_menubar):
579 * xmenu.c (update_frame_menubar):
580 Return void, not int, since caller ignores return value.
581 * gtkutil.c (xg_change_toolbar_position):
582 Return void, not 1.
583
af0e9f75
JB
5842012-09-23 Juanma Barranquero <lekktu@gmail.com>
585
586 * makefile.w32-in (BLOCKINPUT_H): Remove.
587 (SYSSIGNAL_H): New macro.
588 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
589 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
590 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
591 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
592 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
593 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
594 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
595 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
596 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
597 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
598 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
599 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
600 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
601 ($(BLD)/w32xfns.$(O)): Update dependencies.
602
5101529e
EZ
6032012-09-23 Eli Zaretskii <eliz@gnu.org>
604
605 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
606 fatal_error_backtrace.
607
608 * w32proc.c (sys_kill): Undo last change: don't do anything when
609 invoked to deliver SIGABRT to our own process. This is now
610 handled by emacs_raise.
611
2c3ee0ad
JB
6122012-09-23 Juanma Barranquero <lekktu@gmail.com>
613
614 * w32term.c (w32_read_socket): Remove leftover reference to
615 interrupt_input_pending.
616
62a1d661
PE
6172012-09-23 Paul Eggert <eggert@cs.ucla.edu>
618
619 Do not use SA_NODEFER.
620 Problem reported by Dani Moncayo in
621 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
622 * alloc.c (die):
623 * sysdep.c (emacs_abort): Do not reset signal handler.
624 * emacs.c (terminate_due_to_signal): Reset signal handler here.
625 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
626 wanted even on POSIXish hosts, and it doesn't work on Windows.
627
a0942b9a
JD
6282012-09-23 Jan Djärv <jan.h.d@swipnet.se>
629
630 * xterm.c (x_term_init): Call fixup_locale before and after calling
631 gtk_init (Bug#12392).
632
d07ff9db
CY
6332012-09-23 Chong Yidong <cyd@gnu.org>
634
635 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
636 Vdynamic_library_alist.
637
638 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
639 (Fgnutls_available_p): Caller changed.
640
641 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
642 (Flibxml_parse_xml_region): Likewise.
643
644 * dispextern.h (struct image_type): Remove arg from init function.
645
646 * image.c (Finit_image_library, lookup_image_type)
647 (define_image_type): Remove now-unneeded second arg.
648 (init_xpm_functions, init_png_functions, init_jpeg_functions)
649 (init_tiff_functions, init_gif_functions, init_svg_functions):
650 Arglist and w32_delayed_load calling convention changed.
651 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 652 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 653
4d7e6e51
PE
6542012-09-23 Paul Eggert <eggert@cs.ucla.edu>
655
656 Simplify and avoid signal-handling races (Bug#12471).
657 * alloc.c (die):
658 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
659 Avoid recursive loop if there's a fatal error in the function itself.
660 * atimer.c (pending_atimers):
661 * blockinput.h: Don't include "atimer.h"; no longer needed.
662 (interrupt_input_pending): Remove. All uses removed.
663 pending_signals now counts both atimers and ordinary interrupts.
664 This is less racy than having three separate pending-signal flags.
665 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
666 (input_blocked_p):
667 Rename from their upper-case counterparts BLOCK_INPUT,
668 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
669 INPUT_BLOCKED_P, and turn into functions. All uses changed.
670 This makes it easier to access volatile variables more accurately.
671 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
672 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
673 that's more reliable if the code is buggy and sets
674 interrupt_input_blocked to a negative value. All uses changed.
675 * atimer.c (deliver_alarm_signal):
676 Remove. No need to deliver this to the parent; any thread can
677 handle this signal now. All uses replaced by underlying handler.
678 * atimer.c (turn_on_atimers):
679 * dispnew.c (handle_window_change_signal):
680 * emacs.c (handle_danger_signal):
681 * keyboard.c (kbd_buffer_get_event):
682 Don't reestablish signal handler; not needed with sigaction.
683 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
684 (UNBLOCK_INPUT_TO):
685 Rework to avoid unnecessary accesses to volatile variables.
686 (UNBLOCK_INPUT_TO): Now a function.
687 (totally_unblock_input, unblock_input): New decls.
688 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
689 (init_data): Remove. Necessary stuff now done in init_signal.
690 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
691 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
692 (fatal_error_code): Remove; no longer needed.
693 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
694 it doesn't always backtrace. All uses changed. No need to reset
695 signal to default, since sigaction and/or die does that for us now.
696 Use emacs_raise (FOO), not kill (getpid (), FOO).
697 (main): Check more-accurately whether we're dumping.
698 Move fatal-error setup to sysdep.c
699 * floatfns.c: Do not include "syssignal.h"; no longer needed.
700 * gtkutil.c (xg_get_file_name, xg_get_font):
701 Remove no-longer-needed signal-mask manipulation.
702 * keyboard.c, process.c (POLL_FOR_INPUT):
703 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
704 * keyboard.c (read_avail_input): Remove.
705 All uses replaced by gobble_input.
706 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
707 (kbd_buffer_store_event_hold, gobble_input):
708 (record_asynch_buffer_change) [USABLE_SIGIO]:
709 (store_user_signal_events):
710 No need to mess with signal mask.
711 (gobble_input): If blocking input and there are terminals, simply
712 set pending_signals to 1 and return. All hooks changed to not
713 worry about whether input is blocked.
714 (process_pending_signals): Clear pending_signals before processing
715 them, in case a signal comes in while we're processing.
716 By convention callers now test pending_signals before calling us.
717 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
718 New functions, to support changes to blockinput.h.
719 (handle_input_available_signal): Now extern.
720 (reinvoke_input_signal): Remove. All uses replaced by
721 handle_async_input.
722 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
723 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
724 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
725 Clear sigmask reliably, even if Fsignal returns, which it can.
726 Omit unnecessary accesses to volatile var.
727 (quit_throw_to_read_char): No need to restore sigmask.
728 * keyboard.c (gobble_input, handle_user_signal):
729 * process.c (wait_reading_process_output):
730 Call signal-handling code rather than killing ourselves.
731 * lisp.h: Include <float.h>, for...
732 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
733 (pending_signals): Now volatile.
734 (syms_of_data): Now const if IEEE floating point.
735 (handle_input_available_signal) [USABLE_SIGIO]:
736 (terminate_due_to_signal, record_child_status_change): New decls.
737 * process.c (create_process): Avoid disaster if memory is exhausted
738 while we're processing a vfork, by tightening the critical section
739 around the vfork.
740 (send_process_frame, process_sent_to, handle_pipe_signal)
741 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
742 ignores SIGPIPE.
743 (send_process): No need for setjmp/longjmp any more, since the
744 SIGPIPE stuff is now gone. Instead, report an error if errno
745 is EPIPE.
746 (record_child_status_change): Now extern. PID and W are now args.
747 Return void, not bool. All callers changed.
748 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
749 Remove. All uses removed. This bug should be fixed now in a
750 different way.
751 (wait_for_termination_1): Use waitpid rather than sigsuspend,
752 and record the child status change directly. This avoids the
753 need to futz with the signal mask.
754 (process_fatal_action): Move here from emacs.c.
755 (emacs_sigaction_flags): New function, containing
756 much of what used to be in emacs_sigaction_init.
757 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
758 caught by emacs, to make races less likely.
759 (deliver_process_signal): Rename from handle_on_main_thread.
760 All uses changed.
761 (BACKTRACE_LIMIT_MAX): Now at top level.
762 (thread_backtrace_buffer, threadback_backtrace_pointers):
763 New static vars.
764 (deliver_thread_signal, deliver_fatal_thread_signal):
765 New functions, for more-accurate delivery of thread-specific signals.
766 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
767 (deliver_arith_signal): Handle in this thread, not
768 in the main thread, since it's triggered by this thread.
769 (maybe_fatal_sig): New function.
770 (init_signals): New arg DUMPING so that we can be more accurate
771 about whether we're dumping. Caller changed.
772 Treat thread-specific signals differently from process-general signals.
773 Block all signals while handling fatal error; that's safer.
774 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
775 on IEEE hosts.
776 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
777 Ignore SIGPIPE unless batch.
778 (emacs_backtrace): Output backtrace for the appropriate thread,
779 which is not necessarily the main thread.
780 * syssignal.h: Include <stdbool.h>.
781 (emacs_raise): New macro.
782 * xterm.c (x_connection_signal): Remove; no longer needed
783 now that we use sigaction.
784 (x_connection_closed): No need to mess with sigmask now.
785 (x_initialize): No need to reset SIGPIPE handler here, since
786 init_signals does this for us now.
787
8f4635e9
JD
7882012-09-23 Jan Djärv <jan.h.d@swipnet.se>
789
790 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 791 background rect may be larger (Bug#12245).
8f4635e9 792
3296976d
CY
7932012-09-23 Chong Yidong <cyd@gnu.org>
794
795 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
796
d41e491e
PE
7972012-09-22 Paul Eggert <eggert@cs.ucla.edu>
798
799 * .gdbinit: Just stop at fatal_error_backtrace.
800 See Stefan Monnier's request in
801 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
802 Remove no-longer-used query of system type.
803
c88b867f
CY
8042012-09-22 Chong Yidong <cyd@gnu.org>
805
806 * search.c (Freplace_match): Doc fix (Bug#12325).
807
808 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
809
810 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
811 (Fline_end_position): Doc fix.
812
813 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
814
bb4d86b4
CY
8152012-09-22 Chong Yidong <cyd@gnu.org>
816
817 * dispextern.h (struct image_type): Add new slot, storing a type
818 initialization function.
819
820 * image.c (define_image_type): Call the image initializer function
821 if it is defined. Arguments and return value changed.
822 (valid_image_p, make_image): Callers changed.
823 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
824 (gif_type, imagemagick_type, svg_type, gs_type):
825 Add initialization functions.
bb4d86b4
CY
826 (Finit_image_library): Call lookup_image_type.
827 (CHECK_LIB_AVAILABLE): Macro deleted.
828 (lookup_image_type): Call define_image_type here, rather than via
829 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
830 (syms_of_image): Move define_image_type calls for xbm_type and
831 pbm_type to lookup_image_type.
832
df9685f3
EZ
8332012-09-22 Eli Zaretskii <eliz@gnu.org>
834
835 * keyboard.c (timer_check_2): Move calculation of 'timers' and
836 'idle_timers' from here ...
837 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
838 lists, to avoid infloops when the timer does something stupid,
839 like reinvoke itself with the same or smaller time-out.
840 (Bug#12447)
841
8e17c9ba
MR
8422012-09-22 Martin Rudalics <rudalics@gmx.at>
843
844 * window.c (Fsplit_window_internal): Handle only Qt value of
845 Vwindow_combination_limit separately.
846 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
847 (Vwindow_combination_limit): New default value.
848 Rewrite doc-string.
8e17c9ba 849
589bd69b
EZ
8502012-09-22 Eli Zaretskii <eliz@gnu.org>
851
852 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
853 the new overlay string. (Bug#10159)
854
01108e3f
PE
8552012-09-22 Paul Eggert <eggert@cs.ucla.edu>
856
857 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
858 or that fprintf is async-signal-safe. POSIX doesn't require
859 either assumption.
860
82f8cd94
CY
8612012-09-22 Chong Yidong <cyd@gnu.org>
862
863 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
864 (Bug#8207).
865
3cccbd87
KH
8662012-09-22 Kenichi Handa <handa@gnu.org>
867
868 * composite.c (composition_reseat_it): Handle the case that a
869 grapheme cluster is not covered by a single font (Bug#12352).
870
09c01941
CY
8712012-09-21 Chong Yidong <cyd@gnu.org>
872
873 * image.c (define_image_type): Avoid adding duplicate types to
874 image_types (Bug#12463). Suggested by Jörg Walter.
875
acfa068f 8762012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
877
878 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
879 (print_load_command_name): Add case LC_DATA_IN_CODE.
880 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
881
acfa068f 8822012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
883
884 * eval.c (Frun_hook_with_args_until_success)
885 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
886
acfa068f 8872012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
888
889 * fileio.c (Ffile_selinux_context): Only call freecon when
890 lgetfilecon succeeded.
891 (Fset_file_selinux_context): Likewise. (Bug#12444)
892
acfa068f 8932012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
894
895 * xdisp.c (try_window_reusing_current_matrix): Under bidi
896 reordering, locate the cursor by calling set_cursor_from_row; if
897 that fails, clear the desired glyph matrix before returning a
898 failure indication to the caller. Fixes leaving garbled display
899 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
900 (compute_stop_pos_backwards): Fix a typo that caused crashes while
901 scrolling through multibyte text.
aa36e4d2 902
e99f70c8
SM
9032012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
904
905 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
906 calling mark_vectorlike since that's the one that marks the window.
907 (mark_discard_killed_buffers): Mark the final cdr.
908 * window.h (struct window): Move prev/next_buffers to the
909 non-standard fields.
910 * window.c (make_window): Initialize prev/next_buffers manually.
911
f75beb47
PE
9122012-09-20 Paul Eggert <eggert@cs.ucla.edu>
913
914 Omit unused arg EXPECTED from socket hooks.
915 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
916 * nsterm.m (ns_term_init):
917 * termhooks.h (struct terminal.read_socket_hook):
918 * w32inevt.c (w32_console_read_socket):
919 * w32term.c (w32_read_socket):
920 * xterm.c (XTread_socket):
921 Omit unused arg EXPECTED. All callers changed.
922 (store_user_signal_events): Return void, not int, since callers no
923 longer care about the return value. All uses changed.
924
b019b76a
JB
9252012-09-20 Juanma Barranquero <lekktu@gmail.com>
926
927 * w32gui.h (XParseGeometry): Do not declare.
928
05642592
PE
9292012-09-19 Paul Eggert <eggert@cs.ucla.edu>
930
e4bce92a
PE
931 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
932 Ignore 'expected'. See Eli Zaretskii in
933 <http://bugs.gnu.org/12471#8> (last line).
934
05642592
PE
935 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
936 (XParseGeometry): Now static. Substitute extremal values for
937 values that are out of range.
938
e543ae91
JD
9392012-09-19 Jan Djärv <jan.h.d@swipnet.se>
940
941 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
942
943 * nsfns.m (XParseGeometry): Remove.
944 (Fx_create_frame): Call x_set_offset to correctly interpret
945 top_pos in geometry.
946
3a880af4 947 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
948 (Fx_parse_geometry): If there is a space in string, call
949 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
950
45ba16c7
EZ
9512012-09-17 Eli Zaretskii <eliz@gnu.org>
952
c8b9f1bc
EZ
953 * search.c (scan_buffer): Use character positions in calls to
954 region_cache_forward and region_cache_backward, not byte
955 positions. (Bug#12196)
956
b4c932a2
EZ
957 * w32term.c (w32_read_socket): Set pending_signals to 1, like
958 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
959
45ba16c7
EZ
960 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
961 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
962 emacs_blocked_malloc, now deleted.
963
eeceac93
PE
9642012-09-17 Paul Eggert <eggert@cs.ucla.edu>
965
966 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
967 The workaround was for improving performance on Solaris 2.4, but
968 is getting in the way now. Emacs will still work if someone is
969 still running Solaris 2.4 in a museum somewhere; Sun dropped
970 support for Solaris 2.4 in 2003.
971 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
972 * process.c (create_process) [HAVE_WORKING_VFORK]:
973 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
974 since Emacs no longer uses vfork on that platform.
975
78f83752
GM
9762012-09-17 Glenn Morris <rgm@gnu.org>
977
978 * emacs.c: Use COPYRIGHT.
979
634b8cac
PE
9802012-09-16 Paul Eggert <eggert@cs.ucla.edu>
981
0caaedb1
PE
982 Remove configure's --without-sync-input option (Bug#12450).
983 When auditing signal-handling in preparation for cleaning it up,
984 I found that SYNC_INPUT has race conditions and would be a real
985 pain to fix. Since it's an undocumented and deprecated
986 configure-time option, now seems like a good time to remove it.
987 Also see <http://bugs.gnu.org/11080#16>.
988 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
989 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
990 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
991 (malloc_hysteresis):
992 (check_depth) [XMALLOC_OVERRUN_CHECK]:
993 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
994 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
995 (dont_register_blocks, bytes_used_when_reconsidered)
996 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
997 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
998 [!SYSTEM_MALLOC && !SYNC_INPUT]:
999 Remove. All uses removed.
1000 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1001 implementation, one that depends on whether the new macro
1002 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1003 is defined.
1004 * atimer.c (run_timers, handle_alarm_signal):
1005 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1006 (handle_async_input, process_pending_signals)
1007 (handle_input_available_signal, init_keyboard):
1008 * nsterm.m (ns_read_socket):
1009 * process.c (wait_reading_process_output):
1010 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1011 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1012 (emacs_write):
1013 * xterm.c (XTread_socket):
1014 Assume SYNC_INPUT.
1015 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1016 * eval.c (handling_signal): Remove. All uses removed.
1017 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1018 All uses replaced with the SYNC_INPUT version.
1019 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1020 Remove decls.
1021 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1022 Now static.
1023
634b8cac
PE
1024 * font.c (Ffont_shape_gstring): Remove unused local.
1025
83da1b55
GM
10262012-09-16 Glenn Morris <rgm@gnu.org>
1027
518650a5
GM
1028 * Makefile.in (clean): No longer run nextstep's clean.
1029
83da1b55
GM
1030 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1031 (ns_frag): Remove.
1032 (ns-app): Move here from ns.mk, and simplify.
1033 (clean): Simplify nextstep entry.
1034 * ns.mk: Remove file.
1035
85a43e2e
KH
10362012-09-17 Kenichi Handa <handa@gnu.org>
1037
1038 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1039 not covert the last few charactes.
1040
ba13e616 10412012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
1042
1043 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1044 here, but just check the validity of glyphs in the glyph-string.
1045
a8c729af
MR
10462012-09-16 Martin Rudalics <rudalics@gmx.at>
1047
3a880af4
SM
1048 * window.c (Fwindow_parameter, Fset_window_parameter):
1049 Accept any window as argument (Bug#12452).
a8c729af 1050
c077c059
JD
10512012-09-16 Jan Djärv <jan.h.d@swipnet.se>
1052
1053 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1054 to ns_term_init to avoid memory leak.
1055
1056 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
1057 explicit retain/release.
1058 (ns_term_init): Only allow one display. Initialize outerpool and
1059 ns_*_types.
1060
39a57ad0
PE
10612012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1062
1063 Port _setjmp fix to POSIXish hosts as well as Microsoft.
1064 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
1065 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
1066 the Microsoft problem in a different way, by altering ../nt/config.nt.
1067
7105c8cb
EZ
10682012-09-15 Eli Zaretskii <eliz@gnu.org>
1069
1070 * w32xfns.c:
1071 * w32uniscribe.c:
1072 * w32term.c:
1073 * w32select.c:
1074 * w32reg.c:
1075 * w32proc.c:
1076 * w32menu.c:
1077 * w32inevt.c:
1078 * w32heap.c:
1079 * w32font.c:
1080 * w32fns.c:
1081 * w32console.c:
1082 * w32.c:
1083 * w16select.c: Remove inclusion of setjmp.h, as it is now included
1084 by lisp.h. This completes removal of setjmp.h inclusion
1085 erroneously announced in the previous commit. (Bug#12446)
1086
1087 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
1088 more accurate.
1089
1090 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
1091 not defined as a macro. The latter happens on MS-Windows.
1092 (Bug#12446)
1093
0328b6de
PE
10942012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1095
1096 Port better to POSIX hosts lacking _setjmp (Bug#12446).
1097 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 1098 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
1099 only reason for the instance was because "lisp.h" was included.
1100 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
1101 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
1102 and _longjmp with the new symbols. Emacs already uses _setjmp if
1103 available, so this change affects only POSIXish hosts that have
1104 sigsetjmp but not _setjmp, such as some versions of Solaris and
1105 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
1106 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
1107 (png_load_body) [HAVE_PNG]:
1108 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
1109 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
1110 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
1111 since PNG requires jmp_buf. This is the only exception to the
1112 general rule that we now use sys_setjmp and sys_longjmp.
1113 This exception is OK since this code does not change the signal
1114 mask or longjmp out of a signal handler.
1115
2af03429
PE
11162012-09-14 Paul Eggert <eggert@cs.ucla.edu>
1117
1118 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1119 Include "syssignal.h", for 'main_thread'.
1120
2f294edf
DA
11212012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
1122
1123 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
1124 * insdel.c (replace_range, replace_range_2):
1125 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
1126 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1127 Remove redundant check before calling offset_intervals.
1128
6b533e9c
MR
11292012-09-14 Martin Rudalics <rudalics@gmx.at>
1130
1131 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1132 current buffer (Bug#12387).
1133
2a7931e3
JB
11342012-09-14 Juanma Barranquero <lekktu@gmail.com>
1135
1136 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1137
c18e885b
PE
11382012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1139
1140 Use a more backwards-compatible timer format (Bug#12430).
1141 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1142 vector element, not from the 4th, since PSECS is now at the end.
1143 (Fcurrent_idle_time): Doc fix.
1144
d59a1afb
DA
11452012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
1146
1147 Function to mark objects and remove killed buffers at once.
1148 * alloc.c (discard_killed_buffers): Rename to ...
1149 (mark_discard_killed buffers) ... new name. Add marking
1150 of remaining objects. Fix comment. Adjust users.
1151 (mark_object): Do not touch frame buffer lists here.
1152 * frame.c (delete_frame): Reset frame buffer lists here.
1153
5f0cb45a
PE
11542012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1155
8ea47e3a
PE
1156 Better workaround for GNOME bug when --enable-gcc-warnings.
1157 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1158 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
1159 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1160
4a4bbad2
PE
1161 Simplify SIGIO usage (Bug#12408).
1162 The code that dealt with SIGIO was crufty and confusing, e.g., it
1163 played tricks like "#undef SIGIO" but these tricks were not used
1164 consistently. Simplify mostly by not #undeffing standard symbols,
1165 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1166 or not as we please) rather than "defined SIGIO" (standard symbol
1167 that we probably shouldn't #undef).
1168 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1169 Modules that need it can include it.
1170 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1171 * dispextern.h (ignore_sigio): New decl.
1172 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1173 unconditionally, since it's now a no-op if !USABLE_SIGIO.
1174 * emacs.c (shut_down_emacs):
1175 * keyboard.c (kbd_buffer_store_event_hold):
1176 Use ignore_sigio rather than invoking 'signal' directly.
1177 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1178 for FIONREAD.
1179 (FIONREAD, SIGIO): Do not #undef.
1180 (tty_read_avail_input): Use #error rather than a syntax error.
1181 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1182 for I_PIPE, used by SETUP_SLAVE_PTY.
1183 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1184 * sysdep.c (croak): Remove; no longer needed. This bit of
1185 temporary code, with Fred N. Fish's comment that it's temporary,
1186 has been in Emacs since at least 1992!
1187 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1188 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1189 * syssignal.h (croak): Remove decl.
1190 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1191 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1192 now that we're termios-only.
1193 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1194 * term.c (dissociate_if_controlling_tty): Use #error rather than
1195 a run-time error.
1196
5f0cb45a
PE
1197 Work around GCC and GNOME bugs when --enable-gcc-warnings.
1198 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1199 to work around GNOME bug 683906.
1200 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1201 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1202 This works around GCC bug 54561.
1203
40bce90b
PE
12042012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1205
1206 More fixes for 'volatile' and setjmp/longjmp.
1207 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1208 * image.c (struct png_load_context) [HAVE_PNG]: New type.
1209 (png_load_body) [HAVE_PNG]:
1210 (jpeg_load_body) [HAVE_JPEG]:
1211 New function, with most of the old parent function's body.
1212 (png_load) [HAVE_PNG]:
1213 (jpeg_load) [HAVE_JPEG]:
1214 Invoke the new function, to avoid longjmp munging our locals.
1215 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
1216 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
1217 longjmp is passed 2, as the C standard doesn't guarantee this.
1218 Instead, store the failure code into mgr->failure_code.
1219
bfeae2cf
SM
12202012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1221
1222 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
1223 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
1224 (syms_of_keyboard): Remove support for unread-command-char.
1225
8099e36b
EZ
12262012-09-12 Eli Zaretskii <eliz@gnu.org>
1227
1228 * w32proc.c (sys_kill): If PID is our process ID and the signal is
1229 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
1230 violation. (Bug#12426)
1231
92547ff9
PE
12322012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1233
1234 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
1235
45b82ad0
SM
12362012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1237
1238 * eval.c: Add `inhibit-debugger'.
1239 (Qinhibit_debugger): New symbol.
1240 (call_debugger): Bind it instead of Qdebug_on_error.
1241 (maybe_call_debugger): Test Vinhibit_debugger.
1242 (syms_of_eval): Define inhibit-debugger.
1243 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1244 (syms_of_xdisp): Remove inhibit-debug-on-message.
1245
5779a1dc
PE
12462012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1247
50f2e553
PE
1248 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1249 If a nonvolatile local variable is written before a _longjmp to
1250 the frame containing the variable, and is read after the _longjmp,
1251 the value read is indeterminate. Some local variables of type
1252 'struct handler' and 'struct catchtag' are used in this way, so
1253 mark each of their slots as volatile if the slot can be set before
1254 _longjmp and read afterwards.
1255 * lisp.h (struct handler): var and chosen_clause are now volatile.
1256 (struct catchtag): val, next, and pdlcount are now volatile.
1257
ae1d87e2
PE
1258 * bidi.c (bidi_push_it, bidi_pop_it):
1259 * fns.c (copy_hash_table):
1260 * image.c (define_image_type):
1261 * keyboard.c (kbd_buffer_store_event_hold):
1262 * process.c (Fprocess_send_eof):
1263 * xfaces.c (x_create_gc) [HAVE_NS]:
1264 * xgselect.c (xg_select):
1265 Prefer assignment to memcpy when either will do.
1266
5779a1dc
PE
1267 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1268 Use pointer-to-a-pointer to simplify and avoid a NILP check each
1269 time an item is removed. No need to mark this function 'inline';
1270 the compiler knows better than we do.
1271
c4c9756b
JD
12722012-09-11 Jan Djärv <jan.h.d@swipnet.se>
1273
1274 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1275 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1276 to change_frame_size (Bug#12388).
1277 (windowDidResize:): Pass YES to updateFrameSize.
1278
1279 * nsterm.h: Add delay parameter to updateFrameSize.
1280
d73e321c
DA
12812012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1282
1283 Discard killed buffers from deleted window and frame objects.
1284 This reduces an amount of references to killed buffers and
1285 helps GC to reclaim them faster.
1286 * alloc.c (discard_killed_buffers): New function.
1287 (mark_object): Use it for deleted windows and frames.
1288 (mark_object): If symbol's value is set up for a killed buffer
1289 or deleted frame, restore it's global binding.
1290 * data.c (swap_in_global_binding): Add GC notice.
1291 (swap_in_symval_forwarding): Use convenient set_blv_where.
1292 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1293 * window.h: ... to here.
1294
e578f381
DA
12952012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1296
1297 Convenient macro to check whether the buffer is live.
1298 * buffer.h (BUFFER_LIVE_P): New macro.
1299 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1300 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1301
3057e615
YM
13022012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1303
1304 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1305 composition cases (Bug#12364).
1306
1307 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1308 overhang of succeeding glyphs overlapping box cursor.
1309
1310 * w32term.c (x_draw_glyph_string): Likewise.
1311
6fda35f2
PE
13122012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1313
c990426a
PE
1314 Simplify, document, and port floating-point (Bug#12381).
1315 The porting part of this patch fixes bugs on non-IEEE platforms
1316 with frexp, ldexp, logb.
1317 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1318 Now static.
1319 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1320 support, by removing commented-out code and briefly listing the
1321 C89 functions excluded. The commented-out stuff was confusing
1322 maintenance, e.g., we thought we needed cbrt but it was commented out.
1323 (logb): Remove decl; no longer needed.
1324 (isfinite): New macro, if not already supplied.
1325 (isnan): Don't replace any existing macro.
1326 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1327 are present on all C89 platforms.
1328 (Ffrexp): Do not special-case zero, as frexp does the right thing
1329 for that case.
1330 (Flogb): Do not use logb, as it doesn't have the desired meaning
1331 on hosts that use non-base-2 floating point. Instead, stick with
1332 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1333 frexp, to avoid getting an unspecified result.
1334
6fda35f2
PE
1335 * xdisp.c (Qinhibit_debug_on_message): Now static.
1336
16130a58
JD
13372012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1338
1339 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1340 NSBezierPath (Bug#12131).
1341
d105a573
CY
13422012-09-10 Chong Yidong <cyd@gnu.org>
1343
1344 * fns.c (Fdelq, Fdelete): Doc fix.
1345
ff55dfe8
PE
13462012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1347
1348 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1349 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1350
e7032e7c
SM
13512012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1352
1353 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1354 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1355 Use it.
1356
e9957956
EZ
13572012-09-09 Eli Zaretskii <eliz@gnu.org>
1358
aba05ce9
EZ
1359 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1360 left fringe if the window has a left margin. This avoids leaving
1361 traces of the cursor because its leftmost pixel is not drawn over.
1362
e9957956
EZ
1363 * dispnew.c (update_window_line): When the left margin area of a
1364 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1365 that screen line. (Bug#12277)
1366
f6196b87
PE
13672012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1368
1369 Assume C89 or later for math functions (Bug#12381).
1370 This simplifies the code, and makes it a bit smaller and faster,
1371 and (most important) makes it easier to clean up signal handling
1372 since we can stop worring about floating-point exceptions in
1373 library code. That was a problem before C89, but the problem
1374 went away many years ago on all practical Emacs targets.
1375 * data.c, image.c, lread.c, print.c:
1376 Don't include <math.h>; no longer needed.
1377 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1378 might be autoconfigured, as that never happens.
1379 * data.c (fmod):
1380 * doprnt.c (DBL_MAX_10_EXP):
1381 * print.c (DBL_DIG):
1382 Remove. C89 or later always defines these.
1383 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1384 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1385 (arith_error, domain_error, domain_error2):
1386 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1387 no longer needed -- we simply return what C returns. All uses removed.
1388 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1389 the wrapped code.
1390 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1391 Remove. All uses expanded, as these macros are no longer used
1392 more than once and are now more trouble than they're worth.
1393 (Ftan): Use tan, not sin / cos.
1394 (Flogb): Assume C89 frexp.
1395 (fmod_float): Assume C89 fmod.
1396 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1397 (init_floatfns): Remove. All uses removed.
1398
9d7f1863
JD
13992012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1400
1401 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1402 compositeToPoint for OSX < 10.6 (Bug#12390).
1403
eabf0404
PE
14042012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1405
1406 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1407 This produces more-accurate results.
1408
0b3b1d23
JD
14092012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1410
1411 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1412 changes (Bug#12088).
1413
6dcef6ec
CY
14142012-09-08 Chong Yidong <cyd@gnu.org>
1415
1416 * syntax.c (Fstring_to_syntax): Doc fix.
1417
aa7d57c5
JD
14182012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1419
1420 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1421 in the internal border.
1422 (x_set_window_size): Remove static variables and their usage.
1423 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
1424 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1425 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
1426 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1427 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1428 (ns_fix_rect_ibw): Remove.
1429 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1430 (ns_dumpglyphs_box_or_relief): Ditto.
1431 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1432 adjustment.
1433 (ns_dumpglyphs_image): Ditto.
fc0c31f8 1434 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
1435 border adjustment.
1436 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1437 their usage. Add fringe_extended_p and its use as in other terms.
1438 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1439 scroll bar was removed.
1440 (updateFrameSize): New function.
1441 (windowDidResize): Move code to updateFrameSize and call it.
1442
1443 * nsterm.h (EmacsView): Add updateFrameSize.
1444
1a5432bc
CY
14452012-09-07 Chong Yidong <cyd@gnu.org>
1446
b4f5313e
CY
1447 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1448
1a5432bc
CY
1449 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1450
1a4f1e9b
PE
14512012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1452
1453 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
1454 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1455 Problem introduced when merging patches. Noted by Eli Zaretskii in
1456 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
1457 * floatfns.c: Comment fix.
1458 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1459 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1460 and anyway the declaration is harmless even if SIGDANGER is not defined.
1461 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1462 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1463 source files not surprisingly expected syssignal.h to define, or
1464 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1465 Include <sys/ioctl.h>, for FIONREAD.
1466 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1467 This eliminates a problem whereby other files mysteriously had
1468 to include "syssignal.h" before including "systty.h" if they
1469 wanted to use "#ifdef SIGIO".
1470
bc8000ff
EZ
14712012-09-07 Eli Zaretskii <eliz@gnu.org>
1472
3e6d6928
EZ
1473 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1474
1475 * w32.c (sigemptyset): Empty the set.
1476 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1477
bc8000ff
EZ
1478 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1479
b4fa72f2
DA
14802012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1481
1482 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1483 (mark_object): Likewise for frame objects.
1484
30730c93
PE
14852012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1486
1487 * syssignal.h (handle_on_main_thread): Always declare,
1488 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1489 This ports to platforms without HAVE_PTHREAD.
1490
2fe28299
PE
14912012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1492
1493 Signal-handler cleanup (Bug#12327).
1494 Emacs's signal handlers were written in the old 4.2BSD style with
1495 sigblock and sigmask and so forth, and this led to some
1496 inefficiencies and confusion. Rewrite these to use
1497 pthread_sigmask etc. without copying signal sets around. Also,
1498 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1499 'signal', and instead use functions that do not attempt to take
1500 over the system name space. This patch causes Emacs's text
1501 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1502 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1503 Do not include <signal.h> or "syssignal.h", as these
1504 modules do not use signals.
1505 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1506 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1507 Do not include <signal.h>, as "syssignal.h" does that for us now.
1508 * atimer.c (sigmask_atimers): New function.
1509 (block_atimers, unblock_atimers): New functions,
1510 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1511 All uses replaced.
1512 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1513 no longer needed here.
1514 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 1515 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
1516 * sysdep.c (struct save_signal): New member 'action', replacing
1517 old member 'handler'.
1518 (save_signal_handlers, restore_signal_handlers):
1519 Use sigaction instead of 'signal' to save and restore.
1520 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1521 New function. All users of 'signal' modified to use set_sighandler
1522 if they're writeonly, and to use sys_signal if they're read+write.
1523 (emacs_sigaction_init, forwarded_signal): New functions.
1524 (sys_signal): Remove. All uses replaced by calls to sigaction
1525 and emacs_sigaction_init, or by direct calls to 'signal'.
1526 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1527 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1528 all uses replaced by pthread_sigmask etc. calls.
1529 * syssignal.h: Include <signal.h>.
1530 (emacs_sigaction_init, forwarded_signal): New decls.
1531 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1532 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1533 (sigmask, sys_sigmask): Remove; no longer needed.
1534 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1535 (sigblock, sigunblock, sigfree):
1536 (sigsetmask) [!defined sigsetmask]:
1537 Remove. All uses replaced by pthread_sigmask.
1538 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1539 no longer need to be replaced, and its typical old uses
1540 are now done via emacs_sigaction_init and sigaction.
1541 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1542 (sys_sigdel): Remove; unused.
1543 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1544
0216c128
EZ
15452012-09-06 Eli Zaretskii <eliz@gnu.org>
1546
1547 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1548 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1549
c752cfa9
DA
15502012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1551
1552 Explicitly mark buffer_defaults and buffer_local_symbols.
1553 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1554 mark_local_symbols here.
1555 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1556 since special buffers aren't marked here any more.
1557 (allocate_buffer): Chain new buffer with all_buffers here...
1558 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1559 not here.
1560 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1561 (syms_of_buffer): Remove staticpro of the above.
1562 (init_buffer_once): Set names for buffer_defaults and
1563 buffer_local_symbols.
1564
a864ef14
PE
15652012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1566
1567 Use bool for booleans in font-related modules.
1568 * font.c (font_intern_prop, font_style_to_value)
1569 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1570 (generate_otf_features, font_check_otf_features, font_check_otf)
1571 (font_match_p, font_list_entities, font_at):
1572 * fontset.c (fontset_id_valid_p, reorder_font_vector
1573 (fontset_find_font, Fset_fontset_font)
1574 (face_suitable_for_char_p) [0]:
1575 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1576 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1577 (m17n_flt_initialized, ftfont_shape_by_flt):
1578 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1579 * nsfont.m (nsfont_draw):
1580 * w32font.c (w32font_draw):
1581 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1582 Use bool for booleans.
1583 * font.h: Adjust to above API changes.
1584 (struct font, struct font_driver, struct font_driver_list):
1585 Use bool for booleans.
1586 (struct font): Remove useless member encoding_type.
1587 All users removed.
1588 * fontset.c, xftfont.c: Omit unnecessary static decls.
1589
0699fc18
DA
15902012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1591
1592 * alloc.c (mark_object): Revert window marking code
1593 since it's unsafe for the Fset_window_configuration.
1594
20ef56db
PE
15952012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1596
2fe28299 1597 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
1598 Be more systematic about preserving errno whenever a signal
1599 handler returns, even if it's not in the main thread. Do this by
1600 renaming signal handlers to distinguish between signal delivery
1601 and signal handling. All uses changed.
1602 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1603 * data.c (deliver_arith_signal): Rename from arith_error.
1604 * dispnew.c (deliver_window_change_signal): Rename from
1605 window_change_signal.
1606 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1607 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1608 * keyboard.c (deliver_input_available_signal): Rename from
1609 input_available_signal.
1610 (deliver_user_signal): Rename from handle_user_signal.
1611 (deliver_interrupt_signal): Rename from interrupt_signal.
1612 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1613 (deliver_child_signal): Rename from sigchld_handler.
1614 * atimer.c (handle_alarm_signal):
1615 * data.c (handle_arith_signal):
1616 * dispnew.c (handle_window_change_signal):
1617 * emacs.c (handle_fatal_signal, handle_danger_signal):
1618 * keyboard.c (handle_input_available_signal):
1619 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1620 * process.c (handle_pipe_signal, handle_child_signal):
1621 New functions, with the actual signal-handling code taken from the
1622 original respective signal handlers, sans the sporadic attempts to
1623 preserve errno, since that's now done by handle_on_main_thread.
1624 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1625 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1626 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1627 Move to sysdep.c.
1628 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1629 Move initialization of main_thread to sysdep.c's init_signals.
1630 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1631 our usage, and simplifies the mainline code.
1632 (record_child_status_change): New static function, as a helper
1633 for handle_child_signal, and with most of the old child handler's
1634 contents.
1635 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1636 (handle_child_signal): Use the above.
1637 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1638 Moved here from emacs.c.
1639 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1640 code moved here from emacs.c's main function.
1641 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
1642 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
1643 This lets callers save and restore errno properly.
20ef56db 1644
e3ccf108
DA
16452012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1646
1647 Remove redundant or unused things here and there.
1648 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1649 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1650 * editfns.c (Fcompare_buffer_substrings): Likewise.
1651 * frame.h (struct terminal, struct font_driver_list):
1652 Remove redundant declarations.
1653 * window.h (Qleft, Qright): Likewise.
1654
697e1e39
DA
16552012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1656
1657 Do not mark objects from deleted buffers, windows and frames.
1658 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1659 (mark_object): Likewise for windows and frames.
1660
c1ca42ca
DA
16612012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1662
1663 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1664 buffer_defaults and buffer_local_symbols as valid objects.
1665 Return special value to denote them.
1666
014d93be
PE
16672012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1668
f75d7a91
PE
1669 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1670 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1671 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1672 (file_name_absolute_p, Fsubstitute_in_file_name):
1673 (check_executable, check_writable, Ffile_accessible_directory_p)
1674 (Fset_file_selinux_context, Fdefault_file_modes)
1675 (Finsert_file_contents, choose_write_coding_system)
1676 (Fwrite_region, build_annotations, a_write, e_write)
1677 (Fdo_auto_save):
1678 * filelock.c (boot_time_initialized, get_boot_time)
1679 (get_boot_time_1, lock_file_1, within_one_second):
1680 * floatfns.c (in_float):
1681 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1682 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1683 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1684 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1685 * window.c (compare_window_configurations):
1686 Use bool for booleans.
1687 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1688 (Fdefault_file_modes): Now mode_t, not int, for modes.
1689 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1690 (internal_delete_file): Now returns void, not a (boolean) int,
1691 since nobody was looking at the return value.
1692 * lisp.h, window.h: Adjust to above API changes.
1693
014d93be
PE
1694 * xdisp.c (set_message): Simplify and reindent last change.
1695
776f29e1
JB
16962012-09-05 Juanma Barranquero <lekktu@gmail.com>
1697
1698 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1699
7f7e0167
LI
17002012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1701
1702 * eval.c (call_debugger): Make the function non-static so that we
1703 can call it from set_message.
1704
1705 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1706 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1707
cf29dd84
PE
17082012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1709
1710 Give more-useful info on a fatal error (Bug#12328).
1711 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1712 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1713 of doing the work ourselves.
1714 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1715 do most of the work.
1716 (fatal_error_backtrace): New function, taken from the guts
1717 of the old fatal_error_signal, but with a new option to output
1718 a backtrace.
1719 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1720 info about the signal than just its number.
1721 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1722 * sysdep.c: Include <execinfo.h>
1723 (emacs_backtrace): New function, taken partly from the previous
1724 code of the 'die' function.
1725 (emacs_abort): Call fatal_error_backtrace rather than abort.
1726
972debf2
SM
17272012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1728
1729 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1730 eager (load-time) macro-expansion.
1731 * lisp.mk (lisp): Add macroexp.
1732
1088b922
PE
17332012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1734
1735 Simplify redefinition of 'abort' (Bug#12316).
1736 Do not try to redefine the 'abort' function. Instead, redo
1737 the code so that it calls 'emacs_abort' rather than 'abort'.
1738 This removes the need for the NO_ABORT configure-time macro
1739 and makes it easier to change the abort code to do a backtrace.
1740 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1741 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1742 Remove; sysdep.c's emacs_abort now takes its place.
1743 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1744 'abort' changed to use 'emacs_abort'.
1745 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1746 (abort) [!defined abort]: Rename to ...
1747 (emacs_abort): ... new name.
1748 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1749 the place of the old 'abort' in emacs.c.
1750 * w32.c, w32fns.c (abort): Do not #undef.
1751 * w32.c (emacs_abort): Rename from w32_abort.
1752
30934d33
EZ
17532012-09-04 Eli Zaretskii <eliz@gnu.org>
1754
1755 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1756 offsets[j].dv, since the y axis of the screen coordinates points
1757 down, while the y axis of the font definition coordinates points
1758 up. This fixes display of Arabic diacritics such as KASRA and
1759 KASRATAN. (Bug#11860)
1760
af26b72c
PE
17612012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1762
1763 Be more systematic about _setjmp vs setjmp.
1764 * alloc.c (test_setjmp, mark_stack):
1765 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1766 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1767 (png_load, my_error_exit, jpeg_load):
1768 * process.c (send_process_trap, send_process):
1769 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1770 The underscored versions are up to 30x faster on some hosts.
1771 Formerly, the code used setjmp+longjmp sometimes and
1772 _setjmp+_longjmp at other times, with no particular reason to
1773 prefer setjmp+longjmp.
1774
26d4541d
PE
17752012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1776
d42f4f0f 1777 Fix minor problem found by static checking.
26d4541d 1778 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 1779
c5e28e39
MR
17802012-09-03 Martin Rudalics <rudalics@gmx.at>
1781
1782 * buffer.c (Fdelete_all_overlays): New function.
1783
3eab3ca9
CY
17842012-09-03 Chong Yidong <cyd@gnu.org>
1785
1786 * gtkutil.c: Add extern decl for Qxft.
1787
c04889f8
PE
17882012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1789
1882aa38
PE
1790 * emacs.c, eval.c: Use bool for boolean.
1791 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1792 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1793 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1794 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1795 (main, decode_env_path, Fdaemon_initialized):
1796 * eval.c (call_debugger, Finteractive_p, interactive_p):
1797 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1798 (maybe_call_debugger, Fbacktrace):
1799 * process.c (read_process_output, exec_sentinel):
1800 Use bool for booleans.
1801 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1802 All callers changed.
1803 * eval.c (interactive_p): Omit always-true boolean argument
1804 EXCLUDE_SUBRS_P. All callers changed.
1805 * dispextern.h, lisp.h: Reflect above API changes.
1806 * firstfile.c (dummy): Use the address of 'main', whose signature
1807 won't change, instead of the address of 'initialize', whose
1808 signature just changed from int to bool.
1809 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1810 * msdos.c (fatal_error_in_progress): ... from here.
1811 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1812 of incrementing it.
1813 (redisplay_internal, unwind_redisplay): Simply clear
1814 REDISPLAYING_P when unwinding, instead of saving its previous,
1815 always-false value and then restoring it.
1816
a411ac43
PE
1817 Clean up some extern decls.
1818 Mostly, this hoists extern decls out of .c files and into .h files.
1819 That way, we're more likely to catch errors if the interfaces change.
1820 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1821 declare xg_mark_data.
1822 * dispextern.h (x_frame_parm_handlers):
1823 * font.h (Qxft):
1824 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1825 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1826 (Qultra_bold, Qoblique, Qitalic):
1827 Move extern decl here from .c file.
1828 * alloc.c (xg_mark_data) [USE_GTK]:
1829 * doc.c (Qclosure):
1830 * eval.c (Qlexical_binding):
1831 * fns.c (time) [!HAVE_UNISTD_H]:
1832 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1833 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1834 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1835 * lread.c (Qinternal_interpreter_environment):
1836 * minibuf.c (Qbuffer):
1837 * process.c (QCfamily, QCfilter):
1838 * widget.c (free_frame_faces):
1839 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1840 * xfont.c (x_clear_errors):
1841 * xterm.c (x_frame_parm_handlers):
1842 Remove now-redundant extern decls.
1843 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1844 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1845 Now static.
1846 * xfaces.c: Remove unnecessary static decls.
1847 * xterm.c (updating_frame): Remove decl of nonexistent object.
1848
c04889f8
PE
1849 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1850 when building globals.h, as the objects that are not built on
1851 this host are not needed to compile C files on this host.
1852
8b339673
JD
18532012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1854
1855 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1856
1857 * frame.h: Add missing prototype for x_wm_set_size_hint.
1858
a08d4ba7
PE
18592012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1860
1861 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1862 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1863 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1864 (Fsubstitute_command_keys):
1865 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1866 (save_excursion_save, save_excursion_restore)
1867 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1868 (format_time_string, general_insert_function)
1869 (make_buffer_string, make_buffer_string_both)
1870 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1871 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1872 (copy_text, insert_1, insert_1_both, insert_from_string)
1873 (insert_from_string_before_markers, insert_from_string_1)
1874 (insert_from_buffer, insert_from_buffer_1, replace_range)
1875 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1876 (del_range_2, modify_region):
1877 * intervals.c (intervals_equal, balance_possible_root_interval)
1878 (adjust_intervals_for_insertion, merge_properties_sticky)
1879 (graft_intervals_into_buffer, lookup_char_property)
1880 (adjust_for_invis_intang, set_point_both)
1881 (get_property_and_range, compare_string_intervals)
1882 (set_intervals_multibyte_1, set_intervals_multibyte):
1883 * keyboard.c (decode_timer):
1884 Use bool for boolean.
1885 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1886 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1887
48c948de
CY
18882012-09-02 Chong Yidong <cyd@gnu.org>
1889
1890 * keymap.c (push_key_description): Print M-TAB as C-M-i
1891 (Bug#11758).
1892
6c49a40b
JB
18932012-09-02 Juanma Barranquero <lekktu@gmail.com>
1894
1895 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1896 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1897 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1898 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1899 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1900 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1901 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1902
4dfbd238
EZ
19032012-09-01 Eli Zaretskii <eliz@gnu.org>
1904
7e510e28
EZ
1905 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1906 more than one grapheme cluster passed to the shaper: compute the
1907 offset adjustment values separately for each cluster. (Bug#11860)
1908
4dfbd238
EZ
1909 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1910 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1911 about implicit conversions from integer to pointer.
1912
86571ae0
DC
19132012-09-01 Daniel Colascione <dancol@dancol.org>
1914
1915 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1916 system used too early.
1917
0e23ef9d
PE
19182012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1919
1920 Better seed support for (random).
1921 * emacs.c (main): Call init_random.
1922 * fns.c (Frandom): Set the seed from a string argument, if given.
1923 Remove long-obsolete Gentzel cruft.
1924 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1925 (init_random): New function.
1926
17a2cbbd
DC
19272012-09-01 Daniel Colascione <dancol@dancol.org>
1928
1929 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1930 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1931 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1932 x_wm_set_size_hint, x_query_colors, x_real_positions,
1933 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1934 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1935 all of which have been moved to common code.
1936
1937 * xfaces.c: Include TERM_HEADER instead of listing all possible
1938 window-system headers.
1939
1940 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1941 to match header.
1942
1943 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1944 directly accessing frame internals.
1945
f18cbb28 1946 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
1947 globals_of_w32font.
1948
1949 * process.c: Include TERM_HEADER instead of listing all possible
1950 window-system headers.
1951
3a880af4
SM
1952 * nsterm.h: Remove declarations now in frame.h.
1953 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
1954
1955 * menu.c: Include TERM_HEADER instead of listing all possible
1956 window-system headers.
1957
1958 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1959 window system.
1960
1961 * keyboard.c: Include TERM_HEADER instead of listing all possible
1962 window-system headers.
1963
1964 * image.c: Include TERM_HEADER instead of listing all possible
1965 window-system headers. Declare Vlibrary_cache when compiling for
1966 Windows.
1967
1968 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1969 window system declarations.
1970
1971 * frame.h: Move common functions here: set_frame_menubar,
1972 x_set_window_size, x_sync, x_get_focus_frame,
1973 x_set_mouse_position, x_set_mouse_pixel_position,
1974 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1975 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1976 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1977 x_activate_menubar, x_real_positions, x_bitmap_icon,
1978 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1979 and x_query_colors.
1980
1981 * frame.c: Include TERM_HEADER instead of listing all possible
1982 window-system headers.
1983
1984 * font.c: Include TERM_HEADER instead of listing all possible
1985 window-system headers.
1986
1987 * emacs.c: Include TERM_HEADER.
1988
f18cbb28
EZ
1989 * dispnew.c: Include TERM_HEADER instead of listing all possible
1990 window-system headers.
17a2cbbd 1991
f18cbb28 1992 * ccl.h: Include character.h.
17a2cbbd
DC
1993
1994 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1995 the current window system; include in list of objects to link into
1996 Emacs.
1997
c650a5de
DA
19982012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1999
2000 Remove mark_ttys function and fix tty_display_info initialization.
2001 * lisp.h (mark_ttys): Remove prototype.
2002 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2003 to mark_ttys because all possible values of 'top_frame' slot are
2004 the frames which are reachable from Vframe_list.
2005 * term.c (mark_ttys): Remove.
2006 (init_tty): Safely initialize 'top_frame' slot with Qnil.
2007
4e0f6479
DA
20082012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2009
2010 Change struct frame bitfields from unsigned char to unsigned.
2011 * frame.h (struct frame): Change type of 'display_preempted',
2012 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2013 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2014 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2015 bitfields from unsigned char to unsigned.
2016
8b96a52c
DA
20172012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2018
2019 Remove unused member of struct x_output and struct w32_output.
2020 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2021 * w32term.h (struct w32_output): Likewise.
2022
b4444c8a
JD
20232012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2024
2025 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2026 does not become zero (Bug#12234).
2027
b98521db
PE
20282012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2029
2030 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2031 for GCC 4.7.1 x86-64.
2032
31d02438
GM
20332012-08-30 Glenn Morris <rgm@gnu.org>
2034
2035 * lread.c (init_lread): For out-of-tree builds, only add the
2036 source directory's site-lisp dir to the load-path if it exists,
2037 consistent with in-tree builds. (Bug#12302)
2038
7f8941d8
JD
20392012-08-28 Jan Djärv <jan.h.d@swipnet.se>
2040
2041 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 2042 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
2043 (windowShouldClose:): Set window_closed.
2044 (dealloc): New member, free button_values.
fc0c31f8
JB
2045 (process_dialog:): Make member function. Remove window argument,
2046 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
2047 in button_values.
2048 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 2049 with tag. Remove return self, declare return value as void.
7f8941d8
JD
2050 (addString:row:): Remove return self, declare return value as void.
2051 (addSplit): Remove return self, declare return value as void.
2052 (clicked:): Remove return self, declare return value as void.
fc0c31f8 2053 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
2054 (initFromContents:isQuestion:): Adjust call to process_dialog.
2055 Code formatting change.
2056 (timeout_handler:): Set timer_fired to YES.
2057 (runDialogAt:): Set timer_fired to NO.
2058 Handle click on close button as quit.
2059
2060 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
2061 Add window_closed and button_values. Add void as return value for
2062 add(Button|String|Split). addButton takes int instead of Lisp_Object.
2063 Add process_dialog as new member.
2064
eada0861 20652012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 2066
eada0861
GM
2067 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
2068 is not one of the heaps we manage. (Bug#12242)
2069
20702012-08-28 Glenn Morris <rgm@gnu.org>
2071
2072 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
2073
457294dd
MR
20742012-08-28 Martin Rudalics <rudalics@gmx.at>
2075
2076 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
2077 auto-buffer-name window parameter. Install revision of reverted
2078 fix.
457294dd 2079
4f2daf31
DA
20802012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2081
2082 Do not allow to set major mode for a dead buffer.
2083 * buffer.c (Fset_buffer_major_mode): Signal an error
2084 if the buffer is dead.
2085 (Fother_buffer, other_buffer_safely): Remove redundant
2086 nested declaration.
2087
66322887
DA
20882012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2089
2090 Always use set_buffer_if_live to restore original buffer at unwind.
2091 * buffer.h (record_unwind_current_buffer): New function.
2092 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
2093 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
2094 * undo.c, window.c: Adjust users.
2095 * buffer.c (set_buffer_if_live): Fix comment.
2096
a3d794a1
DA
20972012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2098
2099 Fix usage of set_buffer_internal.
2100 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
2101 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
2102 * coding.c (decode_coding): Omit redundant test.
2103 * fileio.c (decide_coding_unwind): Likewise.
2104 * fns.c (secure_hash): Likewise.
2105 * insdel.c (modify_region): Likewise.
2106 * keyboard.c (command_loop_1): Likewise.
2107 * print.c (PRINTFINISH): Likewise.
2108 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
2109
59ea14cd
PE
21102012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2111
2112 * dispnew.c: Use bool for boolean.
2113 (frame_garbaged, display_completed, delayed_size_change)
2114 (fonts_changed_p, add_window_display_history)
2115 (add_frame_display_history, verify_row_hash)
2116 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
2117 (row_equal_p, realloc_glyph_pool)
2118 (allocate_matrices_for_frame_redisplay)
2119 (showing_window_margins_p)
2120 (adjust_frame_glyphs_for_frame_redisplay)
2121 (build_frame_matrix_from_leaf_window, make_current)
2122 (mirrored_line_dance, mirror_line_dance, update_frame)
2123 (update_window_tree, update_single_window)
2124 (check_current_matrix_flags, update_window, update_text_area)
2125 (update_window_line, set_window_update_flags, scrolling_window)
2126 (update_frame_1, scrolling, buffer_posn_from_coords)
2127 (do_pending_window_change, change_frame_size)
2128 (change_frame_size_1, sit_for):
2129 Use bool for boolean.
2130 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2131 and remove last int (actually boolean) argument, which was always 0.
2132 All callers changed.
2133 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2134 * dispextern.h (struct composition_it): Use bool for boolean.
2135 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2136 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2137 * dired.c (file_name_completion):
2138 Use bool for boolean. (This was missed in an earlier change.)
2139
95072a94
MR
21402012-08-27 Martin Rudalics <rudalics@gmx.at>
2141
2142 * window.c (Fset_window_configuration): Revert first part of
2143 last change.
2144
0f19feff
JD
21452012-08-27 Jan Djärv <jan.h.d@swipnet.se>
2146
2147 * nsterm.h (NSPanel): New class variable dialog_return.
2148
3a880af4
SM
2149 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2150 Initialize dialog_return.
0f19feff
JD
2151 (windowShouldClose:): Use stop instead of stopModalWithCode.
2152 (clicked:): Ditto, and also set dialog_return (Bug#12258).
2153 (timeout_handler:): Use stop instead of abortModal. Send a dummy
2154 event.
2155 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
2156 modal loop returns.
2157
f10fe38f
PE
21582012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2159
de1339b0
PE
2160 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2161 * composite.c (find_composition, composition_gstring_p)
2162 (composition_reseat_it, find_automatic_composition):
2163 * data.c (let_shadows_buffer_binding_p)
2164 (let_shadows_global_binding_p, set_internal, make_blv)
2165 (Fmake_variable_buffer_local, Fmake_local_variable)
2166 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2167 (cons_to_signed, arith_driver):
2168 * dbusbind.c (xd_in_read_queued_messages):
2169 * dired.c (directory_files_internal, file_name_completion):
2170 Use bool for booleans.
2171 * dired.c (file_name_completion):
2172 * process.h (fd_callback):
2173 Omit int (actually boolean) argument. It wasn't being used.
2174 All uses changed.
2175 * composite.h, lisp.h: Reflect above API changes.
2176
f10fe38f
PE
2177 * cmds.c, coding.c: Use bool for booleans.
2178 * cmds.c (move_point, Fself_insert_command):
2179 * coding.h (struct composition status, struct coding_system):
2180 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2181 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2182 (emacs_mule_char, decode_coding_emacs_mule)
2183 (encode_coding_emacs_mule, detect_coding_iso_2022)
2184 (decode_coding_iso_2022, encode_invocation_designation)
2185 (encode_designation_at_bol, encode_coding_iso_2022)
2186 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2187 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2188 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2189 (encode_coding_raw_text, detect_coding_charset)
2190 (decode_coding_charset, encode_coding_charset, detect_eol)
2191 (detect_coding, get_translation_table, produce_chars)
2192 (consume_chars, reused_workbuf_in_use)
2193 (make_conversion_work_buffer, code_conversion_save)
2194 (decode_coding_object, encode_coding_object)
2195 (detect_coding_system, char_encodable_p)
2196 (Funencodable_char_position, code_convert_region)
2197 (code_convert_string, code_convert_string_norecord)
2198 (Fset_coding_system_priority):
2199 * fileio.c (Finsert_file_contents):
2200 Use bool for booleans.
2201 * coding.h, lisp.h: Reflect above API changes.
2202 * coding.c: Remove unnecessary static function decls.
2203 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2204 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2205 not a boolean 'int', since callers never look at the return value.
2206 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2207 * coding.h (decoding_buffer_size, encoding_buffer_size)
2208 (emacs_mule_string_char): Remove unused extern decls.
2209 (struct iso_2022_spec, struct coding_system):
2210 Use 'unsigned int : 1' for boolean fields, since there's more than one.
2211 (struct emacs_mule_spec): Remove unused field 'full_support'.
2212 All initializations removed.
2213 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2214
5474c384
DA
22152012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2216
f10fe38f 2217 Fix spare memory change (Bug#12286).
5474c384
DA
2218 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
2219 (valid_lisp_object_p): Likewise.
2220
c4b6914d
MR
22212012-08-27 Martin Rudalics <rudalics@gmx.at>
2222
2223 * window.c (Fset_window_configuration): Record any window's old
2224 buffer if it's replaced (see Bug#8789). If the new current
2225 buffer doesn't appear in the selected window, go to its old
2226 point (Bug#12208).
2227
35aaa1ea
DA
22282012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2229
2230 Special MEM_TYPE_SPARE to denote reserved memory.
2231 * alloc.c (enum mem_type): New memory type.
2232 (refill_memory_reserve): Use new type for spare memory.
2233 This prevents live_cons_p and live_string_p from incorrect
2234 detection of uninitialized objects from spare memory as live.
2235
6af64513
PE
22362012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2237
8b2e00a3
PE
2238 Spelling fixes.
2239 * Makefile.in (.PHONY): versioclean -> versionclean.
2240
b52d6985
PE
2241 Remove unused external symbols.
2242 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2243 * window.c (Qwindow_valid_p, decode_valid_window):
2244 Now static, not extern.
2245 * data.c (Qinterval): Remove; unused.
2246 (syms_of_data): Do not define 'interval'.
2247 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2248 * window.h (decode_valid_window):
2249 Remove decls.
2250
d5172d4f
PE
2251 * character.c, charset.c, chartab.c: Use bool for booleans.
2252 * character.c (lisp_string_width, string_count_byte8)
2253 (string_escape_byte8):
2254 * charset.c (charset_map_loaded, load_charset_map, read_hex):
2255 (load_charset_map_from_file, map_charset_chars)
2256 (Fdefine_charset_internal, define_charset_internal)
2257 (Fdeclare_equiv_charset, find_charsets_in_text)
2258 (Ffind_charset_region, char_charset, Fiso_charset):
2259 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2260 (sub_char_table_set, sub_char_table_set_range)
2261 (char_table_set_range, optimize_sub_char_table)
2262 (map_sub_char_table):
2263 Use bool for boolean.
2264 * character.c (str_to_unibyte): Omit last boolean argument; it was
2265 always 0. All callers changed.
2266 * character.h, charset.h: Adjust to match previous changes.
2267 * character.h (char_printable_p): Remove decl of nonexistent function.
2268 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2269 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2270 are all boolean, so make them single-bit bitfields.
2271
6af64513
PE
2272 * lisp.h (ASET): Remove attempt to detect side effects.
2273 It was meant to be temporary and it often doesn't work,
2274 because when IDX has side effects the behavior of IDX==IDX
2275 is undefined. See Stefan Monnier in
2276 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2277
e1f29348
BR
22782012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2279
2280 * lisp.h (functionp): New function (extracted from Ffunctionp).
2281 (FUNCTIONP): Use it.
2282 * eval.c (Ffunctionp): Use it.
2283
17c05d74
PE
22842012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2285
0f46bc75
PE
2286 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2287 as that's faster and simpler than static storage. Don't bother
2288 with the g_main_context_query overhead if g_main_context_pending
2289 says no events are pending.
2290 (gfds, gfds_size): Remove these static vars.
2291 (xgselect_initialize): Remove; no longer needed.
2292 All uses and decls removed.
2293
ee4c0f69
PE
2294 * emacs.c (fatal_error_signal_hook): Remove.
2295 All uses removed. This leftover from old code was always 0.
2296
17c05d74
PE
2297 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2298 * casefiddle.c (casify_object, casify_region):
2299 * casetab.c (set_case_table):
2300 * category.c, category.h (word_boundary_p):
2301 * category.h (CHAR_HAS_CATEGORY):
2302 Use bool for booleans, instead of int.
2303
391ceac5
EZ
23042012-08-25 Eli Zaretskii <eliz@gnu.org>
2305
2306 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2307
2f221583
PE
23082012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2309
f4a681b0
PE
2310 On assertion failure, print backtrace if available.
2311 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2312 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2313 * Makefile.in (LIB_EXECINFO): New macro.
2314 (LIBES): Use it.
2315
2f221583
PE
2316 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2317 * bytecode.c (exec_byte_code):
2318 * callint.c (check_mark, Fcall_interactively):
2319 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2320 (getenv_internal, sync_process_alive, call_process_exited):
2321 * lisp.h (USE_SAFE_ALLOCA):
2322 Use bool for booleans, instead of int.
2323 * lisp.h, process.h: Adjust prototypes to match above changes.
2324 * callint.c (Fcall_interactively): Don't assume the mark's
2325 offset fits in 'int'.
2326
37ef52bb
PE
23272012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2328
2329 * buffer.c, buffer.h: Use bool for boolean.
2330 * buffer.c (reset_buffer_local_variables)
2331 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2332 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2333 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2334 (overlay_touches_p, overlay_strings, Foverlay_put)
2335 (report_overlay_modification, call_overlay_mod_hooks):
2336 (mmap_enlarge, mmap_set_vars):
2337 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2338 Use bool for booleans, instead of int.
2339 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2340 since the 1-or-0 return value is always ignored anyway.
2341 (mmap_initialized_p):
2342 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2343 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2344
2cc21167
PE
23452012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2346
2347 * bidi.c: Use bool for boolean.
2348 This is a bit more readable, and makes the text segment of bidi.o
2349 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2350 Presumably it's faster too.
2351 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2352 Now bool.
2353 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2354 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2355 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2356 (bidi_explicit_dir_char, bidi_level_of_next_char)
2357 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2358 Use bool for booleans, instead of int.
2359 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2360 (bidi_unshelve_cache): Adjust decls to match code.
2361
7db4ddf4
MR
23622012-08-23 Martin Rudalics <rudalics@gmx.at>
2363
2364 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2365 argument.
2366
b1bb8011
PE
23672012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2368
2369 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2370 * atimer.h: Include <stdbool.h>.
2371
ff687885
DN
23722012-08-22 Dan Nicolaescu <dann@gnu.org>
2373
2374 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2375 compile time tests instead of run time tests on systems that do
2376 not use them.
2377 (FRAME_MAC_P): Remove leftover from deleted code.
2378 * frame.c (syms_of_frame): Remove leftover from deleted code.
2379
4ce7a138
JD
23802012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2381
2382 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2383
d733ec6d
PE
23842012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2385
2386 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2387 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 2388 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
2389 (fontset_add): Return void, for FONTSET_ADD.
2390
d0d2d26f
PE
23912012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2392
fce31d69
PE
2393 * alloc.c: Use bool for booleans.
2394 (gc_in_progress, abort_on_gc)
2395 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2396 (dont_register_blocks) [GC_MALLOC_CHECK]:
2397 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2398 (check_string_bytes, make_specified_string, memory_full)
2399 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2400 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2401 (mark_stack, valid_pointer_p, make_pure_string)
2402 (Fgarbage_collect, survives_gc_p, gc_sweep):
2403 Use bool for booleans, instead of int.
2404 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2405 Remove unused local.
2406 * alloc.c (PURE_POINTER_P):
2407 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2408 * editfns.c (Fformat):
2409 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2410 (Fdo_auto_save):
2411 * fns.c (sweep_weak_table):
2412 * lisp.h (suppress_checking, push_message, survives_gc_p)
2413 (make_pure_string, gc_in_progress, abort_on_gc):
2414 * lread.c (readchar, read1):
2415 * print.c (Fprin1_to_string):
2416 * xdisp.c (push_message):
2417 Use bool for booleans affected directly or indirectly by
2418 alloc.c's changes.
2419
d0d2d26f
PE
2420 Make recently-introduced setters macros.
2421 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2422 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2423 (set_fontset_default, set_fontset_fallback): Rename from their
2424 upper-case counterparts, and make them functions rather than macros.
2425 This is more consistent with the other recently-introduced setters.
2426 These don't need to be inline, since they're local.
2427
d18e2bb6
JD
24282012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2429
2430 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2431 the loop (Bug#12247).
2432
1b9d9d16
PE
24332012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2434
2435 * lisp.h (vcopy): Use memcpy rather than our own loop.
2436 This fixes a performance regression introduced by the recent
2437 addition of vcopy. This means 'vcopy' will need to be modified
2438 for a copying collector, but that's OK. Also, tighten the
2439 checking in the assertion.
2440
b2f09701
EZ
24412012-08-21 Eli Zaretskii <eliz@gnu.org>
2442
2443 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2444 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2445 non-base glyph for the width of the base character, according to
e1f29348
BR
2446 what x_draw_composite_glyph_string_foreground expects.
2447 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
2448 expectations, to produce correct width of the composed character.
2449 Reverse the sign of the DU offset produced by ScriptPlace.
2450
9b994fed
PE
24512012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2452
2453 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2454
086ca913
DA
24552012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2456
2457 Avoid direct writes to contents member of struct Lisp_Vector.
2458 * lisp.h (vcopy): New function to copy data into vector.
2459 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2460 * fns.c (Ffillarray): Use ASET.
2461 * keyboard.c (timer_check_2): Use AREF and ASET.
2462 (append_tool_bar_item, Frecent_keys): Use vcopy.
2463 * lread.c (read_vector): Use ASET.
2464 * msdos.c (Frecent_doskeys): Use vcopy.
2465 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2466 (Finternal_merge_in_global_face): Use ASET and vcopy.
2467 * xfont.c (xfont_list_pattern): Likewise.
2468
5481664a
MR
24692012-08-21 Martin Rudalics <rudalics@gmx.at>
2470
2471 * window.c (Fwindow_point): For the selected window always return
2472 the position of its buffer's point.
2473 (Fset_window_point): For the selected window always go in its
2474 buffer to the specified position.
2475
6d470bdd
DA
24762012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2477
2478 Setter macros for fontsets.
2479 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2480 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2481 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2482 Adjust users.
2483
24564fe1
GM
24842012-08-20 Glenn Morris <rgm@gnu.org>
2485
2486 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2487 Don't assume that `ln -f' works.
2488
0a05a035
EZ
24892012-08-20 Eli Zaretskii <eliz@gnu.org>
2490
2491 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2492 and later about non-assignments with no effect. See discussion at
2493 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2494 details.
2495
e46f2325
DA
24962012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2497
2498 Inline setter functions for Lisp_Objects slots of struct specbinding.
2499 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2500 Adjust users.
2501
734fbd86
MR
25022012-08-20 Martin Rudalics <rudalics@gmx.at>
2503
2504 * window.c (select_window): Always make selected window's buffer
2505 current.
2506
f1a95992
DA
25072012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2508
2509 Use AREF and ASET for docstrings of category tables.
2510 * category.h (CATEGORY_DOCSTRING): Use AREF.
2511 (SET_CATEGORY_DOCSTRING): Use ASET.
2512 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2513
e83064be
DA
25142012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2515
2516 Inline setter functions for hash table members.
2517 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2518 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2519 (set_hash_key_and_value, set_hash_index, set_hash_next)
2520 (set_hash_hash): New functions.
2521 * charset.c, fns.c: Adjust users.
2522
4ce60d2e
DA
25232012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2524
2525 Inline getter and setter functions for per-buffer values.
2526 * buffer.h (per_buffer_default, set_per_buffer_default)
2527 (per_buffer_value, set_per_buffer_value): New functions.
2528 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2529 * buffer.c, data.c: Adjust users.
2530
c06c9690
JB
25312012-08-20 Juanma Barranquero <lekktu@gmail.com>
2532
2533 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2534
32bd4250
PE
25352012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2536
bad03192 2537 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
2538 as gnulib does this if the system doesn't.
2539 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
2540 Remove declaration. MS-Windows declares it on stdlib.h which is
2541 included by conf_post.h.
b69a6d22
PE
2542 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2543 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2544 * vm-limit.c: Include <unistd.h>, for 'environ'.
2545
22d7feb2
PE
2546 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2547 (start_of_data): Remove decl; mem-limits.h provides it.
2548
32bd4250
PE
2549 * xdisp.c (handle_invisible_prop): Make it a bit faster
2550 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2551
450809af
CY
25522012-08-19 Chong Yidong <cyd@gnu.org>
2553
2554 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2555 ends (Bug#3874).
2556
9e677988
AS
25572012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2558
6b1319ce
AS
2559 * .gdbinit: Use call instead of set when calling a function in the
2560 inferior.
2561
9e677988
AS
2562 * data.c (set_internal): Don't use set_blv_found.
2563 (Fkill_local_variable): Likewise.
2564
d7191076
AA
25652012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2566
2567 * nsfont.m (ns_ascii_average_width): Ensure the string
2568 ascii_printable is initialized with a null-terminated character
2569 array. Otherwise, it can contain undesired extra characters.
2570
e757f1c6
PE
25712012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2572
2573 port new setting code to Sun C 5.8 2005/10/13
2574 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2575 Return void, not Lisp_Object. Otherwise, the compiler
2576 complains about (A?B:C) where B is void and C is Lisp_Object
2577 when compiling CHAR_TABLE_SET, due to the recent change to
2578 the API of sub_char_table_set_contents.
2579
a999ce26
CY
25802012-08-18 Chong Yidong <cyd@gnu.org>
2581
2582 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2583 for the string case (Bug#3874).
2584
3f22b86f
PE
25852012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2586
39eb03f1
PE
2587 * buffer.h (BSET): Remove (Bug#12215).
2588 Replace all uses with calls to new setter functions.
2589 (bset_bidi_paragraph_direction, bset_case_canon_table)
2590 (bset_case_eqv_table, bset_directory, bset_display_count)
2591 (bset_display_time, bset_downcase_table)
2592 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2593 (bset_last_selected_window, bset_local_var_alist)
2594 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2595 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2596 (bset_width_table):
2597 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2598 (bset_auto_fill_function, bset_auto_save_file_format)
2599 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2600 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2601 (bset_cache_long_line_scans, bset_case_fold_search)
2602 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2603 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2604 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2605 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2606 (bset_header_line_format, bset_indicate_buffer_boundaries)
2607 (bset_indicate_empty_lines, bset_invisibility_spec)
2608 (bset_left_fringe_width, bset_major_mode, bset_mark)
2609 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2610 (bset_name, bset_overwrite_mode, bset_pt_marker)
2611 (bset_right_fringe_width, bset_save_length)
2612 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2613 (bset_scroll_up_aggressively, bset_selective_display)
2614 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2615 (bset_word_wrap, bset_zv_marker):
2616 * category.c (bset_category_table):
2617 * syntax.c (bset_syntax_table):
2618 New setter functions.
2619
6a09a33b
PE
2620 * process.h (PSET): Remove (Bug#12215).
2621 Replace all uses with calls to new setter functions.
2622 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2623 (PROCESS_INLINE): New macro.
2624 (pset_childp): New setter function.
2625 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2626 * process.c (PROCESS_INLINE):
2627 Define to EXTERN_INLINE, so that the corresponding functions
2628 are compiled into code.
2629 (pset_buffer, pset_command, pset_decode_coding_system)
2630 (pset_decoding_buf, pset_encode_coding_system)
2631 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2632 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2633 (pset_type, pset_write_queue): New setter functions.
2634
e8c17b81
PE
2635 * window.h (WSET): Remove (Bug#12215).
2636 Replace all uses with calls to new setter functions.
2637 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2638 (WINDOW_INLINE): New macro.
2639 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2640 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2641 (wset_total_lines, wset_vertical_scroll_bar)
2642 (wset_window_end_pos, wset_window_end_valid)
2643 (wset_window_end_vpos): New setter functions.
2644 * window.c (WINDOW_INLINE):
2645 Define to EXTERN_INLINE, so that the corresponding functions
2646 are compiled into code.
2647 (wset_combination_limit, wset_dedicated, wset_display_table)
2648 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2649 (wset_new_normal, wset_new_total, wset_next_buffers)
2650 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2651 (wset_prev_buffers, wset_right_fringe_width)
2652 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2653 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2654 (wset_window_parameters):
2655 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2656 (wset_column_number_displayed, wset_region_showing):
2657 New setter functions.
2658
3f22b86f
PE
2659 * termhooks.h (TSET): Remove (Bug#12215).
2660 Replace all uses with calls to new setter functions.
2661 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2662 (TERMHOOKS_INLINE): New macro.
2663 (tset_charset_list, tset_selection_alist): New setter functions.
2664 * terminal.c (TERMHOOKS_INLINE):
2665 Define to EXTERN_INLINE, so that the corresponding functions
2666 are compiled into code.
2667 (tset_param_alist): New setter function.
2668
742af32f
PE
26692012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2670
15dbb4d6
PE
2671 * keyboard.h (KSET): Remove (Bug#12215).
2672 Replace all uses with calls to new setter functions.
2673 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2674 (KEYBOARD_INLINE): New macro.
2675 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2676 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2677 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2678 New setter functions.
2679 * keyboard.c (KEYBOARD_INLINE):
2680 Define to EXTERN_INLINE, so that the corresponding functions
2681 are compiled into code.
2682 (kset_echo_string, kset_kbd_queue)
2683 (kset_keyboard_translate_table, kset_last_prefix_arg)
2684 (kset_last_repeatable_command, kset_local_function_key_map)
2685 (kset_overriding_terminal_local_map, kset_real_last_command)
2686 (kset_system_key_syms): New setter functions.
2687
f00af5b1
PE
2688 * frame.h (FSET): Remove (Bug#12215).
2689 Replace all uses with calls to new setter functions.
2690 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2691 (FRAME_INLINE): New macro.
2692 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2693 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2694 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2695 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2696 (fset_param_alist, fset_root_window, fset_scroll_bars)
2697 (fset_selected_window, fset_title, fset_tool_bar_items)
2698 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2699 * frame.c (FRAME_INLINE):
2700 Define to EXTERN_INLINE, so that the corresponding functions
2701 are compiled into code.
2702 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2703
0c94c8d6
PE
2704 A few more naming-convention fixes for getters and setters.
2705 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2706 and rename from buffer_overlays_set_before.
2707 (set_buffer_overlays_after): Move here from buffer.h, and rename
2708 from buffer_overlays_set_after.
2709 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2710 All uses changed.
2711 (set_buffer_intervals): Rename from buffer_set_intervals.
2712 * intervals.c (set_interval_object): Move here from intervals.h,
2713 and rename from interval_set_object.
2714 (set_interval_left): Move here from intervals.h, and rename from
2715 interval_set_left.
2716 (set_interval_right): Move here from intervals.h, and rename from
2717 interval_set_right.
2718 (copy_interval_parent): Move here from intervals.h, and rename from
2719 interval_copy_parent.
2720 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2721 (set_interval_plist): Rename from interval_set_plist.
2722 Return void, not Lisp_Object, since no caller uses the result.
2723 * lisp.h (string_intervals): Rename from string_get_intervals.
2724 (set_string_intervals): Rename from string_set_intervals.
2725
34dabdb7
PE
2726 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2727 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 2728 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
2729 All uses changed. See the end of
2730 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2731
742af32f
PE
2732 * lisp.h (CSET): Remove (Bug#12215).
2733 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2734 (set_char_table_purpose): New functions,
2735 replacing CSET. All uses changed. For example, replace
2736 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 2737 "set_char_table_parent (char_table, parent);".
742af32f
PE
2738 The old version was confusing because it used the same name
2739 'parent' for two different things.
2740
a04e2c62
DA
27412012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2742
2743 Functions to get and set Lisp_Object fields of buffer-local variables.
2744 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2745 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2746 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2747 * data.c, eval.c, frame.c: Adjust users.
2748
383dcbf9
CY
27492012-08-17 Chong Yidong <cyd@gnu.org>
2750
2751 * xfaces.c (merge_face_vectors): If the target font specfies a
2752 font spec, make the font's attributes take precedence over
2753 directly-specified attributes.
2754 (merge_face_ref): Recognize :font.
2755
44386687
DA
27562012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2757
2758 Do not use memcpy for copying intervals.
2759 * intervals.c (reproduce_interval): New function.
2760 (reproduce_tree, reproduce_tree_obj): Use it.
2761 (reproduce_tree_obj): Remove prototype.
2762
927c7216
PE
27632012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2764
2765 * lisp.h (duration_to_sec_usec): Remove unused decl.
2766
93044f7b
AA
27672012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2768
2769 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2770 to an allocated instance of NSString, not to the class itself.
2771
9851e4a5
JB
27722012-08-17 Juanma Barranquero <lekktu@gmail.com>
2773
2774 * makefile.w32-in (C_CTYPE_H): New macro.
2775 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2776 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2777 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2778
620f13b0
PE
27792012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2780
2781 Use ASCII tests for character types.
2782 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2783 * xfns.c, xterm.c:
2784 Don't include <ctype.h>; was not needed.
2785 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2786 * sysdep.c, xfaces.c:
2787 Include <c-ctype.h> instead of <ctype.h>.
2788 * nsterm.m: Include <c-ctype.h>.
2789 * charset.c (read_hex):
2790 * doc.c (Fsnarf_documentation):
2791 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2792 (DRIVE_LETTER) [DOS_NT]:
2793 (Ffile_name_directory, Fexpand_file_name)
2794 (Fsubstitute_in_file_name):
2795 * font.c (font_parse_xlfd, font_parse_fcname):
2796 * frame.c (x_set_font_backend):
2797 * gtkutil.c (xg_get_font):
2798 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2799 * nsimage.m (hexchar):
2800 * nsterm.m (ns_xlfd_to_fontname):
2801 * sysdep.c (system_process_attributes):
2802 * xfaces.c (hash_string_case_insensitive):
2803 Use C-locale tests instead of locale-specific tests for character
2804 types, since we want the ASCII interpretation here, not the
2805 interpretation suitable for whatever happens to be the current locale.
2806
52162052
MR
28072012-08-16 Martin Rudalics <rudalics@gmx.at>
2808
2809 Consistently check windows for validity/liveness
2810 (Bug#11984, Bug#12025, Bug#12026).
2811 * lisp.h (CHECK_VALID_WINDOW): New macro.
2812 * window.c (decode_window): Rename to decode_live_window.
2813 (decode_valid_window, Fwindow_valid_p): New functions.
2814 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2815 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2816 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2817 (Fwindow_prev_sibling, Fwindow_combination_limit)
2818 (Fset_window_combination_limit, Fwindow_use_time)
2819 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2820 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2821 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2822 (Fwindow_hscroll, Fset_window_hscroll)
2823 (Fwindow_redisplay_end_trigger)
2824 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2825 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2826 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2827 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2828 (Fwindow_end, Fset_window_point, Fset_window_start)
2829 (Fpos_visible_in_window_p, Fwindow_line_height)
2830 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2831 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2832 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2833 (Fset_window_parameter, Fwindow_display_table)
2834 (Fset_window_display_table, Fdelete_other_windows_internal)
2835 (Fset_window_buffer, Fset_window_new_total)
2836 (Fset_window_new_normal, Fdelete_window_internal)
2837 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2838 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2839 (Fwindow_scroll_bars): Check whether argument window is a valid or
2840 live window. Update doc-strings.
2841 (syms_of_window): New symbol Qwindow_valid_p.
2842 * keyboard.c (Fposn_at_x_y): Check whether argument
2843 frame_or_window denotes a valid window.
2844
2751c80f
DA
28452012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2846
2847 Fix previous char table change.
2848 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2849 * chartab.c (optimize_sub_char_table): Likewise.
2850
032a42c8
CY
28512012-08-16 Chong Yidong <cyd@gnu.org>
2852
a2d19368
CY
2853 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2854
032a42c8
CY
2855 * xfont.c (xfont_open):
2856 * xftfont.c (xftfont_open): Set the font's max_width field.
2857
2858 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2859 min_width to space_width and average_width to the average over
2860 printable ASCII characters.
2861 (ns_char_width): Code cleanup.
2862 (ns_ascii_average_width): New utility function.
2863
2864 * font.h (struct font): Update comments.
2865
a098c930
DA
28662012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2867
032a42c8 2868 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
2869 * lisp.h (CSET): New macro.
2870 (char_table_set_extras, char_table_set_contents)
2871 (sub_char_table_set_contents): New function.
2872 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2873 * syntax.c: Adjust users.
2874
8be3a09c
SM
28752012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2876
2877 * eval.c (eval_sub): Bind lexical-binding.
2878 * lread.c (Qlexical_binding): Make non-static.
2879
ac4845a6
JD
28802012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2881
ddee6515
JD
2882 * nsmenu.m (popupSession): Remove.
2883 (pop_down_menu): Remove endModalSession.
2884 (timeout_handler:): New method.
2885 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2886 Call runModalForWindow. Check timer_fired when it returns.
2887 If not set, cancel timer and break out of loop.
2888 Otherwise loop again, with a new timeout.
2889
2890 * nsterm.m: Include fcntl.h if present.
2891 (fd_entry, t_readfds, inNsSelect): Remove.
2892 (select_writefds, select_valid, select_timeout, selfds)
2893 (select_mutex, apploopnr): Add.
2894 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2895 Otherwise call kbd_buffer_store_event.
2896 (ns_send_appdefined): Remove release of fd_entry.
2897 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2898 Increment and decrement apploopnr.
2899 (ns_select): If no file descriptors, just do a NSTimer.
2900 Otherwise copy read/write masks and start select thread (fd_handler).
2901 Start main loop and wait for application defined event.
2902 Inform select thread to stop selecting after main loop is exited.
2903 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 2904 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
2905 (fd_handler:): Loop forever, wait for info from the main thread
2906 to either start or stop selecting. When select returns, send
2907 and appdefined event.
2908 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2909 If not call kbd_buffer_store_event.
2910
2911 * nsterm.h (EmacsApp): fd_handler takes id argument.
2912 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2913
ac4845a6
JD
2914 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2915
eb424fe3
EZ
29162012-08-15 Eli Zaretskii <eliz@gnu.org>
2917
2918 * region-cache.c (move_cache_gap): Update gap_len using the actual
2919 growth of the boundaries array. Do not change cache_len.
2920 (Bug#12196)
2921
4e6a86c6
DA
29222012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2923
2924 Generalize and cleanup font subsystem checks.
2925 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
2926 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2927 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 2928
5bf192ca
DA
29292012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2930
2931 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2932
f2045622
CY
29332012-08-15 Chong Yidong <cyd@gnu.org>
2934
8be3a09c
SM
2935 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2936 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2937 extract the font descriptor instead of just the font name.
2938 In that case, return a font spec instead of a string.
f2045622
CY
2939 (x_last_font_name): Move to this file from xfns.c.
2940
2941 * xfns.c (Fx_select_font): The return value can also be a font
2942 spec. Move x_last_font_name management to gtkutil.c.
2943
2944 * xfaces.c: Make font weight and style symbols non-static.
2945
7f6feb56
SM
29462012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2947
2948 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2949 (bug#12117).
2950
fecbd8ff
SM
29512012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2952
2953 * alloc.c (Fgarbage_collect): Use plural form consistently.
2954
9b8d5165
EZ
29552012-08-14 Eli Zaretskii <eliz@gnu.org>
2956
2957 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2958 iteration through the command loop. Fixes a problem whereby mouse
2959 movements are ignored until the first mouse click.
2960
f5d9e83a
PE
29612012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2962
2963 Use bool, not int, for Lisp booleans.
2964 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2965 makes Emacs a bit smaller and presumably a bit faster.
2966 * lisp.h: Include <stdbool.h>.
2967 (struct Lisp_Boolfwd, defvar_bool):
2968 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2969 * regex.c [!emacs]: Include <stdbool.h>.
2970 (false, true): Remove; <stdbool.h> does this for us now.
2971
55802e4a
CY
29722012-08-14 Chong Yidong <cyd@gnu.org>
2973
4abcdac8
CY
2974 * character.c (Fcharacterp): Doc fix (Bug#12076).
2975
2976 * data.c (Findirect_variable): Doc fix (Bug#11040).
2977
55802e4a
CY
2978 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2979
2980 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 2981 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 2982
8e99d072
BR
29832012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2984
2985 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2986 (bug#12022).
2987
08908aca
MR
29882012-08-14 Martin Rudalics <rudalics@gmx.at>
2989
2990 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2991 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2992 * minibuf.c (choose_minibuf_frame, read_minibuf):
2993 * w32fns.c (x_create_tip_frame):
2994 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2995 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2996
56120d6f
PE
29972012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2998
2999 * intervals.c (offset_intervals): Remove obsolete comment.
3000
67b77c0b
AS
30012012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3002
3003 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3004
f48b82fd
GR
30052012-08-14 Gergely Risko <gergely@risko.hu>
3006
3007 * coding.c (decode_coding): Record buffer modification before
3008 disabling undo_list (Bug#11773).
3009
fd318b54
DA
30102012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3011
3012 Revert and cleanup some recent overlay changes.
3013 * buffer.h (enum overlay_type): Remove.
3014 (buffer_get_overlays, buffer_set_overlays): Likewise.
3015 (buffer_set_overlays_before, buffer_set_overlays_after):
3016 New function. Adjust users.
3017 (unchain_both): Add eassert.
3018
41a62dd9
DA
30192012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3020
3021 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3022
5884c324
PE
30232012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3024
3025 * gtkutil.c (xg_mark_data): Don't assume C99.
3026
ca06f160
JD
30272012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3028
3029 * gtkutil.c (xg_frame_tb_info): New struct.
3030 (TB_INFO_KEY): New define.
3031 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3032 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3033 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3034 if not present.
3035 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 3036 is up to date. Otherwise store new data.
ca06f160
JD
3037 (free_frame_tool_bar): Free xg_frame_tb_info if present.
3038
7864a3f7
DA
30392012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3040
3041 Use KSET for write access to Lisp_Object members of struct kboard.
3042 * keyboard.h (KSET): New macro.
3043 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3044 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3045 * xterm.c: Adjust users.
3046
4c31be61
DA
30472012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3048
3049 Use BSET for write access to Lisp_Object members of struct buffer.
3050 * buffer.h (BSET): New macro.
3051 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3052 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3053 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3054 * window.c, xdisp.c, xfns.c: Adjust users.
3055
14ae4239
BT
30562012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
3057
3058 * lread.c (syms_of_lread): Initialize Vlexical_binding.
3059
32bcadb4
JD
30602012-08-11 Jan Djärv <jan.h.d@swipnet.se>
3061
3d29b2ce 3062 * nsterm.m (not_in_argv): New function.
fc0c31f8 3063 (application:openFile, application:openTempFile:):
3d29b2ce
JD
3064 (application:openFileWithoutUI:, application:openFiles:): Open file
3065 if not_in_argv returns non-zero (bug#12171).
3066
32bcadb4 3067 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
3068 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
3069 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
3070 (xg_get_font_name): Use those functions/macros here.
3071 Reported by Frans Oilinki <moilinki@gmail.com>.
3072
9ff9402d 30732012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
3074
3075 * unexmacosx.c (copy_data_segment): Copy initialized data in
3076 statically linked libraries from input file rather than memory.
3077
db74a5fc
YM
3078 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
3079 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
3080 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
3081
25e65510
GM
30822012-08-10 Glenn Morris <rgm@gnu.org>
3083
3084 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
3085 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
3086
7961135c
DA
30872012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3088
3089 Fix last change to allow compilation with low optimization levels.
3090 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
3091 Reported by Jan Djärv <jan.h.d@swipnet.se>.
3092
42b3a444
DA
30932012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3094
3095 Use common inline syntax in intervals.h.
3096 * intervals.h (INTERVALS_INLINE): New macro.
3097 Change all users from LISP_INLINE.
3098
9fb0c957
DA
30992012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3100
3101 Define Qnone once for all platforms.
3102 * frame.c (Qnone): Define here.
3103 (syms_of_frame): DEFSYM it.
3104 * lisp.h (Qnone): New declaration.
3105 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
3106 * xfns.c: Remove duplication. Adjust users.
3107
65e8ee52
DA
31082012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3109
3110 Remove unused macros from intervals.h.
3111 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
3112 * intervals.c: Adjust comment.
3113
9b855fd6
EZ
31142012-08-10 Eli Zaretskii <eliz@gnu.org>
3115
3116 * w32fns.c <w32_unicode_gui>: New static variable.
3117 (globals_of_w32fns): Initialize it according to os_subtype.
3118 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3119 testing os_subtype.
3120
39cb9e56 31212012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
3122 Eli Zaretskii <eliz@gnu.org>
3123
3124 Fix bug #10299 with Unicode characters sent by customized
3125 keyboards created by MSKLC.
3126 * w32fns.c (INIT_WINDOW_CLASS): New macro.
3127 (w32_init_class): Use it to initialize the Emacs class with either
3128 ANSI or Unicode API calls.
3129 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3130 later.
3131 (w32_wnd_proc): If the character code sent by WM_CHAR or
3132 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3133 original message. Call DefWindowProcW on NT and later.
3134
9374581a
GM
31352012-08-10 Glenn Morris <rgm@gnu.org>
3136
4b94e8cf
GM
3137 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3138
9374581a
GM
3139 * lisp.h (DIRECTORY_SEP): Let configure set it.
3140
a2752828
DA
31412012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
3142
3143 Use TSET for write access to Lisp_Object slots of struct terminal.
3144 * termhooks.h (TSET): New macro.
3145 * coding.c, terminal.c, xselect.c: Adjust users.
3146
cc92c454
SM
31472012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
3148
3149 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
3150 the failing expression, include them in the error message.
3151 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3152 * lisp.h (internal_condition_case_n): Update declaration.
3153
4cb3e6b3
DA
31542012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3155
3156 Inline functions to examine and change buffer overlays.
3157 * buffer.c (unchain_both): New function.
3158 * buffer.h (buffer_get_overlays, buffer_set_overlays):
3159 (buffer_has_overlays): New function.
3160 (enum overlay_type): New enum.
3161 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3162 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3163
8707c1e5
DA
31642012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3165
3166 Inline functions to examine and change buffer intervals.
3167 * alloc.c (mark_interval_tree): Remove.
3168 (MARK_INTERVAL_TREE): Simplify.
3169 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
3170 * intervals.c (buffer_balance_intervals): New function.
3171 (graft_intervals_into_buffer): Adjust indentation.
3172 (set_intervals_multibyte): Simplify.
3173 * buffer.h (BUF_INTERVALS): Remove.
3174 (buffer_get_intervals, buffer_set_intervals): New function.
3175 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3176 * intervals.c, textprop.c: Adjust users.
3177
ad8c997f
DA
31782012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3179
3180 Inline functions to examine and change string intervals.
3181 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3182 (string_get_intervals, string_set_intervals): New function.
3183 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3184 * lread.c, print.c, textprop.c: Adjust users.
3185
32ac3a6b
GM
31862012-08-08 Glenn Morris <rgm@gnu.org>
3187
3188 * lisp.mk (lisp): Remove language/persian.elc.
3189
77c7bcb1
DA
31902012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3191
3192 Cleanup intervals.
3193 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3194 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
3195 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3196 Adjust comment. Move under #if 0.
77c7bcb1
DA
3197 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3198 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3199
9c08a8d4
DA
32002012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3201
3202 Check total length of intervals with eassert.
3203 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3204 * intervals.c: Change all users to eassert.
3205
26d16b35
EZ
32062012-08-07 Eli Zaretskii <eliz@gnu.org>
3207
14ae4239
BT
3208 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
3209 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
3210 INTERNAL_FIELD in Lisp_Cons.
3211
c644523b
DA
32122012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3213
3214 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
3215 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
3216 name since all xname users are fixed long time ago. Do not
3217 use INTERNAL_FIELD.
3218 (set_symbol_name, set_symbol_function, set_symbol_plist):
3219 (set_symbol_next, set_overlay_plist): New function.
3220 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
3221 (struct Lisp_Overlay): Likewise.
3222 (CVAR, MVAR, SVAR): Remove.
3223 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
3224 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
3225 * xterm.c: Adjust users.
3226 * .gdbinit: Change to use name field of struct Lisp_Symbol
3227 where appropriate.
3228
6a3d20cc
DA
32292012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3230
3231 Basic functions to set Lisp_Object and pointer slots of intervals.
3232 * intervals.h (interval_set_parent, interval_set_object):
3233 (interval_set_left, interval_set_right, interval_set_plist):
3234 (interval_copy_parent): New function.
3235 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
3236 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
3237 Adjust indentation.
6a3d20cc
DA
3238 (INTERVAL_SIZE): Remove. Adjust users.
3239 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3240
4d2b044c
DA
32412012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3242
3243 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3244 * process.h (PGET): Remove.
3245 (struct Lisp_Process): Do not use INTERNAL_FIELD.
3246 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3247
d3d50620
DA
32482012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3249
3250 Drop WGET and revert read access to Lisp_Objects slots of struct window.
3251 * window.h (WGET): Remove.
3252 (struct window): Do not use INTERNAL_FIELD.
3253 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3254 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3255 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3256 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3257 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3258 Adjust users.
3259
d10a51dc
CY
32602012-08-07 Chong Yidong <cyd@gnu.org>
3261
3262 * window.c (Fwindow_edges, Fwindow_pixel_edges)
3263 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3264 (Fdelete_window_internal): Signal an error if the window is not on
3265 a live frame (Bug#12025).
3266
e69b0960
DA
32672012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3268
3269 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3270 * frame.h (FGET): Remove.
3271 (struct frame): Do not use INTERNAL_FIELD.
3272 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3273 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3274 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3275 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3276
25a20a3a
JB
32772012-08-06 Juanma Barranquero <lekktu@gmail.com>
3278
3279 * w32.c: Silence compiler warnings.
3280 (map_w32_filename): Remove unused variable `is_fat'.
3281 (chase_symlinks): Add parentheses around expression.
3282
1c6f11f4
GM
32832012-08-06 Glenn Morris <rgm@gnu.org>
3284
1db4583a
GM
3285 * sysdep.c: Respect BROKEN_GETWD.
3286
1c6f11f4
GM
3287 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3288 Let configure handle it.
3289 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3290
2b90362b
DA
32912012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3292
3293 Use GCALIGNMENT where appropriate.
3294 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3295 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3296 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3297
5f50daf2
EZ
32982012-08-06 Eli Zaretskii <eliz@gnu.org>
3299
14ae4239
BT
3300 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3301 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 3302
cbcc7007
SM
33032012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3304
3305 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3306 that should be sufficient for everyone.
3307
4d365fa4
JD
33082012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3309
3310 * keyboard.c (timer_check_2): Add break so timer_check returns next
3311 timeout.
3312
dd86bd82
DA
33132012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3314
3315 Fix Windows build errors introduced after converting to WGET and WSET.
3316 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3317 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3318
054e1668
JD
33192012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3320
3321 * nsterm.m (ns_frame_rehighlight): Use FSET.
3322
3323 * nsmenu.m (ns_update_menubar): Use FSET.
3324
21238f11
DA
33252012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3326
3327 Separate read and write access to Lisp_Object slots of Lisp_Process.
3328 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3329 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3330
077288cf
DA
33312012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3332
3333 Separate read and write access to Lisp_Object slots of struct window.
3334 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3335 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3336 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3337 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3338 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3339 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3340 Adjust users.
3341
71688bd7
DA
33422012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3343
3344 Fix Windows build errors introduced after converting to FGET and FSET.
3345 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3346 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3347 (w32_judge_scroll_bars): Change to use FSET.
3348 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3349
f99bac93
DA
33502012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3351
3352 Fix replacement typo.
3353 * window.c (replace_window): Set root_window instead of
3354 selected_window. This fixes a total window subsystem
3355 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3356
8c2a0f2d
GM
33572012-08-06 Glenn Morris <rgm@gnu.org>
3358
3359 * lisp.mk (lisp): Add language/persian.elc.
3360
edd74c35
DA
33612012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3362
3363 Separate read and write access to Lisp_Object slots of struct frame.
3364 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3365 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3366 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3367 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3368 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3369
8671676c
AS
33702012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3371
3372 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3373
663e2b3f
DA
33742012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3375
3376 Generalize common compile-time constants.
3377 * lisp.h (header_size, bool_header_size, word_size): Now here.
3378 (struct Lisp_Vector): Add comment.
3379 (struct Lisp_Bool_Vector): Move up to define handy constants.
3380 (VECSIZE, PSEUDOVECSIZE): Simplify.
3381 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3382 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3383 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3384 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3385 * xfont.c, xmenu.c: Use word_size where appropriate.
3386
d32e47af
LM
33872012-08-05 Lawrence Mitchell <wence@gmx.li>
3388
3389 * search.c (Freplace_match): Treat \? in the replacement text
3390 literally (Bug#8161).
3391
e5d9c0d1
CY
33922012-08-05 Chong Yidong <cyd@gnu.org>
3393
3394 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3395 * frame.c (Vdelete_frame_functions):
3396 * emacs.c (Vkill_emacs_hook): Doc fix.
3397
8da0576b
EZ
33982012-08-04 Eli Zaretskii <eliz@gnu.org>
3399
3400 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3401 --with-x-toolkit=no builds.
3402 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3403
02676e5d
CY
34042012-08-04 Chong Yidong <cyd@gnu.org>
3405
3406 * syntax.c (Fmodify_syntax_entry): Doc fix.
3407
97147da9
EZ
34082012-08-04 Eli Zaretskii <eliz@gnu.org>
3409
76151e2c
EZ
3410 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3411 * w32.c (init_environment): Change the default values of many
3412 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
3413 them into environment when they were not already defined.
3414 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 3415 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
3416 (check_windows_init_file): Now external, not static.
3417 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
3418 called when Vload_path is already set up.
3419
3420 * w32.h (check_windows_init_file): Add prototype.
3421
3422 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3423 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3424 compatibility with Posix platforms.
3425 (main): Move the call to check_windows_init_file to here from
3426 w32.c.
3427 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3428 any, in the DEFALT argument into the root of the Emacs build or
3429 installation tree, as appropriate.
3430
3431 * callproc.c (init_callproc_1): Call decode_env_path instead of
3432 doing its equivalent by hand.
3433 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3434 the code that sets Vexec_path run on MS-Windows.
3435
3436 * lread.c (init_lread): Add comments to #ifdef's.
3437
97147da9
EZ
3438 * msdos.c (dos_set_window_size, IT_update_begin)
3439 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3440 instead of direct references.
3441
185ee146
PE
34422012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3443
3444 Export DEFAULT_REHASH_* to GDB.
3445 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3446 Now constants, not macros.
3447
8834c57a
PE
34482012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3449
98c6f1e3
PE
3450 Remove unnecessary casts involving pointers.
3451 These casts are no longer needed now that we assume C89 or later,
3452 since they involve casting to or from void *.
3453 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3454 (make_pure_float, make_pure_vector):
3455 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3456 * macros.c (Fstart_kbd_macro):
3457 * menu.c (find_and_return_menu_selection):
3458 * minibuf.c (read_minibuf_noninteractive):
3459 * sysdep.c (closedir):
3460 * xdisp.c (x_produce_glyphs):
3461 * xfaces.c (compare_fonts_by_sort_order):
3462 * xfns.c (x_real_positions, select_visual):
3463 * xselect.c (x_stop_queuing_selection_requests)
3464 (x_get_window_property, x_get_window_property_as_lisp_data):
3465 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3466 Remove unnecessary pointer casts.
3467 * alloc.c (record_xmalloc): New function.
3468 * lisp.h (record_xmalloc): New decl.
3469 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3470 more like a function. This is because the pointer cast is not
3471 needed. All uses changed.
3472 * print.c (print_string, print_error_message): Avoid length recalc.
3473
8834c57a
PE
3474 Improve fix for macroexp crash with debugging (Bug#12118).
3475 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3476 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3477 not supposed to be invoked from the garbage collector.
3478 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3479 (gc_aset): New function, which is like ASET but can be
3480 used in the garbage collector.
3481 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3482 (set_hash_index): Use it instead of ASET.
3483
6dad7178
EZ
34842012-08-03 Eli Zaretskii <eliz@gnu.org>
3485
3486 Support symlinks on latest versions of MS-Windows.
3487 * w32.c: Include winioctl.h and aclapi.h.
3488 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3489 (revert_to_self): Forward declarations of static functions.
3490 <static BOOL g_b_init_get_security_info>:
3491 <g_b_init_create_symbolic_link>: New static flags.
3492 (globals_of_w32): Initialize them to zero.
3493 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3494 (map_w32_filename): Improve commentary. Simplify switch.
3495 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3496 headers (most versions of MinGW w32api don't).
3497 (get_security_info, create_symbolic_link)
3498 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3499 New functions.
3500 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3501 in the argument file name.
3502 (sys_access): Call unc_volume_file_attributes only if
3503 GetFileAttributes fails with network-related error codes.
3504 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3505 have the required privileges.
14ae4239 3506 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
3507 get_file_security_desc.
3508 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
3509 with addition of handling of symlinks and support for 'lstat'.
3510 If possible, get file's attributes and security information by
6dad7178
EZ
3511 handle, not by name. Produce S_IFLNK bit for symlinks, when
3512 called from 'lstat'.
3513 (stat, lstat): New functions, call 'stat_worker'.
3514 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3515 symlinks when the underlying filesystem supports them.
3516
f162bcc3
PE
35172012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3518
79ea6c20
PE
3519 Fix macroexp crash on Windows with debugging (Bug#12118).
3520 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3521 checking subscripts; problem introduced with the recent
3522 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3523 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3524 since it's used in non-static inline functions now.
3525
c0ce93fd
PE
3526 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3527 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 3528
f162bcc3
PE
3529 Use C99-style 'extern inline' if available.
3530 * buffer.h (BUFFER_INLINE):
3531 * category.h (CATEGORY_INLINE):
3532 * character.h (CHARACTER_INLINE):
3533 * charset.h (CHARSET_INLINE):
3534 * composite.h (COMPOSITE_INLINE):
3535 * dispextern.h (DISPEXTERN_INLINE):
3536 * lisp.h (LISP_INLINE):
3537 * systime.h (SYSTIME_INLINE):
3538 New macro, replacing 'static inline' in this header.
3539 * buffer.h, category.h, character.h, charset.h, composite.h:
3540 * dispextern.h, lisp.h, systime.h:
3541 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3542 * alloc.c (LISP_INLINE):
3543 * buffer.c (BUFFER_INLINE):
3544 * category.c (CATEGORY_INLINE):
3545 * character.c (CHARACTER_INLINE):
3546 * charset.c (CHARSET_INLINE):
3547 * composite.c (COMPOSITE_INLINE):
3548 * dispnew.c (DISPEXTERN_INLINE):
3549 * sysdep.c (SYSTIME_INLINE):
3550 Define to EXTERN_INLINE, so that the corresponding functions
3551 are compiled into code.
3552 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3553 (INLINE_HEADER_END): New macros.
3554 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3555 since it's used in non-static inline functions now.
a8333d03 3556 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 3557
837b365b
GM
35582012-08-02 Glenn Morris <rgm@gnu.org>
3559
d66b744d
GM
3560 * s/: Remove empty directory.
3561
837b365b
GM
3562 * s/ms-w32.h: Move to ../nt/inc.
3563 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3564 Update for new ms-w32.h location.
3565
13294f95
PE
35662012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3567
3568 Port to Solaris 8.
3569 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3570
90df0db3
GM
35712012-08-02 Glenn Morris <rgm@gnu.org>
3572
3573 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3574 hard-coding the path separator.
3575
4939150c
PE
35762012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3577
3578 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3579 This how ASET and AREF are supposed to work, and makes
3580 it easier to think about future improvements. See
3581 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3582 * charset.h (set_charset_attr): New function.
3583 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3584 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3585 (aref_addr): New function. All uses of &AREF(...) changed.
3586 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3587 (set_hash_index): New functions. All lvalue-style uses of
3588 HASH_KEY etc. changed.
3589 * keyboard.c (set_prop): New function. All lvalue-style uses
3590 of PROP changed.
3591
947b2afd
AA
35922012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3593
3594 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3595 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3596 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3597 * nsfns.m (ns_set_name_as_filename): Likewise.
3598 * nsmenu.m (ns_update_menubar): Likewise.
3599 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3600
4f5d0325
EZ
36012012-08-01 Eli Zaretskii <eliz@gnu.org>
3602
2008beae
EZ
3603 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3604 Adapt to latest changes in field names of the corresponding Lisp
288479f6 3605 objects.
2008beae 3606
4f5d0325
EZ
3607 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3608
fe3cc771
GM
36092012-08-01 Glenn Morris <rgm@gnu.org>
3610
3611 * s/msdos.h: Remove file.
3612 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3613 * Makefile.in (S_FILE): Remove.
3614 (config_h): Remove S_FILE.
3615
c90acc54
JB
36162012-08-01 Juanma Barranquero <lekktu@gmail.com>
3617
3618 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3619 Remove; moved to nt/config.nt.
3620
d8a05828
DA
36212012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3622
3623 Use INTERNAL_FIELD for conses and overlays.
3624 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3625 Remove obsolete comment.
3626 (MVAR): New macro.
3627 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3628 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3629
8271d590
DA
36302012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3631
3632 Use INTERNAL_FIELD for symbols.
3633 * lisp.h (SVAR): New macro. Adjust users.
3634 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3635 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3636
3193acd2
DA
36372012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3638
3639 Use INTERNAL_FIELD for processes.
3640 * process.h (PVAR): New macro. Adjust style.
3641 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3642 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3643
3a45383a
DA
36442012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3645
3646 Use INTERNAL_FIELD for windows.
3647 * window.h (WVAR): New macro.
3648 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3649 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3650 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3651 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3652 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3653 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3654
c1dbc63c
PE
36552012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3656
3657 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3658
5c0c0e8a
GM
36592012-08-01 Glenn Morris <rgm@gnu.org>
3660
3661 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3662 Move to configure.ac.
3663
552a99b4
JB
36642012-08-01 Juanma Barranquero <lekktu@gmail.com>
3665
3666 * makefile.w32-in (CONFIG_H): Update dependencies.
3667 (CONF_POST_H): New macro.
3668
3669 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3670
8d8e2dfe
GM
36712012-07-31 Glenn Morris <rgm@gnu.org>
3672
bc96620a
GM
3673 * Makefile.in (S_FILE): No longer set by configure.
3674
476b1b2d
GM
3675 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3676 is available.
3677 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3678
b2c7a106
GM
3679 * process.h (NULL_DEVICE):
3680 * emacs.c (SEPCHAR):
3681 * editfns.c (USER_FULL_NAME): Let configure set them.
3682
d53d062a
GM
3683 * s/README, s/template.h: Remove files.
3684
4515017f
GM
3685 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3686
8d8e2dfe
GM
3687 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3688 Move to configure.ac.
3689
5b20b3cc
EZ
36902012-07-31 Eli Zaretskii <eliz@gnu.org>
3691
1e0afd9a
EZ
3692 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3693 resulting renaming of 'struct frame' members.
3694
5b20b3cc
EZ
3695 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3696
3697 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3698 after introduction of FVAR.
3699
f1310128
JD
37002012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3701
79e721e0
JD
3702 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3703
3704 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3705 instead of compositeToPoint.
3706 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3707
8d7c7eed 3708 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 3709
e34f7f79
DA
37102012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3711
3712 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3713 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 3714 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
3715 (BVAR): Change to use INTERNAL_FIELD.
3716 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3717 (KVAR): Change to use INTERNAL_FIELD.
3718 * frame.h (FVAR): New macro.
3719 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
3720 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3721 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3722 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
3723 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3724
c09bfb2f
DA
37252012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3726
3727 Miscellaneous fixes for non-default X toolkits.
3728 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3729 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3730 Move under #ifdef USE_LUCID.
3731 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3732 definition and usage to avoid warnings.
3733
14c114ae
JD
37342012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3735
3736 * nsterm.m (openFiles): Fix previous checkin.
3737
3bd21e82
PE
37382012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3739
3740 * indent.c (compute_motion): Remove unused local.
3741
c1529ded
GM
37422012-07-31 Glenn Morris <rgm@gnu.org>
3743
400d5621
GM
3744 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3745
268e2432
GM
3746 * conf_post.h [USG5_4]:
3747 Move remaining contents of s/usg5-4-common.h here.
3748 * s/usg5-4-common.h: Remove file.
3749
7552f3ee
GM
3750 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3751 * s/irix6-5.h: Remove file.
3752
6a381852
GM
3753 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3754 * s/darwin.h: Remove file.
3755
c1529ded
GM
3756 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3757 * s/hpux10-20.h: Remove file, which is now empty.
3758
b429a4ee
GM
37592012-07-30 Glenn Morris <rgm@gnu.org>
3760
3761 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3762 * Makefile.in (config_h): Add conf_post.h.
3763 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3764
adff3182
JD
37652012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3766
3767 * nsterm.m (ns_do_open_file): New variable.
b9031d69 3768 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
3769 (openFile, openTempFile, openFileWithoutUI, openFiles):
3770 Open files only if ns_do_open_file.
adff3182 3771
c32af1e4
PE
37722012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3773
7393bcbb
PE
3774 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3775 This no-op macro hasn't been needed for many years.
3776 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3777
c32af1e4
PE
3778 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3779 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3780 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3781 gdb_make_enums_visible.
3782 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3783 (DIRECTORY_SEP): Now a constant, not a macro.
3784
302fc036
EZ
37852012-07-30 Eli Zaretskii <eliz@gnu.org>
3786
3787 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3788 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3789
3790 * w32term.c <w32_keyboard_codepage>: Renamed from
3791 keyboard_codepage and now external. All users changed.
3792
3793 * w32term.h: Add declaration of w32_keyboard_codepage.
3794
3795 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3796 the codepage to translate keys to Unicode. If this argument is
3797 -1, use the value returned by GetConsoleCP. All callers changed.
3798
88fb40b4
PE
37992012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3800
0aee6912
PE
3801 Update .PHONY listings in makefiles.
3802 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3803 bootstrap-clean, distclean, maintainer-clean, versioclean,
3804 extraclean, frc.
3805
88fb40b4
PE
3806 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3807 This is a bit clearer. Fix some commentary typos.
3808
0a763bd1
GM
38092012-07-30 Glenn Morris <rgm@gnu.org>
3810
32bac6d6
GM
3811 * s/netbsd.h: Let configure include signal.h if needed.
3812 Remove file, which is now empty.
3813
b65e7c46
GM
3814 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3815 Let configure set them.
3816 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3817 No more need to undefine.
0a763bd1 3818
169304bd
AS
38192012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3820
3821 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3822 non-single-byte char when adding meta modifier. (Bug#12090)
3823
6cd7a139
DA
38242012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3825
3826 Convert safe_call to use variable number of arguments.
3827 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3828 (safe_call2): Fix comment.
3829 * lisp.h (safe_call): Adjust prototype.
3830 * coding.c (encode_coding_object): Change to use safe_call2.
3831 * xfaces.c (merge_face_heights): Change to use safe_call1.
3832
d34d6ffc
GM
38332012-07-30 Glenn Morris <rgm@gnu.org>
3834
7b8a48e4 3835 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 3836 does that unconditionally. Remove file, which is now empty.
7b8a48e4 3837
d34d6ffc
GM
3838 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3839 Remove empty files.
3840
03a660a6
PE
38412012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3842
3843 Export to GDB most of lisp.h's remaining object-like macros.
3844 * lisp.h (min, max): Move earlier, because they're used earlier now.
3845 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3846 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3847 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3848 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3849 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3850 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3851 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3852 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3853 Now constants, for GDB. They need not be macros.
3854 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3855 Now constants, for GDB, as well as macros, for static initializers.
3856 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3857 Move to after the definition of struct Lisp_Char_Table,
3858 since the former now needs that type defined.
3859 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3860 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3861 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3862 New enums, for gdb_make_enums_visible.
3863 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 3864 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
3865 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3866 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3867 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3868 enum maxargs, enum MAX_ALLOCA.
3869 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3870 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3871 no longer needed, now that they are done in lisp.h.
3872
e499d0ee
DA
38732012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3874
3875 Cleanup string bytes checking.
3876 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3877 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3878 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3879 (check_sblock, compact_small_strings): Simplify.
3880
d5040d2d
PE
38812012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3882
3883 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3884 These macros are confusing and no longer need to be defined, as
3885 the enum values now suffice. All uses replaced with definiens.
3886 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3887
7f259ae6
JB
38882012-07-29 Juanma Barranquero <lekktu@gmail.com>
3889
3890 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3891 ($(BLD)/w32console.$(O)): Update dependencies.
3892
7e63e0c3
DA
38932012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3894
3895 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3896 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3897 time. Adjust users.
3898 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3899
ffd817eb
JD
39002012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3901
3902 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3903 setting sitelisp (Bug#12010).
3904
417a7a0e
EZ
39052012-07-29 Eli Zaretskii <eliz@gnu.org>
3906
14ae4239 3907 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
3908
3909 * w32heap.c (cache_system_info):
3910 * w32.c (sys_rename):
3911 * w32proc.c (find_child_console, sys_kill): All users changed.
3912
387d4d92
PE
39132012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3914
3915 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3916
55a6cca6
EZ
39172012-07-29 Eli Zaretskii <eliz@gnu.org>
3918
3919 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3920
dbcf001c
DA
39212012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3922
3923 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
3924 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3925 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 3926
e2688e4a
DA
39272012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3928
3929 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3930 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3931 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3932 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3933 (replace_range, replace_range_2, del_range_2): Change to eassert.
3934 * marker.c (byte_char_debug_check): Adjust style.
3935
b46a6a83
PE
39362012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3937
3938 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3939 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3940 long-ago-commented-out code that talks about "WIN32".
3941 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3942 All uses changed.
3943
e32a5799
PE
39442012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3945
3946 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3947 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3948 Simplify by using alignof.
3949 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3950 * lisp.h: Include <stdalign.h>.
3951 (GCALIGNMENT): New macro and constant.
3952 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3953 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3954 (stdalign): New macro, if not already defined.
3955
df81cd29
EZ
39562012-07-28 Eli Zaretskii <eliz@gnu.org>
3957
01bd1b0d
EZ
3958 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3959 * w32inevt.c: Include w32inevt.h.
3960 (w32_read_console_input): New inline function, calls either
3961 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3962 w32_console_unicode_input.
3963 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3964 (w32_kbd_patch_key, key_event): Use the codepage returned by
3965 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3966 (key_event): use uChar.UnicodeChar only if
3967 w32_console_unicode_input is non-zero.
3968
3969 * w32console.c: Include w32heap.h.
3970 <w32_console_unicode_input>: New global variable.
3971 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3972 family of Windows, zero otherwise.
3973
3974 * w32inevt.h: Declare w32_console_unicode_input.
3975
df81cd29
EZ
3976 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3977 --without-x. (Bug#11742)
3978
c20fdd9e
PE
39792012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3980
3981 Adjust GDB to reflect pvec_type changes (Bug#12036).
3982 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
3983 2012-07-04 changes to pseudovector representation.
3984 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 3985
32770973 39862012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
3987
3988 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3989 bus address.
3990 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3991
3438fe21
EZ
39922012-07-27 Eli Zaretskii <eliz@gnu.org>
3993
bcfbc9de
EZ
3994 * alloc.c (listn): Fix the order the arguments are consed onto the
3995 list.
3996
3438fe21
EZ
3997 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3998 enumeration constants, as PURE and HEAP are too general, and clash
3999 with other headers and sources, such as gmalloc.c and the
4000 MS-Windows system headers. All users changed.
4001
eeaea515
DA
40022012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4003
4004 Revert last save_excursion_save and save_excursion_restore changes.
4005 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4006 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4007
073c88c2
DA
40082012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4009
4010 Fix recently-introduced typos in Windows port.
4011 Reported by Martin Rudalics <rudalics@gmx.at>.
4012 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 4013 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 4014
4706125e
PE
40152012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4016
4017 Improve GDB symbol export (Bug#12036).
4018 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4019 arms of an 'if', not using conditional expressions; otherwise GDB
4020 complains about the types in the unevaluated arm when the argument
4021 is an integer literal.
4022 (xgetint): Simplify expression.
4023 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4024 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4025 Zaretskii in <http://bugs.gnu.org/12036#13>.
4026 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4027 needed now that we have gdb_make_enums_visible.
4028 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4029 (enum enum_USE_LSB_TAG):
4030 New enum types, packaging up enums that need to be exported to GDB.
4031
694b6c97
DA
40322012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4033
4034 Utility function to make a list from specified amount of objects.
4035 * lisp.h (enum constype): New datatype.
4036 (listn): New prototype.
4037 * alloc.c (listn): New function.
4038 (Fmemory_use_count, syms_of_alloc): Use it.
4039 * buffer.c (syms_of_buffer): Likewise.
4040 * callint.c (syms_of_callint): Likewise.
4041 * charset.c (define_charset_internal): Likewise.
4042 * coding.c (syms_of_coding): Likewise.
4043 * keymap.c (syms_of_keymap): Likewise.
4044 * search.c (syms_of_search): Likewise.
4045 * syntax.c (syms_of_syntax): Likewise.
4046 * w32.c (init_environment): Likewise.
4047 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4048 * xdisp.c (syms_of_xdisp): Likewise.
4049 * xfns.c (syms_of_xfns): Likewise.
4050
6195f384
DA
40512012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4052
4053 Fast save_excursion_save and save_excursion_restore.
4054 * lisp.h (struct Lisp_Excursion): New data type.
4055 (PVEC_EXCURSION): New pseudovector type.
4056 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
4057 to deal with it. Adjust comments.
4058 (init_marker, attach_marker): New prototype.
4059 (unchain_marker): Adjust prototype.
4060 * marker.c (attach_marker): Change to global.
4061 (init_marker): New function.
4062 * alloc.c (Fmake_marker, build_marker): Use it.
4063 (build_marker): More easserts.
4064 (mark_object): Handle struct Lisp_Excursion.
4065 * editfns.c (save_excursion_save, save_excursion_restore):
4066 Reimplement to use struct Lisp_Excursion. Add comments.
4067
5eceb8fb
PE
40682012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4069
4070 Fix export of symbols to GDB (Bug#12036).
4071 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
4072 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
4073 emacs.c, as this is a more-suitable home. Had this been done earlier
4074 the fix for 12036 would have avoided some of the problems noted in
4075 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
4076 would have been more obvious.
562157c8
PE
4077 * emacs.c: Do not include <verify.h>; no longer needed.
4078 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
4079 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
4080 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4081 Remove; now done in lisp.h.
4082 * lisp.h (PUBLISH_TO_GDB): New macro.
4083 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
4084 (DATA_SEG_BITS): Use it.
4085 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
4086 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
4087 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
4088 not be usable in #if. This simplifies things.
4089
d6749401
JB
40902012-07-26 Juanma Barranquero <lekktu@gmail.com>
4091
4092 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
4093
1781b9e9
PE
40942012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4095
d89518db 4096 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
4097 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
4098 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
4099 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
4100 Adjust to changes in lisp.h and emacs.c, by using
4101 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
4102 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
4103 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
4104 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
4105 instead of gdb_valbits.
4106 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
4107 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
4108 instead of gdb_array_mark_flag.
4109 (xboolvector): Get size from $->size, not $->header.size.
4110 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
4111 (xreload, hook-run, hookpost-run): Remove.
4112 * emacs.c: Include <verify.h>.
4113 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
4114 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
4115 Remove.
4116 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
4117 (gdb_USE_LSB_TAG): New enum constants.
4118 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4119 Also define these as enum constants, so they're visible to GDB.
4120 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4121 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4122 as constants, so they're visible to GDB.
4123 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4124 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4125 Now enum constants, not macros, so they're visible to GDB.
4126 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4127 more convenient now. All uses changed.
4128 (VALMASK) [USE_LSB_TAG]: Also define in this case.
4129 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4130
3628596a
DA
41312012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
4132
4133 Explicitly free restriction data that are not needed anymore.
4134 * editfns.c (save_restriction_restore): Free restriction data.
4135
7abaf5cc
SM
41362012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
4137
4138 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4139 add argument, tune behavior, and adjust all callers.
4140
71f88e00
PE
41412012-07-25 Paul Eggert <eggert@cs.ucla.edu>
4142
4143 Use typedef for EMACS_INT, EMACS_UINT.
4144 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4145 than macros. This simplifies debugging in the usual case, since
4146 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4147 and it allows expressions involving EMACS_INT casts.
4148 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4149
57ec3034
JD
41502012-07-25 Jan Djärv <jan.h.d@swipnet.se>
4151
4152 * nsterm.m (ns_read_socket): Return early if there is a modal
4153 window (Bug#12043).
4154
8137e7b3
MR
41552012-07-25 Martin Rudalics <rudalics@gmx.at>
4156
4157 * frame.c (Fredirect_frame_focus): In doc-string don't mention
4158 that FOCUS-FRAME can be omitted.
4159
04e9897c
DA
41602012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
4161
4162 Adjust buffer text indirection counters at the end of Fkill_buffer.
4163 * buffer.c (Fkill_buffer): Adjust indirection counters when the
4164 buffer is definitely dead. This should really fix an issue reported
4165 by Christoph Scholtes again. (Bug#12007).
4166 (init_buffer_once): Initialize indirection counters of
4167 buffer_defaults and buffer_local_symbols (for sanity and safety).
4168
8a0484e1
EZ
41692012-07-24 Eli Zaretskii <eliz@gnu.org>
4170
4171 * xdisp.c (init_iterator): Don't compute dimensions of truncation
4172 and continuation glyphs on tooltip frames, leave them at zero.
4173 Avoids continued lines in tooltips. (Bug#11832)
4174
fa691a83
DA
41752012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
4176
4177 Simplify copy_overlay.
04e9897c 4178 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
4179 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4180
436bc8e0
EZ
41812012-07-23 Eli Zaretskii <eliz@gnu.org>
4182
4183 * print.c (print_object): Don't crash when a frame's name is nil
4184 or invalid. (Bug#12025)
4185
4186 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4187 it signals an error when a tooltip frame is being created.
4188
d7a7fda3
DA
41892012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4190
4191 Cleanup miscellaneous objects allocation and initialization.
4192 * alloc.c (allocate_misc): Change to static. Add argument to
4193 specify the subtype. Adjust comment and users.
4194 (build_overlay): New function.
4195 * buffer.c (copy_overlays, Fmake_overlay): Use it.
4196 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4197 (allocate_misc): Remove prototype.
4198 (build_overlay): Add prototype.
4199
42002012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
4201
4202 Swap buffer text indirection counters in Fbuffer_swap_text.
4203 * buffer.c (Fbuffer_swap_text): Swap indirections too.
4204 This avoids crash reported by Christoph Scholtes at
4205 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4206
9d7fa573
JD
42072012-07-22 Jan Djärv <jan.h.d@swipnet.se>
4208
4209 * nsmenu.m (Popdown_data): New struct.
4210 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
4211 free Popdown_data.
4212 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
4213 (initWithContentRect): Make imgView and contentView non-static
4214 and autorelease them. Also autorelease img and matrix (Bug#12005).
4215 (dealloc): Remove (Bug#12005).
4216
0dd6d66d
DA
42172012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4218
4219 Adjust consing_since_gc when objects are explicitly freed.
4220 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
4221 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
4222 (free_cons, free_misc): Subtract object size from consing_since_gc.
4223
d36d71df
DA
42242012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4225
4226 Simplify and cleanup markers positioning code.
4227 * marker.c (attach_marker): More useful eassert.
4228 (live_buffer, set_marker_internal): New function.
4229 (Fset_marker, set_marker_restricted): Use set_marker_internal.
4230 (set_marker_both, set_marker_restricted_both): Use live_buffer.
4231
fb9ea40f
PE
42322012-07-22 Paul Eggert <eggert@cs.ucla.edu>
4233
4234 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
4235 as it's limited by the amount of memory, not by INT_MAX.
4236
2d5c5f7d
EZ
42372012-07-21 Eli Zaretskii <eliz@gnu.org>
4238
07fb592e
EZ
4239 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
4240 in special-event-map. See the discussion at
4241 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4242 for the reasons.
4243
37a9eac8 4244 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
4245 info.dwItemData. Fixes crashes on 64-bit Windows.
4246 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 4247
c4328746
JD
42482012-07-21 Jan Djärv <jan.h.d@swipnet.se>
4249
fc0c31f8 4250 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 4251 (conversationIdentifier): Return value is NSInteger.
784051c4 4252 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 4253
6e5d1c12
CY
42542012-07-21 Chong Yidong <cyd@gnu.org>
4255
4256 * window.c (decode_any_window): Signal an error if the window is
4257 on a dead frame (Bug#11984).
4258
9928463d
DA
42592012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4260
4261 Add indirection counting to speed up Fkill_buffer.
4262 * buffer.h (struct buffer): New member.
4263 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4264 (Fmake_indirect_buffer): Set indirection counter to -1, increment
4265 base buffer indirection counter.
4266 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4267 (Fkill_buffer): Adjust indirection counters as needed, don't walk
4268 through buffer list if indirection counter is 0.
4269
f8643a6b
DA
42702012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4271
4272 Extend the value returned by Fgarbage_collect with heap statistics.
4273 * alloc.c (Qheap): New symbol.
4274 (syms_of_alloc): DEFSYM it.
4275 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4276 (Fmemory_free): Remove.
4277 (syms_of_alloc): Don't defsubr it.
4278 * buffer.c (Fcompact_buffer): Remove.
4279 (syms_of_buffer): Don't defsubr it.
4280
dac616ff
DA
42812012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4282
4283 Make maybe_gc inline.
4284 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4285 * lisp.h (consing_since_gc, gc_relative_threshold)
4286 (memory_full_cons_threshold): Revert declaration.
4287 (maybe_gc): Remove prototype, define as inline.
4288 * alloc.c: Remove old commented-out code.
4289 (consing_since_gc, gc_relative_threshold)
4290 (memory_full_cons_threshold): Revert to global.
4291 (maybe_gc): Remove.
4292
d7ea76b4
DA
42932012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4294
4295 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4296 * lisp.h (build_unibyte_string): New function.
4297 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4298 * sysdep.c, w32fns.c, xfns.c: Use it.
4299 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4300 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4301 Adjust users accordingly.
4302 * font.h (font_open_by_name): Adjust prototype.
4303
765e61e3
DA
43042012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4305
4306 Cleanup calls to Fgarbage_collect.
4307 * lisp.h (maybe_gc): New prototype.
4308 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4309 Remove declarations.
4310 * alloc.c (maybe_gc): New function.
4311 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4312 Make them static.
4313 * bytecode.c (MAYBE_GC): Use maybe_gc.
4314 * eval.c (eval_sub, Ffuncall): Likewise.
4315 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4316 to avoid dependency from auto-save feature.
4317
52b852c7
PE
43182012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4319
4320 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4321 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4322 'for_each_per_buffer_object_at'.
4323 All uses changed. It's better to use upper-case for macros that
4324 cannot be implemented as functions, to give the reader a clue
4325 that they're special.
4326
5db81e33
SM
43272012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4328
4329 * alloc.c (Fgarbage_collect): Tweak docstring.
4330
5b835e1d
DA
43312012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4332
4333 Tweak the value returned from Fgarbage_collect again.
4334 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4335 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4336 Adjust documentation.
4337 (total_vector_bytes): Rename to total_vector_slots, adjust
4338 accounting.
4339 (total_free_vector_bytes): Rename to total_free_vector_slots,
4340 adjust accounting.
4341 (Qstring_bytes, Qvector_slots): New symbols.
4342 (syms_of_alloc): DEFSYM them.
4343
9cd47b72
DA
43442012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4345
4346 Buffer compaction primitive which may be used from Lisp.
4347 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4348 (syms_of_buffer): Register Fcompact_buffer.
4349 * alloc.c (Fgarbage_collect): Use compact_buffer.
4350 * buffer.h (compact_buffer): New prototype.
4351 (struct buffer_text): New member.
4352
d17337e5
DA
43532012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4354
4355 New macro to iterate over all buffers, miscellaneous cleanups.
4356 * lisp.h (all_buffers): Remove declaration.
4357 * buffer.h (all_buffers): Add declaration, with comment.
4358 (for_each_buffer): New macro.
4359 * alloc.c (Fgarbage_collect, mark_object): Use it.
4360 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4361 (init_buffer): Likewise.
4362 * data.c (Fset_default): Likewise.
4363 * coding.c (code_conversion_restore): Remove redundant check
4364 for dead buffer.
4365 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4366
60cfd278
AS
43672012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4368
4369 Fix bug that created negative-length intervals.
4370 * intervals.c (merge_interval_right, merge_interval_left):
4371 Do not zero out this interval if it is absorbed by its children,
4372 as this interval's total length doesn't change in that case. See
4373 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4374
d06714cb
PE
43752012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4376
83713154
PE
4377 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4378 when invoking (make-bool-vector N t) and N is a positive
4379 multiple of 8 -- the last 8 bits were mistakenly cleared.
4380
d06714cb
PE
4381 Remove some struct layout assumptions in bool vectors.
4382 * alloc.c (bool_header_size): New constant.
4383 (header_size, word_size): Move earlier, as they're now used earlier.
4384 Use 'word_size' in a few more places, where it's appropriate.
4385 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4386 padding before the data member of a bool vector.
4387 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4388 than doing the check by hand with an abort ().
4389
464d5a5e
SM
43902012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4391
5fbc0409
SM
4392 * eval.c (Fdefvar): Don't check constants since we only set the var if
4393 it's not yet defined anyway (bug#11904).
4394
464d5a5e
SM
4395 * lisp.h (last_undo_boundary): Declare new var.
4396 * keyboard.c (command_loop_1): Set it.
4397 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4398 were auto-added by the command loop (bug#11774).
4399
8dc2e44a
AS
44002012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4401
4402 * w32font.c (Qsymbol): Remove local definition.
4403 (syms_of_w32font): Don't DEFSYM it.
4404
169925ec
DA
44052012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4406
4407 Fix sweep_vectors to handle large bool vectors correctly.
4408 * alloc.c (sweep_vectors): Account total_vector_bytes for
4409 bool vectors larger than VBLOCK_BYTES_MAX.
4410
5fbfb018
CY
44112012-07-18 Chong Yidong <cyd@gnu.org>
4412
4413 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4414 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4415
3ab6e069
DA
44162012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4417
4418 Return more descriptive data from Fgarbage_collect.
4419 Suggested by Stefan Monnier in
4420 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4421 * alloc.c (bounded_number): New function.
4422 (total_buffers, total_vectors): New variable.
4423 (total_string_size): Rename to total_string_bytes, adjust users.
4424 (total_vector_size): Rename to total_vector_bytes, adjust users.
4425 (sweep_vectors): Account total_vectors and total_vector_bytes.
4426 (Fgarbage_collect): New return value. Adjust documentation.
4427 (gc_sweep): Account total_buffers.
4428 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4429 (VECTOR_SIZE): Remove.
4430 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4431 (Qinterval, Qmisc): New symbols.
4432 (syms_of_data): Initialize them.
4433 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4434 (Qcons, Qbuffer): New declarations.
4435
6d02fe5b
PE
44362012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4437
4438 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4439 Round up, not down. Improve doc.
4440
b7ffe040
DA
44412012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4442
4443 Restore old code in allocate_string_data to avoid Faset breakage.
4444 Reported by Julien Danjou <julien@danjou.info> in
4445 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4446 * alloc.c (allocate_string_data): Restore old code with minor
4447 adjustments, fix comment to explain this subtle issue.
4448
4dc7c8d5
SM
44492012-07-17 Eli Zaretskii <eliz@gnu.org>
4450
4451 Remove FILE_SYSTEM_CASE.
4452 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4453
4454 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4455 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4456 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4457 call-process-region passes it through expand-file-name.
4458
4459 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4460
44612012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4462
4463 Fix crash when creating indirect buffer (Bug#11917)
4464 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4465 Don't handle unbound variables specially if non-zero.
4466 (Fbuffer_local_variables): Pass zero.
4467 (clone_per_buffer_values): Pass non-zero.
4468
44692012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4470
4471 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4472 to make the loop interruptible.
4473
44742012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4475
4476 * gnutls.c (emacs_gnutls_handshake): Only retry if
4477 GNUTLS_E_INTERRUPTED.
4478
cce7fefc
DA
44792012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4480
4481 Cleanup and convert miscellaneous checks to eassert.
4482 * alloc.c (mark_interval): Fix comment, partially rephrase
4483 old comment from intervals.h (see below).
4484 * intervals.c (find_interval, adjust_intervals_for_insertion)
4485 (delete_interval, adjust_intervals_for_deletion)
4486 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4487 Convert to eassert.
4488 (adjust_intervals_for_insertion, make_new_interval):
4489 Remove obsolete and unused code.
4490 * intervals.h (struct interval): Remove obsolete comment.
4491 * textprotp.c (erase_properties): Remove unused code.
4492 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4493 (Fremove_list_of_text_properties): Convert to eassert.
4494
9ea10cc3
CY
44952012-07-17 Chong Yidong <cyd@gnu.org>
4496
4497 * editfns.c (Finsert_char): Doc fix.
4498
3900d5de
DA
44992012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4500
4501 Fix previous change to make Fmemory_free always accurate.
4502 * alloc.c (make_interval): Update total_free_intervals.
4503 (make_float): Likewise for total_free_floats.
4504 (free_cons, Fcons): Likewise for total_free_conses.
4505 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4506 Likewise for total_free_vector_bytes.
4507 (Fmake_symbol): Likewise for total_free_symbols.
4508 (bytes_free): Remove.
4509
7098646f
DA
45102012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4511
4512 Simple free memory accounting feature.
4513 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4514 (sweep_vectors): Accumulate size of free vectors.
4515 (Fgarbage_collect): Setup bytes_free.
4516 (Fmemory_free): New function.
4517 (syms_of_alloc): Register it.
4518
22657b40
DA
45192012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4520
4521 Cleanup overlays checking.
4522 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4523 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4524 eassert and OVERLAYP.
4525 (sort_overlays): Change to use OVERLAYP.
4526
ddfc8813
RK
45272012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4528
4529 * editfns.c (Finsert_char): Make it interactive, and make the
4530 second arg optional. Copy interactive spec and docstring from
4531 ucs-insert.
4532
7c26cf3c
PE
45332012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4534
4535 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4536 Unlike the other wrapped functions, fabs has an unspecified
4537 effect on errno.
4538
5d127af9
JD
45392012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4540
4541 * nsterm.m (keyDown): Interpret flags without left/right bits
4542 as the left key (Bug#11670).
4543
6a0dd1d7
DA
45442012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4545
4546 Remove empty and useless init functions.
4547 * lisp.h (init_character_once, init_fns, init_image)
4548 (init_filelock, init_sound): Remove prototype.
4549 * character.c (init_character_once): Remove.
4550 * filelock.c (init_filelock): Likewise.
4551 * fns.c (init_fns): Likewise.
4552 * image.c (init_image): Likewise.
4553 * sound.c (init_sound): Likewise.
4554 * emacs.c (main): Adjust accordingly.
4555
7a6136fd
DA
45562012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4557
4558 * gtkutil.h: Tiny cleanups.
4559 (use_old_gtk_file_dialog): Remove useless declaration.
4560 (xg_uses_old_file_dialog): Add suggested const attribute.
4561
ce811ad9
EZ
45622012-07-15 Eli Zaretskii <eliz@gnu.org>
4563
4564 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4565 (bidi_paragraph_init): Use it to limit search forward for a strong
4566 directional character in abnormally large paragraphs full of
4567 neutral or weak characters. (Bug#11943)
4568
c9adfeaa
SF
45692012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4570
4571 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4572 the toolbar (Bug#9451).
4573 (xg_make_tool_item): Give the widget event box a transparent
4574 background.
4575
fff62aa9
DA
45762012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4577
4578 Cleanup basic allocation variables and functions.
4579 * alloc.c (ignore_warnings, init_intervals, init_float)
4580 (init_cons, init_symbol, init_marker): Remove.
4581 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4582 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4583 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4584 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4585 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4586 (staticidx, init_alloc_once, init_strings, free_ablock):
4587 Remove redundant initialization.
4588 * fns.c (init_weak_hash_tables): Remove.
4589 * lisp.h (init_weak_hash_tables): Remove prototype.
4590
9730daca
DA
45912012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4592
4593 Use zero_vector where appropriate.
4594 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4595 accordingly.
4596 * lisp.h (zero_vector): New declaration.
4597 * font.c (null_vector): Remove.
4598 (syms_of_font): Remove initialization and staticpro.
4599 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4600 * keymap.c (Faccessible_keymaps): Likewise.
4601
2e2d2a13
LL
46022012-07-15 Leo Liu <sdl.web@gmail.com>
4603
4604 * fringe.c: Fix typo in comments.
4605
cd276f6e
LL
46062012-07-14 Leo Liu <sdl.web@gmail.com>
4607
4608 * fringe.c: Add a new bitmap exclamation-mark.
4609
5a1131d9
EZ
46102012-07-14 Eli Zaretskii <eliz@gnu.org>
4611
4612 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4613
4614 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4615 (HAVE_MENUS): Don't define, defined by editing config.in with
4616 msdos/sed2v2.inp.
4617 (GMALLOC_INHIBIT_VALLOC): Don't define.
4618 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4619
22e983b7
JB
46202012-07-14 Juanma Barranquero <lekktu@gmail.com>
4621
4622 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4623
5b3f250f
GM
46242012-07-14 Glenn Morris <rgm@gnu.org>
4625
4626 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4627 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4628 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4629
33d63ff4
GM
46302012-07-13 Glenn Morris <rgm@gnu.org>
4631
5b633342
GM
4632 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4633
33d63ff4
GM
4634 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4635 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4636
b55b9f85
JD
46372012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4638
0dc8cf50
JD
4639 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4640 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4641 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4642 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4643 where appropriate.
4644 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4645 as boolean expression.
4646 (x_set_window_size): Remove unused variable toolbar.
4647 (ns_get_color_default, ns_mod_to_lisp): Remove.
4648 (ns_mouse_position): Remove unused variables xchar and ychar.
4649 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4650 (ns_set_vertical_scroll_bar): Remove unused variable count.
4651 (ns_delete_terminal): Remove unused variable i.
4652 (ns_term_init): Remove unused variables r, g and b.
4653 (mouseDown): Remove unused variable window.
4654 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4655 (initFrameFromEmacs): Remove unused variable vbextra.
4656 (mouseEntered): Remove unused variables p and dpyinfo.
4657 (mouseExited): Remove unused variables p and r.
4658 (ns_define_frame_cursor, ns_clear_frame_area)
4659 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4660 (menuDown): Assign [sender tag] to variable and cast the variable.
4661
4662 * nsterm.h (menuDown): Add id as type to argument sender.
4663 (ns_display_info_for_name): Add Lisp_Object argument.
4664 (ns_term_init): Add Lisp_Object argument.
4665 (ns_map_event_to_object): Add void argument.
4666 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4667 prototype with arguments and only declare if __OBJC__.
4668 (nxatoms_of_nsselect): Add void argument.
4669 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4670 (ns_alloc_autorelease_pool): Add void argument.
4671 (ns_release_autorelease_pool): Add void* argument.
4672 (ns_get_defaults_value): Add const char* argument.
4673
4674 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4675 (initFromContents): Use SSDATA where appropriate.
4676 (ns_update_menubar): Add braces to ambigous if-else.
4677 (initWithTitle): Put () around assignment in if statement.
4678 (ns_menu_show): Remove unused variables window and keymap.
4679 (update_frame_tool_bar): Remove unused variable selected_p.
4680 (initWithContentRect): Remove unused variable this_cmd_name.
4681
4682 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4683 appropriate.
4684 (setXBMColor): Remove unused variable len.
4685 (setPixmapData): Put () around assignment in loop statement.
4686
4687 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4688 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4689 where appropriate.
4690 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4691 around assignment in loop statement.
4692 (nsfont_open): Remove unused variable i.
4693 (nsfont_open): Remove unused variable len.
4694 (nsfont_draw): Remove unused variable cs.
4695
4696 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4697 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4698 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4699 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4700 (Fns_font_name, Fns_perform_service)
4701 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4702 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4703 (ns_set_name): Remove unused variable view.
4704 (x_set_menu_bar_lines): Remove unused variable olines.
4705 (x_set_tool_bar_lines): Remove unused variable root_window.
4706 (Fns_list_colors): Put () around assignment in while statement.
4707 (Fns_perform_service): Remove unused variable len.
4708 (Fns_display_usable_bounds): Remove unused variable top.
4709 (syms_of_nsfns): Remove unused variable i.
4710
b55b9f85
JD
4711 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4712 memcpy (Bug#11907).
4713
ed9265fc 47142012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
4715
4716 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4717 and free it with DestroyExceptionInfo (Bug#11558).
4718
ef099b57
JB
47192012-07-13 Juanma Barranquero <lekktu@gmail.com>
4720
4721 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4722 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4723 Set here, not in nt/config.nt.
4724
ea814a5d
EZ
47252012-07-13 Eli Zaretskii <eliz@gnu.org>
4726
4727 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4728 cursor overflow into the last glyph on display line when the right
4729 fringe is off. (Bug#11832)
4730
1a952767
PE
47312012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4732
4733 * xdisp.c (produce_special_glyphs): Now static.
4734 * dispextern.h (produce_special_glyphs): Remove decl.
4735
983188fd
GM
47362012-07-13 Glenn Morris <rgm@gnu.org>
4737
8d7c7eed 4738 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
4739 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4740
983188fd
GM
4741 * s/usg5-4-common.h (USG, USG5):
4742 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4743 * s/sol2-6.h (SOLARIS2):
4744 * s/irix6-5.h (IRIX6_5):
4745 * s/hpux10-20.h (USG, USG5, HPUX):
4746 * s/gnu-linux.h (USG, GNU_LINUX):
4747 * s/freebsd.h (BSD_SYSTEM):
4748 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4749 * s/cygwin.h (CYGWIN):
4750 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4751 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4752
d1e68667 47532012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
4754
4755 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 4756
6de0e799
GM
47572012-07-13 Glenn Morris <rgm@gnu.org>
4758
739ae010
GM
4759 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4760
dbee5793
GM
4761 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4762
6de0e799
GM
4763 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4764 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4765
b82da769
GM
47662012-07-12 Glenn Morris <rgm@gnu.org>
4767
4fae5a7a 4768 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
4769
4770 * process.c (init_process_emacs): Rename from init_process.
4771 The old name is also the name of a Mach system call.
4772 * lisp.h, emacs.c: Update for this name change.
4773 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4774 longer needed.
4775
5a979817
EZ
47762012-07-12 Eli Zaretskii <eliz@gnu.org>
4777
4778 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4779 memmove call that removes glyphs covered by the left truncation
4780 glyph. Improve commentary.
4781 (display_line): Fix display of continuation glyphs on GUI frames
4782 when the right fringe is turned off and variable-size fonts are
4783 used in the window. Move the code that appends a stretch glyph to
4784 produce_special_glyphs, so that it could be used for truncation
4785 and continuation glyphs alike.
4786 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4787 glyph of a suitably computed width, to align the special glyphs at
4788 the window margin. Code moved from display_line. (Bug#11832)
4789
3e91a053
GM
47902012-07-12 Glenn Morris <rgm@gnu.org>
4791
ba9e4b84
GM
4792 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4793
4794 * s/gnu-linux.h, s/hpux10-20.h:
4795 Do not unconditionally define HAVE_XRMSETDATABASE.
4796
3e91a053
GM
4797 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4798
b300b1f4
PE
47992012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4800
4801 Fix typos that broke OS X build.
4802 Reported by Randal L. Schwartz in
4803 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4804 * nsterm.m (ns_timeout): Add missing local decl.
4805 (ns_get_color): snprintf -> sprintf, to fix typo.
4806
6e777848
GM
48072012-07-12 Glenn Morris <rgm@gnu.org>
4808
3f922c37
GM
4809 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4810 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4811 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4812 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4813
0ab7b23a
GM
4814 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4815 Move PTY_OPEN to configure.
4816
6e777848
GM
4817 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4818 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4819 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4820
4a7edc24
DA
48212012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4822
4823 Use empty_unibyte_string where applicable.
4824 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4825 * lread.c (read1): Likewise.
4826 * xsettings.c (syms_of_xsettings): Likewise.
4827
308aab79
GM
48282012-07-12 Glenn Morris <rgm@gnu.org>
4829
42bd1719
GM
4830 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4831 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
4832 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4833 * s/hpux10-20.h (RUN_TIME_REMAP):
4834 * s/bsd-common.h (TABDLY): Move to configure.
4835
4836 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4837
4838 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4839
ea0bbd17 4840 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 4841 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
4842
4843 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 4844
308aab79
GM
4845 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4846 * s/template.h: Move NARROWPROTO to configure.
4847
ee1cf5cf
GM
48482012-07-11 Glenn Morris <rgm@gnu.org>
4849
30fe9bf4
GM
4850 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4851 unused since 2011-01-17 change to systty.h.
4852
ee1cf5cf
GM
4853 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4854 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4855 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4856
63e47e07
PE
48572012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4858
4859 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4860
c43fb4c3
GM
48612012-07-11 Glenn Morris <rgm@gnu.org>
4862
4863 * s/darwin.h, s/gnu-linux.h, s/template.h:
4864 Move INTERRUPT_INPUT to configure.
4865
e8df9267
DA
48662012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4867
4868 Minor adjustments to interning code.
4869 * lisp.h (intern, intern_c_string): Redefine as static inline
4870 wrappers for intern_1 and intern_c_string_1, respectively.
4871 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
4872 * lread.c (intern_1, intern_c_string_1, oblookup):
4873 Simplify Vobarray checking.
e8df9267
DA
4874 * font.c (font_intern_prop): Likewise. Adjust comment.
4875 * w32font.c (intern_font_name): Likewise.
4876
34348bd4
AS
48772012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4878
d96a1e0c
AS
4879 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4880
34348bd4
AS
4881 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4882 of Fcar/Fcdr if possible.
4883 * font.c (check_otf_features): Likewise.
4884 * fontset.c (Fnew_fontset): Likewise.
4885 * gnutls.c (Fgnutls_boot): Likewise.
4886 * minibuf.c (read_minibuf): Likewise.
4887 * msdos.c (IT_set_frame_parameters): Likewise.
4888 * xmenu.c (Fx_popup_dialog): Likewise.
4889 * w32menu.c (Fx_popup_dialog): Likewise.
4890
c8add24e
GM
48912012-07-11 Glenn Morris <rgm@gnu.org>
4892
4b575b3c
GM
4893 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4894 since nothing has defined it on these platforms.
4895
09f4e3b0
GM
4896 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4897 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4898
172bedef
GM
4899 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4900 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4901 Move CLASH_DETECTION to configure.
4902
249685df
GM
4903 * s/gnu.h: Remove file, which is now empty.
4904
c8add24e
GM
4905 * s/gnu.h, s/gnu-linux.h:
4906 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4907
b41253a3
JW
49082012-07-11 John Wiegley <johnw@newartisans.com>
4909
4910 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4911 function attribute, so we only use it if it exists in the
4912 compiler.
4913
d923b542
DA
49142012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4915
4916 Avoid call to strlen in fast_c_string_match_ignore_case.
4917 * search.c (fast_c_string_match_ignore_case): Change to use
4918 length argument. Adjust users accordingly.
4919 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4920
5ebbef1d
PE
49212012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4922
bb352260
PE
4923 Assume mkdir, rmdir.
4924 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4925 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4926
57054ddd
PE
4927 Assume rename.
4928 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4929
b747d3f7
PE
4930 Assume perror.
4931 * s/hpux10-20.h (HAVE_PERROR): Remove.
4932 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4933 Remove dummy definition, as this problem was obsolete long ago.
4934
5ebbef1d
PE
4935 Assume strerror.
4936 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4937
984e7f30
DA
49382012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4939
4940 Avoid calls to strlen in font processing functions.
4941 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
4942 (font_open_by_name): Change to use length argument.
4943 Adjust users accordingly.
d923b542
DA
4944 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4945 Adjust prototypes.
4946 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4947 Change to return ptrdiff_t.
984e7f30
DA
4948 (xfont_list_pattern, xfont_match): Use length returned by
4949 xfont_decode_coding_xlfd.
4950 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4951
20e94fdd
GM
49522012-07-11 Glenn Morris <rgm@gnu.org>
4953
9d596af3
GM
4954 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4955 Move DONT_REOPEN_PTY to configure.
4956
20e94fdd
GM
4957 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4958 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4959
e99a530f
PE
49602012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4961
22ffb973
PE
4962 Remove "#define unix" that is no longer needed (Bug#11905).
4963 * s/aix4-2.h (unix): Remove; no longer needed.
4964
e9a9ae03
PE
4965 EMACS_TIME simplification (Bug#11875).
4966 This replaces macros (which typically do not work in GDB)
4967 with functions, typedefs and enums, making the code easier to debug.
4968 The functional style also makes code easier to read and maintain.
4969 * systime.h: Include <sys/time.h> on all hosts, not just if
4970 WINDOWSNT, since 'struct timeval' is needed in general.
4971 (EMACS_TIME): Now a typedef, not a macro.
4972 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4973 not macros.
4974 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4975 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4976 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4977 (EMACS_TIME_LE): Now functions, not macros.
4978 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4979 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4980 which are not functions. All uses rewritten to use:
4981 (make_emacs_time): New function.
4982 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4983 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4984 not functions. All uses rewritten to use the following, respectively:
4985 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4986 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 4987 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
4988 * fileio.c (Fcopy_file):
4989 * xterm.c (XTflash): Get the current time closer to when it's used.
4990 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4991
ffacb126
PE
4992 * bytecode.c (targets): Suppress -Woverride-init warnings.
4993
e99a530f
PE
4994 Simplify by avoiding confusing use of strncpy etc.
4995 * doc.c (Fsnarf_documentation):
4996 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4997 * frame.c (Fmake_terminal_frame):
4998 * gtkutil.c (get_utf8_string):
4999 * lread.c (openp):
5000 * nsmenu.m (ns_update_menubar):
5001 * regex.c (regerror):
5002 Prefer memcpy to strncpy and strncat when either will do.
5003 * fileio.c (Fsubstitute_in_file_name):
5004 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5005 (menu_separator_name_p):
5006 * nsmenu.m (ns_update_menubar):
5007 Prefer memcmp to strncmp when either will do.
5008 * nsterm.m: Include <ftoastr.h>.
5009 (ns_get_color):
5010 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5011 Prefer snprintf to strncpy.
5012 * nsterm.m (ns_term_init):
5013 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5014 * nsterm.m (ns_term_init):
5015 Avoid the need for strncpy, by using build_string or
5016 make_unibyte_string directly. Use dtoastr, not snprintf.
5017 * process.c (Fmake_network_process): Diagnose service names that
5018 are too long, rather than silently truncating them or creating
5019 non-null-terminated names.
5020 (Fnetwork_interface_info): Likewise, for interface names.
5021 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5022 Prefer sprintf to strncat.
5023 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5024 Prefer vsnprintf to vsprintf + strncpy.
5025
c59592b3
GM
50262012-07-10 Glenn Morris <rgm@gnu.org>
5027
5028 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5029 Clarify fallback case.
5030
7d7bbefd
DA
50312012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5032
5033 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5034 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5035 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 5036 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
5037 where argument type is known to be a Lisp_Cons.
5038
3a4c8000
TT
50392012-07-10 Tom Tromey <tromey@redhat.com>
5040
5041 * bytecode.c (BYTE_CODE_THREADED): New macro.
5042 (BYTE_CODES): New macro. Replaces all old byte-code defines.
5043 (enum byte_code_op): New type.
5044 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5045 (exec_byte_code): Use them. Use token threading when applicable.
5046
2a0213a6
DA
50472012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5048
5049 Optimize pure C strings initialization.
5050 * lisp.h (make_pure_string): Fix prototype.
5051 (build_pure_c_string): New function, defined as static inline. This
5052 provides a better opportunity to optimize away calls to strlen when
5053 the function is called with compile-time constant argument.
5054 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
5055 argument, adjust users accordingly. Use build_pure_c_string where
5056 appropriate.
5057 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
5058 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
5059 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
5060
cb1caeaf
DA
50612012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5062
5063 Avoid calls to strlen in miscellaneous functions.
5064 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
5065 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
5066 * lread.c (openp): Likewise.
5067
c293e30c
DA
50682012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5069
5070 Avoid calls to strlen in path processing functions.
5071 * fileio.c (file_name_as_directory): Add comment. Change to add
5072 srclen argument and return the length of result. Adjust users
5073 accordingly.
5074 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
5075 swap 1st and 2nd arguments to obey the common convention.
5076 Adjust users accordingly.
c293e30c
DA
5077 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
5078
9e059e3f
GM
50792012-07-10 Glenn Morris <rgm@gnu.org>
5080
d02eb359
GM
5081 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
5082 Move PENDING_OUTPUT_COUNT definition to configure.
5083
882cf227
GM
5084 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
5085 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
5086 * s/gnu.h (DATA_START): Move definitions to configure.
5087
af6e839f
GM
5088 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
5089 We include usg5-4-common.h, which defines them both.
5090
40289a12
GM
5091 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
5092 O_RDONLY already includes it).
5093
9e059e3f
GM
5094 Stop ns builds setting the EMACSLOADPATH environment variable.
5095 * nsterm.m (ns_load_path): Rename from ns_init_paths.
5096 Now it does not set EMACSLOADPATH, just returns the load-path string.
5097 * nsterm.h: Update accordingly.
5098 * lread.c [HAVE_NS]: Include nsterm.h.
5099 (init_lread) [HAVE_NS]: Use ns_load_path.
5100 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
5101
7c4e8ec0
GM
51022012-07-09 Glenn Morris <rgm@gnu.org>
5103
d4f600ff
GM
5104 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
5105 since the included bsd-common.h does so.
5106
cbb31951
GM
5107 Stop ns builds setting the EMACSPATH environment variable.
5108 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
5109 (ns_init_paths): Do not set EMACSPATH.
5110 * nsterm.h (ns_exec_path): Add it.
5111 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
5112 Use ns_exec_path.
5113
7c4e8ec0
GM
5114 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
5115
26bccfae
PE
51162012-07-09 Paul Eggert <eggert@cs.ucla.edu>
5117
a0bee46f
PE
5118 * process.c (wait_reading_process_output): 'waitchannels' was unset
5119 when read_kbd || !NILP (wait_for_cell); fix this.
5120
5994c183
PE
5121 Add GCC-style 'const' attribute to functions that can use it.
5122 * character.h (char_resolve_modifier_mask):
5123 * keyboard.h (make_ctrl_char):
5124 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5125 (init_character_once, next_almost_prime, init_fns, init_image)
5126 (flush_pending_output, init_sound):
5127 * mem-limits.h (start_of_data):
5128 * menu.h (finish_menu_items):
5129 Add ATTRIBUTE_CONST.
5130 * emacs.c (DEFINE_DUMMY_FUNCTION):
5131 Declare the dummy function with ATTRIBUTE_CONST.
5132 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5133 Add decls with ATTRIBUTE_CONST.
5134
26bccfae
PE
5135 Minor improvements to make_formatted_string.
5136 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5137 where int is good enough, as vsprintf returns an int.
5138 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5139
a8290ec3
DA
51402012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5141
5142 Use make_formatted_string to avoid double length calculation.
5143 * lisp.h (make_formatted_string): New prototype.
5144 * alloc.c (make_formatted_string): New function.
5145 * buffer.c (Fgenerate_new_buffer_name): Use it.
5146 * dbus.c (syms_of_dbusbind): Likewise.
5147 * editfns.c (Fcurrent_time_zone): Likewise.
5148 * filelock.c (get_boot_time): Likewise.
5149 * frame.c (make_terminal_frame, set_term_frame_name)
5150 (x_report_frame_params): Likewise.
5151 * image.c (gs_load): Likewise.
5152 * minibuf.c (get_minibuffer): Likewise.
5153 * msdos.c (dos_set_window_size): Likewise.
5154 * process.c (make_process): Likewise.
5155 * xdisp.c (ensure_echo_area_buffers): Likewise.
5156 * xsettings.c (apply_xft_settings): Likewise.
5157
d01ba2f1
GM
51582012-07-09 Glenn Morris <rgm@gnu.org>
5159
5160 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5161 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5162 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5163 * nsterm.h (ns_etc_directory): Add it.
5164 * callproc.c [HAVE_NS]: Include nsterm.h.
5165 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5166
f1f924b6
DA
51672012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5168
5169 Move marker debugging code under MARKER_DEBUG.
5170 * marker.c (MARKER_DEBUG): Move marker debugging code under
5171 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5172 for bootstrap with --enable-checking (~3x slowdown reported
5173 by Juanma Barranquero <lekktu@gmail.com>).
5174 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5175
ab531b66
PE
51762012-07-08 Paul Eggert <eggert@cs.ucla.edu>
5177
5178 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5179 See <http://bugs.gnu.org/11825#29>.
5180
c4b3bc8a
EZ
51812012-07-08 Eli Zaretskii <eliz@gnu.org>
5182
5183 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5184 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
5185 (display_line): Add commentary about displaying truncation glyphs
5186 on GUI frames.
5187 (produce_special_glyphs): Move here from term.c.
5188
5189 * term.c (produce_special_glyphs): Move to xdisp.c.
5190
5191 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5192 section.
c4b3bc8a 5193
b676b881
AS
51942012-07-07 Andreas Schwab <schwab@linux-m68k.org>
5195
f17c5273
AS
5196 * xdisp.c (display_line): Avoid warning about implicit declaration
5197 of FRAME_FONT.
5198
298819b9
AS
5199 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5200
b676b881
AS
5201 * lisp.h: Remove empty conditional.
5202
6045c4fd
PE
52032012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5204
b3350bf9
PE
5205 * lread.c (load_path_check): Now static.
5206
6045c4fd
PE
5207 Fix some minor --with-ns problems found by static checking.
5208 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
5209 (x_set_font) [!HAVE_X_WINDOWS]:
5210 * image.c (xpm_load_image) [HAVE_NS]:
5211 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
5212 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
5213 Remove unused local.
5214 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
5215 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
5216 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
5217 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
5218 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
5219 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
5220 Fix pointer signedness problem.
5221 * xfaces.c (FRAME_X_FONT_TABLE):
5222 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
5223
929e7845
GM
52242012-07-07 Glenn Morris <rgm@gnu.org>
5225
5226 * lread.c (load_path_check): New function, split from init_lread.
5227 (init_lread): Reorganize. Motivation:
5228 If EMACSLOADPATH is set, check/warn about that rather than the
5229 defaults, which we are not going to use. Hence we can remove
5230 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
5231 Don't warn if site-lisp directories are missing.
5232 If not installed, start from a blank load-path, since
5233 PATH_LOADSEARCH refers to the eventual installation directories.
5234
58dd0aa4
EZ
52352012-07-07 Eli Zaretskii <eliz@gnu.org>
5236
5237 Support truncation and continuation glyphs on GUI frames, when
5238 fringes are disabled. (Bug#11832)
5239 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
5240 continuation glyphs even if on GUI frames.
5241 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
5242 or both, are absent.
5243 (start_display, move_it_in_display_line_to): Handle the case of a
5244 GUI frame without a fringe to display continuation or truncation
5245 glyphs.
5246 (insert_left_trunc_glyphs): Support GUI frames: make sure
5247 truncation glyphs overwrite enough glyphs from the current line to
5248 have sufficient space in pixels.
5249 (display_line): Support truncation and continuation glyphs on GUI
5250 frames. If some spare pixels are left on the line after inserting
5251 the truncation glyphs, fill that space with a stretch glyph of a
5252 suitably computed width.
5253
5254 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5255 produce_glyphs, to support GUI sessions.
5256
31571fd7
PE
52572012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5258
5a16b9bc
PE
5259 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5260
f3047c75
PE
5261 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5262
31571fd7
PE
5263 Do not require float-time's arg to fit in time_t (Bug#11825).
5264 This works better on hosts where time_t is unsigned, and where
5265 float-time is applied to the (negative) difference between two times.
5266 * editfns.c (decode_time_components): Last arg is now double *,
5267 not int *, and means to store all the result as a double, without
5268 worrying about whether the seconds part fits in time_t.
5269 All callers changed.
5270 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5271 All callers changed.
5272 (Ffloat_time): Do not fail merely because the specified time falls
5273 outside of time_t range.
5274
4516fbef
GM
52752012-07-07 Glenn Morris <rgm@gnu.org>
5276
5277 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5278 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5279 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5280
07adc2c6
JB
52812012-07-07 Juanma Barranquero <lekktu@gmail.com>
5282
5283 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5284 Update dependencies.
5285
5286 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5287
fd573f31
PE
52882012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5289
fee5959d
PE
5290 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5291 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5292 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5293 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5294 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5295 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5296
fd573f31
PE
5297 * xfont.c (compare_font_names): Redo to omit the need for casts.
5298
ddadbc0e
AS
52992012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5300
fca8d6b6
AS
5301 * xfns.c (Fx_change_window_property): Doc fix.
5302 * w32fns.c (Fx_change_window_property): Doc fix.
5303
ddadbc0e
AS
5304 * w32fns.c (Fx_window_property): Accept the same arguments as the
5305 X Windows version. Doc fix.
5306 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5307
ed9265fc 53082012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
5309 Eli Zaretskii <eliz@gnu.org>
5310
5311 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5312 Windows-specific code from nt/config.nt moved here.
5313 Obsolete settings removed.
5314
216ee680
PE
53152012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5316
5317 * process.c: Avoid unnecessary calls to gettime.
5318 (wait_reading_process_output): Don't get the time of day
5319 when gobbling data immediately and not waiting, as there's no need
5320 for it in that case. This removes a FIXME.
5321
bdd091e4
JD
53222012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5323
5324 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5325 is defined (Bug#11768).
5326
9d44f8ce
DA
53272012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5328
5329 Fix marker debugging code.
5330 * marker.c (byte_char_debug_check): Do not perform the check
5331 if buffer is not multibyte.
090bd7cb
JB
5332 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5333 Call byte_char_debug_check with correct arguments.
9d44f8ce 5334
90fc4786
DA
53352012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5336
5337 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
5338 * marker.c (byte_char_debug_check, count_markers):
5339 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
5340 (byte_debug_flag): Remove.
5341 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5342 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5343
7b7ae965
DA
53442012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5345
4e57b342
DA
5346 Avoid code repetition in marker-related functions.
5347 * marker.c (attach_marker): New function.
5348 (Fset_marker, set_marker_restricted, set_marker_both)
5349 (set_marker_restricted_both): Use it.
5350 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5351 Consistently rename charno to charpos.
5352 (marker_position): Add eassert.
5353 (marker_byte_position): Convert to eassert.
5354
53552012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5356
5357 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 5358 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 5359 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 5360
657924ff
DA
53612012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5362
5363 Introduce fast path for the widely used marker operation.
5364 * alloc.c (build_marker): New function.
5365 * lisp.h (build_marker): New prototype.
5366 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5367 * composite.c (autocmp_chars): Likewise.
5368 * editfns.c (buildmark): Remove.
5369 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5370 (save_restriction_save): Use build_marker.
5371 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5372 * window.c (save_window_save): Likewise.
5373
041a49a6
DA
53742012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5375
5376 Do not use Fdelete_overlay in delete_all_overlays
5377 to avoid redundant calls to unchain_overlay.
5378 * buffer.c (drop_overlay): New function.
5379 (delete_all_overlays, Fdelete_overlay): Use it.
5380 * minibuf.c (get_minibuffer): Fix comment.
5381
7dca65a4
PE
53822012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5383
5384 Port to OpenBSD 5.1 amd64.
5385 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5386 This is needed for OpenBSD, and should be harmless on all BSD systems.
5387 Also, include <sys/sysctl.h>, as it should be available on all
5388 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5389 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5390 use p_pid member, not kp_proc.pid.
5391
8eb876e2
GM
53922012-07-06 Glenn Morris <rgm@gnu.org>
5393
5394 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5395
38182d90
PE
53962012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5397
5398 More xmalloc and related cleanup.
5399 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5400 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5401 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5402 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5403 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5404 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5405 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5406 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5407 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5408 * xterm.c:
5409 Omit needless casts involving void * pointers and allocation.
5410 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5411 as the former is more robust if P's type is changed.
5412 Prefer xzalloc to xmalloc + memset 0.
5413 Simplify malloc-or-realloc to realloc.
5414 Don't worry about xmalloc returning a null pointer.
5415 Prefer xstrdup to xmalloc + strcpy.
5416 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5417 growing it.
5418 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5419 alloca of a constant.
5420
6dd5a677
EZ
54212012-07-05 Eli Zaretskii <eliz@gnu.org>
5422
5423 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5424 hscroll is larger than the line width. Fixes long and futile
5425 looping inside extend_face_to_end_of_line (on a TTY) producing
5426 glyphs that are not needed and thrown away.
5427
6b312f0f
DA
54282012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5429
5430 * marker.c (set_marker_restricted_both): Simplify by using
5431 clip_to_bounds.
5432
f520ef9b
PE
54332012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5434
5435 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5436
383b7c95
JD
54372012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5438
5439 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5440 not defined (Bug#11768).
5441 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5442 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5443 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5444 followed by gtk_box_set_homogeneous (Bug#11768).
5445 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
5446 (update_theme_scrollbar_width, xg_create_scroll_bar):
5447 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
5448 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5449 (is_box_type): New function (Bug#11768).
5450 (xg_tool_item_stale_p): Call is_box_type.
5293d758 5451 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
5452 with default display (Bug#11768).
5453
d6e7bf45
EZ
54542012-07-05 Eli Zaretskii <eliz@gnu.org>
5455
5456 * xdisp.c (window_hscroll_limited): New function.
5457 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5458 coordinates when window's hscroll is set to insanely large
5459 values. (Bug#11857)
5460
431391ec
JB
54612012-07-05 Juanma Barranquero <lekktu@gmail.com>
5462
5463 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5464 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5465
23f86fce
DA
54662012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5467
5468 Cleanup xmalloc.
5469 * lisp.h (xzalloc): New prototype. Omit needless casts.
5470 * alloc.c (xzalloc): New function. Omit needless casts.
5471 * charset.c: Omit needless casts. Convert all calls to
5472 xmalloc with following memset to xzalloc.
5473 * dispnew.c: Likewise.
5474 * fringe.c: Likewise.
5475 * image.c: Likewise.
5476 * sound.c: Likewise.
5477 * term.c: Likewise.
5478 * w32fns.c: Likewise.
5479 * w32font.c: Likewise.
5480 * w32term.c: Likewise.
5481 * xfaces.c: Likewise.
5482 * xfns.c: Likewise.
5483 * xterm.c: Likewise.
5484 * atimer.c: Omit needless casts.
5485 * buffer.c: Likewise.
5486 * callproc.c: Likewise.
5487 * ccl.c: Likewise.
5488 * coding.c: Likewise.
5489 * composite.c: Likewise.
5490 * doc.c: Likewise.
5491 * doprnt.c: Likewise.
5492 * editfns.c: Likewise.
5493 * emacs.c: Likewise.
5494 * eval.c: Likewise.
5495 * filelock.c: Likewise.
5496 * fns.c: Likewise.
5497 * gtkutil.c: Likewise.
5498 * keyboard.c: Likewise.
5499 * lisp.h: Likewise.
5500 * lread.c: Likewise.
5501 * minibuf.c: Likewise.
5502 * msdos.c: Likewise.
5503 * print.c: Likewise.
5504 * process.c: Likewise.
5505 * region-cache.c: Likewise.
5506 * search.c: Likewise.
5507 * sysdep.c: Likewise.
5508 * termcap.c: Likewise.
5509 * terminal.c: Likewise.
5510 * tparam.c: Likewise.
5511 * w16select.c: Likewise.
5512 * w32.c: Likewise.
5513 * w32reg.c: Likewise.
5514 * w32select.c: Likewise.
5515 * w32uniscribe.c: Likewise.
5516 * widget.c: Likewise.
5517 * xdisp.c: Likewise.
5518 * xmenu.c: Likewise.
5519 * xrdb.c: Likewise.
5520 * xselect.c: Likewise.
5521
0497dc44
PE
55222012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5523
5524 * fileio.c (time_error_value): Check the right error number.
5525 Problem reported by Troels Nielsen in
5526 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5527
356e7178
PE
55282012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5529
4e71fd89
PE
5530 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5531 This should be fixed in a better way; see Eli Zaretskii in
5532 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5533 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5534
f0941253
PE
5535 * fileio.c (time_error_value): Rename from special_mtime.
5536 The old name's problems were noted by Eli Zaretskii in
5537 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5538
065c9eb4
PE
5539 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5540 This variable's comment says Emacs needs at least one GDB-visible
5541 symbol of type enum pvec_type, to work around GDB problems.
5542 The symbol's value doesn't matter.
5543
356e7178
PE
5544 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5545 that causes compilation to fail on pre-C99 compilers.
5546
ed9265fc 55472012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
5548
5549 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5550 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5551
3884d954
DA
55522012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5553
d209e2fb 5554 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
5555 headers for buffer_defaults and buffer_local_symbols.
5556 Reported by Juanma Barranquero <lekktu@gmail.com>.
5557
ee28be33
SM
55582012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5559
5560 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5561 * lisp.h (enum pvec_type): Use fewer bits.
5562 (PSEUDOVECTOR_SIZE_BITS): New constant.
5563 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5564 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5565 change in pvec_type.
5566 (PSEUDOVECTOR_TYPEP): New macro.
5567 (TYPED_PSEUDOVECTORP): Use it.
5568 * fns.c (internal_equal): Adapt code to extract pvectype.
5569 * emacs.c (gdb_pvec_type): Update type.
5570 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5571 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5572 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5573 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5574 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5575 abusing vector->header.next.nbytes.
5576 (live_vector_p): Use PVEC_TYPE.
5577 (mark_object): Adapt code to extract pvectype. Use switch.
5578
c7f2cd7f
PE
55792012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5580
5581 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5582 Tighten new eassert a bit.
5583
8ce70ed2
DA
55842012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5585
5586 Fix compilation with --enable-gcc-warnings and -O1
5587 optimization level.
5588 * doprnt.c (doprnt): Change type of tem to int, initialize
5589 to avoid compiler warning. Add eassert.
5590 * search.c (simple_search): Initialize match_byte to avoid
5591 compiler warning. Add eassert.
5592
dea7f1e5
PE
55932012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5594
24a212eb
PE
5595 Avoid weird behavior with large horizontal scrolls.
5596 Without this change, for example, large hscroll values would
5597 mess up Emacs's display on Fedora 15 x86, presumably due to
5598 overflows in int calculations in the display code.
5599 Also, if buffers had long lines, Emacs would freeze.
5600 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5601 (set_window_hscroll): New function, containing the old guts of
5602 Fset_window_hscroll. Return the clipped value.
5603 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5604 This avoids the need to check against PTRDIFF_MAX.
5605
dea7f1e5
PE
5606 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5607
76046526
DA
56082012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5609
5610 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5611
39adff0d
PE
56122012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5613
63807d47
PE
5614 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5615 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5616 since GCC 4.4.6 issues a bogus warning for them.
5617
39adff0d
PE
5618 Fix bugs in file timestamp newness comparisons.
5619 * fileio.c (Ffile_newer_than_file_p):
5620 * lread.c (Fload): Use full timestamp resolution of files,
5621 not just the 1-second resolution, so that files that are only
5622 slightly newer still count as newer.
5623 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5624 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5625
dbeed9a6
PE
56262012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5627
5628 * fileio.c: Improve handling of file time marker. (Bug#11852)
5629 (special_mtime): New function.
5630 (Finsert_file_contents, Fverify_visited_file_modtime):
5631 Use it to set special mtime values consistently.
5632
636334d6
AS
56332012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5634
5635 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5636 marker for non-existing file. (Bug#11852)
5637
e2017fe2
GM
56382012-07-03 Glenn Morris <rgm@gnu.org>
5639
5640 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5641 and did not make it into globals.h).
5642
404dbd37
TT
56432012-07-03 Tom Tromey <tromey@redhat.com>
5644
5645 * window.c (Fset_window_margins, Fset_window_fringes)
5646 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5647 * textprop.c (Fprevious_property_change): No longer static.
5648 * syntax.c (Fsyntax_table_p): No longer static.
5649 * process.c (Fget_process, Fprocess_datagram_address): No longer
5650 static.
5651 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5652 * keyboard.c (Fcommand_execute): No longer static.
5653 Remove EXFUN.
5654 * insdel.c (Fcombine_after_change_execute): No longer static.
5655 * image.c (Finit_image_library): No longer static.
5656 * fileio.c (Fmake_symbolic_link): No longer static.
5657 * eval.c (Ffetch_bytecode): No longer static.
5658 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
5659 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5660 No longer static.
404dbd37
TT
5661 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5662 static.
5663 * dired.c (Ffile_attributes): No longer static.
5664 * composite.c (Fcomposition_get_gstring): No longer static.
5665 * callproc.c (Fgetenv_internal): No longer static.
5666
5667 * ccl.h: Remove EXFUNs.
5668 * buffer.h: Remove EXFUNs.
5669 * dispextern.h: Remove EXFUNs.
5670 * intervals.h: Remove EXFUNs.
5671 * fontset.h: Remove EXFUN.
5672 * font.h: Remove EXFUNs.
5673 * dosfns.c (system_process_attributes): Remove EXFUN.
5674 * keymap.h: Remove EXFUNs.
5675 * lisp.h: Remove EXFUNs.
5676 * w32term.h: Remove EXFUNs.
5677 * window.h: Remove EXFUNs.
5678 * xsettings.h: Remove EXFUN.
5679 * xterm.h: Remove EXFUN.
5680
8e4fd1e1
GM
56812012-07-03 Glenn Morris <rgm@gnu.org>
5682
5683 * lisp.h (Frandom): Make it visible to C.
5684 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5685 buffer for invisible buffers. (Bug#1229)
5686
ca95b3eb
DA
56872012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5688
5689 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5690 values which aren't power of 2.
14ae4239
BT
5691 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5692 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
5693 accordingly.
5694
7555c33f
SM
56952012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5696
5697 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5698
5699 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5700
d12e8f5a
DA
57012012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5702
5703 * alloc.c (allocate_vector_block): Remove redundant
5704 calls to mallopt if DOUG_LEA_MALLOC is defined.
5705 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5706 avoid calls to mallopt if zero_vector is returned.
5707
296094c3
DA
57082012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5709
5710 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5711 is enabled, avoid dereferencing NULL current_sblock if
5712 running undumped.
5713
36429c89
DA
57142012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5715
5716 Cleanup basic buffer management.
5717 * buffer.h (struct buffer): Change layout to use generic vector
5718 marking code. Fix some comments. Change type of 'clip_changed'
5719 to bitfield. Remove unused #ifndef old.
5720 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5721 (GET_OVERLAYS_AT): Fix indentation.
5722 (for_each_per_buffer_object_at): New macro.
5723 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5724 (Fbuffer_local_variables): Use it.
5725 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5726 * alloc.c (allocate_buffer): Adjust to match new layout of
5727 struct buffer. Fix comment.
5728 (mark_overlay): New function.
5729 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5730 Lisp area of struct buffer.
5731 (mark_object): Use it. Adjust marking of misc objects
5732 and related comments.
5733
3b3e4cac
PE
57342012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5735
5736 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5737 wrapper that is not needed because the wrapped code is a no-op (zero
5738 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5739 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5740
cf5c0175
DA
57412012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5742
5743 * alloc.c (mark_buffer): Simplify. Remove prototype.
5744 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 5745 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
5746 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5747 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 5748
ca26824c
GM
57492012-06-30 Glenn Morris <rgm@gnu.org>
5750
2e4c5312
GM
5751 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5752
ca26824c
GM
5753 * epaths.in (PATH_SITELOADSEARCH): New.
5754 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5755 This is rather than relying on --enable-locallisppath elements
5756 having "site-lisp" in their names. (Bug#10208#25, 11658)
5757
0d23c240
EZ
57582012-06-30 Eli Zaretskii <eliz@gnu.org>
5759
c9240d7a
EZ
5760 * w32proc.c (sys_select): Accept and ignore one more argument.
5761
5762 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5763
0d23c240 5764 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 5765 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
5766
5767 * sysdep.c: Don't include dos.h and dosfns.h.
5768
5769 * process.c (sys_select):
5770 * msdos.c (sys_select): Accept one more argument and ignore it.
5771
5772 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5773 adapt data types and code to that.
5774
5775 * dosfns.c:
5776 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5777 which clashes with the gnulib function of the same name.
5778
af5a5a98
AS
57792012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5780
c5e4379c
AS
5781 * font.c (font_style_to_value, font_style_symbolic)
5782 (font_prop_validate_style): Add type checks for values in
5783 font_style_table.
5784
af5a5a98
AS
5785 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5786 argument.
5787 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5788 uses.
5789
8d38f461
EZ
57902012-06-29 Eli Zaretskii <eliz@gnu.org>
5791
2e5a6631
EZ
5792 * xdisp.c (try_window_id): Undo last change.
5793
8d38f461
EZ
5794 * w32.c (getwd): Adjust commentary about startup_dir.
5795 (init_environment): Always call sys_access, even in non-MSVC
5796 builds. Don't chdir to the directory of the Emacs executable.
5797 This undoes code from 1997 which was justified by the need to
5798 "avoid conflicts when removing and renaming directories". But its
5799 downside was that every relative file name was being interpreted
5800 relative to the directory of the Emacs executable, which can never
5801 be TRT. In particular, it broke sys_access when called with
5802 relative file names.
5803 (sys_access): Map GetLastError to errno.
5804
2af3565e
DA
58052012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5806
5807 * window.h (struct window): Change type of 'fringes_outside_margins'
5808 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 5809 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
5810 Adjust comment.
5811 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5812 to ptrdiff_t.
5813
c8d3a25c 58142012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 5815
c8d3a25c
GM
5816 * gnutls.c (emacs_gnutls_handshake):
5817 Add QUIT to make the loop interruptible.
57570cd3 5818
c8d3a25c 58192012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 5820
c8d3a25c
GM
5821 * charset.c (init_charset): Make lack of etc/charsets fatal.
5822
3e984ee8
DA
58232012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5824
5825 * editfns.c (region_limit): Fix type mismatch.
5826
ef884f23
DA
58272012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5828
5829 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5830 undefined. Convert from xassert to eassert.
5831 * nsmenu.m: Convert from xassert to eassert.
5832 * nsterm.m: Likewise.
5833
7d7e0027
SM
58342012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5835
5836 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5837
aa754e6a
PE
58382012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5839
5840 Avoid integer overflow on scroll-left and scroll-right.
5841 * window.c (HSCROLL_MAX): New macro.
5842 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5843 overflow when requested scroll falls outside ptrdiff_t range.
5844
80b00b08
DA
58452012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5846
5847 * window.h (struct window): Change type of 'hscroll',
5848 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5849 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5850 Adjust users accordingly.
5851 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5852 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5853 from EMACS_INT to ptrdiff_t.
5854 (make_window): Omit redundant initialization.
5855
62b2bcf6
JB
58562012-06-28 Juanma Barranquero <lekktu@gmail.com>
5857
5858 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5859
45942c7d
DA
58602012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5861
5862 * window.h (struct window): Change type of 'use_time' and
5863 'sequence_number' from Lisp_Object to int.
5864 * frame.c (make_frame): Adjust users accordingly.
5865 * print.c (print_object): Likewise.
5866 * window.c (select_window, Fwindow_use_time, make_parent_window)
5867 (make_window): Likewise.
5868
e509cfa6
DA
58692012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5870
5871 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5872 enabled with --enable-checking=[all,glyphs] configure option.
5873 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5874 adjust comments accordingly.
5875 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5876 undefined, adjust comments accordingly.
5877 * image.c: Likewise.
5878 * scroll.c: Likewise.
5879 * w32fns.c: Likewise.
5880 * w32term.c: Likewise.
5881 * xdisp.c: Likewise.
5882 * xfaces.c: Likewise.
5883 * xfns.c: Likewise.
5884 * xterm.c: Likewise.
5885
a54e2c05
DA
58862012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5887
5888 Generalize run-time debugging checks.
5889 * dispextern.h (XASSERTS): Remove.
5890 * fontset.c (xassert): Remove.
5891 Convert from xassert to eassert.
5892 * alloc.c: Convert from xassert to eassert.
5893 * bidi.c: Likewise.
5894 * dispnew.c: Likewise.
5895 * fns.c: Likewise.
5896 * fringe.c: Likewise.
5897 * ftfont.c: Likewise.
5898 * gtkutil.c: Likewise.
5899 * image.c: Likewise.
5900 * keyboard.c: Likewise.
5901 * menu.c: Likewise.
5902 * process.c: Likewise.
5903 * scroll.c: Likewise.
5904 * sound.c: Likewise.
5905 * term.c: Likewise.
5906 * w32console.c: Likewise.
5907 * w32fns.c: Likewise.
5908 * w32term.c: Likewise.
5909 * window.c: Likewise.
5910 * xdisp.c: Likewise.
5911 * xfaces.c: Likewise.
5912 * xfns.c: Likewise.
5913 * xselect.c: Likewise.
5914 * xterm.c: Likewise.
5915
1ec4b7b2
SM
59162012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5917
5918 * fns.c (maybe_resize_hash_table): Output message when growing the
5919 purify-hashtable.
5920
2014308a
DA
59212012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5922
5923 * alloc.c (allocate_string_data): Remove dead code.
5924 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5925 avoid GCC warning about unused macro.
5926
246155eb
DA
59272012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5928
5929 * alloc.c (allocate_string): Omit intervals initialization.
5930 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5931 as in make_pure_string and make_pure_c_string.
5932
43184b7b
DA
59332012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5934
d209e2fb 5935 * alloc.c (allocate_string): Fix last change.
43184b7b 5936
3fe6dd74
DA
59372012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5938
d209e2fb 5939 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
5940 to memset, add explicit initialization where appropriate.
5941
1ba6038a
GM
59422012-06-27 Glenn Morris <rgm@gnu.org>
5943
5944 * lisp.mk (lisp): Remove paths.elc.
5945
c89926a5
CY
59462012-06-27 Chong Yidong <cyd@gnu.org>
5947
5948 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5949
ed6b3510
JW
59502012-06-26 John Wiegley <johnw@newartisans.com>
5951
1ec4b7b2 5952 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
5953 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5954
ed6b3510
JW
5955 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5956 when building with Clang.
5957
8edd4a2b
SM
59582012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5959
5960 * eval.c (Fapply): Allow calling it with a single argument.
5961
f6f62d1b
EZ
59622012-06-26 Eli Zaretskii <eliz@gnu.org>
5963
5964 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5965 _stricmp and _strnicmp.
5966 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5967
62efea5e
DA
59682012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5969
5970 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5971 allocated window.
5972 (allocate_process): Likewise for new process.
8edd4a2b 5973 (allocate_terminal): Change to use offsetof.
62efea5e
DA
5974 (allocate_frame): Likewise.
5975 * frame.c (make_frame): Omit redundant initialization.
5976 * window.c (make_parent_window): Use memset.
5977 (make_window): Omit redundant initialization.
5978 * process.c (make_process): Omit redundant initialization.
5979 * terminal.c (create_terminal): Likewise.
5980
42997f4d
DA
59812012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5982
5983 * term.c (delete_tty): Remove redundant call to memset.
5984
1130ecfc
DA
59852012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5986
5987 * alloc.c: Remove build_string.
5988 * lisp.h: Define build_string as static inline. This provides
5989 a better opportunity to optimize away calls to strlen when the
5990 function is called with compile-time constant argument.
5991 * image.c (imagemagick_error): Convert to build_string.
5992 * w32proc.c (sys_spawnve): Likewise.
5993 * xterm.c (x_term_init): Likewise.
5994
cf38a720
PE
59952012-06-26 Paul Eggert <eggert@cs.ucla.edu>
5996
99027bdd
PE
5997 Use sprintf return value instead of invoking strlen on result.
5998 In the old days this wasn't portable, since some sprintf
5999 implementations returned char *. But they died out years ago and
6000 Emacs already assumes sprintf returns int.
6001 Similarly for float_to_string.
6002 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6003 * ccl.c (ccl_driver):
6004 * character.c (string_escape_byte8):
6005 * data.c (Fnumber_to_string):
6006 * doprnt.c (doprnt):
6007 * print.c (print_object):
6008 * xdisp.c (message_dolog):
6009 * xfns.c (syms_of_xfns):
6010 Use sprintf or float_to_string result to avoid need to call strlen.
6011 * data.c (Fnumber_to_string):
6012 Use make_unibyte_string, since the string must be ASCII.
6013 * lisp.h, print.c (float_to_string): Now returns int length.
6014 * term.c (produce_glyphless_glyph):
6015 Use sprintf result rather than recomputing it.
6016
cf38a720
PE
6017 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6018 * Makefile.in (ALL_CFLAGS):
6019 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6020 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6021
3511c784
DA
60222012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6023
0a08eb21 6024 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
6025 strcasecmp if available.
6026 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6027
fb7da12e
AS
60282012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6029
6030 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6031 Avoid comma operator.
6032 * menu.c (push_submenu_start, push_submenu_end)
6033 (push_left_right_boundary, push_menu_pane): Likewise.
6034 * msdos.c (dos_rawgetc): Likewise.
6035
afa2ffd8
DA
60362012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6037
6038 * xfns.c (xic_create_fontsetname): Remove redundant calls
6039 to memset.
6040
b3b4476b
PE
60412012-06-25 Paul Eggert <eggert@cs.ucla.edu>
6042
4495ff38
PE
6043 * gtkutil.c (get_utf8_string): Remove redundant assignment.
6044 sprintf already null-terminates its output.
6045
b3b4476b
PE
6046 * xfns.c (x_window): Remove redundant cast.
6047
b00876c9
DA
60482012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6049
6050 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6051 `const char *' to `char *' to avoid compiler warning.
6052
d188e26b
PE
60532012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6054
885d1d74
PE
6055 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6056 instead of truncating it to 63 (admittedly a generous limit).
6057
d188e26b
PE
6058 * process.c: Fix spelling and caps in comments.
6059
e2f560b1
DN
60602012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
6061
e86db54b 6062 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
6063 * sysdep.c (setpgrp): Remove definition, not used in this file.
6064
7583a3a1
JB
60652012-06-24 Juanma Barranquero <lekktu@gmail.com>
6066
6067 * makefile.w32-in: Update dependencies.
6068
696056c2
EZ
60692012-06-24 Eli Zaretskii <eliz@gnu.org>
6070
6071 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
6072 (SYSTIME_H): Add nt/inc/sys/time.h.
6073
6074 * systime.h [WINDOWSNT]: Include sys/time.h.
6075
6076 * s/ms-w32.h (struct timespec): Definition moved from
6077 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
6078
845ca893
PE
60792012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6080
6081 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
6082 * buffer.h (buffer_slot_type_mismatch):
6083 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6084 * eval.c (unwind_to_catch):
6085 * image.c (my_png_error, my_error_exit):
6086 * keyboard.c (quit_throw_to_read_char, user_error)
6087 (Fexit_recursive_edit, Fabort_recursive_edit):
6088 * lisp.h (die, args_out_of_range, args_out_of_range_3)
6089 (wrong_type_argument, buffer_overflow, __executable_start)
6090 (memory_full, buffer_memory_full, string_overflow, Fthrow)
6091 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
6092 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
6093 (fatal):
6094 (child_setup) [!DOS_NT]:
6095 * lread.c (end_of_file_error, invalid_syntax):
6096 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6097 * puresize.h (pure_write_error):
6098 * search.c (matcher_overflow):
6099 * sound.c (sound_perror, alsa_sound_perror):
6100 * sysdep.c, syssignal.h (croak):
6101 * term.c (maybe_fatal, vfatal):
6102 * textprop.c (text_read_only):
6103 * undo.c (user_error):
6104 * unexmacosx.c (unexec_error):
6105 * xterm.c (x_ins_del_lines, x_delete_glyphs):
6106 Use _Noreturn rather than NO_RETURN.
6107 No need for separate decl merely because of _Noreturn.
6108 * sound.c (sound_warning, parse_sound):
6109 Remove unnecessary forward decls.
6110
f1dd8073
PE
61112012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6112
6113 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
6114 * lisp.h (WAIT_READING_MAX): New macro.
6115 * dispnew.c (Fsleep_for, sit_for):
6116 * keyboard.c (kbd_buffer_get_event):
6117 * process.c (Faccept_process_output):
6118 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6119 This improves on the previous patch, which introduced a bug
6120 when time_t is unsigned and as wide as intmax_t.
6121 See <http://bugs.gnu.org/9000#51>.
6122
b82c1755
EZ
61232012-06-23 Eli Zaretskii <eliz@gnu.org>
6124
6125 * dispnew.c (sit_for, Fsleep_for):
6126 * keyboard.c (kbd_buffer_get_event):
6127 * process.c (Faccept_process_output): Avoid compiler warnings when
6128 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6129
ca300656
JB
61302012-06-23 Juanma Barranquero <lekktu@gmail.com>
6131
049ec95b
JB
6132 * makefile.w32-in: Update dependencies.
6133
ca300656
JB
6134 * w32.c (ltime): Add return type and declare static.
6135 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6136
db7b8d06
PE
61372012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6138
6139 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6140 Privately reported by Herbert J. Skuhra.
6141 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6142 All uses changed.
6143 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6144 not make_lisp_timeval, when the argument is of type EMACS_TIME.
6145
0bd8297f
EZ
61462012-06-23 Eli Zaretskii <eliz@gnu.org>
6147
96512555
EZ
6148 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6149 last argument of make_unibyte_string.
6150
0bd8297f
EZ
6151 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6152 language ID in the event parameters.
6153
6154 * w32term.c (w32_read_socket): Put the new keyboard codepage into
6155 event.code, not the obscure "character set ID".
6156
63def6b6
CY
61572012-06-23 Chong Yidong <cyd@gnu.org>
6158
6159 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6160
e8a02204
EZ
61612012-06-23 Eli Zaretskii <eliz@gnu.org>
6162
388cdec0
EZ
6163 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6164 * w32.c (fdutimens): New function.
6165
6166 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6167
6168 * s/ms-w32.h (pselect): Redirect to sys_select.
6169
6170 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6171
e8a02204
EZ
6172 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6173 in the logic of incrementing and decrementing the value of
6174 use_relocatable_buffers.
6175
d054f3fb
PE
61762012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6177
6178 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6179 Privately reported by Herbert J. Skuhra.
6180 [__FreeBSD__]: Remove "*/" typo after "#include".
6181 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6182 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6183 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6184 Don't assume EMACS_TIME and struct timeval are the same type.
6185
d35af63c
PE
61862012-06-22 Paul Eggert <eggert@cs.ucla.edu>
6187
6188 Support higher-resolution time stamps (Bug#9000).
6189 The time stamps are only nanosecond-resolution at the C level,
6190 since that's the best that any real-world system supports now.
6191 But they are picosecond-resolution at the Lisp level, as that's
6192 easy, and leaves room for future OS improvements.
6193
6194 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6195 (LIBES): Use it.
6196
6197 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6198 Don't get current time unless it's needed.
6199
6200 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6201 now provides it if it's absent.
6202 (start_atimer): Port to higher-res time stamps.
6203 Check for time stamp overflow. Don't get current time more
6204 often than is needed.
6205
6206 * buffer.h (struct buffer): Buffer modtime now has high resolution.
6207 Include systime.h, not time.h.
6208 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
6209
6210 * dired.c: Include stat-time.h.
6211 (Ffile-attributes): File times now have higher resolution.
6212
6213 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
6214 (struct image): Timestamp now has higher resolution.
6215
6216 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
6217 has at least microseconds now. All uses removed.
6218 (update_frame, update_single_window, update_window, update_frame_1)
6219 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 6220 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
6221
6222 * editfns.c (time_overflow): Now extern.
6223 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
6224 (float-time, Fformat_time_string, Fcurrent_time_string)
6225 (Fcurrent_time_zone): Accept and generate higher-resolution
6226 time stamps.
6227 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
6228 (decode_time_components, lisp_seconds_argument): New functions.
6229 (make_time): Now static.
6230 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
6231 Report an error if the time is invalid, rather than having the caller
6232 do that.
6233
6234 * fileio.c: Include <stat-time.h>
6235 (Fcopy_file): Copy higher-resolution time stamps.
6236 Prefer to set the time stamp via a file descriptor if that works.
6237 (Fset_file_times, Finsert_file_contents, Fwrite_region)
6238 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
6239 (Fvisited_file_modtime, Fset_visited_file_modtime):
6240 Support higher-resolution time stamps.
6241
6242 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6243
6244 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6245
6246 * image.c (prepare_image_for_display, clear_image_cache)
6247 (lookup_image): Port to higer-resolution time stamps.
6248
6249 * keyboard.c (start_polling, bind_polling_period):
6250 Check for time stamp overflow.
6251 (read_char, kbd_buffer_get_event, timer_start_idle)
6252 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6253 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6254 Port to higher-resolution time stamps. Do not assume time_t is signed.
6255 (decode_timer): New function. Timers are now vectors of length 9,
6256 not 8, to accommodate the picosecond component.
6257 (timer_check_2): Use it.
6258
6259 * nsterm.m (select_timeout, timeval_subtract): Remove.
6260 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6261 as they're a bit more accurate and handle overflow better.
6262 (ns_select): Change prototype to be compatible with pselect.
6263 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6264 * nsterm.h (ns_select): Adjust prototype.
6265
6266 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6267 us-resolution time stamps.
6268 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6269
6270 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6271
6272 * lisp.h (time_overflow): New decl.
6273 (wait_reading_process_output): First arg is now intmax_t, not int,
6274 to accommodate larger waits.
6275
6276 * process.h (struct Lisp_Process.read_output_delay):
6277 Now counts nanoseconds, not microseconds.
6278 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6279 EMACS_HAS_USECS.
6280 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6281 (wait_reading_process_output):
6282 Port to ns-resolution time stamps.
6283 (Faccept_process_output, wait_reading_process_output):
6284 Check for time stamp overflow. Do not assume time_t is signed.
6285 (select_wrapper): Remove; we now use pselect.
6286 (Fprocess_attributes): Now generates ns-resolution time stamps.
6287
6288 * sysdep.c: Include utimens.h. Don't include utime.h
6289 or worry about struct utimbuf; gnulib does that for us now.
6290 (gettimeofday): Remove; gnulib provides a substitute.
6291 (make_timeval): New function.
6292 (set_file_times): Now sets ns-resolution time stamps.
6293 New arg FD; all uses changed.
6294 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6295 (system_process_attributes):
6296 Now returns ns-resolution time stamp. All uses changed.
6297 Check for time stamp overflow.
6298
6299 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6300 provides a substitute now.
6301
6302 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6303 since it guarantees struct timespec.
6304 (EMACS_TIME): Now struct timespec, so that we can support
6305 ns-resolution time stamps.
6306 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6307 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6308 (EMACS_USECS): Remove.
6309 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6310 so multiply the arg by 1000 before storing it.
6311 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6312 New macros.
6313 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6314 Port to ns-resolution time stamps.
6315 (EMACS_TIME_NEG_P): Remove; replaced by....
6316 (EMACS_TIME_SIGN): New macro.
6317 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6318 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6319 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6320 (make_timeval, make_lisp_time, decode_time_components): New decls.
6321 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6322 that it mishandled time_t overflow. You can't compare by subtracting!
6323 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6324 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6325
6326 * term.c: Include <sys/time.h>.
6327 (timeval_to_Time): New function, for proper overflow wraparound.
6328 (term_mouse_position, term_mouse_click): Use it.
6329
6330 * undo.c (record_first_change): Support higher-resolution time stamps
6331 in the undo buffer.
6332 (Fprimitive_undo): Use them when restoring time stamps.
6333
6334 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6335 (w32_get_internal_run_time):
6336 Port to higher-resolution Emacs time stamps.
6337 (ltime): Now accepts single 64-bit integer, as that's more convenient
6338 for callers.
6339
6340 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6341
6342 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6343 for compatibility with pselect. Support ns-resolution time stamps.
6344
6345 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6346
6347 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6348 Check for time stamp overflow, and support ns-resolution time stamps.
6349
6350 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6351 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6352 (timeval_subtract): Remove; no longer needed.
6353 (XTflash, XTring_bell, x_wait_for_event):
6354 Port to ns-resolution time stamps. Don't assume time_t is signed.
6355
b6a92dfe
CY
63562012-06-22 Chong Yidong <cyd@gnu.org>
6357
6358 * xdisp.c (x_consider_frame_title): Revert last change.
6359
d251c37c
EZ
63602012-06-22 Eli Zaretskii <eliz@gnu.org>
6361
6362 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6363 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6364 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6365 staticidx goes up to 1597 out of 1600 = 0x640.)
6366
f10deafb
PE
63672012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6368
6369 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6370 Otherwise, the umask might be mistakenly 0 while handling input signals.
6371
ec6de1e2
SM
63722012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6373
6374 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6375
28be1ada
DA
63762012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6377
6378 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6379 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6380 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6381 access to `contents' member of Lisp_Vector objects with AREF and ASET
6382 where appropriate.
6383
c6bf3022
CY
63842012-06-19 Chong Yidong <cyd@gnu.org>
6385
6386 * frame.c (delete_frame): When selecting a frame on a different
6387 text terminal, do not alter the terminal's top-frame.
6388
6389 * xdisp.c (format_mode_line_unwind_data): Record the target
6390 frame's selected window and its terminal's top-frame.
6391 (unwind_format_mode_line): Restore them.
6392 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6393 Callers changed.
6394 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6395 since tty frames can be explicitly named.
6396 (prepare_menu_bars): Likewise.
6397
6398 * term.c (Ftty_top_frame): New function.
6399
defd4196
PE
64002012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6401
6402 Port byte-code-meter to modern targets.
6403 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6404 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 6405 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
6406 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6407 (METER_1, METER_2): Simplify.
6408
1053a871
SM
64092012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6410
6411 * data.c (Fdefalias): Return `symbol' (bug#11686).
6412
b7e8d081
MR
64132012-06-18 Martin Rudalics <rudalics@gmx.at>
6414
6415 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
6416 gets killed during executing of this function (Bug#11665).
6417 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
6418 (Vkill_buffer_query_functions): In doc-string say that functions
6419 run by this hook should not change the current buffer.
6420
7ea2b339
PE
64212012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6422
6423 Fix recently-introduced process.c problems found by static checking.
6424 * process.c (write_queue_push, write_queue_pop, send_process):
6425 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6426 (write_queue_pop): Fix pointer signedness problem.
6427 (send_process): Remove unused local.
6428
96a313a1
CY
64292012-06-17 Chong Yidong <cyd@gnu.org>
6430
6431 * xdisp.c (redisplay_internal): No need to redisplay terminal
6432 frames that are not on top.
6433
20ca2e94
TN
64342012-06-17 Troels Nielsen <bn.troels@gmail.com>
6435
6436 * process.c (make_process): Initialize write_queue.
6437 (write_queue_push, write_queue_pop): New functions.
6438 (send_process): Use them to maintain correct ordering of process
6439 writes (Bug#10815).
6440
9a900ca9
PE
64412012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6442
310fbfa8
PE
6443 * lisp.h (eassert): Assume C89 or later.
6444 This removes the need for CHECK.
6445 (CHECK): Remove. Its comments about always evaluating its
6446 argument were confusing, as 'eassert' typically does not evaluate
6447 its argument.
6448
27bb1ca4
PE
6449 * coding.c (produce_chars): Use ptrdiff_t, not int.
6450
9a900ca9
PE
6451 * xterm.c (x_draw_underwave): Check for integer overflow.
6452 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6453
41b7f8bc 64542012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
6455
6456 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6457 referenced (Bug#11583).
6458
9b0e3eba
AA
64592012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6460
6461 Implement wave-style variant of underlining.
6462 * dispextern.h (face_underline_type): New enum.
6463 (face): Add field for underline type.
6464 * nsterm.m (ns_draw_underwave): New function.
6465 (ns_draw_text_decoration): Use it.
6466 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6467 New functions.
6468 (x_draw_glyph_string): Use them.
6469 * xfaces.c (Qline, Qwave): New Lisp objects.
6470 (check_lface_attrs, merge_face_ref)
1053a871
SM
6471 (Finternal_set_lisp_face_attribute, realize_x_face):
6472 Handle wave-style underline face attributes.
9b0e3eba
AA
6473 * xterm.c (x_draw_underwave): New function.
6474 (x_draw_glyph_string): Use it.
6475
0fb52f11
JB
64762012-06-16 Juanma Barranquero <lekktu@gmail.com>
6477
6478 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6479 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6480 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6481 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6482 ($(BLD)/w32select.$(O)): Update dependencies.
6483
e5560ff7
AS
64842012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6485
6486 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6487 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6488 * character.c (_fetch_multibyte_char_p): Remove.
6489 * alloc.c: Include "character.h" before "buffer.h".
6490 * bidi.c: Likewise.
6491 * buffer.c: Likewise.
6492 * bytecode.c: Likewise.
6493 * callint.c: Likewise.
6494 * callproc.c: Likewise.
6495 * casefiddle.c: Likewise.
6496 * casetab.c: Likewise.
6497 * category.c: Likewise.
6498 * cmds.c: Likewise.
6499 * coding.c: Likewise.
6500 * composite.c: Likewise.
6501 * dired.c: Likewise.
6502 * dispnew.c: Likewise.
6503 * doc.c: Likewise.
6504 * dosfns.c: Likewise.
6505 * editfns.c: Likewise.
6506 * emacs.c: Likewise.
6507 * fileio.c: Likewise.
6508 * filelock.c: Likewise.
6509 * font.c: Likewise.
6510 * fontset.c: Likewise.
6511 * fringe.c: Likewise.
6512 * indent.c: Likewise.
6513 * insdel.c: Likewise.
6514 * intervals.c: Likewise.
6515 * keyboard.c: Likewise.
6516 * keymap.c: Likewise.
6517 * lread.c: Likewise.
6518 * macros.c: Likewise.
6519 * marker.c: Likewise.
6520 * minibuf.c: Likewise.
6521 * nsfns.m: Likewise.
6522 * nsmenu.m: Likewise.
6523 * print.c: Likewise.
6524 * process.c: Likewise.
6525 * regex.c: Likewise.
6526 * region-cache.c: Likewise.
6527 * search.c: Likewise.
6528 * syntax.c: Likewise.
6529 * term.c: Likewise.
6530 * textprop.c: Likewise.
6531 * undo.c: Likewise.
6532 * unexsol.c: Likewise.
6533 * w16select.c: Likewise.
6534 * w32fns.c: Likewise.
6535 * w32menu.c: Likewise.
6536 * window.c: Likewise.
6537 * xdisp.c: Likewise.
6538 * xfns.c: Likewise.
6539 * xmenu.c: Likewise.
6540 * xml.c: Likewise.
6541 * xselect.c: Likewise.
6542
2f07e6af
EZ
65432012-06-16 Eli Zaretskii <eliz@gnu.org>
6544
1053a871
SM
6545 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6546 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 6547 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
6548 row.
6549 (handle_face_prop): Use chunk-relative overlay string index when
6550 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
6551 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6552 the rightmost. (Bug#11720)
2f07e6af 6553
29b83cec
AS
65542012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6555
6556 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6557 (CATEGORY_MEMBER): Enforce 1/0 value.
6558 * category.c (_temp_category_set): Remove.
6559
4c5501e9
EZ
65602012-06-16 Eli Zaretskii <eliz@gnu.org>
6561
6562 * window.c (Fdelete_other_windows_internal)
6563 (Fdelete_window_internal): Don't access frame's mouse highlight
6564 info of the initial frame. (Bug#11677)
6565
2b570124
PE
65662012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6567
e93864f9
PE
6568 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6569 Assume USE_2_TAGS_FOR_INTS.
6570 (xreload): Adjust $tagmask width to match recent lisp.h change.
6571
2b570124
PE
6572 Simplify lisp.h in minor ways that should not affect code.
6573 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6574 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6575 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6576 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6577 (INTTYPEBITS): New macro, for clarity.
6578 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
6579 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6580 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
6581 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6582 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6583
81755f69
JB
65842012-06-13 Juanma Barranquero <lekktu@gmail.com>
6585
6586 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6587
16192a57
GM
65882012-06-13 Glenn Morris <rgm@gnu.org>
6589
6590 * s/bsd-common.h (BSD4_3):
6591 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6592
646b5f55
AS
65932012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6594
6595 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6596 instead of union.
6597 (XLI, XIL): Define.
1053a871
SM
6598 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6599 Use them.
6600 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 6601 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 6602 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
6603 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6604 * frame.c (delete_frame): Remove outdated comment.
6605 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6606 USE_LISP_UNION_TYPE.
6607 (Fw32_unregister_hot_key): Likewise.
6608 (Fw32_toggle_lock_key): Likewise.
6609 * w32menu.c (add_menu_item): Likewise.
6610 (w32_menu_display_help): Use XIL instead of checking
6611 USE_LISP_UNION_TYPE.
6612 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6613 (init_heap): Likewise.
6614 * w32term.c (w32_read_socket): Update comment.
6615
1d3823c9
GM
66162012-06-13 Glenn Morris <rgm@gnu.org>
6617
c62ff706
GM
6618 * s/usg5-4-common.h, src/s/unixware.h:
6619 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6620
1d3823c9
GM
6621 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6622
bfe3e0a2
PE
66232012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6624
6625 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6626 * alloc.c (make_number) [!defined make_number]:
6627 Remove, as lisp.h always defines this now.
6628 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6629 (roundup_size): Verify that it is a power of 2.
6630 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6631 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6632 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6633 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6634 USE_LSB_TAG now is always defined to be either 0 or 1.
6635 All uses changed.
6636 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6637 code works fine either way, and efficiency is not a concern here,
6638 as the union type is for debugging, not for production.
6639 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6640 Use an inline function on all platforms when using the union type,
6641 since this is simpler and 'static inline' can be used portably
6642 within Emacs now.
6643 (LISP_INITIALLY_ZERO): New macro.
6644 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6645 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6646
45fa9c0f
GM
66472012-06-12 Glenn Morris <rgm@gnu.org>
6648
b4492cba
GM
6649 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6650
6651 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 6652
45fa9c0f
GM
6653 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6654 Move BROKEN_SIGIO to configure.
6655
6656 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6657 Move NO_TERMIO to configure.
6658
0e25d334
CY
66592012-06-12 Chong Yidong <cyd@gnu.org>
6660
6661 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6662 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6663 MagickExportImagePixels is undefined.
6664
43682bb6
PE
66652012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6666
6667 * image.c (imagemagick_load_image): Remove unused label.
6668
a9be7d2b
GM
66692012-06-11 Glenn Morris <rgm@gnu.org>
6670
6671 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6672 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6673 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6674 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6675
3017f87f
SM
66762012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6677
6678 * alloc.c (make_byte_code): New function.
6679 (Fmake_byte_code): Use it. Don't purify here.
6680 * lread.c (read1): Use it as well to avoid extra allocation.
6681
1b9b4cf4
CY
66822012-06-11 Chong Yidong <cyd@gnu.org>
6683
6684 * image.c (imagemagick_load_image): Implement transparency.
6685
95988fcf
AS
66862012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6687
6688 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6689 account for preceding backslashes. (Bug#11663)
6690
cd4eb164
CY
66912012-06-09 Chong Yidong <cyd@gnu.org>
6692
6693 * term.c: Support italics in capable terminals (Bug#9652).
6694 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6695 (turn_on_face): Output using TS_enter_italic_mode if available.
6696 Don't handle unused blinking and alt-charset cases.
6697 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6698 and tty_alt_charset_p cases.
6699 (tty_capable_p, init_tty): Support italics.
6700
6701 * termchar.h (struct tty_display_info): Add field for italics.
6702 Remove unused blink field.
6703
6704 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6705 Handle slant.
6706
6707 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6708 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6709 tty_alt_charset_p. Add tty_italic_p.
6710
ff88beb8
MA
67112012-06-09 Michael Albinus <michael.albinus@gmx.de>
6712
6713 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6714 dbus_type_is_basic if available.
6715 (xd_extract_signed, xd_extract_unsigned): Rename from
6716 extract_signed and extract_unsigned, respectively. Adapt callers.
6717
44286096
CY
67182012-06-09 Chong Yidong <cyd@gnu.org>
6719
1682701f
CY
6720 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6721
44286096
CY
6722 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6723 case (Bug#9752).
6724
d86feb17
PE
67252012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6726
6727 * xdisp.c (vmessage): Treat frame message as multibyte.
6728 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6729 would generate the diagnostic "Making \302\247 buffer-local while
6730 let-bound!".
6731
d5c20fe8
EZ
67322012-06-08 Eli Zaretskii <eliz@gnu.org>
6733
6734 * dispnew.c (showing_window_margins_p): Undo last change, which
6735 was done due to an inadvertent commit.
6736 (adjust_frame_glyphs_for_frame_redisplay): Do call
6737 showing_window_margins_p.
6738
513749ee
SM
67392012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6740
6741 * eval.c (Fmake_var_non_special): New primitive.
6742 (syms_of_eval): Defsubr it.
6743 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6744
d4a8f5c1
JB
67452012-06-08 Juanma Barranquero <lekktu@gmail.com>
6746
6747 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6748 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6749
8bbbc977
EZ
67502012-06-08 Eli Zaretskii <eliz@gnu.org>
6751
6752 * alloc.c (allocate_vectorlike): Fix last change.
6753
f3372c87
DA
67542012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6755
6756 Block-based vector allocation of small vectors.
6757 * lisp.h (struct vectorlike_header): New field `nbytes',
6758 adjust comment accordingly.
6759 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 6760 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
6761 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6762 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6763 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6764 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6765 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6766 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6767 (roundup_size): New constant.
6768 (struct vector_block): New data type.
6769 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 6770 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
6771 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6772 (sweep_vectors): New functions.
6773 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 6774 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
6775 or equal to VBLOCK_BYTES_MAX.
6776 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6777 (init_alloc_once): Add call to init_vectors.
6778
4f18a4ed
SM
67792012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6780
6781 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6782
86f158bc
PE
67832012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6784
6785 * doprnt.c (doprnt): Truncate multibyte char correctly.
6786 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6787 would mishandle a string argument "Xc" if X was a multibyte
6788 character of length 2: it would truncate after X's first byte
6789 rather than including all of X.
6790
c5cfcbe0
CY
67912012-06-06 Chong Yidong <cyd@gnu.org>
6792
6793 * buffer.c (word_wrap): Doc fix.
6794
c05cf390
PE
67952012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6796
6797 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6798
0c3461de
GM
67992012-06-03 Glenn Morris <rgm@gnu.org>
6800
6801 * xdisp.c (tool-bar-style): Doc fix.
6802
c71232db
UM
68032012-06-03 Ulrich Müller <ulm@gentoo.org>
6804
6805 * Makefile.in (PAXCTL): Define.
6806 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6807 binary via PaX flags if the paxctl utility is available.
6808 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6809 Restore PaX flags to their default. (Bug#11398)
6810
383f7350
CY
68112012-06-03 Chong Yidong <cyd@gnu.org>
6812
6813 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6814 buffer (Bug#11226).
6815
5f2c76c6
CY
68162012-06-03 Chong Yidong <cyd@gnu.org>
6817
6818 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6819 (note_mode_line_or_margin_highlight): If there is no help echo,
6820 use mode-line-default-help-echo. Handle the case where the mouse
6821 position is past the end of the mode line string.
6822
6823 * buffer.c (buffer_local_value_1): New function, split from
6824 Fbuffer_local_value; can return Qunbound.
6825 (Fbuffer_local_value): Use it.
6826 (Vmode_line_format): Docstring tweaks.
6827
773d47f6
PE
68282012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6829
6830 * sysdep.c (system_process_attributes): Improve comment.
6831
f2d6a3df
SM
68322012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6833
6834 * keyboard.c: Export real-this-command to Elisp.
6835 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6836 and DEFVAR it. Update all users.
6837
63810350
PE
68382012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6839
7bd5c1f4
PE
6840 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6841
63810350
PE
6842 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6843 Convert pctcpu and pctmem to Lisp float properly.
6844 Let the compiler fold better, as 100.0/0x8000 is exact.
6845
a2821611
AS
68462012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6847
6848 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6849 cons_block.
6850
5fceba1d
PE
68512012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6852
6853 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6854
c98ff5dd
DA
68552012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6856
6857 For a 'struct window', replace some Lisp_Object fields to
6858 bitfields where appropriate, remove unused fields.
6859 * window.h (struct window): Remove unused 'last_mark_x' and
6860 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6861 change it's type from Lisp_Object to bitfield.
6862 Change type of 'force_start', 'optional_new_start',
6863 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 6864 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 6865
ca34e0be
PE
68662012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6867
6868 Pacify gcc -Wdouble-precision when using Xaw.
6869 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6870 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6871 Use 'float' consistently, rather than 'float' in most places
6872 and 'double' in a couple of places.
6873
efc00ab1 68742012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
6875
6876 * xdisp.c (handle_stop): Detect whether we have overlay strings
6877 loaded by testing it->current.overlay_string_index to be
6878 non-negative, instead of checking whether n_overlay_strings is
6879 positive. (Bug#11587)
6880
efc00ab1 68812012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
6882
6883 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6884
6885 * doc.c (Fsubstitute_command_keys): Doc fix.
6886
efc00ab1 68872012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
6888
6889 * search.c (search_buffer): Remove calls to
6890 r_alloc_inhibit_buffer_relocation, as it is now called by
6891 maybe_unify_char, which was the cause of relocation of buffer text
6892 in bug#11519.
6893
efc00ab1 68942012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
6895
6896 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6897 for the duration of call to load_charset, to avoid problems with
6898 callers of maybe_unify_char that access buffer text through C
6899 pointers.
6900
6901 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6902 decrement the inhibition flag, instead of just setting or
6903 resetting it.
6904
ba93a187
PE
69052012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6906
6907 Remove obsolete '#define static' cruft.
6908 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6909 This #undef was "temporary" in 2000; it is no longer needed
6910 now that '#define static' has gone away.
6911 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6912 (gray_bitmap_bits): Remove; no longer needed.
6913 All uses replaced with definiens.
6914 * xterm.c: Include "bitmaps/gray.xbm".
6915
9e4bf381
PE
69162012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6917
6918 Clean up __executable_start, monstartup when --enable-profiling.
6919 The following changes affect the code only when profiling.
6920 * dispnew.c (__executable_start): Rename from safe_bcopy.
6921 Define only on platforms that need it.
6922 * emacs.c: Include <sys/gmon.h> when profiling.
6923 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6924 (__executable_start): Remove decl, since lisp.h does it now.
6925 (safe_bcopy): Remove decl; no longer has that name.
6926 (main): Coalesce #if into single bit of code, for simplicity.
6927 Cast pointers to uintptr_t, since standard libraries want integers
6928 and not pointers.
6929 * lisp.h (__executable_start): New decl.
6930
32d72c2f
GM
69312012-05-31 Glenn Morris <rgm@gnu.org>
6932
6933 * image.c (Fimagemagick_types): Doc fix.
6934
baac5bc7
JM
69352012-05-30 Jim Meyering <meyering@redhat.com>
6936
6937 * callproc.c (Fcall_process_region): Include directory component
6938 in mkstemp error message (Bug#11586).
6939
72cb32cf
PE
69402012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6941
6942 * alloc.c, lisp.h (make_pure_vector): Now static.
6943
61b108cc
SM
69442012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6945
6946 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6947 Move to byte-run.el.
6948 (Fautoload): Do the hash-doc more carefully.
6949 * data.c (Fdefalias): Purify definition, except for keymaps.
6950 (Qdefun): Move from eval.c.
6951 * lisp.h (Qdefun): Remove.
6952 * lread.c (read1): Tiny simplification.
6953
471fe23d
TN
69542012-05-29 Troels Nielsen <bn.troels@gmail.com>
6955
934f3f58 6956 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
6957 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6958 Bug#9642, but explicitly check that the buffer the overlay would
6959 be moved to is live and rearrange lines to make sure that errors
6960 will not put the overlay in an inconsistent state.
6961 (Fdelete_overlay): Cosmetics.
6962
85d0efd1
EZ
69632012-05-28 Eli Zaretskii <eliz@gnu.org>
6964
6965 * w32term.c (my_bring_window_to_top): New function.
6966 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
6967 could be different from the original one.
6968 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
6969 (Bug#11513)
6970
6971 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6972 by calling BringWindowToTop.
6973
6974 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6975 (WM_EMACS_END): Increase by one.
6976
da92a98c
PE
69772012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6978
6979 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6980 This avoids undefined behavior that might cause the eassert
6981 to not catch an out-of-range value.
6982
74d1f848
JB
69832012-05-28 Juanma Barranquero <lekktu@gmail.com>
6984
6985 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6986 Update dependencies.
6987
9e1a06fc
EZ
69882012-05-27 Eli Zaretskii <eliz@gnu.org>
6989
6990 * bidi.c (bidi_mirror_char): Fix last change.
6991
f3dd7312
AS
69922012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6993
6994 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6995 when referring to sectname field in printf format.
6996
81899c91
PE
69972012-05-27 Paul Eggert <eggert@cs.ucla.edu>
6998
57b81a9f
PE
6999 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7000 Only r_alloc_inhibit_buffer_relocation needed to be added;
7001 the others were already declared.
7002
81899c91
PE
7003 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7004 before checking whether it's out of range. Put the check inside
7005 eassert. See
7006 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7007
33017faf 70082012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
7009
7010 * callproc.c (Fcall_process): Restore a line that was accidentally
7011 commented out in the 2011-02-13 change (bug#11547).
7012
33017faf 70132012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
7014
7015 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7016 defined on ralloc.c.
7017
7018 * buffer.c [REL_ALLOC]: Remove prototypes of
7019 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7020 they are now on lisp.h.
7021
7022 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7023
7024 * search.c (search_buffer): Use it to inhibit relocation of buffer
7025 text while re_search_2 is doing its job, because re_search_2 is
7026 passed C pointers to buffer text. (Bug#11519)
7027
23415acf
EZ
7028 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7029 Update value to 24.
7030
44e27368
EZ
7031 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7032 state after an additional call to move_it_in_display_line_to, keep
7033 the values of it->max_ascent and it->max_descent found for the
7034 entire line.
7035 (pos_visible_p): Revert the comparison against bottom_y to what it
7036 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7037 (Bug#11464)
7038
c1892f11
PE
70392012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7040
7041 Fix coding-related core dumps with gcc -ftrapv.
7042 The code was computing A - B, where A and B are pointers, and B is
7043 random garbage. This can lead to core dumps on platforms that
7044 have special pointer registers, and it also leads to core dumps on
7045 x86-64 when compiled with gcc -ftrapv. The fix is to compute
7046 A - B only when B is initialized properly.
7047 * coding.c (coding_set_source, coding_set_destination): Return void.
7048 (coding_change_source, coding_change_destinations): New functions,
7049 with the old behaviors of coding_set_source and coding_set_destination.
7050 All callers that need an offset changed to use these new functions.
7051
eb7afdad
GM
70522012-05-26 Glenn Morris <rgm@gnu.org>
7053
7054 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
7055
f12fdf02
EZ
70562012-05-26 Eli Zaretskii <eliz@gnu.org>
7057
53a63be6 7058 Extend mouse support on W32 text-mode console.
61b108cc
SM
7059 * xdisp.c (draw_row_with_mouse_face):
7060 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 7061
eb3f6f01 7062 * w32console.c: Include window.h.
61b108cc
SM
7063 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
7064 New functions.
eb3f6f01
EZ
7065 (initialize_w32_display): Initialize mouse-highlight data.
7066
53a63be6
EZ
7067 * w32inevt.c: Include termchar.h and window.h.
7068 (do_mouse_event): Support mouse-autoselect-window. When the mouse
7069 moves, call note_mouse_highlight. If help_echo changed, call
7070 gen_help_event to produce help-echo message in the echo area.
7071 Call clear_mouse_face if mouse_face_hidden is set in the mouse
7072 highlight info.
7073
4cfd81f6
PE
70742012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7075
7076 * lread.c (read1): Simplify slightly to avoid an overflow warning
7077 with GCC 4.7.0 on x86-64.
7078
4446092a
EZ
70792012-05-26 Eli Zaretskii <eliz@gnu.org>
7080
7081 * bidi.c (bidi_mirror_char): Revert last change: an int is
7082 definitely wide enough here.
7083
42b2a986 70842012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 7085
42b2a986 7086 Fix integer width and related bugs (Bug#9874).
eb106a49 7087 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
7088 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
7089 (string_bytes, check_sblock, allocate_string_data):
7090 (compact_small_strings, Fmake_bool_vector, make_string)
7091 (make_unibyte_string, make_multibyte_string)
7092 (make_string_from_bytes, make_specified_string)
7093 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
7094 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
7095 (mark_vectorlike):
7096 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7097 (allocate_pseudovector):
7098 Use int, not EMACS_INT, where int is wide enough.
7099 (inhibit_garbage_collection, Fgarbage_collect):
7100 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7101 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
7102 int might not be wide enough.
7103 (bidi_cache_search, bidi_cache_find, bidi_init_it)
7104 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
7105 (bidi_at_paragraph_end, bidi_find_paragraph_start)
7106 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7107 (bidi_level_of_next_char, bidi_move_to_visually_next):
7108 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7109 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
7110 (Fkill_buffer, Fset_buffer_major_mode)
7111 (advance_to_char_boundary, Fbuffer_swap_text)
7112 (Fset_buffer_multibyte, overlays_at, overlays_in)
7113 (overlay_touches_p, struct sortvec, record_overlay_string)
7114 (overlay_strings, recenter_overlay_lists)
7115 (adjust_overlays_for_insert, adjust_overlays_for_delete)
7116 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
7117 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
7118 (Foverlay_recenter, last_overlay_modification_hooks_used)
7119 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7120 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
7121 (validate_region): Omit unnecessary test for b <= e,
7122 since that's guaranteed by the previous test.
d311d28c
PE
7123 (adjust_overlays_for_delete): Avoid pos + length overflow.
7124 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7125 (report_overlay_modification):
7126 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7127 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7128 Omit pointer cast, which isn't needed anyway, and doesn't work
7129 after the EMACS_INT -> ptrdiff_t change.
02481186 7130 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
7131 * buffer.h: Adjust decls to match defn changes elsewhere.
7132 (struct buffer_text, struct buffer):
7133 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7134 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
7135 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7136 not int, to avoid needless 32-bit limit on 64-bit hosts.
7137 (exec_byte_code): Use tighter memory-full test, one that checks
7138 for alloca overflow. Don't compute the address of the object just
7139 before an array, as that's not portable. Use EMACS_INT, not
7140 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
7141 * callint.c (Fcall_interactively):
7142 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7143 * callproc.c (call_process_kill, Fcall_process):
7144 Don't assume pid_t fits into an Emacs fixnum.
7145 (call_process_cleanup, Fcall_process, child_setup):
7146 Don't assume pid_t fits into int.
7147 (call_process_cleanup, Fcall_process, delete_temp_file)
7148 (Fcall_process_region):
7149 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7150 (Fcall_process): Simplify handling of volatile integers.
7151 Use int, not EMACS_INT, where int will do.
7152 * casefiddle.c (casify_object, casify_region, operate_on_word)
7153 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7154 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7155 (casify_object): Avoid integer overflow when overallocating buffer.
7156 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 7157 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
7158 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7159 * category.h (CATEGORYP): Don't assume arg is nonnegative.
7160 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7161 integers are now checked earlier. All uses replaced with XINT.
7162 (ccl_driver):
7163 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7164 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
7165 (ccl_driver, Fregister_code_conversion_map):
7166 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
7167 (resolve_symbol_ccl_program): Check that vector header is in range.
7168 Always copy the vector, so that we can check its contents reliably
7169 now rather than having to recheck each instruction as it's being
7170 executed. Check that vector words fit in 'int'.
7171 (ccl_get_compiled_code, Fregister_ccl_program)
7172 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7173 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7174 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7175 contents are in range.
7176 (Fccl_execute_on_string): Check that status is in range.
7177 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7178 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7179 Accept and return EMACS_INT, not int, because callers can pass values
7180 out of 'int' range.
7181 (c_string_width, strwidth, lisp_string_width, chars_in_text)
7182 (multibyte_chars_in_text, parse_str_as_multibyte)
7183 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7184 (str_as_unibyte, str_to_unibyte, string_count_byte8)
7185 (string_escape_byte8, Fget_byte):
7186 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 7187 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
7188 avoid mishandling large integers.
7189 * character.h: Adjust decls to match defn changes elsewhere.
7190 * charset.c (load_charset_map_from_file, find_charsets_in_text)
7191 (Ffind_charset_region):
7192 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7193 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7194 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 7195 Don't assume fixnum fits in int.
d311d28c
PE
7196 (load_charset_map_from_vector, Fmap_charset_chars):
7197 Remove now-unnecessary CHECK_NATNUMs.
7198 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
7199 Don't rely on undefined behavior with signed left shift overflow.
7200 Don't assume unsigned int fits into fixnum, or that fixnum fits
7201 into unsigned int. Don't require max_code to be a valid fixnum;
7202 that's not true for gb10830 4-byte on a 32-bit host. Allow
7203 invalid_code to be a cons, for the same reason. Require code_offset
7204 to be a character. Avoid int overflow if max_char is close
7205 to INT_MAX.
7206 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7207 this is intended anyway and avoids some undefined behavior.
7208 (load_charset_map): Pass unsigned, not int, as 2nd arg of
7209 INDEX_TO_CODE_POINT, as that's what it expects.
7210 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
7211 * charset.h (DECODE_CHAR): Return int, not unsigned;
7212 this is what was intended anyway, and it avoids undefined behavior.
7213 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
7214 integer-overflow issues.
7215 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
7216 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
7217 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
7218 * chartab.c (Fmake_char_table, Fset_char_table_range)
7219 (uniprop_get_decoder, uniprop_get_encoder):
7220 Don't assume fixnum fits in int.
7221 * cmds.c (move_point): New function, that does the gist of
7222 Fforward_char and Fbackward_char, but does so while checking
7223 for integer overflow more accurately.
c96e5d6a 7224 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
7225 (Fforward_line, Fend_of_line, internal_self_insert)
7226 (internal_self_insert):
7227 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7228 Fix a FIXME, by checking for integer overflow when calculating
7229 target_clm and actual_clm.
7230 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 7231 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
7232 (ASSURE_DESTINATION, coding_alloc_by_realloc)
7233 (coding_alloc_by_making_gap, alloc_destination)
7234 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
7235 (encode_coding_utf_16, detect_coding_emacs_mule)
7236 (decode_coding_emacs_mule, encode_coding_emacs_mule)
7237 (detect_coding_iso_2022, decode_coding_iso_2022)
7238 (encode_invocation_designation, encode_designation_at_bol)
7239 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7240 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7241 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7242 (encode_coding_ccl, encode_coding_raw_text)
7243 (detect_coding_charset, decode_coding_charset)
7244 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7245 (produce_composition, produce_charset, produce_annotation)
7246 (decode_coding, handle_composition_annotation)
7247 (handle_charset_annotation, consume_chars, decode_coding_gap)
7248 (decode_coding_object, encode_coding_object, detect_coding_system)
7249 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7250 (code_convert_region, code_convert_string)
8f50130c
PE
7251 (Fdefine_coding_system_internal)
7252 (coding_set_source, coding_set_destination):
d311d28c
PE
7253 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7254 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7255 (Fdefine_coding_system_internal):
7256 Don't assume fixnums fit in int.
7257 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 7258 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
7259 (Funencodable_char_position, Fcheck_coding_systems_region)
7260 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 7261 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 7262 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 7263 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 7264 Don't access memory outside of the args array.
d311d28c 7265 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
7266 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7267 result of ENCODE_CHAR.
d311d28c
PE
7268 * coding.h: Adjust decls to match defn changes elsewhere.
7269 (struct coding_system):
7270 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7271 * composite.c (get_composition_id, find_composition)
7272 (run_composition_function, update_compositions)
7273 (compose_text, composition_gstring_put_cache)
7274 (composition_gstring_p, composition_gstring_width)
7275 (fill_gstring_header, fill_gstring_body, autocmp_chars)
7276 (composition_compute_stop_pos, composition_reseat_it)
7277 (composition_update_it, struct position_record)
7278 (find_automatic_composition, composition_adjust_point)
7279 (Fcomposition_get_gstring, Ffind_composition_internal):
7280 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7281 (update_compositions):
7282 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7283 * composite.h: Adjust decls to match defn changes elsewhere.
7284 (struct composition):
7285 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7286 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7287 Do not attempt to compute the address of the object just before a
7288 buffer; this is not portable.
7289 (Faref, Faset):
7290 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7291 (Faset): Use int, not EMACS_INT, where int is wide enough.
7292 (Fstring_to_number): Don't assume fixnums fit in int.
7293 (Frem): Don't assume arg is nonnegative.
7294 * dbusbind.c (xd_append_arg): Check for integers out of range.
7295 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 7296 (extract_signed, extract_unsigned): New functions.
243e0530
PE
7297 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7298 (xd_get_connection_references): Return ptrdiff_t, not int.
7299 All uses changed.
7300 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7301 (xd_read_message_1):
7302 Use int, not unsigned, where the dbus API uses int.
7303 (Fdbus_message_internal): Don't overflow mtype.
7304 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
7305 * dired.c (directory_files_internal, file_name_completion, scmp)
7306 (file_name_completion_stat):
7307 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7308 (file_name_completion): Don't overflow matchcount.
7309 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7310 * dispextern.h: Adjust decls to match defn changes elsewhere.
7311 (struct text_pos, struct glyph, struct bidi_saved_info)
7312 (struct bidi_string_data, struct bidi_it, struct composition_it)
7313 (struct it):
7314 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7315 (struct display_pos, struct composition_it, struct it):
7316 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7317 * dispnew.c (increment_matrix_positions)
7318 (increment_row_positions, mode_line_string)
7319 (marginal_area_string):
7320 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 7321 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
7322 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7323 (duration_to_sec_usec): New function, to check for overflow better.
7324 (Fsleep_for, sit_for): Use it.
7325 * doc.c (get_doc_string, store_function_docstring):
7326 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7327 (get_doc_string, Fsnarf_documentation):
7328 Use int, not EMACS_INT, where int is wide enough.
7329 (get_doc_string):
7330 Use SAFE_ALLOCA, not alloca.
7331 Check for overflow when converting EMACS_INT to off_t.
7332 * doprnt.c (doprnt):
7333 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7334 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7335 Don't assume uid_t fits into fixnum.
7336 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7337 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7338 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7339 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7340 (general_insert_function)
7341 (Finsert_char, make_buffer_string, make_buffer_string_both)
7342 (update_buffer_properties, Fbuffer_substring)
7343 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7344 (Fsubst_char_in_region, check_translation)
7345 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7346 (transpose_markers, Ftranspose_regions):
7347 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7348 (clip_to_bounds): Move to lisp.h as an inline function).
7349 (Fconstrain_to_field): Don't assume integers are nonnegative.
7350 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7351 (Fsubst_char_in_region, Fsave_restriction):
7352 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7353 (Femacs_pid): Don't assume pid_t fits into fixnum.
7354 (lo_time): Use int, not EMACS_INT, when int suffices.
7355 (lisp_time_argument): Check for usec out of range.
7356 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
7357 (Fuser_login_name, Fuser_full_name): Signal an error
7358 if a uid argument is out of range, rather than relying on
7359 undefined behavior.
c8d5c857
PE
7360 (Fformat_time_string): Remove now-unnecessary check.
7361 lisp_time_argument checks for out-of-range usec now.
243e0530 7362 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
7363 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7364 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7365 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7366 (init_cmdargs, Fdump_emacs):
7367 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7368 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7369 the bottom (typically) 32 bits of the fixnum.
7370 * eval.c (specpdl_size, call_debugger):
7371 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7372 (when_entered_debugger, Fbacktrace_debug):
7373 Don't assume fixnum can fit in int.
7374 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7375 the object just before a buffer; this is not portable.
7376 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7377 (grow_specpdl, unbind_to):
7378 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7379 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7380 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 7381 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
7382 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7383 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7384 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7385 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7386 (a_write, e_write):
7387 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7388 (Fcopy_file, non_regular_nbytes, read_non_regular)
7389 (Finsert_file_contents):
7390 Use int, not EMACS_INT, where int is wide enough.
7391 (READ_BUF_SIZE): Verify that it fits in int.
7392 (Finsert_file_contents): Check that counts are in proper range,
7393 rather than assuming fixnums fit into ptrdiff_t etc.
7394 Don't assume fixnums fit into int.
125b3835 7395 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
7396 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7397 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
7398 (string_char_to_byte, string_byte_to_char)
7399 (string_make_multibyte, string_to_multibyte)
7400 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7401 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7402 (substring_both, Fdelete, internal_equal, Ffillarray)
7403 (Fclear_string, mapcar1)
7404 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7405 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7406 (larger_vector, make_hash_table, maybe_resize_hash_table)
7407 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7408 (Fmaphash, secure_hash):
7409 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7410 (concat): Check for string index and length overflow.
7411 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7412 (Frequire):
7413 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7414 (larger_vector): New API (vec, incr_min, size_max) replaces old
7415 one (vec, new_size, init). This catches size overflow.
7416 INIT was removed because it was always Qnil.
7417 All callers changed.
7418 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7419 the upper bound on a hash table index size.
7420 (make_hash_table, maybe_resize_hash_table): Use it.
7421 (secure_hash): Computer start_byte and end_byte only after
7422 they're known to be in ptrdiff_t range.
7423 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7424 (Ffont_get_glyphs, Ffont_at):
7425 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7426 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7427 (Flist_fonts, Fopen_font):
7428 Don't assume fixnum can fit in int.
7429 (check_gstring): Don't assume index can fit in int.
7430 (font_match_p): Check that fixnum is a character, not a nonnegative
7431 fixnum, since the later code needs to stuff it into an int.
7432 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7433 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7434 conversion overflow issues.
7435 (Fopen_font): Check for integer out of range.
7436 (Ffont_get_glyphs): Don't assume index can fit in int.
7437 * font.h: Adjust decls to match defn changes elsewhere.
7438 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7439 integer overflow.
7440 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7441 printmax_t, where ptrdiff_t is wide enough.
7442 (Finternal_char_font):
7443 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7444 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7445 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7446 (Fset_frame_position, x_set_frame_parameters)
7447 (x_set_line_spacing, x_set_border_width)
7448 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7449 Check that fixnums are in proper range for system types.
7450 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7451 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7452 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7453 Use SAFE_ALLOCA_LISP, not alloca.
7454 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7455 intptr_t is wide enough.
7456 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7457 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7458 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7459 Check for fixnum out of range.
7460 * ftfont.c (ftfont_list): Don't assume index fits in int.
7461 Check that fixnums are in proper range for system types.
7462 (ftfont_shape_by_flt):
7463 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
7464 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7465 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7466 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7467 Check that fixnums are in proper range for system types.
7468 * gnutls.h: Adjust decls to match defn changes elsewhere.
7469 * gtkutil.c (xg_dialog_run):
7470 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7471 (update_frame_tool_bar):
7472 Check that fixnums are in proper range for system types.
7473 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 7474 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
7475 * indent.c (last_known_column, last_known_column_point):
7476 (current_column_bol_cache):
7477 (skip_invisible, current_column, check_display_width):
7478 (check_display_width, scan_for_column, current_column_1)
7479 (Findent_to, Fcurrent_indentation, position_indentation)
7480 (indented_beyond_p, Fmove_to_column, compute_motion):
7481 (Fcompute_motion, Fvertical_motion):
7482 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7483 (last_known_column_modified): Use EMACS_INT, not int.
7484 (check_display_width):
7485 (Fcompute_motion):
7486 Check that fixnums and floats are in proper range for system types.
7487 (compute_motion): Don't assume index or fixnum fits in int.
7488 (compute_motion, Fcompute_motion):
7489 Use int, not EMACS_INT, when it is wide enough.
7490 (vmotion): Omit local var start_hpos that is always 0; that way
7491 we don't need to worry about overflow in expressions involving it.
7492 * indent.h: Adjust decls to match defn changes elsewhere.
7493 (struct position):
7494 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7495 Use int, not EMACS_INT, where int is wide enough.
7496 Remove unused members ovstring_chars_done and tab_offset;
7497 all uses removed.
7498 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7499 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7500 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7501 (make_gap, copy_text, insert, insert_and_inherit)
7502 (insert_before_markers, insert_before_markers_and_inherit)
7503 (insert_1, count_combining_before, count_combining_after)
7504 (insert_1_both, insert_from_string)
7505 (insert_from_string_before_markers, insert_from_string_1)
7506 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7507 (adjust_after_replace, adjust_after_insert, replace_range)
7508 (replace_range_2, del_range, del_range_1, del_range_byte)
7509 (del_range_both, del_range_2, modify_region)
7510 (prepare_to_modify_buffer, signal_before_change)
7511 (signal_after_change, Fcombine_after_change_execute):
7512 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7513 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7514 (balance_an_interval, split_interval_right, split_interval_left)
7515 (find_interval, next_interval, update_interval)
7516 (adjust_intervals_for_insertion, delete_node, delete_interval)
7517 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7518 (static_offset_intervals, offset_intervals)
7519 (merge_interval_right, merge_interval_left, make_new_interval)
7520 (graft_intervals_into_buffer, temp_set_point_both)
7521 (temp_set_point, set_point, adjust_for_invis_intang)
7522 (set_point_both, move_if_not_intangible, get_property_and_range)
7523 (get_local_map, copy_intervals, copy_intervals_to_string)
7524 (compare_string_intervals, set_intervals_multibyte_1):
7525 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7526 * intervals.h: Adjust decls to match defn changes elsewhere.
7527 (struct interval):
7528 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7529 * keyboard.c (this_command_key_count, this_single_command_key_start)
7530 (before_command_key_count, before_command_echo_length, echo_now)
7531 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7532 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7533 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7534 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7535 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7536 (last_non_minibuf_size, last_point_position, echo_truncate)
7537 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7538 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7539 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7540 (stuff_buffered_input):
7541 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7542 (last_auto_save, command_loop_1, read_char):
7543 Use EMACS_INT, not int, to avoid integer overflow.
7544 (record_char): Avoid overflow in total_keys computation.
7545 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7546 * keyboard.h: Adjust decls to match defn changes elsewhere.
7547 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7548 (Fkey_description, Fdescribe_vector, Flookup_key):
7549 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7550 (click_position): New function, to check that positions are in range.
7551 (Fcurrent_active_maps):
7552 (describe_command):
7553 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7554 (Faccessible_keymaps, Fkey_description):
7555 (preferred_sequence_p):
7556 Don't assume fixnum can fit into int.
7557 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7558 Check for integer overflow in size calculations.
7559 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7560 avoid mishandling large integers.
7561 * lisp.h: Adjust decls to match defn changes elsewhere.
7562 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7563 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7564 (struct Lisp_Marker):
7565 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7566 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
7567 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7568 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7569 All callers changed.
7570 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7571 Assume the arg has valid form, since it always does.
7572 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7573 unsigned integer system type.
7574 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7575 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7576 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7577 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7578 (duration_to_sec_usec): New decl.
7579 * lread.c (read_from_string_index, read_from_string_index_byte)
7580 (read_from_string_limit, readchar, unreadchar, openp)
7581 (read_internal_start, read1, oblookup):
7582 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7583 (Fload, readevalloop, Feval_buffer, Feval_region):
7584 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7585 (openp): Check for out-of-range argument to 'access'.
7586 (read1): Use int, not EMACS_INT, where int is wide enough.
7587 Don't assume fixnum fits into int.
6efdadfd 7588 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
7589 (read_filtered_event): Use duration_to_sec_usec
7590 to do proper overflow checking on durations.
d311d28c
PE
7591 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7592 in size calculation.
7593 (Fexecute_kbd_macro):
7594 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7595 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7596 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7597 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7598 (set_marker_both, set_marker_restricted_both, marker_position)
7599 (marker_byte_position, Fbuffer_has_markers_at):
7600 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7601 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 7602 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
7603 It now merely ensures that the menu is large enough, without
7604 necessarily growing it, as this avoids some integer overflow issues.
7605 All callers changed.
7606 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7607 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7608 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7609 Use SAFE_ALLOCA_LISP, not alloca.
7610 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7611 to EMACS_INT. Check that fixnums are in proper range for system types.
7612 * minibuf.c (minibuf_prompt_width, string_to_object)
7613 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7614 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7615 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7616 (get_minibuffer, read_minibuf_unwind):
7617 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7618 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7619 this simplifies overflow checking. All callers changed.
7620 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7621 (Ftest_completion):
7622 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7623 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7624 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7625 Check that fixnums are in proper range for system types.
7626 (Fx_create_frame, Fx_show_tip):
7627 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7628 * nsfont.m (ns_findfonts, nsfont_list_family):
7629 Don't assume fixnum fits in long.
7630 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7631 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7632 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7633 wide enough.
17fdb222 7634 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
7635 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7636 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7637 (PRINTDECLARE, PRINTPREPARE):
7638 (strout, print_string):
7639 (print, print_preprocess, print_check_string_charset_prop)
7640 (print_object):
7641 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7642 (PRINTDECLARE):
7643 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7644 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7645 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 7646 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 7647 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
7648 (print_error_message): Use SAFE_ALLOCA, not alloca.
7649 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
7650 (print_depth, new_backquote_output, print_number_index):
7651 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
7652 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7653 (Fset_process_window_size, Fformat_network_address)
7654 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 7655 (sigchld_handler):
d311d28c 7656 Check that fixnums are in proper range for system types.
d44287d4 7657 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
7658 Check for process-ids out of pid_t range rather than relying on
7659 undefined behavior.
e4d81efc 7660 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
7661 (Fformat_network_address, read_process_output, send_process)
7662 (Fprocess_send_region, status_notify):
7663 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7664 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7665 (wait_reading_process_output, read_process_output, exec_sentinel):
7666 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7667 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7668 (Faccept_process_output): Use duration_to_sec_usec to do proper
7669 overflow checking on durations.
dde14581
PE
7670 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7671 Don't assume pid_t fits in int.
02481186
PE
7672 * process.h (struct Lisp_Process): Members tick and update_tick
7673 are now of type EMACS_INT, not int.
b62b53e8
PE
7674 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7675 configured --with-wide-int.
d311d28c
PE
7676 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7677 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7678 * search.c (looking_at_1, string_match_1):
7679 (fast_string_match, fast_c_string_match_ignore_case)
7680 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7681 (scan_newline, find_before_next_newline, search_command)
7682 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7683 (set_search_regs, wordify):
7684 (Freplace_match):
7685 (Fmatch_data):
7686 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7687 (string_match_1, search_buffer, set_search_regs):
7688 (Fmatch_data):
7689 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7690 (wordify): Check for overflow in size calculation.
7691 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7692 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7693 Check that fixnums are in proper range for system types.
7694 * sound.c (struct sound_device)
7695 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7696 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7697 (Fplay_sound_internal):
7698 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 7699 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
7700 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7701 (Fparse_partial_sexp):
7702 Don't assume fixnums can fit in int.
7703 (struct lisp_parse_state, find_start_pos, find_start_value)
7704 (find_start_value_byte, find_start_begv)
7705 (update_syntax_table, char_quoted, dec_bytepos)
7706 (find_defun_start, prev_char_comend_first, back_comment):
7707 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7708 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7709 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7710 (Finternal_describe_syntax_value): Check that match_lisp is a
7711 character, not an integer, since the code stuffs it into int.
7712 (scan_words, scan_sexps_forward):
7713 Check that fixnums are in proper range for system types.
7714 (Fforward_word):
7715 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7716 (scan_sexps_forward):
7717 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7718 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7719 * syntax.h: Adjust decls to match defn changes elsewhere.
7720 (struct gl_state_s):
7721 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
7722 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7723 MOST_POSITIVE_FIXNUM.
d311d28c
PE
7724 * sysdep.c (wait_for_termination_1, wait_for_termination)
7725 (interruptible_wait_for_termination, mkdir):
7726 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7727 (emacs_read, emacs_write):
7728 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
7729 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7730 and double all fit in int.
d311d28c
PE
7731 * term.c (set_tty_color_mode):
7732 Check that fixnums are in proper range for system types.
7733 * termhooks.h (struct input_event):
7734 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7735 * textprop.c (validate_interval_range, interval_of)
7736 (Fadd_text_properties, set_text_properties_1)
7737 (Fremove_text_properties, Fremove_list_of_text_properties)
7738 (Ftext_property_any, Ftext_property_not_all)
7739 (copy_text_properties, text_property_list, extend_property_ranges)
7740 (verify_interval_modification):
7741 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7742 (Fnext_single_char_property_change)
7743 (Fprevious_single_char_property_change):
7744 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
7745 (copy_text_properties):
7746 Check for integer overflow in index calculation.
d311d28c
PE
7747 * undo.c (last_boundary_position, record_point, record_insert)
7748 (record_delete, record_marker_adjustment, record_change)
7749 (record_property_change):
7750 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7751 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7752 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7753 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7754 (Fx_hide_tip, Fx_file_dialog):
7755 * w32menu.c (set_frame_menubar):
7756 Use ptrdiff_t, not int, for consistency with rest of code.
7757 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7758 (select_window, Fdelete_other_windows_internal)
7759 (window_scroll_pixel_based, window_scroll_line_based)
7760 (Frecenter, Fset_window_configuration):
7761 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7762 (Fset_window_hscroll, run_window_configuration_change_hook)
7763 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 7764 (Fscroll_other_window, Frecenter):
d311d28c
PE
7765 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7766 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7767 Don't assume fixnum fits in int.
7768 (Fset_window_scroll_bars):
7769 Check that fixnums are in proper range for system types.
7770 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7771 (string_pos, c_string_pos, number_of_chars, init_iterator)
7772 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7773 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7774 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
7775 (face_before_or_after_it_pos, handle_invisible_prop)
7776 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
7777 (display_prop_intangible_p, string_buffer_position_lim)
7778 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7779 (get_overlay_strings_1, get_overlay_strings)
7780 (iterate_out_of_display_property, forward_to_next_line_start)
7781 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7782 (get_next_display_element, set_iterator_to_next)
7783 (get_visually_first_element, compute_stop_pos_backwards)
7784 (handle_stop_backwards, next_element_from_buffer)
7785 (move_it_in_display_line_to, move_it_in_display_line)
7786 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7787 (add_to_log, message_dolog, message_log_check_duplicate)
7788 (message2, message2_nolog, message3, message3_nolog
7789 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7790 (current_message_1, truncate_echo_area, truncate_message_1)
7791 (set_message, set_message_1, store_mode_line_noprop)
7792 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7793 (text_outside_line_unchanged_p, check_point_in_composition)
7794 (reconsider_clip_changes)
7795 (redisplay_internal, set_cursor_from_row, try_scrolling)
7796 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7797 (redisplay_window, find_last_unchanged_at_beg_row)
7798 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7799 (trailing_whitespace_p, find_row_edges, display_line)
7800 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7801 (display_mode_element, store_mode_line_string)
7802 (pint2str, pint2hrstr, decode_mode_spec)
7803 (display_count_lines, display_string, draw_glyphs)
7804 (x_produce_glyphs, x_insert_glyphs)
7805 (rows_from_pos_range, mouse_face_from_buffer_pos)
7806 (fast_find_string_pos, mouse_face_from_string_pos)
7807 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7808 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7809 (safe_call, init_from_display_pos, handle_fontified_prop)
7810 (handle_single_display_spec, load_overlay_strings)
7811 (with_echo_area_buffer, setup_echo_area_for_printing)
7812 (display_echo_area, echo_area_display)
7813 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7814 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
7815 (redisplay_window, dump_glyph_row, display_mode_line)
7816 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 7817 (handle_display_spec, display_prop_string_p):
d311d28c
PE
7818 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7819 (handle_single_display_spec, build_desired_tool_bar_string)
7820 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7821 (get_specified_cursor_type):
7822 Check that fixnums are in proper range for system types.
7823 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7824 (Flookup_image_map):
7825 Don't assume fixnums fit in int.
7826 (compare_overlay_entries):
7827 Avoid mishandling comparisons due to subtraction overflow.
7828 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7829 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7830 (handle_tool_bar_click):
7831 Use int, not unsigned, since we prefer signed and the signedness
7832 doesn't matter here.
7833 (get_next_display_element, next_element_from_display_vector):
7834 Use int, not EMACS_INT, when int is wide enough.
7835 (start_hourglass): Use duration_to_sec_usec to do proper
7836 overflow checking on durations.
7837 * xfaces.c (Fbitmap_spec_p):
7838 Check that fixnums are in proper range for system types.
7839 (compare_fonts_by_sort_order):
7840 Avoid mishandling comparisons due to subtraction overflow.
7841 (Fx_family_fonts, realize_basic_faces):
7842 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7843 (Fx_family_fonts):
7844 Don't assume fixnum fits in int.
7845 Use SAFE_ALLOCA_LISP, not alloca.
7846 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7847 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7848 (face_at_buffer_position, face_for_overlay_string)
7849 (face_at_string_position):
7850 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7851 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7852 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7853 (Fx_show_tip):
7854 Check that fixnums are in proper range for system types.
7855 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7856 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7857 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7858 (Fx_change_window_property): Don't assume fixnums fit in int.
7859 * xfont.c (xfont_chars_supported):
7860 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7861 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7862 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7863 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7864 * xml.c (parse_region):
7865 * xrdb.c (magic_file_p):
7866 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7867 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7868 (x_get_local_selection, x_reply_selection_request)
7869 (x_handle_selection_request, wait_for_property_change):
7870 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7871 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7872 short is wide enough.
7873 (x_send_client_event): Don't assume fixnum fits in int.
7874 * xterm.c (x_x_to_emacs_modifiers):
7875 Don't assume EMACS_INT overflows nicely into int.
7876 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7877 may come from Lisp.
7878 (handle_one_xevent): NATNUMP can eval its arg twice.
7879 (x_connection_closed):
7880 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7881 * xterm.h: Adjust decls to match defn changes elsewhere.
7882 (struct scroll_bar): Use struct vectorlike_header
7883 rather than rolling our own approximation.
7884 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7885
c6574eb5
GM
78862012-05-25 Glenn Morris <rgm@gnu.org>
7887
7888 * lisp.mk (lisp): Update for more files being compiled now.
7889
e8d32c7e
SM
78902012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7891
48def666
SM
7892 * lread.c: Remove `read_pure' which makes no difference.
7893 (read_pure): Remove var.
7894 (unreadpure): Remove function.
7895 (readevalloop): Don't call read_list with -1 flag.
7896 (read1, read_vector): Don't test read_pure any more.
7897 (read_list): Simplify.
7898
e8d32c7e
SM
7899 * fileio.c, character.h: Minor style tweaks.
7900
4b2addb7
DA
79012012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7902
7903 * window.h (clip_changed): Remove useless declaration.
7904
584461b2
JB
79052012-05-22 Juanma Barranquero <lekktu@gmail.com>
7906
7907 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7908 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7909
34374650
PE
79102012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7911
7912 Remove src/m/*.
7913 This directory predates autoconf and is no longer needed nowadays.
7914 Move its few remaining bits of functionality to where they're needed.
7915 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7916 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7917 * m/template.h: Remove.
7918 * Makefile.in (M_FILE): Remove. All uses removed.
7919 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7920 * lisp.h (USE_LSB_TAG):
7921 * mem-limits.h (EXCEEDS_LISP_PTR):
7922 Use VAL_MAX, not VALBITS, in #if.
7923 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7924 (EMACS_UINT): Define unconditionally now.
7925 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7926 (BITS_PER_EMACS_INT): New constants, replacing
7927 what used to be in config.h, but not useful in #if.
7928 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7929 define them any more.
7930 (VAL_MAX): New macro.
7931 (VALMASK): Use it.
7932 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7933 BITS_PER_EMACS_INT, in #if.
7934 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7935 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7936 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7937 * s/ms-w32.h (DATA_START):
7938 Move here from removed file m/intel386.h.
7939 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7940 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7941
261cb4bb
PE
79422012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7943
7944 Assume C89 or later.
7945 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7946 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7947 (xrealloc):
7948 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7949 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7950 * textprop.c, tparam.c (NULL): Remove.
7951 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7952 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7953 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7954 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7955 * xterm.c (input_signal_count): Assume volatile works.
7956
ff23cd9f
KB
79572012-05-21 Ken Brown <kbrown@cornell.edu>
7958
7959 * xgselect.c (xg_select): Fix first argument in call to 'select'
7960 (bug#11508).
7961
1b170bc6
KB
79622012-05-20 Ken Brown <kbrown@cornell.edu>
7963
7964 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 7965 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 7966
b2f4d39f
KB
79672012-05-19 Ken Brown <kbrown@cornell.edu>
7968
7969 * xfns.c (x_in_use): Remove `static' qualifier.
7970 * xterm.h (x_in_use): Declare.
7971 * xgselect.c: Include xterm.h.
7972 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7973 and `display_arg' (bug#9754).
7974
003fdae2
PE
79752012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7976
9232a6d9
PE
7977 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7978
003fdae2
PE
7979 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7980 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7981
784b56e2
EZ
79822012-05-18 Eli Zaretskii <eliz@gnu.org>
7983
7984 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7985
7986 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 7987 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
7988
7989 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7990 reference to image_cache->refcount.
7991 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7992
a0a79cde
JL
79932012-05-17 Juri Linkov <juri@jurta.org>
7994
7995 * search.c (Fword_search_regexp, Fword_search_backward)
7996 (Fword_search_forward, Fword_search_backward_lax)
7997 (Fword_search_forward_lax): Move functions to isearch.el
7998 (bug#10145, bug#11381).
7999
b0572523
PE
80002012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8001
8002 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8003
9660f5fc
SM
80042012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8005
8006 * lread.c (init_obarray): Declare Qt and Qnil as special.
8007
4374de83
GM
80082012-05-14 Glenn Morris <rgm@gnu.org>
8009
8010 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 8011 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 8012
dc44c39a
PE
80132012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8014
078c97cb
PE
8015 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8016
dc44c39a
PE
8017 * unexaix.c: Port to more-recent AIX compilers.
8018 (report_error, report_error_1, make_hdr, copy_sym)
8019 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8020 Make arguments const char *, not char *, to avoid violations of C
8021 standard and to fix some AIX warnings reported by Gilles Pion.
8022
e18afed7 80232012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
8024
8025 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8026 already have overlays loaded.
8027 (handle_single_display_spec): Before returning without displaying
8028 fringe bitmap, synchronize the bidi iterator with the main display
8029 iterator, by calling iterate_out_of_display_property.
8030 (iterate_out_of_display_property): Detect buffer iteration by
8031 testing that it->string is a Lisp string.
8032 (get_next_display_element): When the current object is exhausted,
8033 and there's something on it->stack, call set_iterator_to_next to
8034 proceed with what's on the stack, instead of returning zero.
8035 (set_iterator_to_next): If called at the end of a Lisp string,
8036 proceed to consider_string_end without incrementing string
8037 position. Don't increment display vector index past the end of
8038 the display vector. (Bug#11417)
c8fb9dc6
EZ
8039 (pos_visible_p): Don't report a position visible when move_it_to
8040 stopped at the last line of window, which happens to be scanned
8041 backwards by the bidi iteration. (Bug#11464)
ac268e67 8042
e18afed7 80432012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
8044
8045 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8046 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
8047 are on a TTY, and thus unable to display on the fringes.
8048 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
8049 so we need to signal to the caller that this is a "replacing"
8050 display spec. This fixes display when the spec is invalid or we
8051 are on a TTY.
8052
e18afed7 80532012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
8054
8055 * unexaix.c (make_hdr): Fix typo in prototype.
8056 This bug broke the build on AIX. Problem reported by Gilles Pion.
8057
9d0a235a
MA
80582012-05-14 Michael Albinus <michael.albinus@gmx.de>
8059
8060 * keyboard.c (kbd_buffer_get_event): Read special events also in
8061 batch mode. (Bug#11415)
8062
9e6b06ed
GM
80632012-05-12 Glenn Morris <rgm@gnu.org>
8064
8065 * ns.mk: Update for ns_appbindir no longer having trailing "/".
8066
c1a1d7a3
EZ
80672012-05-12 Eli Zaretskii <eliz@gnu.org>
8068
8069 * lisp.mk (lisp): Add newcomment.elc.
8070
3fe7cdc8
GM
80712012-05-12 Glenn Morris <rgm@gnu.org>
8072
8073 * Makefile.in (MKDIR_P): New, set by configure.
8074 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
8075
53f7d2c0
PE
80762012-05-11 Paul Eggert <eggert@cs.ucla.edu>
8077
8078 Remove unused function hourglass_started.
8079 * dispextern.h (hourglass_started):
8080 * w32fns.c (hourglass_started):
8081 * xdisp.c (hourglass_started): Remove.
8082
75aafb17
JB
80832012-05-10 Juanma Barranquero <lekktu@gmail.com>
8084
8085 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
8086 Update dependencies.
8087
12959e8e
PE
80882012-05-10 Paul Eggert <eggert@cs.ucla.edu>
8089
97107e2e
PE
8090 * xgselect.c (xg_select): Put maxfds+1 into a var.
8091 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
8092
12959e8e
PE
8093 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
8094
836d29b3
DA
80952012-05-10 Dave Abrahams <dave@boostpro.com>
8096
8097 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
8098 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
8099
5cb67954
MA
81002012-05-09 Michael Albinus <michael.albinus@gmx.de>
8101
8102 * dbusbind.c (xd_registered_buses): New internal Lisp object.
8103 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
8104 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
8105 Initialize xd_registered_buses.
8106
3478ec45
PE
81072012-05-09 Paul Eggert <eggert@cs.ucla.edu>
8108
b263a6b0
PE
8109 Untag more efficiently if USE_LSB_TAG.
8110 This is based on a proposal by YAMAMOTO Mitsuharu in
8111 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
8112 For an admittedly artificial (nth 8000 longlist) benchmark on
8113 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
8114 Emacs's overall text size by 1%.
8115 * lisp.h (XUNTAG): New macro.
8116 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
8117 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
8118 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8119 * eval.c (Fautoload):
8120 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8121 * frame.h (XFRAME): Use XUNTAG.
8122
3478ec45
PE
8123 Port recent dbusbind.c changes to 32-bit --with-wide-int.
8124 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8125 Remove unportable assumptions about print widths of types like
8126 dbus_uint32_t.
8127 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8128 intptr_t when converting between pointer and integer, to avoid GCC
8129 warnings about wrong width.
8130
666b903b 81312012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
8132
8133 * w32proc.c (new_child): Force Windows to reserve only 64KB of
8134 stack for each reader_thread, instead of defaulting to 8MB
8135 determined by the linker. This avoids failures in creating
8136 subprocesses on Windows 7, see the discussion in this thread:
8137 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8138
b120cc17
JC
81392012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
8140
8141 Fix up display of the *Minibuf-0* buffer in the mini window.
8142 * keyboard.c (read_char): Don't clear the echo area if there's no
8143 message to clear.
8144 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 8145 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 8146
9a4b36f8
MA
81472012-05-07 Michael Albinus <michael.albinus@gmx.de>
8148
8149 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8150 batch mode.
8151
e5f9458f
CY
81522012-05-06 Chong Yidong <cyd@gnu.org>
8153
8154 * lisp.mk (lisp): Update.
8155
eceeb5fc 81562012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
8157
8158 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8159
71873e2b
SM
81602012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
8161
8162 * data.c (PUT_ERROR): New macro.
8163 (syms_of_data): Use it. Add new error type `user-error'.
8164 * undo.c (user_error): New function.
8165 (Fprimitive_undo): Use it.
8166 * print.c (print_error_message): Adjust print style for `user-error'.
8167 * keyboard.c (user_error): New function.
8168 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8169
ab0fa4e4
PE
81702012-05-03 Paul Eggert <eggert@cs.ucla.edu>
8171
8172 Do not limit current-time-string to years 1000..9999.
8173 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8174 (Fcurrent_time_string): Support any year that is supported by the
8175 underlying localtime representation. Don't use asctime, as it
8176 has undefined behavior for years outside the range -999..9999.
8177
7ed806a7
PE
81782012-05-02 Paul Eggert <eggert@cs.ucla.edu>
8179
8180 Fix race conditions involving setenv, gmtime, localtime, asctime.
8181 Without this fix, interrupts could mess up code that uses these
8182 nonreentrant functions, since setting TZ invalidates existing
8183 tm_zone or tzname values, and since most of these functions return
8184 pointers to static storage.
8185 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8186 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8187 Grow the critical sections to include not just invoking
8188 localtime/gmtime, but also accessing these functions' results
8189 including their tm_zone values if any, and any related TZ setting.
8190 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
8191 so that the struct tm is saved in the critical section.
8192 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
8193 motivated by the fact that memory allocation needs to be outside
8194 the critical section.
8195
0c16dfed
DA
81962012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
8197
8198 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8199 with RESET_INTERVAL.
8200
8201 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8202 Remove duplicated buffer name initialization.
8203
3f83ace8
JM
82042012-05-02 Jim Meyering <jim@meyering.net>
8205
8206 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8207
c7b8541e
JM
8208 * xfns.c (x_window): Use xstrdup (Bug#11375).
8209
90207a15 82102012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
8211
8212 * xdisp.c (pos_visible_p): If already at a newline from the
8213 display string before the 'while' loop, don't walk back the glyphs
8214 from it3.glyph_row. Solves assertion violation when the display
8215 string begins with a newline (egg.el). (Bug#11367)
8216
b593d6a9
AH
82172012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
8218
8219 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
8220 Move to simple.el.
8221
4737362e
GM
82222012-05-01 Glenn Morris <rgm@gnu.org>
8223
99cf43f9
GM
8224 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
8225 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
8226 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
8227 All were removed before 23.1.
8228
9311dcff
GM
8229 * dispnew.c: Remove HAVE_LIBNCURSES test;
8230 it is always true on relevant platforms.
8231
4d5c6349
GM
8232 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
8233 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
8234
4737362e
GM
8235 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
8236
74dd3a6b
AS
82372012-04-30 Andreas Schwab <schwab@linux-m68k.org>
8238
8239 * .gdbinit (xpr): Remove checks for no longer existing misc types.
8240 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8241 Remove.
8242
13c379ee
PE
82432012-04-28 Paul Eggert <eggert@cs.ucla.edu>
8244
8245 Do not avoid creating empty evaporating overlays (Bug#9642).
8246 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8247 That is, do not delete an evaporating overlay if it becomes
8248 empty after its bounds are adjusted to fit within its buffer.
8249 This fix caused other problems, and I'm reverting it until we get
8250 to the bottom of them.
8251
a8e7d6d7 82522012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
8253
8254 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8255
a8e7d6d7 82562012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
8257
8258 * xdisp.c (pos_visible_p): If the window start position is beyond
8259 ZV, start the display from buffer beginning. Prevents assertion
8260 violation in init_iterator when the minibuffer window is scrolled
8261 via the scroll bar.
8262
8263 * window.c (window_scroll_pixel_based): Likewise.
8264
a8e7d6d7 82652012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
8266
8267 * keymap.c (where_is_internal): Doc fix (Bug#10872).
8268
a8e7d6d7 82692012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
8270
8271 * fileio.c (Fcopy_file, Fset_file_selinux_context):
8272 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
8273
a8e7d6d7 82742012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 8275
b593d6a9
AH
8276 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8277 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 8278
1c6900d9
EZ
82792012-04-26 Eli Zaretskii <eliz@gnu.org>
8280
4c3fa1d9
EZ
8281 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8282 display element, check also the underlying string or buffer
8283 character. (Bug#11341)
8284
1c6900d9
EZ
8285 * w32menu.c: Include w32heap.h.
8286 (add_menu_item): If the call to AppendMenuW (via
8287 unicode_append_menu) fails, disable Unicode menus only if we are
8288 running on Windows 9X/Me.
8289
42bf8205
AS
82902012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8291
8292 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8293 (xgetint): Add missing shift for LSB tags.
8294
b1bac16e
MR
82952012-04-24 Martin Rudalics <rudalics@gmx.at>
8296
8297 * keyboard.c (read_char): Don't wipe echo area for select window
8298 events: These might get delayed via `mouse-autoselect-window'
8299 (Bug#11304).
8300
d69621cc
JB
83012012-04-24 Juanma Barranquero <lekktu@gmail.com>
8302
8303 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8304 manipulation of :loaded-from data.
8305
02fd101b
JB
83062012-04-23 Juanma Barranquero <lekktu@gmail.com>
8307
8308 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8309 now a cons (bug#11311).
8310
888bec30
PE
83112012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8312
89a438bd
PE
8313 Do not create empty overlays with the evaporate property (Bug#9642).
8314 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8315 if it becomes empty after its bounds are adjusted to fit within
8316 its buffer. Without this fix, in a nonempty buffer (let ((o
8317 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8318 yields an empty overlay that has the evaporate property, which is
8319 not supposed to happen.
8320
1068fe4d
PE
8321 Fix minor GTK3 problems found by static checking.
8322 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8323 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8324 (struct _EmacsFixedClass, emacs_fixed_get_type):
8325 Move decls here from emacsgtkfixed.h, since they needn't be public.
8326 (emacs_fixed_get_type): Now static.
8327 (emacs_fixed_class_init): Omit unused local.
8328 (emacs_fixed_child_type): Remove; unused.
8329 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8330 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8331 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8332 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8333 (EMACS_FIXED_GET_CLASS): Remove; unused.
8334 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8335
888bec30
PE
8336 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8337 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8338
de85e130
PE
83392012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8340
d0baac98 8341 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 8342 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
8343 (__malloc_size_t, __malloc_ptrdiff_t):
8344 Remove. All uses removed, replaced by the definiens if needed,
8345 since we can assume C89 or better now.
8346 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8347 (protect_malloc_state, align, get_contiguous_space)
8348 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8349 (malloc_atfork_handler_child, malloc_enable_thread)
8350 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8351 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8352 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8353 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8354 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8355 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8356 Define using prototypes, not old style.
8357 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8358 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8359 (align): Don't assume that signed integer overflow wraps around.
8360 Omit unused local var.
8361 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8362 (_free_internal_nolock, memalign, mallochook, reallochook):
8363 Omit no-longer-needed casts.
8364 (valloc): Use getpagesize, not __getpagesize.
8365 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8366 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8367
de85e130
PE
8368 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8369
dcbf5805
MA
83702012-04-22 Michael Albinus <michael.albinus@gmx.de>
8371
8372 Move functions from C to Lisp. Make non-blocking method calls
8373 the default. Implement further D-Bus standard interfaces.
8374
8375 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8376 (QCdbus_request_name_allow_replacement)
8377 (QCdbus_request_name_replace_existing)
8378 (QCdbus_request_name_do_not_queue)
8379 (QCdbus_request_name_reply_primary_owner)
8380 (QCdbus_request_name_reply_in_queue)
8381 (QCdbus_request_name_reply_exists)
8382 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8383 (QCdbus_registered_serial, QCdbus_registered_method)
8384 (QCdbus_registered_signal): New Lisp objects.
8385 (XD_DEBUG_MESSAGE): Use sizeof.
8386 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8387 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8388 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8389 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8390 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8391 (xd_signature, xd_append_arg): Allow float for integer types.
8392 (xd_get_connection_references): New function.
b593d6a9
AH
8393 (xd_get_connection_address): Rename from xd_initialize.
8394 Return cached address.
dcbf5805
MA
8395 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8396 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8397 level.
8398 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 8399 Return number of refcounts.
dcbf5805
MA
8400 (Fdbus_get_unique_name): Make stronger parameter check.
8401 (Fdbus_message_internal): New defun.
8402 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8403 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8404 (Fdbus_send_signal, Fdbus_register_service)
8405 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8406 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8407 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8408 (Vdbus_compiled_version, Vdbus_runtime_version)
8409 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8410 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8411 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
8412 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8413 Adapt docstring.
dcbf5805 8414
52828e02
PE
84152012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8416
da05bc4c
PE
8417 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8418 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8419 Do not assume ptrdiff_t is the same width as 'int'.
8420
52828e02
PE
8421 * alloc.c: Handle unusual debugging option combinations.
8422 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8423 since the two debugging options are incompatible.
8424 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8425 is defined.
8426 (mem_init, mem_insert, mem_insert_fixup):
8427 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8428 (NEED_MEM_INSERT): Remove; no longer needed.
8429
f01769f9
LL
84302012-04-22 Leo Liu <sdl.web@gmail.com>
8431
8432 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8433
5790543d
PE
84342012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8435
8436 * sysdep.c [__FreeBSD__]: Minor cleanups.
8437 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8438 Use Emacs indenting style more consistently. Avoid some casts.
8439 Use 'double' consistently rather than mixing 'float' and 'double'.
8440
b91b7e4d
EW
84412012-04-21 Eduard Wiebe <usenet@pusto.de>
8442
b593d6a9
AH
8443 * sysdep.c (list_system_processes, system_process_attributes):
8444 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 8445
6114eb15
AS
84462012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8447
8448 * lisp.mk (lisp): Update.
8449
2f38dff7
PE
84502012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8451
8452 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8453 It is never used otherwise.
8454
4ae29f89
SM
84552012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8456
8457 * print.c (print_preprocess): Only check print_depth if print-circle
8458 is nil.
8459 (print_object): Check for cycles even when print-circle is nil and
8460 print-gensym is t, but only check print_depth if print-circle is nil.
8461
f30d612a
CY
84622012-04-20 Chong Yidong <cyd@gnu.org>
8463
8464 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8465 set the status to "failed" and ensure that sentinel is run.
8466
c07a4c0b 84672012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
8468
8469 * process.c (Fset_process_inherit_coding_system_flag)
8470 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 8471 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 8472
c07a4c0b 84732012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
8474
8475 * xdisp.c (string_buffer_position_lim): Limit starting position to
8476 BEGV.
8477 (set_cursor_from_row): If called for a mode-line or header-line
8478 row, return zero immediately.
8479 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
8480 farther than the first row after the header line, if any.
8481 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
8482 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8483
c07a4c0b 84842012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8485
4ae29f89
SM
8486 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8487 (bug#11238).
ad3a2b41 8488
c07a4c0b 84892012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 84902012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
8491
8492 configure: new option --enable-gcc-warnings (Bug#11207)
8493 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8494 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8495 (ALL_CFLAGS): Use new macros rather than old.
8496 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8497 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8498 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8499 -Wunused-result, -Wunused-variable. This should go away once
8500 the Emacs and Gnulib regex code is merged.
8501 (xmalloc, xrealloc): Now static.
8502
aba027e8
PE
85032012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8504
8505 * dired.c (Fsystem_groups): Remove unused local.
8506
e5a36063
GM
85072012-04-17 Glenn Morris <rgm@gnu.org>
8508
8509 * dired.c (Fsystem_users): Doc fix.
8510
316411f0
DA
85112012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8512
8513 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8514 (syms_of_dired): Add them.
8515
9426aba4
PE
85162012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8517
b62a57be
PE
8518 Fix minor alloc.c problems found by static checking.
8519 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8520 New extern decls, to avoid calling undeclared functions.
8521 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8522 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8523 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8524 (NEED_MEM_INSERT): New macro.
8525 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 8526 Remove one incorrect comment and fix another.
b62a57be 8527
3539f31f
PE
8528 Fix minor ralloc.c problems found by static checking.
8529 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8530 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8531 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8532 (r_alloc_sbrk): Now static.
8533
a041960a
PE
8534 Improve ralloc.c interface checking.
8535 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8536 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8537 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8538 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8539 [REL_ALLOC]: ... to here, to check interface.
8540 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8541 Remove decls. This fixes an "It stinks!".
8542
9426aba4
PE
8543 * alloc.c (which_symbols): Fix alignment issue / type clash.
8544
d55c12ed
AS
85452012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8546
8547 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8548 (struct Lisp_Misc_Any): Likewise.
8549 (struct Lisp_Free): Likewise.
8550 * alloc.c (union aligned_Lisp_Symbol): Define.
8551 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8552 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8553 (union aligned_Lisp_Misc): Define.
8554 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8555 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 8556 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 8557
b948ce8b
PE
85582012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8559
8560 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8561 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8562 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8563 * s/netbsd.h, s/sol2-6.h:
8564 Remove definition of GC_MARK_STACK, since the default now works.
8565 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8566 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8567 no longer the default.
8568 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8569
35dc09a1 85702012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8571
35dc09a1
GM
8572 * lread.c (lisp_file_lexically_bound_p):
8573 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 8574
35dc09a1
GM
85752012-04-14 Eli Zaretskii <eliz@gnu.org>
8576
8577 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8578 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8579
85802012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8581
8582 * nsterm.m (constrainFrameRect): Always constrain when there is only
8583 one screen (Bug#10962).
8584
bcd86815
KB
85852012-04-13 Ken Brown <kbrown@cornell.edu>
8586
8587 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8588
c25df26e
RT
85892012-04-13 Reuben Thomas <rrt@sc3d.org>
8590
8591 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8592
0fc59f1e
DC
85932012-04-11 Daniel Colascione <dancol@dancol.org>
8594
8595 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8596 against is gone. It's better to use vfork now so that when Cygwin
8597 gains a new, working vfork, we use it automatically (bug#10398).
8598
de8c03dc
SM
85992012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8600
8601 * window.c (save_window_save): Obey window-point-insertion-type.
8602
2f097256
GM
86032012-04-11 Glenn Morris <rgm@gnu.org>
8604
8605 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8606
453b951e
SM
86072012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8608
8609 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8610
75f1671a 86112012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
8612
8613 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8614 (force_quit_count): New var.
8615 (handle_interrupt): Use it.
8616
2a8ce227
JB
86172012-04-10 Juanma Barranquero <lekktu@gmail.com>
8618
8619 * w32.c (w32_delayed_load): Record the full path of the library
8620 being loaded (bug#10424).
8621
935396c0
GM
86222012-04-09 Glenn Morris <rgm@gnu.org>
8623
05920a43
GM
8624 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8625 not just in the obarray, before snarfing them. (Bug#11036)
8626
935396c0
GM
8627 * Makefile.in ($(leimdir)/leim-list.el):
8628 Pass EMACS rather than BUILT_EMACS.
8629
a18ecafa
TZ
86302012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8631
8632 * process.c (make_process):
8633 * process.h: Add integer `gnutls_handshakes_tried' member to
8634 process struct.
8635
6bbef4e5
JC
8636 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8637 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
8638
8639 * gnutls.c (gnutls_log_function2i): Convenience log function.
8640 (emacs_gnutls_read): Use new log functions,
8641 `gnutls_handshakes_tried' process member, and
8642 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8643 attempts per process (connection).
8644
b4d3bc10
CY
86452012-04-09 Chong Yidong <cyd@gnu.org>
8646
8647 * eval.c (Fuser_variable_p, user_variable_p_eh)
8648 (lisp_indirect_variable): Functions deleted.
8649 (Fdefvar): Caller changed.
8650
8651 * callint.c (Finteractive, Fcall_interactively):
8652 * minibuf.c (Fread_variable): Callers changed.
8653
70f4d973
EZ
86542012-04-09 Eli Zaretskii <eliz@gnu.org>
8655
8656 * xdisp.c (set_cursor_from_row): If the display string appears in
8657 the buffer at position that is closer to point than the position
8658 after the display string, display the cursor on the first glyph of
8659 the display string. Fixes cursor display when a 'display' text
8660 property immediately follows invisible text. (Bug#11094)
8661
cb3c2e3e
PE
86622012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8663
8664 composite.c: use 'double' consistently
8665 * composite.c (get_composition_id): Use 'double' consistently
8666 instead of converting 'float' to 'double' and vice versa; this is
8667 easier to understand and avoids a GCC warning.
8668
fd06db5d
GM
86692012-04-09 Glenn Morris <rgm@gnu.org>
8670
50fe702a
GM
8671 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8672 preparation for dumping it with emacs. (Bug#4789)
8673 (leimdir): New variable.
8674 ($(leimdir)/leim-list.el): New rule.
8675 (emacs$(EXEEXT)): Depend on leim-list.el.
8676
fd06db5d
GM
8677 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8678 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8679 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8680
55c131ee
AS
86812012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8682
8683 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8684 proper alignment.
8685
9209588f
JB
86862012-04-07 Juanma Barranquero <lekktu@gmail.com>
8687
8688 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8689 Remove unused local variable.
8690
e3fb2efb
PE
86912012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8692
8693 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8694 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8695 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8696 objects, as mark_maybe_pointer will catch them otherwise.
8697 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8698 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8699
b5385551
PE
87002012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8701
8702 Fix typo that broke non-Windows builds.
8703 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8704
9078ead6
EZ
87052012-04-07 Eli Zaretskii <eliz@gnu.org>
8706
8707 Support building on MS-Windows with libxml2.
8708
8709 * makefile.w32-in (OBJ2): Add xml.$(O).
8710 (GLOBAL_SOURCES): Add xml.c.
8711 ($(BLD)/xml.$(O)): New dependency list.
8712
8713 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8714 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8715 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8716 [!WINDOWSNT]: New macros.
8717 (init_libxml2_functions, libxml2_loaded_p): New functions.
8718 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8719 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8720 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8721 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8722 linked in).
6bbef4e5
JC
8723 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8724 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
8725 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8726
8727 * emacs.c: Don't include libxml/parser.h.
8728 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8729 xmlCleanupParser directly.
8730
8731 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8732
3811fdf3
EZ
87332012-04-07 Eli Zaretskii <eliz@gnu.org>
8734
8735 * indent.c (Fvertical_motion): If there is a display string at
8736 point, use it.vpos to compute how many lines to backtrack after
8737 move_it_to point. (Bug#11133)
8738
2f8e16b2
EZ
87392012-04-06 Eli Zaretskii <eliz@gnu.org>
8740
8741 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8742 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8743 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8744 macros related to unification of CJK characters. For the details,
8745 see the discussion following the message here:
8746 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8747
3d439cd1
CY
87482012-04-04 Chong Yidong <cyd@gnu.org>
8749
8750 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8751
8bc53d00
EZ
87522012-04-01 Eli Zaretskii <eliz@gnu.org>
8753
8754 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8755 instead of alloca. (Bug#11138)
8756
3b0512a3
AS
87572012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8758
8759 * w32menu.c (is_simple_dialog): Properly check lisp types.
8760 (Bug#11141)
8761
8427ddd2
EZ
87622012-03-31 Eli Zaretskii <eliz@gnu.org>
8763
979022ef
EZ
8764 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8765 position we get to after a call to move_it_to fails the
8766 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8767 only if we wind up in a string from display property. (Bug#11063)
8768
a6b1c7cc
EZ
8769 * window.c (Fdelete_other_windows_internal): Invalidate the row
8770 and column information about mouse highlight, so that redisplay
8771 restores it after reallocating the glyph matrices. (Bug#7464)
8772
8427ddd2
EZ
8773 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8774 string comes from a `display' text property, use the buffer
8775 position of that property as if we actually saw that position in
8776 the row's glyphs.
697ba24b
EZ
8777 (move_it_by_lines): Remove the assertion that
8778 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8779 violated when there's a before-string at the beginning of a line.
8780 (Bug#11063)
8427ddd2 8781
65a0a738
EZ
87822012-03-30 Eli Zaretskii <eliz@gnu.org>
8783
8784 * xdisp.c (append_space_for_newline): If the default face was
8785 remapped, use the remapped face for the appended newline.
8786 (extend_face_to_end_of_line): Use the remapped default face for
8787 extending the face to the end of the line.
8788 (display_line): Call extend_face_to_end_of_line when the default
8789 face was remapped. (Bug#11068)
8790
581355cc
EZ
87912012-03-29 Eli Zaretskii <eliz@gnu.org>
8792
8793 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8794
e8fc049f
SM
87952012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8796
8797 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8798
4fb9a543
GM
87992012-03-27 Glenn Morris <rgm@gnu.org>
8800
8801 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8802 Doc fixes.
8803
679910f1
KH
88042012-03-26 Kenichi Handa <handa@m17n.org>
8805
8806 * dispextern.h (struct glyph): Fix previous change. Change the
8807 bit length of glyphless.ch to 25 (Bug#11082).
8808
90d49b7f
CY
88092012-03-26 Chong Yidong <cyd@gnu.org>
8810
8811 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8812 (command_loop_1): Use it; inhibit selection update for
8813 handle-select-window too (Bug#8996).
8814
f514f6f0
FP
88152012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8816
e8fc049f 8817 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 8818
bf43fa51
KH
88192012-03-25 Kenichi Handa <handa@m17n.org>
8820
8821 * dispextern.h (struct glyph): Change the bit length of
8822 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8823
8a0c01dd
EZ
88242012-03-24 Eli Zaretskii <eliz@gnu.org>
8825
8826 * s/ms-w32.h (tzname): Include time.h before redirecting to
8827 _tzname. Fixes the MSVC build. (Bug#9960)
8828
7d1c3a76
AS
88292012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8830
8ed79523
AS
8831 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8832 characters.
8833
7d1c3a76
AS
8834 * xterm.c (XTread_socket): Only modify handling_signal if
8835 !SYNC_INPUT. (Bug#11080)
8836
e99a9b8b
EZ
88372012-03-23 Eli Zaretskii <eliz@gnu.org>
8838
8839 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8840 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8841 when fetching a multibyte character consumes more bytes than
8842 CHAR_BYTES returns, due to unification of CJK characters in
8843 string_char. (Bug#11073)
8844
5063c0e1
TN
88452012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8846
8847 * process.c (wait_reading_process_output): Handle pty disconnect
8848 by refraining from sending oneself a SIGCHLD (bug#10933).
8849
9f851fbd
CY
88502012-03-22 Chong Yidong <cyd@gnu.org>
8851
8852 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8853
5063c0e1 8854 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
8855 Mark string as coming from a prefix property.
8856 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8857 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8858
fb5b8aca
CY
88592012-03-21 Chong Yidong <cyd@gnu.org>
8860
8861 * xfaces.c (Vface_remapping_alist): Doc fix.
8862
62356a1b
EZ
88632012-03-20 Eli Zaretskii <eliz@gnu.org>
8864
8865 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
8866 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8867 Doc fixes.
62356a1b 8868
025de85b
CY
88692012-03-20 Chong Yidong <cyd@gnu.org>
8870
8871 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8872 to reflect default non-nil value of redisplay-dont-pause.
8873
4827f94e
KH
88742012-03-19 Kenichi Handa <handa@m17n.org>
8875
8876 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8877 it fit in a valid range (Bug#11003).
8878
e50a24a2
EZ
88792012-03-18 Eli Zaretskii <eliz@gnu.org>
8880
8881 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8882 that is not from display property, accept the row as a "cursor
8883 row" if one of the string's character has a non-nil `cursor'
8884 property. Fixes cursor positioning when there are newlines in
8885 overlay strings, e.g. in icomplete.el. (Bug#11035)
8886
9af5ed87
PE
88872012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8888
8889 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8890
d1f55f16
CY
88912012-03-12 Chong Yidong <cyd@gnu.org>
8892
8893 * eval.c (inhibit_lisp_code): Rename from
8894 inhibit_window_configuration_change_hook; move from window.c.
8895
8896 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8897 * window.c (run_window_configuration_change_hook)
8898 (syms_of_window): Callers changed.
8899
66c5eebd
CY
89002012-03-11 Chong Yidong <cyd@gnu.org>
8901
413df973
CY
8902 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8903
66c5eebd
CY
8904 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8905
1de11f56
CY
89062012-03-10 Chong Yidong <cyd@gnu.org>
8907
8908 * frame.c (other_visible_frames): Don't assume the selected frame
8909 is visible (Bug#10955).
8910
cae07000
SM
89112012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8912
8913 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8914
89c94350
JD
89152012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8916
8917 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8918 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8919 zero (Bug#10954).
8920
999dd333
GM
89212012-03-03 Glenn Morris <rgm@gnu.org>
8922
01a6dcc8 8923 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 8924
de0100f2
EZ
89252012-03-02 Eli Zaretskii <eliz@gnu.org>
8926
8927 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8928 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
8929 (redisplay_window, next_element_from_string): Fix typos in
8930 comments.
3e441275
EZ
8931 (redisplay_window): Pass to move_it_vertically the margin in
8932 pixels, not in screen lines.
de0100f2 8933
96a72ee9
GM
89342012-03-02 Glenn Morris <rgm@gnu.org>
8935
8936 * buffer.c (buffer-list-update-hook): Doc fix.
8937
312508d7
EZ
89382012-02-29 Eli Zaretskii <eliz@gnu.org>
8939
8940 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8941 push_it before setting up the iterator for the first overlay
8942 string, even if we have an empty string loaded.
8943 (next_overlay_string): If there's an empty string on the iterator
8944 stack, pop the stack. (Bug#10903)
8945
27f3c637
PE
89462012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8947
8948 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8949 Suggested by Stefan Monnier in
8950 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8951 * alloc.c (widen_to_Lisp_Object): New static function.
8952 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8953 and widening them to Lisp_Objects. This would work even if
8954 USE_LSB_TAG is defined and wide integers are used, which might
8955 happen in a future version of Emacs.
8956
3c9dfce6
CY
89572012-02-25 Chong Yidong <cyd@gnu.org>
8958
fa74b241
CY
8959 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8960 Doc fix.
8961
3c9dfce6
CY
8962 * xselect.c (Fx_selection_exists_p): Doc fix.
8963 (x_clipboard_manager_save_all): Print an informative message
8964 before saving to clipboard manager.
8965
9486df08
CY
89662012-02-24 Chong Yidong <cyd@gnu.org>
8967
8968 * keyboard.c (process_special_events): Handle all X selection
8969 requests in kbd_buffer, not just the next one (Bug#8869).
8970
f01d3321
CY
89712012-02-23 Chong Yidong <cyd@gnu.org>
8972
8973 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8974 call when setting menu-bar-lines and tool-bar-lines parameters.
8975 (unwind_create_frame_1): New helper function.
8976
8977 * window.c (inhibit_window_configuration_change_hook): New var.
8978 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 8979 (syms_of_window): Initialize it.
f01d3321 8980
86b847b6
CY
89812012-02-22 Chong Yidong <cyd@gnu.org>
8982
8983 * xterm.c (x_draw_image_relief): Add missing type check for
8984 Vtool_bar_button_margin (Bug#10743).
8985
a59225b1
CY
89862012-02-21 Chong Yidong <cyd@gnu.org>
8987
8988 * fileio.c (Vfile_name_handler_alist): Doc fix.
8989
8990 * buffer.c (Fget_file_buffer): Protect against invalid file
8991 handler return value.
8992
310f5bd4
PE
89932012-02-20 Paul Eggert <eggert@cs.ucla.edu>
8994
cb3a28cc
PE
8995 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8996 when computing $valmask.
8997
310f5bd4
PE
8998 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8999 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9000 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9001 It's useless in that case, and it can cause problems on hosts
9002 that allocate halves of EMACS_INT values separately.
9003 Reported by Dan Horák. Diagnosed by Andreas Schwab in
9004 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9005 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9006 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
9007 it avoids undefined behavior on hosts where shifting right by more
9008 than the word width has undefined behavior.
9009
2375c96a
CY
90102012-02-19 Chong Yidong <cyd@gnu.org>
9011
9012 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9013 (Funhandled_file_name_directory, Ffile_name_as_directory)
9014 (Fdirectory_file_name, Fexpand_file_name)
9015 (Fsubstitute_in_file_name): Protect against invalid file handler
9016 return values (Bug#10845).
9017
3eb49e71
EZ
90182012-02-18 Eli Zaretskii <eliz@gnu.org>
9019
9020 * .gdbinit (pitx): Fix incorrect references to fields of the
9021 iterator stack.
9022
7b926f3f
CY
90232012-02-17 Chong Yidong <cyd@gnu.org>
9024
9025 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9026
11273115
PE
90272012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9028
9029 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9030 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9031
c3a70e2b
CY
90322012-02-15 Chong Yidong <cyd@gnu.org>
9033
9034 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9035 marked as special. Also, starting docstrings with * is obsolete.
9036
0ca43699
AS
90372012-02-13 Andreas Schwab <schwab@linux-m68k.org>
9038
9039 * gnutls.c (emacs_gnutls_write): Fix last change.
9040
2e8f3c56
LI
90412012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
9042
9043 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9044 send_process.
9045
af70074f
SM
90462012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
9047
9048 * keymap.c (Fsingle_key_description): Handle char ranges.
9049
95986d52
CY
90502012-02-12 Chong Yidong <cyd@gnu.org>
9051
afd83bd1
CY
9052 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9053 as that creates a dangerous corner case.
9054
95986d52
CY
9055 * window.c (Fdelete_window_internal): Invalidate the mouse
9056 highlight (Bug#9904).
9057
bd7da63e
GM
90582012-02-12 Glenn Morris <rgm@gnu.org>
9059
9060 * xselect.c (Fx_own_selection_internal)
9061 (Fx_get_selection_internal, Fx_disown_selection_internal)
9062 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
9063 * nsselect.m (Fx_own_selection_internal)
9064 (Fx_disown_selection_internal, Fx_selection_exists_p)
9065 (Fx_selection_owner_p, Fx_get_selection_internal):
9066 Sync docs and argument specs with the xselect.c versions.
9067
77abcbc2
LI
90682012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
9069
9070 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
9071
90b671e2
EZ
90722012-02-11 Eli Zaretskii <eliz@gnu.org>
9073
1c0ca0b7
EZ
9074 * w32select.c (Fx_selection_exists_p): Sync doc string and
9075 argument list with xselect.c. (Bug#10783)
9076
9077 * w16select.c (Fx_selection_exists_p): Sync doc string and
9078 argument list with xselect.c. (Bug#10783)
90b671e2 9079
49241268
GM
90802012-02-10 Glenn Morris <rgm@gnu.org>
9081
9082 * fns.c (Fsecure_hash): Doc fix.
9083
f998bbe7 90842012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
9085
9086 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
9087
0992bd9c
CY
90882012-02-07 Chong Yidong <cyd@gnu.org>
9089
9090 * buffer.c (Fbuffer_local_variables)
9091 (buffer_lisp_local_variables): Handle unbound vars correctly;
9092 don't let Qunbound leak into Lisp.
9093
af008560
GM
90942012-02-07 Glenn Morris <rgm@gnu.org>
9095
dd605cc4
GM
9096 * image.c (Fimagemagick_types): Doc fix.
9097
af008560
GM
9098 * image.c (imagemagick-render-type): Change it from a lisp object
9099 to an integer. Move the doc here from the lisp manual.
9100 Treat all values not equal to 0 the same.
9101
1449fa1d
CY
91022012-02-06 Chong Yidong <cyd@gnu.org>
9103
9104 * doc.c (store_function_docstring): Avoid applying docstring of
9105 alias to base function (Bug#2603).
9106
3723ec07
AS
91072012-02-04 Andreas Schwab <schwab@linux-m68k.org>
9108
9109 * .gdbinit (pp1, pv1): Remove redundant defines.
9110 (pr): Use pp.
9111
79c1cc1e
CY
91122012-02-04 Chong Yidong <cyd@gnu.org>
9113
9114 * nsterm.m: Declare a global (Bug#10694).
9115
d7f29f8e
EZ
91162012-02-04 Eli Zaretskii <eliz@gnu.org>
9117
cae07000
SM
9118 * w32.c (get_emacs_configuration_options):
9119 Include --enable-checking, if specified, in the return value.
d7f29f8e 9120
3b95a6f9
MR
91212012-02-04 Martin Rudalics <rudalics@gmx.at>
9122
9123 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9124 after rounding frame sizes. (Bug#9723)
9125
d6fa96a6
EZ
91262012-02-04 Eli Zaretskii <eliz@gnu.org>
9127
9128 * keyboard.c (adjust_point_for_property): Don't position point
9129 before BEGV. (Bug#10696)
9130
df0b2940
PE
91312012-02-03 Paul Eggert <eggert@cs.ucla.edu>
9132
9133 Handle overflow when computing char display width (Bug#9496).
9134 * character.c (char_width): Return EMACS_INT, not int.
9135 (char_width, c_string_width): Check for overflow when
9136 computing the width; this is possible now that individual
9137 characters can have unbounded width. Problem introduced
9138 by merge from Emacs 23 on 2012-01-19.
9139
6bee44d6
MA
91402012-02-02 Michael Albinus <michael.albinus@gmx.de>
9141
9142 * dbusbind.c (Fdbus_register_method): Mention the return value
9143 :ignore in the docstring.
9144
44f92739
GM
91452012-02-02 Glenn Morris <rgm@gnu.org>
9146
1b9f60cc
GM
9147 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9148
44f92739
GM
9149 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9150 Unconditionally set to t. (Bug#10673)
9151 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9152 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9153 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9154
c5d3843c
KH
91552012-02-02 Kenichi Handa <handa@m17n.org>
9156
9157 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
9158 0, do not call append_composite_glyph.
9159
159462d4 91602012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
9161
9162 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9163 NULL (Bug#6988).
9164 (x_produce_glyphs): If the component of a composition is a null
9165 string, set it->pixel_width to 1 to avoid zero-width glyph.
9166
78cef877
EZ
91672012-02-01 Eli Zaretskii <eliz@gnu.org>
9168
9169 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9170 first 2 arguments are identical. This makes inserting large
9171 output from a subprocess an order of magnitude faster on
9172 MS-Windows, where all sbrk'ed memory is always contiguous.
9173
97897668
GM
91742012-01-31 Glenn Morris <rgm@gnu.org>
9175
9176 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 9177 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
9178 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9179
31fd3586
GM
91802012-01-29 Glenn Morris <rgm@gnu.org>
9181
9182 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9183
0e24a8b2
CY
91842012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
9185
9186 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9187
cc0adcb0
CY
91882012-01-28 Chong Yidong <cyd@gnu.org>
9189
9190 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9191
acc28cb9
CY
91922012-01-26 Chong Yidong <cyd@gnu.org>
9193
9c69cfb7
CY
9194 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9195
acc28cb9
CY
9196 * search.c (Fsearch_forward, Fsearch_backward): Document negative
9197 repeat counts (Bug#10507).
9198
48da7392
GM
91992012-01-26 Glenn Morris <rgm@gnu.org>
9200
9201 * lread.c (syms_of_lread): Doc fix.
9202
14af5f7f
CY
92032012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
9204
9205 * coding.c (encode_designation_at_bol): Change return value to
9206 EMACS_INT.
9207
0b21c100
CY
92082012-01-25 Chong Yidong <cyd@gnu.org>
9209
9210 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
9211
3c2907f7
CY
92122012-01-21 Chong Yidong <cyd@gnu.org>
9213
9214 * floatfns.c (Fcopysign): Make the second argument non-optional,
9215 since nil is not allowed anyway.
9216
959ad23f
AS
92172012-01-21 Andreas Schwab <schwab@linux-m68k.org>
9218
9219 * process.c (read_process_output): Use p instead of XPROCESS (proc).
9220 (send_process): Likewise.
9221
34a02f46
MR
92222012-01-19 Martin Rudalics <rudalics@gmx.at>
9223
9224 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
9225 (Vwindow_persistent_parameters): Do not use Qstate.
9226 Rewrite doc-strings.
34a02f46 9227
1259009a 92282012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
9229
9230 * character.c (char_width): New function.
70d4fdf6
GM
9231 (Fchar_width, c_string_width, lisp_string_width):
9232 Use char_width (Bug#9496).
25ed9e61 9233
6a6ee00d
MR
92342012-01-16 Martin Rudalics <rudalics@gmx.at>
9235
9236 * window.c (Vwindow_persistent_parameters): New variable.
9237 (Fset_window_configuration, save_window_save): Handle persistent
9238 window parameters.
9239
c85efaf7
EZ
92402012-01-14 Eli Zaretskii <eliz@gnu.org>
9241
9242 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9243 thrashing the stack of the thread. (Bug#9087)
9244
5944709e
PE
92452012-01-12 Paul Eggert <eggert@cs.ucla.edu>
9246
9247 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9248
e71f5d99
EZ
92492012-01-11 Eli Zaretskii <eliz@gnu.org>
9250
9251 * xdisp.c (rows_from_pos_range): Handle the case where the
9252 highlight ends on a newline. (Bug#10464)
9253 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9254 he end column for display of highlight that ends on a newline
9255 before a R2L line.
9256
ce316182
GM
92572012-01-11 Glenn Morris <rgm@gnu.org>
9258
9259 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9260 from load-path also when installation-directory is nil. (Bug#10208)
9261
5b43da69
GM
92622012-01-10 Glenn Morris <rgm@gnu.org>
9263
74cc8ff9
GM
9264 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9265
7d8d6e4e
GM
9266 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9267 Update template values to be closer to their typical values these days.
5b43da69 9268
a0db8d43
EZ
92692012-01-09 Eli Zaretskii <eliz@gnu.org>
9270
9271 * xdisp.c (rows_from_pos_range): Accept additional argument
9272 DISP_STRING, and accept any glyph in a row whose object is that
9273 string as eligible for mouse highlight. Fixes mouse highlight of
9274 display strings from overlays. (Bug#10464)
9275
9a0115ab 92762012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 9277
b9110d6a 9278 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
9279 * fileio.c (auto_saving_dir_umask): New static var.
9280 (Fmake_directory_internal): Use it.
9281 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9282 creating the directory. The old code temporarily assigns
9283 too-generous permissions to the directory.
9284 (do_auto_save_eh): Clear it.
b9110d6a 9285 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
9286 that the var is always cleared.
9287
6c1bd3f3
EZ
92882012-01-07 Eli Zaretskii <eliz@gnu.org>
9289
9290 * search.c (scan_buffer): Pass character positions to
9291 know_region_cache, not byte positions. (Bug#6540)
9292
069d2b50
L
92932012-01-07 LynX <_LynX@bk.ru> (tiny change)
9294
9295 * w32.c (sys_rename): Report EXDEV when rename of a directory
9296 fails because the target is on another logical disk. (Bug#10284)
9297
75bf0d33
DB
92982012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9299
9300 * xterm.c (x_embed_request_focus): New function.
9301
9302 * xterm.h: Add prototype.
9303
9304 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9305
1c6e5a32
GM
93062012-01-05 Glenn Morris <rgm@gnu.org>
9307
9308 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9309
651e947e
EZ
93102012-01-01 Eli Zaretskii <eliz@gnu.org>
9311
9312 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9313 Load gnutls_transport_set_lowat only if GnuTLS version is below
9314 2.11.1.
9315 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9316 GnuTLS versions below 2.11.1.
9317
3778cdd8
AL
93182011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9319
9320 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9321 to the doc string advising against its use for altering the way
9322 windows are scrolled.
9323
0e5317f7
KH
93242011-12-28 Kenichi Handa <handa@m17n.org>
9325
9326 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9327 coding-system ASCII compatible only when it does not produce BOM
9328 on encoding (Bug#10383).
9329
93d5ca1f
JD
93302011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9331
9332 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9333 can scroll.
9334 (create_and_show_popup_menu): Always use menu_position_func for
9335 Gtk3 (Bug#10361).
9336
ca22b785
AS
93372011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9338
9339 * callint.c (Fcall_interactively): Don't truncate prompt string.
9340
d048e1e6
EZ
93412011-12-23 Eli Zaretskii <eliz@gnu.org>
9342
9343 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9344 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 9345 resumed from there (after widening). (Bug#10360)
d048e1e6 9346
5ccaba1f
JD
93472011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9348
9349 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9350
204ee57f
JD
93512011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9352
b81d40f0
JB
9353 * nsterm.m (x_free_frame_resources):
9354 Release f->output_data.ns->miniimage.
204ee57f
JD
9355 (ns_index_color): Fix indentation. Do not retain
9356 color_table->colors[i].
9357
9358 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9359 before returning.
9360
9361 * nsfns.m (x_set_background_color): Assign return value from
9362 ns_index_color to face-background instead of NSColor*.
9363 (ns_implicitly_set_icon_type): Fix indentation.
9364 Change assignment in for loop to comparison.
9365
9366 * emacs.c (ns_pool): New variable.
9367 (main): Assign ns_pool.
9368 (Fkill_emacs): Call ns_release_autorelease_pool.
9369
9370 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9371 autorelease fdesc, release fdAttrs and tdict.
9372 (ns_get_covering_families): Release charset.
9373 (ns_findfonts): Release NSFontDescriptor created with new.
9374 (ns_uni_to_glyphs): Fix indentation.
9375 (setString): Release attrStr before assigning new value.
9376
c803b2b7
JD
93772011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9378
678f4426
JD
9379 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9380 and NS_IMPL_COCOA.
9381 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9382 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9383
cd394be1 93842011-12-18 David Reitter <reitter@cmu.edu>
678f4426 9385
5fecd5fc
JD
9386 * nsterm.m (ns_term_init): Subscribe for notifications
9387 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9388 to method trackingNotification in EmacsMenu.
9389
9390 * nsmenu.m (trackingMenu): New variable.
3771cb17 9391 (trackingNotification): New method (from Aquamacs).
5fecd5fc 9392 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 9393 from Aquamacs (Bug#7030).
678f4426
JD
9394
93952011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 9396
c803b2b7
JD
9397 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9398 (symbol_to_nsstring): Fix indentation.
9399 (ns_symbol_to_pb): New function.
cae07000
SM
9400 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9401 (Fns_rotate_cut_buffers_internal): Remove.
9402 (Fns_store_selection_internal): Rename from
c803b2b7
JD
9403 Fns_store_cut_buffer_internal.
9404 (ns_get_foreign_selection, Fx_own_selection_internal)
9405 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
9406 (Fns_get_selection_internal, Fns_store_selection_internal):
9407 Use ns_symbol_to_pb and check if return value is nil.
9408 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9409 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
9410 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9411 renamed to Sns_store_selection_internal.
9412 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9413 and remove this function.
9414 (ns_handle_selection_clear): Remove, never used.
9415 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9416 here.
9417
e1b01a3a
KB
94182011-12-17 Ken Brown <kbrown@cornell.edu>
9419
9420 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9421 GID is unknown (Bug#10257).
9422
2adb6e85
PE
94232011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9424
9425 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9426 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9427 which caused a build failure on GNU/Linux IA-64. This problem was
9428 introduced by my 2011-10-07 patch.
9429
d1d7b339
JL
94302011-12-15 Juri Linkov <juri@jurta.org>
9431
9432 * image.c (imagemagick_error): New function. (Bug#10112)
9433 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9434 Use `imagemagick_error' where ImageMagick functions return
9435 `MagickFalse'.
9436 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9437 proper order.
9438
100d5755
KH
94392011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9440
9441 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9442 fill background (Bug#8992).
9443
454592a6
MR
94442011-12-13 Martin Rudalics <rudalics@gmx.at>
9445
9446 * window.c (Vwindow_combination_resize)
9447 (Vwindow_combination_limit): Use t instead of non-nil in
9448 doc-strings.
61d4b438
MR
9449 (Vrecenter_redisplay): Add first sentence of doc-string on
9450 separate line.
53524d93 9451 (Frecenter): Fix doc-string typo.
454592a6 9452
3633e3aa
KH
94532011-12-11 Kenichi Handa <handa@m17n.org>
9454
9455 * coding.c (Funencodable_char_position): Pay attention to the
9456 buffer text relocation (Bug#9389).
9457
7b9d523a 94582011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 9459
7b9d523a
JD
9460 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9461 gtk_init (Bug#10100).
9462
b73189c6
EZ
94632011-12-10 Eli Zaretskii <eliz@gnu.org>
9464
9465 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9466 IT->string is nil. (Bug#10263)
9467
f7dfe5d6
JD
94682011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9469
83faebb4
JD
9470 * nsterm.h (x_free_frame_resources): Declare.
9471
f7dfe5d6
JD
9472 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9473 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9474
9475 * nsterm.h (ns_get_defaults_value): Declare.
9476
9477 * nsterm.m (ns_default): Call ns_get_defaults_value.
9478
7cd4e72c
EZ
94792011-12-09 Eli Zaretskii <eliz@gnu.org>
9480
9481 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9482 (Bug#10170)
9483
b34d7317
YM
94842011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9485
9486 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9487 that where the value of an _OBJC_* symbol points to is in the .bss
9488 section (Bug#10240).
9489
76470ad1
KH
94902011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9491
9492 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 9493 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 9494
745fff94
KH
94952011-12-08 Kenichi Handa <handa@m17n.org>
9496
9497 * ftfont.c (get_adstyle_property): Fix previous change
9498 (Bug#10233).
9499
6e44397c
JB
95002011-12-07 Juanma Barranquero <lekktu@gmail.com>
9501
9502 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9503 dirs from the default value of EMACSLOADPATH (bug#10208).
9504
7efa6272
GM
95052011-12-07 Glenn Morris <rgm@gnu.org>
9506
9507 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9508 installation and source directories as well. (Bug#10208)
9509
f6fc4d87
CY
95102011-12-06 Chong Yidong <cyd@gnu.org>
9511
9512 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9513
2bf26180
GM
95142011-12-06 Glenn Morris <rgm@gnu.org>
9515
9516 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9517 as an error, not just -1. (Bug#10217)
9518
3a6ad4f0
CY
95192011-12-05 Chong Yidong <cyd@gnu.org>
9520
9521 * keyboard.c (process_special_events): New function.
9522 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9523
75a3b399
PE
95242011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9525
9526 * coding.c (encode_designation_at_bol): Don't use uninitialized
9527 local variable (Bug#9318).
9528
c3c9e25e
KH
95292011-12-05 Kenichi Handa <handa@m17n.org>
9530
9531 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9532 return Qnil (Bug#8046, Bug#10193).
9533
5eb05ea3
KH
95342011-12-05 Kenichi Handa <handa@m17n.org>
9535
9536 * coding.c (encode_designation_at_bol): New args charbuf_end and
9537 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
9538 (coding_set_source): Return how many bytes coding->source was
9539 relocated.
9540 (coding_set_destination): Return how many bytes
9541 coding->destination was relocated.
9542 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 9543 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
9544
95452011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9546
9547 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9548 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9549 macro (Bug#9318).
9550
95512011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9552
9553 The following changes are to fix Bug#9318.
9554
a79703f5 9555 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
9556 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9557 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 9558 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 9559
7dbda6df
JB
95602011-12-05 Juanma Barranquero <lekktu@gmail.com>
9561
9562 * lisp.h (process_quit_flag): Fix external declaration.
9563
6d5eb5b0
SM
95642011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9565
9566 Don't macro-inline non-performance-critical code.
9567 * eval.c (process_quit_flag): New function.
9568 * lisp.h (QUIT): Use it.
9569
a0c3fad0
JD
95702011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9571
9572 * nsfns.m (get_geometry_from_preferences): New function.
9573 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9574
6c07aac2
AS
95752011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9576
9577 * emacs.c (Qkill_emacs): Define.
9578 (syms_of_emacs): Initialize it.
9579 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9580 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
9581 (quit_throw_to_read_char): Add parameter `from_signal'.
9582 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
9583 * lisp.h (QUIT): Call Fkill_emacs if requested.
9584
c052ead4
JD
95852011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9586
9587 * widget.c (update_wm_hints): Return if wmshell is null.
9588 (widget_update_wm_size_hints): New function.
9589
9590 * widget.h (widget_update_wm_size_hints): Declare.
9591
9592 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9593 widget_update_wm_size_hints (Bug#10104).
9594
9e49252b
EZ
95952011-12-03 Eli Zaretskii <eliz@gnu.org>
9596
9597 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9598 before a newline, prepare the bidi iterator for consuming the
9599 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 9600 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 9601
02b16839
JL
96022011-12-02 Juri Linkov <juri@jurta.org>
9603
9604 * search.c (Fword_search_regexp): New Lisp function created from
9605 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9606 (Fword_search_backward, Fword_search_forward)
9607 (Fword_search_backward_lax, Fword_search_forward_lax):
9608 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9609 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9610
0068070e
SM
96112011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9612
9613 * fileio.c (Finsert_file_contents): Move after-change-function call
9614 to before the "handled:" label, since all "goto handled" appear in
9615 cases where the *-change-functions have already been properly called
9616 (bug#10117).
9617
3360a3fc
AS
96182011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9619
9620 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9621 waiting for input. (Bug#10169)
9622
73d6c093
EZ
96232011-11-30 Eli Zaretskii <eliz@gnu.org>
9624
9625 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9626 verifies glyph row's hash code--we have just reallocated the
9627 glyphs, so their contents can be complete garbage. (Bug#10164)
9628
febe6bea
JB
96292011-11-30 Juanma Barranquero <lekktu@gmail.com>
9630
9631 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9632
801a4313
EZ
96332011-11-30 Eli Zaretskii <eliz@gnu.org>
9634
9635 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9636 attributes are tested _before_ calling verify_row_hash, to protect
9637 against GCC re-ordering of the tests. (Bug#10164)
9638
2b56b87e
JD
96392011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9640
9641 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9642
9643 * xterm.c (handle_one_xevent): Only set async_visible and friends
9644 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 9645 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
9646 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9647
dbf31225
PE
96482011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9649
9650 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9651 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9652 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9653 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9654 All uses changed to use GCPRO1 etc.
9655 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9656 Revert to old implementation (i.e., before 2011-03-11).
9657
1305621b
YM
96582011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9659
9660 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9661 of scroll runs so as to avoid assigning disabled bogus rows and
9662 unnecessary graphics copy operations.
9663
8c9afb46
EZ
96642011-11-27 Eli Zaretskii <eliz@gnu.org>
9665
9666 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9667 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9668 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9669 (malloc, free, realloc, calloc): Redirect to e_* only when
9670 compiling Emacs.
9671
9672 * lisp.h (GCTYPEBITS): Move before first use.
9673 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9674 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9675 this macro definition.
9676
9677 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9678 _MSC_VER.
9679
54e9e3bf
JD
96802011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9681
6d5eb5b0
SM
9682 * gtkutil.c (xg_create_frame_widgets):
9683 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
9684 present with Gtk+ 2.0.
9685
83aca1cb
PE
96862011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9687
9688 * fileio.c (Finsert_file_contents): Undo previous change; see
9689 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9690
5b76caa4
PE
96912011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9692
9693 Rename locals to avoid shadowing.
9694 * fileio.c (Finsert_file_contents):
9695 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9696 * process.c (wait_reading_process_output):
9697 Rename inner 'proc' to 'p' to avoid shadowing.
9698 Indent for consistency with usual Emacs style.
9699
8c535114
EZ
97002011-11-25 Eli Zaretskii <eliz@gnu.org>
9701
9702 * xdisp.c (redisplay_window): If cursor row is not fully visible
9703 after recentering, and scroll-conservatively is set to a large
9704 number, scroll window by a few more lines to make the cursor fully
9705 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
9706 (start_display): Don't move to the next line if the display should
9707 start at a newline that is part of a display vector or an overlay
9708 string. (Bug#10119)
8c535114 9709
fa4fdb5c
JL
97102011-11-24 Juri Linkov <juri@jurta.org>
9711
9712 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9713 after the `MagickPingImage' call. (Bug#10112)
9714
90ec88df
CY
97152011-11-23 Chong Yidong <cyd@gnu.org>
9716
9717 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9718
56e2e794
MR
97192011-11-23 Martin Rudalics <rudalics@gmx.at>
9720
9721 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9722 making another buffer current. (Bug#10114)
9723
b6e64c41
GM
97242011-11-23 Glenn Morris <rgm@gnu.org>
9725
9726 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9727
6b21de18
CY
97282011-11-23 Chong Yidong <cyd@gnu.org>
9729
9730 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9731 using it (Bug#5984).
9732
b12cd789
EZ
97332011-11-22 Eli Zaretskii <eliz@gnu.org>
9734
9735 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9736 and header-lines, as they don't have one computed for them.
9737 (Bug#10098)
9738
9739 * .gdbinit (prow): Make displayed values more self-explaining.
9740 Add row's hash code.
9741
261b6fd4
LMI
97422011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9743
9744 * process.c (wait_reading_process_output): Fix asynchrounous
9745 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 9746 (wait_reading_process_output): Add comment and URL.
261b6fd4 9747
e7cfd277
JD
97482011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9749
9750 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9751
a9b9b7f5
CY
97522011-11-21 Chong Yidong <cyd@gnu.org>
9753
9754 * window.c (Fnext_window, Fprevious_window): Doc fix.
9755
b0d15b4f
SM
97562011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9757
9758 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9759
fe7a3057
JB
97602011-11-20 Juanma Barranquero <lekktu@gmail.com>
9761
9762 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9763
d2999b1a
MR
97642011-11-20 Martin Rudalics <rudalics@gmx.at>
9765
9766 * window.c (Fset_window_combination_limit): Rename argument
9767 STATUS to LIMIT.
9768 (Vwindow_combination_limit): Remove "status" from doc-string.
9769
d5ff9cd0
AS
97702011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9771
9772 * m/ibms390.h: Remove.
9773 * m/ibms390x.h: Don't include "ibms390.h".
9774
a5bb9bd3
SM
97752011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9776
9777 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9778 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9779
cd1181db
JB
97802011-11-20 Juanma Barranquero <lekktu@gmail.com>
9781
9782 * casetab.c (Fset_case_table):
9783 * charset.c (Fcharset_after): Fix typos.
9784
615a3b8d 97852011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 9786
17e845af
PE
9787 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9788 Otherwise, valgrind does not work on some platforms.
9789 Problem reported by Andreas Schwab in
6a0bf43d
PE
9790 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9791 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9792 is set, removing the need for VIRT_ADDRESS_VARIES.
9793 (PURE_P): Use a more-efficient implementation that needs just one
9794 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9795 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9796 to 4 (xorl, subq, cmpq, setbe).
9797 * alloc.c (pure): Always extern now, since that's the
9798 VIRT_ADDR_VARIES behavior.
9799 (PURE_POINTER_P): Use a single comparison, not two, for
9800 consistency with the new puresize.h.
9801 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9802 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9803 Remove VIRT_ADDR_VARIES no longer needed.
9804
f8fe6f96
EZ
98052011-11-19 Eli Zaretskii <eliz@gnu.org>
9806
9807 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9808 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9809 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9810 behave as if the cursor position were at the window margin.
9811
9812 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9813 and the cursor position is out of bounds, behave as if the cursor
9814 position were at the window margin. (Bug#10075)
9815
df05a53c
CY
98162011-11-18 Chong Yidong <cyd@gnu.org>
9817
9818 * window.c (Fwindow_combination_limit): Make first argument
9819 non-optional, since it is meaningless for live windows like the
9820 selected window.
61ccba97 9821
2071918e
DA
98222011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9823
9824 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9825
b50a28de
SM
98262011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9827
9828 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9829 (graft_intervals_into_buffer): Simplify.
9830
015137db
EZ
98312011-11-18 Eli Zaretskii <eliz@gnu.org>
9832
9833 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9834 hash values of the two rows.
9835 (copy_row_except_pointers): Preserve the used[] arrays and the
9836 hash values of the two rows. (Bug#10035)
68c95424 9837 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
9838
9839 * xdisp.c (row_hash): New function, body extracted from
9840 compute_line_metrics.
9841 (compute_line_metrics): Call row_hash, instead of computing the
9842 hash code inline.
9843
9844 * dispnew.c (verify_row_hash): Call row_hash for computing the
9845 hash code of a row, instead of duplicating code from xdisp.c.
9846
9847 * dispextern.h (row_hash): Add prototype.
9848
a2addb04
TH
98492011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9850
9851 * frame.c (delete_frame): Don't delete the terminal when the last
9852 X frame is closed if emacs is built with GTK toolkit.
9853
df85d315
JB
98542011-11-17 Juanma Barranquero <lekktu@gmail.com>
9855
9856 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9857
a0c2d0ae
MR
98582011-11-17 Martin Rudalics <rudalics@gmx.at>
9859
9860 * window.c (Vwindow_splits): Rename to
9861 Vwindow_combination_resize. Suggested by Juri Linkov.
9862 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9863 of Vwindow_splits.
9864
58179cce
JB
98652011-11-16 Juanma Barranquero <lekktu@gmail.com>
9866
7877f373
JB
9867 * nsfns.m (Fns_font_name):
9868 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 9869
b6f67890
MR
98702011-11-16 Martin Rudalics <rudalics@gmx.at>
9871
9872 * window.h (window): Rename slot "nest" to "combination_limit".
9873 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9874 (Fset_window_nest): Rename to Fset_window_combination_limit.
9875 (Vwindow_nest): Rename to Vwindow_combination_limit.
9876 (recombine_windows, make_parent_window, make_window)
9877 (Fsplit_window_internal, saved_window)
9878 (Fset_window_configuration, save_window_save): Rename all
9879 occurrences of window_nest to window_combination_limit.
9880
c7015153
JB
98812011-11-15 Juanma Barranquero <lekktu@gmail.com>
9882
9883 * image.c (imagemagick_load_image): Fix typo.
9884
322ad6ec
EZ
98852011-11-14 Eli Zaretskii <eliz@gnu.org>
9886
9887 * xdisp.c (display_line): Move the call to
9888 highlight_trailing_whitespace before the call to
9889 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
9890 faces of all the glyphs to compute ROW's hash value.
9891 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 9892
f067b8ec
JB
98932011-11-14 Juanma Barranquero <lekktu@gmail.com>
9894
9895 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9896 just return (bug#10044).
9897
1e5b2111
EZ
98982011-11-12 Eli Zaretskii <eliz@gnu.org>
9899
7ef3cbd5
EZ
9900 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9901 with user-defined heap size. Bump the default size of the temacs
9902 heap to 27MB, to avoid memory warning when running temacs.
9903 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9904
1e5b2111
EZ
9905 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9906 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
9907 (verify_row_hash) [XASSERTS]: New function.
9908 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9909 that the hash value of glyph rows is correct.
1e5b2111 9910
89d61221
MR
99112011-11-12 Martin Rudalics <rudalics@gmx.at>
9912
9913 * window.h (window): Remove splits slot.
9914 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9915 (Fdelete_other_windows_internal, make_parent_window)
9916 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9917 (Fset_window_configuration, save_window_save): Don't deal with
9918 split status of windows.
9919 (saved_window): Remove splits slot.
9920 (Vwindow_splits): Rewrite doc-string.
9921
97f18cc8
JD
99222011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9923
9924 * xfns.c (unwind_create_frame):
9925 * nsfns.m (unwind_create_frame):
9926 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9927 Vframe_list (Bug#9999).
9928
22a648b4
DA
99292011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9930
0b381c7e 9931 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 9932
659afede
KH
99332011-11-11 Kenichi Handa <handa@m17n.org>
9934
9935 * callproc.c (Fcall_process): Set the member dst_multibyte of
9936 process_coding.
9937
9ac0394b
KH
99382011-11-11 Johan Bockgård <bojohan@gnu.org>
9939
9940 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9941 avoid a crash (bug#9496).
9942
2fbdc249
CY
99432011-11-09 Chong Yidong <cyd@gnu.org>
9944
9945 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9946 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9947
ac6b1f81
PE
99482011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9949
9950 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9951
09db192c
PE
99522011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9953
9954 Avoid some portability problems by eschewing 'extern inline' functions.
9955 The trivial performance wins aren't worth the portability hassles; see
9956 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9957 et seq.
9958 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9959 (window_box_width, window_box_left, window_box_left_offset)
9960 (window_box_right, window_box_right_offset): Undo previous change,
9961 by removing the "extern"s.
9962 * intervals.c (adjust_intervals_for_insertion)
9963 (adjust_intervals_for_deletion): Undo previous change,
9964 making these static again.
9965 (offset_intervals, temp_set_point_both, temp_set_point)
9966 (copy_intervals_to_string): No longer inline.
9967 * xdisp.c (window_text_bottom_y, window_box_width)
9968 (window_box_height, window_box_left_offset)
9969 (window_box_right_offset, window_box_left, window_box_right)
9970 (window_box): No longer inline.
9971
105216ed
CY
99722011-11-08 Chong Yidong <cyd@gnu.org>
9973
9974 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
9975 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9976 Signal an error if not a live window.
105216ed
CY
9977 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9978 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9979
ae9e237f
JB
99802011-11-07 Juanma Barranquero <lekktu@gmail.com>
9981
9982 * lisp.h (syms_of_abbrev): Remove declaration.
9983 Reported by CHENG Gao <chenggao@royau.me>.
9984
c7aa8333
EZ
99852011-11-07 Eli Zaretskii <eliz@gnu.org>
9986
9987 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9988 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
9989 of temacs in GUI mode.
9990
be7f5545
MR
99912011-11-07 Martin Rudalics <rudalics@gmx.at>
9992
9993 * window.h: Declare delete_all_child_windows instead of
9994 delete_all_subwindows.
9995 * window.c (Fwindow_nest, Fset_window_nest)
9996 (Fset_window_new_total, Fset_window_new_normal)
9997 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9998 (delete_all_subwindows): Rename to delete_all_child_windows.
9999 (Fdelete_other_windows_internal, Fset_window_configuration):
10000 Call delete_all_child_windows instead of delete_all_subwindows.
10001 * frame.c (delete_frame): Call delete_all_child_windows instead
10002 of delete_all_subwindows.
10003
ca78dc43
PE
100042011-11-07 Paul Eggert <eggert@cs.ucla.edu>
10005
10006 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10007 This is also needed for porting to any host where GC_MARK_STACK is
10008 not GC_MAKE_GCPROS_NOOPS.
10009 (which_symbols): Use it.
10010
a0241d01
KH
100112011-11-07 Kenichi Handa <handa@m17n.org>
10012
10013 * coding.c (coding_set_destination): Check coding->src_pos only
10014 when coding->src_object is a buffer (bug#9910).
10015
10016 * process.c (send_process): Set the member src_multibyte of coding
10017 to 0 (bug#9911) when sending a unibyte text.
10018
10019 * callproc.c (Fcall_process): Set the member src_multibyte of
10020 process_coding to 0 (bug#9912).
10021
a64bfdfa 100222011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
10023
10024 * xmenu.c (cleanup_widget_value_tree): New function.
10025 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10026 calling free_menubar_widget_value_tree directly (Bug#9830).
10027
cb41b32a
PE
100282011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10029
10030 Fix some portability problems with 'inline'.
10031 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10032 (window_box_width, window_box_left, window_box_left_offset)
10033 (window_box_right, window_box_right_offset): Declare extern.
10034 Otherwise, these inline functions do not conform to C99 and
10035 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
10036 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10037 * intervals.c (adjust_intervals_for_insertion)
10038 (adjust_intervals_for_deletion): Now extern, because otherwise the
10039 extern inline functions 'offset_intervals' couldn't refer to it.
10040 (static_offset_intervals): Remove.
10041 (offset_intervals): Rewrite using the old contents of
10042 static_offset_intervals. The old version didn't conform to C99
10043 because an extern inline function contained a reference to an
10044 identifier with static linkage.
10045
b7041366
AS
100462011-11-06 Andreas Schwab <schwab@linux-m68k.org>
10047
10048 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10049 GC.
10050
88a37c4d
EZ
100512011-11-06 Eli Zaretskii <eliz@gnu.org>
10052
10053 * xdisp.c (init_iterator, reseat_to_string): Don't set the
10054 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
10055 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10056 return Qleft_to_right.
10057
49745b39
CY
100582011-11-06 Chong Yidong <cyd@gnu.org>
10059
10060 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
10061 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
10062 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
10063 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
10064 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
10065 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
10066 (Fwindow_vscroll): Doc fix.
10067 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
10068 argument, since it makes no sense to pass a live window and for
10069 consistency with window-child.
10070
1f05cd82
CS
100712011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
10072
10073 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
10074 support MSVC.
10075
22610910
JR
100762011-11-05 Jason Rumney <jasonr@gnu.org>
10077
10078 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
10079 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
10080 fonts (Bug#6029).
10081 (add_font_entity_to_list): Fix logic errors in mixed boolean and
10082 bitwise arithmetic preventing use of unicode-sip and non-truetype
10083 opentype fonts.
10084
a06776b2
EZ
100852011-11-05 Eli Zaretskii <eliz@gnu.org>
10086
3ad924ba
EZ
10087 * s/ms-w32.h (fstat, stat, utime): Move redirections to
10088 "emacs"-only part.
10089
a06776b2
EZ
10090 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
10091 initialization code to keep similarity to xfns.c after changes
10092 from 2011-11-05.
10093
c9e7db78
JD
100942011-11-05 Jan Djärv <jan.h.d@swipnet.se>
10095
a97f8f3f
JD
10096 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
10097 (unwind_create_frame): New function (Bug#9943).
10098 (Fx_create_frame): Restructure code to be more similar to the one in
10099 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
10100 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
10101 Move terminal->reference_count++ just before making the frame official
10102 (Bug#9943).
10103
10104 * nsterm.m (x_free_frame_resources): New function.
10105 (x_destroy_window): Move code to x_free_frame_resources.
10106
c9e7db78 10107 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
10108 (Fx_create_frame, x_create_tip_frame):
10109 Move terminal->reference_count++ just before making the frame
75f1671a 10110 official. Move initialization of image_cache_refcount and
c9e7db78
JD
10111 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
10112
a6fc3b5c
EZ
101132011-11-05 Eli Zaretskii <eliz@gnu.org>
10114
10115 Support MSVC build with newer versions of Visual Studio.
10116 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
10117 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
10118 nt/gmake.defs.
10119
10120 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10121 which are not supported by MSVC.
10122 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10123 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10124 bitfields.
10125 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10126 types in bitfields.
10127 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10128
10129 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10130
58179cce 101312011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
10132
10133 Support MSVC build with newer versions of Visual Studio.
10134 * w32.c: Don't include w32api.h for MSVC.
10135 (init_environment) [_MSC_VER]: Call sys_access, not _access.
10136
10137 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10138 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10139 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10140 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10141 e_* cousins.
10142 (alloca) [_MSC_VER]: Define to _alloca.
10143
10144 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10145
10146 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10147
a58c13ed
EZ
101482011-11-04 Eli Zaretskii <eliz@gnu.org>
10149
10150 * xdisp.c (note_mouse_highlight): If either of
10151 previous/next-single-property-change returns nil, treat that as
10152 the beginning or the end of the buffer. (Bug#9955)
10153
fe0b6370
JD
101542011-11-04 Jan Djärv <jan.h.d@swipnet.se>
10155
a58c13ed 10156 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
10157 label is not null (Bug#9951).
10158 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10159 may be NULL.
10160
89bd5ee1
EZ
101612011-11-04 Eli Zaretskii <eliz@gnu.org>
10162
10163 * window.c (Fwindow_body_size): Mention in the doc string that the
10164 return value is in frame's canonical units. (Bug#9949)
10165
84c3edb9
EZ
101662011-11-03 Eli Zaretskii <eliz@gnu.org>
10167
4e2fb5c7
EZ
10168 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
10169
84c3edb9 10170 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 10171 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 10172 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 10173
bc17a887
EZ
101742011-11-01 Eli Zaretskii <eliz@gnu.org>
10175
10176 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10177 Don't stop backward scan on the continuation glyph, even though
10178 its CHARPOS is positive.
6d5eb5b0
SM
10179 (mouse_face_from_buffer_pos, note_mouse_highlight):
10180 Rename cover_string to disp_string.
bc17a887 10181
4ee88440
MR
101822011-11-01 Martin Rudalics <rudalics@gmx.at>
10183
10184 * window.c (temp_output_buffer_show): Don't use
10185 Vtemp_buffer_show_specifiers.
10186 (Vtemp_buffer_show_specifiers): Remove unused variable.
10187
c2ff3c02
EZ
101882011-10-30 Eli Zaretskii <eliz@gnu.org>
10189
10190 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10191 past the beginning of the current glyph matrix.
10192
58179cce 101932011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
10194
10195 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10196 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10197 HAVE_GTK3 (Bug#9869).
b77a6a7f 10198
3b574623
JD
10199 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10200 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10201
b77a6a7f
JD
10202 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10203
10204 * xterm.c: Declare x_handle_net_wm_state to return int.
10205 (handle_one_xevent): Check if we are iconified but don't have
10206 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
10207 (get_current_wm_state): Return non-zero if not hidden,
10208 check for _NET_WM_STATE_HIDDEN (Bug#9893).
10209 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
10210 (x_handle_net_wm_state): Return what get_current_wm_state returns.
10211 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
10212
196e41e4
PE
102132011-10-29 Paul Eggert <eggert@cs.ucla.edu>
10214
10215 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
10216 so that this new function doesn't get optimized away by a
10217 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
10218
021f2e1a
AS
102192011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10220
10221 * frame.h (MOUSE_HL_INFO): Remove excess parens.
10222
8b058d44
EZ
102232011-10-29 Eli Zaretskii <eliz@gnu.org>
10224
10225 Fix the `xbytecode' command.
10226 * .gdbinit (xprintbytestr): New command.
b50a28de 10227 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
10228 (xbytecode): Print the byte-code string as well.
10229
4452fb80
EZ
102302011-10-29 Kim Storm <storm@cua.dk>
10231
8b058d44
EZ
10232 * alloc.c (which_symbols): New function.
10233
21b72067
AS
102342011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10235
10236 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
10237 line. (Bug#9903)
10238
83ed7b5c
GM
102392011-10-29 Glenn Morris <rgm@gnu.org>
10240
10241 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10242 Not clear what it was for, and it causes various bugs. (Bug#9839)
10243
5a7a728b
EZ
102442011-10-28 Eli Zaretskii <eliz@gnu.org>
10245
10246 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10247 possible random value that matches one of those tested as
10248 condition to clear the mouse face.
10249
d3d0842f
CY
102502011-10-28 Chong Yidong <cyd@gnu.org>
10251
10252 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10253
31b39d13
DN
102542011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
10255
10256 * window.c (make_window): Initialize phys_cursor_on_p.
10257
9aba6043
SM
102582011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
10259
10260 * lisp.h (struct Lisp_Symbol): Update comments.
10261
c20992f4
JB
102622011-10-28 Juanma Barranquero <lekktu@gmail.com>
10263
10264 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10265
db4f02f2
EZ
102662011-10-28 Eli Zaretskii <eliz@gnu.org>
10267
10268 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
10269 <oslsachem@gmail.com> for helping to debug this.
10270
10271 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10272 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10273 (g_b_init_get_glyph_outline_w): New static variables.
10274 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10275 (GetGlyphOutlineW_Proc): New typedefs.
10276 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
10277 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10278 New functions.
10279 (w32font_open_internal, compute_metrics):
10280 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
10281 instead of calling the "wide" APIs directly.
10282
10283 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10284
10285 * w32.h (syms_of_w32font): Add prototype.
10286
87e68db4
JB
102872011-10-27 Juanma Barranquero <lekktu@gmail.com>
10288
10289 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10290 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10291 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10292 (Fmove_to_window_line): Doc fix.
10293
435c1d67
CY
102942011-10-27 Chong Yidong <cyd@gnu.org>
10295
10296 * process.c (make_process): Set gnutls_state to NULL.
10297
10298 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10299 non-NULL, regardless of GNUTLS_INITSTAGE.
10300 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10301 an error. Set process slots as soon as we allocate them.
10302
10303 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10304
9c6c6f49
CY
103052011-10-27 Chong Yidong <cyd@gnu.org>
10306
9aba6043
SM
10307 * gnutls.c (emacs_gnutls_deinit): New function.
10308 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
10309 (Fgnutls_deinit, Fgnutls_boot): Use it.
10310
10311 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10312 (deactivate_process): Call emacs_gnutls_deinit.
10313
657d08d3
JB
103142011-10-27 Juanma Barranquero <lekktu@gmail.com>
10315
10316 * image.c (x_create_x_image_and_pixmap):
10317 * w32.c (sys_rename, w32_delayed_load):
10318 * w32font.c (fill_in_logfont):
10319 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10320
5430d399
JB
103212011-10-26 Juanma Barranquero <lekktu@gmail.com>
10322
10323 * w32fns.c (w32_default_color_map): New function,
10324 extracted from Fw32_default_color_map.
a7ef684b 10325 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 10326
fe0055fa
PE
103272011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10328
10329 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10330
e6346438
SM
103312011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10332
10333 * keyboard.c (test_undefined): New function (bug#9751).
10334 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10335
e112cc37
ET
103362011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10337
10338 * sysdep.c (init_sys_modes): Fix the check for the controlling
10339 terminal (Bug#6649).
10340
7b5d6677
EZ
103412011-10-20 Eli Zaretskii <eliz@gnu.org>
10342
10343 * dispextern.h (struct bidi_it): New member next_en_type.
10344
10345 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10346 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10347 current character, check also for next_en_type being WEAK_EN.
10348 (bidi_resolve_weak): Don't enter the expensive loop if the current
10349 position is before next_en_pos. Record the bidi type of the first
10350 non-ET, non-BN character we find, in addition to its position.
10351 (bidi_level_of_next_char): Invalidate next_en_type when
10352 next_en_pos is over-stepped.
10353
7da0b018
PE
103542011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10355
10356 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10357 * editfns.c: Rewrite current-time-zone so that it invokes
10358 the equivalent of (format-time-string "%Z") to get the time zone name.
10359 This fixes a bug when the time zone name contains characters that
10360 need converting from the system time locale to Emacs internal format.
10361 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10362 that patch fixed format-time-string to do the conversion, but
10363 I forgot to fix current-time-zone.
10364 (format_time_string): New function, containing most of
10365 what Fformat_time_string used to contain.
10366 (Fformat_time_string): Rewrite in terms of format_time_string.
10367 This doesn't change this function's behavior.
10368 (current-time-zone): Rewrite to use format_time_string.
10369 This fixes the bug reported by Michael Schierl in
10370 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10371 Jason Rumney's 2007-06-07 change worked around this bug, but
10372 didn't fix it.
10373 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10374
8547b010
EZ
103752011-10-19 Eli Zaretskii <eliz@gnu.org>
10376
10377 * xdisp.c (start_display): If the character at POS is displayed
10378 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
10379 (try_window_reusing_current_matrix): If a line ends in a display
10380 vector or the next line starts in a display vector, continue
10381 redrawing the window even though the character position of
10382 start_row was reached.
8547b010
EZ
10383 (Bug#9771, part 2)
10384
4e948d15
CY
103852011-10-18 Chong Yidong <cyd@gnu.org>
10386
10387 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10388 with nobreak-char-display too.
10389
4787455f
EZ
103902011-10-18 Eli Zaretskii <eliz@gnu.org>
10391
10392 Fix part 3 of bug#9771.
10393 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10394 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10395 non-neutral characters if the current character is a paragraph
10396 separator (a.k.a. Newline). This avoids running the same
10397 expensive loop twice, once when we consume the preceding newline
10398 and the other time when the line actually needs to be displayed.
10399 Avoid the loop when we see neutrals on the base embedding level
10400 following a character whose directionality is the same as the
10401 paragraph's. This avoids running the expensive loop when a line
10402 ends in a long sequence of neutrals, like control characters.
10403 Add assertion against STRONG_AL type. Slightly rearrange code
10404 that determines the type of a neutral given the first non-neutral
10405 that follows it.
10406 (bidi_level_of_next_char): Set next_en_pos to zero when
10407 invalidating its info.
10408
2c91f553
EZ
104092011-10-17 Eli Zaretskii <eliz@gnu.org>
10410
10411 * xdisp.c (push_display_prop): Determine whether to record string
10412 or buffer position by IT->string, not by IT->method. Allow
10413 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
10414 (move_it_vertically_backward): Don't look for character position
10415 immediately after the newline when in a continuation line.
10416 (Bug#9771, part 1)
2c91f553 10417
c7b08b0d
MR
104182011-10-15 Martin Rudalics <rudalics@gmx.at>
10419
10420 * window.c (coordinates_in_window): Rewrite and delabelize
10421 vertical border check. (Bug#5357) (Bug#9618)
10422
6b02f655
SM
104232011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10424
10425 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10426 errors in XSetWindowBorder (bug#9310).
10427
81d40c92
DA
104282011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10429
10430 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10431 avoid crash when xmalloc overrun checking is enabled.
10432
d4172c3b
EZ
104332011-10-13 Eli Zaretskii <eliz@gnu.org>
10434
10435 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10436 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10437 cursor motion with <left> and <right> arrow keys.
10438
10439 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10440 some callers set that themselves.
10441
b00eea75
EZ
104422011-10-12 Eli Zaretskii <eliz@gnu.org>
10443
10444 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10445 display string and the previous row comes from the same string and
10446 is empty. (Bug#9739) (Bug#9738)
10447
8fe012c4
SM
104482011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10449
10450 * doc.c (get_doc_string): Encode file name (bug#9735).
10451
0074aef2
EZ
104522011-10-12 Eli Zaretskii <eliz@gnu.org>
10453
79beb178
EZ
10454 * bidi.c (bidi_level_of_next_char):
10455 * xdisp.c (get_visually_first_element): Remove old incorrect
10456 comments regarding the Unicode Line Separator character.
10457
0074aef2
EZ
10458 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10459
6e4b3fbe
DA
104602011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10461
10462 * alloc.c (Fgc_status): Do not access beyond zombies array
10463 boundary if nzombies > MAX_ZOMBIES.
10464 * alloc.c (dump_zombies): Add missing format specifier.
10465
0324f3af
PE
104662011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10467
b5525cac
PE
10468 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10469 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10470
0324f3af
PE
10471 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10472 Some packages use them to denote characters with modifiers.
10473
e9b5f888
AS
104742011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10475
10476 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10477 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10478 matching a pp-number. Rename parameter var to var1.
10479
127827c0
SM
104802011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10481
10482 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10483
c8fd3bd0
GM
104842011-10-08 Glenn Morris <rgm@gnu.org>
10485
10486 * callint.c (Fcall_interactively): Give a more explicit error for the
10487 'c' case with a non-character input. (Bug#8479)
10488
352ec8ff
EZ
104892011-10-08 Eli Zaretskii <eliz@gnu.org>
10490
03669ccb
EZ
10491 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10492 lines.
7061c986
EZ
10493 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10494 lines that are hscrolled on the left.
03669ccb 10495
352ec8ff
EZ
10496 * dispnew.c (buffer_posn_from_coords): Account for a possible
10497 presence of header-line. (Bug#4426)
10498
a66cfb1c
SM
104992011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10500
6b02f655
SM
10501 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10502 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 10503
7c5ee88e
PE
105042011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10505
10506 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10507 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10508 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10509 this makes Emacs dump core during garbage collection on rare
10510 occasions. sizeof is obviously inferior to offsetof here, so
10511 stick with offsetof.
10512 (GC_POINTER_ALIGNMENT): New macro.
10513 (mark_memory): Omit 3rd (offset) arg; caller changed.
10514 Don't assume EMACS_INT alignment is the same as pointer alignment.
10515
df1bbe5b
SM
105162011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10517
10518 * keyboard.c (read_key_sequence_remapped): New var.
10519 (read_key_sequence): Compute remapping in the right buffer.
10520 (command_loop_1): Use read_key_sequence's remapping directly.
10521
51553db6
SM
105222011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10523
32c1fffd
SM
10524 * dired.c (file_name_completion): Don't expand file name.
10525 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10526 before checking file name handler.
10527
51553db6
SM
10528 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10529 they've been requested explicitly (bug#9591).
10530
b6bd1599 105312011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
10532
10533 * keymap.c (Fsingle_key_description): Use make_specified_string
10534 instead of build_string to build string from push_key_description.
10535 (Bug#5193)
10536
f701dc2a
PE
105372011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10538
4222c55d
PE
10539 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10540 This fixes a Y2038 bug on 64-bit hosts.
10541 * buffer.c (reset_buffer):
10542 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10543 (Fclear_buffer_auto_save_failure):
10544 Use 0, not -1, to represent an unset failure time, since time_t
10545 might not be signed.
10546
f701dc2a
PE
10547 Remove dependency on glibc malloc internals.
10548 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10549 Move back here from lisp.h, but with their new implementations.
10550 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10551 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10552 * charset.c (charset_table_init): New static var.
10553 (syms_of_charset): Use it instead of xmalloc. This removes a
10554 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10555 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10556 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10557 Move back to alloc.c.
10558 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10559 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10560
9ceebf39
JD
105612011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10562
10563 * nsterm.m (windowDidResize): Call x_set_window_size only when
10564 ns_in_resize is true. Otherwise set pixelwidth/height and
10565 call change_frame_size (Bug#9628).
10566
cb993c58
PE
105672011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10568
3930c88b
PE
10569 Port --enable-checking=all to Fedora 14 x86-64.
10570 * charset.c (syms_of_charset): Also account for glibc malloc's
10571 internal overhead when calculating the initial malloc maximum.
10572
cb993c58
PE
10573 Port --enable-checking=all to Fedora 14 x86.
10574 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10575 Move to lisp.h.
10576 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10577 (overrun_check_realloc, overrun_check_free):
10578 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10579 That way, xmalloc returns a properly-aligned pointer even if
10580 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10581 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10582 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10583 into account when calculating the initial malloc maximum.
10584 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10585 Move here from alloc.c, so that charset.c can use it too.
10586 Properly align; the old code wasn't right for common 32-bit hosts
10587 when configured with --enable-checking=all.
10588 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10589 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10590
31bed486
EZ
105912011-09-29 Eli Zaretskii <eliz@gnu.org>
10592
04c70788 10593 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
10594 use EDOM.
10595
fbcaa2f3
EZ
105962011-09-28 Eli Zaretskii <eliz@gnu.org>
10597
10598 * xdisp.c (compute_display_string_end): If there's no display
10599 string at CHARPOS, return -1.
10600
10601 * bidi.c (bidi_fetch_char): When compute_display_string_end
10602 returns a negative value, treat the character as a normal
10603 character not covered by a display string. (Bug#9624)
10604
a239d4e9
JB
106052011-09-28 Juanma Barranquero <lekktu@gmail.com>
10606
10607 * lread.c (Fread_from_string): Fix typo in docstring.
10608
88652fd5
EZ
106092011-09-27 Eli Zaretskii <eliz@gnu.org>
10610
10611 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10612 newline, reseat the iterator instead of bidi-iterating there one
10613 character at a time. (Bug#9610)
32c1fffd
SM
10614 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10615 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 10616
ed497dd4
AS
106172011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10618
10619 * lread.c (readevalloop): Use correct code for NBSP.
10620 (read1): Likewise. (Bug#9608)
10621
b2bf61aa
MA
106222011-09-25 Michael Albinus <michael.albinus@gmx.de>
10623
10624 * dbusbind.c (Fdbus_register_signal): When service is not
10625 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10626
32bbb17c
GM
106272011-09-25 Glenn Morris <rgm@gnu.org>
10628
10629 * buffer.c (truncate-lines): Doc fix.
10630
94e0933e
CY
106312011-09-24 Chong Yidong <cyd@stupidchicken.com>
10632
10633 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10634 (Fset_window_next_buffers): Doc fix.
10635
cddde921
GM
106362011-09-24 Glenn Morris <rgm@gnu.org>
10637
10638 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10639
1260aef1
PE
106402011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10641
25b4bfa0
PE
10642 Fix minor problems found by static checking.
10643 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
10644 * indent.c (Fvertical_motion): Fix == vs = typo.
10645
e3cbd34b
EZ
106462011-09-24 Eli Zaretskii <eliz@gnu.org>
10647
a66cfb1c
SM
10648 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10649 Default value is now t. Doc fix.
6bf7006f 10650
e3cbd34b 10651 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 10652 logic when moving up, not only when moving down. Fix the
e3cbd34b 10653 confusing name and values of the it_overshoot_expected variable;
32c1fffd 10654 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
10655
10656 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10657 CHARPOS is covered by a display string which includes newlines.
10658 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10659 is covered by a display string with embedded newlines.
10660
a3de0cbd
MA
106612011-09-24 Michael Albinus <michael.albinus@gmx.de>
10662
10663 * dbusbind.c (Fdbus_register_signal): Add match rule to
10664 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
10665 (Fdbus_register_method, Vdbus_registered_objects_table):
10666 Fix docstring.
a3de0cbd 10667
b260039d
JM
106682011-09-24 Jim Meyering <meyering@redhat.com>
10669
32c1fffd 10670 do not ignore write error for any output size
b260039d
JM
10671 The previous change was incomplete.
10672 While it makes emacs --batch detect the vast majority of stdout
10673 write failures, errors were still ignored whenever the output size is
10674 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10675 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10676 && echo FAIL: ignored write error
10677 FAIL: ignored write error
10678 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10679 && echo FAIL: ignored write error
10680 FAIL: ignored write error
10681 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10682
8eca8a7c
AS
106832011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10684
10685 * emacs.c (Fkill_emacs): In noninteractive mode exit
10686 non-successfully if a write error occurred on stdout. (Bug#9574)
10687
3341db62
EZ
106882011-09-21 Eli Zaretskii <eliz@gnu.org>
10689
10690 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10691 the xassert test.
10692
10693 * dispextern.h (struct it): Update the comment documenting what
10694 can it->OBJECT be.
10695
8c203dbf
EZ
106962011-09-20 Eli Zaretskii <eliz@gnu.org>
10697
10698 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10699 a display string, extend search for cursor position to end of row.
10700 (find_row_edges): If the row ends in a newline from a display
10701 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10702 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
10703 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10704 non-empty line. Fixes confusing cursor motion with arrow keys at
10705 the beginning of a line that starts with whitespace.
8c203dbf 10706
a4824228
LMI
107072011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10708
10709 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10710 (bug#9493).
10711
33ed493b
CY
107122011-09-18 Chong Yidong <cyd@stupidchicken.com>
10713
10714 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10715 boolean (Bug#9154).
10716
56cd55c8
EZ
107172011-09-18 Eli Zaretskii <eliz@gnu.org>
10718
10719 * xdisp.c (display_line): Record maximum and minimum buffer
10720 positions even if no glyphs were produced (e.g., by a zero-width
10721 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10722 buffer positions that will be removed from the glyph row because
10723 they don't fit.
c02dcedf
EZ
10724 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10725 column is beyond frame width: don't subtract 1 "pixel" when
10726 computing width of the stretch.
3e62b7e0
EZ
10727 (reseat_at_next_visible_line_start): Undo the change made on
10728 2011-09-17 that saved paragraph information and restored it after
10729 the call to `reseat'. (Bug#9545)
56cd55c8 10730
5ed99d36 107312011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
10732
10733 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10734 and turn window cursor on if cleared (Bug#9415).
10735
5ed99d36 107362011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
10737
10738 * search.c (boyer_moore): Take unibyte characters from pattern
10739 literally. (Bug#9458)
10740
9bade7b2
EZ
107412011-09-18 Eli Zaretskii <eliz@gnu.org>
10742
10743 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10744
e5e9d610
PE
107452011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10746
87e4427a
PE
10747 Fix minor problem found by static checking.
10748 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10749 initialized, to pacify gcc -Wuninitialized.
10750
e5e9d610
PE
10751 * fileio.c: Report proper errno when syscall falls.
10752 (Finsert_file_contents): Save and restore errno,
10753 so that report_file_error outputs the correct diagnostic.
10754 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10755
a1674f0b
EZ
107562011-09-18 Eli Zaretskii <eliz@gnu.org>
10757
10758 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10759
fbfb6dd4
EZ
107602011-09-17 Eli Zaretskii <eliz@gnu.org>
10761
10762 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10763 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10764
bb187662
EZ
107652011-09-17 Eli Zaretskii <eliz@gnu.org>
10766
1137e8b8 10767 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 10768 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
10769
10770 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10771 (bidi_find_paragraph_start): Search back for paragraph beginning
10772 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10773 (bidi_move_to_visually_next): Only trigger paragraph-related
10774 computations when the last character is a newline or at EOB, not
10775 just any NEUTRAL_B. (Bug#9470)
10776
bb187662
EZ
10777 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10778 truncated lines if point is covered by a display string. (Bug#9524)
10779
2e621251
PE
107802011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10781
10782 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10783 (cons_to_x_long): New function.
10784 (lisp_data_to_selection_data): Use it. Correct the test for
10785 short-versus-long data; it was negated. Break out of vector
10786 loop, for efficiency, when a long datum is discovered.
10787
91a15bc6
SM
107882011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10789
10790 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10791
b41c3a35
EZ
107922011-09-16 Eli Zaretskii <eliz@gnu.org>
10793
10794 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10795 GCC PR/17406) by declaring this function with external scope.
10796
7812ba2d
PE
107972011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10798
10799 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10800 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10801
cf7edc2a
AS
108022011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10803
10804 * editfns.c (Fformat): Correctly handle text properties on "%%".
10805
bd01620e
EZ
108062011-09-15 Eli Zaretskii <eliz@gnu.org>
10807
10808 * xterm.c (x_draw_composite_glyph_string_foreground):
10809 * w32term.c (x_draw_composite_glyph_string_foreground):
10810 * term.c (encode_terminal_code):
10811 * composite.c (composition_update_it, get_composition_id):
10812 * xdisp.c (get_next_display_element)
10813 (fill_composite_glyph_string): Add comments about special meaning
10814 of TAB characters in a composition.
10815
a02719a3
PE
108162011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10817
10818 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
10819 This occurs when processing a multibyte format.
10820 Problem reported by Wolfgang Jenker.
a02719a3 10821
72589a3c
JB
108222011-09-15 Johan Bockgård <bojohan@gnu.org>
10823
10824 * xdisp.c (try_cursor_movement): Only check for exact match if
10825 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10826
1c14176c
PE
108272011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10828
10829 Remove unused external symbols.
10830 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10831 * xdisp.c (calc_pixel_width_or_height): Now static.
10832 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10833 * indent.c (check_display_width):
10834 * w32term.c: Fix comment to match code.
10835 * xterm.c, xterm.h (x_catching_errors): Remove.
10836
d2eea5b5
PE
108372011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10838
10839 * xselect.c: Use signed conversions more consistently (Bug#9498).
10840 (selection_data_to_lisp_data): Assume incoming selection data are
10841 signed integers, not unsigned. This is to be consistent with
10842 outgoing selection data, which was modified to use signed integers
10843 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10844 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10845 expects long, not unsigned long.
10846
46888499
EZ
108472011-09-14 Eli Zaretskii <eliz@gnu.org>
10848
10849 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10850 computation of loop end. Reported by Johan Bockgård
10851 <bojohan@gnu.org>.
10852
ef8ef9fb
CY
108532011-09-13 Chong Yidong <cyd@stupidchicken.com>
10854
10855 * frame.c (Fother_visible_frames_p): Function deleted.
10856
fa819fed
EZ
108572011-09-12 Eli Zaretskii <eliz@gnu.org>
10858
10859 * indent.c (compute_motion): Process display vector front to back
10860 rather than the other way around. (Bug#2496)
10861
2ba8e008
SM
108622011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10863
10864 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10865
20f53c69
CY
108662011-09-11 Chong Yidong <cyd@stupidchicken.com>
10867
10868 * minibuf.c (Fread_from_minibuffer): Doc fix.
10869
d562d7a4
EZ
108702011-09-11 Eli Zaretskii <eliz@gnu.org>
10871
10872 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10873 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10874
1c4d7f3d
LMI
108752011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10876
10877 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10878 value for non-existent files.
10879
b885bf36
EZ
108802011-09-11 Eli Zaretskii <eliz@gnu.org>
10881
10882 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10883 set its "size" to -1. This will set the modtime_size field of
10884 the corresponding buffer to -1, which is what
10885 verify-visited-file-modtime expects for files that do not exist.
10886 (Bug#9139)
10887
6612f0bf
PE
108882011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10889
10890 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10891 here ...
10892 * lisp.h: ... from here. push_key_description is no longer
10893 defined in keyboard.c, so its declaration should not be in
10894 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10895 logically belongs with push_key_description.
10896
dfb3f755
PE
108972011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10898
10899 * buffer.h: Include <sys/types.h> instead of <time.h>.
10900 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10901 Problem reported by Herbert J. Skuhra.
10902
3134906c
LMI
109032011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10904
10905 * xml.c (parse_region): Make the parsing work for
10906 non-comment-starting XML files again (bug#9144).
10907
8d903f4e
AS
109082011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10909
10910 * image.c (gif_load): Fix calculation of bottom and right corner.
10911 (Bug#9468)
10912
80ad64f4
EZ
109132011-09-10 Eli Zaretskii <eliz@gnu.org>
10914
10915 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10916 redisplay in small windows.
10917
208a048d
EZ
109182011-09-09 Eli Zaretskii <eliz@gnu.org>
10919
10920 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10921
9b1c252e
MR
109222011-09-08 Martin Rudalics <rudalics@gmx.at>
10923
10924 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10925 Operate on live windows only.
10926
2949f33b
JB
109272011-09-08 Juanma Barranquero <lekktu@gmail.com>
10928
10929 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10930
e08dcafd
EZ
109312011-09-07 Eli Zaretskii <eliz@gnu.org>
10932
10933 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10934 only under bidi iteration.
10935
115b96bd
JD
109362011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10937
10938 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10939
c8199d0f
PE
109402011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10941
10942 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10943 Without this fix, the command to link temacs failed due to an
10944 undefined symbol __builtin_isnan. This is because
10945 /usr/include/iso/math_c99.h #defines isnan(x) to
10946 __builtin_isnan(x), but the bundled gcc, which identifies itself
10947 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10948 a __builtin_isnan.
10949 * floatfns.c (isnan): #undef, and then #define to a clone of
10950 what's in data.c.
10951 (Fisnan): Always define, since it's always available now.
10952 (syms_of_floatfns): Always define isnan at the Lisp level.
10953
e39b275c 109542011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
10955
10956 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10957
b2db44d9 109582011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 10959
f4af5137 10960 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
10961 The previous code assumed that file offsets (off_t values) fit in
10962 EMACS_INT variables, which is not true on typical 32-bit hosts.
10963 The code messed up by falsely reporting buffer overflow in cases
10964 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10965 when "big" contains more than 2**29 bytes, even though this
10966 inserts just one byte and does not overflow the buffer.
10967 (Finsert_file_contents): Store file offsets as off_t
10968 values, not as EMACS_INT values. Check for overflow when
10969 converting between EMACS_INT and off_t. When checking for
10970 buffer overflow or for overlap, take the offsets into account.
10971 Don't use EMACS_INT for small values where int suffices.
10972 When checking for overlap, fix a typo: ZV was used where
10973 ZV_BYTE was intended.
10974 (Fwrite_region): Don't assume off_t fits into 'long'.
10975 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10976
ecfc0a49
MA
109772011-09-05 Michael Albinus <michael.albinus@gmx.de>
10978
10979 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10980
6511acf2 109812011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 10982
0999621a 10983 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
10984
10985 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 10986 (esprintf, exprintf, evxprintf): New functions.
62f19c19 10987 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 10988 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
10989 (modify_event_symbol): Do not assume that the length of
10990 name_alist_or_stem is safe to alloca and fits in int.
10991 (Fexecute_extended_command): Likewise for function name and binding.
10992 (Frecursion_depth): Wrap around reliably on integer overflow.
10993 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10994 since some callers pass EMACS_INT values.
10995 (Fsingle_key_description): Don't crash if symbol name contains more
10996 than MAX_ALLOCA bytes.
10997 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10998 (get_minibuffer): Arg is now EMACS_INT, not int.
10999 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 11000 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
11001 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11002
2be7d702
PE
11003 * dbusbind.c (signature_cat): New function.
11004 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
11005 Do not overrun buffer; instead, report string overflow.
11006
9d1df220
PE
11007 * dispnew.c (add_window_display_history): Don't overrun buffer.
11008 Truncate instead; this is OK since it's just a log.
11009
33ef5c64
PE
11010 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11011 even if the time zone offset is outlandishly large.
11012 Don't mishandle offset == INT_MIN.
11013
66c6fdd5
PE
11014 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11015 when creating daemon; the previous buffer-overflow check was incorrect.
11016
d749b01b
PE
11017 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11018 which has the guts of the old verror function.
11019
b5cd1905
PE
11020 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11021 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11022
6e1a67fb
PE
11023 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11024 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 11025 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 11026 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
11027 length of string rather than counting it via multiple sprintfs;
11028 that's simpler and more reliable.
c21721cc
PE
11029 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11030 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11031 sprintf, in case result does not fit in int.
11032
c57b67fc
PE
11033 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11034 (fontset_from_font): Print it.
11035
8a401434
PE
11036 * frame.c (tty_frame_count): Now printmax_t, not int.
11037 (make_terminal_frame, set_term_frame_name): Print it.
11038 (x_report_frame_params): In X, window IDs are unsigned long,
11039 not signed long, so print them as unsigned.
11040 (validate_x_resource_name): Check for implausibly long names,
11041 and don't assume name length fits in 'int'.
11042 (x_get_resource_string): Don't blindly alloca invocation name;
11043 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
11044 not fit in int.
11045
6e1a67fb
PE
11046 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11047 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
11048 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11049
0df02bf3
PE
11050 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11051 Use esprintf, not sprintf, in case result does not fit in int.
11052
48e30793
PE
11053 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11054 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11055 it as a large positive number.
11056 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
11057 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11058
a66ff6d8
PE
11059 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
11060 in case result does not fit in int.
11061
aca216ff
PE
11062 * print.c (float_to_string): Detect width overflow more reliably.
11063 (print_object): Make sprintf buffer a bit bigger, to avoid potential
11064 buffer overrun. Don't assume list length fits in 'int'. Treat
11065 print length of 0 as 0, not as infinity; to be consistent with other
11066 uses of print length in this function. Don't overflow print length
11067 index. Don't assume hash table size fits in 'long', or that
11068 vectorlike size fits in 'unsigned long'.
11069
31c286f7
PE
11070 * process.c (make_process): Use printmax_t, not int, to format
11071 process-name gensyms.
11072
55e5faa1
PE
11073 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
11074
80f2e268
PE
11075 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
11076 to avoid potential buffer overrun.
11077
670741ab
PE
11078 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
11079 if X resource line is longer than 512 bytes.
11080
b7163a50
PE
11081 * xfns.c (x_window): Make sprintf buffer a bit bigger
11082 to avoid potential buffer overrun.
11083
ae58ff1f
PE
11084 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
11085
c43c8a6a
PE
11086 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
11087
3f8236f4
PE
110882011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11089
53e9fe90 11090 Integer overflow fixes for scrolling, etc.
6511acf2
PE
11091 Without these, Emacs silently mishandles large integers sometimes.
11092 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
11093 it were "C-u 1 M-x recenter" on a typical 64-bit host.
11094
6511acf2
PE
11095 * xdisp.c (try_window_id): Check Emacs fixnum range before
11096 converting to 'int'.
806add1d 11097
6511acf2 11098 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
11099 Check that an Emacs fixnum is in range before assigning it to 'int'.
11100 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
11101 values converted from Emacs fixnums.
11102 (Frecenter): Don't wrap around a line count if it is out of 'int'
11103 range; instead, treat it as an extreme value.
11104 (Fset_window_configuration, compare_window_configurations):
11105 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
11106
6511acf2
PE
11107 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
11108 that can exceed INT_MAX. Check that EMACS_INT value is in range
11109 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
11110 (match_limit): Don't assume that a fixnum can fit in 'int'.
11111
6511acf2 11112 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
11113 exceed INT_MAX.
11114
6511acf2 11115 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
11116 (Fvertical_motion): Don't wrap around LINES values that don't fit
11117 in 'int'. Instead, treat them as extreme values. This is good
11118 enough for windows, which can't have more than INT_MAX lines anyway.
11119
fcb901a7
LMI
111202011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11121
0f2f6b6d
LMI
11122 * Require libxml/parser.h to avoid compilation warning.
11123
fcb901a7
LMI
11124 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11125
11126 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11127 since this reportedly can destroy thread storage.
11128
6e20a0d4
CY
111292011-08-30 Chong Yidong <cyd@stupidchicken.com>
11130
11131 * syntax.c (find_defun_start): Update all cache variables if
11132 exiting early (Bug#9401).
11133
148ae00e
EZ
111342011-08-30 Eli Zaretskii <eliz@gnu.org>
11135
f6cfbd8f
EZ
11136 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11137
148ae00e
EZ
11138 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11139 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
11140 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
11141
11142 * term.c (tty_append_glyph): New function.
11143 (produce_stretch_glyph): Static function and its prototype deleted.
11144
a66cfb1c
SM
11145 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11146 Add prototypes.
148ae00e 11147
c4a07a4c
PE
111482011-08-29 Paul Eggert <eggert@cs.ucla.edu>
11149
11150 * image.c (parse_image_spec): Check for nonnegative, not for positive,
11151 when checking :margin (Bug#9390).
11152 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 11153 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
11154 so that the name doesn't mislead. All uses changed.
11155
6bc8cd65
JB
111562011-08-28 Johan Bockgård <bojohan@gnu.org>
11157
11158 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11159 set_tty_hooks.
11160
dca4927e
EZ
111612011-08-27 Eli Zaretskii <eliz@gnu.org>
11162
11163 * xdisp.c (move_it_to): Don't bail out early when reaching
11164 position beyond to_charpos, if we are scanning backwards.
11165 (move_it_vertically_backward): When DY == 0, make sure we get to
11166 the first character in the line after the newline.
11167
f2cad773
PE
111682011-08-27 Paul Eggert <eggert@cs.ucla.edu>
11169
11170 * ccl.c: Improve and simplify overflow checking (Bug#9196).
11171 (ccl_driver): Do not generate an out-of-range pointer.
11172 (Fccl_execute_on_string): Remove unnecessary check for
11173 integer overflow, noted by Stefan Monnier in
11174 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11175 Remove a FIXME that didn't need fixing.
11176 Simplify the newly-introduced buffer reallocation code.
11177
0cae2cdb
JB
111782011-08-27 Juanma Barranquero <lekktu@gmail.com>
11179
11180 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11181
5fc295a4 111822011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 11183
70c60eb2 11184 Integer and memory overflow issues (Bug#9196).
726e0ab1 11185
d31850da
PE
11186 * doc.c (get_doc_string): Rework so that
11187 get_doc_string_buffer_size is the actual buffer size, rather than
11188 being 1 less than the actual buffer size; this makes xpalloc more
11189 convenient.
11190
a69fbedb
PE
11191 * image.c (x_allocate_bitmap_record, cache_image):
11192 * xselect.c (Fx_register_dnd_atom):
11193 Simplify previous changes by using xpalloc.
11194
fe5c5d37
PE
11195 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11196 since either will do and ptrdiff_t is convenient with xpalloc.
11197
0065d054
PE
11198 * charset.c (charset_table_size)
11199 (struct charset_sort_data.priority): Now ptrdiff_t.
11200 (charset_compare): Don't overflow if priorities differ greatly.
11201 (Fsort_charsets): Don't assume list length fits in int.
11202 Check for size-calculation overflow when allocating sort data.
11203 (syms_of_charset): Allocate an initial charset table that is
11204 just under 64 KiB, to avoid problems with glibc malloc and mmap.
11205
11206 * cmds.c (internal_self_insert): Check for size-calculation overflow.
11207
11208 * composite.h (struct composition.glyph_len): Now int, not unsigned.
11209 The actual value is always <= INT_MAX, and leaving it unsigned made
11210 overflow checking harder.
11211
11212 * dispextern.h (struct glyph_matrix.rows_allocated)
11213 (struct face_cache.size): Now ptrdiff_t, for convenience in use
11214 with xpalloc. The values are still always <= INT_MAX.
11215
11216 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
11217
11218 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
11219 (SAFE_NALLOCA): New macro.
11220
11221 * region-cache.c (struct boundary.pos, find_cache_boundary)
11222 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
11223 (set_cache_region, invalidate_region_cache)
11224 (revalidate_region_cache, know_region_cache, region_cache_forward)
11225 (region_cache_backward, pp_cache):
11226 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
11227 so that ptrdiff_t * can be passed to xpalloc.
11228 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
11229 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
11230 (pp_cache): Don't assume cache_len fits in int.
11231 * region-cache.h: Adjust extern decls to match.
11232
11233 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
11234 EMACS_INT, since either will do, for xpalloc.
11235
11236 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
11237 (xnmalloc, xnrealloc, xpalloc): New functions.
11238
726e0ab1
PE
11239 * bidi.c (bidi_shelve_header_size): New constant.
11240 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11241 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11242
51f30bc5 11243 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
11244 * buffer.c (overlays_at, overlays_in, record_overlay_string)
11245 (overlay_strings):
11246 Don't update size of array until after memory allocation succeeds,
11247 because xmalloc/xrealloc may not return.
0065d054
PE
11248 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11249 now that we have proper integer overflow checking.
11250 (record_overlay_string, overlay_strings): Catch overflows when
11251 calculating size of overlay_str_buf.
726e0ab1 11252
0065d054
PE
11253 * callproc.c (Fcall_process): Check for size overflow when
11254 calculating size of args2.
11255 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11256 Normally we prefer signed values, but sticking with ptrdiff_t would
11257 require adding more-complicated checks.
726e0ab1
PE
11258
11259 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11260 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11261 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 11262 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
11263
11264 * character.c (Fstring): Check for size-calculation overflow.
11265
11266 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11267 unnecessary integer overflow. Check for size overflow.
11268 (encode_coding_object): Don't update size until xmalloc succeeds.
11269
11270 * composite.c (get_composition_id): Check for overflow in glyph
11271 length calculations.
11272
11273 Integer and memory overflow fixes for display code.
11274 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11275 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11276 (scrolling_window): Check for overflow in size calculations.
11277 (line_draw_cost, realloc_glyph_pool, add_row_entry):
11278 Don't assume glyph table len fits in int.
11279 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11280 (row_table_size): Now ptrdiff_t, not int.
11281 (scrolling_window): Avoid overflow in size calculations.
11282 Don't update size until allocation succeeds.
11283 * fns.c (concat): Check for overflow in size calculations.
11284 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11285 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11286 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11287
11288 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11289 (get_doc_string): Check for size calculation overflow.
11290 Don't update size until allocation succeeds.
11291 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11292 EMACS_INT, where ptrdiff_t will do.
11293 (Fsubstitute_command_keys): Check for string overflow.
11294
11295 * editfns.c (set_time_zone_rule): Don't assume environment length
11296 fits in int.
11297 (message_length): Now ptrdiff_t, not int.
11298 (Fmessage_box): Don't update size until allocation succeeds.
11299 Don't assume message length fits in int.
11300 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11301
0065d054
PE
11302 * emacs.c (main): Do not reallocate argv, since there is a null at
11303 the end that can be overwritten, and this way there's no need to
11304 worry about size-calculation overflow.
11305 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
11306
11307 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11308 alloc succeeds.
11309 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11310
11311 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11312 (x_set_scroll_bar_width, x_figure_window_size):
11313 Check for integer overflow.
11314 (x_set_alpha): Do not assume XINT fits in int.
11315
11316 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11317 This is for the members text_lines, text_cols, total_lines, total_cols,
11318 where the system imposes an 'int' limit.
11319
11320 * fringe.c (Fdefine_fringe_bitmap):
11321 Don't update size until alloc works.
11322
11323 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11324 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11325
11326 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11327 Check for size-calculation overflow.
11328 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11329 do, as we prefer signed integers.
11330 (id_to_widget.max_size, id_to_widget.used)
11331 (xg_store_widget_in_map, xg_remove_widget_from_map)
11332 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11333 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11334 Use and return ptrdiff_t, not int.
11335 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11336 * gtkutil.h: Change prototypes to match the above.
11337
11338 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11339 are duplicate now that they've been promoted to lisp.h.
11340 (x_allocate_bitmap_record, x_alloc_image_color)
11341 (make_image_cache, cache_image, xpm_load):
11342 Don't update size until alloc is done.
11343 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11344 (x_detect_edges):
3256efce 11345 Check for size calculation overflow.
726e0ab1
PE
11346 (ct_colors_allocated_max): New constant.
11347 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11348 overflow.
3256efce 11349
726e0ab1
PE
11350 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11351 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11352 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11353 Use ptrdiff_t, not int, to count maps.
11354 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
11355 calculations. Don't update size until allocation succeeds.
11356 Redo calculations to avoid overflow.
726e0ab1
PE
11357 * keyboard.h: Change prototypes to match the above.
11358
11359 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11360 to count maps.
11361 (current_minor_maps): Check for size calculation overflow.
11362 * keymap.h: Change prototypes to match the above.
11363
11364 * lread.c (read1, init_obarray): Don't update size until alloc done.
11365
11366 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11367 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11368
726e0ab1
PE
11369 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11370 Now ptrdiff_t, not int.
11371 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11372 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11373
11374 * process.c (Fnetwork_interface_list): Check for overflow
11375 in size calculation.
11376
11377 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11378
11379 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11380 overflow. Don't bother calling xmalloc when xrealloc will do.
11381
11382 * search.c (Freplace_match): Check for size calculation overflow.
11383 (Fset_match_data): Don't assume list lengths fit in 'int'.
11384
11385 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11386 for command line length. Do not attempt to address one before the
11387 beginning of an array, as that's not portable.
11388
11389 * term.c (max_frame_lines): Remove; unused.
11390 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11391 not int.
11392 (encode_terminal_code, calculate_costs): Check for size
11393 calculation overflow.
11394 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11395 table lengths and related sizes. Don't update size until alloc
11396 done. Redo calculations to avoid overflow.
11397 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11398
11399 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11400 subtracting pointers.
11401 (gobble_line): Check for overflow more carefully. Don't update size
11402 until alloc done.
11403
11404 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11405 Don't update size until alloc done.
11406 Redo size calculations to avoid overflow.
11407 Check for size calculation overflow.
0065d054 11408 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
11409
11410 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11411 Use ptrdiff_t, not int, for sizes.
11412 (store_mode_line_noprop_char): Don't update size until alloc done.
11413
0065d054
PE
11414 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11415 Use ptrdiff_t, not int, for sizes.
11416 (Finternal_make_lisp_face, cache_face):
11417 Check for size calculation overflow.
11418 (cache_face): Treat size calculation overflows as if they were
11419 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
11420
11421 * xfns.c (x_encode_text, x_set_name_internal)
11422 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11423 sizes, since they can exceed INT_MAX in size. Check for size
11424 calculation overflow.
11425
0065d054
PE
11426 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11427 (xg_select): Check for size calculation overflow.
726e0ab1
PE
11428 Don't update size until alloc done.
11429
0065d054 11430 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 11431 as sprintf is limited to int lengths.
1d526e2f 11432
252c5ee1
PE
11433 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11434 (X_LONG_MIN): New macros.
864d7ce7
PE
11435 Use them to make the following changes clearer.
11436 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11437 This change doesn't affect the value now, but it may help remind
11438 future maintainers not to raise the value too much later.
11439 (SELECTION_QUANTUM): Remove, replacing with ...
11440 (selection_quantum): ... new function, which avoids overflow.
11441 All uses changed.
11442 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11443 assumption that selection length fits in 'int'.
11444 (x_reply_selection_request, x_handle_selection_request)
11445 (x_get_window_property, receive_incremental_selection)
11446 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11447 (lisp_data_to_selection_data, clean_local_selection_data):
11448 Use ptrdiff_t, not int, to record length of selection.
11449 (x_reply_selection_request, x_get_window_property)
11450 (receive_incremental_selection, x_property_data_to_lisp):
11451 Redo calculations to avoid overflow.
11452 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 11453 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
11454 something.
11455 (x_get_window_property, receive_incremental_selection)
11456 (lisp_data_to_selection_data, x_property_data_to_lisp):
11457 Check for size-calculation overflow.
11458 (x_get_window_property, receive_incremental_selection)
11459 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11460 Don't store size until memory allocation succeeds.
11461 (x_get_window_property): Plug memory leak on memory exhaustion.
11462 Don't double-block input; malloc is safe here. Don't assume 2**34
11463 - 4 fits in unsigned long. Add an xassert to check
11464 XGetWindowProperty overflow. Be more careful about overflow
11465 calculations, and distinguish size from memory overflow better.
11466 (receive_incremental_selection): When tracing, don't assume
11467 unsigned int is less than INT_MAX.
11468 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11469 harmful) conversions of unsigned short to int.
11470 (lisp_data_to_selection_data): Don't assume that integers
11471 in the range -65535 through -1 fit in an X unsigned short.
11472 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11473 result parameters unless successful. Rely on cons_to_unsigned
11474 to report problems with elements; the old code wasn't right anyway.
11475 (x_check_property_data): Check for int overflow; we cannot use
11476 a wider type due to X limits.
11477 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11478
726e0ab1 11479 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 11480
0065d054
PE
11481 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11482 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
11483 (x_color_cells): Don't store size until memory allocation succeeds.
11484 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 11485 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
11486 (x_term_init): Don't assume length fits in int (sprintf is limited
11487 to int size).
bc18e09d 11488
ebfa62c0
PE
11489 Use ptrdiff_t for composition IDs.
11490 * character.c (lisp_string_width):
11491 * composite.c (composition_table_size, n_compositions)
11492 (get_composition_id, composition_gstring_from_id):
11493 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11494 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11495 * window.c (Frecenter):
11496 Use ptrdiff_t, not int, for composition IDs.
11497 * composite.c (get_composition_id): Check for integer overflow.
11498 * composite.h: Adjust prototypes to match the above changes.
11499
d3411f89
PE
11500 Use ptrdiff_t for hash table indexes.
11501 * category.c (hash_get_category_set):
11502 * ccl.c (ccl_driver):
11503 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11504 * coding.c (coding_system_charset_list, detect_coding_system):
11505 * coding.h (struct coding_system.id):
11506 * composite.c (get_composition_id, gstring_lookup_cache):
11507 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11508 * image.c (xpm_get_color_table_h):
11509 * lisp.h (hash_lookup, hash_put):
11510 * minibuf.c (Ftest_completion):
11511 Use ptrdiff_t for hash table indexes, not int (which is too
11512 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11513 32-bit --with-wide-int hosts).
11514
e097a6fa
PE
11515 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11516 Add a FIXME comment about memory leaks.
11517 (syms_of_charset): Don't assume xmalloc returns.
11518
5637687f
PE
11519 Don't assume that stated character widths fit in int.
11520 * character.c (Fchar_width, c_string_width, lisp_string_width):
11521 * character.h (CHAR_WIDTH):
11522 * indent.c (MULTIBYTE_BYTES_WIDTH):
11523 Use sanitize_char_width to avoid undefined and/or bad behavior
11524 with outlandish widths.
a66cfb1c 11525 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
11526 now that we have two such functions. All uses changed.
11527 (sanitize_char_width): New inline function.
11528
a2271ba2
PE
11529 Don't assume that tab-width fits in int.
11530 * character.h (sanitize_width): New inline function.
11531 (SANE_TAB_WIDTH): New macro.
11532 (ASCII_CHAR_WIDTH): Use it.
11533 * indent.c (sane_tab_width): Remove. All uses replaced by
11534 SANE_TAB_WIDTH (current_buffer).
11535 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11536
18c52557
PE
11537 * fileio.c: Integer overflow issues with file modes.
11538 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11539
caeeedc1
PE
11540 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11541 Remove unreachable code.
11542 (read_hex, load_charset_map_from_file): Check for integer overflow.
11543
6df6ae42 11544 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
11545 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11546 (x_send_scroll_bar_event): Likewise. Check that the size does not
11547 exceed limits imposed by XClientMessageEvent, as well as the usual
11548 ptrdiff_t and size_t limits.
11549
b13995db
PE
11550 * keyboard.c: Overflow, signedness and related fixes.
11551 (make_lispy_movement): Use same integer type in forward decl
11552 that is used in the definition.
11553 (read_key_sequence, keyremap_step):
11554 Change bufsize argument back to int, undoing my 2011-03-30 change.
11555 We prefer signed types, and int is wide enough here.
11556 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11557 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11558 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11559 length, not size_t. Use ptrdiff_t for index, not int.
11560 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11561 possibility of integer overflow.
11562
13464394
PE
11563 Overflow, signedness and related fixes for images.
11564
11565 * dispextern.h (struct it.stack[0].u.image.image_id)
11566 (struct_it.image_id, struct image.id, struct image_cache.size)
11567 (struct image_cache.used, struct image_cache.ref_count):
11568 * gtkutil.c (update_frame_tool_bar):
11569 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11570 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11571 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11572 * nsmenu.m (update_frame_tool_bar):
11573 * xdisp.c (calc_pixel_width_or_height):
11574 * xfns.c (image_cache_refcount):
11575 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11576 on typical 64-bit hosts.
11577
11578 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11579 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11580 Omit unnecessary casts to int.
11581 (parse_image_spec): Check that integers fall into 'int' range
11582 when the callers expect that.
11583 (image_ascent): Redo ascent calculation to avoid int overflow.
11584 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11585 (lookup_image): Remove unnecessary tests.
11586 (xbm_image_p): Locals are now of int, not EMACS_INT,
11587 since parse_image_check makes sure they fit into int.
11588 (png_load, gif_load, svg_load_image):
11589 Prefer int to unsigned where either will do.
11590 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
11591 old tiff_error_handler and tiff_warning_handler.
11592 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
11593 stack buffer overflows. It uses only the features of vsnprintf
11594 that are common to both POSIX and native Microsoft.
11595 (tiff_error_handler, tiff_warning_handler): Use it.
11596 (tiff_load, gif_load, imagemagick_load_image):
11597 Don't assume :index value fits in 'int'.
11598 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11599 (imagemagick_load_image): Check that crop parameters fit into
11600 the integer types that MagickCropImage accepts. Don't assume
11601 Vimagemagick_render_type has a nonnegative value. Don't assume
11602 size_t fits in 'long'.
11603 (gs_load): Use printmax_t to print the widest integers possible.
11604 Check for integer overflow when computing image height and width.
11605
c11821d4
EZ
116062011-08-26 Eli Zaretskii <eliz@gnu.org>
11607
11608 * xdisp.c (redisplay_window): Don't force window start if point
11609 will be invisible in the resulting window. (Bug#9324)
11610
0c95fcf7
EZ
116112011-08-25 Eli Zaretskii <eliz@gnu.org>
11612
11613 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11614 the display spec is of the form `(space ...)'.
11615 (handle_display_spec): Return the value returned by
11616 handle_single_display_spec, not just 1 or zero.
11617 (handle_single_display_spec): If the display spec is of the form
11618 `(space ...)', and specifies display in the text area, return 2
11619 rather than 1.
fee65a97 11620 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
11621 accurately, and prefer exact match for point under bidi.
11622 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
11623
11624 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11625 into disp_prop; all users changed.
11626
11627 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11628 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11629 for the text covered by the display property.
11630
e4ed06f1
CY
116312011-08-25 Chong Yidong <cyd@stupidchicken.com>
11632
11633 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11634 Change return value to nil.
11635 (Frecord_buffer): Delete unused function.
11636
f67cdd7f
EZ
116372011-08-24 Eli Zaretskii <eliz@gnu.org>
11638
5980d4c6
EZ
11639 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11640 buffers, return left-to-right.
8610fe8b
EZ
11641 (set_cursor_from_row): Consider candidate row a win if its glyph
11642 represents a newline and point is on that newline. Fixes cursor
11643 positioning on the newline at EOL of R2L text within L2R
11644 paragraph, and vice versa.
11645 (try_cursor_movement): Check continued rows, in addition to
11646 continuation rows. Fixes unwarranted scroll when point enters a
11647 continued line of R2L text within an L2R paragraph, or vice versa.
11648 (cursor_row_p): Consider the case of point being equal to
11649 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11650 from the end of a short line to the beginning of a continued line
11651 of R2L text within L2R paragraph.
11652 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11653 composed characters.
5980d4c6 11654
f67cdd7f
EZ
11655 * bidi.c (bidi_check_type): Use xassert.
11656 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11657 members.
11658
bca633fb
EZ
116592011-08-23 Eli Zaretskii <eliz@gnu.org>
11660
11661 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11662 a character.
11663
4a5885a7
CY
116642011-08-23 Chong Yidong <cyd@stupidchicken.com>
11665
11666 * nsfont.m (ns_otf_to_script): Fix typo.
11667
0902a04e
KH
116682011-08-22 Kenichi Handa <handa@m17n.org>
11669
11670 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11671 extra slot even if the purpose is char-code-property-table.
11672
1a2e6670
EZ
116732011-08-23 Eli Zaretskii <eliz@gnu.org>
11674
8ddde651
EZ
11675 * xdisp.c (redisplay_window): When computing centering_position,
11676 account for the height of the header line. (Bug#8874)
11677
425cc014
EZ
11678 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11679 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11680 candidate is selected by the mouse, and that candidate has a
11681 composed character under the mouse.
11682
1a2e6670
EZ
11683 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11684 coordinates reported by pos-visible-in-window-p for a composed
11685 character in column zero.
11686
8b76d6f8
SM
116872011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11688
11689 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11690
dac347dd
EZ
116912011-08-22 Eli Zaretskii <eliz@gnu.org>
11692
11693 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11694 consider it a hit if to_charpos is anywhere in the range of the
11695 composed buffer positions.
11696
e013fb34
CY
116972011-08-22 Chong Yidong <cyd@stupidchicken.com>
11698
11699 * image.c (gif_load): Don't assume that each subimage has the same
11700 dimensions as the base image. Handle disposal method that is
11701 "undefined" by the gif spec (Bug#9335).
11702
bd1ba3e8
CY
117032011-08-20 Chong Yidong <cyd@stupidchicken.com>
11704
11705 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 11706 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 11707
54a1215b
EZ
117082011-08-19 Eli Zaretskii <eliz@gnu.org>
11709
823564e5
EZ
11710 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11711 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11712 from an Org mode buffer to a Speedbar frame.
11713
54a1215b
EZ
11714 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11715 a composition, take its buffer position from IT->cmp_it.charpos.
11716 Fixes cursor positioning at the beginning of a line that begins
11717 with a composed character.
11718
9778ebcc
EZ
117192011-08-18 Eli Zaretskii <eliz@gnu.org>
11720
0be6ee06
EZ
11721 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11722 character bidirectional type, use STRONG_L instead. Fixes crashes
11723 in a buffer produced by `describe-categories'.
11724
9778ebcc
EZ
11725 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11726 members before the level stack, so they would be saved and
11727 restored when copying iterator state. Fixes incorrect reordering
11728 around TABs covered by display properties.
11729
156bffbe
AS
117302011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11731
6b02f655 11732 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 11733
72ad093b
CY
117342011-08-17 Chong Yidong <cyd@stupidchicken.com>
11735
11736 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
11737 (internal_condition_case_2, internal_condition_case_n):
11738 Remove unnecessary aborts (Bug#9081).
72ad093b 11739
35774242
EZ
117402011-08-17 Eli Zaretskii <eliz@gnu.org>
11741
11742 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11743 has no `load' handler, try opening the file locally. (Bug#9311)
11744
db76dd85
KB
117452011-08-16 Ken Brown <kbrown@cornell.edu>
11746
11747 * gmalloc.c: Expand comment.
11748
b215eee5
EZ
117492011-08-16 Eli Zaretskii <eliz@gnu.org>
11750
11751 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11752 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11753
a4579d33
KB
117542011-08-16 Ken Brown <kbrown@cornell.edu>
11755
11756 Fix memory allocation problems in Cygwin build (Bug#9273).
11757
11758 * unexcw.c ( __malloc_initialized): Declare external variable.
11759 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11760
8b76d6f8
SM
11761 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11762 New variables.
a4579d33
KB
11763 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11764 dumped emacs.
11765 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11766 in the static heap.
11767 [CYGWIN] (special_realloc): New function.
11768 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11769 requests to realloc storage in the static heap.
11770
3ebec551
PE
117712011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11772
11773 * bidi.c (bidi_initialize): Remove unused local.
11774
9fd8be00
EZ
117752011-08-15 Eli Zaretskii <eliz@gnu.org>
11776
6b02f655
SM
11777 * bidimirror.h:
11778 * biditype.h: Remove file.
11779 * makefile.w32-in ($(BLD)/bidi.$(O)):
11780 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
11781
11782 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11783
11784 * chartab.c: Improve commentary for the uniprop_table API.
11785
32413314
EZ
11786 * bidi.c (bidi_paragraph_init): Support zero value of
11787 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
11788 (bidi_initialize): Use uniprop_table instead of including
11789 biditype.h and bidimirror.h.
32413314 11790
9fd8be00
EZ
11791 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11792 coordinates of the iterator when restoring from ppos_it.
11793 (Bug#9296)
11794
5cf2b69b
KH
117952011-08-14 Kenichi Handa <handa@m17n.org>
11796
11797 * process.c (create_process): Call setup_process_coding_systems
72ad093b 11798 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 11799
daf17d00
EZ
118002011-08-14 Eli Zaretskii <eliz@gnu.org>
11801
11802 * xdisp.c (move_it_in_display_line_to): Don't invoke
11803 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11804 ppos_it. Fixes vertical cursor motion when line beginning is
11805 covered by an image. (Bug#9296)
11806
08e3161a
JD
118072011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11808
11809 * nsterm.h (ns_run_ascript): Declare.
11810 (NSAPP_DATA2_RUNASSCRIPT): Define.
11811
11812 * nsfns.m (as_script, as_result, as_status): New static variables.
11813 (ns_run_ascript): New function.
5e617bc2 11814 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
11815 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11816 the event loop. Get status from as_status (Bug#7276).
11817
11818 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11819 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11820 the event loop (Bug#7276).
11821
a3720aa2
AS
118222011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11823
11824 * gnutls.c (QCgnutls_bootprop_priority)
11825 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11826 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11827 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11828 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11829 (QCgnutls_bootprop_verify_hostname_error)
11830 (QCgnutls_bootprop_callbacks_verify): Rename from
11831 Qgnutls_bootprop_..., all uses changed.
11832
11833 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11834 uses changed.
11835
0a0d27fb
PE
118362011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11837
19d5c50c
PE
11838 * xfaces.c (Qframe_set_background_mode): Now static.
11839 * dispextern.h (Qframe_set_background_mode): Remove decl.
11840
0a0d27fb
PE
11841 * process.c (Fnetwork_interface_info): Declare local only if needed.
11842
377538cb
JD
118432011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11844
11845 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11846 (Fnetwork_interface_list): Allocate in increments of bytes instead
11847 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11848 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11849 sockaddr.
11850 (struct ifflag_def): notrailers is smart on OSX.
11851 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11852 Get hardware address with getifaddrs if available.
11853
08fff70c
EZ
118542011-08-12 Eli Zaretskii <eliz@gnu.org>
11855
11856 * xdisp.c (iterate_out_of_display_property): xassert that
11857 IT->position is set to within IT->object's boundaries. Break from
11858 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
11859 when IT->position is set up wrongly due to some bug.
11860 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
11861 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11862 entry. Force push_it to save on the stack the current
11863 buffer/string position, to be restored by pop_it. Fix flags in
11864 the iterator structure wrt the object coming from a display
11865 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11866 properties. (Bug#9284)
11867
7be1c708 118682011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 11869
7be1c708
CY
11870 * fontset.c (fontset_get_font_group): Add proper type checks.
11871 (Bug#9172)
aac0c6e3 11872
7be1c708 118732011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 11874
7be1c708
CY
11875 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11876 and LC_VERSION_MIN_MACOSX.
11877 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11878 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 11879
97bb72a6
EZ
118802011-08-08 Eli Zaretskii <eliz@gnu.org>
11881
11882 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
11883 no-display-properties-and-no-overlays under bidi display.
11884 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 11885 properties and overlays.
97bb72a6 11886
d5617611
CY
118872011-08-08 Chong Yidong <cyd@stupidchicken.com>
11888
37e11a63
CY
11889 * editfns.c (Fset_time_zone_rule): Document relationship with the
11890 setenv function.
11891
d5617611
CY
11892 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11893 the font entity extracted from the cache (Bug#8109).
11894
58872834
CY
118952011-08-07 Chong Yidong <cyd@stupidchicken.com>
11896
11897 * composite.c (autocmp_chars): Don't reset point. That is done by
11898 restore_point_unwind (Bug#5984).
11899
75bfc667
JL
119002011-08-07 Juri Linkov <juri@jurta.org>
11901
11902 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11903 to show the arg `TIME' instead of `TIMEVAL'.
11904
d1410150
EZ
119052011-08-06 Eli Zaretskii <eliz@gnu.org>
11906
11907 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11908 display property strides EOL and includes a newline, as in
11909 longlines-mode. (Bug#9254)
75b771e4
EZ
11910 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11911 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
11912
11913 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11914 is non-zero, even if the data buffer is NULL. Fixes a crash in
11915 vertical-motion with longlines-mode. (Bug#9254)
11916
35928349
EZ
119172011-08-05 Eli Zaretskii <eliz@gnu.org>
11918
ec7cc85b
EZ
11919 * bidi.c <bidi_cache_total_alloc>: Now static.
11920 (bidi_initialize): Initialize bidi_cache_total_alloc.
11921
8b76d6f8 11922 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
11923 cache. (Bug#9221)
11924
11925 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11926 amount allocated this far in `bidi_cache_total_alloc'.
11927 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11928 non-zero, only free the data buffer without restoring the cache
11929 contents. All callers changed.
11930
11931 * dispextern.h (bidi_unshelve_cache): Update prototype.
11932
11933 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11934 (move_it_in_display_line, move_it_to)
11935 (move_it_vertically_backward, move_it_by_lines): Replace the call
11936 to xfree to an equivalent call to bidi_unshelve_cache.
11937 (move_it_in_display_line_to): Fix logic of returning
412b6358 11938 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 11939
e2e2423b
EZ
119402011-08-05 Eli Zaretskii <eliz@gnu.org>
11941
11942 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11943 came from a string character with a `cursor' property. (Bug#9229)
11944
ae9e757a
JD
119452011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11946
11947 * Makefile.in (LIB_PTHREAD): New variable.
11948 (LIBES): Add LIB_PTHREAD (Bug#9216).
11949
11950 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11951 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11952
213bd7f2
AS
119532011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11954
6b02f655 11955 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 11956
99aaf75f
JD
119572011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11958
11959 * xterm.c (x_find_topmost_parent): New function.
11960 (x_set_frame_alpha): Find topmost parent window with
11961 x_find_topmost_parent and set the property there also (bug#9181).
11962 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11963
c74e9d86
PE
119642011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11965
11966 * callproc.c (Fcall_process): Avoid vfork clobbering
11967 the local vars buffer, coding_systems, current_dir.
11968
640c8776
SM
119692011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11970
11971 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11972
f26d0e4c
PE
119732011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11974
8a10d76c
PE
11975 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11976 so that it is not optimized away.
11977
f26d0e4c
PE
11978 * xdisp.c (compute_display_string_pos): Remove unused local.
11979
55439c61
EZ
119802011-08-02 Eli Zaretskii <eliz@gnu.org>
11981
11982 Fix slow cursor motion and scrolling in large buffers with
11983 selective display, like Org Mode buffers. (Bug#9218)
11984
11985 * dispextern.h (struct bidi_it): New member disp_prop_p.
11986
11987 * xdisp.c: Remove one-slot cache of display string positions.
11988 (compute_display_string_pos): Accept an additional argument
5e617bc2 11989 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
11990 for a display string or property. If found, set DISP_PROP_P
11991 non-zero.
11992
11993 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
11994 DISP_PROP_P, and pass it to compute_display_string_pos.
11995 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
11996 non-zero. All callers of bidi_fetch_char changed.
11997
fb33fa43
SM
119982011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
11999
12000 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12001
b099e063
DM
120022010-12-03 Don March <don@ohspite.net>
12003
12004 * keymap.c (Fdefine_key): Fix non-prefix key error message when
12005 last character M-[char] is translated to ESC [char] (bug#7541).
12006
5cc7f7af
KH
120072011-08-02 Kenichi Handa <handa@m17n.org>
12008
d0fffa3f 12009 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
12010
12011 * chartab.c (uniprop_table): Make it non-static.
12012
525d5e6e
EZ
120132011-08-01 Eli Zaretskii <eliz@gnu.org>
12014
12015 * xdisp.c (forward_to_next_line_start): Accept additional argument
12016 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12017 on the newline.
12018 (reseat_at_next_visible_line_start): Use the bidi iterator state
12019 returned by forward_to_next_line_start to restore the state of
12020 it->bidi_it after backing up to previous newline. (Bug#9212)
12021
31011111
AS
120222011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12023
12024 * regex.c (re_comp): Protoize.
12025 (re_exec): Fix return type.
12026 (regexec): Fix type of `ret'. (Bug#9203)
12027
476371c4
PE
120282011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12029
e5d76069
PE
12030 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12031 This is needed if max-image-size is a floating-point number.
12032
9a79b20c
AS
120332011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12034
12035 * print.c (print_object): Print empty symbol as ##.
12036
12037 * lread.c (read1): Read ## as empty symbol.
12038
d8c2fa78
AA
120392011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12040
12041 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12042 setting frame foreground color (Bug#9175).
12043 (x_set_background_color): Likewise.
12044
ffe57a7a
AA
12045 * nsmenu.m (-setText): Size tooltip dimensions precisely to
12046 contents (Bug#9176).
12047 (EmacsTooltip -init): Remove bezels and add shadows to
12048 tooltip windows.
12049
bf3492a5
AA
12050 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12051 or scroll bar (Bug#8470).
12052
d55e9c53
AA
12053 * nsfont.m (nsfont_open): Remove assignment to voffset and
12054 unnecessary vars hshink, expand, hd, full_height, min_height.
12055 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12056
12057 * nsterm.h (nsfont_info): Remove voffset field.
12058
d8c2fa78 120592011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
12060
12061 Implement strike-through and overline on NextStep (Bug#8863).
12062
12063 * nsfont.m (nsfont_open): Use underline position provided by font,
12064 instead of hard-coded value of 2.
12065 (nsfont_draw): Call ns_draw_text_decoration instead.
12066
12067 * nsterm.h: Add declaration for ns_draw_text_decoration.
12068
12069 * nsterm.m (ns_draw_text_decoration): New function for drawing
12070 underline, overline, and strike-through.
12071 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
12072 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 12073 accommodate underlining, etc.
4843aac3 12074
4cc60b9b
EZ
120752011-07-28 Eli Zaretskii <eliz@gnu.org>
12076
bc7ece87
EZ
12077 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
12078 default.
4cc60b9b 12079
476371c4
PE
120802011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12081
66606eea
PE
12082 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
12083 Without this fix, if a signal arrives just after memory fills up,
12084 'malloc' might be invoked reentrantly.
12085
476371c4
PE
12086 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
12087 In other words, assume that every image size is allowed, on non-X
12088 hosts. This assumption is probably wrong, but it lets Emacs compile.
12089
f3fcc40d
AS
120902011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12091
12092 * regex.c (re_iswctype): Convert return values to boolean.
12093
350c992f
EZ
120942011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
12095
12096 * xdisp.c (compute_display_string_pos): Don't use cached display
12097 string position if the buffer had its restriction changed.
12098 (Bug#9184)
12099
5266b4bb
PE
121002011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12101
12102 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12103
2573a837 121042011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 12105
41f55ccd 12106 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 12107
39e378da
PE
12108 * bidi.c: Integer size and overflow fixes.
12109 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
12110 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
12111 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12112 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
12113 (bidi_find_other_level_edge):
12114 Use ptrdiff_t instead of EMACS_INT where either will do.
12115 This works better on 32-bit hosts configured --with-wide-int.
12116 (bidi_cache_ensure_space): Check for size-calculation overflow.
12117 Use % rather than repeated addition, for better worst-case speed.
12118 Don't set bidi_cache_size until after xrealloc returns, because it
12119 might not return.
12120 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
12121 (bidi_cache_ensure_space): Also check that the bidi cache size
12122 does not exceed that of the largest Lisp string or buffer. See Eli
12123 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 12124
5e927815
PE
12125 * alloc.c (__malloc_size_t): Remove.
12126 All uses replaced by size_t. See Andreas Schwab's note
12127 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12128
ca4aa935
PE
12129 * image.c: Improve checking for integer overflow.
12130 (check_image_size): Assume that f is nonnull, since
12131 it is always nonnull in practice. This is one less thing to
12132 worry about when checking for integer overflow later.
12133 (x_check_image_size): New function, which checks for integer
12134 overflow issues inside X.
12135 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12136 This removes the need for a memory_full check.
12137 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12138 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12139 (xbm_read_bitmap_data): Change locals back to 'int', since
12140 their values must fit in 'int'.
12141 (xpm_load_image, png_load, tiff_load):
12142 Invoke x_create_x_image_and_pixmap earlier,
12143 to avoid much needless work if the image is too large.
12144 (tiff_load): Treat overly large images as if
12145 x_create_x_image_and_pixmap failed, not as malloc failures.
12146 (gs_load): Use x_check_image_size.
12147
5f8f9cc2
PE
12148 * gtkutil.c: Omit integer casts.
12149 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12150 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12151
5adf60bc
PE
12152 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12153
c8907a93
PE
12154 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12155 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12156 would wrongly return t on a 64-bit host.
12157
e3c25c68
PE
12158 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12159 The plain *_OVERFLOW macros run afoul of GCC bug 49705
12160 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12161 and therefore cause GCC to emit a bogus diagnostic in some cases.
12162
3f791afe
PE
12163 * image.c: Integer signedness and overflow and related fixes.
12164 This is not an exhaustive set of fixes, but it's time to
12165 record what I've got.
12166 (lookup_pixel_color, check_image_size): Remove redundant decls.
12167 (check_image_size): Don't assume that arbitrary EMACS_INT values
12168 fit in 'int', or that arbitrary 'double' values fit in 'int'.
12169 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12170 (tiff_load, imagemagick_load_image):
12171 Check for overflow in size calculations.
12172 (x_create_x_image_and_pixmap): Remove unnecessary test for
12173 xmalloc returning NULL; that can't happen.
12174 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12175 (xpm_color_bucket): Use better integer hashing function.
12176 (xpm_cache_color): Don't possibly over-allocate memory.
12177 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12178 (gif_memory_source):
12179 Use ptrdiff_t, not int or size_t, to record sizes.
12180 (png_load): Don't assume values greater than 2**31 fit in 'int'.
12181 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12182 either works, as we prefer signed integers.
12183 (tiff_read_from_memory, tiff_write_from_memory):
12184 Return tsize_t, not size_t, since that's what the TIFF API wants.
12185 (tiff_read_from_memory): Don't fail simply because the read would
12186 go past EOF; instead, return a short read.
12187 (tiff_load): Omit no-longer-needed casts.
12188 (Fimagemagick_types): Don't assume size fits into 'int'.
12189
3cc5a532
PE
12190 Improve hashing quality when configured --with-wide-int.
12191 * fns.c (hash_string): New function, taken from sxhash_string.
12192 Do not discard information about ASCII character case; this
12193 discarding is no longer needed.
12194 (sxhash-string): Use it. Change sig to match it. Caller changed.
12195 * lisp.h: Declare it.
12196 * lread.c (hash_string): Remove, since we now use fns.c's version.
12197 The fns.c version returns a wider integer if --with-wide-int is
12198 specified, so this should help the quality of the hashing a bit.
12199
b312a492
PE
12200 * emacs.c: Integer overflow minor fix.
12201 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
12202 Define only if GNU_LINUX.
12203 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12204
dfd153ae
PE
12205 * dispnew.c: Integer signedness and overflow fixes.
12206 Remove unnecessary forward decls, that were a maintenance hassle.
12207 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12208 All uses changed.
12209 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
12210 (scrolling_window): Use ptrdiff_t, not int, for byte count.
12211 (prepare_desired_row, line_draw_cost):
12212 Use int, not unsigned, where either works.
12213 (save_current_matrix, restore_current_matrix):
12214 Use ptrdiff_t, not size_t, where either works.
12215 (init_display): Check for overflow more accurately, and without
12216 relying on undefined behavior.
12217
a81d11a3
PE
12218 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
12219 Remove, replacing with the new symbols in lisp.h. All uses changed.
12220 * fileio.c (make_temp_name):
12221 * filelock.c (lock_file_1, lock_file):
12222 * xdisp.c (message_dolog):
12223 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
12224 Use pMd etc. instead.
12225 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
12226 replacing the pWIDE etc. symbols removed from editfns.c.
12227
3300e6fd
PE
12228 * keyboard.h (num_input_events): Now uintmax_t.
12229 This is (very slightly) less likely to mess up due to wraparound.
12230 All uses changed.
12231
fd05c7e9
PE
12232 * buffer.c: Integer signedness fixes.
12233 (alloc_buffer_text, enlarge_buffer_text):
12234 Use ptrdiff_t rather than size_t when either will do, as we prefer
12235 signed integers.
12236
903fe15d
PE
12237 * alloc.c: Integer signedness and overflow fixes.
12238 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
12239 (__malloc_size_t): Default to size_t, not to int.
12240 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12241 (Fgarbage_collect, mark_object_loop_halt, mark_object):
12242 Prefer ptrdiff_t to size_t when either would do, as we prefer
12243 signed integers.
12244 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12245 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12246 Now const. Initialize with values that are in range even if char
12247 is signed.
12248 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12249 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
12250 These functions do the right thing with sizes > 2**32.
12251 (check_depth): Now ptrdiff_t, not int.
12252 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12253 Adjust to new way of storing sizes. Check for size overflow bugs
12254 in rest of code.
12255 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
12256 slightly wrong anyway, as it missed one instance of
12257 XMALLOC_OVERRUN_CHECK_OVERHEAD.
12258 (refill_memory_reserve): Omit needless cast to size_t.
12259 (mark_object_loop_halt): Mark as externally visible.
12260
ac82cc6a
PE
12261 * xselect.c: Integer signedness and overflow fixes.
12262 (Fx_register_dnd_atom, x_handle_dnd_message):
12263 Use ptrdiff_t, not size_t, since we prefer signed.
12264 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12265 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12266 x_dnd_atoms_size and x_dnd_atoms_length.
12267
c2d1e36d
PE
12268 * doprnt.c: Prefer signed to unsigned when either works.
12269 * eval.c (verror):
12270 * doprnt.c (doprnt):
12271 * lisp.h (doprnt):
12272 * xdisp.c (vmessage):
12273 Use ptrdiff_t, not size_t, when using or implementing doprnt,
12274 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12275 prefer signed arithmetic to avoid comparison confusion.
12276 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12277 but is a bit tricky.
12278
0e926e56
PE
12279 Assume freestanding C89 headers, string.h, stdlib.h.
12280 * data.c, doprnt.c, floatfns.c, print.c:
12281 Include float.h unconditionally.
12282 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12283 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12284 * regex.c: Likewise for stddef.h, string.h.
12285 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12286 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12287 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12288 (STDC_HEADERS): Remove obsolete defines.
12289 * sysdep.c: Include limits.h unconditionally.
12290
9cfdb3ec
PE
12291 Assume support for memcmp, memcpy, memmove, memset.
12292 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12293 * regex.c (memcmp, memcpy):
12294 Remove; we assume C89 now.
12295
12296 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12297 (__malloc_safe_bcopy): Remove; no longer needed.
12298
cf950e6b 12299 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
12300 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12301 well either way, and we prefer signed to unsigned.
12302
dbf38e02
LMI
123032011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12304
12305 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12306 closes the connection while we're reading (bug#9182).
12307
d6f0886c 123082011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 12309
d6f0886c
JD
12310 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12311 are specified (Bug#9168).
24e0f6b1 12312
2eb1f9e6
PE
123132011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12314
12315 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12316 Found by GCC static checking and --with-wide-int on a 32-bit host.
12317
22381272 123182011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
12319
12320 * xdisp.c (compute_display_string_pos): Fix logic of caching
12321 previous display string position. Initialize cached_prev_pos to
12322 -1. Fixes slow-down at the beginning of a buffer.
12323
f25e39b4
EZ
123242011-07-24 Eli Zaretskii <eliz@gnu.org>
12325
12326 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12327 for attrs[LFACE_FONTSET_INDEX].
12328
04c4b52e
PE
123292011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12330
12331 * xml.c (parse_region): Remove unused local
12332 that was recently introduced.
12333
c1734fbd
EZ
123342011-07-23 Eli Zaretskii <eliz@gnu.org>
12335
be18c5a5
EZ
12336 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12337 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12338
c1734fbd
EZ
12339 * xdisp.c (move_it_in_display_line_to): Record the best matching
12340 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
12341 exit if none of the characters scanned was an exact match.
12342 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
12343 when exact match is impossible due to invisible text, and the
12344 lines are truncated.
12345
a258d627
JD
123462011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12347
12348 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12349 for OSX >= 10.7.
12350
b6d5a689
EZ
123512011-07-22 Eli Zaretskii <eliz@gnu.org>
12352
0f74f785
EZ
12353 Fix a significant slow-down of cursor motion with C-n, C-p,
12354 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12355 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 12356 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
12357 (next_element_from_buffer): Call compute_stop_pos_backwards to
12358 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
12359 base_level_stop.
12360 (reseat): Don't look for prev_stop, as that could mean a very long
12361 run.
12362 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12363 <cached_disp_overlay_modiff>: Cache for last found display string
12364 position.
551918c1 12365 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
12366 about the same buffer in the same area of character positions, and
12367 the buffer wasn't changed since the time the display string
12368 position was cached.
551918c1 12369
b2d0c91a
EZ
123702011-07-22 Eli Zaretskii <eliz@gnu.org>
12371
12372 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12373 is an integer, which is important for empty lines. (Bug#9149)
12374
043604ee
CY
123752011-07-22 Chong Yidong <cyd@stupidchicken.com>
12376
12377 * frame.c (Fmodify_frame_parameters): In tty case, update the
12378 default face if necessary (Bug#4238).
12379
da4adb04
CY
123802011-07-21 Chong Yidong <cyd@stupidchicken.com>
12381
12382 * editfns.c (Fstring_to_char): No need to explain what a character
12383 is in the docstring (Bug#6576).
12384
9abd0532
LMI
123852011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12386
12387 * xml.c (parse_region): Make sure we always return a tree.
12388
36881d16
HK
123892011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12390
12391 * xml.c (parse_region): If a document contains only comments,
12392 return that, too.
12393
1e98674d
LMI
123942011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12395
12396 * xml.c (make_dom): Return comments, too.
12397
590bd467
PE
123982011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12399
12400 Port to OpenBSD.
12401 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12402 and the surrounding thread.
12403 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12404 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12405 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12406 timer goes off.
12407 * s/openbsd.h (BROKEN_SIGIO): Define.
12408 * unexelf.c (unexec) [__OpenBSD__]:
12409 Don't update the .mdebug section of the Alpha COFF symbol table.
12410
f41628b2
LMI
124112011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12412
12413 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12414 (bug#8460).
12415
b59b67c5
PE
124162011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12417
15e3a074
PE
12418 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12419 This fixes some race conditions on the permissions of any newly
12420 created file.
12421
41bed37d
PE
12422 * alloc.c (valid_pointer_p): Use pipe, not open.
12423 This fixes some permissions issues when debugging.
12424
b59b67c5
PE
12425 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12426 If fchown fails to set both uid and gid, try to set just gid,
12427 as that is sometimes allowed. Adjust the file's mode to eliminate
12428 setuid or setgid bits that are inappropriate if fchown fails.
12429
925a6be7
SM
124302011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12431
12432 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12433 to compare Lisp_Objects.
12434 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12435 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12436 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12437
52968808
AS
124382011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12439
0a6a104b
AS
12440 * lread.c (read_integer): Unread even EOF character.
12441 (read1): Likewise. Properly record start position of symbol.
12442
52968808
AS
12443 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12444 symbol character follows.
12445
9e381cdd
PE
124462011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12447
12448 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12449 This works around a problem with the previous change to Fcopy_file.
12450 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12451 and without this change, GCC might complain about discarding
12452 fchown's return value.
12453
b5641435
JB
124542011-07-16 Juanma Barranquero <lekktu@gmail.com>
12455
12456 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12457
a8031457
PE
124582011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12459
12460 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12461
dd889327
LMI
124622011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12463
750c33f7
LMI
12464 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12465 it's used from the C level.
12466
dd889327
LMI
12467 * process.c: Use the same condition for POLL_FOR_INPUT in both
12468 keyboard.c and process.c (bug#1858).
12469
87e86684
LM
124702011-07-09 Lawrence Mitchell <wence@gmx.li>
12471
12472 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12473 (Fgnutls_boot): Use it.
12474
64348f40
AS
124752011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12476
12477 * doc.c (Fsubstitute_command_keys): Revert last change.
12478
1d698799
LMI
124792011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12480
f863868c
LMI
12481 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12482 quotes the next character, and doesn't affect other longer
12483 sequences (bug#8935).
12484
1d698799
LMI
12485 * lread.c (syms_of_lread): Clarify that is isn't only
12486 `eval-buffer' and `eval-defun' that's affected by
12487 `lexical-binding' (bug#8460).
12488
aa4b6df6
EZ
124892011-07-15 Eli Zaretskii <eliz@gnu.org>
12490
12491 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 12492 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 12493
5d856da6
PE
124942011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12495
ad6042bb
PE
12496 Fix minor problems found by static checking.
12497 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12498 (elsz): Now a signed constant, not a size_t var. We prefer signed
12499 types to unsigned, to avoid integer comparison confusion. Without
12500 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12501 "cannot optimize loop, the loop counter may overflow", a symptom
12502 of the confusion.
f00bbb22 12503 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
12504 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12505
6468f31c
LMI
125062011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12507
49080b10
LMI
12508 * search.c (Fre_search_backward): Mention `case-fold-search' in
12509 all the re_search_* functions (bug#8138).
12510
6468f31c
LMI
12511 * keyboard.c (Fopen_dribble_file): Document when the file is
12512 closed (bug#8056).
12513
c965adc5
EZ
125142011-07-14 Eli Zaretskii <eliz@gnu.org>
12515
df9733bf
EZ
12516 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12517 bidi_cache_idx.
12518
0bb23927
EZ
12519 Support bidi reordering of display and overlay strings.
12520 * xdisp.c (compute_display_string_pos)
12521 (compute_display_string_end): Accept additional argument STRING.
12522 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12523 (reseat_to_string): Initialize bidi_it->string.s and
12524 bidi_it->string.schars.
12525 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
12526 NULL (avoids a crash in bidi_paragraph_init).
12527 Initialize itb.string.lstring.
0bb23927
EZ
12528 (init_iterator): Call bidi_init_it only of a valid
12529 buffer position was specified. Initialize paragraph_embedding to
12530 L2R.
12531 (reseat_to_string): Initialize the bidi iterator.
12532 (display_string): If we need to ignore text properties of
12533 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12534 original value of -1 will not work with bidi.)
12535 (compute_display_string_pos): First arg is now struct
12536 `text_pos *'; all callers changed. Support display properties on
12537 Lisp strings.
12538 (compute_display_string_end): Support display properties on Lisp
12539 strings.
12540 (init_iterator, reseat_1, reseat_to_string): Initialize the
12541 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12542 when iterating on a string not from display properties).
640c8776
SM
12543 (compute_display_string_pos, compute_display_string_end):
12544 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
12545 arrow keys.
12546 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
12547 base_level_stop; instead, set base_level_stop to BEGV.
12548 Fixes crashes in vertical-motion.
0bb23927
EZ
12549 (next_element_from_buffer): Improve commentary for when
12550 the iterator is before prev_stop.
12551 (init_iterator): Initialize bidi_p from the default value of
12552 bidi-display-reordering, not from buffer-local value. Use the
12553 buffer-local value only if initializing for buffer iteration.
12554 (handle_invisible_prop): Support invisible properties on strings
12555 that are being bidi-reordered.
12556 (set_iterator_to_next): Support bidi reordering of C strings and
12557 Lisp strings.
12558 (next_element_from_string): Support bidi reordering of Lisp
12559 strings.
12560 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
12561 (display_string): Support display of R2L glyph rows.
12562 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
12563 (init_iterator): Don't initialize it->bidi_p for strings
12564 here.
12565 (reseat_to_string): Initialize it->bidi_p for strings here.
12566 (next_element_from_string, next_element_from_c_string)
12567 (next_element_from_buffer): Add xassert's for correspondence
12568 between IT's object being iterated and it->bidi_it.string
12569 structure.
12570 (face_before_or_after_it_pos): Support bidi iteration.
12571 (next_element_from_c_string): Handle the case of the first string
12572 character that is not the first one in the visual order.
12573 (get_visually_first_element): New function, refactored from common
12574 parts of next_element_from_buffer, next_element_from_string, and
12575 next_element_from_c_string.
12576 (tool_bar_lines_needed, redisplay_tool_bar)
12577 (display_menu_bar): Force left-to-right direction. Add a FIXME
12578 comment for making that be controlled by a user option.
12579 (push_it, pop_it): Save and restore the state of the
12580 bidi iterator. Save and restore the bidi_p flag.
12581 (pop_it): Iterate out of display property for string iteration as
12582 well.
12583 (iterate_out_of_display_property): Support iteration over strings.
12584 (handle_single_display_spec): Set up it->bidi_it for iteration
12585 over a display string, and call bidi_init_it.
12586 (handle_single_display_spec, next_overlay_string)
12587 (get_overlay_strings_1, push_display_prop): Set up the bidi
12588 iterator for displaying display or overlay strings.
12589 (forward_to_next_line_start): Don't use the shortcut if
12590 bidi-iterating.
12591 (back_to_previous_visible_line_start): If handle_display_prop
12592 pushed the iterator stack, restore the internal state of the bidi
12593 iterator by calling bidi_pop_it same number of times.
12594 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12595 and we are bidi-iterating, don't decrement the iterator position;
12596 instead, set the first_elt flag in the bidi iterator, to produce
12597 the same effect.
12598 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12599 (push_display_prop): xassert that we are iterating a buffer.
12600 (push_it, pop_it): Save and restore paragraph_embedding member.
12601 (handle_single_display_spec, next_overlay_string)
12602 (get_overlay_strings_1, reseat_1, reseat_to_string)
12603 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12604 correctly. Don't assume unibyte strings are not bidi-reordered.
12605 (compute_display_string_pos)
12606 (compute_display_string_end): Fix handling the case of C string.
12607 (push_it, pop_it): Save and restore from_disp_prop_p.
12608 (handle_single_display_spec, push_display_prop): Set the
12609 from_disp_prop_p flag.
12610 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12611 (pop_it): Call iterate_out_of_display_property only if we are
12612 popping after iteration over a string that came from a display
12613 property. Fix a typo in popping stretch info. Add an assertion
12614 for verifying that the iterator position is in sync with the bidi
12615 iterator.
12616 (handle_single_display_spec, get_overlay_strings_1)
12617 (push_display_prop): Fix initialization of paragraph direction for
12618 string when that of the parent object is not yet determined.
12619 (reseat_1): Call bidi_init_it to resync the bidi
12620 iterator with IT's position. (Bug#7616)
12621 (find_row_edges): If ROW->start.pos gives position
12622 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12623 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12624 Reset the from_disp_prop_p flag.
12625 (SAVE_IT, RESTORE_IT): New macros.
12626 (pos_visible_p, face_before_or_after_it_pos)
12627 (back_to_previous_visible_line_start)
12628 (move_it_in_display_line_to, move_it_in_display_line)
12629 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12630 (try_scrolling, redisplay_window, display_line): Use them when
12631 saving a temporary copy of the iterator and restoring it back.
12632 (back_to_previous_visible_line_start, reseat_1)
12633 (init_iterator): Empty the bidi cache "stack".
12634 (move_it_in_display_line_to): If iterator ended up at
12635 EOL, but we never saw any buffer positions smaller than
12636 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12637 motion in bidi-reordered lines.
12638 (move_it_in_display_line_to): Record prev_method and prev_pos
12639 immediately before the call to set_iterator_to_next. Fixes cursor
12640 motion in bidi-reordered lines with stretch glyphs and strings
12641 displayed in margins. (Bug#8133) (Bug#8867)
12642 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12643 TO_CHARPOS.
640c8776
SM
12644 (pos_visible_p): Support positions in bidi-reordered lines.
12645 Save and restore bidi cache.
0bb23927
EZ
12646
12647 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12648 (bidi_paragraph_info): Delete unused struct.
12649 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12650 (bidi_cache_start): New variable.
12651 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12652 to zero.
12653 (bidi_cache_fetch_state, bidi_cache_search)
12654 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12655 (bidi_cache_find, bidi_peek_at_next_level)
12656 (bidi_level_of_next_char, bidi_find_other_level_edge)
12657 (bidi_move_to_visually_next): Compare cache index with
12658 bidi_cache_start rather than with zero.
12659 (bidi_fetch_char): Accept new argument STRING; all callers
12660 changed. Support iteration over a string. Support strings with
12661 display properties. Support unibyte strings. Fix the type of
12662 `len' according to what STRING_CHAR_AND_LENGTH expects.
12663 (bidi_paragraph_init, bidi_resolve_explicit_1)
12664 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
12665 (bidi_level_of_next_char, bidi_move_to_visually_next):
12666 Support iteration over a string.
0bb23927
EZ
12667 (bidi_set_sor_type, bidi_resolve_explicit_1)
12668 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12669 can now be zero (for strings); special values 0 and -1 were
12670 changed to -1 and -2, respectively.
12671 (bidi_char_at_pos): New function.
12672 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12673 Call it instead of FETCH_MULTIBYTE_CHAR.
12674 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12675 initialized to valid values.
12676 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12677 values.
12678 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12679 the test for valid cached positions. Fix the logic for looking up
12680 the sentinel state in the cache. GCPRO the Lisp string we are
12681 iterating.
12682 (bidi_push_it, bidi_pop_it): New functions.
12683 (bidi_initialize): Initialize the bidi cache start stack pointer.
12684 (bidi_cache_ensure_space): New function, refactored from part of
12685 bidi_cache_iterator_state. Don't assume the required size is just
12686 one BIDI_CACHE_CHUNK away.
12687 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12688 (bidi_count_bytes, bidi_char_at_pos): New functions.
12689 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12690 always valid if bidi_cache_idx is valid.
12691 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12692 is valid if it's going to be used.
12693 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12694 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
12695 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12696 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
12697 (bidi_find_other_level_edge, bidi_cache_start_stack):
12698 All variables related to cache indices are now EMACS_INT.
c965adc5 12699
0bb23927
EZ
12700 * dispextern.h (struct bidi_string_data): New structure.
12701 (struct bidi_it): New member `string'. Make flag members be 1-bit
12702 fields, and put them last in the struct.
640c8776
SM
12703 (compute_display_string_pos, compute_display_string_end):
12704 Update prototypes.
0bb23927
EZ
12705 (bidi_push_it, bidi_pop_it): Add prototypes.
12706 (struct iterator_stack_entry): New members bidi_p,
12707 paragraph_embedding, and from_disp_prop_p.
12708 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
12709 (bidi_shelve_cache, bidi_unshelve_cache):
12710 Declare prototypes.
0bb23927
EZ
12711
12712 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12713 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12714 and vector-like objects.
12715
12716 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12717 cache around display iteration.
12718
12719 * window.c (Fwindow_end, window_scroll_pixel_based)
12720 (displayed_window_lines, Frecenter): Save and restore the bidi
12721 cache around display iteration.
12722
3bbd2265
LMI
127232011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12724
12725 * editfns.c (Fdelete_region): Clarify the use of the named
12726 parameters (bug#6788).
12727
adc47434
MR
127282011-07-14 Martin Rudalics <rudalics@gmx.at>
12729
12730 * indent.c (Fvertical_motion): Set and restore w->pointm when
12731 saving and restoring the window's buffer (Bug#9006).
12732
837c31f8
LMI
127332011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12734
12735 * editfns.c (Fstring_to_char): Clarify just what is returned
12736 (bug#6576). Text by Eli Zaretskii.
12737
ac389d0c
JB
127382011-07-13 Juanma Barranquero <lekktu@gmail.com>
12739
12740 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12741
0be0ce47
EZ
127422011-07-13 Eli Zaretskii <eliz@gnu.org>
12743
12744 * buffer.c (mmap_find): Fix a typo.
12745
cd18e7e3
JB
127462011-07-13 Johan Bockgård <bojohan@gnu.org>
12747
12748 Fix execution of x selection hooks.
12749 * xselect.c (Qx_lost_selection_functions)
12750 (Qx_sent_selection_functions): New vars.
12751 (syms_of_xselect): DEFSYM them.
12752 (x_handle_selection_request): Pass Qx_sent_selection_functions
12753 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12754 (x_handle_selection_clear,x_clear_frame_selections):
12755 Pass Qx_lost_selection_functions rather than
12756 Vx_lost_selection_functions to Frun_hook_with_args.
12757
47ea7f44
PE
127582011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12759
ac389d0c 12760 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
12761 The old code sometimes used this field without initializing it.
12762
47ea7f44
PE
12763 * alloc.c (gc_sweep): Don't read past end of array.
12764 In theory, the old code could also have corrupted Emacs internals,
12765 though it'd be very unlikely.
12766
bc985c87
AS
127672011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12768
12769 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 12770 argument. (Bug#4026)
bc985c87 12771
0cf34688
LMI
127722011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12773
b3dadd76
LMI
12774 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12775 key" (bug#4257).
12776
0cf34688
LMI
12777 * window.c (Fset_window_start): Doc fix (bug#4199).
12778 (Fset_window_hscroll): Ditto.
12779
270768cd
PE
127802011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12781
077e3dda 12782 Fix minor new problems caught by GCC 4.6.1.
270768cd 12783 * term.c (init_tty): Remove unused local.
490011a6 12784 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 12785 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 12786 not used otherwise.
270768cd 12787
b1f58454
CY
127882011-07-12 Chong Yidong <cyd@stupidchicken.com>
12789
12790 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12791
22b9578d
LMI
127922011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12793
6e70ab07
LMI
12794 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12795 are the mini-buffer and the echo area (bug#3320).
12796
22b9578d
LMI
12797 * term.c (init_tty): Remove support for supdup, c10 and perq
12798 terminals, which are no longer supported (bug#1482).
12799
8974cc9f
JB
128002011-07-10 Johan Bockgård <bojohan@gnu.org>
12801
12802 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12803
a560d974
JD
128042011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12805
12806 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12807 for non-popups (Bug#3642).
12808
1dae0f0a
AS
128092011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12810
268c2c36 12811 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 12812 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
12813 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12814 * cm.c (losecursor): Likewise.
1dae0f0a
AS
12815 * data.c (fmod): Likewise.
12816 * dispnew.c (swap_glyphs_in_rows): Likewise.
12817 * emacs.c (memory_warning_signal): Likewise.
12818 * floatfns.c (float_error): Likewise.
12819 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12820 (otf_open, font_otf_capability, generate_otf_features)
12821 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12822 Likewise.
12823 * image.c (pbm_read_file): Likewise.
12824 * indent.c (string_display_width): Likewise.
12825 * intervals.c (check_for_interval, search_for_interval)
12826 (inc_interval_count, count_intervals, root_interval)
12827 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12828 * lread.c (defalias): Likewise.
268c2c36 12829 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
12830 * regex.c (set_image_of_range_1, set_image_of_range)
12831 (regex_grow_registers): Likewise.
12832 * sysdep.c (strerror): Likewise.
12833 * termcap.c (valid_filename_p, tprint, main): Likewise.
12834 * tparam.c (main): Likewise.
12835 * unexhp9k800.c (run_time_remap, save_data_space)
12836 (update_file_ptrs, read_header, write_header, calculate_checksum)
12837 (copy_file, copy_rest, display_header): Likewise.
12838 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12839 Likewise.
12840 * xdisp.c (check_it): Likewise.
12841 * xfaces.c (register_color, unregister_color, unregister_colors):
12842 Likewise.
12843 * xfns.c (print_fontset_result): Likewise.
12844 * xrdb.c (member, fatal, main): Likewise.
12845
99033785
PE
128462011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12847
12848 Fix minor problems found by static checking (Bug#9031).
12849 * chartab.c (char_table_set_range, map_sub_char_table):
12850 Remove unused locals.
12851 (uniprop_table): Now static.
12852 * composite.c (_work_char): Remove unused static var.
12853
9cb2ac56
JB
128542011-07-09 Juanma Barranquero <lekktu@gmail.com>
12855
12856 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12857
f25661f0
JD
128582011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12859
12860 * gtkutil.c (qttip_cb): Remove code without function.
12861
8278c4fe
EZ
128622011-07-09 Eli Zaretskii <eliz@gnu.org>
12863
12864 * w32.c (pthread_sigmask): New stub.
12865
1692ae2d 128662011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 12867
8a6ebd58 12868 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
12869 sigprocmask is portable only for single-threaded applications, and
12870 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
12871 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12872 (LIBES): Use it.
12873 * callproc.c (Fcall_process):
12874 * process.c (create_process):
12875 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12876 Use pthread_sigmask, not sigprocmask.
123403e4 12877
1b854618
JD
128782011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12879
12880 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12881 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12882 wrong (Bug#8591).
12883
3fe4b549
JD
128842011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12885
0ce7e563
JD
12886 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12887 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12888 (xg_hide_tooltip): Fix comment.
12889
3fe4b549
JD
12890 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12891 in registerServicesMenuSendTypes.
12892 (validRequestorForSendType): Don't check ns_return_types.
12893
12894 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12895 ns_return_type.
12896
5df75e47
JR
128972011-07-08 Jason Rumney <jasonr@gnu.org>
12898
22610910
JR
12899 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12900 SH_SHOW for hidden windows (Bug#5482).
12901
5df75e47
JR
12902 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12903 frame struct members of non-existent frames (Bug#6284).
12904
699c10bd
JD
129052011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12906
4393663b
JD
12907 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12908 variable firstTime not needed on OSX >= 10.6.
12909 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12910 >= 10.5. Use setKnobProportion, setDoubleValue.
12911
12912 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12913 (MAC_OS_X_VERSION_10_5): Define if not defined.
12914 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12915 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12916 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12917
12918 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 12919 cString and lossyCString on OSX >= 10.4.
4393663b 12920
58179cce 12921 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
12922 sizeToFit on OSX >= 10.2.
12923
12924 * nsimage.m (allocInitFromFile): Don't use deprecated method
12925 bestRepresentationForDevice on OSX >= 10.6.
12926
12927 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12928 to avoid warning.
12929
12930 * emacs.c: Declare unexec_init_emacs_zone.
12931
a63e0781
JD
12932 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12933
699c10bd
JD
12934 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12935
12936 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12937 on svcsMenu (Bug#8842).
12938
12939 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12940 ns_return_types.
12941 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12942
12943 * nsterm.m (QUTF8_STRING): Declare.
12944 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12945 (validRequestorForSendType): Return type is (id).
12946 Change indexOfObjectIdenticalTo to indexOfObject.
12947 Check if we have local selection before returning self (Bug#8842).
12948 (writeSelectionToPasteboard): Put local selection into paste board
12949 if we have a local selection (Bug#8842).
12950 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12951
12952 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12953 (ns_get_local_selection): Declare.
12954
54e10184
LMI
129552011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12956
9888ff71
LMI
12957 * keymap.c (describe_map_tree): Don't insert a double newline at
12958 the end of the buffer (bug#1169) and return whether we inserted
12959 something.
12960
54e10184
LMI
12961 * callint.c (Fcall_interactively): Change "reading args" to
12962 "providing args" to try to clarify what it does (bug#1010).
12963
15fa4783
KH
129642011-07-07 Kenichi Handa <handa@m17n.org>
12965
12966 * composite.c (composition_compute_stop_pos): Ignore a static
12967 composition starting before CHARPOS (Bug#8915).
12968
12969 * xdisp.c (handle_composition_prop): Likewise.
12970
a8815b00
EZ
129712011-07-07 Eli Zaretskii <eliz@gnu.org>
12972
12973 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12974 (Bug#9015)
12975
ef7b981d 129762011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
12977
12978 * character.h (unicode_category_t): New enum type.
12979
12980 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12981 (Qchar_code_property_table): New variable.
12982 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12983 (UNIPROP_COMPRESSED_FORM_P): New macros.
12984 (char_table_ascii): Uncompress the compressed values.
12985 (sub_char_table_ref): New arg is_uniprop. Callers changed.
12986 Uncompress the compressed values.
ac389d0c 12987 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
12988 (char_table_ref_and_range): Uncompress the compressed values.
12989 (sub_char_table_set): New arg is_uniprop. Callers changed.
12990 Uncompress the compressed values.
12991 (sub_char_table_set_range): Args changed. Callers changed.
12992 (char_table_set_range): Adjuted for the above change.
12993 (map_sub_char_table): Delete args default_val and parent. Add arg
12994 top. Give decoded values to a Lisp function.
640c8776 12995 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
12996 values to a Lisp function. Gcpro more variables.
12997 (uniprop_table_uncompress)
12998 (uniprop_decode_value_run_length): New functions.
12999 (uniprop_decoder, uniprop_decoder_count): New variables.
13000 (uniprop_get_decoder, uniprop_encode_value_character)
13001 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13002 New functions.
13003 (uniprop_encoder, uniprop_encoder_count): New variables.
13004 (uniprop_get_encoder, uniprop_table)
13005 (Funicode_property_table_internal, Fget_unicode_property_internal)
13006 (Fput_unicode_property_internal): New functions.
13007 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13008 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 13009 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
13010 char-code-property-alist.
13011
640c8776 13012 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
13013 Vunicode_category_table.
13014
640c8776 13015 * font.c (font_range): Adjust for the change of
c805dec0
KH
13016 Vunicode_category_table.
13017
76b397fb
DN
130182011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13019
13020 * m/iris4d.h: Remove file, move contents ...
13021 * s/irix6-5.h: ... here.
13022
22b4128e
PE
130232011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13024
13025 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
13026 * alloc.c (mark_buffer):
13027 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13028 (clone_per_buffer_values): Don't assume that
22b4128e
PE
13029 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13030 This isn't true in general, and it's particularly not true
13031 if Emacs is configured with --with-wide-int.
13032 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13033 New macros, used in the buffer.c change.
13034
869795d6
JD
130352011-07-05 Jan Djärv <jan.h.d@swipnet.se>
13036
13037 * xsettings.c: Use both GConf and GSettings if both are available.
13038 (store_config_changed_event): Add comment.
13039 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13040 (store_tool_bar_style_changed): New functions.
5e617bc2 13041 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
13042 (struct xsettings): Move font inside HAVE_XFT.
13043 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 13044 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 13045 Move inside HAVE_XFT.
640c8776 13046 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
13047 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13048 also.
13049 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 13050 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 13051 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
13052 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13053 (parse_settings): Move check for font inside HAVE_XFT.
13054 (read_settings, apply_xft_settings): Add comment.
13055 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
13056 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
13057 call store_font_name_changed.
13058 (xft_settings_event): Add comment.
13059 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
13060 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
13061 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
13062 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
13063 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
13064 (xsettings_get_system_font, xsettings_get_system_normal_font):
13065 Add comment.
869795d6 13066
d8ed26bd
PE
130672011-07-05 Paul Eggert <eggert@cs.ucla.edu>
13068
13069 Random fixes. E.g., (random) never returned negative values.
13070 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
13071 subseconds part to the entropy, as that's a bit more random.
13072 Prefer signed to unsigned, since the signedness doesn't matter and
13073 in general we prefer signed. When given a limit, use a
13074 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
13075 latter isn't right if USE_2_TAGS_FOR_INTS.
13076 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
13077 not 0..VALMASK. Don't discard "excess" bits that random () returns.
13078
cabf1cac
SM
130792011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
13080
13081 * textprop.c (text_property_stickiness):
13082 Obey Vtext_property_default_nonsticky.
13083 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
13084 * w32fns.c (syms_of_w32fns):
13085 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
13086
6e9b2be9
PE
130872011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13088
13089 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
13090 This is more efficient than Ffile_directory_p and avoids a minor race.
13091
90186c68
LMI
130922011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
13093
7c301272
LMI
13094 * buffer.c (Foverlay_put): Say what the return value is
13095 (bug#7835).
13096
c4f2d8d4
LMI
13097 * fileio.c (barf_or_query_if_file_exists): Check first if the file
13098 is a directory before asking whether to use the file name
13099 (bug#7564).
ad637907
LMI
13100 (barf_or_query_if_file_exists): Make the "File is a directory"
13101 error be more correct.
c4f2d8d4 13102
90186c68
LMI
13103 * fns.c (Frequire): Remove the mention of the .gz files, since
13104 that's installation-specific, but keep the mention of
13105 `get-load-suffixes'.
13106
da64016e
PE
131072011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13108
13109 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
13110 Report string overflow if the output is too long.
13111
7d47b580
JB
131122011-07-04 Juanma Barranquero <lekktu@gmail.com>
13113
a555cb87
JB
13114 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
13115 (syms_of_gnutls): Remove duplicate DEFSYM for
13116 Qgnutls_bootprop_verify_hostname_error, an error for
13117 Qgnutls_bootprop_verify_error (which is no longer used).
13118
7d47b580
JB
13119 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13120 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
13121 Also (re)move comments that are misplaced or no longer relevant.
13122
1e49bfab
LMI
131232011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13124
13125 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13126
1485f4c0
CY
131272011-07-03 Chong Yidong <cyd@stupidchicken.com>
13128
13129 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13130 and background color parameters if they have been changed.
13131
a9ab721e
LMI
131322011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13133
13134 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13135
cf7cff57
PE
131362011-07-03 Paul Eggert <eggert@cs.ucla.edu>
13137
2e13213d
PE
13138 * xsettings.c (SYSTEM_FONT): Define only when used.
13139 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13140
cf7cff57
PE
13141 * keymap.c (access_keymap_1): Now static.
13142
7a8e04f7
CY
131432011-07-02 Chong Yidong <cyd@stupidchicken.com>
13144
13145 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13146 leave any prefix arg for the up event (Bug#1586).
13147
61352f62
LMI
131482011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
13149
69bb1ef7
LMI
13150 * lread.c (syms_of_lread): Mention single symbols defined by
13151 `defvar' or `defconst' (bug#7154).
13152
61352f62 13153 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 13154 (Frequire): Mention get-load-suffixes.
61352f62 13155
28545e04
MR
131562011-07-02 Martin Rudalics <rudalics@gmx.at>
13157
13158 * window.h (window): Remove clone_number slot.
13159 * window.c (Fwindow_clone_number, Fset_window_clone_number):
13160 Remove.
13161 (make_parent_window, make_window, saved_window)
13162 (Fset_window_configuration, save_window_save): Don't deal with
13163 clone numbers.
13164 * buffer.c (Qclone_number): Remove declaration.
13165 (sort_overlays, overlay_strings): Don't deal with clone numbers.
13166
3349e122
SM
131672011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
13168
13169 Add multiple inheritance to keymaps.
13170 * keymap.c (Fmake_composed_keymap): New function.
13171 (Fset_keymap_parent): Simplify.
13172 (fix_submap_inheritance): Remove.
13173 (access_keymap_1): New function extracted from access_keymap to handle
13174 embedded parents and handle lists of maps.
13175 (access_keymap): Use it.
13176 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13177 (Fcopy_keymap): Handle embedded parents.
13178 (Fcommand_remapping, define_as_prefix): Simplify.
13179 (Fkey_binding): Simplify.
13180 (syms_of_keymap): Move minibuffer-local-completion-map,
13181 minibuffer-local-filename-completion-map,
13182 minibuffer-local-must-match-map, and
13183 minibuffer-local-filename-must-match-map to Elisp.
13184 (syms_of_keymap): Defsubr make-composed-keymap.
13185 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13186 (parse_menu_item): Trivial simplification.
13187
3279eb87
GM
131882011-07-01 Glenn Morris <rgm@gnu.org>
13189
13190 * Makefile.in (SETTINGS_LIBS): Fix typo.
13191
39cb9e56 131922011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
13193
13194 * coding.c (Fencode_coding_string): Record the last coding system
13195 used, as the function doc string says (bug#8738).
13196
0949d2b6
JD
131972011-07-01 Jan Djärv <jan.h.d@swipnet.se>
13198
13199 * xsettings.c (store_monospaced_changed): Take new font as arg and
13200 check for change against current_mono_font.
13201 (EMACS_TYPE_SETTINGS): Remove this and related defines.
13202 (emacs_settings_constructor, emacs_settings_get_property)
13203 (emacs_settings_set_property, emacs_settings_class_init)
13204 (emacs_settings_init, gsettings_obj): Remove.
13205 (something_changedCB): New function for HAVE_GSETTINGS.
13206 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13207 with value as argument.
13208 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
13209 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 13210 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
13211 "changed".
13212
13213 * xgselect.c: Add defined (HAVE_GSETTINGS).
13214 (xgselect_initialize): Ditto.
13215
13216 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
13217 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
13218 xg_select.
13219
bbc6b304
PE
132202011-07-01 Paul Eggert <eggert@cs.ucla.edu>
13221
13222 * eval.c (struct backtrace): Simplify and port the data structure.
13223 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
13224 signed bit field, as this assumption is not portable and it makes
13225 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
13226 "char debug_on_exit : 1" as this is not portable either; instead,
13227 use the portable "unsigned int debug_on_exit : 1". Remove unused
13228 member evalargs. Remove obsolete comments about cc bombing out.
13229
9851bfc5
JD
132302011-06-30 Jan Djärv <jan.h.d@swipnet.se>
13231
51bb811f 13232 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
13233 Let HAVE_GSETTINGS override HAVE_GCONF.
13234 (store_monospaced_changed): New function.
13235 (EMACS_SETTINGS): A new type derived from GObject to handle
13236 GSettings notifications.
13237 (emacs_settings_constructor, emacs_settings_get_property)
13238 (emacs_settings_set_property, emacs_settings_class_init):
13239 New functions.
13240 (gsettings_client, gsettings_obj): New variables.
13241 (GSETTINGS_SCHEMA): New define.
13242 (something_changedCB): Call store_monospaced_changed.
13243 (init_gsettings): New function.
13244 (xsettings_initialize): Call init_gsettings.
13245 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13246 to NULL.
13247
640c8776 13248 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
13249 GCONF_CFLAGS/LIBS.
13250
5386012d
MR
132512011-06-29 Martin Rudalics <rudalics@gmx.at>
13252
13253 * window.c (resize_root_window, grow_mini_window)
13254 (shrink_mini_window): Rename Qresize_root_window to
13255 Qwindow_resize_root_window and Qresize_root_window_vertically to
13256 Qwindow_resize_root_window_vertically.
13257
f13e0b08
PE
132582011-06-28 Paul Eggert <eggert@cs.ucla.edu>
13259
13260 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13261
94515237
JB
132622011-06-27 Juanma Barranquero <lekktu@gmail.com>
13263
13264 * makefile.w32-in: Redesign dependencies so they reflect more
13265 clearly which files are directly included by each source file,
13266 and not through other includes.
13267
e43b6e43
MR
132682011-06-27 Martin Rudalics <rudalics@gmx.at>
13269
13270 * buffer.c (Qclone_number): Declare static and DEFSYM it.
13271 (sort_overlays, overlay_strings): When an overlay's clone number
13272 matches the window's clone number process the overlay even if
13273 the overlay's window property doesn't match the current window.
13274
d68443dc
MR
13275 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13276 (Fwindow_hchild): Rename to Fwindow_left_child.
13277 (Fwindow_next): Rename to Fwindow_next_sibling.
13278 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
13279 (resize_window_check): Rename to window_resize_check.
13280 (resize_window_apply): Rename to window_resize_apply.
13281 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13282 (Fdelete_other_windows_internal, resize_frame_windows)
13283 (Fsplit_window_internal, Fdelete_window_internal)
13284 (grow_mini_window, shrink_mini_window)
13285 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 13286
c7e73be5
JD
132872011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13288
13289 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13290 (emacs_fixed_set_min_size): Remove.
13291 (emacs_fixed_new): Take frame as argument.
13292
13293 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13294 (_EmacsFixedPrivate): Remove minwidth/height.
13295 Add struct frame *f.
13296 (emacs_fixed_init): Initialize priv->f.
13297 (get_parent_class, emacs_fixed_set_min_size): Remove.
13298 (emacs_fixed_new): Set priv->f to argument.
13299 (emacs_fixed_get_preferred_width)
13300 (emacs_fixed_get_preferred_height): Use min_width/height from
13301 frames size_hint to set minimum and natural (Bug#8919).
13302 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13303 and use min_width/height from frames size_hint to set
13304 min_width/height (Bug#8919).
13305
13306 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
13307 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13308 Fix indentation.
c7e73be5 13309
cf99dcf8
EZ
133102011-06-26 Eli Zaretskii <eliz@gnu.org>
13311
13312 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13313 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13314 called at ZV.
13315
029529ac
CY
133162011-06-26 Chong Yidong <cyd@stupidchicken.com>
13317
13318 * process.c (wait_reading_process_output): Bypass select if
13319 waiting for a cell while ignoring keyboard input, and input is
13320 pending. Suggested by Jan Djärv (Bug#8869).
13321
7a7ef429
PE
133222011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13323
13324 Use gnulib's dup2 module instead of rolling our own.
13325 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13326
11fdef7d 133272011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
13328
13329 * dispnew.c (scrolling_window): Before scrolling, turn off a
13330 mouse-highlight in the window being scrolled.
13331
cd3520a4
JB
133322011-06-24 Juanma Barranquero <lekktu@gmail.com>
13333
13334 Move DEFSYM to lisp.h and use everywhere.
13335
13336 * character.h (DEFSYM): Move declaration...
13337 * lisp.h (DEFSYM): ...here.
13338
13339 * gnutls.c:
13340 * minibuf.c:
13341 * w32menu.c:
13342 * w32proc.c:
13343 * w32select.c: Don't include character.h.
13344
13345 * alloc.c (syms_of_alloc):
13346 * buffer.c (syms_of_buffer):
13347 * bytecode.c (syms_of_bytecode):
13348 * callint.c (syms_of_callint):
13349 * casefiddle.c (syms_of_casefiddle):
13350 * casetab.c (init_casetab_once):
13351 * category.c (init_category_once, syms_of_category):
13352 * ccl.c (syms_of_ccl):
13353 * cmds.c (syms_of_cmds):
13354 * composite.c (syms_of_composite):
13355 * dbusbind.c (syms_of_dbusbind):
13356 * dired.c (syms_of_dired):
13357 * dispnew.c (syms_of_display):
13358 * doc.c (syms_of_doc):
13359 * editfns.c (syms_of_editfns):
13360 * emacs.c (syms_of_emacs):
13361 * eval.c (syms_of_eval):
13362 * fileio.c (syms_of_fileio):
13363 * fns.c (syms_of_fns):
13364 * frame.c (syms_of_frame):
13365 * fringe.c (syms_of_fringe):
13366 * insdel.c (syms_of_insdel):
13367 * keymap.c (syms_of_keymap):
13368 * lread.c (init_obarray, syms_of_lread):
13369 * macros.c (syms_of_macros):
13370 * msdos.c (syms_of_msdos):
13371 * print.c (syms_of_print):
13372 * process.c (syms_of_process):
13373 * search.c (syms_of_search):
13374 * sound.c (syms_of_sound):
13375 * syntax.c (init_syntax_once, syms_of_syntax):
13376 * terminal.c (syms_of_terminal):
13377 * textprop.c (syms_of_textprop):
13378 * undo.c (syms_of_undo):
13379 * w32.c (globals_of_w32):
13380 * window.c (syms_of_window):
13381 * xdisp.c (syms_of_xdisp):
13382 * xfaces.c (syms_of_xfaces):
13383 * xfns.c (syms_of_xfns):
13384 * xmenu.c (syms_of_xmenu):
13385 * xsettings.c (syms_of_xsettings):
13386 * xterm.c (syms_of_xterm): Use DEFSYM.
13387
4228cf16
TZ
133882011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13389
cd3520a4 13390 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 13391
7fcccf1e
PE
133922011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13393
7efb4e0e
PE
13394 Integer and buffer overflow fixes (Bug#8873).
13395
ff5844ad
PE
13396 * print.c (printchar, strout): Check for string overflow.
13397 (PRINTPREPARE, printchar, strout):
13398 Don't set size unless allocation succeeds.
13399
90532f02
PE
13400 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13401 for sizes. Check for string overflow more accurately.
13402 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13403
6d84508d
PE
13404 * macros.c: Integer and buffer overflow fixes.
13405 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13406 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13407 Use ptrdiff_t, not int, for sizes.
13408 Don't increment bufsize until after realloc succeeds.
13409 Check for size-calculation overflow.
13410 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13411
437b2cb4
PE
13412 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13413
8b9ac8b4
PE
13414 * lread.c: Integer overflow fixes.
13415 (read_integer): Radix is now EMACS_INT, not int,
13416 to improve quality of diagnostics for out-of-range radices.
13417 Calculate buffer size correctly for out-of-range radices.
13418 (read1): Check for integer overflow in radices, and in
13419 read-circle numbers.
82cb60d3
PE
13420 (read_escape): Avoid int overflow.
13421 (Fload, openp, read_buffer_size, read1)
13422 (substitute_object_recurse, read_vector, read_list, map_obarray):
13423 Use ptrdiff_t, not int, for sizes.
13424 (read1): Use EMACS_INT, not int, for sizes.
20270765 13425 Check for size overflow.
8b9ac8b4 13426
7fcccf1e
PE
13427 * image.c (cache_image): Check for size arithmetic overflow.
13428
bfbbd7e7
PE
13429 * lread.c: Integer overflow issues.
13430 (saved_doc_string_size, saved_doc_string_length)
13431 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13432 Now ptrdiff_t, not int.
13433 (read1): Don't assume doc string length fits in int. Check for
13434 out-of-range doc string lengths.
13435 (read_list): Don't assume file position fits in int.
39019e54 13436 (read_escape): Check for hex character overflow.
bfbbd7e7 13437
4e323265
LL
134382011-06-22 Leo Liu <sdl.web@gmail.com>
13439
13440 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13441 Move to minibuffer.el.
13442
85fece3e
PE
134432011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13444
20b84ce9 13445 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
13446 The following patches are for when GLYPH_DEBUG && !XASSERT.
13447 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13448 * dispnew.c (flush_stdout):
13449 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13450 Mark as externally visible.
13451 * dispnew.c (check_window_matrix_pointers): Now static.
13452 * dispnew.c (window_to_frame_vpos):
13453 * xfns.c (unwind_create_frame):
13454 * xterm.c (x_check_font): Remove unused local.
13455 * scroll.c (CHECK_BOUNDS):
13456 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13457 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13458 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13459 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13460 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13461 Now static.
13462 (debug_method_add): Use va_list and vsprintf rather than relying
13463 on undefined behavior with wrong number of arguments.
13464 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13465 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13466 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13467 since we're not interested in debugging glyphs with old libraries.
13468 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13469 GCC 4.6.0's static checking.
13470
0766b489
PE
134712011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13472
31fd4b32
PE
13473 Integer overflow and signedness fixes (Bug#8873).
13474 A few related buffer overrun fixes, too.
13475
b79e8648
PE
13476 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13477
0766b489
PE
13478 * dispextern.h (struct face.stipple):
13479 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13480 (x_bitmap_mask, x_allocate_bitmap_record)
13481 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13482 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13483 (x_create_bitmap_from_xpm_data):
13484 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13485 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13486 (.bitmaps_last):
13487 * xfaces.c (load_pixmap):
13488 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13489 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13490 (.bitmaps_last, struct x_output.icon_bitmap):
13491 Use ptrdiff_t, not int, for bitmap indexes.
13492 (x_allocate_bitmap_record): Check for size overflow.
13493 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13494
b081724f
PE
13495 Use ptrdiff_t, not int, for overlay counts.
13496 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13497 * editfns.c (overlays_around, get_pos_property):
13498 * textprop.c (get_char_property_and_overlay):
13499 * xdisp.c (next_overlay_change, note_mouse_highlight):
13500 * xfaces.c (face_at_buffer_position):
21514da7
PE
13501 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13502 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13503 (Fnext_overlay_change, Fprevious_overlay_change)
13504 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 13505 Use ptrdiff_t, not int, for sizes.
21514da7 13506 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 13507
3de73e5e
PE
13508 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13509
2606c57b
PE
13510 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13511 (x_session_initialize): Do not assume string length fits in int.
13512
aaafe47a
PE
13513 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13514 This is unlikely, but can occur if DPI is outlandish.
13515
2674ddc8 13516 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
13517 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13518
28154962
PE
13519 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13520 * xrdb.c (magic_file_p, search_magic_path):
13521 Omit last arg SUFFIX; it was always 0. All callers changed.
13522 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13523
7de51af5
PE
13524 * xfont.c (xfont_match): Avoid need for strlen.
13525
25ed6cc3
PE
13526 * xfns.c: Don't assume strlen fits in int.
13527 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13528
4eab31dd
PE
13529 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13530 not unsigned long, as we prefer signed integers. All callers changed.
13531 Detect integer overflow in repeat count.
13532 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 13533 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 13534
171e2a58
PE
13535 * termcap.c: Don't assume sizes fit in int and never overflow.
13536 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13537 (gobble_line): Check for size-calculation overflow.
13538
ad39faca 13539 * minibuf.c (Fread_buffer):
6e5bb2dc 13540 * lread.c (intern, intern_c_string):
74ca2eb3
PE
13541 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13542 Don't assume string length fits in int.
13543
52c61c22 13544 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
13545 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13546
b5b8c9e5
PE
13547 * font.c: Don't assume string length fits in int.
13548 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13549 Use ptrdiff_t, not int.
ccd6111c
PE
13550 (font_intern_prop): Don't assume string length fits in int.
13551 Don't assume integer property fits in fixnum.
13552 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 13553
882f0d81 13554 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 13555 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
13556 Reformulate so as not to need the command string.
13557 Invoke gzip -cd rather than gunzip, as it's more portable.
13558 (lock_info_type, lock_file_1, lock_file):
13559 Don't assume pid_t and time_t fit in unsigned long.
13560 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13561 (current_lock_owner): Prefer signed type for sizes.
13562 Use memcpy, not strncpy, where memcpy is what is really wanted.
13563 Don't assume (via atoi) that time_t and pid_t fit in int.
13564 Check for time_t and/or pid_t out of range, e.g., via a network share.
13565 Don't alloca where an auto var works fine.
13566
93f4cf88
PE
13567 * fileio.c: Fix some integer overflow issues.
13568 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13569 Don't assume string length fits in int.
13570 (directory_file_name): Don't assume string length fits in long.
13571 (make_temp_name): Don't assume pid fits in int, or that its print
13572 length is less than 20.
13573
f3e92b69
PE
13574 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13575
1bfdaf10
PE
13576 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13577
35016e9a
PE
13578 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13579
3d1e65a1
PE
13580 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13581 We prefer signed integers, even for size calculations.
13582
0b963a93
PE
13583 * emacs.c: Don't assume string length fits in 'int'.
13584 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13585 (main): Don't invoke strlen when not needed.
13586
573f4b54
PE
13587 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13588 (XD_DEBUG_MESSAGE): Don't waste a byte.
13589
989f33ba
PE
13590 * callproc.c (getenv_internal_1, getenv_internal)
13591 (Fgetenv_internal):
965d34eb
PE
13592 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13593
e4d29b33
PE
13594 * lread.c (invalid_syntax): Omit length argument.
13595 All uses changed. This doesn't fix a bug, but it simplifies the
13596 code away from its former Hollerith-constant appearance, and it's
13597 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 13598 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 13599
eb49b136
PE
13600 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13601 This didn't break anything, but it didn't help either.
13602 It's confusing to put a bogus integer in a place where the actual
13603 value does not matter.
9f62aeb1 13604 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 13605 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 13606
15375a22
PE
13607 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13608 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13609 implementation.
b61cc01c
PE
13610 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13611 We prefer signed types, and the value cannot exceed the EMACS_INT
13612 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
13613 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13614 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13615 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 13616
53b2623d
PE
13617 * indent.c (sane_tab_width): New function.
13618 (current_column, scan_for_column, Findent_to, position_indentation)
13619 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 13620 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 13621
51cab52b 13622 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 13623
f2ed8a70
PE
13624 * lisp.h (lint_assume): New macro.
13625 * composite.c (composition_gstring_put_cache):
13626 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13627
abe80cc6
PE
13628 * editfns.c, insdel.c:
13629 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 13630
b02c740e
PE
13631 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13632
ebc96716
PE
13633 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13634
b4e50fa0 13635 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 13636 Use much-faster test for byte-length change.
311d5d7c 13637 Don't assume string byte-length fits in 'int'.
a4cf38e4 13638 Check that character arg fits in 'int'.
85461888 13639 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 13640
c0c1ee9f
PE
13641 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13642
a498d7f4
PE
13643 * fns.c (concat): Catch string overflow earlier.
13644 Do not rely on integer wraparound.
13645
51cab52b
PE
13646 * dispextern.h (struct it.overlay_strings_charpos)
13647 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
13648 * xdisp.c (forward_to_next_line_start)
13649 (back_to_previous_visible_line_start)
13650 (reseat_at_next_visible_line_start, next_element_from_buffer):
13651 Don't arbitrarily truncate the value of 'selective' to int.
13652
76031fad
PE
13653 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13654
5eb55db9
PE
13655 * composite.c: Don't truncate sizes to 'int'.
13656 (composition_gstring_p, composition_reseat_it)
13657 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
13658 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13659 not EMACS_UINT, for indexes.
5eb55db9 13660
0703a717
PE
13661 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13662
d6202519
PE
13663 * buffer.c: Include <verify.h>.
13664 (struct sortvec.priority, struct sortstr.priority):
8961a454 13665 Now EMACS_INT, not int.
c20998a7 13666 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
13667 (struct sortstr.size, record_overlay_string)
13668 (struct sortstrlist.size, struct sortlist.used):
13669 Don't truncate size to int.
13670 (record_overlay_string): Check for size-calculation overflow.
d6202519 13671 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 13672
d5a19415
JM
136732011-06-22 Jim Meyering <meyering@redhat.com>
13674
029529ac 13675 Don't leak an XBM-image-sized buffer
d5a19415
JM
13676 * image.c (xbm_load): Free the image buffer after using it.
13677
a9041e6c
PE
136782011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13679
13680 Port to Sun C.
13681 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13682 that Sun C diagnosed.
13683 * fns.c (secure_hash): Fix pointer signedness issue.
13684 * intervals.c (static_offset_intervals): New function.
13685 (offset_intervals): Use it.
13686
7f3f739f
LL
136872011-06-21 Leo Liu <sdl.web@gmail.com>
13688
13689 * deps.mk (fns.o):
13690 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13691 sha512.h.
13692
13693 * fns.c (secure_hash): Rename from crypto_hash_function and change
13694 the first arg to accept symbols.
5b66d427 13695 (Fsecure_hash): New primitive.
7f3f739f
LL
13696 (syms_of_fns): New symbols.
13697
76147d94
DD
136982011-06-20 Deniz Dogan <deniz@dogan.se>
13699
13700 * process.c (Fset_process_buffer): Clarify return value in
13701 docstring.
13702
7d7d0045
CY
137032011-06-18 Chong Yidong <cyd@stupidchicken.com>
13704
13705 * dispnew.c (add_window_display_history): Use BVAR.
13706
13707 * xdisp.c (debug_method_add): Use BVAR.
13708 (check_window_end, dump_glyph_matrix, dump_glyph)
13709 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13710
13711 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13712 Likewise.
13713
13714 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13715 check till after the cache is created in init_frame_faces.
13716
ff2bc410
SM
137172011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13718
13719 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13720
28177add
PE
137212011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13722
dd3482fe
PE
13723 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13724 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13725 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13726
393d71f3 13727 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
13728 * fileio.c (Finsert_file_contents):
13729 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13730 Remove the old (too-loose) buffer overflow checks.
13731 They weren't needed, since make_gap checks for buffer overflow.
13732 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13733 The old code merely checked for Emacs fixnum overflow, and relied
13734 on undefined (wraparound) behavior. The new code avoids undefined
13735 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13736
2e6813b0 13737 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
13738 Tune. Don't use wider integers than needed. Don't use alloca.
13739 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 13740
599a9e4f
PE
13741 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13742
99561444
PE
13743 * insdel.c, lisp.h (buffer_overflow): New function.
13744 (insert_from_buffer_1, replace_range, replace_range_2):
13745 * insdel.c (make_gap_larger):
13746 * editfns.c (Finsert_char):
13747 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13748
28177add
PE
13749 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13750
e69dafad
PE
137512011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13752
4baa020d 13753 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 13754
b1c46f02
PE
13755 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13756 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13757
e69dafad
PE
13758 * fileio.c: Don't assume EMACS_INT fits in off_t.
13759 (emacs_lseek): New static function.
13760 (Finsert_file_contents, Fwrite_region): Use it.
13761 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13762
566684ea
PE
13763 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13764
e6966cd6
PE
13765 * fns.c: Don't overflow int when computing a list length.
13766 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13767 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13768 truncation on 64-bit hosts. Check for QUIT every
13769 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13770 faster and is responsive enough.
13771 (Flength): Report an error instead of overflowing an integer.
13772 (Fsafe_length): Return a float if the value is not representable
13773 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 13774 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 13775 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 13776
dd0b0efb
PE
13777 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13778 (header_size, word_size): New constants.
13779 (allocate_vectorlike): Don't check size overflow here.
13780 (allocate_vector): Check it here instead, since this is the only
13781 caller of allocate_vectorlike that could cause overflow.
13782 Check that the new vector's length is representable as a fixnum.
13783
86fe5cfe
PE
13784 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13785 The previous code was bogus. For example, next_almost_prime (32)
13786 returned 39, which is undesirable as it is a multiple of 3; and
13787 next_almost_prime (24) returned 25, which is a multiple of 5 so
13788 why was the code bothering to check for multiples of 7?
13789
80e88859
PE
13790 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13791
4a2f0ad6
PE
13792 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13793
f66c7cf8
PE
13794 Variadic C functions now count arguments with ptrdiff_t.
13795 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13796 Back then I didn't know that the Emacs coding style prefers signed int.
13797 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
13798 were being counted with int, which may truncate counts on 64-bit
13799 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
13800 * lisp.h (struct Lisp_Subr.function.aMANY)
13801 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13802 Arg counts are now ptrdiff_t, not size_t.
13803 All variadic functions and their callers changed accordingly.
13804 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13805 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13806 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13807 * callint.c (Fcall_interactively): Check arg count for overflow,
13808 to avoid potential buffer overrun. Use signed char, not 'int',
13809 for 'varies' array, so that we needn't bother to check its size
13810 calculation for overflow.
13811 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13812 * eval.c (apply_lambda):
13813 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13814 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13815 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13816
a1759b76
PE
13817 * callint.c (Fcall_interactively): Don't use index var as event count.
13818
d96be9fc
PE
13819 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13820 * mem-limits.h (SIZE): Remove; no longer used.
13821
a690a978 13822 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 13823
578c21e6
PE
13824 Remove unnecessary casts.
13825 * xterm.c (x_term_init):
13826 * xfns.c (x_set_border_pixel):
13827 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13828 These aren't needed now that we assume ANSI C.
13829
96f53c6c
PE
13830 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13831 It's more likely to cause problems (due to unsigned overflow)
13832 than to cure them.
13833
83c77d31
PE
13834 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13835
ee2079f1
PE
13836 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13837
6da65536
PE
13838 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13839
7147c4a4
PE
13840 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13841
193e32d9
PE
13842 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13843
e5533da6
PE
13844 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13845
9910e595
PE
13846 GLYPH_CODE_FACE returns EMACS_INT, not int.
13847 * dispextern.h (merge_faces):
13848 * xfaces.c (merge_faces):
01103c44
PE
13849 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13850 Don't assume EMACS_INT fits in int.
9910e595 13851
2638320e
PE
13852 * character.h (CHAR_VALID_P): Remove unused parameter.
13853 * fontset.c, lisp.h, xdisp.c: All uses changed.
13854
045eb8d9
PE
13855 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13856
c1f134b5
PE
13857 * fns.c (concat): Minor tuning based on overflow analysis.
13858 This doesn't fix any bugs. Use int to hold character, instead
13859 of constantly refetching from Emacs object. Use XFASTINT, not
13860 XINT, for value known to be a character. Don't bother comparing
13861 a single byte to 0400, as it's always less.
13862
395fcb93 13863 * floatfns.c (Fexpt):
327eeec8
PE
13864 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13865
abbd3d23
PE
13866 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13867 for characters.
13868
684a03ef
PE
13869 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13870
0fed43f3
PE
13871 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13872 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13873 incorrectly succeed when S was a string, because 4294967386 was
13874 truncated before it was used.
13875
8fd02eb7
PE
13876 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13877 Otherwise, an out-of-range integer could cause undefined behavior
13878 on a 64-bit host.
13879
f8c86b69
PE
13880 * composite.c: Use int, not EMACS_INT, for characters.
13881 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13882 EMACS_INT, for values that are known to be in character range.
13883 This doesn't fix any bugs but is the usual style inside Emacs and
13884 may generate better code on 32-bit machines.
13885
34206dd2
PE
13886 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13887 This is for reasons similar to the recent CHAR_STRING fix.
13888 * charset.c (Fencode_char): Check that character arg is actually
13889 a character. Pass an int to ENCODE_CHAR.
13890 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13891 wider than 'int', as a compile-time check to prevent future regressions
13892 in this area.
13893
c5958d4c 13894 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
13895
13896 Make sure a 64-bit char is never passed to CHAR_STRING.
13897 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13898 by silently ignoring the top 32 bits, allowing some values
13899 that were far too large to be valid characters.
13900 * character.h: Include <verify.h>.
13901 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13902 arguments are no wider than unsigned, as a compile-time check
13903 to prevent future regressions in this area.
13904 * data.c (Faset):
01103c44 13905 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
13906 (Fsubst_char_in_region):
13907 * fns.c (concat):
13908 * xdisp.c (decode_mode_spec_coding):
13909 Adjust to CHAR_STRING's new requirement.
13910 * editfns.c (Finsert_char, Fsubst_char_in_region):
13911 * fns.c (concat): Check that character args are actually
13912 characters. Without this test, these functions did the wrong
13913 thing with wildly out-of-range values on 64-bit hosts.
13914
d37ca623
PE
13915 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13916 These casts should not be needed on 32-bit hosts, either.
13917 * keyboard.c (read_char):
13918 * lread.c (Fload): Remove casts to unsigned.
13919
ea204efb
PE
13920 * lisp.h (UNSIGNED_CMP): New macro.
13921 This fixes comparison bugs on 64-bit hosts.
13922 (ASCII_CHAR_P): Use it.
13923 * casefiddle.c (casify_object):
01103c44 13924 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
13925 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13926 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13927 * dispextern.h (FACE_FROM_ID):
13928 * keyboard.c (read_char): Use UNSIGNED_CMP.
13929
41cb286c
PE
13930 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13931 not to EMACS_INT, to avoid GCC warning.
13932
4a1b9832
PE
13933 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13934
55daad71
PE
13935 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13936 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13937 isn't needed on 32-bit machines.
8f95c75c 13938
01103c44
PE
13939 * buffer.c (Fgenerate_new_buffer_name):
13940 Use EMACS_INT for count, not int.
0ceccced 13941 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
13942
13943 * data.c (Qcompiled_function): Now static.
13944
c6f072e7
PE
13945 * window.c (window_body_lines): Now static.
13946
20ce5912
PE
13947 * image.c (gif_load): Rename local to avoid shadowing.
13948
9c4c5f81
PE
13949 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13950 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13951 * alloc.c (make_save_value): Integer argument is now of type
13952 ptrdiff_t, not int.
13953 (mark_object): Use ptrdiff_t, not int.
13954 * lisp.h (pD): New macro.
13955 * print.c (print_object): Use it.
13956
c0c5c8ae
PE
13957 * alloc.c: Use EMACS_INT, not int, to count objects.
13958 (total_conses, total_markers, total_symbols, total_vector_size)
13959 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
13960 (total_free_floats, total_floats, total_free_intervals)
13961 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
13962 Now EMACS_INT, not int. All uses changed.
13963 (Fgarbage_collect): Compute overall total using a double, so that
13964 integer overflow is less likely to be a problem. Check for overflow
13965 when converting back to an integer.
5a25e253
PE
13966 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13967 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13968 These were 'int' variables that could overflow on 64-bit hosts;
13969 they were never used, so remove them instead of repairing them.
211a0b2a 13970 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
13971 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13972 Previously, this ceilinged at INT_MAX, but that doesn't work on
13973 64-bit machines.
e46bb31a 13974 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 13975
c78baabf 13976 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 13977 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
13978 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13979 when a (possibly-narrower) signed value would do just as well.
13980 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 13981
c9d624c6
PE
13982 * alloc.c: Catch some string size overflows that we were missing.
13983 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13984 for convenience in STRING_BYTES_MAX.
13985 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13986 The definition here is exact; the one in lisp.h was approximate.
13987 (allocate_string_data): Check for string overflow. This catches
13988 some instances we weren't catching before. Also, it catches
13989 size_t overflow on (unusual) hosts where SIZE_MAX <= min
13990 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13991 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 13992
c9d624c6
PE
13993 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13994 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 13995 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 13996
353032ce
PE
13997 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13998
2bccce07
PE
13999 * alloc.c (Fmake_string): Check for out-of-range init.
14000
0ac30604
SM
140012011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14002
14003 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14004
c195f2de
JD
140052011-06-14 Jan Djärv <jan.h.d@swipnet.se>
14006
14007 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14008 xg_get_default_scrollbar_width.
14009
14010 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14011 (int_gtk_range_get_value): Move to the scroll bar part of the file.
14012 (style_changed_cb): Call update_theme_scrollbar_width and call
14013 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14014 all frames (Bug#8505).
14015 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14016 Call gtk_window_set_resizable if HAVE_GTK3.
14017 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14018 and height if HAVE_GTK3 (Bug#8505).
14019 (scroll_bar_width_for_theme): New variable.
14020 (update_theme_scrollbar_width): New function.
14021 (xg_get_default_scrollbar_width): Move code to
14022 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14023 (xg_initialize): Call update_theme_scrollbar_width.
14024
14025 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14026
14027 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14028
e10ac9f1
MR
140292011-06-12 Martin Rudalics <rudalics@gmx.at>
14030
14031 * frame.c (make_frame): Call other_buffer_safely instead of
14032 other_buffer.
14033
14034 * window.c (temp_output_buffer_show): Call display_buffer with
14035 second argument Vtemp_buffer_show_specifiers and reset latter
14036 immediately after the call.
14037 (Vtemp_buffer_show_specifiers): New variable.
14038 (auto_window_vscroll_p, next_screen_context_lines)
14039 (Vscroll_preserve_screen_position): Remove leading asterisks from
14040 doc-strings.
14041
2d3c217e 140422011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 14043
7b7f97e8 14044 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
14045 * buffer.c (Qclone_number): Remove for now, as it's unused.
14046 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14047 (record_buffer): Remove unused local.
14048 * frame.c (other_visible_frames, frame_buffer_list): Now static.
14049 (set_frame_buffer_list): Remove; unused.
14050 * frame.h (other_visible_frames): Remove decl.
14051 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14052 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14053 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14054 if HAVE_GPM.
14055 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14056 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
14057 Define only if HAVE_GPM.
14058 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
14059 (update_hints_inhibit): Remove; never set. All uses removed.
14060 * widgetprv.h (emacsFrameClassRec): Remove decl.
14061 * window.c (delete_deletable_window): Now returns void, since it
14062 wasn't returning anything.
14063 (compare_window_configurations): Remove unused locals.
14064 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
14065 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
14066 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
14067 the same widths as pointers. This follows up on the 2011-05-06 patch.
14068 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
14069 * xterm.h: Likewise.
14070 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
14071
1384b89e
JB
140722011-06-12 Juanma Barranquero <lekktu@gmail.com>
14073
14074 * makefile.w32-in: Update dependencies.
14075 (LISP_H): Add lib/intprops.h.
14076
1100a63c
CY
140772011-06-11 Chong Yidong <cyd@stupidchicken.com>
14078
14079 * image.c (gif_load): Add animation frame delay to the metadata.
14080 (syms_of_image): Use DEFSYM. New symbol `delay'.
14081
6198ccd0
MR
140822011-06-11 Martin Rudalics <rudalics@gmx.at>
14083
14084 * window.c (delete_deletable_window): Re-add.
14085 (Fset_window_configuration): Rewrite to handle dead buffers and
14086 consequently deletable windows.
14087 (window_tree, Fwindow_tree): Remove. Supply functionality in
14088 window.el.
14089 (compare_window_configurations): Simplify code.
14090
b6e3633c
AS
140912011-06-11 Andreas Schwab <schwab@linux-m68k.org>
14092
1ab0dee5
AS
14093 * image.c (imagemagick_load_image): Fix type mismatch.
14094 (Fimagemagick_types): Likewise.
14095
b6e3633c
AS
14096 * window.h (replace_buffer_in_windows): Declare.
14097
9397e56f
MR
140982011-06-11 Martin Rudalics <rudalics@gmx.at>
14099
14100 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
14101 Qclone_number. Remove external declaration of Qdelete_window.
14102 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
14103 code.
640c8776
SM
14104 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
14105 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
14106 (Fother_buffer): Rewrite doc-string. Major rewrite for new
14107 buffer list implementation.
14108 (other_buffer_safely): New function.
14109 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
14110 calls to replace_buffer_in_windows and
14111 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
14112 if allowed.
14113 (record_buffer): Inhibit quitting and rewrite using quittable
14114 functions. Run Qbuffer_list_update_hook if allowed.
14115 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
14116 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
14117 Move switch-to-buffer to window.el.
9397e56f
MR
14118 (bury-buffer): Move to window.el.
14119 (Vbuffer_list_update_hook): New variable.
14120
14121 * lisp.h (other_buffer_safely): Add prototype in buffer.c
14122 section.
14123
14124 * window.h (resize_frame_windows): Move up in code.
14125 (Fwindow_frame): Remove EXFUN.
14126 (replace_buffer_in_all_windows): Remove prototype.
14127 (replace_buffer_in_windows_safely): Add prototype.
14128
14129 * window.c: Declare Qdelete_window static again. Move down
14130 declaration of select_count.
14131 (Fnext_window, Fprevious_window): Rewrite doc-strings.
14132 (Fother_window): Move to window.el.
14133 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14134 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14135 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14136 window.el.
14137 (replace_buffer_in_windows): Implement by calling
14138 Qreplace_buffer_in_windows.
14139 (replace_buffer_in_all_windows): Remove with some functionality
14140 moved into replace_buffer_in_windows_safely.
14141 (replace_buffer_in_windows_safely): New function.
14142 (select_window_norecord, select_frame_norecord): Move in front
14143 of run_window_configuration_change_hook. Remove now obsolete
14144 declarations.
640c8776
SM
14145 (Fset_window_buffer): Rewrite doc-string.
14146 Call Qrecord_window_buffer.
9397e56f
MR
14147 (keys_of_window): Move binding for other-window to window.el.
14148
b50691aa
CY
141492011-06-11 Chong Yidong <cyd@stupidchicken.com>
14150
14151 * dispextern.h (struct image): Replace data member, whose int_val
14152 and ptr_val fields were not used by anything, with a single
14153 lisp_val object.
14154
14155 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14156 (gif_clear_image, gif_load, imagemagick_load_image)
14157 (gs_clear_image, gs_load): Callers changed.
14158
3f754b86
PE
141592011-06-10 Paul Eggert <eggert@cs.ucla.edu>
14160
cca69397
PE
14161 * buffer.h: Include <time.h>, for time_t.
14162 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
14163
109e28d0
PE
14164 Fix minor problems found by static checking.
14165
60737f02
PE
14166 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14167
4b66faf3
PE
14168 Make identifiers static if they are not used in other modules.
14169 * data.c (Qcompiled_function, Qframe, Qvector):
14170 * image.c (QimageMagick, Qsvg):
14171 * minibuf.c (Qmetadata):
14172 * window.c (resize_window_check, resize_root_window): Now static.
14173 * window.h (resize_window_check, resize_root_window): Remove decls.
14174
109e28d0
PE
14175 * window.c (window_deletion_count, delete_deletable_window):
14176 Remove; unused.
46a4ce9e
PE
14177 (window_body_lines): Now static.
14178 (Fdelete_other_windows_internal): Mark vars as initialized.
14179 Make sure 'resize_failed' is initialized.
14180 (run_window_configuration_change_hook): Rename local to avoid shadowing.
14181 (resize_window_apply): Remove unused local.
14182 * window.h (delete_deletable_window): Remove decl.
14183
109e28d0 14184 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
14185 (imagemagick_load_image): Fix pointer signedness problem by changing
14186 last arg from unsigned char * to char *. All uses changed.
14187 Also, fix a local for similar reasons.
14188 Remove unused locals. Remove locals to avoid shadowing.
14189 (fn_rsvg_handle_free): Remove; unused.
14190 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 14191 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 14192
3f754b86
PE
14193 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14194
2547adb1
CY
141952011-06-10 Chong Yidong <cyd@stupidchicken.com>
14196
14197 * image.c (gif_load): Fix omitted cast error introduced by
14198 2011-06-06 change.
14199
2c8e37d4
MR
142002011-06-10 Martin Rudalics <rudalics@gmx.at>
14201
14202 * window.h (resize_proportionally, orig_total_lines)
14203 (orig_top_line): Remove from window structure.
14204 (set_window_height, set_window_width, change_window_heights)
14205 (Fdelete_window): Remove prototypes.
14206 (resize_frame_windows): Remove duplicate declaration.
14207
440a42e3
EZ
142082011-06-10 Eli Zaretskii <eliz@gnu.org>
14209
14210 * window.h (resize_frame_windows, resize_window_check)
14211 (delete_deletable_window, resize_root_window)
14212 (resize_frame_windows): Declare prototypes.
14213
14214 * window.c (resize_window_apply): Make definition be "static" to
14215 match the prototype.
14216
562dd5e9
MR
142172011-06-10 Martin Rudalics <rudalics@gmx.at>
14218
14219 * window.c: Remove declarations of Qwindow_size_fixed,
14220 window_min_size_1, window_min_size_2, window_min_size,
14221 size_window, window_fixed_size_p, enlarge_window, delete_window.
14222 Remove static from declaration of Qdelete_window, it's
14223 temporarily needed by Fbury_buffer.
14224 (replace_window): Don't assign orig_top_line and
14225 orig_total_lines.
14226 (Fdelete_window, delete_window): Remove. Window deletion is
14227 handled by window.el.
640c8776
SM
14228 (window_loop): Remove DELETE_OTHER_WINDOWS case.
14229 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
14230 (Fdelete_other_windows): Remove. Deleting other windows is
14231 handled by window.el.
14232 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
14233 handled in window.el.
14234 (window_min_size_2, window_min_size_1, window_min_size): Remove.
14235 Window minimum sizes are handled in window.el.
14236 (shrink_windows, size_window, set_window_height)
14237 (set_window_width, change_window_heights, window_height)
14238 (window_width, CURBEG, CURSIZE, enlarge_window)
14239 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
14240 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
14241 handled in window.el.
14242 (make_dummy_parent): Rename to make_parent_window and give it a
14243 second argument horflag.
14244 (make_window): Don't set resize_proportionally any more.
14245 (Fsplit_window): Remove. Windows are split in window.el.
14246 (save_restore_action, save_restore_orig_size)
14247 (shrink_window_lowest_first, save_restore_orig_size): Remove.
14248 Resize mini windows in window.el.
14249 (grow_mini_window, shrink_mini_window): Implement by calling
14250 Qresize_root_window_vertically, resize_window_check and
14251 resize_window_apply.
640c8776
SM
14252 (saved_window, Fset_window_configuration, save_window_save):
14253 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
14254 resize_proportionally.
14255 (window_min_height, window_min_width): Move to window.el.
14256 (keys_of_window): Move bindings for delete-other-windows,
14257 split-window, delete-window and enlarge-window to window.el.
14258
14259 * buffer.c: Temporarily extern Qdelete_window.
14260 (Fbury_buffer): Temporarily call Qdelete_window instead of
14261 Fdelete_window (Fbury_buffer will move to window.el soon).
14262
14263 * frame.c (set_menu_bar_lines_1): Remove code handling
14264 orig_top_line and orig_total_lines.
14265
14266 * dispnew.c (adjust_frame_glyphs_initially): Don't use
14267 set_window_height but set heights directly.
14268 (change_frame_size_1): Use resize_frame_windows.
14269
14270 * xdisp.c (init_xdisp): Don't use set_window_height but set
14271 heights directly.
14272
640c8776
SM
14273 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14274 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
14275 run_window_configuration_change_hook.
14276
14277 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14278 instead of change_window_heights and run
14279 run_window_configuration_change_hook.
14280
1a13852e
MR
142812011-06-09 Martin Rudalics <rudalics@gmx.at>
14282
14283 * window.c (replace_window): Rename second argument REPLACEMENT to
14284 NEW. New third argument SETFLAG. Rewrite.
14285 (delete_window, make_dummy_parent): Call replace_window with
14286 third argument 1.
14287 (window_list_1): Move down in code.
14288 (run_window_configuration_change_hook): Move set_buffer part
14289 before select_frame_norecord part in order to unwind correctly.
14290 Rename count1 to count.
14291 (recombine_windows, delete_deletable_window, resize_root_window)
14292 (Fdelete_other_windows_internal)
14293 (Frun_window_configuration_change_hook, make_parent_window)
14294 (resize_window_check, resize_window_apply, Fresize_window_apply)
14295 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
14296 (Fdelete_window_internal, Fresize_mini_window_internal):
14297 New functions.
1a13852e
MR
14298 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14299
f3d1777e
MR
143002011-06-08 Martin Rudalics <rudalics@gmx.at>
14301
496e208e
MR
14302 * window.h (window): Add some new members to window structure -
14303 normal_lines, normal_cols, new_total, new_normal, clone_number,
14304 splits, nest, prev_buffers, next_buffers.
14305 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 14306 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 14307
f3d1777e
MR
14308 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14309 Remove.
496e208e
MR
14310 (make_dummy_parent): Set new members of windows structure.
14311 (make_window): Move down in code. Handle new members of window
14312 structure.
14313 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14314 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14315 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14316 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
14317 (Fset_window_next_buffers, Fset_window_clone_number):
14318 New functions.
496e208e
MR
14319 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14320 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14321 Doc-string fixes.
14322 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14323 Argument WINDOW can be now internal window too.
14324 (Fwindow_use_time): Move up in code.
14325 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14326 Rewrite doc-string.
14327 (Fset_window_configuration, saved_window)
14328 (Fcurrent_window_configuration, save_window_save): Handle new
14329 members of window structure.
b9e809c2
MR
14330 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14331 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14332 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14333 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14334 Qget_mru_window, Qresize_root_window,
14335 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14336 Qauto_buffer_name; staticpro them.
f3d1777e 14337
abde8f8c
MR
143382011-06-07 Martin Rudalics <rudalics@gmx.at>
14339
14340 * window.c (Fwindow_total_size, Fwindow_left_column)
14341 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14342 (Fwindow_list_1): New functions.
14343 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
14344 (Fwindow_width, Fscroll_left, Fscroll_right):
14345 Use window_body_cols instead of window_box_text_cols.
14346 (delete_window, Fset_window_configuration):
14347 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
14348 (delete_all_subwindows): Take a window as argument and not a
14349 structure. Rewrite.
190b47e6
MR
14350 (window_loop): Remove handling of GET_LRU_WINDOW and
14351 GET_LARGEST_WINDOW.
14352 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
14353
14354 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
14355 window_box_text_cols. delete_all_subwindows now takes a
14356 Lisp_Object as argument.
abde8f8c 14357
640c8776
SM
14358 * indent.c (compute_motion, Fcompute_motion):
14359 Use window_body_cols instead of window_box_text_cols.
abde8f8c 14360
fa8a67e6
MR
14361 * frame.c (delete_frame): Call delete_all_subwindows with root
14362 window as argument.
14363
a54e3482
DC
143642011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14365
14366 * fns.c (Fputhash): Document return value.
14367
60002bf5
CY
143682011-06-06 Chong Yidong <cyd@stupidchicken.com>
14369
14370 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14371
0c671da6 143722011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 14373
b862a52a 14374 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 14375
be44ca6c
PE
14376 Check for overflow when converting integer to cons and back.
14377 * charset.c (Fdefine_charset_internal, Fdecode_char):
14378 Use cons_to_unsigned to catch overflow.
14379 (Fencode_char): Use INTEGER_TO_CONS.
14380 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14381 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14382 * data.c (long_to_cons, cons_to_long): Remove.
14383 (cons_to_unsigned, cons_to_signed): New functions.
14384 These signal an error for invalid or out-of-range values.
14385 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14386 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14387 * font.c (Ffont_variation_glyphs):
14388 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14389 * lisp.h: Include <intprops.h>.
14390 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14391 (cons_to_signed, cons_to_unsigned): New decls.
14392 (long_to_cons, cons_to_long): Remove decls.
14393 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14394 (Fprimitive_undo): Use CONS_TO_INTEGER.
14395 * xfns.c (Fx_window_property): Likewise.
14396 * xselect.c: Include <limits.h>.
14397 (x_own_selection, selection_data_to_lisp_data):
14398 Use INTEGER_TO_CONS.
14399 (x_handle_selection_request, x_handle_selection_clear)
14400 (x_get_foreign_selection, Fx_disown_selection_internal)
14401 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14402 (lisp_data_to_selection_data): Use cons_to_unsigned.
14403 (x_fill_property_data): Use cons_to_signed.
14404 Report values out of range.
14405
d1f3d2af
PE
14406 Check for buffer and string overflow more precisely.
14407 * buffer.h (BUF_BYTES_MAX): New macro.
14408 * lisp.h (STRING_BYTES_MAX): New macro.
14409 * alloc.c (Fmake_string):
14410 * character.c (string_escape_byte8):
14411 * coding.c (coding_alloc_by_realloc):
14412 * doprnt.c (doprnt):
14413 * editfns.c (Fformat):
14414 * eval.c (verror):
14415 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14416 since they may not be the same number.
14417 * editfns.c (Finsert_char):
14418 * fileio.c (Finsert_file_contents):
14419 Likewise for BUF_BYTES_MAX.
14420
dd52fcea
PE
14421 * image.c: Use ptrdiff_t, not int, for sizes.
14422 (slurp_file): Switch from int to ptrdiff_t.
14423 All uses changed.
14424 (slurp_file): Check that file size fits in both size_t (for
14425 malloc) and ptrdiff_t (for sanity and safety).
14426
7f9bbdbb
PE
14427 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14428 if b->modtime has its maximal value.
14429
dfe18f82
PE
14430 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14431
84acfcf0
PE
14432 Don't assume time_t can fit into int.
14433 * buffer.h (struct buffer.modtime): Now time_t, not int.
14434 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14435 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14436
ccd9a01a
PE
14437 Minor fixes for signed vs unsigned integers.
14438 * character.h (MAYBE_UNIFY_CHAR):
14439 * charset.c (maybe_unify_char):
14440 * keyboard.c (read_char, reorder_modifiers):
14441 XINT -> XFASTINT, since the integer must be nonnegative.
14442 * ftfont.c (ftfont_spec_pattern):
14443 * keymap.c (access_keymap, silly_event_symbol_error):
14444 XUINT -> XFASTINT, since the integer must be nonnegative.
14445 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14446 since it makes no difference and we prefer signed.
14447 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14448 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14449 nonnegative.
14450
d6d100dd
SM
144512011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14452
14453 * window.h (Fwindow_frame): Declare.
14454
2b6148e4
PE
144552011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14456
14457 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14458 (SPARE_MEMORY): Always define.
14459 (LARGE_REQUEST): Remove.
14460 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14461
f230ecc9
MR
144622011-06-06 Martin Rudalics <rudalics@gmx.at>
14463
727e958e
MR
14464 * lisp.h: Move EXFUNS for Fframe_root_window,
14465 Fframe_first_window and Fset_frame_selected_window to window.h.
14466
14467 * window.h: Move EXFUNS for Fframe_root_window,
14468 Fframe_first_window and Fset_frame_selected_window here from
14469 lisp.h.
14470
14471 * frame.c (Fwindow_frame, Fframe_first_window)
14472 (Fframe_root_window, Fframe_selected_window)
14473 (Fset_frame_selected_window): Move to window.c.
14474 (Factive_minibuffer_window): Move to minibuf.c.
14475 (Fother_visible_frames_p): New function.
14476
14477 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14478
f230ecc9
MR
14479 * window.c (decode_window, decode_any_window): Move up in code.
14480 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14481 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
14482 (Fwindow_buffer): Move up and rewrite doc-string.
14483 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14484 (Fwindow_prev): New functions.
727e958e
MR
14485 (Fwindow_frame): Move here from frame.c. Accept any window as
14486 argument.
14487 (Fframe_root_window, Fframe_first_window)
14488 (Fframe_selected_window): Move here from frame.c. Accept frame
14489 or arbitrary window as argument. Update doc-strings.
14490 (Fminibuffer_window): Move up in code.
14491 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
14492 (Fset_frame_selected_window): Move here from frame.c.
14493 Marginal rewrite.
727e958e
MR
14494 (Fselected_window, select_window, Fselect_window): Move up in
14495 code. Minor doc-string fixes.
f230ecc9 14496
4d09bcf6
PE
144972011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14498
14499 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14500 Do not assume that spare memory exists; that assumption is valid
14501 only if SYSTEM_MALLOC.
14502 (LARGE_REQUEST): New macro, so that the issue of large requests
14503 is separated from the issue of spare memory.
14504
810928a2
AS
145052011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14506
172418ad
AS
14507 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14508 format. (Bug#8806)
14509
43f862f7
AS
14510 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14511
810928a2
AS
14512 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14513 before statements.
14514
a059fe24
JD
145152011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14516
14517 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14518
14519 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14520
14521 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14522 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14523
989bf368
JB
145242011-06-05 Juanma Barranquero <lekktu@gmail.com>
14525
14526 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14527
4b80f674
CY
145282011-06-04 Chong Yidong <cyd@stupidchicken.com>
14529
14530 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14531 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
14532 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14533 New error handlers.
4b80f674
CY
14534 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14535 Obey Vx_select_enable_clipboard_manager. Catch errors in
14536 x_clipboard_manager_save (Bug#8779).
14537 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 14538 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 14539
99a33b77 145402011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
14541
14542 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14543
99a33b77 145442011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
14545
14546 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14547 in the current matrix if keep_current_p is non-zero.
14548
8264569d
EZ
145492011-06-04 Eli Zaretskii <eliz@gnu.org>
14550
14551 * bidi.c (bidi_level_of_next_char): Fix last change.
14552
57f97249
EZ
145532011-06-03 Eli Zaretskii <eliz@gnu.org>
14554
fec2107c 14555 Support bidi reordering of text covered by display properties.
57f97249 14556
fec2107c
EZ
14557 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14558 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14559 (bidi_cache_search, bidi_cache_iterator_state)
14560 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
14561 (bidi_level_of_next_char, bidi_move_to_visually_next):
14562 Support character positions inside a run of characters covered by a
fec2107c
EZ
14563 display string.
14564 (bidi_paragraph_init, bidi_resolve_explicit_1)
14565 (bidi_level_of_next_char): Call bidi_fetch_char and
14566 bidi_fetch_char_advance instead of FETCH_CHAR and
14567 FETCH_CHAR_ADVANCE.
14568 (bidi_init_it): Initialize new members.
14569 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14570 definitions.
14571 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14572 instead of using explicit *_CHAR codes.
d6d100dd
SM
14573 (bidi_resolve_explicit, bidi_resolve_weak):
14574 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
14575 bidirectional text is supported only in multibyte buffers.
14576 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14577 it to initialize the frame_window_p member of struct bidi_it.
14578 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14579 (bidi_resolve_explicit, bidi_resolve_weak)
14580 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14581 bidi_it->nchars is non-positive.
14582 (bidi_level_of_next_char): Don't try to lookup the cache for the
14583 next/previous character if nothing is cached there yet, or if we
14584 were just reseat()'ed to a new position.
c40e2fb2 14585
0e14fe90
EZ
14586 * xdisp.c (set_cursor_from_row): Set start and stop points
14587 according to the row's direction when priming the loop that looks
14588 for the glyph on which to display cursor.
14589 (single_display_spec_intangible_p): Function deleted.
14590 (display_prop_intangible_p): Reimplement to call
14591 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
14592 Accept 3 additional arguments needed by handle_display_spec.
14593 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
14594 values: lists, `(when COND...)' forms, etc.
14595 (single_display_spec_string_p): Support property values that are
14596 lists with the argument STRING its top-level element.
14597 (display_prop_string_p): Fix the condition for processing a
14598 property that is a list to be consistent with handle_display_spec.
fec2107c 14599 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
14600 last portion of handle_display_prop.
14601 (compute_display_string_pos): Accept additional argument
14602 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14603 value of a `display' property is a "replacing spec".
14604 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14605 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14606 the display property, but just return a value indicating whether
14607 the display property will replace the characters it covers.
14608 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14609 frame_window_p members of struct bidi_it.
d6d100dd
SM
14610 (compute_display_string_pos, compute_display_string_end):
14611 New functions.
fec2107c
EZ
14612 (push_it): Accept second argument POSITION, where pop_it should
14613 jump to continue iteration.
14614 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 14615
fec2107c
EZ
14616 * keyboard.c (adjust_point_for_property): Adjust the call to
14617 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
14618
14619 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
14620 (bidi_init_it): Update prototypes.
14621 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
14622 (compute_display_string_pos, compute_display_string_end):
14623 Declare prototypes.
fec2107c
EZ
14624 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14625 EMACS_INT.
fc6f18ce 14626
40087514 146272011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 14628
57f53182
PE
14629 Malloc failure behavior now depends on size of allocation.
14630 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14631 * lisp.h: Change signatures accordingly.
14632 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14633 All callers changed. (Bug#8762)
14634
14635 * gnutls.c: Use Emacs's memory allocators.
14636 Without this change, the gnutls library would invoke malloc etc.
14637 directly, which causes problems on non-SYNC_INPUT hosts, and which
14638 runs afoul of improving memory_full behavior. (Bug#8761)
14639 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14640 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14641 xfree instead of the default malloc, realloc, free.
14642 (Fgnutls_boot): No need to check for memory allocation failure,
14643 since xmalloc does that for us.
14644
ac32cd99 14645 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
14646 * category.c (hash_get_category_set):
14647 * ccl.c (ccl_driver):
14648 * charset.c (Fdefine_charset_internal):
14649 * charset.h (struct charset.hash_index):
14650 * composite.c (get_composition_id, gstring_lookup_cache)
14651 (composition_gstring_put_cache):
14652 * composite.h (struct composition.hash_index):
14653 * dispextern.h (struct image.hash):
14654 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14655 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14656 (hashfn_equal, hashfn_user_defined, make_hash_table)
14657 (maybe_resize_hash_table, hash_lookup, hash_put)
14658 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14659 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14660 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14661 * image.c (make_image, search_image_cache, lookup_image)
14662 (xpm_put_color_table_h):
14663 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 14664 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 14665 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 14666 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
14667 * alloc.c (allocate_vectorlike):
14668 Check for overflow in vector size calculations.
14669 * ccl.c (ccl_driver):
14670 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
14671 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14672 need to be updated by these changes.
40087514
PE
14673 * fns.c (make_hash_table, maybe_resize_hash_table):
14674 Check for integer overflow with large hash tables.
0de4bb68
PE
14675 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14676 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14677 (SXHASH_REDUCE): New macro.
14678 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14679 Use it instead of discarding useful hash info with large hash values.
14680 (sxhash_float): New function.
14681 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14682 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
14683 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14684 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
14685 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14686 Adjust signatures to match updated version of code.
14687 (consing_since_gc): Now EMACS_INT, since a single hash table can
14688 use more than INT_MAX bytes.
14689
698d32e2
DN
146902011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14691
14692 Make it possible to build with GCC-4.6+ -O2 -flto.
14693
14694 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14695
fd6fa53f
SM
146962011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14697
14698 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14699 Call minibuffer-inactive-mode.
14700
864db017
JB
147012011-05-31 Juanma Barranquero <lekktu@gmail.com>
14702
14703 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14704 Update dependencies.
14705
2ad0baf4
DN
147062011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14707
14708 * data.c (init_data): Remove code for UTS, this system is not
14709 supported anymore.
14710
4fcc2638
DN
147112011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14712
14713 Don't force ./temacs to start in terminal mode.
14714
14715 * frame.c (make_initial_frame): Initialize faces in all cases, not
14716 only when CANNOT_DUMP is defined.
14717 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14718
c56e0fd5
DN
147192011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14720
14721 * dispnew.c (add_window_display_history): Use const for the string
14722 pointer. Remove declaration, not needed.
14723
333d54da 147242011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 14725
55d4c1b2 14726 Use 'inline', not 'INLINE'.
333d54da 14727 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
14728 * alloc.c, fontset.c (INLINE): Remove.
14729 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14730 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14731 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14732 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14733 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14734
738db178
DN
147352011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14736
14737 Make it possible to run ./temacs.
14738
14739 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14740 syms_of_callproc does the same thing. Remove test for
14741 "initialized", do it in the caller.
14742 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14743
620c53a6
SM
147442011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14745
14746 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14747 (read_minibuf): Use get_minibuffer.
14748 (syms_of_minibuf): Use DEFSYM.
14749 (Qmetadata): New var.
14750 * data.c (Qbuffer): Don't make it static.
14751 (syms_of_data): Use DEFSYM.
14752
e003a292
PE
147532011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14754
14755 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14756 (CCL_CODE_MIN): New macro.
14757
ed008a6d
PE
147582011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14759
3687c2ef
PE
14760 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14761
ed008a6d
PE
14762 * eval.c (Qdebug): Now static.
14763 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14764 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14765 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14766
d66c4c7c
CY
147672011-05-29 Chong Yidong <cyd@stupidchicken.com>
14768
14769 * image.c: Various fixes to ImageMagick code comments.
14770 (Fimagemagick_types): Doc fix.
14771
5fbc2025
PE
147722011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14773
0196f88a
PE
14774 Minor fixes prompted by GCC 4.6.0 warnings.
14775
14776 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14777
5fbc2025
PE
14778 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14779 (x_clipboard_manager_save_all): Move extern decl to ...
14780 * xterm.h: ... here, so that it can be checked for consistency.
14781
1dd3c2d9
CY
147822011-05-29 Chong Yidong <cyd@stupidchicken.com>
14783
14784 * xselect.c (x_clipboard_manager_save_frame)
14785 (x_clipboard_manager_save_all): New functions.
14786 (Fx_clipboard_manager_save): Lisp function deleted.
14787
14788 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14789 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14790
14791 * xterm.h: Update prototype.
14792
5ba6571d
WX
147932011-05-28 William Xu <william.xwl@gmail.com>
14794
14795 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14796 exiting (Bug#8239).
14797
3eaff834
JM
147982011-05-28 Jim Meyering <meyering@redhat.com>
14799
e1900994 14800 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
14801 * fns.c (to_uchar): Define.
14802 (crypto_hash_function): Use it to convert some newly-signed
14803 variables to unsigned, to avoid sign-extension bugs. For example,
14804 without this change, (md5 "truc") would evaluate to
14805 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14806 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 14807 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 14808
0f6990a7
PE
148092011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14810
14811 Integer overflow fixes.
c8a9ca5a 14812
08686060
PE
14813 * dbusbind.c: Serial number integer overflow fixes.
14814 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
14815 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14816 to hold a serial number that is too large for a fixnum.
14817 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14818 Check for serial numbers out of range. Decode any serial number
59568bf0 14819 that was so large that it became a float. (Bug#8722)
08686060 14820
2d1fc3c7
PE
14821 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14822 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14823 Use XFASTINT rather than XUINT when numbers are nonnegative.
14824 (xd_append_arg, Fdbus_method_return_internal):
14825 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14826 arguments, check that Lisp number is nonnegative, rather than
59568bf0 14827 silently wrapping negative numbers around. (Bug#8722)
30217ff0 14828 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 14829 (Bug#8722)
2d1fc3c7 14830
c8a9ca5a
PE
14831 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14832
519e1d69
PE
14833 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14834
6df6ae42 14835 ccl: Add integer overflow checks.
30569699
PE
14836 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14837 (IN_INT_RANGE): New macros.
14838 (ccl_driver): Use them to check for integer overflow when
14839 decoding a CCL program. Many of the new checks are whether XINT (x)
14840 fits in int; it doesn't always, on 64-bit hosts. The new version
14841 doesn't catch all possible integer overflows, but it's an
847044ea 14842 improvement. (Bug#8719)
30569699 14843
c11285dc
PE
14844 * alloc.c (make_event_array): Use XINT, not XUINT.
14845 There's no need for unsigned here.
14846
fdccd48e
PE
14847 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14848 This follows up to the 2011-05-06 change that substituted uintptr_t
14849 for EMACS_INT. This case wasn't caught back then.
14850
37910ab2
PE
14851 Rework Fformat to avoid integer overflow issues.
14852 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14853 now (part of C89). Include <verify.h>.
14854 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14855 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14856 (Fformat): Avoid the prepass trying to compute sizes; it was only
14857 approximate and thus did not catch overflow reliably. Instead, walk
14858 through the format just once, formatting and computing sizes as we go,
14859 checking for integer overflow at every step, and allocating a larger
14860 buffer as needed. Keep track separately whether the format is
14861 multibyte. Keep only the most-recently calculated precision, rather
14862 than them all. Record whether each argument has been converted to
14863 string. Use EMACS_INT, not int, for byte and char and arg counts.
14864 Support field widths and precisions larger than INT_MAX. Avoid
14865 sprintf's undefined behavior with conversion specifications such as %#d
14866 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14867 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14868 formatting out-of-range floating point numbers with int
9173deec 14869 formats. (Bug#8668)
37910ab2 14870
2e6578fb
PE
14871 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14872
0ae6bdee
PE
14873 * data.c: Avoid integer truncation in expressions involving floats.
14874 * data.c: Include <intprops.h>.
14875 (arith_driver): When there's an integer overflow in an expression
14876 involving floating point, convert the integers to floating point
14877 so that the resulting value does not suffer from catastrophic
14878 integer truncation. For example, on a 64-bit host (* 4
14879 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14880 Do not rely on undefined behavior after integer overflow.
14881
de883a70
PE
14882 merge count_size_as_multibyte, parse_str_to_multibyte
14883 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 14884 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
14885 Check for integer overflow.
14886 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14887 since it's now a duplicate of the other. This is more of
14888 a character than a buffer op, so better that it's in character.c.
14889 * fns.c, print.c: Adjust to above changes.
14890
2ff916cb
PE
148912011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14892
14893 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14894
f1b54466
PE
148952011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14896
fb1ac845
PE
14897 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14898 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14899 (x_clipboard_manager_save): Now static.
14900 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14901
f1b54466
PE
14902 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14903 (crypto_hash_function): Now static.
14904 Fix pointer signedness problems. Avoid unnecessary initializations.
14905
a9f737ee
CY
149062011-05-27 Chong Yidong <cyd@stupidchicken.com>
14907
14908 * termhooks.h (Vselection_alist): Make it terminal-local.
14909
14910 * terminal.c (create_terminal): Initialize it.
14911
14912 * xselect.c: Support for clipboard managers.
14913 (Vselection_alist): Move to termhooks.h as terminal-local var.
14914 (LOCAL_SELECTION): New macro.
14915 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14916 (symbol_to_x_atom): Remove gratuitous arg.
14917 (x_handle_selection_request, lisp_data_to_selection_data)
14918 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
14919 (x_own_selection, x_get_local_selection, x_convert_selection):
14920 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
14921 (some_frame_on_display): Delete unused function.
14922 (Fx_own_selection_internal, Fx_get_selection_internal)
14923 (Fx_disown_selection_internal, Fx_selection_owner_p)
14924 (Fx_selection_exists_p): New optional frame arg.
14925 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14926 (x_handle_selection_clear): Don't treat other terminals with the
14927 same keyboard specially. Use the terminal-local Vselection_alist.
14928 (x_clear_frame_selections): Use Frun_hook_with_args.
14929
14930 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14931
14932 * xterm.h: Add support for those atoms.
14933
e067f0c1
CY
149342011-05-26 Chong Yidong <cyd@stupidchicken.com>
14935
14936 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14937 (converted_selections, conversion_fail_tag): New global variables.
14938 (x_selection_request_lisp_error): Free the above.
14939 (x_get_local_selection): Remove unnecessary code.
14940 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
14941 of converted selections stored in converted_selections.
14942 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
14943 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14944 (x_convert_selection): New function.
14945 (x_handle_selection_event): Simplify.
14946 (x_get_foreign_selection): Don't ignore incoming requests while
14947 waiting for an answer; this will fail when we implement
14948 SAVE_TARGETS, and seems unnecessary anyway.
14949 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14950 (Vx_sent_selection_functions): Doc fix.
14951
0f4aebc0
LL
149522011-05-26 Leo Liu <sdl.web@gmail.com>
14953
14954 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14955
e61124cd
YM
149562011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14957
14958 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14959
14960 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14961 for fringe update if it has periodic bitmap.
ac389d0c 14962 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
14963 and fringe_bitmap_periodic_p.
14964
14965 * fringe.c (get_fringe_bitmap_data): New function.
14966 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14967 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14968 row. Mark glyph row for fringe update if periodicity changed.
14969
14970 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14971 for fringe update unless it has periodic bitmap.
14972
f16d9837
KH
149732011-05-25 Kenichi Handa <handa@m17n.org>
14974
14975 * xdisp.c (get_next_display_element): Set correct it->face_id for
14976 a static composition.
14977
e1b90ef6
LL
149782011-05-24 Leo Liu <sdl.web@gmail.com>
14979
14980 * deps.mk (fns.o):
14981 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14982
14983 * fns.c (crypto_hash_function, Fsha1): New function.
14984 (Fmd5): Use crypto_hash_function.
14985 (syms_of_fns): Add Ssha1.
14986
7400048f
PE
149872011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14988
14989 * gnutls.c: Remove unused macros.
14990 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14991 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14992 Remove macros that are defined and never used.
14993 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14994
abb71cf4
CY
149952011-05-22 Chong Yidong <cyd@stupidchicken.com>
14996
14997 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14998 (Fx_get_selection_internal): Minor cleanup.
14999 (Fx_own_selection_internal): Rename arguments for consistency with
15000 select.el.
15001
6307db39
PE
150022011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15003
15004 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15005
f3d4e0a4
CY
150062011-05-22 Chong Yidong <cyd@stupidchicken.com>
15007
15008 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15009
4d8ade89
YM
150102011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15011
15012 * dispnew.c (scrolling_window): Don't exclude the case that the
15013 last enabled row in the desired matrix touches the bottom boundary.
15014
32078c8d
GM
150152011-05-21 Glenn Morris <rgm@gnu.org>
15016
15017 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
15018 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15019 and add some more files.
32078c8d 15020
7285dc67
EZ
150212011-05-20 Eli Zaretskii <eliz@gnu.org>
15022
15023 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15024 report_file_error introduced by the change from 2011-05-07.
15025
89d1bd22
PE
150262011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15027
15028 * systime.h (Time): Define only if emacs is defined.
15029 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15030 where the include path doesn't have X11/X.h by default. See
15031 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15032
cd394be1 150332011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
15034
15035 * composite.c (find_automatic_composition): Fix previous change.
15036
b9704ad9
GM
150372011-05-20 Glenn Morris <rgm@gnu.org>
15038
15039 * lisp.mk: New file, split from Makefile.in.
15040 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15041 (shortlisp): Remove.
15042 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15043
4a720484
GM
150442011-05-19 Glenn Morris <rgm@gnu.org>
15045
15046 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15047 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15048 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15049 (lisp): Set the order to that of loadup.el.
15050 (shortlisp): Make it a copy of $lisp.
15051 (SOME_MACHINE_LISP): Remove.
15052 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15053 Use just $shortlisp, not $SOME_MACHINE_LISP too.
15054
a28d4396
KH
150552011-05-18 Kenichi Handa <handa@m17n.org>
15056
15057 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
15058 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
15059 (find_automatic_composition): Mostly rewrite for efficiency.
15060
a2b1fa8e
JB
150612011-05-18 Juanma Barranquero <lekktu@gmail.com>
15062
15063 * makefile.w32-in: Update dependencies.
15064
8e1f5610
CS
150652011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
15066
15067 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 15068 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 15069
7025ee00 150702011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 15071
cdfa6eab
PE
15072 Fix some integer overflow issues, such as string length overflow.
15073
06d6db33
PE
15074 * insdel.c (count_size_as_multibyte): Check for string overflow.
15075
2b4560a8
PE
15076 * character.c (lisp_string_width): Check for string overflow.
15077 Use EMACS_INT, not int, for string indexes and lengths; in
15078 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
15079 the resulting string length overflows an EMACS_INT; instead,
15080 report a string overflow if no precision given. When checking for
15081 precision exhaustion, use a check that cannot possibly have
15082 integer overflow. (Bug#8675)
15083 * character.h (lisp_string_width): Adjust to new signature.
15084
cb93f9be
PE
15085 * alloc.c (string_overflow): New function.
15086 (Fmake_string): Use it. This doesn't change behavior, but saves
15087 a few bytes and will simplify future changes.
15088 * character.c (string_escape_byte8): Likewise.
15089 * lisp.h (string_overflow): New decl.
15090
1a1f3366
PE
15091 Fixups, following up to the user-interface timestamp change.
15092 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
15093 for UI timestamps, instead of unsigned long.
9fbd6841
PE
15094 * msdos.c (mouse_get_pos): Likewise.
15095 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
15096 * w32gui.h (Time): Define by including "systime.h" rather than by
15097 declaring it ourselves. (Bug#8664)
15098
d4e3e4d3
PE
15099 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
15100 * image.c (clear_image_cache): Likewise.
15101
f6a24d19
PE
15102 * term.c (term_mouse_position): Don't assume time_t wraparound.
15103
08dc5ae6
PE
15104 Be more systematic about user-interface timestamps.
15105 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
15106 and sometimes 'EMACS_UINT', to represent these timestamps.
15107 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
15108 This makes the code easier to follow, and makes it easier to catch
15109 integer overflow bugs such as Bug#8664.
15110 * frame.c (Fmouse_position, Fmouse_pixel_position):
15111 Use Time, not unsigned long, for user-interface timestamps.
15112 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
15113 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
15114 * keyboard.h (last_event_timestamp): Likewise.
15115 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15116 * menu.h (xmenu_show): Likewise.
15117 * term.c (term_mouse_position): Likewise.
15118 * termhooks.h (struct input_event.timestamp): Likewise.
15119 (struct terminal.mouse_position_hook): Likewise.
15120 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15121 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15122 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
15123 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15124 what it was before.
15125 * menu.h, termhooks.h: Include "systime.h", for Time.
15126
8e55734a
PE
15127 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15128 Don't assume that the difference between two unsigned long values
15129 can fit into an integer. At this point, we know button_down_time
15130 <= event->timestamp, so the difference must be nonnegative, so
15131 there's no need to cast the result if double-click-time is
15132 nonnegative, as it should be; check that it's nonnegative, just in
15133 case. This bug is triggered when events are more than 2**31 ms
86db42d2 15134 apart (about 25 days). (Bug#8664)
8e55734a 15135
841f1b75 15136 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 15137 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 15138
3e26f69c
PE
15139 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15140 that always fit in int. Use a sentinel instead of a counter, to
15141 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
15142 * frame.h (struct frame): Use int for menu_bar_items_used
15143 instead of EMACS_INT, since it always fits in int.
3e26f69c 15144
5cc152c0
PE
15145 * menu.c (grow_menu_items): Check for int overflow.
15146
d89eb65e
PE
15147 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15148
5235bd3e
PE
15149 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15150 Before, the code was not consistent. These values cannot exceed
15151 2**31 - 1 so there's no need to make them unsigned.
15152 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15153 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15154 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15155 as modifiers.
15156 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15157
bc827e23
PE
15158 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15159 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15160 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15161 presumably because the widths might not match.
15162
78eb494e
PE
15163 * window.c (size_window): Avoid needless test at loop start.
15164
04f2d78b
CB
151652011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
15166
15167 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15168
d2fc7e3d 151692011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
15170
15171 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15172
d2fc7e3d 151732011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
15174
15175 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15176 `width' to `bar_area_x' and `bar_area_width', respectively.
15177 (x_scroll_run): Take account of fringe background extension.
15178
04f2d78b
CB
15179 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15180 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
15181 `bar_area_width', respectively.
15182 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15183 background extension.
15184
79b70037
GM
151852011-05-10 Jim Meyering <meyering@redhat.com>
15186
15187 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15188
2f142cc5
JB
151892011-05-10 Juanma Barranquero <lekktu@gmail.com>
15190
15191 * image.c (Finit_image_library): Return t for built-in image types,
15192 like pbm and xbm. (Bug#8640)
15193
57679c86
AS
151942011-05-09 Andreas Schwab <schwab@linux-m68k.org>
15195
15196 * w32menu.c (set_frame_menubar): Fix submenu allocation.
15197
888c9e86
EZ
151982011-05-07 Eli Zaretskii <eliz@gnu.org>
15199
b0512a1d
EZ
15200 * w32console.c (Fset_screen_color): Doc fix.
15201 (Fget_screen_color): New function.
15202 (syms_of_ntterm): Defsubr it.
15203
7285dc67
EZ
15204 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15205 unlink the temporary file if Fcall_process didn't create it in the
15206 first place.
15207 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15208 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
15209 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
15210 cue to call_process_cleanup not to close that handle.
15211
4d3fcc8e
BK
152122011-05-07 Ben Key <bkey76@gmail.com>
15213
15214 * makefile.w32-in: The bootstrap-temacs rule now makes use of
15215 one of two shell specific rules, either bootstrap-temacs-CMD or
15216 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
15217 to the previous implementation of the bootstrap-temacs rule.
15218 The bootstrap-temacs-CMD rule is similar to the previous
15219 implementation of the bootstrap-temacs rule except that it
15220 makes use of the ESC_CFLAGS variable instead of the CFLAGS
15221 variable.
15222
15223 These changes, along with some changes to nt/configure.bat,
15224 nt/gmake.defs, and nt/nmake.defs, are required to extend my
15225 earlier fix to add support for --cflags and --ldflags options
15226 that include quotes so that it works whether make uses cmd or
15227 sh as the shell.
15228
b4289b64
MA
152292011-05-06 Michael Albinus <michael.albinus@gmx.de>
15230
15231 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
15232 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
15233 is a constant.
15234 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
15235 a string. Handle both cases.
15236 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
15237 (Fdbus_register_method): Use Qinvalid_function.
15238
af4c0e28
JB
152392011-05-06 Juanma Barranquero <lekktu@gmail.com>
15240
15241 * makefile.w32-in: Update dependencies.
15242 (LISP_H): Add inttypes.h and stdin.h.
15243 (PROCESS_H): Add unistd.h.
15244
c51453d9
EZ
152452011-05-06 Eli Zaretskii <eliz@gnu.org>
15246
15247 * lread.c: Include limits.h (fixes the MS-Windows build broken by
15248 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15249
8ff0ac3c 152502011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 15251
4c4b566b
PE
15252 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15253
aab2b9b5
PE
15254 * term.c (vfatal): Remove stray call to va_end.
15255 It's not needed and the C Standard doesn't allow it here anyway.
15256
c378da0b
PE
15257 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15258 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
15259
288b08c7
PE
15260 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15261 bytes.
15262
e3601888
PE
15263 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15264
db6c0e74
PE
15265 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15266
dd5963ea
PE
15267 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15268
88c9450f
PE
15269 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15270
2f9442b8
PE
15271 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15272
c032b5f8
PE
15273 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15274 * charset.c (Fdefine_charset_internal): Don't initialize
15275 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 15276 32-bit int (Bug#8600).
a108c10b
PE
15277
15278 * lread.c (read_integer): Be more consistent with string-to-number.
15279 Use string_to_number to do the actual conversion; this avoids
15280 rounding errors and fixes some other screwups. Without this fix,
15281 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15282 (digit_to_number): Move earlier, for benefit of read_integer.
15283 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 15284 not a digit in any supported base. (Bug#8602)
a108c10b 15285
ad5f9eea
PE
15286 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15287
aec1708a
PE
15288 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15289 to match comment at start of function. This also removes a
15290 GCC warning about overflow in a 32+64-bit port.
15291
47be4ab5
PE
15292 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15293
371cac43
PE
15294 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15295 Reported by Stefan Monnier in
15296 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
15297 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15298 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 15299
d01a7826
PE
15300 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15301 (EMACS_UINTPTR): Likewise, with uintptr_t.
15302
7fd47d5c
PE
15303 * lisp.h: Prefer 64-bit EMACS_INT if available.
15304 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15305 on 32-bit hosts that have 64-bit int, so that they can access
15306 large files.
122b0c86
PE
15307 However, temporarily disable this change unless the temporary
15308 symbol WIDE_EMACS_INT is defined.
7fd47d5c 15309
8727937b
PE
15310 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15311
8ac068ac
PE
15312 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15313 This removes an assumption that EMACS_INT and long are the same
15314 width as pointers. The assumption is true for Emacs porting targets
15315 now, but we want to make other targets possible.
15316 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15317 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15318 In the rest of the code, change types of integers that hold casted
15319 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15320 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15321 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15322 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15323 No need to cast type when ORing.
15324 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15325 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15326 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15327 assume EMACS_INT is the same width as char *.
15328 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15329 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15330 Remove no-longer-needed casts.
15331 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15332 (xg_tool_bar_help_callback, xg_make_tool_item):
15333 Use EMACS_INTPTR to hold an integer
15334 that will be cast to void *; this can avoid a GCC warning
15335 if EMACS_INT is not the same width as void *.
15336 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15337 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15338 (current_message_1, set_message_1):
15339 Use a local to convert to proper width without a cast.
15340 * xmenu.c (dialog_selection_callback): Likewise.
15341
ede49d71
PE
15342 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15343 Also, don't assume VALBITS / RAND_BITS is less than 5,
15344 and don't rely on undefined behavior when shifting a 1 left into
15345 the sign bit.
15346 * lisp.h (get_random): Change signature to match.
15347
2f30ecd0
PE
15348 * lread.c (hash_string): Use size_t, not int, for hash computation.
15349 Normally we prefer signed values; but hashing is special, because
15350 it's better to use unsigned division on hash table sizes so that
15351 the remainder is nonnegative. Also, size_t is the natural width
15352 for hashing into memory. The previous code used 'int', which doesn't
15353 retain enough info to hash well into very large tables.
15354 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15355
2a866e7b
PE
15356 * dbusbind.c: Don't possibly lose pointer info when converting.
15357 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15358 Use XPNTR rather than XHASH, so that the high-order bits of
15359 the pointer aren't lost when converting through void *.
15360
51639eac
PE
15361 * eval.c (Fautoload): Don't double-shift a pointer.
15362
92394119
PE
15363 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15364
dbdb9a7c
JB
153652011-05-06 Juanma Barranquero <lekktu@gmail.com>
15366
15367 * gnutls.c (DEF_GNUTLS_FN):
15368 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15369
db7a0b4f
AS
153702011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15371
15372 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15373 marker. (Bug#8610)
15374
cd394be1 153752011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
15376
15377 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15378 New version that can reserve upto 2GB of heap space.
15379
f7ff1b0f 153802011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
15381
15382 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15383
639c109b
TZ
153842011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15385
15386 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15387 `gnutls_certificate_set_x509_key_file'.
15388
d2127135
JB
153892011-05-05 Juanma Barranquero <lekktu@gmail.com>
15390
15391 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15392 Update dependencies.
15393
e968f4f3
JB
153942011-05-04 Juanma Barranquero <lekktu@gmail.com>
15395
15396 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15397 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15398 Remove unused parameter `fildes'.
15399 * process.c (read_process_output, send_process): Don't pass it.
15400
84d358f0
JB
154012011-05-04 Juanma Barranquero <lekktu@gmail.com>
15402
15403 Fix previous change: the library cache is defined in w32.c.
15404 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15405 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15406
0898ca10
JB
154072011-05-04 Juanma Barranquero <lekktu@gmail.com>
15408
15409 Implement dynamic loading of GnuTLS on Windows.
15410
15411 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15412 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15413 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15414 Declare.
15415
15416 * gnutls.c (Qgnutls_dll): Define.
15417 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15418 (gnutls_*): Declare function pointers.
15419 (init_gnutls_functions): New function to initialize function pointers.
15420 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15421 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15422 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15423 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15424 (emacs_gnutls_write, emacs_gnutls_read)
15425 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15426 (Fgnutls_available_p): New function.
15427 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15428 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15429 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15430
15431 * image.c: Include w32.h.
15432 (Vimage_type_cache): Delete.
15433 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15434 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15435 (w32_delayed_load): Move to w32.c.
15436
15437 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15438
15439 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15440 (w32_delayed_load): Move from image.c. When loading a library, record
15441 its filename in the :loaded-from property of the library id.
15442 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15443 Initialize and staticpro them.
15444 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15445
15446 * process.c: Include lisp.h before w32.h, not after.
15447 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15448 instead of gnutls_record_check_pending.
15449
15450 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15451
ff4de4aa
TZ
154522011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15453
15454 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15455 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15456 as passed in.
15457
abe95abb
JD
154582011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15459
15460 * xterm.c (x_set_frame_alpha): Do not set property on anything
15461 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15462
e16e55d4
JB
154632011-05-02 Juanma Barranquero <lekktu@gmail.com>
15464
15465 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15466
bafcf6a5
JB
154672011-05-02 Juanma Barranquero <lekktu@gmail.com>
15468
15469 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15470 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15471 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15472 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15473 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15474 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15475 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15476 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15477 (Qgnutls_bootprop_callbacks_verify): Make static.
15478
e7a6747f
AS
154792011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15480
19ed11ba
AS
15481 * callproc.c: Indentation fixup.
15482
e7a6747f 15483 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
15484 (wait_for_termination, interruptible_wait_for_termination):
15485 Move after wait_for_termination_1.
e7a6747f 15486
1ef14cb4
LMI
154872011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15488
15489 * sysdep.c (interruptible_wait_for_termination): New function
15490 which is like wait_for_termination, but allows keyboard
15491 interruptions.
15492
15493 * callproc.c (Fcall_process): Add (:file "file") as an option for
15494 the STDOUT buffer.
15495 (Fcall_process_region): Ditto.
15496
330d880c
EZ
154972011-04-30 Eli Zaretskii <eliz@gnu.org>
15498
8db90b73
EZ
15499 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15500 rather than `XVECTOR (FOO)->size'.
15501
330d880c
EZ
15502 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15503 inttypes.h, as a gnulib replacement is used if it not available in
15504 system headers.
15505
15cbd324
EZ
155062011-04-21 Eli Zaretskii <eliz@gnu.org>
15507
15508 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15509 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15510 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15511
15512 * coding.c (coding_alloc_by_realloc): Error out if destination
15513 will grow beyond MOST_POSITIVE_FIXNUM.
15514 (decode_coding_emacs_mule): Abort if there isn't enough place in
15515 charbuf for the composition carryover bytes. Reserve an extra
15516 space for up to 2 characters produced in a loop.
15517 (decode_coding_iso_2022): Abort if there isn't enough place in
15518 charbuf for the composition carryover bytes.
15519
155202011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 15521
ae940cca
EZ
15522 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15523 aborting when %lld or %lll format is passed.
15524 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15525 %llo or %llx format is passed. (Bug#8545)
15526
03ab8921
EZ
15527 * window.c (window_scroll_line_based): Use a marker instead of
15528 simple variables to record original value of point. (Bug#7952)
15529
afda1437
EZ
15530 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15531 produced by %s or %c overflows available buffer space. (Bug#8545)
15532
f76dee0c
PE
155332011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15534
15535 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 15536 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 15537
fdc5744d
JB
155382011-04-28 Juanma Barranquero <lekktu@gmail.com>
15539
15540 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15541
638f053a
JB
155422011-04-28 Juanma Barranquero <lekktu@gmail.com>
15543
15544 * keyboard.c (Qdelayed_warnings_hook): Define.
15545 (command_loop_1): Run `delayed-warnings-hook'
15546 if Vdelayed_warnings_list is non-nil.
15547 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15548 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15549
d178f871
EZ
155502011-04-28 Eli Zaretskii <eliz@gnu.org>
15551
15552 * doprnt.c (doprnt): Don't return value smaller than the buffer
15553 size if the message was truncated. (Bug#8545).
15554
b124fd93
JB
155552011-04-28 Juanma Barranquero <lekktu@gmail.com>
15556
15557 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15558 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15559
e810457d
PE
155602011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15561
15562 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15563
ea51cceb
JB
155642011-04-27 Juanma Barranquero <lekktu@gmail.com>
15565
15566 * makefile.w32-in: Update dependencies.
15567
94dcfacf
EZ
155682011-04-27 Eli Zaretskii <eliz@gnu.org>
15569
15570 Improve `doprnt' and its usage. (Bug#8545)
15571 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15572 `format_end'. Remove support for %l as a conversion specifier.
15573 Don't use xrealloc. Improve diagnostics when the %l size modifier
15574 is used. Update the commentary.
15575
15576 * eval.c (verror): Simplify calculation of size_t.
15577
15578 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15579 messages.
15580
f61f41d7
PE
155812011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15582
15583 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15584 change.
15585
96fb4434
PE
155862011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15587
15588 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15589 This makes this file independent of the recent pseudovector change.
15590
671875da 155912011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 15592
69e9b5a3
PE
15593 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15594
b5f869a7 15595 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 15596 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 15597 Remove unused local.
c8926152 15598 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 15599
841a1577 15600 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
15601 GCC 4.6.0 optimizes based on type-based alias analysis.
15602 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
15603 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15604 != &v->size, and therefore "v->size = 1; b->size = 2; return
15605 v->size;" must therefore return 1. This assumption is incorrect
15606 for Emacs, since it type-puns struct Lisp_Vector * with many other
15607 types. To fix this problem, this patch adds a new type struct
f904488f 15608 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
15609 and pseudovectors, and helps optimizing compilers not get fooled
15610 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15611 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
15612 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15613 the size member.
eab3844f
PE
15614 (XSETPVECTYPE): Rewrite in terms of new macro.
15615 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15616 This is a bit clearer, and further avoids the possibility of
15617 undesirable aliasing.
15618 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 15619 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
15620 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15621 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
15622 (ASIZE): Now uses header.size rather than size.
15623 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
15624 to avoid the hassle of writing XVECTOR (foo)->header.size.
15625 (struct vectorlike_header): New type.
eab3844f
PE
15626 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15627 object, to help avoid aliasing.
15628 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15629 (SUBRP): Likewise, since Lisp_Subr is a special case.
15630 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15631 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15632 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 15633 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
15634 changed to be "header.size" and "header.next".
15635 * buffer.h (struct buffer): Likewise.
15636 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15637 * frame.h (struct frame): Likewise.
15638 * process.h (struct Lisp_Process): Likewise.
15639 * termhooks.h (struct terminal): Likewise.
15640 * window.c (struct save_window_data, struct saved_window): Likewise.
15641 * window.h (struct window): Likewise.
15642 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15643 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15644 * buffer.c (init_buffer_once): Likewise.
15645 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15646 special case.
15647 * process.c (Fformat_network_address): Use local var for size,
15648 for brevity.
15649
0df1eac5
PE
15650 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15651
847ab9d1 15652 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
15653 * data.c (atof): Remove decl; no longer used or needed.
15654 (digit_to_number): Move to lread.c.
15655 (Fstring_to_number): Use new string_to_number function, to be
15656 consistent with how the Lisp reader treats infinities and NaNs.
15657 Do not assume that floating-point numbers represent EMACS_INT
15658 without losing information; this is not true on most 64-bit hosts.
15659 Avoid double-rounding errors, by insisting on integers when
15660 parsing non-base-10 numbers, as the documentation specifies.
15661 * lisp.h (string_to_number): New decl, replacing ...
15662 (isfloat_string): Remove.
bc0a5c13 15663 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 15664 (read1): Do not accept +. and -. as integers; this
452f4150
PE
15665 appears to have been a coding error. Similarly, do not accept
15666 strings like +-1e0 as floating point numbers. Do not report
15667 overflow for integer overflows unless the base is not 10 which
15668 means we have no simple and reliable way to continue.
15669 Break out the floating-point parsing into a new
15670 function string_to_number, so that Fstring_to_number parses
15671 floating point numbers consistently with the Lisp reader.
04f2d78b 15672 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
15673 (E_CHAR, EXP_INT): Remove, replacing with ...
15674 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15675 (string_to_number): New function, replacing isfloat_string.
15676 This function checks for valid syntax and produces the resulting
15677 Lisp float number too. Rework it so that string-to-number
bc0a5c13 15678 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
15679 so that overflow for non-base-10 numbers is reported only when
15680 there's no portable and simple way to convert to floating point.
452f4150 15681
67769ffc
PE
15682 * textprop.c (set_text_properties_1): Rewrite for clarity,
15683 and to avoid GCC warning about integer overflow.
15684
c20db43f
PE
15685 * intervals.h (struct interval): Use EMACS_INT for members
15686 where EMACS_UINT might cause problems. See
15687 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15688 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15689 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15690 All uses changed.
37aa2f85
PE
15691 (offset_intervals): Tell GCC not to worry about length overflow
15692 when negating a negative length.
c20db43f 15693
2538aa2f
PE
15694 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15695 (overrun_check_free): Likewise.
15696
f2d3008d
PE
15697 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15698 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15699 word size.
15700
ec8df744
PE
15701 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15702 (gnutls_make_error): Rename local to avoid shadowing.
15703 (gnutls_emacs_global_deinit): ifdef out; not used.
15704 (Fgnutls_boot): Use const for pointer to readonly storage.
15705 Comment out unused local. Fix pointer signedness problems.
15706
640ee02d
PE
15707 * lread.c (openp): Don't stuff size_t into an 'int'.
15708 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15709 about possible signed overflow.
15710
6048fb2a
PE
15711 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15712 (GDK_KEY_g): Don't define if already defined.
15713 (xg_prepare_tooltip): Avoid pointer signedness problem.
15714 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15715
fa3c87e1
PE
15716 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15717 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15718
2172544b
PE
15719 * xfns.c (Fx_window_property): Simplify a bit,
15720 to make a bit faster and to avoid GCC 4.6.0 warning.
15721 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15722
9b821a21
PE
15723 * fns.c (internal_equal): Don't assume size_t fits in int.
15724
3c616cfa
PE
15725 * alloc.c (compact_small_strings): Tighten assertion a little.
15726
c2982e87
PE
15727 Replace pEd with more-general pI, and fix some printf arg casts.
15728 * lisp.h (pI): New macro, generalizing old pEd macro to other
15729 conversion specifiers. For example, use "...%"pI"d..." rather
15730 than "...%"pEd"...".
15731 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 15732 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
15733 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15734 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15735 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15736 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15737 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15738 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15739 64-bit hosts.
15740 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15741 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15742 * print.c (safe_debug_print, print_object): Likewise.
15743 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15744 to int.
6f04d126
PE
15745 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15746 avoiding the 0 flag, which is not portable.
c2982e87
PE
15747 * process.c (Fmake_network_process): Use pI to avoid cast.
15748 * region-cache.c (pp_cache): Likewise.
15749 * xdisp.c (decode_mode_spec): Likewise.
15750 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15751 behavior on 64-bit hosts with printf arg.
6f04d126 15752 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
15753 (x_stop_queuing_selection_requests): Likewise.
15754 (x_get_window_property): Don't truncate byte count to an 'int'
15755 when tracing.
0b432f21 15756
5e073ec7
PE
15757 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15758 here, since it parses constructs like leading '-' and spaces,
15759 which are not wanted; and it overflows with large numbers.
15760 Instead, simply match F[0-9]+, which is what is wanted anyway.
15761
36372bf9
PE
15762 * alloc.c: Remove unportable assumptions about struct layout.
15763 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15764 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15765 (allocate_vectorlike, make_pure_vector): Use the new macros,
15766 plus offsetof, to remove unportable assumptions about struct layout.
15767 These assumptions hold on all porting targets that I know of, but
15768 they are not guaranteed, they're easy to remove, and removing them
15769 makes further changes easier.
15770
0b432f21
PE
15771 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15772 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
15773 (string_overrun_cookie): Now const. Use initializers that
15774 don't formally overflow signed char, to avoid warnings.
000098c1
PE
15775 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15776 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
15777 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15778 multiple of sizeof (EMACS_INT); it need not be, if
15779 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 15780 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 15781
895009e1
JB
157822011-04-26 Juanma Barranquero <lekktu@gmail.com>
15783
15784 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15785
6a7a1b0b
TZ
157862011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15787
15788 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 15789 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
15790 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15791
841a1577 157922011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
15793
15794 * lisp.h (Qdebug): List symbol.
895009e1 15795 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
15796 * keyboard.c (debug-on-event): New variable.
15797 (handle_user_signal): Break into debugger when debug-on-event
15798 matches the current signal symbol.
15799
f2d3ba6f
DN
158002011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15801
15802 * alloc.c (check_sblock, check_string_bytes)
15803 (check_string_free_list): Convert to standard C.
15804
42ce4c63
TZ
158052011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15806
15807 * w32.c (emacs_gnutls_push): Fix typo.
15808
825cd63c
EZ
158092011-04-25 Eli Zaretskii <eliz@gnu.org>
15810
fb11d64d
EZ
15811 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15812 "cast to pointer from integer of different size".
15813
825cd63c
EZ
15814 Improve doprnt and its use in verror. (Bug#8545)
15815 * doprnt.c (doprnt): Document the set of format control sequences
15816 supported by the function. Use SAFE_ALLOCA instead of always
15817 using `alloca'.
15818
15819 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15820 is one byte too soon. Don't use xrealloc; instead xfree and
15821 xmalloc anew.
15822
e061a11b
TZ
158232011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15824
15825 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15826 callbacks stage.
15827
15828 * gnutls.c: Renamed global_initialized to
15829 gnutls_global_initialized. Added internals for the
15830 :verify-hostname-error, :verify-error, and :verify-flags
15831 parameters of `gnutls-boot' and documented those parameters in the
15832 docstring. Start callback support.
9173deec
JB
15833 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15834 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15835 on error. Return error code.
e061a11b
TZ
15836 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15837 (emacs_gnutls_read): Likewise.
15838 (Fgnutls_boot): Return handshake error code.
15839 (emacs_gnutls_handle_error): New function.
15840 (wsaerror_to_errno): Likewise.
15841
15842 * w32.h (emacs_gnutls_pull): Add prototype.
15843 (emacs_gnutls_push): Likewise.
15844
15845 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15846 (emacs_gnutls_push): Likewise.
15847
158482011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15849
15850 * process.c (wait_reading_process_output): Check if GnuTLS
15851 buffered some data internally if no FDs are set for TLS
15852 connections.
15853
15854 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15855 (LIBS): Link to USER_LIBS.
15856 ($(BLD)/gnutls.$(0)): New target.
15857
fa6996bc
EZ
158582011-04-24 Eli Zaretskii <eliz@gnu.org>
15859
eb35682e
EZ
15860 * xdisp.c (handle_single_display_spec): Rename the
15861 display_replaced_before_p argument into display_replaced_p, to
15862 make it consistent with the commentary. Fix typos in the
15863 commentary.
15864
e2ad650c
EZ
15865 * textprop.c (syms_of_textprop): Remove dead code.
15866 (copy_text_properties): Delete obsolete commentary about an
15867 interface that was deleted long ago. Fix typos in the description
15868 of arguments.
15869
1b2de274
EZ
15870 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15871 to changes in oldXMenu/XMenu.h from 2011-04-16.
15872 <menu_help_message, prev_menu_help_message>: Constify.
15873 (IT_menu_make_room): menu->help_text is now `const char **';
15874 adjust.
15875
15876 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15877 to changes in oldXMenu/XMenu.h from 2011-04-16.
15878 (struct XMenu): Declare `help_text' `const char **'.
15879
15880 * xfaces.c <Qunspecified>: Make extern again.
15881
15882 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 15883 required by POSIX.
1b2de274 15884
762b15be
EZ
15885 * doc.c (get_doc_string): Improve the format passed to `error'.
15886
15887 * doprnt.c (doprnt): Improve commentary.
15888
15889 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15890
15891 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15892 them with etags.
15893
f1052e5d
EZ
15894 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15895 changes in globals.h immediately force recompilation.
762b15be
EZ
15896 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15897 $(CURDIR)/s/ms-w32.h.
15898 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 15899
fa6996bc
EZ
15900 * character.c (Fchar_direction): Function deleted.
15901 (syms_of_character): Don't defsubr it.
15902 <char-direction-table>: Deleted.
15903
e6c3da20
EZ
159042011-04-23 Eli Zaretskii <eliz@gnu.org>
15905
15906 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15907 * doprnt.c: Include limits.h.
15908 (SIZE_MAX): New macro.
04f2d78b
CB
15909 (doprnt): Return a size_t value. 2nd arg is now size_t.
15910 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
15911 Improve overflow protection. Support `l' modifier for integer
15912 conversions. Support %l conversion. Don't assume an EMACS_INT
15913 argument for integer conversions and for %c.
15914
15915 * lisp.h (doprnt): Restore prototype.
15916
15917 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15918 $(SRC)/character.h.
15919
15920 * Makefile.in (base_obj): Add back doprnt.o.
15921
15922 * deps.mk (doprnt.o): Add back prerequisites.
15923 (callint.o): Depend on character.h.
15924
15925 * eval.c (internal_lisp_condition_case): Include the handler
15926 representation in the error message.
15927 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15928 when breaking from the loop.
15929
15930 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15931
15932 * callint.c (Fcall_interactively): When displaying error message
15933 about invalid control letter, pass the character's codepoint, not
15934 a pointer to its multibyte form. Improve display of the character
15935 in octal and display also its hex code.
15936
15937 * character.c (char_string): Use %x to display the (unsigned)
15938 codepoint of an invalid character, to avoid displaying a bogus
15939 negative value.
15940
15941 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15942 `error', not SYMBOL_NAME itself.
15943
15944 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15945 character arguments to `error'.
15946
15947 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15948 to `error' in error message about FINAL_CHAR argument. Make sure
15949 FINAL_CHAR is a character, and use %c when it is passed as
15950 argument to `error'.
15951
4ffd0d6b 159522011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
15953
15954 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15955
15956 * w32.c: Include <time.h>.
15957 (sys_localtime): New function.
15958
4ffd0d6b 159592011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
15960
15961 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15962
4ffd0d6b 15963 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 15964
4ffd0d6b 159652011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 15966
4ffd0d6b
GM
15967 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15968 zombies (Bug#8467).
aac0c6e3 15969
04c56954
EZ
159702011-04-19 Eli Zaretskii <eliz@gnu.org>
15971
15972 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15973 gl_state.e_property when gl_state.object is Qt.
15974
15975 * insdel.c (make_gap_larger): Remove limitation of buffer size
15976 to <= INT_MAX.
15977
16a43933
CY
159782011-04-18 Chong Yidong <cyd@stupidchicken.com>
15979
15980 * xdisp.c (lookup_glyphless_char_display)
15981 (produce_glyphless_glyph): Handle cons cell entry in
15982 glyphless-char-display.
15983 (Vglyphless_char_display): Document it.
15984
15985 * term.c (produce_glyphless_glyph): Handle cons cell entry in
15986 glyphless-char-display.
15987
4581706e
CY
159882011-04-17 Chong Yidong <cyd@stupidchicken.com>
15989
15990 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15991
15992 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15993
15994 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15995 definition for no-X builds.
15996
4887c6e2 159972011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 15998
fd35b6f9
PE
15999 Static checks with GCC 4.6.0 and non-default toolkits.
16000
5c1ccb01
PE
16001 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16002
006c5daa
PE
16003 * process.c (keyboard_bit_set): Define only if SIGIO.
16004 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16005 (send_process): Repair possible setjmp clobbering.
16006
efc736d3
PE
16007 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16008
4e2fe2e6
PE
16009 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16010
f97334a2
PE
16011 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16012
4e75f29d
PE
16013 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16014 Define only if needed.
16015
90efadd1
PE
16016 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16017 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 16018 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 16019
3c647824
PE
16020 * dispextern.h (struct redisplay_interface): Rename param
16021 to avoid shadowing.
e264f262 16022 * termhooks.h (struct terminal): Likewise.
761383f4 16023 * xterm.c (xembed_send_message): Likewise.
3c647824 16024
b58c5c4a
PE
16025 * insdel.c (make_gap_smaller): Define only if
16026 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16027
cad59032
PE
16028 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16029 it.
16030
c339dc2e
PE
16031 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16032 so that we aren't warned about unused symbols.
16033
91a3e27b
PE
16034 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16035
399c71d3 16036 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 16037
8ffc96f5
PE
16038 * xfns.c (x_real_positions): Mark locals as initialized.
16039
eef9bc79
PE
16040 * xmenu.c (xmenu_show): Don't use uninitialized vars.
16041
098db9dd
PE
16042 * xterm.c: Fix problems found by static analysis with other toolkits.
16043 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
16044 (x_dispatch_event): Declare static if USE_GTK, and
16045 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 16046 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 16047 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
16048 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16049 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 16050
eb18f6cc
PE
16051 * xmenu.c (menu_help_callback): Pointer type fixes.
16052 Use const pointers when pointing at readonly data. Avoid pointer
16053 signedness clashes.
16054 (FALSE): Remove unused macro.
16055 (update_frame_menubar): Remove unused decl.
16056
1fe72bf8
PE
16057 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
16058
60d9e1db
PE
16059 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
16060 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
16061 (single_menu_item): Rename local to avoid shadowing.
16062
39261c26
PE
16063 * keyboard.c (make_lispy_event): Remove unused local var.
16064
018c5e19
PE
16065 * frame.c, frame.h (x_get_resource_string): Bring this back, but
16066 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
16067
63d2b86e
PE
16068 * bitmaps: Change bitmaps from unsigned char back to the X11
16069 compatible char. Avoid the old compiler warnings about
16070 out-of-range initializers by using, for example, '\xab' rather
16071 than 0xab.
16072
aefd87e1
PE
16073 * xgselect.c (xgselect_initialize): Check vs interface
16074 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
16075
bf501fb9
PE
16076 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
16077
e9829fdf
PE
16078 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
16079 to read-only memory.
16080
1086c095
PE
16081 * fns.c (vector): Remove; this old hack is no longer needed.
16082
2baccd04 16083 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 16084 Remove unused var.
dde42981 16085 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 16086
72391843 16087 * xrdb.c (x_load_resources): Omit unused local.
3565b346 16088
436c16df 16089 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 16090 (x_window): Rename locals to avoid shadowing.
dc5ddd85 16091 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 16092
92bb796d 16093 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 16094 (x_term_init): Remove local to avoid shadowing.
92bb796d 16095
764430a3 16096 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
16097
16098 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
16099 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
16100
d1dfb56c
EZ
161012011-04-16 Eli Zaretskii <eliz@gnu.org>
16102
c4354cb4
EZ
16103 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
16104
d1dfb56c
EZ
16105 Fix regex.c, syntax.c and friends for buffers > 2GB.
16106 * syntax.h (struct gl_state_s): Declare character position members
16107 EMACS_INT.
16108
16109 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
16110
04f2d78b
CB
16111 * textprop.c (verify_interval_modification, interval_of):
16112 Declare arguments EMACS_INT.
d1dfb56c
EZ
16113
16114 * intervals.c (adjust_intervals_for_insertion): Declare arguments
16115 EMACS_INT.
16116
16117 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
16118
16119 * indent.c (Fvertical_motion): Local variable it_start is now
16120 EMACS_INT.
16121
16122 * regex.c (re_match, re_match_2, re_match_2_internal)
16123 (bcmp_translate, regcomp, regexec, print_double_string)
16124 (group_in_compile_stack, re_search, re_search_2, regex_compile)
16125 (re_compile_pattern, re_exec): Declare arguments and local
16126 variables `size_t' and `ssize_t' and return values `regoff_t', as
16127 appropriate.
16128 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16129 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16130 <compile_stack_type>: `size' and `avail' are now `size_t'.
16131
16132 * regex.h <regoff_t>: Use ssize_t, not int.
16133 (re_search, re_search_2, re_match, re_match_2): Arguments that
16134 specify buffer/string position and length are now ssize_t and
16135 size_t. Return type is regoff_t.
16136
613052cd
BK
161372011-04-16 Ben Key <bkey76@gmail.com>
16138
16139 * nsfont.m: Fixed bugs in ns_get_family and
16140 ns_descriptor_to_entity that were caused by using free to
16141 deallocate memory blocks that were allocated by xmalloc (via
16142 xstrdup). This caused Emacs to crash when compiled with
16143 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16144 --enable-checking=xmallocoverrun). xfree is now used to
16145 deallocate these memory blocks.
16146
4170f62f 161472011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 16148
71b41406
PE
16149 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16150
9587a89d
PE
16151 emacs_write: Accept and return EMACS_INT for sizes.
16152 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16153 et seq.
16154 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16155 Accept and return EMACS_INT.
16156 (emacs_gnutls_write): Return the number of bytes written on
16157 partial writes.
16158 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
16159 (emacs_read, emacs_write): Remove check for negative size, as the
16160 Emacs source code has been audited now.
9587a89d
PE
16161 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16162 (emacs_read, emacs_write): Use it.
273a5f82
PE
16163 * process.c (send_process): Adjust to the new signatures of
16164 emacs_write and emacs_gnutls_write. Do not attempt to store
16165 a byte offset into an 'int'; it might overflow.
9587a89d 16166 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 16167
3e047f51
PE
16168 * sound.c: Don't assume sizes fit in 'int'.
16169 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 16170 Return EMACS_INT, not int.
3e047f51 16171 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
16172 Accept EMACS_INT, not int.
16173 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
16174 record read return values.
16175
cc39a9db
BK
161762011-04-15 Ben Key <bkey76@gmail.com>
16177
c9d0ec6d
JB
16178 * keyboard.c (Qundefined): Don't declare static since it is used
16179 in nsfns.m.
16180 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16181 static since they are used in nsfont.m.
cc39a9db 16182
6c60eb9f
SM
161832011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
16184
16185 * process.c (Qprocessp): Don't declare static.
16186 * lisp.h (Qprocessp): Declare again.
16187
7990b61a
JB
161882011-04-15 Juanma Barranquero <lekktu@gmail.com>
16189
16190 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16191
5d4cb038
PE
161922011-04-14 Paul Eggert <eggert@cs.ucla.edu>
16193
8bd7b830 16194 Improve C-level modularity by making more things 'static'.
cd64ea1d 16195
e3b27b31
PE
16196 Don't publish debugger-only interfaces to other modules.
16197 * lisp.h (safe_debug_print, debug_output_compilation_hack):
16198 (verify_bytepos, count_markers): Move decls to the only modules
16199 that need them.
16200 * region-cache.h (pp_cache): Likewise.
16201 * window.h (check_all_windows): Likewise.
16202 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16203
5d4cb038
PE
16204 * sysdep.c (croak): Now static, if
16205 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16206 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
16207
16208 * alloc.c (refill_memory_reserve): Now static if
16209 !defined REL_ALLOC || defined SYSTEM_MALLOC.
16210 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 16211
e87b6180
PE
16212 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
16213 Define only if USE_LUCID.
16214
ac64929e
PE
16215 * xrdb.c (x_customization_string, x_rm_string): Now static.
16216
6f37259d
PE
16217 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
16218 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
16219
1683e3ab
PE
16220 * xdisp.c (draw_row_with_mouse_face): Now static.
16221 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
16222
de9c2632
PE
16223 * window.h (check_all_windows): Mark externally visible.
16224
2b96acb7
PE
16225 * window.c (window_deletion_count): Now static.
16226
16227 * undo.c: Make symbols static if they're not exported.
16228 (last_undo_buffer, last_boundary_position, pending_boundary):
16229 Now static.
16230
50436f33
PE
16231 * textprop.c (interval_insert_behind_hooks): Now static.
16232 (interval_insert_in_front_hooks): Likewise.
16233
64520e5c
PE
16234 * term.c: Make symbols static if they're not exported.
16235 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
16236 (max_frame_lines, tty_set_terminal_modes):
16237 (tty_reset_terminal_modes, tty_turn_off_highlight):
16238 (get_tty_terminal): Now static.
16239 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
16240 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 16241 HAVE_WINDOW_SYSTEM.
64520e5c
PE
16242 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16243 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16244
1fa53021
PE
16245 * sysdep.c: Make symbols static if they're not exported.
16246 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16247 Now static.
16248 (sigprocmask_set, full_mask): Remove; unused.
16249 (wait_debugging): Mark as visible.
16250 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16251 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16252
d4b43b22
PE
16253 * syntax.c (syntax_temp): Define only if !__GNUC__.
16254
b7c513d0
PE
16255 * sound.c (current_sound_device, current_sound): Now static.
16256
989b29ad
PE
16257 * search.c (searchbufs, searchbuf_head): Now static.
16258
13a55a78
PE
16259 * scroll.c (scroll_cost): Remove; unused.
16260 * dispextern.h (scroll_cost): Remove decl.
16261
de68a1fc
PE
16262 * region-cache.h (pp_cache): Mark as externally visible.
16263
40ccffa6
PE
16264 * process.c: Make symbols static if they're not exported.
16265 (process_tick, update_tick, create_process, chan_process):
16266 (Vprocess_alist, proc_buffered_char, datagram_access):
16267 (fd_callback_data, send_process_frame, process_sent_to): Now static.
16268 (deactivate_process): Mark defn as static, as well as decl.
16269 * lisp.h (create_process): Remove decl.
16270 * process.h (chan_process, Vprocess_alist): Remove decls.
16271
ad64fc97
PE
16272 * print.c: Make symbols static if they're not exported.
16273 (print_depth, new_backquote_output, being_printed, print_buffer):
16274 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16275 (print_interval, print_number_index, initial_stderr_stream):
16276 Now static.
16277 * lisp.h (Fprinc): Remove decl.
16278 (debug_output_compilation_hack): Mark as externally visible.
16279
adddb265
PE
16280 * sysdep.c (croak): Move decl from here to syssignal.h.
16281 * syssignal.h (croak): Put it here, so the API can be checked when
16282 'croak' is called from dissociate_if_controlling_tty.
16283
1717ede2
PE
16284 * minibuf.c: Make symbols static if they're not exported.
16285 (minibuf_save_list, choose_minibuf_frame): Now static.
16286 * lisp.h (choose_minibuf_frame): Remove decl.
16287
fa5fb2bc
PE
16288 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16289
1e3890d1
PE
16290 * lread.c: Make symbols static if they're not exported.
16291 (read_objects, initial_obarray, oblookup_last_bucket_number):
16292 Now static.
16293 (make_symbol): Remove; unused.
16294 * lisp.h (initial_obarray, make_symbol): Remove decls.
16295
8a1414fa
PE
16296 * keyboard.c: Make symbols static if they're not exported.
16297 (single_kboard, recent_keys_index, total_keys, recent_keys):
16298 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16299 (this_single_command_key_start, echoing, last_auto_save):
16300 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16301 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16302 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16303 (Vlispy_mouse_stem, double_click_count):
16304 Now static.
16305 (force_auto_save_soon): Define only if SIGDANGER.
16306 (ignore_mouse_drag_p): Now static if
16307 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16308 (print_help): Remove; unused.
16309 (stop_character, last_timer_event): Mark as externally visible.
16310 * keyboard.h (ignore_mouse_drag_p): Declare only if
16311 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16312 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16313 * lisp.h (echoing): Remove decl.
16314 (force_auto_save_soon): Declare only if SIGDANGER.
16315 * xdisp.c (redisplay_window): Simplify code, to make it more
16316 obvious that ignore_mouse_drag_p is not accessed if !defined
16317 USE_GTK && !defined HAVE_NS.
16318
93ea6e8f
PE
16319 * intervals.c: Make symbols static if they're not exported.
16320 (merge_properties_sticky, merge_interval_right, delete_interval):
16321 Now static.
16322 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16323
77382fcc
PE
16324 * insdel.c: Make symbols static if they're not exported.
16325 However, leave prepare_to_modify_buffer alone. It's never
16326 called from outside this function, but that appears to be a bug.
16327 (combine_after_change_list, combine_after_change_buffer):
4889fc82 16328 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
16329 (adjust_after_replace_noundo): Remove; unused.
16330 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 16331 (signal_before_change): Remove decls.
77382fcc 16332
9306c32e
PE
16333 * indent.c (val_compute_motion, val_vmotion): Now static.
16334
cd44d2eb
PE
16335 * image.c: Make symbols static if they're not exported.
16336 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16337 if USE_GTK.
16338 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16339 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16340
ad9a7a06
PE
16341 * fringe.c (standard_bitmaps): Now static.
16342 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16343
81626931
PE
16344 * frame.c: Make symbols static if they're not exported.
16345 (x_report_frame_params, make_terminal_frame): Now static.
16346 (get_frame_param): Now static, unless HAVE_NS.
16347 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16348 (x_get_resource_string): Remove; not used.
16349 * frame.h (make_terminal_frame, x_report_frame_params):
16350 (x_get_resource_string); Remove decls.
16351 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16352 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16353
239f9db9
PE
16354 * font.c, fontset.c: Make symbols static if they're not exported.
16355 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16356 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16357 * font.c (font_close_object): Now static.
16358 * font.h (font_close_object): Remove.
16359 * fontset.c (FONTSET_OBJLIST): Remove.
16360 (free_realized_fontset) #if-0 the body, which does nothing.
16361 (face_suitable_for_char_p): #if-0, as it's never called.
16362 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
16363 * xfaces.c (face_at_string_position):
16364 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
16365 since 0 is always ASCII.
16366
dfcf3579
PE
16367 * fns.c (weak_hash_tables): Now static.
16368
5045092b
PE
16369 * fileio.c: Make symbols static if they're not exported.
16370 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16371 (Vwrite_region_annotation_buffers): Now static.
16372
57a96f5c
PE
16373 * eval.c: Make symbols static if they're not exported.
16374 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16375 * lisp.h (backtrace_list): Remove decl.
16376
35f08c38
PE
16377 * emacs.c: Make symbols static if they're not exported.
16378 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16379 (fatal_error_code, fatal_error_signal_hook, standard_args):
16380 Now static.
16381 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16382 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16383 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16384 * lisp.h (fatal_error_signal_hook): Remove decl.
16385 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16386
f44bd759
PE
16387 * editfns.c: Move a (normally-unused) function to its only use.
16388 * editfns.c, lisp.h (get_operating_system_release): Remove.
16389 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16390 worth the hassle of breaking this out.
16391
b532497d
PE
16392 * xterm.c: Make symbols static if they're not exported.
16393 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16394 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16395 (x_destroy_window, x_delete_display):
16396 Now static.
16397 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16398 (x_mouse_leave): Remove; unused.
16399 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16400 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16401 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16402 Remove decls.
16403 (x_mouse_leave): Declare only if WINDOWSNT.
16404 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16405 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16406 USE_X_TOOLKIT.
16407
1675728f
PE
16408 * ftxfont.c: Make symbols static if they're not exported.
16409 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16410 HAVE_FREETYPE.
16411 * font.h (ftxfont_driver): Likewise.
16412
e4cebfca
PE
16413 * xfns.c: Make symbols static if they're not exported.
16414 (x_last_font_name, x_display_info_for_name):
16415 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16416 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16417 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16418 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16419 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16420 (last_show_tip_args): Now static.
16421 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16422 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16423 (x_screen_planes): Remove; unused.
16424 * dispextern.h (x_screen_planes): Remove decl.
16425
5bf46f05
PE
16426 * dispnew.c: Make symbols static if they're not exported.
16427 * dispextern.h (redraw_garbaged_frames, scrolling):
16428 (increment_row_positions): Remove.
16429 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16430 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16431 Now static.
16432 (redraw_garbaged_frames): Remove; unused.
16433
435f4c28
PE
16434 * xfaces.c: Make symbols static if they're not exported.
16435 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16436 Remove decls.
16437 * xterm.h (defined_color): Remove decls.
16438 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16439 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16440 (menu_face_changed_default, defined_color, free_realized_face):
16441 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16442 (ascii_face_of_lisp_face): Remove; unused.
16443
8524aef3
PE
16444 * xdisp.c: Make symbols static if they're not exported.
16445 * dispextern.h (scratch_glyph_row, window_box_edges):
16446 (glyph_to_pixel_coords, set_cursor_from_row):
16447 (get_next_display_element, set_iterator_to_next):
16448 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16449 (show_mouse_face): Remove decls
16450 * frame.h (message_buf_print): Likewise.
16451 * lisp.h (pop_message, set_message, check_point_in_composition):
16452 Likewise.
16453 * xterm.h (set_vertical_scroll_bar): Likewise.
16454 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16455 (message_buf_print, scratch_glyph_row, displayed_buffer):
16456 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16457 (get_next_display_element, show_mouse_face, window_box_edges):
16458 (frame_to_window_pixel_xy, check_point_in_composition):
16459 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16460 (glyph_to_pixel_coords): Remove; unused.
16461
16390cd2
PE
16462 * dired.c (file_name_completion): Now static.
16463
16464 * dbusbind.c (xd_in_read_queued_messages): Now static.
16465
a25f4dfa
PE
16466 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16467 * data.c (circular_list_error): Remove.
16468
14a9c8df
PE
16469 * commands.h (last_point_position, last_point_position_buffer):
16470 (last_point_position_window): Remove decls.
16471 * keyboard.c: Make these variables static.
16472
04f2d78b
CB
16473 * coding.h (coding, code_convert_region, encode_coding_gap):
16474 Remove decls.
74ab6df5
PE
16475 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16476 (iso_code_class, detect_coding, code_convert_region): Now static.
16477 (encode_coding_gap): Remove; unused.
16478
38dfbee1
PE
16479 * chartab.c (chartab_chars, chartab_bits): Now static.
16480
a2cb4e63
PE
16481 * charset.h (charset_iso_8859_1): Remove decl.
16482 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16483 Now static.
16484
127198fd
PE
16485 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16486 * ccl.c (Vccl_program_table): Now static.
16487 (check_ccl_update): Remove; unused.
16488
d85b608f
PE
16489 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16490 * category.h: ... from here.
16491 * category.c (check_category_table, set_category_set): Now static.
16492
31cd66f3
PE
16493 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16494 * lisp.h: Remove these decls.
16495
c358e587
PE
16496 * buffer.c (buffer_count): Remove unused var.
16497
e78aecca
PE
16498 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16499 so that it's not optimized away.
16500 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16501 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16502 exported only to the debugger.
16503
e192d7d3 16504 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 16505 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 16506
92470028
PE
16507 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16508 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16509 was inaccessible from Lisp.
16510 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16511 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16512
244ed907
PE
16513 alloc.c: Import and export fewer symbols, and remove unused items.
16514 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16515 is defined.
16516 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16517 it's not optimized away by whole-program optimization.
16518 (message_enable_multibyte, free_misc): Remove.
16519 (catchlist, handlerlist, mark_backtrace):
16520 Declare only if BYTE_MARK_STACK.
16521 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16522 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16523 (message_enable_multibyte): Remove decl.
16524 (free_misc, interval_free_list, float_block, float_block_index):
16525 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16526 (cons_free_list, last_marked_index):
16527 Now static.
16528 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16529 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16530 (mark_backtrace): Define only if BYTE_MARK_STACK.
16531 * xdisp.c (message_enable_multibyte): Now static.
16532
61c2b50e 16533 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
16534 This makes it easier for human readers (and static analyzers)
16535 to see whether these variables are used from other modules.
16536 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16537 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16538 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16539 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16540 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16541 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16542 * xmenu.c, xselect.c:
16543 Declare Q* vars static if they are not used in other modules.
16544 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16545 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16546 Remove decls of unexported vars.
16547 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16548
95c82688
PE
16549 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16550
16a97296
PE
16551 Make Emacs functions such as Fatom 'static' by default.
16552 This makes it easier for human readers (and static analyzers)
16553 to see whether these functions can be called from other modules.
16554 DEFUN now defines a static function. To make the function external
16555 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
16556 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16557 (Finit_image_library):
16a97296
PE
16558 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16559 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16560 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16561 Remove decls, since these functions are now static.
16562 (Funintern, Fget_internal_run_time): New decls, since these functions
16563 were already external.
95c82688 16564
16a97296
PE
16565 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16566 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16567 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16568 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16569 * keyboard.c, keymap.c, lread.c:
16570 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16571 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16572 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16573 Mark functions with DEFUE instead of DEFUN,
16574 if they are used in other modules.
16575 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16576 decls for now-static functions.
16577 * buffer.h (Fdelete_overlay): Remove decl.
16578 * callproc.c (Fgetenv_internal): Mark as internal.
16579 * composite.c (Fremove_list_of_text_properties): Remove decl.
16580 (Fcomposition_get_gstring): New forward static decl.
16581 * composite.h (Fcomposite_get_gstring): Remove decl.
16582 * dired.c (Ffile_attributes): New forward static decl.
16583 * doc.c (Fdocumntation_property): New forward static decl.
16584 * eval.c (Ffetch_bytecode): New forward static decl.
16585 (Funintern): Remove extern decl; now in .h file where it belongs.
16586 * fileio.c (Fmake_symbolic_link): New forward static decl.
16587 * image.c (Finit_image_library): New forward static decl.
16588 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16589 * intervals.h (Fprevious_property_change):
16590 (Fremove_list_of_text_properties): Remove decls.
16591 * keyboard.c (Fthis_command_keys): Remove decl.
16592 (Fcommand_execute): New forward static decl.
16593 * keymap.c (Flookup_key): New forward static decl.
16594 (Fcopy_keymap): Now static.
16595 * keymap.h (Flookup_key): Remove decl.
16596 * process.c (Fget_process): New forward static decl.
16597 (Fprocess_datagram_address): Mark as internal.
16598 * syntax.c (Fsyntax_table_p): New forward static decl.
16599 (skip_chars): Remove duplicate decl.
16600 * textprop.c (Fprevious_property_change): New forward static decl.
16601 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16602 Now internal.
16603 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16604 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16605
785bbd42
PE
16606 * editfns.c (Fformat): Remove unreachable code.
16607
8b913b57
AS
166082011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16609
16610 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16611 change. (Bug#8496)
16612
a6744a35
EZ
166132011-04-13 Eli Zaretskii <eliz@gnu.org>
16614
16615 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16616 when at ZV. (Bug#8487)
16617
e7974947
AS
166182011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16619
baad03f0
AS
16620 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16621 (Bug#8437)
16622 * keyboard.c (parse_tool_bar_item): Likewise.
16623 * sound.c (sound_cleanup, alsa_close): Likewise.
16624 * termcap.c (tgetent): Likewise.
16625 * xfns.c (x_default_font_parameter): Likewise.
16626 * xsettings.c (read_and_apply_settings): Likewise.
16627
e7974947
AS
16628 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16629 (overrun_check_free): Protoize.
16630
28272684
PE
166312011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16632
16633 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16634 since callers should never pass a negative size.
16635 Change the signature to match that of plain 'read' and 'write'; see
16636 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16637 * lisp.h: Update prototypes of emacs_write and emacs_read.
16638
11997c76
EZ
166392011-04-11 Eli Zaretskii <eliz@gnu.org>
16640
16641 * xdisp.c (redisplay_window): Don't try to determine the character
16642 position of the scroll margin if the window start point w->startp
e896f03c 16643 is outside the buffer's accessible region. (Bug#8468)
11997c76 16644
8a2cbd72
EZ
166452011-04-10 Eli Zaretskii <eliz@gnu.org>
16646
16647 Fix write-region and its subroutines for buffers > 2GB.
16648 * fileio.c (a_write, e_write): Modify declaration of arguments and
16649 local variables to support buffers larger than 2GB.
16650 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16651
16652 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16653 argument, local variables, and return value.
16654
16655 * lisp.h: Update prototypes of emacs_write and emacs_read.
16656
16657 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16658
4073e537 166592011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 16660
1ebfdcb6
PE
16661 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16662
b2ded58d
PE
16663 Fix more problems found by GCC 4.6.0's static checks.
16664
7d66342c
PE
16665 * xdisp.c (vmessage): Use a better test for character truncation.
16666
bbf47d44
PE
16667 * charset.c (load_charset_map): <, not <=, for optimization,
16668 and to avoid potential problems with integer overflow.
9248994d 16669 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 16670 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 16671 * editfns.c (Fformat): Likewise.
1e69125e 16672 * syntax.c (skip_chars): Likewise.
3befa583 16673
e3019616
PE
16674 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16675 This also lets GCC 4.6.0 generate slightly better loop code.
16676
becfa255
PE
16677 * callint.c (Fcall_interactively): <, not <=, for optimization.
16678 (Fcall_interactively): Count the number of arguments produced,
16679 not the number of arguments given. This is simpler and lets GCC
16680 4.6.0 generate slightly better code.
16681
dae0cd48
PE
16682 * ftfont.c: Distingish more carefully between FcChar8 and char.
16683 The previous code passed unsigned char * to a functions like
16684 strlen and xstrcasecmp that expect char *, which does not
16685 conform to the C standard.
16686 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16687 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16688 char * when the C standard requires it.
16689
76032d70
PE
16690 * keyboard.c (read_char): Remove unused var.
16691
eb3f1cc8
PE
16692 * eval.c: Port to Windows vsnprintf (Bug#8435).
16693 Include <limits.h>.
16694 (SIZE_MAX): Define if the headers do not.
16695 (verror): Do not give up if vsnprintf returns a negative count.
16696 Instead, grow the buffer. This ports to Windows vsnprintf, which
16697 does not conform to C99. Problem reported by Eli Zaretskii.
16698 Also, simplify the allocation scheme, by avoiding the need for
16699 calling realloc, and removing the ALLOCATED variable.
16700
70476b54
PE
16701 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16702
12020a9e
PE
16703 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16704 But keep the doprint source code for now, as we might revamp it
16705 and use it again (Bug#8435).
ea6c7ae6
PE
16706 * lisp.h (doprnt): Remove.
16707 * Makefile.in (base_obj): Remove doprnt.o.
16708 * deps.mk (doprnt.o): Remove.
16709
5fdb398c
PE
16710 error: Print 32- and 64-bit integers portably (Bug#8435).
16711 Without this change, on typical 64-bit hosts error ("...%d...", N)
16712 was used to print both 32- and 64-bit integers N, which relied on
16713 undefined behavior.
61bdb816 16714 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
16715 * lisp.h (error, verror): Mark as printf-like functions.
16716 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16717 Report overflow in size calculations when allocating printf buffer.
16718 Do not truncate output string at its first null byte.
16719 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16720 Truncate the output at a character boundary, since vsnprintf does not
16721 do that.
16722 * charset.c (check_iso_charset_parameter): Convert internal
16723 character to string before calling 'error', since %c now has the
16724 printf meaning.
16725 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16726 overflow when computing char to be passed to 'error'. Do not
16727 pass Lisp_Object to 'error'; pass the integer instead.
16728 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16729 formatted with plain %d.
16730
b189fa66
PE
16731 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16732
bff87ef0
PE
16733 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16734
7e2cac20
PE
16735 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16736
ce4d90b5
PE
16737 * xterm.c (x_catch_errors): Remove duplicate declaration.
16738
266c9547
PE
16739 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16740
79c49ad2
PE
16741 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16742
368f4090
JM
167432011-04-10 Jim Meyering <meyering@redhat.com>
16744
16745 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16746 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16747 return ssize_t not "int", and use size_t as the buffer length.
16748 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16749 * gnutls.h: Update declarations.
16750 * process.c (read_process_output): Use ssize_t, to match.
16751 (send_process): Likewise.
16752
a32d4040
CY
167532011-04-09 Chong Yidong <cyd@stupidchicken.com>
16754
16755 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16756
8546720e 167572011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 16758
04f2d78b
CB
16759 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16760 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 16761
8546720e
GM
16762 * xterm.c (handle_one_xevent):
16763 * xmenu.c (create_and_show_popup_menu):
16764 * xselect.c (x_decline_selection_request)
16765 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 16766
0a2f5c1a 167672011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
16768
16769 Fix some uses of `int' instead of EMACS_INT.
16770 * search.c (string_match_1, fast_string_match)
16771 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16772 (scan_buffer, find_next_newline_no_quit)
16773 (find_before_next_newline, search_command, Freplace_match)
16774 (Fmatch_data): Make some `int' variables be EMACS_INT.
16775
16776 * xdisp.c (display_count_lines): 3rd argument and return value now
16777 EMACS_INT. All callers changed.
16778 (pint2hrstr): Last argument is now EMACS_INT.
16779
16780 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16781 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16782 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16783 (decode_coding_utf_16, decode_coding_emacs_mule)
16784 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16785 (decode_coding_ccl, decode_coding_charset)
16786 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16787 (decode_coding_iso_2022, decode_coding_emacs_mule)
16788 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16789 <char_offset, last_offset>: Declare EMACS_INT.
16790 (encode_coding_utf_8, encode_coding_utf_16)
16791 (encode_coding_emacs_mule, encode_invocation_designation)
16792 (encode_designation_at_bol, encode_coding_iso_2022)
16793 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16794 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16795 Declare EMACS_INT.
16796 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16797 (encode_invocation_designation): Last argument P_NCHARS is now
16798 EMACS_INT.
16799 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16800 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16801
16802 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16803 All users changed.
16804
16805 * ccl.c (Fccl_execute_on_string): Declare some variables
16806 EMACS_INT.
16807
8546720e 168082011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
16809
16810 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16811
4e19a977
CS
168122011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16813
16814 * process.c (Fformat_network_address): Doc fix.
16815
87302331
R
168162011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16817
ee7683eb 16818 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 16819
cbb59342
CY
168202011-04-08 Chong Yidong <cyd@stupidchicken.com>
16821
16822 * keyboard.c (read_char): Call Lisp function help-form-show,
16823 instead of using internal_with_output_to_temp_buffer.
16824 (Qhelp_form_show): New var.
e0d38eeb 16825 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
16826
16827 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16828
16829 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16830
e67a13ab
CY
168312011-04-06 Chong Yidong <cyd@stupidchicken.com>
16832
04f2d78b
CB
16833 * process.c (Flist_processes): Remove to Lisp.
16834 (list_processes_1): Delete.
e67a13ab 16835
973f782d
EZ
168362011-04-06 Eli Zaretskii <eliz@gnu.org>
16837
7c106b1e
EZ
16838 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16839
973f782d
EZ
16840 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16841
41cf7d1a 168422011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 16843
ca23cc88
PE
16844 Fix more problems found by GCC 4.6.0's static checks.
16845
f390e2d5
PE
16846 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16847
42eea0d0
PE
16848 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16849
b69769da 16850 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 16851
f9541e84
PE
16852 * xdisp.c (vmessage): Mark as a printf-like function.
16853
13841b55
PE
16854 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16855
c136c10f
PE
16856 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16857
5e2d4a30
PE
16858 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16859 printf-like functions.
16860 (tiff_load): Add casts to remove these marks before passing them
16861 to system-supplied API.
16862
583f48b9
PE
16863 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16864
b25d760e
PE
16865 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16866 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
16867 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16868 directly, rather than having caller test rule sign. This avoids
16869 some unnecessary tests.
16870 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16871 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16872 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 16873
bc7b6697 16874 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 16875 (xfont_open): Avoid unnecessary tests.
bc7b6697 16876
27ccc379
PE
16877 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16878
dcd5c89a
PE
16879 * composite.h, composite.c (composition_gstring_put_cache):
16880 Use EMACS_INT, not int, for length.
16881
b13a45c6
PE
16882 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16883 breaking out part of COMPOSITION_DECODE_RULE.
16884 (COMPOSITION_DECODE_RULE): Use it.
16885 * composite.c (get_composition_id): Remove unused local vars,
16886 by using the new macro.
16887
1e792e4d
PE
16888 * textprop.c (set_text_properties_1): Change while to do-while,
16889 since the condition is always true at first.
16890
dc6c6455 16891 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
16892 (interval_deletion_adjustment): Return unsigned value.
16893 All uses changed.
dc6c6455 16894
aba7731a
PE
16895 * process.c (list_processes_1, create_pty, read_process_output):
16896 (exec_sentinel): Remove vars that were set but not used.
afd4052b 16897 (create_pty): Remove unnecessary "volatile"s.
bc57d757 16898 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 16899 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 16900 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 16901
fdfc4bf3
PE
16902 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16903
fca8fe46 16904 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 16905 (update_syntax_table): Use unsigned instead of int.
fca8fe46 16906
06a0259a 16907 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 16908 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 16909 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 16910
e7b9e80f
PE
16911 * print.c (print_error_message): Avoid int overflow.
16912
56201685
PE
16913 * font.c (font_list_entities): Redo for clarity,
16914 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16915
78834453 16916 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 16917 (font_score): Avoid potential overflow in diff calculation.
78834453 16918
0bc0b309 16919 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 16920 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 16921
e610eaca
PE
16922 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16923
b895abce
PE
16924 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16925 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16926 can always succeed if overflow has undefined behavior.
16927
1f1d9321 16928 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 16929 (wordify): Omit three unnecessary tests.
1f1d9321 16930
c59478bc
PE
16931 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16932 All callers changed. This avoids the need for an unused var.
16933
79b73827
PE
16934 * casefiddle.c (casify_region): Remove var that is set but not used.
16935
a4db5dfe
PE
16936 * dired.c (file_name_completion): Remove var that is set but not used.
16937
43aae36e
PE
16938 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16939
2a47c44d 16940 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 16941 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 16942
a37c69bf
PE
16943 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16944 Check for integer overflow on size calculations.
16945
328ab8e7
PE
16946 * buffer.c (Fprevious_overlay_change): Remove var that is set
16947 but not used.
16948
e5a2a5cb
PE
16949 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16950 Remove vars that are set but not used.
8d84a6eb 16951 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 16952 (timer_check_2): Mark vars as initialized.
e5a2a5cb 16953
a60e5f68
PE
16954 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16955
f661cb61 16956 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 16957 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 16958
f0397f5a
PE
16959 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16960 that are set but not used.
16961
8664db06 16962 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 16963 if XCreateBitmapFromData fails (Bug#8410).
8664db06 16964
6abdaa4a
PE
16965 * xselect.c (x_get_local_selection, x_handle_property_notify):
16966 Remove vars that are set but not used.
16967
0ce7538d 16968 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 16969 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 16970
9ae848fc
PE
16971 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16972 Remove var that is set but not used.
0b918413
PE
16973 (scroll_bar_windows_size): Now size_t, not int.
16974 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16975 Check for overflow.
9ae848fc 16976
a5a62657
PE
16977 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16978 (map_tty_color) [!defined MSDOS]: Likewise.
16979
5c5cdd39
PE
16980 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16981
66ebf983
PE
16982 * coding.c: Remove vars that are set but not used.
16983 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16984 All callers changed.
16985 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16986 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16987 (decode_coding_charset): Remove vars that are set but not used.
16988
1be4d761
PE
16989 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16990 that is set but not used.
16991
47553fa8
PE
16992 * print.c (print_object): Remove var that is set but not used.
16993
1f7196bf 16994 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
16995 The gnulib version avoids calling malloc in the usual case,
16996 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16997 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16998 * filelock.c (current_lock_owner): Likewise.
16999 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17000 * sysdep.c: Include allocator.h, careadlinkat.h.
17001 (emacs_no_realloc_allocator): New static constant.
17002 (emacs_readlink): New function.
fdb61804
PE
17003 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17004 ../lib/careadlinkat.h.
d1fdcab7 17005
f84c17c7
SM
170062011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
17007
17008 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17009 first non-nil return value).
17010
ef3862ad
JD
170112011-04-03 Jan Djärv <jan.h.d@swipnet.se>
17012
17013 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17014 if not defined (Bug#8403).
17015
376a7006
JB
170162011-04-02 Juanma Barranquero <lekktu@gmail.com>
17017
17018 * xdisp.c (display_count_lines): Remove parameter `start',
17019 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17020 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17021 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17022 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17023 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17024 and thereabouts. All callers changed.
17025 (get_per_char_metric): Remove parameter `f', unused since
17026 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17027
6ca3801d
JM
170282011-04-02 Jim Meyering <meyering@redhat.com>
17029
17030 do not dereference NULL upon failed strdup
17031 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17032 (ns_get_family): Likewise.
17033
d8e2b5ba
JB
170342011-04-02 Juanma Barranquero <lekktu@gmail.com>
17035
17036 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17037
8c74fcbd
JD
170382011-04-02 Jan Djärv <jan.h.d@swipnet.se>
17039
17040 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17041 later (Bug#8403).
17042
7200d79c
SM
170432011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
17044
03408648 17045 Add lexical binding.
7200d79c 17046
03408648
SM
17047 * window.c (Ftemp_output_buffer_show): New fun.
17048 (Fsave_window_excursion):
17049 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17050
17051 * lread.c (lisp_file_lexically_bound_p): New function.
17052 (Fload): Bind Qlexical_binding.
17053 (readevalloop): Remove `evalfun' arg.
17054 Bind Qinternal_interpreter_environment.
17055 (Feval_buffer): Bind Qlexical_binding.
17056 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
17057 Mark as dynamic.
17058 (syms_of_lread): Declare `lexical-binding'.
17059
17060 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
17061
17062 * keyboard.c (eval_dyn): New fun.
17063 (menu_item_eval_property): Use it.
ca105506
SM
17064
17065 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 17066
03408648
SM
17067 * fns.c (concat, mapcar1): Accept byte-code-functions.
17068
17069 * eval.c (Fsetq): Handle lexical vars.
17070 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
17071 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
17072 (FletX, Flet): Obey lexical binding.
17073 (Fcommandp): Handle closures.
17074 (Feval): New `lexical' arg.
17075 (eval_sub): New function extracted from Feval. Use it almost
17076 everywhere where Feval was used. Look up vars in lexical env.
17077 Handle closures.
17078 (Ffunctionp): Move from subr.el.
17079 (Ffuncall): Handle closures.
17080 (apply_lambda): Remove `eval_flags'.
17081 (funcall_lambda): Handle closures and new byte-code-functions.
17082 (Fspecial_variable_p): New function.
17083 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
17084 but without exporting it to Lisp.
23aba0ea 17085
23aba0ea 17086 * doc.c (Fdocumentation, store_function_docstring):
03408648 17087 * data.c (Finteractive_form): Handle closures.
23aba0ea 17088
03408648
SM
17089 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
17090 interactive spec.
ba83908c 17091
04f2d78b
CB
17092 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
17093 New byte-codes.
03408648
SM
17094 (exec_byte_code): New function extracted from Fbyte_code to handle new
17095 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 17096
03408648 17097 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 17098
03408648 17099 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 17100
e2abce01
JB
171012011-03-31 Juanma Barranquero <lekktu@gmail.com>
17102
17103 * xdisp.c (redisplay_internal): Fix prototype.
17104
63696a73 171052011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 17106
63696a73 17107 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
17108 (try_scrolling): Use it when setting scroll_limit.
17109 Limit scrolling to 100 screen lines.
63696a73
EZ
17110 (redisplay_window): Even when falling back on "recentering",
17111 position point in the window according to scroll-conservatively,
17112 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
17113
17114 (try_scrolling): When point is above the window, allow searching
17115 as far as scroll_max, or one screenful, to compute vertical
17116 distance from PT to the scroll margin position. This prevents
17117 try_scrolling from unnecessarily failing when
17118 scroll-conservatively is set to a value slightly larger than the
17119 window height. Clean up the case of PT below the margin at bottom
17120 of window: scroll_max can no longer be INT_MAX. When aggressive
17121 scrolling is in use, don't let point enter the opposite scroll
17122 margin as result of the scroll.
17123 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
17124 threshold of 100 lines for never-recentering scrolling.
17125
e4cc2dfc
JB
171262011-03-31 Juanma Barranquero <lekktu@gmail.com>
17127
17128 * dispextern.h (move_it_by_lines):
17129 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17130 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
17131 (message_log_check_duplicate): Remove parameters `prev_bol' and
17132 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17133 (redisplay_internal): Remove parameter `preserve_echo_area',
17134 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
17135
17136 * indent.c (Fvertical_motion):
17137 * window.c (window_scroll_pixel_based, Frecenter):
17138 Don't pass `need_y_p' to `move_it_by_lines'.
17139
1c470562
SM
171402011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
17141
44f230aa
SM
17142 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17143 steal a few bits to be more compact.
17144 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17145 Remove unneeded casts.
17146
1c470562
SM
17147 * bytecode.c (Fbyte_code): CAR and CDR can GC.
17148
888adce9
ZK
171492011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
17150
17151 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17152 binding" message (bug#7967).
17153
f838ed7b
PE
171542011-03-30 Paul Eggert <eggert@cs.ucla.edu>
17155
77861b95
PE
17156 Fix more problems found by GCC 4.6.0's static checks.
17157
de6dbc14
PE
17158 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17159 Remove unused local var.
17160
f838ed7b
PE
17161 * editfns.c (Fmessage_box): Remove unused local var.
17162
792c7b2b
PE
17163 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17164 (note_mode_line_or_margin_highlight, note_mouse_highlight):
17165 Omit unused local vars.
c499e557 17166 * window.c (shrink_windows): Omit unused local var.
b01a1c29 17167 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
17168 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17169 Omit unused local var.
17170
ba0165e1
PE
17171 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17172 Don't assume string length fits in int.
32ad8845 17173 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 17174 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 17175
3c59b4c9
PE
17176 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17177 instead of alloca (Bug#8344).
17178
a3eed478 17179 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 17180 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 17181
eb4d412d
PE
17182 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17183
1658b401
PE
17184 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17185 concerns.
17186
17187 * term.c (produce_glyphless_glyph): Remove unnecessary test.
17188
17189 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 17190
9a2c6e05
PE
17191 * keyboard.c (syms_of_keyboard): Use the same style as later
17192 in this function when indexing through an array. This also
17193 works around GCC bug 48267.
17194
03d0a109
PE
17195 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17196
44f730c8
PE
17197 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17198
fe75f926
PE
17199 * chartab.c (sub_char_table_ref_and_range): Redo for slight
17200 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17201
ffa8c828
PE
17202 * keyboard.c, keyboard.h (num_input_events): Now size_t.
17203 This avoids undefined behavior on integer overflow, and is a bit
17204 more convenient anyway since it is compared to a size_t variable.
17205
c5101a77
PE
17206 Variadic C functions now count arguments with size_t, not int.
17207 This avoids an unnecessary limitation on 64-bit machines, which
17208 caused (substring ...) to crash on large vectors (Bug#8344).
17209 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
17210 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 17211 All variadic functions and their callers changed accordingly.
c5101a77
PE
17212 (struct gcpro.nvars): Now size_t, not int. All uses changed.
17213 * data.c (arith_driver, float_arith_driver): Likewise.
17214 * editfns.c (general_insert_function): Likewise.
17215 * eval.c (struct backtrace.nargs, interactive_p)
17216 (internal_condition_case_n, run_hook_with_args, apply_lambda)
17217 (funcall_lambda, mark_backtrace): Likewise.
17218 * fns.c (concat): Likewise.
17219 * frame.c (x_set_frame_parameters): Likewise.
17220 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
17221 0 if not found, not -1. All callers changed.
17222
dd3f25f7
PE
17223 * alloc.c (garbage_collect): Don't assume stack size fits in int.
17224 (stack_copy_size): Now size_t, not int.
17225 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
17226
461c2ab9
JB
172272011-03-28 Juanma Barranquero <lekktu@gmail.com>
17228
17229 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
17230 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17231 All callers changed.
17232
17233 * lisp.h (multibyte_char_to_unibyte):
17234 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
17235 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17236 * character.h (CHAR_TO_BYTE8):
17237 * cmds.c (internal_self_insert):
17238 * editfns.c (general_insert_function):
17239 * keymap.c (push_key_description):
17240 * search.c (Freplace_match):
17241 * xdisp.c (message_dolog, set_message_1): All callers changed.
17242
f6d62986
SM
172432011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
17244
17245 * keyboard.c (safe_run_hook_funcall): New function.
17246 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17247 don't set the hook to nil, but remove the offending function instead.
17248 (Qcommand_hook_internal): Remove, unused.
17249 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17250 Vcommand_hook_internal.
17251
17252 * eval.c (enum run_hooks_condition): Remove.
17253 (funcall_nil, funcall_not): New functions.
17254 (run_hook_with_args): Call each function through a `funcall' argument.
17255 Remove `cond' argument, now redundant.
17256 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17257 (Frun_hook_with_args_until_failure): Adjust accordingly.
17258 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17259
1db5b1ad
JB
172602011-03-28 Juanma Barranquero <lekktu@gmail.com>
17261
17262 * dispextern.h (string_buffer_position): Remove declaration.
17263
17264 * print.c (strout): Remove parameter `multibyte', unused since
17265 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
17266
17267 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17268 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17269 All callers changed.
17270
17271 * w32.c (_wsa_errlist): Use braces for struct initializers.
17272
17273 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17274 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17275 All callers changed.
17276 (string_buffer_position): Likewise. Also, make static (it's never
17277 used outside xdisp.c).
17278 (cursor_row_p): Remove parameter `w', unused since
17279 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
17280 (decode_mode_spec): Remove parameter `precision', introduced during
17281 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17282 All callers changed.
17283
5ffb62aa
JD
172842011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17285
17286 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17287
461c2ab9 172882011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
17289
17290 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17291 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17292 (ns_update_auto_hide_menu_bar): New functions.
17293 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17294 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17295 ns_constrain_all_frames.
17296 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17297 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17298
5c380ffb
JD
172992011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17300
17301 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17302
9af30bdf
GM
173032011-03-27 Glenn Morris <rgm@gnu.org>
17304
17305 * syssignal.h: Replace RETSIGTYPE with void.
17306 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17307 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17308 Replace SIGTYPE with void everywhere.
17309 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17310 * s/template.h (SIGTYPE): Remove commented out definition.
17311
e2abce01
JB
173122011-03-26 Eli Zaretskii <eliz@gnu.org>
17313
17314 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17315 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17316
f868cd8a
JB
173172011-03-26 Juanma Barranquero <lekktu@gmail.com>
17318
59eb0929
JB
17319 * w32.c (read_unc_volume): Use parameter `henum', instead of
17320 global variable `wget_enum_handle'.
17321
17322 * keymap.c (describe_vector): Remove parameters `indices' and
17323 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17324 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17325
f868cd8a
JB
17326 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17327
17328 * keyboard.c (timer_check): Remove parameter `do_it_now',
17329 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17330 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17331 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17332
17333 * keyboard.c (read_char):
17334 * w32menu.c (w32_menu_display_help):
17335 * xmenu.c (show_help_event, menu_help_callback):
17336 Adjust calls to `show_help_echo'.
17337
17338 * gtkutil.c (xg_maybe_add_timer):
17339 * keyboard.c (readable_events):
17340 * process.c (wait_reading_process_output):
17341 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17342
17343 * insdel.c (adjust_markers_gap_motion):
17344 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17345 (gap_left, gap_right): Don't call it.
17346
2ecf6fdb
CY
173472011-03-25 Chong Yidong <cyd@stupidchicken.com>
17348
17349 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17350 incurred during fontification.
17351
6b1f9ba4
JB
173522011-03-25 Juanma Barranquero <lekktu@gmail.com>
17353
17354 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17355 (DEFVAR_PER_BUFFER): Don't pass it.
17356
17357 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17358 (scrolling_window): Don't pass it.
17359
0f4a96b5
JB
173602011-03-25 Juanma Barranquero <lekktu@gmail.com>
17361
17362 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17363
17364 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17365 and `suffix'.
17366 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17367 of variables specific to SELinux and computation of `encoded_absname'.
17368
17369 * image.c (XPutPixel): Remove unused variable `height'.
17370
17371 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17372
17373 * unexw32.c (get_section_info): Remove unused variable `section'.
17374
17375 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17376 (system_process_attributes): Remove unused variable `sess'.
17377 (sys_read): Remove unused variable `err'.
17378
17379 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17380 (w32_wnd_proc): Remove unused variable `isdead'.
17381 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17382 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17383 (x_create_tip_frame): Remove unused variable `tem'.
17384
17385 * w32inevt.c (w32_console_read_socket):
17386 Remove unused variable `no_events'.
17387
17388 * w32term.c (x_draw_composite_glyph_string_foreground):
17389 Remove unused variable `width'.
17390
1149507c
JB
173912011-03-24 Juanma Barranquero <lekktu@gmail.com>
17392
17393 * w32term.c (x_set_glyph_string_clipping):
17394 Don't pass uninitialized region to CombineRgn.
17395
9c88f339
JB
173962011-03-23 Juanma Barranquero <lekktu@gmail.com>
17397
17398 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17399 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17400 (Fx_close_connection): Remove unused variable `i'.
17401
17402 * w32font.c (w32font_draw): Return number of glyphs.
17403 (w32font_open_internal): Remove unused variable `i'.
17404 (w32font_driver): Add missing initializer.
17405
17406 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17407 (fill_in_menu): Remove unused variable `items_added'.
17408
17409 * w32term.c (last_mouse_press_frame): Remove static global variable.
17410 (w32_clip_to_row): Remove unused variable `f'.
17411 (x_delete_terminal): Remove unused variable `i'.
17412
17413 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17414 (NOTHING): Remove unused static global variable.
17415 (uniscribe_check_otf): Remove unused variable `table'.
17416 (uniscribe_font_driver): Add missing initializers.
17417
dee091a3
JD
174182011-03-23 Julien Danjou <julien@danjou.info>
17419
17420 * term.c (Fsuspend_tty, Fresume_tty):
17421 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17422 * window.c (temp_output_buffer_show):
17423 * insdel.c (signal_before_change):
17424 * frame.c (Fhandle_switch_frame):
17425 * fileio.c (Fdo_auto_save):
17426 * emacs.c (Fkill_emacs):
17427 * editfns.c (save_excursion_restore):
17428 * cmds.c (internal_self_insert):
17429 * callint.c (Fcall_interactively):
17430 * buffer.c (Fkill_all_local_variables):
17431 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17432 Use Frun_hooks.
0f4a96b5 17433 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 17434 unconditionally since it does the check itself.
dee091a3 17435
2c520ab5 174362011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 17437
c9c49752
PE
17438 Fix more problems found by GCC 4.5.2's static checks.
17439
8abc3f12
PE
17440 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17441 the first time through the loop, since we know p0 < p1 then.
17442 This also avoids a gcc -Wstrict-overflow warning.
17443
a2d26660
PE
17444 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17445 leading to a memory leak, possible in functions like
17446 load_charset_map_from_file that can allocate an unbounded number
b12ef411 17447 of objects (Bug#8318).
a2d26660 17448
916c72e9
PE
17449 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17450 that could (at least in theory) be that large.
17451
19ab8a18
PE
17452 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17453 This is less likely to overflow, and avoids undefined behavior if
17454 overflow does occur. All callers changed. Use strtoul to scan
17455 for the unsigned long integer.
b7cbbd6f
PE
17456 (pint2hrstr): Simplify and tune code slightly.
17457 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 17458
f0641eff
PE
17459 * scroll.c (do_scrolling): Work around GCC bug 48228.
17460 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17461
7f650bb9
PE
17462 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17463 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
17464 (validate_x_resource_name): Simplify count usage.
17465 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 17466
37dd57d1
PE
17467 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17468 fail (Bug#8306).
81e56e61 17469
699979fc 17470 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 17471
401bf9b4
PE
17472 * process.c (Fmake_network_process): Use socklen_t, not int,
17473 where POSIX says socklen_t is required in portable programs.
17474 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 17475 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
17476 (Fmake_network_process, server_accept_connection):
17477 (wait_reading_process_output, read_process_output):
17478 Likewise.
17479
b93aacde
PE
17480 * process.c: Rename or move locals to avoid shadowing.
17481 (list_processes_1, Fmake_network_process):
17482 (read_process_output_error_handler, exec_sentinel_error_handler):
17483 Rename or move locals.
4dc343ee 17484 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 17485 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 17486 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 17487 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 17488 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 17489
af8a867c 17490 Make tparam.h and terminfo.c consistent.
44f230aa
SM
17491 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17492 Include tparam.h instead, since it declares them.
af8a867c
PE
17493 * cm.h (PC): Remove extern decl; tparam.h now does this.
17494 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17495 * terminfo.c: Include tparam.h, to check interfaces.
17496 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17497 (tparam): Adjust signature to match interface in tparam.h;
17498 this removes some undefined behavior. Check that outstring and len
17499 are zero, which they always are with Emacs.
17500 * tparam.h (PC, BC, UP): New extern decls.
17501
0248044d 17502 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 17503 (xftfont_open): Rename locals to avoid shadowing.
0248044d 17504
8ff096c1 17505 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
17506 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17507 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 17508 (ftfont_list): Remove unused local.
49eaafba
PE
17509 (get_adstyle_property, ftfont_pattern_entity):
17510 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17511 Rename locals to avoid shadowing.
8ff096c1 17512
e2be39f6
PE
17513 * xfont.c (xfont_list_family): Mark var as initialized.
17514
c9735e30
PE
17515 * xml.c (make_dom): Now static.
17516
8f5201ae
PE
17517 * composite.c (composition_compute_stop_pos): Rename local to
17518 avoid shadowing.
b246f932
PE
17519 (composition_reseat_it): Remove unused locals.
17520 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 17521 (composition_update_it): Mark var as initialized.
11b61122
PE
17522 (find_automatic_composition): Mark vars as initialized,
17523 with a FIXME (Bug#8290).
8f5201ae 17524
760fbc2c
PE
17525 character.h: Rename locals to avoid shadowing.
17526 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17527 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17528 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17529 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17530 to avoid shadowing.
17531
ff08eb85
PE
17532 * textprop.c (property_change_between_p): Remove; unused.
17533
fc7bf025
PE
17534 * intervals.c (interval_start_pos): Now static.
17535
235d7abc
PE
17536 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17537
44f230aa
SM
17538 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17539 Rename locals to avoid shadowing.
3e7d6594 17540
50060332
PE
17541 * sound.c (wav_play, au_play, Fplay_sound_internal):
17542 Fix pointer signedness.
d01f234b 17543 (alsa_choose_format): Remove unused local var.
c83b8872
PE
17544 (wav_play): Initialize a variable to 0, to prevent undefined
17545 behavior (Bug#8278).
50060332 17546
c4fc4e30
PE
17547 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17548
918436ed
PE
17549 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17550
c939f91b
PE
17551 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17552 clobbering (Bug#8298).
b9c7f648
PE
17553 * sysdep.c (sys_subshell): Likewise.
17554 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 17555
6bd8c144
PE
17556 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17557 This should get cleaned up, so that child_setup has the
17558 same signature on all platforms.
17559
7710357c 17560 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 17561 (relocate_fd): Rename locals to avoid shadowing.
7710357c 17562
c59da222
CY
175632011-03-22 Chong Yidong <cyd@stupidchicken.com>
17564
17565 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17566 not to be necessary, and produces flickering.
17567
66b87493
GM
175682011-03-20 Glenn Morris <rgm@gnu.org>
17569
17570 * config.in: Remove file.
17571
45b6f6d5
JB
175722011-03-20 Juanma Barranquero <lekktu@gmail.com>
17573
17574 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17575 are now in src/globals.h.
17576 (syms_of_minibuf): Remove spurious & from previous change.
17577
cd394be1 175782011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
17579
17580 * minibuf.c (completing-read-function): New variable.
17581 (completing-read-default): Rename from completing-read.
17582 (completing-read): Call completing-read-function.
17583
b14e3e21
CY
175842011-03-19 Juanma Barranquero <lekktu@gmail.com>
17585
17586 * xfaces.c (Fx_load_color_file):
17587 Read color file from absolute filename (bug#8250).
17588
f2b726e6
JB
175892011-03-19 Juanma Barranquero <lekktu@gmail.com>
17590
17591 * makefile.w32-in: Update dependencies.
17592
09f6ff02
EZ
175932011-03-17 Eli Zaretskii <eliz@gnu.org>
17594
17595 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17596
29a6015a
PE
175972011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17598
a3a6c54e
PE
17599 Fix more problems found by GCC 4.5.2's static checks.
17600
b766f867
PE
17601 * process.c (make_serial_process_unwind, send_process_trap):
17602 (sigchld_handler): Now static.
17603
be02381c
PE
17604 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17605 That way, the code declares only the vars that it needs.
17606 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17607 * s/cygwin.h (PTY_ITERATION): Likewise.
17608 * s/darwin.h (PTY_ITERATION): Likewise.
17609 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17610
57048744
PE
17611 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17612 * process.c (allocate_pty): Don't declare stb unless it's needed.
17613
7914961c 17614 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
17615 (CONSTANTLIM): Remove; unused.
17616 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17617 Define only if needed.
7914961c 17618
b3967b18
PE
17619 * unexelf.c (unexec): Name an expression,
17620 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
17621 Use a different way to cause a compilation error if anyone uses
17622 n rather than nn, a way that does not involve shadowing.
73366a00 17623 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 17624
29a6015a
PE
17625 * deps.mk (unexalpha.o): Remove; unused.
17626
43cfc33e 17627 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 17628 * unexec.h: New file.
ce701a33
PE
17629 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17630 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17631 Depend on unexec.h.
17632 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17633 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17634 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 17635 Change as necessary to match prototype in unexec.h.
ce701a33 17636
01f44d5a
PE
17637 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17638 shadowing.
4f63c6bb 17639 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 17640
a6670b0b
PE
17641 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17642 Rename locals to avoid shadowing.
17643
cef2010d 17644 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 17645 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 17646
d4d7173a
PE
17647 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17648
f08b802a
PE
17649 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17650 warning when compiling print.c.
17651
3ddb0639
PE
17652 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17653 instead of using an uninitialized var.
5ad03b97 17654 (font_sort_entities): Mark var as initialized.
3ddb0639 17655
170a2692
PE
17656 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17657
e663c700
PE
17658 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17659 pointers to constants.
89bc529a 17660 (font_parse_fcname): Remove unused vars.
7b81e2d0 17661 (font_delete_unmatched): Now static.
ea838e10 17662 (font_get_spec): Remove; unused.
13a547c6
PE
17663 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17664 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17665 Rename or move locals to avoid shadowing.
e663c700 17666
2a80c887 17667 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 17668 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 17669
1384fa33 17670 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 17671 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 17672
8b2c52e9
PE
17673 * alloc.c (mark_backtrace): Move decl from here ...
17674 * lisp.h: ... to here, so that it can be checked.
17675
475545b5 17676 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 17677 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
17678 (lisp_indirect_variable): Name an expression,
17679 to avoid gcc -Wbad-function-cast warning.
1faed8ae 17680 (Fdefvar): Rename locals to avoid shadowing.
475545b5 17681
b1349114 17682 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 17683 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 17684 Use const pointer when appropriate.
b1349114 17685
a2928364
PE
17686 * lisp.h (get_system_name, get_operating_system_release):
17687 Move decls here, to check interfaces.
17688 * process.c (get_operating_system_release): Move decl to lisp.h.
17689 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
17690 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17691 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17692 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
17693 (Fformat_time_string, Fencode_time, Finsert_char):
17694 (Ftranslate_region_internal, Fformat):
17695 Rename or remove local vars to avoid shadowing.
9710023e 17696 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 17697
a415e694
PE
17698 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17699 avoid shadowing.
17700
8ef4622d
PE
17701 * lisp.h (eassert): Check that the argument compiles, even if
17702 ENABLE_CHECKING is not defined.
17703
946f9a5b
PE
17704 * data.c (Findirect_variable): Name an expression, to avoid
17705 gcc -Wbad-function-cast warning.
112396d6 17706 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 17707 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
17708 (Fmake_variable_buffer_local, Fmake_local_variable):
17709 Mark variables as initialized.
52746918 17710 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 17711
e5aab7e7 17712 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
17713 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17714 Rename locals to avoid shadowing.
dff45157
PE
17715 (mark_stack): Move local variables into the #ifdef region where
17716 they're used.
7bc26fdb
PE
17717 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17718 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17719 needed otherwise.
17720 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17721 (GC_STRING_CHARS): Remove; not used.
d40d4be1 17722 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 17723
e5aab7e7
PE
17724 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17725 avoids undefined behavior in theory.
17726
4da60324
PE
17727 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17728
88043301
PE
17729 Use functions, not macros, for up- and down-casing (Bug#8254).
17730 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17731 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17732 to use the following functions instead of these macros.
17733 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17734 EMACS_INT, since callers assume the returned value fits in int.
17735 (upcase1): Likewise, for UPCASE_TABLE.
17736 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 17737 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 17738 the race-condition problem in the old DOWNCASE.
88043301 17739
19ed5445
PE
17740 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17741 Rename locals to avoid shadowing.
17742 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
17743 (regex_compile, re_search_2, re_match_2_internal):
17744 Remove unused local vars.
952db0d7
PE
17745 (FREE_VAR): Rewrite so as not to use empty "else",
17746 which gcc can warn about.
da053e48 17747 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
17748 (RETALLOC_IF): Define only if needed.
17749 (WORDCHAR_P): Likewise. This one is never needed, but is used
17750 only in a comment talking about a compiler bug, so put inside
17751 the #if 0 of that comment.
17752 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17753 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17754 Remove; unused.
19ed5445 17755
1f3561e4 17756 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
17757 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17758 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 17759
ded6f8f7
PE
17760 * search.c (simple_search): Remove unused var.
17761
dbd37a95
PE
17762 * dired.c (compile_pattern): Move decl from here ...
17763 * lisp.h: ... to here, so that it can be checked.
17764 (struct re_registers): New forward decl.
17765
7e47afad
PE
17766 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17767
85f24f61
PE
17768 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17769 All uses changed.
17770 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17771 Rename locals to avoid shadowing.
5671df8f 17772 (Fvertical_motion): Mark locals as initialized.
85f24f61 17773
181aa2be 17774 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 17775 (casify_region): Mark local as initialized.
181aa2be 17776
930d429c
PE
17777 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17778
7082eac6
PE
17779 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17780 New macros, so that the caller can use some names other than
17781 gcpro1, gcpro2, etc.
17782 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17783 of the new macros.
17784 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17785 argument, for consistency with GCPRO2_VAR, etc: it is now the
17786 prefix of the variable, not the variable itself. All uses
17787 changed.
38b2c076
PE
17788 * dired.c (directory_files_internal, file_name_completion):
17789 Rename locals to avoid shadowing.
17790
15206ed9
PE
17791 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17792 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17793 dired.c's scmp function, had undefined behavior.
17794 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17795 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17796 * buffer.h: ... to here, because these macros use current_buffer,
17797 and the new implementation with inline functions needs to have
17798 current_buffer in scope now, rather than later when the macros
17799 are used.
17800 (downcase, upcase1): New static inline functions.
17801 (DOWNCASE, UPCASE1): Reimplement using these functions.
17802 This avoids undefined behavior in expressions like
17803 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17804 from race conditions in accessing the global variables
17805 case_temp1 and case_temp2.
17806 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17807 * lisp.h (case_temp1, case_temp2): Remove their decls.
17808 * character.h (ASCII_CHAR_P): Move from here ...
17809 * lisp.h: ... to here, so that the inline functions mentioned
17810 above can use them.
17811
4a6bea26
PE
17812 * dired.c (directory_files_internal_unwind): Now static.
17813
f14b7e14
PE
17814 * fileio.c (file_name_as_directory, directory_file_name):
17815 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17816 Now static.
2893f146
PE
17817 (file_name_as_directory): Use const pointers when appropriate.
17818 (Fexpand_file_name): Likewise. In particular, newdir might
17819 point at constant storage, so make it a const pointer.
fd4ead52 17820 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
17821 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17822 signedness issues.
f839df0c
PE
17823 (Fset_file_times, Finsert_file_contents, auto_save_error):
17824 Rename locals to avoid shadowing.
f14b7e14 17825
5716756e 17826 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
17827 (Ftry_completion, Fall_completions): Rename or remove locals
17828 to avoid shadowing.
5716756e 17829
b4c3046a
PE
17830 * marker.c (bytepos_to_charpos): Remove; unused.
17831
b45db522
PE
17832 * lisp.h (verify_bytepos, count_markers): New decls,
17833 so that gcc does not warn that these functions aren't declared.
17834
85876d07
PE
17835 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17836 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 17837 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 17838 (copy_text): Remove unused local var.
85876d07 17839
03d78a21 17840 * filelock.c (within_one_second): Now static.
b3dd38ab 17841 (lock_file_1): Rename local to avoid shadowing.
03d78a21 17842
5df8f01b
PE
17843 * buffer.c (fix_overlays_before): Mark locals as initialized.
17844 (fix_start_end_in_overlays): Likewise. This function should be
17845 simplified by using pointers-to-pointers, but that's a different
17846 matter.
b1d876f1 17847 (switch_to_buffer_1): Now static.
8f54f30a
PE
17848 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17849 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 17850
a70072c9 17851 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 17852 Fix pointer signedness issue.
edced198
PE
17853 (sys_subshell): Mark local as volatile if checking for lint,
17854 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 17855 (MAXPATHLEN): Define only if needed.
a70072c9 17856
a0977c44
PE
17857 * process.c (serial_open, serial_configure): Move decls from here ...
17858 * systty.h: ... to here, so that they can be checked.
17859
a884fdcc
PE
17860 * fns.c (get_random, seed_random): Move extern decls from here ...
17861 * lisp.h: ... to here, so that they can be checked.
17862
604efe86 17863 * sysdep.c (reset_io): Now static.
b8950c94 17864 (wait_for_termination_signal): Remove; unused.
604efe86 17865
38fc62d9
PE
17866 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17867 (copy_keymap_item, append_key, push_text_char_description):
17868 Now static.
1004a21a 17869 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 17870 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
17871 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17872 (describe_map_tree):
17873 Rename locals to avoid shadowing.
38fc62d9 17874
2f2650da
PE
17875 * keyboard.c: Declare functions static if they are not used elsewhere.
17876 (echo_char, echo_dash, cmd_error, top_level_2):
17877 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
17878 (read_char, kbd_buffer_get_event, make_lispy_position):
17879 (make_lispy_event, make_lispy_movement, apply_modifiers):
17880 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17881 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17882 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 17883 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 17884 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 17885
a053e86c 17886 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
17887 (mark_kboards): Move decl here ...
17888 * alloc.c (mark_kboards): ... from here.
a053e86c 17889
4752793e
PE
17890 * lisp.h (force_auto_save_soon): New decl.
17891
74f10ca7 17892 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
17893 (DEFINE_DUMMY_FUNCTION): New macro.
17894 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17895 Use it.
c03cd23f
PE
17896 (main): Add casts to avoid warnings
17897 if GCC considers string literals to be constants.
74f10ca7 17898
022e70d4
PE
17899 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17900
59d6fe83
PE
17901 * dbusbind.c: Pointer signedness fixes.
17902 (xd_signature, xd_append_arg, xd_initialize):
17903 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17904 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17905 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17906 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17907
78320123
PE
17908 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17909 if GCC considers string literals to be constants.
49cebcca 17910 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 17911
35ac2a97
SM
179122011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17913
fb103ca9
SM
17914 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17915 (print_preprocess, print_object): New macro to fix last change.
17916
35ac2a97
SM
17917 * print.c (print_preprocess): Don't forget font objects.
17918
62973b41
JB
179192011-03-16 Juanma Barranquero <lekktu@gmail.com>
17920
17921 * emacs.c (USAGE3): Doc fixes.
17922
0e48bb22
AS
179232011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17924
17925 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17926 structure.
17927
7684e57b
JB
179282011-03-14 Juanma Barranquero <lekktu@gmail.com>
17929
17930 * lisp.h (VWindow_system, Qfile_name_history):
17931 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17932 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17933 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17934
17935 * w32select.c: Don't #include "keyboard.h".
c96bbc66 17936 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
17937
17938 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17939 * w32console.c (detect_input_pending, read_input_pending)
17940 (encode_terminal_code):
17941 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17942 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17943 (w32_system_caret_y, Qfile_name_history):
17944 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17945 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17946 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17947 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17948 * w32proc.c (Qlocal, report_file_error):
17949 * w32term.c (Vwindow_system, updating_frame):
17950 * w32uniscribe.c (initialized, uniscribe_font_driver):
17951 Remove unneeded extern declarations.
17952
2aa46d6c
CY
179532011-03-14 Chong Yidong <cyd@stupidchicken.com>
17954
c96bbc66 17955 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 17956
cffc6f3b
CY
179572011-03-13 Chong Yidong <cyd@stupidchicken.com>
17958
17959 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17960 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17961 These macros can no longer be used for assignment.
17962
44f230aa
SM
17963 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17964 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
17965 (record_buffer_markers, fetch_buffer_markers): New functions for
17966 recording and fetching special buffer markers.
17967 (set_buffer_internal_1, set_buffer_temp): Use them.
17968
17969 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17970
17971 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17972
17973 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17974 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17975
17976 * xdisp.c (hscroll_window_tree):
17977 (reconsider_clip_changes): Use PT instead of BUF_PT.
17978
d251f04b
EZ
179792011-03-13 Eli Zaretskii <eliz@gnu.org>
17980
17981 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17982 $(EMACS_ROOT)/lib/intprops.h.
17983
f0c77cd1
PE
179842011-03-13 Paul Eggert <eggert@cs.ucla.edu>
17985
3eca4629
PE
17986 Fix more problems found by GCC 4.5.2's static checks.
17987
7c86ee98
PE
17988 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17989 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
17990 (xg_free_frame_widgets): Make it clear that a local variable is
17991 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
17992 (gdk_window_get_screen): Make it clear that this macro is needed
17993 only if USE_GTK_TOOLTIP.
1e5524e7
PE
17994 (int_gtk_range_get_value): New function, which avoids a diagnostic
17995 from gcc -Wbad-function-cast.
17996 (xg_set_toolkit_scroll_bar_thumb): Use it.
17997 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17998 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
17999 (get_utf8_string, xg_get_file_with_chooser):
18000 Rename locals to avoid shadowing.
18001 (create_dialog): Move locals to avoid shadowing.
7c86ee98 18002
41729b81
PE
18003 * xgselect.c (xg_select): Remove unused var.
18004
f0c77cd1
PE
18005 * image.c (four_corners_best): Mark locals as initialized.
18006 (gif_load): Initialize transparent_p to zero (Bug#8238).
18007 Mark another local as initialized.
ec6cf4c6 18008 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 18009
ce0ad53d 18010 * image.c (clear_image_cache): Now static.
d5d5a617 18011 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 18012 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
18013 (x_edge_detection): Remove unnecessary cast that
18014 gcc -Wbad-function-cast diagnoses.
2037898d 18015 (gif_load): Fix pointer signedness.
6ae141d6
PE
18016 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18017 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 18018
33383987 180192011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 18020
d32df629
PE
18021 Improve quality of tests for time stamp overflow.
18022 For example, without this patch (encode-time 0 0 0 1 1
18023 1152921504606846976) returns the obviously-bogus value (-948597
18024 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18025 reports time overflow. See
18026 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
18027 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18028 * editfns.c: Include limits.h and intprops.h.
18029 (TIME_T_MIN, TIME_T_MAX): New macros.
18030 (time_overflow): Move earlier, to before first use.
18031 (hi_time, lo_time): New functions, for an accurate test for
18032 out-of-range times.
18033 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18034 (Fget_internal_run_time): Don't assume time_t fits in int.
18035 (make_time): Use list2 instead of Fcons twice.
18036 (Fdecode_time): More accurate test for out-of-range times.
18037 (check_tm_member): New function.
18038 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
18039 (lisp_time_argument): Don't rely on undefined left-shift and
18040 right-shift behavior when checking for time stamp overflow.
8be6f318 18041
fe31d94c
PE
18042 * editfns.c (time_overflow): New function, refactoring common code.
18043 (Fformat_time_string, Fdecode_time, Fencode_time):
18044 (Fcurrent_time_string): Use it.
18045
8be6f318
PE
18046 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18047 * dired.c (make_time): Move to ...
18048 * editfns.c (make_time): ... here.
18049 * systime.h: Note the move.
18050
09d9db2c 180512011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 18052
126bc0dc
YM
18053 * fringe.c (update_window_fringes): Remove unused variables.
18054
c47cbdfd
YM
18055 * unexmacosx.c (copy_data_segment): Also copy __got section.
18056 (Bug#8223)
18057
7ac80be9
EZ
180582011-03-12 Eli Zaretskii <eliz@gnu.org>
18059
c96bbc66 18060 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
18061 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
18062 Constify `char *' arguments and their references according to
18063 prototypes in tparam.h.
18064
ecb0f94d 18065 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 18066
7ac80be9
EZ
18067 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
18068 Adapt all references accordingly.
18069
18070 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
18071
ef1fd07e
TT
180722011-03-11 Tom Tromey <tromey@redhat.com>
18073
18074 * buffer.c (syms_of_buffer): Remove obsolete comment.
18075
7ef4b50c
EZ
180762011-03-11 Eli Zaretskii <eliz@gnu.org>
18077
18078 * termhooks.h (encode_terminal_code): Declare prototype.
18079
18080 * msdos.c (encode_terminal_code): Don't declare prototype.
18081
18082 * term.c (encode_terminal_code): Now external again, used by
18083 w32console.c and msdos.c.
18084
44f230aa
SM
18085 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
18086 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 18087
4b1ec863 180882011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 18089
1714f52b 18090 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 18091
4b1ec863
PE
18092 * fringe.c (update_window_fringes): Mark locals as initialized
18093 (Bug#8227).
18094 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 18095
524c7aa6
PE
18096 * alloc.c (mark_fringe_data): Move decl from here ...
18097 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
18098 to check its interface.
18099 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
18100
a5c0af81 18101 * fontset.c (free_realized_fontset): Now static.
7519b8cd 18102 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 18103 (fontset_font): Mark local as initialized.
a9a06e0b 18104 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 18105
b4716021
PE
18106 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
18107
811e9bac 18108 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 18109 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
18110 (x_own_selection, Fx_disown_selection_internal): Rename locals
18111 to avoid shadowing.
18112 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 18113
7e3ab302
PE
18114 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
18115 so that the caller can use some name other than gcpro1.
18116 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
18117 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18118 (Fx_backspace_delete_keys_p):
18119 Use them to avoid shadowing, and rename vars to avoid shadowing.
18120 (x_decode_color, x_set_name, x_window): Now static.
6b437900 18121 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 18122 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
18123 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18124 Remove unused locals.
7e3ab302
PE
18125 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18126 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18127 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18128 macros.
f78faa98 18129
e2b13473
PE
18130 * xterm.h (x_mouse_leave): New decl.
18131
77f23912
PE
18132 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18133 Remove unused functions.
cdf4ba58
PE
18134 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18135 (x_calc_absolute_position): Now static.
7411c686 18136 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 18137 Don't declare local "event" unless it's used.
ed7bf3a5
PE
18138 (x_iconify_frame, x_free_frame_resources): Don't declare locals
18139 unless they are used.
38d0b34a
PE
18140 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18141 (x_fatal_error_signal): Remove; not used.
a6067996
PE
18142 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18143 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18144 (x_error_catcher, x_connection_closed, x_error_handler):
18145 (x_error_quitter, xembed_send_message, x_iconify_frame):
18146 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 18147 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 18148 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 18149
44f230aa
SM
18150 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18151 Rename or move locals to avoid shadowing.
6b463e58 18152 (tty_defined_color, merge_face_heights): Now static.
5967d051 18153 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
18154 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18155 does not deduce is never used uninitialized.
73719eba
PE
18156 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18157 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 18158
426994c3 18159 * terminal.c (store_terminal_param): Now static.
5489860b 18160
032f1620 18161 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 18162 (set_frame_menubar): Remove unused local.
d4323972 18163 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
18164 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18165 since they might point to immutable storage.
281585b0
PE
18166 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18167 since it's unused otherwise.
032f1620 18168
367c19e5 18169 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 18170 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
18171 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18172 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 18173 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
18174 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18175 does not deduce are never used uninitialized.
70739cbe 18176
07b48fa9
PE
18177 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18178
8868a238 18179 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
18180 * window.c (window_loop, size_window):
18181 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 18182
7e5cf297 18183 * window.c (display_buffer): Now static.
d6550a9f
PE
18184 (size_window): Mark variables that gcc -Wuninitialized
18185 does not deduce are never used uninitialized.
a586633d
PE
18186 * window.h (check_all_windows): New decl, to forestall
18187 gcc -Wmissing-prototypes diagnostic.
5b555da1 18188 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 18189
f6095868
PE
18190 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18191 shadowing.
18192 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
18193 Include <limits.h>.
18194 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18195 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
18196 (load_charset_map): Mark variables that gcc -Wuninitialized
18197 does not deduce are never used uninitialized.
53df7c11 18198 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 18199
f38b440c
PE
18200 * coding.c (coding_set_source, coding_set_destination):
18201 Use "else { /* comment */ }" rather than "else /* comment */;"
18202 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
18203 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18204 a block, when the outer 'i' will do.
18205 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18206 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18207 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18208 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
18209 (Fdecode_sjis_char, Fdefine_coding_system_internal):
18210 Rename locals to avoid shadowing.
18211 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
18212 * coding.c (emacs_mule_char, encode_invocation_designation):
18213 Now static, since they're not used elsewhere.
413bb2db 18214 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 18215 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
18216 (decode_coding_emacs_mule): Mark variables that gcc
18217 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
18218 (detect_coding_iso_2022): Initialize a local variable that might
18219 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 18220 this initialization is needed. (Bug#8211)
5f58e762
PE
18221 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
18222 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
18223 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
18224 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
18225 Remove unused macros.
f38b440c 18226
232b38b9 18227 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 18228 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 18229 * character.c (string_count_byte8): Likewise.
232b38b9 18230
fb90da1b
PE
18231 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
18232 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
18233
fb93dbc2
PE
18234 * chartab.c (copy_sub_char_table): Now static, since it's not used
18235 elsewhere.
5c156ace
PE
18236 (sub_char_table_ref_and_range, char_table_ref_and_range):
18237 Rename locals to avoid shadowing.
bbcd0949 18238 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 18239
7d3b3862 18240 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 18241 (BIDI_BOB): Remove unused macro.
7d3b3862 18242
6be7d3da
PE
18243 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18244 deduce are never used uninitialized.
c2ed9c8b 18245 * term.c (encode_terminal_code): Likewise.
6be7d3da 18246
75f8807f 18247 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 18248
50938595
PE
18249 * tparam.h: New file.
18250 * term.c, tparam.h: Include it.
18251 * deps.mk (term.o, tparam.o): Depend on tparam.h.
18252 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18253 Move these decls to tparam.h, and make them agree with what
18254 is actually in tparam.c. The previous trick of using incompatible
18255 decls in different modules does not conform to the C standard.
18256 All callers of tparam changed to use tparam's actual API.
18257 * tparam.c (tparam1, tparam, tgoto):
18258 Use const pointers where appropriate.
18259
fbceeba2
PE
18260 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18261 * cm.h (struct cm): Likewise.
18262 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18263 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18264 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18265 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18266 (turn_on_face, init_tty): Likewise.
18267 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 18268
7f3f1250
PE
18269 * term.c (term_mouse_position): Rename local to avoid shadowing.
18270
e6ca6543
PE
18271 * alloc.c (mark_ttys): Move decl from here ...
18272 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18273
c40f8d15
AS
182742011-03-11 Andreas Schwab <schwab@linux-m68k.org>
18275
18276 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18277
cfe0661d
JB
182782011-03-09 Juanma Barranquero <lekktu@gmail.com>
18279
18280 * search.c (compile_pattern_1): Remove argument regp, unused since
18281 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18282 (compile_pattern): Don't pass it.
18283
0afb4571
J
182842011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18285
18286 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18287 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18288 for ! HAVE_GTK3.
18289 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18290
18291 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18292
18293 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18294 gdk_window_get_screen, gdk_window_get_geometry,
18295 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18296 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18297 (xg_get_pixbuf_from_pixmap): New function.
18298 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18299 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18300 Call xg_get_pixbuf_from_pixmap instead of
18301 gdk_pixbuf_get_from_drawable.
18302 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18303 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18304 (xg_check_special_colors): Use GtkStyleContext and its functions
18305 for HAVE_GTK3.
18306 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18307 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18308 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
18309 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18310 Call gtk_widget_get_preferred_size.
0afb4571
J
18311 (xg_frame_resized): gdk_window_get_geometry only takes 5
18312 parameters.
44f230aa
SM
18313 (xg_win_to_widget, xg_event_is_for_menubar):
18314 Call gdk_x11_window_lookup_for_display.
0afb4571
J
18315 (xg_set_widget_bg): New function.
18316 (delete_cb): New function.
895009e1 18317 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 18318 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
18319 (xg_set_background_color): Call xg_set_widget_bg.
18320 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18321 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18322 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18323 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18324 if ! HAVE_GTK3.
18325 (update_frame_tool_bar): Call gtk_widget_hide.
18326 (xg_initialize): Use GDK_KEY_g.
18327
18328 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18329 if ! HAVE_GTK3
18330 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18331
18332 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18333 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18334 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18335
1c2cc4ef
JB
183362011-03-08 Juanma Barranquero <lekktu@gmail.com>
18337
18338 * w32xfns.c (select_palette): Check success of RealizePalette against
18339 GDI_ERROR, not zero.
18340
33383987 18341See ChangeLog.11 for earlier changes.
aac0c6e3
MR
18342
18343;; Local Variables:
18344;; coding: utf-8
aac0c6e3
MR
18345;; End:
18346
2f097256 18347 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
18348
18349 This file is part of GNU Emacs.
18350
18351 GNU Emacs is free software: you can redistribute it and/or modify
18352 it under the terms of the GNU General Public License as published by
18353 the Free Software Foundation, either version 3 of the License, or
18354 (at your option) any later version.
18355
18356 GNU Emacs is distributed in the hope that it will be useful,
18357 but WITHOUT ANY WARRANTY; without even the implied warranty of
18358 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18359 GNU General Public License for more details.
18360
18361 You should have received a copy of the GNU General Public License
18362 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.