Auto-commit of loaddefs files.
[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.
4cdfbb89
EZ
10 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
11 return results.
12 [!HAVE_SETITIMER]: Behave as the previous version that didn't
13 support timers.
f0e5f225
EZ
14
15 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
16 term_ntproc after all the other bookkeeping, to get timers working
17 as long as possible.
18
82ef37c1
PE
192012-10-01 Paul Eggert <eggert@cs.ucla.edu>
20
b3a4c387
PE
21 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
22 Suggested by Juri Linkov in
23 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
24
b0ab8123
PE
25 Prefer plain 'static' to 'static inline' (Bug#12541).
26 With static functions, modern compilers inline pretty well by
27 themselves; advice from programmers often hurts as much as it helps.
28 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
29 this change shrinks the text size of the Emacs executable by 1.1%
30 without affecting CPU significantly in my benchmark.
31 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
32 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
33 (mark_maybe_object, mark_maybe_pointer, bounded_number):
34 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
35 (bset_auto_fill_function, bset_auto_save_file_format)
36 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
37 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
38 (bset_cache_long_line_scans, bset_case_fold_search)
39 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
40 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
41 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
42 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
43 (bset_header_line_format, bset_indicate_buffer_boundaries)
44 (bset_indicate_empty_lines, bset_invisibility_spec)
45 (bset_left_fringe_width, bset_major_mode, bset_mark)
46 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
47 (bset_name, bset_overwrite_mode, bset_pt_marker)
48 (bset_right_fringe_width, bset_save_length)
49 (bset_scroll_bar_width, bset_scroll_down_aggressively)
50 (bset_scroll_up_aggressively, bset_selective_display)
51 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
52 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
53 (set_buffer_overlays_after):
54 * category.c (bset_category_table):
55 * charset.c (read_hex):
56 * coding.c (produce_composition, produce_charset)
57 (handle_composition_annotation, handle_charset_annotation)
58 (char_encodable_p):
59 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
60 (assign_row, set_frame_matrix_frame, make_current)
61 (add_row_entry):
62 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
63 * fns.c (maybe_resize_hash_table):
64 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
65 * gmalloc.c (register_heapinfo):
66 * image.c (lookup_image_type):
67 * intervals.c (set_interval_object, set_interval_left)
68 (set_interval_right, copy_interval_parent, rotate_right)
69 (rotate_left, balance_possible_root_interval):
70 * keyboard.c (kset_echo_string, kset_kbd_queue)
71 (kset_keyboard_translate_table, kset_last_prefix_arg)
72 (kset_last_repeatable_command, kset_local_function_key_map)
73 (kset_overriding_terminal_local_map, kset_real_last_command)
74 (kset_system_key_syms, clear_event, set_prop):
75 * lread.c (digit_to_number):
76 * marker.c (attach_marker, live_buffer, set_marker_internal):
77 * nsterm.m (ns_compute_glyph_string_overhangs):
78 * process.c (pset_buffer, pset_command)
79 (pset_decode_coding_system, pset_decoding_buf)
80 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
81 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
82 (pset_status, pset_tty_name, pset_type, pset_write_queue):
83 * syntax.c (bset_syntax_table, dec_bytepos):
84 * terminal.c (tset_param_alist):
85 * textprop.c (interval_has_some_properties)
86 (interval_has_some_properties_list):
87 * window.c (wset_combination_limit, wset_dedicated)
88 (wset_display_table, wset_hchild, wset_left_fringe_width)
89 (wset_left_margin_cols, wset_new_normal, wset_new_total)
90 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
91 (wset_right_fringe_width, wset_right_margin_cols)
92 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
93 (wset_vertical_scroll_bar_type, wset_window_parameters):
94 * xdisp.c (wset_base_line_number, wset_base_line_pos)
95 (wset_column_number_displayed, wset_region_showing)
96 (window_box_edges, run_window_scroll_functions)
97 (append_glyph_string_lists, prepend_glyph_string_lists)
98 (append_glyph_string, set_glyph_string_background_width)
99 (append_glyph, append_composite_glyph)
100 (take_vertical_position_into_account):
101 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
102 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
103 (lface_hash, lface_same_font_attributes_p, lookup_face):
104 * xml.c (libxml2_loaded_p):
105 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
106 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
107 Now 'static', not 'static inline'.
108
05584c31
PE
109 * bidi.c: Tune.
110 (bidi_copy_it): Do the whole copy with a single memcpy.
111 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
112
86ec63ba
PE
113 Revert the FOLLOW-SYMLINKS change for file-attributes.
114 Doing it right would require several changes to Tramp, and there's
115 not enough time to get that tested before the freeze today.
116 * dired.c (directory_files_internal, Ffile_attributes):
117 Undo last change.
118
82ef37c1
PE
119 * frame.c (x_report_frame_params): Port better to wider ints.
120 Do not assume that EMACS_UINT is the same width as uprintmax_t,
121 or that pointers can be printed in 15 decimal digits.
122 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
123
62aba0d4
FP
1242012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
125
126 Support x64 build on MS-Windows.
127 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
128 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
129 compatibility with x64.
5e4daaf3 130 (x_get_focus_frame): Add prototype.
62aba0d4
FP
131
132 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
133 defining an XRectangle structure.
134
135 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
136 arithmetics for compatibility with x64.
137
138 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
139 compatibility with x64.
140
141 * w32heap.h: Adjust prototypes and declarations.
142
143 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
144 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
145 DWORD, long, and unsigned long, for compatibility with x64.
146 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
147 (sbrk): Argument is now of type ptrdiff_t.
148
149 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
150 less than 0x0500.
151 (w32_msg_pump): Use WPARAM type for 'result'.
152
153 * w32.c (init_environment, get_emacs_configuration): Support AMD64
154 architecture.
155 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
156 compatibility with x64.
157
158 * vm-limit.c (lim_data): Now size_t.
159 (check_memory_limits): Adjust prototypes of real_morecore and
160 __morecore to receive argument of type ptrdiff_t. Use size_t for
161 five_percent and data_size.
162
163 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
164 variables, for compatibility with x64.
165 (rva_to_section, offset_to_section, relocate_offset)
166 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
167 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
168 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
169 for compatibility with x64.
170
171 * sysdep.c (STDERR_FILENO): Define if not already defined.
172
173 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
174 (__morecore): Argument type is now ptrdiff_t.
175 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
176 (relinquish): Use ptrdiff_t type for 'excess'.
177 (r_alloc_sbrk): Argument type is now ptrdiff_t.
178
179 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
180 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
181 instead of a literal number.
182
183 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
184 (min): Define only if not already defined.
185
186 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
187 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
188 hosts.
189
190 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
191 'bitmaps' is a pointer.
192
193 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
194
195 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
196
e7a2937b
PE
1972012-09-30 Paul Eggert <eggert@cs.ucla.edu>
198
199 file-attributes has a new optional arg FOLLOW-SYMLINKS.
200 * dired.c (directory_files_internal, Ffile_attributes):
201 New arg follow_symlinks. All uses changed.
202
b43d62ae
SM
2032012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
204
205 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
206
c06c382a
EZ
2072012-09-30 Eli Zaretskii <eliz@gnu.org>
208
209 Support atimers and CPU profiler via profile.c on MS-Windows.
210 * w32proc.c (sig_mask, crit_sig): New static variables.
211 (sys_signal): Support SIGALRM and SIGPROF.
212 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 213 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
214 sigfillset, and sigprocmask are no longer no-ops.
215 (sigismember): New function.
216 (struct itimer_data): New definition.
217 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
218 (crit_prof): New static variables.
219 (MAX_SINGLE_SLEEP): New definition.
220 (timer_loop, stop_timer_thread, term_timers, init_timers)
221 (start_timer_thread, getitimer, setitimer): New functions.
222 (alarm): No longer a no-op, calls setitimer.
223
224 * w32.c (term_ntproc): Call term_timers.
225 (init_ntproc): Make sure all signals are unblocked at startup, to
226 erase any traces of dumping. Call init_timers.
227
228 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
229 Windows-specific code to display the hourglass mouse pointer is no
230 longer used.
231 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
232 to hourglass timer expiration.
233 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
234 Remove, no longer used.
b43d62ae
SM
235 (w32_note_current_window, show_hourglass, hide_hourglass):
236 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
237 window systems.
238 (syms_of_w32fns): Don't initialize hourglass_timer.
239
240 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
241 WINDOWSNT as well.
242 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
243
244 * w32.h (init_timers, term_timers): Add prototypes.
245
95402d5f
KH
2462012-09-30 Kenichi Handa <handa@gnu.org>
247
248 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
249 to the buffer relocation which may be caused by ccl_driver.
250
dd946752
JD
2512012-09-30 Jan Djärv <jan.h.d@swipnet.se>
252
d7e642cc
JD
253 * xfns.c (Fx_file_dialog): Update comment.
254
255 * w32fns.c (Fx_file_dialog): Update comment.
256
257 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
258 Initialize panel name field if OSX >= 10.6.
259
260 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
261
dd946752
JD
262 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
263
264 * nsterm.m (NEW_STYLE_FS): New define.
265 (ns_fullscreen_hook, windowWillEnterFullScreen)
266 (windowDidEnterFullScreen, windowWillExitFullScreen)
267 (windowDidExitFullScreen, toggleFullScreen, handleFS)
268 (setFSValue): New functions.
269 (EmacsFSWindow): New implementation.
270 (canBecomeKeyWindow): New function for EmacsFSWindow.
271 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
272 (dealloc): Release nonfs_window if in fullscreen.
273 (updateFrameSize:): Call windowDidMove to update top/left.
274 (windowWillResize:toSize:): Check if frame is still maximized.
275 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
276 next_maximized, maximized_width, maximized_height and nonfs_window.
277 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
278 tbar_height.
279 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
280 fullscreen. Set maximized_width/height. Act on next_maximized.
281
282 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
283 (EmacsView): Add variables for fullscreen.
284 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
285 (EmacsFSWindow): New interface for fullscreen.
286
427730eb
JB
2872012-09-30 Juanma Barranquero <lekktu@gmail.com>
288
289 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
290
48de8b12
CY
2912012-09-30 Chong Yidong <cyd@gnu.org>
292
293 * fns.c (Frandom): Doc fix.
294
5938d519
MR
2952012-09-30 Martin Rudalics <rudalics@gmx.at>
296
297 * window.c (Vwindow_combination_limit): New default value.
298 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
299
cb5b0266
PE
3002012-09-30 Paul Eggert <eggert@cs.ucla.edu>
301
302 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
303 Suggested by Eli Zaretskii in
304 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
305
84f72efd
EZ
3062012-09-30 Eli Zaretskii <eliz@gnu.org>
307
308 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
309 HAVE_TIMER_SETTIME is defined.
310
9d4dcdc9
PE
3112012-09-30 Paul Eggert <eggert@cs.ucla.edu>
312
d89460ed
PE
313 Profiler improvements: more-accurate timers, overflow checks.
314 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
315 signal.h, setjmp.h. Include systime.h instead.
316 (saturated_add): New function.
317 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
318 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
319 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
320 New static vars.
84f72efd 321 (enum profiler_cpu_running): New enum.
d89460ed
PE
322 (profiler_cpu_running): Now of that enum type, not bool.
323 All uses changed to store the new value.
324 (handle_profiler_signal): Rename from sigprof_handler_1,
325 for consistency with other handlers. Do not check whether
326 cpu_log is a hash-table if garbage collecting, since it
327 doesn't matter in that case.
328 (deliver_profiler_signal): Rename from sigprof_handler,
329 for consistency with other handlers.
330 (setup_cpu_timer): New function, with much of what used to be in
331 Fprofiler_cpu_start. Check for out-of-range argument.
332 Prefer timer_settime if available, and prefer
333 thread cputime clocks, then process cputime clocks, then
334 monotonic clocks, to the old realtime clock. Use make_timeval
335 to round more-correctly when falling back to setitimer.
336 (Fprofiler_cpu_start): Use it.
337 (Fprofiler_cpu_stop): Prefer timer_settime if available.
338 Don't assume that passing NULL as the 2nd argument of setitimer
339 is the same as passing a pointer to all-zero storage.
340 Ignore SIGPROF afterwards.
341 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
342 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
343 non-fatal signal handlers. Ignore SIGPROF on startup.
344 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
345 in profiler.c, since sysdep.c now uses it.
346
9d4dcdc9
PE
347 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
348 Suggested by Eli Zaretskii in
349 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
350
8e5691a0
JB
3512012-09-29 Juanma Barranquero <lekktu@gmail.com>
352
353 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
354
e7c1b6ef
SM
3552012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
356
357 * lisp.h (struct backtrace): Remove indirection for `function' field.
358 * xdisp.c (redisplay_internal):
359 * profiler.c (record_backtrace, sigprof_handler_1):
360 * alloc.c (Fgarbage_collect):
361 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
362 (Fbacktrace_frame): Adjust accordingly.
363
e61d39cd 3642012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
365
366 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
367 (Frun_hook_with_args_until_failure): Doc fixes.
368
404043ea
EZ
3692012-09-28 Eli Zaretskii <eliz@gnu.org>
370
371 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
372 Qautomatic_redisplay and change the symbol name. All users changed.
373
704d3f45
TM
3742012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
375
376 * profiler.c (sigprof_handler): Fix race condition.
377
757140ff
GM
3782012-09-28 Glenn Morris <rgm@gnu.org>
379
380 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
381
a615a3ae
PE
3822012-09-27 Paul Eggert <eggert@cs.ucla.edu>
383
384 Check more robustly for timer_settime.
89d17fd0
PE
385 * Makefile.in (LIB_TIMER_TIME): New macro.
386 (LIBES): Add it.
a615a3ae
PE
387 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
388 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
389 call timer_settime.
390
3670daf7
TM
3912012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
392
393 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
394
6a586b7f
JB
3952012-09-26 Juanma Barranquero <lekktu@gmail.com>
396
397 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
398
41c8bfcf
PE
3992012-09-26 Paul Eggert <eggert@cs.ucla.edu>
400
401 * character.h (MAYBE_UNIFY_CHAR): Remove.
402 * charset.c, charset.h (maybe_unify_char): Now static.
403 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
404 Since this stuff is now private to charset.c, there's no need for
405 a public macro and no need to inline by hand.
406
3a880af4
SM
4072012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
408 Stefan Monnier <monnier@iro.umontreal.ca>
409 Juanma Barranquero <lekktu@gmail.com>
611b7507 410
3a880af4
SM
411 * profiler.c: New file.
412 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
413 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
414 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
415 * emacs.c (main): Call syms_of_profiler.
416 * alloc.c (Qautomatic_gc): New constant.
417 (MALLOC_PROBE): New macro.
418 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
419 (total_bytes_of_live_objects): New function.
420 (Fgarbage_collect): Use it. Record itself in backtrace_list.
421 Call malloc_probe for the memory profiler.
422 (syms_of_alloc): Define Qautomatic_gc.
423 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
424 race condition.
425 (struct backtrace): Move definition...
426 * lisp.h (struct backtrace): ..here.
427 (Qautomatic_gc, profiler_memory_running): Declare vars.
428 (malloc_probe, syms_of_profiler): Declare functions.
429 * xdisp.c (Qautomatic_redisplay): New constant.
430 (redisplay_internal): Record itself in backtrace_list.
431 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 432
5938d519 4332012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
4342012-09-25 Juanma Barranquero <lekktu@gmail.com>
435
436 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
437
e26fd2e4
PE
4382012-09-25 Paul Eggert <eggert@cs.ucla.edu>
439
440 Prefer POSIX timers if available.
441 They avoid a race if the timer is too close to the current time.
442 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
443 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 444 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 445
eedec3ee
EZ
4462012-09-25 Eli Zaretskii <eliz@gnu.org>
447
448 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
449 CHAR_STRING_ADVANCE.
450 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
451 STRING_CHAR_ADVANCE.
452
aa15c6bb
JB
4532012-09-25 Juanma Barranquero <lekktu@gmail.com>
454
455 Move Vlibrary_cache to emacs.c and reset before dumping.
456
457 * lisp.h (reset_image_types): Declare.
458 [WINDOWSNT] (Vlibrary_cache): Declare.
459
460 * image.c (reset_image_types): New function.
461
462 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
463 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
464 (Fdump_emacs): Reset Vlibrary_cache and image_types.
465
466 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
467 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
468
469 * w32.h (Vlibrary_cache): Do not declare.
470
54d629be
EZ
4712012-09-25 Eli Zaretskii <eliz@gnu.org>
472
16b22fef
EZ
473 * w32proc.c (sys_signal): Handle all signals defined by the
474 MS-Windows runtime, not just SIGCHLD. Actually install the signal
475 handlers for signals supported by Windows. Don't override
476 term_ntproc as the handler for SIGABRT.
477 (sigaction): Rewrite to call sys_signal instead of duplicating its
478 code.
479 (sys_kill): Improve commentary.
480
481 * w32.c (term_ntproc): Accept (and ignore) one argument, for
482 consistency with a signature of a signal handler. All callers
483 changed.
484 (init_ntproc): Accept an argument DUMPING. If dumping, don't
485 install term_ntproc as a signal handler for SIGABRT, as that
486 should be done by the dumped Emacs.
487
488 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
489
490 * w32select.c (term_w32select): Protect against repeated
491 invocation by setting clipboard_owner to NULL after calling
492 DestroyWindow.
493
494 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
495 and term_ntproc to their modified signatures.
496
54d629be
EZ
497 * character.c (char_string, string_char): Remove calls to
498 MAYBE_UNIFY_CHAR. See the discussion starting at
499 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
500 for the details.
501
59f7af81
CY
5022012-09-25 Chong Yidong <cyd@gnu.org>
503
504 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
505
22e8cf4a
SM
5062012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
507
508 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
509 when encountering an unknown bytecode.
510
578098f3
PE
5112012-09-24 Paul Eggert <eggert@cs.ucla.edu>
512
513 image.c, indent.c: Use bool for booleans.
514 * dispextern.h (struct image_type): Members valid_p, load, init
515 now return bool, not int. All uses changed.
516 * image.c: Omit unnecessary static decls.
517 (x_create_bitmap_mask, x_build_heuristic_mask):
518 Return void, not int, since callers don't care about the return value.
519 (x_create_bitmap_mask, define_image_type, valid_image_p)
520 (struct image_keyword, parse_image_spec, image_spec_value)
521 (check_image_size, image_background)
522 (image_background_transparent, x_clear_image_1)
523 (postprocess_image, lookup_image, x_check_image_size)
524 (x_create_x_image_and_pixmap, xbm_image_p)
525 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
526 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
527 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
528 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
529 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
530 (png_image_p, init_png_functions, png_load_body, png_load)
531 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
532 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
533 (init_gif_functions, gif_load, imagemagick_image_p)
534 (imagemagick_load_image, imagemagick_load, svg_image_p)
535 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
536 (gs_load):
537 * nsimage.m (ns_load_image):
538 * nsterm.m (ns_defined_color):
539 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
540 * xfns.c (x_defined_color):
541 * xterm.c (x_alloc_lighter_color_for_widget)
542 (x_alloc_nearest_color_1, x_alloc_nearest_color)
543 (x_alloc_lighter_color):
544 * indent.c (disptab_matches_widthtab, current_column)
545 (scan_for_column, string_display_width, indented_beyond_p)
546 (compute_motion, vmotion, Fvertical_motion):
547 Use bool for booleans.
548
a5f2b6ec
CY
5492012-09-24 Chong Yidong <cyd@gnu.org>
550
551 * chartab.c (Fset_char_table_default): Obsolete function removed.
552
18e27ea8
PE
5532012-09-23 Paul Eggert <eggert@cs.ucla.edu>
554
afea8a8a
PE
555 Move pid_t related decls out of lisp.h.
556 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
557 (interruptible_wait_for_termination):
558 Move these decls from lisp.h to syswait.h, since they use pid_t.
559 Needed on FreeBSD; see Herbert J. Skuhra in
560 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
561 * callproc.c: Include syswait.h.
562
18e27ea8
PE
563 gnutls.c, gtkutil.c: Use bool for boolean.
564 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
565 (emacs_gnutls_handle_error):
566 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
567 (xg_hide_tooltip, xg_create_frame_widgets)
568 (create_dialog, xg_uses_old_file_dialog)
569 (xg_get_file_with_chooser, xg_get_file_with_selection)
570 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
571 (xg_item_label_same_p, xg_update_menubar)
572 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
573 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
574 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
575 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
576 (update_frame_tool_bar, free_frame_tool_bar):
577 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
578 * nsmenu.m (ns_update_menubar):
579 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
580 * xfns.c (Fx_show_tip) [USE_GTK]:
581 Use bool for boolean.
582 * gtkutil.c (xg_update_frame_menubar):
583 * xmenu.c (update_frame_menubar):
584 Return void, not int, since caller ignores return value.
585 * gtkutil.c (xg_change_toolbar_position):
586 Return void, not 1.
587
af0e9f75
JB
5882012-09-23 Juanma Barranquero <lekktu@gmail.com>
589
590 * makefile.w32-in (BLOCKINPUT_H): Remove.
591 (SYSSIGNAL_H): New macro.
592 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
593 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
594 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
595 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
596 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
597 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
598 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
599 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
600 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
601 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
602 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
603 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
604 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
605 ($(BLD)/w32xfns.$(O)): Update dependencies.
606
5101529e
EZ
6072012-09-23 Eli Zaretskii <eliz@gnu.org>
608
609 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
610 fatal_error_backtrace.
611
612 * w32proc.c (sys_kill): Undo last change: don't do anything when
613 invoked to deliver SIGABRT to our own process. This is now
614 handled by emacs_raise.
615
2c3ee0ad
JB
6162012-09-23 Juanma Barranquero <lekktu@gmail.com>
617
618 * w32term.c (w32_read_socket): Remove leftover reference to
619 interrupt_input_pending.
620
62a1d661
PE
6212012-09-23 Paul Eggert <eggert@cs.ucla.edu>
622
623 Do not use SA_NODEFER.
624 Problem reported by Dani Moncayo in
625 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
626 * alloc.c (die):
627 * sysdep.c (emacs_abort): Do not reset signal handler.
628 * emacs.c (terminate_due_to_signal): Reset signal handler here.
629 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
630 wanted even on POSIXish hosts, and it doesn't work on Windows.
631
a0942b9a
JD
6322012-09-23 Jan Djärv <jan.h.d@swipnet.se>
633
634 * xterm.c (x_term_init): Call fixup_locale before and after calling
635 gtk_init (Bug#12392).
636
d07ff9db
CY
6372012-09-23 Chong Yidong <cyd@gnu.org>
638
639 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
640 Vdynamic_library_alist.
641
642 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
643 (Fgnutls_available_p): Caller changed.
644
645 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
646 (Flibxml_parse_xml_region): Likewise.
647
648 * dispextern.h (struct image_type): Remove arg from init function.
649
650 * image.c (Finit_image_library, lookup_image_type)
651 (define_image_type): Remove now-unneeded second arg.
652 (init_xpm_functions, init_png_functions, init_jpeg_functions)
653 (init_tiff_functions, init_gif_functions, init_svg_functions):
654 Arglist and w32_delayed_load calling convention changed.
655 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 656 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 657
4d7e6e51
PE
6582012-09-23 Paul Eggert <eggert@cs.ucla.edu>
659
660 Simplify and avoid signal-handling races (Bug#12471).
661 * alloc.c (die):
662 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
663 Avoid recursive loop if there's a fatal error in the function itself.
664 * atimer.c (pending_atimers):
665 * blockinput.h: Don't include "atimer.h"; no longer needed.
666 (interrupt_input_pending): Remove. All uses removed.
667 pending_signals now counts both atimers and ordinary interrupts.
668 This is less racy than having three separate pending-signal flags.
669 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
670 (input_blocked_p):
671 Rename from their upper-case counterparts BLOCK_INPUT,
672 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
673 INPUT_BLOCKED_P, and turn into functions. All uses changed.
674 This makes it easier to access volatile variables more accurately.
675 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
676 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
677 that's more reliable if the code is buggy and sets
678 interrupt_input_blocked to a negative value. All uses changed.
679 * atimer.c (deliver_alarm_signal):
680 Remove. No need to deliver this to the parent; any thread can
681 handle this signal now. All uses replaced by underlying handler.
682 * atimer.c (turn_on_atimers):
683 * dispnew.c (handle_window_change_signal):
684 * emacs.c (handle_danger_signal):
685 * keyboard.c (kbd_buffer_get_event):
686 Don't reestablish signal handler; not needed with sigaction.
687 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
688 (UNBLOCK_INPUT_TO):
689 Rework to avoid unnecessary accesses to volatile variables.
690 (UNBLOCK_INPUT_TO): Now a function.
691 (totally_unblock_input, unblock_input): New decls.
692 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
693 (init_data): Remove. Necessary stuff now done in init_signal.
694 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
695 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
696 (fatal_error_code): Remove; no longer needed.
697 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
698 it doesn't always backtrace. All uses changed. No need to reset
699 signal to default, since sigaction and/or die does that for us now.
700 Use emacs_raise (FOO), not kill (getpid (), FOO).
701 (main): Check more-accurately whether we're dumping.
702 Move fatal-error setup to sysdep.c
703 * floatfns.c: Do not include "syssignal.h"; no longer needed.
704 * gtkutil.c (xg_get_file_name, xg_get_font):
705 Remove no-longer-needed signal-mask manipulation.
706 * keyboard.c, process.c (POLL_FOR_INPUT):
707 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
708 * keyboard.c (read_avail_input): Remove.
709 All uses replaced by gobble_input.
710 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
711 (kbd_buffer_store_event_hold, gobble_input):
712 (record_asynch_buffer_change) [USABLE_SIGIO]:
713 (store_user_signal_events):
714 No need to mess with signal mask.
715 (gobble_input): If blocking input and there are terminals, simply
716 set pending_signals to 1 and return. All hooks changed to not
717 worry about whether input is blocked.
718 (process_pending_signals): Clear pending_signals before processing
719 them, in case a signal comes in while we're processing.
720 By convention callers now test pending_signals before calling us.
721 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
722 New functions, to support changes to blockinput.h.
723 (handle_input_available_signal): Now extern.
724 (reinvoke_input_signal): Remove. All uses replaced by
725 handle_async_input.
726 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
727 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
728 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
729 Clear sigmask reliably, even if Fsignal returns, which it can.
730 Omit unnecessary accesses to volatile var.
731 (quit_throw_to_read_char): No need to restore sigmask.
732 * keyboard.c (gobble_input, handle_user_signal):
733 * process.c (wait_reading_process_output):
734 Call signal-handling code rather than killing ourselves.
735 * lisp.h: Include <float.h>, for...
736 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
737 (pending_signals): Now volatile.
738 (syms_of_data): Now const if IEEE floating point.
739 (handle_input_available_signal) [USABLE_SIGIO]:
740 (terminate_due_to_signal, record_child_status_change): New decls.
741 * process.c (create_process): Avoid disaster if memory is exhausted
742 while we're processing a vfork, by tightening the critical section
743 around the vfork.
744 (send_process_frame, process_sent_to, handle_pipe_signal)
745 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
746 ignores SIGPIPE.
747 (send_process): No need for setjmp/longjmp any more, since the
748 SIGPIPE stuff is now gone. Instead, report an error if errno
749 is EPIPE.
750 (record_child_status_change): Now extern. PID and W are now args.
751 Return void, not bool. All callers changed.
752 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
753 Remove. All uses removed. This bug should be fixed now in a
754 different way.
755 (wait_for_termination_1): Use waitpid rather than sigsuspend,
756 and record the child status change directly. This avoids the
757 need to futz with the signal mask.
758 (process_fatal_action): Move here from emacs.c.
759 (emacs_sigaction_flags): New function, containing
760 much of what used to be in emacs_sigaction_init.
761 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
762 caught by emacs, to make races less likely.
763 (deliver_process_signal): Rename from handle_on_main_thread.
764 All uses changed.
765 (BACKTRACE_LIMIT_MAX): Now at top level.
766 (thread_backtrace_buffer, threadback_backtrace_pointers):
767 New static vars.
768 (deliver_thread_signal, deliver_fatal_thread_signal):
769 New functions, for more-accurate delivery of thread-specific signals.
770 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
771 (deliver_arith_signal): Handle in this thread, not
772 in the main thread, since it's triggered by this thread.
773 (maybe_fatal_sig): New function.
774 (init_signals): New arg DUMPING so that we can be more accurate
775 about whether we're dumping. Caller changed.
776 Treat thread-specific signals differently from process-general signals.
777 Block all signals while handling fatal error; that's safer.
778 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
779 on IEEE hosts.
780 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
781 Ignore SIGPIPE unless batch.
782 (emacs_backtrace): Output backtrace for the appropriate thread,
783 which is not necessarily the main thread.
784 * syssignal.h: Include <stdbool.h>.
785 (emacs_raise): New macro.
786 * xterm.c (x_connection_signal): Remove; no longer needed
787 now that we use sigaction.
788 (x_connection_closed): No need to mess with sigmask now.
789 (x_initialize): No need to reset SIGPIPE handler here, since
790 init_signals does this for us now.
791
8f4635e9
JD
7922012-09-23 Jan Djärv <jan.h.d@swipnet.se>
793
794 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 795 background rect may be larger (Bug#12245).
8f4635e9 796
3296976d
CY
7972012-09-23 Chong Yidong <cyd@gnu.org>
798
799 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
800
d41e491e
PE
8012012-09-22 Paul Eggert <eggert@cs.ucla.edu>
802
803 * .gdbinit: Just stop at fatal_error_backtrace.
804 See Stefan Monnier's request in
805 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
806 Remove no-longer-used query of system type.
807
c88b867f
CY
8082012-09-22 Chong Yidong <cyd@gnu.org>
809
810 * search.c (Freplace_match): Doc fix (Bug#12325).
811
812 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
813
814 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
815 (Fline_end_position): Doc fix.
816
817 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
818
bb4d86b4
CY
8192012-09-22 Chong Yidong <cyd@gnu.org>
820
821 * dispextern.h (struct image_type): Add new slot, storing a type
822 initialization function.
823
824 * image.c (define_image_type): Call the image initializer function
825 if it is defined. Arguments and return value changed.
826 (valid_image_p, make_image): Callers changed.
827 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
828 (gif_type, imagemagick_type, svg_type, gs_type):
829 Add initialization functions.
bb4d86b4
CY
830 (Finit_image_library): Call lookup_image_type.
831 (CHECK_LIB_AVAILABLE): Macro deleted.
832 (lookup_image_type): Call define_image_type here, rather than via
833 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
834 (syms_of_image): Move define_image_type calls for xbm_type and
835 pbm_type to lookup_image_type.
836
df9685f3
EZ
8372012-09-22 Eli Zaretskii <eliz@gnu.org>
838
839 * keyboard.c (timer_check_2): Move calculation of 'timers' and
840 'idle_timers' from here ...
841 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
842 lists, to avoid infloops when the timer does something stupid,
843 like reinvoke itself with the same or smaller time-out.
844 (Bug#12447)
845
8e17c9ba
MR
8462012-09-22 Martin Rudalics <rudalics@gmx.at>
847
848 * window.c (Fsplit_window_internal): Handle only Qt value of
849 Vwindow_combination_limit separately.
850 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
851 (Vwindow_combination_limit): New default value.
852 Rewrite doc-string.
8e17c9ba 853
589bd69b
EZ
8542012-09-22 Eli Zaretskii <eliz@gnu.org>
855
856 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
857 the new overlay string. (Bug#10159)
858
01108e3f
PE
8592012-09-22 Paul Eggert <eggert@cs.ucla.edu>
860
861 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
862 or that fprintf is async-signal-safe. POSIX doesn't require
863 either assumption.
864
82f8cd94
CY
8652012-09-22 Chong Yidong <cyd@gnu.org>
866
867 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
868 (Bug#8207).
869
3cccbd87
KH
8702012-09-22 Kenichi Handa <handa@gnu.org>
871
872 * composite.c (composition_reseat_it): Handle the case that a
873 grapheme cluster is not covered by a single font (Bug#12352).
874
09c01941
CY
8752012-09-21 Chong Yidong <cyd@gnu.org>
876
877 * image.c (define_image_type): Avoid adding duplicate types to
878 image_types (Bug#12463). Suggested by Jörg Walter.
879
acfa068f 8802012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
881
882 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
883 (print_load_command_name): Add case LC_DATA_IN_CODE.
884 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
885
acfa068f 8862012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
887
888 * eval.c (Frun_hook_with_args_until_success)
889 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
890
acfa068f 8912012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
892
893 * fileio.c (Ffile_selinux_context): Only call freecon when
894 lgetfilecon succeeded.
895 (Fset_file_selinux_context): Likewise. (Bug#12444)
896
acfa068f 8972012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
898
899 * xdisp.c (try_window_reusing_current_matrix): Under bidi
900 reordering, locate the cursor by calling set_cursor_from_row; if
901 that fails, clear the desired glyph matrix before returning a
902 failure indication to the caller. Fixes leaving garbled display
903 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
904 (compute_stop_pos_backwards): Fix a typo that caused crashes while
905 scrolling through multibyte text.
aa36e4d2 906
e99f70c8
SM
9072012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
908
909 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
910 calling mark_vectorlike since that's the one that marks the window.
911 (mark_discard_killed_buffers): Mark the final cdr.
912 * window.h (struct window): Move prev/next_buffers to the
913 non-standard fields.
914 * window.c (make_window): Initialize prev/next_buffers manually.
915
f75beb47
PE
9162012-09-20 Paul Eggert <eggert@cs.ucla.edu>
917
918 Omit unused arg EXPECTED from socket hooks.
919 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
920 * nsterm.m (ns_term_init):
921 * termhooks.h (struct terminal.read_socket_hook):
922 * w32inevt.c (w32_console_read_socket):
923 * w32term.c (w32_read_socket):
924 * xterm.c (XTread_socket):
925 Omit unused arg EXPECTED. All callers changed.
926 (store_user_signal_events): Return void, not int, since callers no
927 longer care about the return value. All uses changed.
928
b019b76a
JB
9292012-09-20 Juanma Barranquero <lekktu@gmail.com>
930
931 * w32gui.h (XParseGeometry): Do not declare.
932
05642592
PE
9332012-09-19 Paul Eggert <eggert@cs.ucla.edu>
934
e4bce92a
PE
935 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
936 Ignore 'expected'. See Eli Zaretskii in
937 <http://bugs.gnu.org/12471#8> (last line).
938
05642592
PE
939 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
940 (XParseGeometry): Now static. Substitute extremal values for
941 values that are out of range.
942
e543ae91
JD
9432012-09-19 Jan Djärv <jan.h.d@swipnet.se>
944
945 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
946
947 * nsfns.m (XParseGeometry): Remove.
948 (Fx_create_frame): Call x_set_offset to correctly interpret
949 top_pos in geometry.
950
3a880af4 951 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
952 (Fx_parse_geometry): If there is a space in string, call
953 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
954
45ba16c7
EZ
9552012-09-17 Eli Zaretskii <eliz@gnu.org>
956
c8b9f1bc
EZ
957 * search.c (scan_buffer): Use character positions in calls to
958 region_cache_forward and region_cache_backward, not byte
959 positions. (Bug#12196)
960
b4c932a2
EZ
961 * w32term.c (w32_read_socket): Set pending_signals to 1, like
962 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
963
45ba16c7
EZ
964 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
965 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
966 emacs_blocked_malloc, now deleted.
967
eeceac93
PE
9682012-09-17 Paul Eggert <eggert@cs.ucla.edu>
969
970 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
971 The workaround was for improving performance on Solaris 2.4, but
972 is getting in the way now. Emacs will still work if someone is
973 still running Solaris 2.4 in a museum somewhere; Sun dropped
974 support for Solaris 2.4 in 2003.
975 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
976 * process.c (create_process) [HAVE_WORKING_VFORK]:
977 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
978 since Emacs no longer uses vfork on that platform.
979
78f83752
GM
9802012-09-17 Glenn Morris <rgm@gnu.org>
981
982 * emacs.c: Use COPYRIGHT.
983
634b8cac
PE
9842012-09-16 Paul Eggert <eggert@cs.ucla.edu>
985
0caaedb1
PE
986 Remove configure's --without-sync-input option (Bug#12450).
987 When auditing signal-handling in preparation for cleaning it up,
988 I found that SYNC_INPUT has race conditions and would be a real
989 pain to fix. Since it's an undocumented and deprecated
990 configure-time option, now seems like a good time to remove it.
991 Also see <http://bugs.gnu.org/11080#16>.
992 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
993 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
994 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
995 (malloc_hysteresis):
996 (check_depth) [XMALLOC_OVERRUN_CHECK]:
997 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
998 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
999 (dont_register_blocks, bytes_used_when_reconsidered)
1000 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1001 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1002 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1003 Remove. All uses removed.
1004 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1005 implementation, one that depends on whether the new macro
1006 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1007 is defined.
1008 * atimer.c (run_timers, handle_alarm_signal):
1009 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1010 (handle_async_input, process_pending_signals)
1011 (handle_input_available_signal, init_keyboard):
1012 * nsterm.m (ns_read_socket):
1013 * process.c (wait_reading_process_output):
1014 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1015 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1016 (emacs_write):
1017 * xterm.c (XTread_socket):
1018 Assume SYNC_INPUT.
1019 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1020 * eval.c (handling_signal): Remove. All uses removed.
1021 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1022 All uses replaced with the SYNC_INPUT version.
1023 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1024 Remove decls.
1025 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1026 Now static.
1027
634b8cac
PE
1028 * font.c (Ffont_shape_gstring): Remove unused local.
1029
83da1b55
GM
10302012-09-16 Glenn Morris <rgm@gnu.org>
1031
518650a5
GM
1032 * Makefile.in (clean): No longer run nextstep's clean.
1033
83da1b55
GM
1034 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1035 (ns_frag): Remove.
1036 (ns-app): Move here from ns.mk, and simplify.
1037 (clean): Simplify nextstep entry.
1038 * ns.mk: Remove file.
1039
85a43e2e
KH
10402012-09-17 Kenichi Handa <handa@gnu.org>
1041
1042 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1043 not covert the last few charactes.
1044
ba13e616 10452012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
1046
1047 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1048 here, but just check the validity of glyphs in the glyph-string.
1049
a8c729af
MR
10502012-09-16 Martin Rudalics <rudalics@gmx.at>
1051
3a880af4
SM
1052 * window.c (Fwindow_parameter, Fset_window_parameter):
1053 Accept any window as argument (Bug#12452).
a8c729af 1054
c077c059
JD
10552012-09-16 Jan Djärv <jan.h.d@swipnet.se>
1056
1057 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1058 to ns_term_init to avoid memory leak.
1059
1060 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
1061 explicit retain/release.
1062 (ns_term_init): Only allow one display. Initialize outerpool and
1063 ns_*_types.
1064
39a57ad0
PE
10652012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1066
1067 Port _setjmp fix to POSIXish hosts as well as Microsoft.
1068 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
1069 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
1070 the Microsoft problem in a different way, by altering ../nt/config.nt.
1071
7105c8cb
EZ
10722012-09-15 Eli Zaretskii <eliz@gnu.org>
1073
1074 * w32xfns.c:
1075 * w32uniscribe.c:
1076 * w32term.c:
1077 * w32select.c:
1078 * w32reg.c:
1079 * w32proc.c:
1080 * w32menu.c:
1081 * w32inevt.c:
1082 * w32heap.c:
1083 * w32font.c:
1084 * w32fns.c:
1085 * w32console.c:
1086 * w32.c:
1087 * w16select.c: Remove inclusion of setjmp.h, as it is now included
1088 by lisp.h. This completes removal of setjmp.h inclusion
1089 erroneously announced in the previous commit. (Bug#12446)
1090
1091 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
1092 more accurate.
1093
1094 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
1095 not defined as a macro. The latter happens on MS-Windows.
1096 (Bug#12446)
1097
0328b6de
PE
10982012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1099
1100 Port better to POSIX hosts lacking _setjmp (Bug#12446).
1101 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 1102 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
1103 only reason for the instance was because "lisp.h" was included.
1104 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
1105 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
1106 and _longjmp with the new symbols. Emacs already uses _setjmp if
1107 available, so this change affects only POSIXish hosts that have
1108 sigsetjmp but not _setjmp, such as some versions of Solaris and
1109 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
1110 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
1111 (png_load_body) [HAVE_PNG]:
1112 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
1113 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
1114 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
1115 since PNG requires jmp_buf. This is the only exception to the
1116 general rule that we now use sys_setjmp and sys_longjmp.
1117 This exception is OK since this code does not change the signal
1118 mask or longjmp out of a signal handler.
1119
2af03429
PE
11202012-09-14 Paul Eggert <eggert@cs.ucla.edu>
1121
1122 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1123 Include "syssignal.h", for 'main_thread'.
1124
2f294edf
DA
11252012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
1126
1127 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
1128 * insdel.c (replace_range, replace_range_2):
1129 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
1130 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1131 Remove redundant check before calling offset_intervals.
1132
6b533e9c
MR
11332012-09-14 Martin Rudalics <rudalics@gmx.at>
1134
1135 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1136 current buffer (Bug#12387).
1137
2a7931e3
JB
11382012-09-14 Juanma Barranquero <lekktu@gmail.com>
1139
1140 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1141
c18e885b
PE
11422012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1143
1144 Use a more backwards-compatible timer format (Bug#12430).
1145 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1146 vector element, not from the 4th, since PSECS is now at the end.
1147 (Fcurrent_idle_time): Doc fix.
1148
d59a1afb
DA
11492012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
1150
1151 Function to mark objects and remove killed buffers at once.
1152 * alloc.c (discard_killed_buffers): Rename to ...
1153 (mark_discard_killed buffers) ... new name. Add marking
1154 of remaining objects. Fix comment. Adjust users.
1155 (mark_object): Do not touch frame buffer lists here.
1156 * frame.c (delete_frame): Reset frame buffer lists here.
1157
5f0cb45a
PE
11582012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1159
8ea47e3a
PE
1160 Better workaround for GNOME bug when --enable-gcc-warnings.
1161 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1162 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
1163 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1164
4a4bbad2
PE
1165 Simplify SIGIO usage (Bug#12408).
1166 The code that dealt with SIGIO was crufty and confusing, e.g., it
1167 played tricks like "#undef SIGIO" but these tricks were not used
1168 consistently. Simplify mostly by not #undeffing standard symbols,
1169 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1170 or not as we please) rather than "defined SIGIO" (standard symbol
1171 that we probably shouldn't #undef).
1172 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1173 Modules that need it can include it.
1174 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1175 * dispextern.h (ignore_sigio): New decl.
1176 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1177 unconditionally, since it's now a no-op if !USABLE_SIGIO.
1178 * emacs.c (shut_down_emacs):
1179 * keyboard.c (kbd_buffer_store_event_hold):
1180 Use ignore_sigio rather than invoking 'signal' directly.
1181 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1182 for FIONREAD.
1183 (FIONREAD, SIGIO): Do not #undef.
1184 (tty_read_avail_input): Use #error rather than a syntax error.
1185 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1186 for I_PIPE, used by SETUP_SLAVE_PTY.
1187 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1188 * sysdep.c (croak): Remove; no longer needed. This bit of
1189 temporary code, with Fred N. Fish's comment that it's temporary,
1190 has been in Emacs since at least 1992!
1191 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1192 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1193 * syssignal.h (croak): Remove decl.
1194 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1195 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1196 now that we're termios-only.
1197 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1198 * term.c (dissociate_if_controlling_tty): Use #error rather than
1199 a run-time error.
1200
5f0cb45a
PE
1201 Work around GCC and GNOME bugs when --enable-gcc-warnings.
1202 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1203 to work around GNOME bug 683906.
1204 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1205 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1206 This works around GCC bug 54561.
1207
40bce90b
PE
12082012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1209
1210 More fixes for 'volatile' and setjmp/longjmp.
1211 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1212 * image.c (struct png_load_context) [HAVE_PNG]: New type.
1213 (png_load_body) [HAVE_PNG]:
1214 (jpeg_load_body) [HAVE_JPEG]:
1215 New function, with most of the old parent function's body.
1216 (png_load) [HAVE_PNG]:
1217 (jpeg_load) [HAVE_JPEG]:
1218 Invoke the new function, to avoid longjmp munging our locals.
1219 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
1220 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
1221 longjmp is passed 2, as the C standard doesn't guarantee this.
1222 Instead, store the failure code into mgr->failure_code.
1223
bfeae2cf
SM
12242012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1225
1226 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
1227 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
1228 (syms_of_keyboard): Remove support for unread-command-char.
1229
8099e36b
EZ
12302012-09-12 Eli Zaretskii <eliz@gnu.org>
1231
1232 * w32proc.c (sys_kill): If PID is our process ID and the signal is
1233 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
1234 violation. (Bug#12426)
1235
92547ff9
PE
12362012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1237
1238 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
1239
45b82ad0
SM
12402012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1241
1242 * eval.c: Add `inhibit-debugger'.
1243 (Qinhibit_debugger): New symbol.
1244 (call_debugger): Bind it instead of Qdebug_on_error.
1245 (maybe_call_debugger): Test Vinhibit_debugger.
1246 (syms_of_eval): Define inhibit-debugger.
1247 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1248 (syms_of_xdisp): Remove inhibit-debug-on-message.
1249
5779a1dc
PE
12502012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1251
50f2e553
PE
1252 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1253 If a nonvolatile local variable is written before a _longjmp to
1254 the frame containing the variable, and is read after the _longjmp,
1255 the value read is indeterminate. Some local variables of type
1256 'struct handler' and 'struct catchtag' are used in this way, so
1257 mark each of their slots as volatile if the slot can be set before
1258 _longjmp and read afterwards.
1259 * lisp.h (struct handler): var and chosen_clause are now volatile.
1260 (struct catchtag): val, next, and pdlcount are now volatile.
1261
ae1d87e2
PE
1262 * bidi.c (bidi_push_it, bidi_pop_it):
1263 * fns.c (copy_hash_table):
1264 * image.c (define_image_type):
1265 * keyboard.c (kbd_buffer_store_event_hold):
1266 * process.c (Fprocess_send_eof):
1267 * xfaces.c (x_create_gc) [HAVE_NS]:
1268 * xgselect.c (xg_select):
1269 Prefer assignment to memcpy when either will do.
1270
5779a1dc
PE
1271 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1272 Use pointer-to-a-pointer to simplify and avoid a NILP check each
1273 time an item is removed. No need to mark this function 'inline';
1274 the compiler knows better than we do.
1275
c4c9756b
JD
12762012-09-11 Jan Djärv <jan.h.d@swipnet.se>
1277
1278 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1279 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1280 to change_frame_size (Bug#12388).
1281 (windowDidResize:): Pass YES to updateFrameSize.
1282
1283 * nsterm.h: Add delay parameter to updateFrameSize.
1284
d73e321c
DA
12852012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1286
1287 Discard killed buffers from deleted window and frame objects.
1288 This reduces an amount of references to killed buffers and
1289 helps GC to reclaim them faster.
1290 * alloc.c (discard_killed_buffers): New function.
1291 (mark_object): Use it for deleted windows and frames.
1292 (mark_object): If symbol's value is set up for a killed buffer
1293 or deleted frame, restore it's global binding.
1294 * data.c (swap_in_global_binding): Add GC notice.
1295 (swap_in_symval_forwarding): Use convenient set_blv_where.
1296 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1297 * window.h: ... to here.
1298
e578f381
DA
12992012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1300
1301 Convenient macro to check whether the buffer is live.
1302 * buffer.h (BUFFER_LIVE_P): New macro.
1303 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1304 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1305
3057e615
YM
13062012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1307
1308 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1309 composition cases (Bug#12364).
1310
1311 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1312 overhang of succeeding glyphs overlapping box cursor.
1313
1314 * w32term.c (x_draw_glyph_string): Likewise.
1315
6fda35f2
PE
13162012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1317
c990426a
PE
1318 Simplify, document, and port floating-point (Bug#12381).
1319 The porting part of this patch fixes bugs on non-IEEE platforms
1320 with frexp, ldexp, logb.
1321 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1322 Now static.
1323 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1324 support, by removing commented-out code and briefly listing the
1325 C89 functions excluded. The commented-out stuff was confusing
1326 maintenance, e.g., we thought we needed cbrt but it was commented out.
1327 (logb): Remove decl; no longer needed.
1328 (isfinite): New macro, if not already supplied.
1329 (isnan): Don't replace any existing macro.
1330 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1331 are present on all C89 platforms.
1332 (Ffrexp): Do not special-case zero, as frexp does the right thing
1333 for that case.
1334 (Flogb): Do not use logb, as it doesn't have the desired meaning
1335 on hosts that use non-base-2 floating point. Instead, stick with
1336 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1337 frexp, to avoid getting an unspecified result.
1338
6fda35f2
PE
1339 * xdisp.c (Qinhibit_debug_on_message): Now static.
1340
16130a58
JD
13412012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1342
1343 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1344 NSBezierPath (Bug#12131).
1345
d105a573
CY
13462012-09-10 Chong Yidong <cyd@gnu.org>
1347
1348 * fns.c (Fdelq, Fdelete): Doc fix.
1349
ff55dfe8
PE
13502012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1351
1352 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1353 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1354
e7032e7c
SM
13552012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1356
1357 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1358 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1359 Use it.
1360
e9957956
EZ
13612012-09-09 Eli Zaretskii <eliz@gnu.org>
1362
aba05ce9
EZ
1363 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1364 left fringe if the window has a left margin. This avoids leaving
1365 traces of the cursor because its leftmost pixel is not drawn over.
1366
e9957956
EZ
1367 * dispnew.c (update_window_line): When the left margin area of a
1368 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1369 that screen line. (Bug#12277)
1370
f6196b87
PE
13712012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1372
1373 Assume C89 or later for math functions (Bug#12381).
1374 This simplifies the code, and makes it a bit smaller and faster,
1375 and (most important) makes it easier to clean up signal handling
1376 since we can stop worring about floating-point exceptions in
1377 library code. That was a problem before C89, but the problem
1378 went away many years ago on all practical Emacs targets.
1379 * data.c, image.c, lread.c, print.c:
1380 Don't include <math.h>; no longer needed.
1381 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1382 might be autoconfigured, as that never happens.
1383 * data.c (fmod):
1384 * doprnt.c (DBL_MAX_10_EXP):
1385 * print.c (DBL_DIG):
1386 Remove. C89 or later always defines these.
1387 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1388 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1389 (arith_error, domain_error, domain_error2):
1390 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1391 no longer needed -- we simply return what C returns. All uses removed.
1392 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1393 the wrapped code.
1394 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1395 Remove. All uses expanded, as these macros are no longer used
1396 more than once and are now more trouble than they're worth.
1397 (Ftan): Use tan, not sin / cos.
1398 (Flogb): Assume C89 frexp.
1399 (fmod_float): Assume C89 fmod.
1400 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1401 (init_floatfns): Remove. All uses removed.
1402
9d7f1863
JD
14032012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1404
1405 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1406 compositeToPoint for OSX < 10.6 (Bug#12390).
1407
eabf0404
PE
14082012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1409
1410 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1411 This produces more-accurate results.
1412
0b3b1d23
JD
14132012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1414
1415 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1416 changes (Bug#12088).
1417
6dcef6ec
CY
14182012-09-08 Chong Yidong <cyd@gnu.org>
1419
1420 * syntax.c (Fstring_to_syntax): Doc fix.
1421
aa7d57c5
JD
14222012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1423
1424 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1425 in the internal border.
1426 (x_set_window_size): Remove static variables and their usage.
1427 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
1428 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1429 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
1430 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1431 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1432 (ns_fix_rect_ibw): Remove.
1433 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1434 (ns_dumpglyphs_box_or_relief): Ditto.
1435 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1436 adjustment.
1437 (ns_dumpglyphs_image): Ditto.
fc0c31f8 1438 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
1439 border adjustment.
1440 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1441 their usage. Add fringe_extended_p and its use as in other terms.
1442 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1443 scroll bar was removed.
1444 (updateFrameSize): New function.
1445 (windowDidResize): Move code to updateFrameSize and call it.
1446
1447 * nsterm.h (EmacsView): Add updateFrameSize.
1448
1a5432bc
CY
14492012-09-07 Chong Yidong <cyd@gnu.org>
1450
b4f5313e
CY
1451 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1452
1a5432bc
CY
1453 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1454
1a4f1e9b
PE
14552012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1456
1457 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
1458 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1459 Problem introduced when merging patches. Noted by Eli Zaretskii in
1460 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
1461 * floatfns.c: Comment fix.
1462 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1463 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1464 and anyway the declaration is harmless even if SIGDANGER is not defined.
1465 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1466 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1467 source files not surprisingly expected syssignal.h to define, or
1468 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1469 Include <sys/ioctl.h>, for FIONREAD.
1470 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1471 This eliminates a problem whereby other files mysteriously had
1472 to include "syssignal.h" before including "systty.h" if they
1473 wanted to use "#ifdef SIGIO".
1474
bc8000ff
EZ
14752012-09-07 Eli Zaretskii <eliz@gnu.org>
1476
3e6d6928
EZ
1477 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1478
1479 * w32.c (sigemptyset): Empty the set.
1480 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1481
bc8000ff
EZ
1482 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1483
b4fa72f2
DA
14842012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1485
1486 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1487 (mark_object): Likewise for frame objects.
1488
30730c93
PE
14892012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1490
1491 * syssignal.h (handle_on_main_thread): Always declare,
1492 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1493 This ports to platforms without HAVE_PTHREAD.
1494
2fe28299
PE
14952012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1496
1497 Signal-handler cleanup (Bug#12327).
1498 Emacs's signal handlers were written in the old 4.2BSD style with
1499 sigblock and sigmask and so forth, and this led to some
1500 inefficiencies and confusion. Rewrite these to use
1501 pthread_sigmask etc. without copying signal sets around. Also,
1502 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1503 'signal', and instead use functions that do not attempt to take
1504 over the system name space. This patch causes Emacs's text
1505 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1506 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1507 Do not include <signal.h> or "syssignal.h", as these
1508 modules do not use signals.
1509 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1510 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1511 Do not include <signal.h>, as "syssignal.h" does that for us now.
1512 * atimer.c (sigmask_atimers): New function.
1513 (block_atimers, unblock_atimers): New functions,
1514 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1515 All uses replaced.
1516 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1517 no longer needed here.
1518 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 1519 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
1520 * sysdep.c (struct save_signal): New member 'action', replacing
1521 old member 'handler'.
1522 (save_signal_handlers, restore_signal_handlers):
1523 Use sigaction instead of 'signal' to save and restore.
1524 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1525 New function. All users of 'signal' modified to use set_sighandler
1526 if they're writeonly, and to use sys_signal if they're read+write.
1527 (emacs_sigaction_init, forwarded_signal): New functions.
1528 (sys_signal): Remove. All uses replaced by calls to sigaction
1529 and emacs_sigaction_init, or by direct calls to 'signal'.
1530 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1531 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1532 all uses replaced by pthread_sigmask etc. calls.
1533 * syssignal.h: Include <signal.h>.
1534 (emacs_sigaction_init, forwarded_signal): New decls.
1535 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1536 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1537 (sigmask, sys_sigmask): Remove; no longer needed.
1538 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1539 (sigblock, sigunblock, sigfree):
1540 (sigsetmask) [!defined sigsetmask]:
1541 Remove. All uses replaced by pthread_sigmask.
1542 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1543 no longer need to be replaced, and its typical old uses
1544 are now done via emacs_sigaction_init and sigaction.
1545 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1546 (sys_sigdel): Remove; unused.
1547 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1548
0216c128
EZ
15492012-09-06 Eli Zaretskii <eliz@gnu.org>
1550
1551 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1552 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1553
c752cfa9
DA
15542012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1555
1556 Explicitly mark buffer_defaults and buffer_local_symbols.
1557 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1558 mark_local_symbols here.
1559 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1560 since special buffers aren't marked here any more.
1561 (allocate_buffer): Chain new buffer with all_buffers here...
1562 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1563 not here.
1564 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1565 (syms_of_buffer): Remove staticpro of the above.
1566 (init_buffer_once): Set names for buffer_defaults and
1567 buffer_local_symbols.
1568
a864ef14
PE
15692012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1570
1571 Use bool for booleans in font-related modules.
1572 * font.c (font_intern_prop, font_style_to_value)
1573 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1574 (generate_otf_features, font_check_otf_features, font_check_otf)
1575 (font_match_p, font_list_entities, font_at):
1576 * fontset.c (fontset_id_valid_p, reorder_font_vector
1577 (fontset_find_font, Fset_fontset_font)
1578 (face_suitable_for_char_p) [0]:
1579 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1580 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1581 (m17n_flt_initialized, ftfont_shape_by_flt):
1582 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1583 * nsfont.m (nsfont_draw):
1584 * w32font.c (w32font_draw):
1585 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1586 Use bool for booleans.
1587 * font.h: Adjust to above API changes.
1588 (struct font, struct font_driver, struct font_driver_list):
1589 Use bool for booleans.
1590 (struct font): Remove useless member encoding_type.
1591 All users removed.
1592 * fontset.c, xftfont.c: Omit unnecessary static decls.
1593
0699fc18
DA
15942012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1595
1596 * alloc.c (mark_object): Revert window marking code
1597 since it's unsafe for the Fset_window_configuration.
1598
20ef56db
PE
15992012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1600
2fe28299 1601 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
1602 Be more systematic about preserving errno whenever a signal
1603 handler returns, even if it's not in the main thread. Do this by
1604 renaming signal handlers to distinguish between signal delivery
1605 and signal handling. All uses changed.
1606 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1607 * data.c (deliver_arith_signal): Rename from arith_error.
1608 * dispnew.c (deliver_window_change_signal): Rename from
1609 window_change_signal.
1610 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1611 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1612 * keyboard.c (deliver_input_available_signal): Rename from
1613 input_available_signal.
1614 (deliver_user_signal): Rename from handle_user_signal.
1615 (deliver_interrupt_signal): Rename from interrupt_signal.
1616 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1617 (deliver_child_signal): Rename from sigchld_handler.
1618 * atimer.c (handle_alarm_signal):
1619 * data.c (handle_arith_signal):
1620 * dispnew.c (handle_window_change_signal):
1621 * emacs.c (handle_fatal_signal, handle_danger_signal):
1622 * keyboard.c (handle_input_available_signal):
1623 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1624 * process.c (handle_pipe_signal, handle_child_signal):
1625 New functions, with the actual signal-handling code taken from the
1626 original respective signal handlers, sans the sporadic attempts to
1627 preserve errno, since that's now done by handle_on_main_thread.
1628 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1629 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1630 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1631 Move to sysdep.c.
1632 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1633 Move initialization of main_thread to sysdep.c's init_signals.
1634 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1635 our usage, and simplifies the mainline code.
1636 (record_child_status_change): New static function, as a helper
1637 for handle_child_signal, and with most of the old child handler's
1638 contents.
1639 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1640 (handle_child_signal): Use the above.
1641 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1642 Moved here from emacs.c.
1643 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1644 code moved here from emacs.c's main function.
1645 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
1646 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
1647 This lets callers save and restore errno properly.
20ef56db 1648
e3ccf108
DA
16492012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1650
1651 Remove redundant or unused things here and there.
1652 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1653 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1654 * editfns.c (Fcompare_buffer_substrings): Likewise.
1655 * frame.h (struct terminal, struct font_driver_list):
1656 Remove redundant declarations.
1657 * window.h (Qleft, Qright): Likewise.
1658
697e1e39
DA
16592012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1660
1661 Do not mark objects from deleted buffers, windows and frames.
1662 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1663 (mark_object): Likewise for windows and frames.
1664
c1ca42ca
DA
16652012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1666
1667 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1668 buffer_defaults and buffer_local_symbols as valid objects.
1669 Return special value to denote them.
1670
014d93be
PE
16712012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1672
f75d7a91
PE
1673 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1674 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1675 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1676 (file_name_absolute_p, Fsubstitute_in_file_name):
1677 (check_executable, check_writable, Ffile_accessible_directory_p)
1678 (Fset_file_selinux_context, Fdefault_file_modes)
1679 (Finsert_file_contents, choose_write_coding_system)
1680 (Fwrite_region, build_annotations, a_write, e_write)
1681 (Fdo_auto_save):
1682 * filelock.c (boot_time_initialized, get_boot_time)
1683 (get_boot_time_1, lock_file_1, within_one_second):
1684 * floatfns.c (in_float):
1685 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1686 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1687 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1688 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1689 * window.c (compare_window_configurations):
1690 Use bool for booleans.
1691 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1692 (Fdefault_file_modes): Now mode_t, not int, for modes.
1693 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1694 (internal_delete_file): Now returns void, not a (boolean) int,
1695 since nobody was looking at the return value.
1696 * lisp.h, window.h: Adjust to above API changes.
1697
014d93be
PE
1698 * xdisp.c (set_message): Simplify and reindent last change.
1699
776f29e1
JB
17002012-09-05 Juanma Barranquero <lekktu@gmail.com>
1701
1702 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1703
7f7e0167
LI
17042012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1705
1706 * eval.c (call_debugger): Make the function non-static so that we
1707 can call it from set_message.
1708
1709 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1710 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1711
cf29dd84
PE
17122012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1713
1714 Give more-useful info on a fatal error (Bug#12328).
1715 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1716 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1717 of doing the work ourselves.
1718 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1719 do most of the work.
1720 (fatal_error_backtrace): New function, taken from the guts
1721 of the old fatal_error_signal, but with a new option to output
1722 a backtrace.
1723 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1724 info about the signal than just its number.
1725 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1726 * sysdep.c: Include <execinfo.h>
1727 (emacs_backtrace): New function, taken partly from the previous
1728 code of the 'die' function.
1729 (emacs_abort): Call fatal_error_backtrace rather than abort.
1730
972debf2
SM
17312012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1732
1733 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1734 eager (load-time) macro-expansion.
1735 * lisp.mk (lisp): Add macroexp.
1736
1088b922
PE
17372012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1738
1739 Simplify redefinition of 'abort' (Bug#12316).
1740 Do not try to redefine the 'abort' function. Instead, redo
1741 the code so that it calls 'emacs_abort' rather than 'abort'.
1742 This removes the need for the NO_ABORT configure-time macro
1743 and makes it easier to change the abort code to do a backtrace.
1744 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1745 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1746 Remove; sysdep.c's emacs_abort now takes its place.
1747 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1748 'abort' changed to use 'emacs_abort'.
1749 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1750 (abort) [!defined abort]: Rename to ...
1751 (emacs_abort): ... new name.
1752 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1753 the place of the old 'abort' in emacs.c.
1754 * w32.c, w32fns.c (abort): Do not #undef.
1755 * w32.c (emacs_abort): Rename from w32_abort.
1756
30934d33
EZ
17572012-09-04 Eli Zaretskii <eliz@gnu.org>
1758
1759 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1760 offsets[j].dv, since the y axis of the screen coordinates points
1761 down, while the y axis of the font definition coordinates points
1762 up. This fixes display of Arabic diacritics such as KASRA and
1763 KASRATAN. (Bug#11860)
1764
af26b72c
PE
17652012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1766
1767 Be more systematic about _setjmp vs setjmp.
1768 * alloc.c (test_setjmp, mark_stack):
1769 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1770 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1771 (png_load, my_error_exit, jpeg_load):
1772 * process.c (send_process_trap, send_process):
1773 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1774 The underscored versions are up to 30x faster on some hosts.
1775 Formerly, the code used setjmp+longjmp sometimes and
1776 _setjmp+_longjmp at other times, with no particular reason to
1777 prefer setjmp+longjmp.
1778
26d4541d
PE
17792012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1780
d42f4f0f 1781 Fix minor problem found by static checking.
26d4541d 1782 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 1783
c5e28e39
MR
17842012-09-03 Martin Rudalics <rudalics@gmx.at>
1785
1786 * buffer.c (Fdelete_all_overlays): New function.
1787
3eab3ca9
CY
17882012-09-03 Chong Yidong <cyd@gnu.org>
1789
1790 * gtkutil.c: Add extern decl for Qxft.
1791
c04889f8
PE
17922012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1793
1882aa38
PE
1794 * emacs.c, eval.c: Use bool for boolean.
1795 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1796 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1797 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1798 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1799 (main, decode_env_path, Fdaemon_initialized):
1800 * eval.c (call_debugger, Finteractive_p, interactive_p):
1801 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1802 (maybe_call_debugger, Fbacktrace):
1803 * process.c (read_process_output, exec_sentinel):
1804 Use bool for booleans.
1805 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1806 All callers changed.
1807 * eval.c (interactive_p): Omit always-true boolean argument
1808 EXCLUDE_SUBRS_P. All callers changed.
1809 * dispextern.h, lisp.h: Reflect above API changes.
1810 * firstfile.c (dummy): Use the address of 'main', whose signature
1811 won't change, instead of the address of 'initialize', whose
1812 signature just changed from int to bool.
1813 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1814 * msdos.c (fatal_error_in_progress): ... from here.
1815 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1816 of incrementing it.
1817 (redisplay_internal, unwind_redisplay): Simply clear
1818 REDISPLAYING_P when unwinding, instead of saving its previous,
1819 always-false value and then restoring it.
1820
a411ac43
PE
1821 Clean up some extern decls.
1822 Mostly, this hoists extern decls out of .c files and into .h files.
1823 That way, we're more likely to catch errors if the interfaces change.
1824 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1825 declare xg_mark_data.
1826 * dispextern.h (x_frame_parm_handlers):
1827 * font.h (Qxft):
1828 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1829 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1830 (Qultra_bold, Qoblique, Qitalic):
1831 Move extern decl here from .c file.
1832 * alloc.c (xg_mark_data) [USE_GTK]:
1833 * doc.c (Qclosure):
1834 * eval.c (Qlexical_binding):
1835 * fns.c (time) [!HAVE_UNISTD_H]:
1836 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1837 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1838 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1839 * lread.c (Qinternal_interpreter_environment):
1840 * minibuf.c (Qbuffer):
1841 * process.c (QCfamily, QCfilter):
1842 * widget.c (free_frame_faces):
1843 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1844 * xfont.c (x_clear_errors):
1845 * xterm.c (x_frame_parm_handlers):
1846 Remove now-redundant extern decls.
1847 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1848 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1849 Now static.
1850 * xfaces.c: Remove unnecessary static decls.
1851 * xterm.c (updating_frame): Remove decl of nonexistent object.
1852
c04889f8
PE
1853 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1854 when building globals.h, as the objects that are not built on
1855 this host are not needed to compile C files on this host.
1856
8b339673
JD
18572012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1858
1859 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1860
1861 * frame.h: Add missing prototype for x_wm_set_size_hint.
1862
a08d4ba7
PE
18632012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1864
1865 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1866 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1867 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1868 (Fsubstitute_command_keys):
1869 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1870 (save_excursion_save, save_excursion_restore)
1871 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1872 (format_time_string, general_insert_function)
1873 (make_buffer_string, make_buffer_string_both)
1874 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1875 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1876 (copy_text, insert_1, insert_1_both, insert_from_string)
1877 (insert_from_string_before_markers, insert_from_string_1)
1878 (insert_from_buffer, insert_from_buffer_1, replace_range)
1879 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1880 (del_range_2, modify_region):
1881 * intervals.c (intervals_equal, balance_possible_root_interval)
1882 (adjust_intervals_for_insertion, merge_properties_sticky)
1883 (graft_intervals_into_buffer, lookup_char_property)
1884 (adjust_for_invis_intang, set_point_both)
1885 (get_property_and_range, compare_string_intervals)
1886 (set_intervals_multibyte_1, set_intervals_multibyte):
1887 * keyboard.c (decode_timer):
1888 Use bool for boolean.
1889 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1890 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1891
48c948de
CY
18922012-09-02 Chong Yidong <cyd@gnu.org>
1893
1894 * keymap.c (push_key_description): Print M-TAB as C-M-i
1895 (Bug#11758).
1896
6c49a40b
JB
18972012-09-02 Juanma Barranquero <lekktu@gmail.com>
1898
1899 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1900 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1901 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1902 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1903 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1904 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1905 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1906
4dfbd238
EZ
19072012-09-01 Eli Zaretskii <eliz@gnu.org>
1908
7e510e28
EZ
1909 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1910 more than one grapheme cluster passed to the shaper: compute the
1911 offset adjustment values separately for each cluster. (Bug#11860)
1912
4dfbd238
EZ
1913 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1914 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1915 about implicit conversions from integer to pointer.
1916
86571ae0
DC
19172012-09-01 Daniel Colascione <dancol@dancol.org>
1918
1919 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1920 system used too early.
1921
0e23ef9d
PE
19222012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1923
1924 Better seed support for (random).
1925 * emacs.c (main): Call init_random.
1926 * fns.c (Frandom): Set the seed from a string argument, if given.
1927 Remove long-obsolete Gentzel cruft.
1928 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1929 (init_random): New function.
1930
17a2cbbd
DC
19312012-09-01 Daniel Colascione <dancol@dancol.org>
1932
1933 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1934 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1935 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1936 x_wm_set_size_hint, x_query_colors, x_real_positions,
1937 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1938 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1939 all of which have been moved to common code.
1940
1941 * xfaces.c: Include TERM_HEADER instead of listing all possible
1942 window-system headers.
1943
1944 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1945 to match header.
1946
1947 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1948 directly accessing frame internals.
1949
f18cbb28 1950 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
1951 globals_of_w32font.
1952
1953 * process.c: Include TERM_HEADER instead of listing all possible
1954 window-system headers.
1955
3a880af4
SM
1956 * nsterm.h: Remove declarations now in frame.h.
1957 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
1958
1959 * menu.c: Include TERM_HEADER instead of listing all possible
1960 window-system headers.
1961
1962 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1963 window system.
1964
1965 * keyboard.c: Include TERM_HEADER instead of listing all possible
1966 window-system headers.
1967
1968 * image.c: Include TERM_HEADER instead of listing all possible
1969 window-system headers. Declare Vlibrary_cache when compiling for
1970 Windows.
1971
1972 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1973 window system declarations.
1974
1975 * frame.h: Move common functions here: set_frame_menubar,
1976 x_set_window_size, x_sync, x_get_focus_frame,
1977 x_set_mouse_position, x_set_mouse_pixel_position,
1978 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1979 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1980 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1981 x_activate_menubar, x_real_positions, x_bitmap_icon,
1982 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1983 and x_query_colors.
1984
1985 * frame.c: Include TERM_HEADER instead of listing all possible
1986 window-system headers.
1987
1988 * font.c: Include TERM_HEADER instead of listing all possible
1989 window-system headers.
1990
1991 * emacs.c: Include TERM_HEADER.
1992
f18cbb28
EZ
1993 * dispnew.c: Include TERM_HEADER instead of listing all possible
1994 window-system headers.
17a2cbbd 1995
f18cbb28 1996 * ccl.h: Include character.h.
17a2cbbd
DC
1997
1998 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1999 the current window system; include in list of objects to link into
2000 Emacs.
2001
c650a5de
DA
20022012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2003
2004 Remove mark_ttys function and fix tty_display_info initialization.
2005 * lisp.h (mark_ttys): Remove prototype.
2006 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2007 to mark_ttys because all possible values of 'top_frame' slot are
2008 the frames which are reachable from Vframe_list.
2009 * term.c (mark_ttys): Remove.
2010 (init_tty): Safely initialize 'top_frame' slot with Qnil.
2011
4e0f6479
DA
20122012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2013
2014 Change struct frame bitfields from unsigned char to unsigned.
2015 * frame.h (struct frame): Change type of 'display_preempted',
2016 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2017 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2018 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2019 bitfields from unsigned char to unsigned.
2020
8b96a52c
DA
20212012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2022
2023 Remove unused member of struct x_output and struct w32_output.
2024 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2025 * w32term.h (struct w32_output): Likewise.
2026
b4444c8a
JD
20272012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2028
2029 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2030 does not become zero (Bug#12234).
2031
b98521db
PE
20322012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2033
2034 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2035 for GCC 4.7.1 x86-64.
2036
31d02438
GM
20372012-08-30 Glenn Morris <rgm@gnu.org>
2038
2039 * lread.c (init_lread): For out-of-tree builds, only add the
2040 source directory's site-lisp dir to the load-path if it exists,
2041 consistent with in-tree builds. (Bug#12302)
2042
7f8941d8
JD
20432012-08-28 Jan Djärv <jan.h.d@swipnet.se>
2044
2045 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 2046 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
2047 (windowShouldClose:): Set window_closed.
2048 (dealloc): New member, free button_values.
fc0c31f8
JB
2049 (process_dialog:): Make member function. Remove window argument,
2050 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
2051 in button_values.
2052 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 2053 with tag. Remove return self, declare return value as void.
7f8941d8
JD
2054 (addString:row:): Remove return self, declare return value as void.
2055 (addSplit): Remove return self, declare return value as void.
2056 (clicked:): Remove return self, declare return value as void.
fc0c31f8 2057 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
2058 (initFromContents:isQuestion:): Adjust call to process_dialog.
2059 Code formatting change.
2060 (timeout_handler:): Set timer_fired to YES.
2061 (runDialogAt:): Set timer_fired to NO.
2062 Handle click on close button as quit.
2063
2064 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
2065 Add window_closed and button_values. Add void as return value for
2066 add(Button|String|Split). addButton takes int instead of Lisp_Object.
2067 Add process_dialog as new member.
2068
eada0861 20692012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 2070
eada0861
GM
2071 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
2072 is not one of the heaps we manage. (Bug#12242)
2073
20742012-08-28 Glenn Morris <rgm@gnu.org>
2075
2076 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
2077
457294dd
MR
20782012-08-28 Martin Rudalics <rudalics@gmx.at>
2079
2080 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
2081 auto-buffer-name window parameter. Install revision of reverted
2082 fix.
457294dd 2083
4f2daf31
DA
20842012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2085
2086 Do not allow to set major mode for a dead buffer.
2087 * buffer.c (Fset_buffer_major_mode): Signal an error
2088 if the buffer is dead.
2089 (Fother_buffer, other_buffer_safely): Remove redundant
2090 nested declaration.
2091
66322887
DA
20922012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2093
2094 Always use set_buffer_if_live to restore original buffer at unwind.
2095 * buffer.h (record_unwind_current_buffer): New function.
2096 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
2097 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
2098 * undo.c, window.c: Adjust users.
2099 * buffer.c (set_buffer_if_live): Fix comment.
2100
a3d794a1
DA
21012012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2102
2103 Fix usage of set_buffer_internal.
2104 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
2105 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
2106 * coding.c (decode_coding): Omit redundant test.
2107 * fileio.c (decide_coding_unwind): Likewise.
2108 * fns.c (secure_hash): Likewise.
2109 * insdel.c (modify_region): Likewise.
2110 * keyboard.c (command_loop_1): Likewise.
2111 * print.c (PRINTFINISH): Likewise.
2112 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
2113
59ea14cd
PE
21142012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2115
2116 * dispnew.c: Use bool for boolean.
2117 (frame_garbaged, display_completed, delayed_size_change)
2118 (fonts_changed_p, add_window_display_history)
2119 (add_frame_display_history, verify_row_hash)
2120 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
2121 (row_equal_p, realloc_glyph_pool)
2122 (allocate_matrices_for_frame_redisplay)
2123 (showing_window_margins_p)
2124 (adjust_frame_glyphs_for_frame_redisplay)
2125 (build_frame_matrix_from_leaf_window, make_current)
2126 (mirrored_line_dance, mirror_line_dance, update_frame)
2127 (update_window_tree, update_single_window)
2128 (check_current_matrix_flags, update_window, update_text_area)
2129 (update_window_line, set_window_update_flags, scrolling_window)
2130 (update_frame_1, scrolling, buffer_posn_from_coords)
2131 (do_pending_window_change, change_frame_size)
2132 (change_frame_size_1, sit_for):
2133 Use bool for boolean.
2134 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2135 and remove last int (actually boolean) argument, which was always 0.
2136 All callers changed.
2137 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2138 * dispextern.h (struct composition_it): Use bool for boolean.
2139 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2140 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2141 * dired.c (file_name_completion):
2142 Use bool for boolean. (This was missed in an earlier change.)
2143
95072a94
MR
21442012-08-27 Martin Rudalics <rudalics@gmx.at>
2145
2146 * window.c (Fset_window_configuration): Revert first part of
2147 last change.
2148
0f19feff
JD
21492012-08-27 Jan Djärv <jan.h.d@swipnet.se>
2150
2151 * nsterm.h (NSPanel): New class variable dialog_return.
2152
3a880af4
SM
2153 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2154 Initialize dialog_return.
0f19feff
JD
2155 (windowShouldClose:): Use stop instead of stopModalWithCode.
2156 (clicked:): Ditto, and also set dialog_return (Bug#12258).
2157 (timeout_handler:): Use stop instead of abortModal. Send a dummy
2158 event.
2159 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
2160 modal loop returns.
2161
f10fe38f
PE
21622012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2163
de1339b0
PE
2164 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2165 * composite.c (find_composition, composition_gstring_p)
2166 (composition_reseat_it, find_automatic_composition):
2167 * data.c (let_shadows_buffer_binding_p)
2168 (let_shadows_global_binding_p, set_internal, make_blv)
2169 (Fmake_variable_buffer_local, Fmake_local_variable)
2170 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2171 (cons_to_signed, arith_driver):
2172 * dbusbind.c (xd_in_read_queued_messages):
2173 * dired.c (directory_files_internal, file_name_completion):
2174 Use bool for booleans.
2175 * dired.c (file_name_completion):
2176 * process.h (fd_callback):
2177 Omit int (actually boolean) argument. It wasn't being used.
2178 All uses changed.
2179 * composite.h, lisp.h: Reflect above API changes.
2180
f10fe38f
PE
2181 * cmds.c, coding.c: Use bool for booleans.
2182 * cmds.c (move_point, Fself_insert_command):
2183 * coding.h (struct composition status, struct coding_system):
2184 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2185 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2186 (emacs_mule_char, decode_coding_emacs_mule)
2187 (encode_coding_emacs_mule, detect_coding_iso_2022)
2188 (decode_coding_iso_2022, encode_invocation_designation)
2189 (encode_designation_at_bol, encode_coding_iso_2022)
2190 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2191 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2192 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2193 (encode_coding_raw_text, detect_coding_charset)
2194 (decode_coding_charset, encode_coding_charset, detect_eol)
2195 (detect_coding, get_translation_table, produce_chars)
2196 (consume_chars, reused_workbuf_in_use)
2197 (make_conversion_work_buffer, code_conversion_save)
2198 (decode_coding_object, encode_coding_object)
2199 (detect_coding_system, char_encodable_p)
2200 (Funencodable_char_position, code_convert_region)
2201 (code_convert_string, code_convert_string_norecord)
2202 (Fset_coding_system_priority):
2203 * fileio.c (Finsert_file_contents):
2204 Use bool for booleans.
2205 * coding.h, lisp.h: Reflect above API changes.
2206 * coding.c: Remove unnecessary static function decls.
2207 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2208 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2209 not a boolean 'int', since callers never look at the return value.
2210 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2211 * coding.h (decoding_buffer_size, encoding_buffer_size)
2212 (emacs_mule_string_char): Remove unused extern decls.
2213 (struct iso_2022_spec, struct coding_system):
2214 Use 'unsigned int : 1' for boolean fields, since there's more than one.
2215 (struct emacs_mule_spec): Remove unused field 'full_support'.
2216 All initializations removed.
2217 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2218
5474c384
DA
22192012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2220
f10fe38f 2221 Fix spare memory change (Bug#12286).
5474c384
DA
2222 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
2223 (valid_lisp_object_p): Likewise.
2224
c4b6914d
MR
22252012-08-27 Martin Rudalics <rudalics@gmx.at>
2226
2227 * window.c (Fset_window_configuration): Record any window's old
2228 buffer if it's replaced (see Bug#8789). If the new current
2229 buffer doesn't appear in the selected window, go to its old
2230 point (Bug#12208).
2231
35aaa1ea
DA
22322012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2233
2234 Special MEM_TYPE_SPARE to denote reserved memory.
2235 * alloc.c (enum mem_type): New memory type.
2236 (refill_memory_reserve): Use new type for spare memory.
2237 This prevents live_cons_p and live_string_p from incorrect
2238 detection of uninitialized objects from spare memory as live.
2239
6af64513
PE
22402012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2241
8b2e00a3
PE
2242 Spelling fixes.
2243 * Makefile.in (.PHONY): versioclean -> versionclean.
2244
b52d6985
PE
2245 Remove unused external symbols.
2246 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2247 * window.c (Qwindow_valid_p, decode_valid_window):
2248 Now static, not extern.
2249 * data.c (Qinterval): Remove; unused.
2250 (syms_of_data): Do not define 'interval'.
2251 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2252 * window.h (decode_valid_window):
2253 Remove decls.
2254
d5172d4f
PE
2255 * character.c, charset.c, chartab.c: Use bool for booleans.
2256 * character.c (lisp_string_width, string_count_byte8)
2257 (string_escape_byte8):
2258 * charset.c (charset_map_loaded, load_charset_map, read_hex):
2259 (load_charset_map_from_file, map_charset_chars)
2260 (Fdefine_charset_internal, define_charset_internal)
2261 (Fdeclare_equiv_charset, find_charsets_in_text)
2262 (Ffind_charset_region, char_charset, Fiso_charset):
2263 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2264 (sub_char_table_set, sub_char_table_set_range)
2265 (char_table_set_range, optimize_sub_char_table)
2266 (map_sub_char_table):
2267 Use bool for boolean.
2268 * character.c (str_to_unibyte): Omit last boolean argument; it was
2269 always 0. All callers changed.
2270 * character.h, charset.h: Adjust to match previous changes.
2271 * character.h (char_printable_p): Remove decl of nonexistent function.
2272 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2273 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2274 are all boolean, so make them single-bit bitfields.
2275
6af64513
PE
2276 * lisp.h (ASET): Remove attempt to detect side effects.
2277 It was meant to be temporary and it often doesn't work,
2278 because when IDX has side effects the behavior of IDX==IDX
2279 is undefined. See Stefan Monnier in
2280 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2281
e1f29348
BR
22822012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2283
2284 * lisp.h (functionp): New function (extracted from Ffunctionp).
2285 (FUNCTIONP): Use it.
2286 * eval.c (Ffunctionp): Use it.
2287
17c05d74
PE
22882012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2289
0f46bc75
PE
2290 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2291 as that's faster and simpler than static storage. Don't bother
2292 with the g_main_context_query overhead if g_main_context_pending
2293 says no events are pending.
2294 (gfds, gfds_size): Remove these static vars.
2295 (xgselect_initialize): Remove; no longer needed.
2296 All uses and decls removed.
2297
ee4c0f69
PE
2298 * emacs.c (fatal_error_signal_hook): Remove.
2299 All uses removed. This leftover from old code was always 0.
2300
17c05d74
PE
2301 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2302 * casefiddle.c (casify_object, casify_region):
2303 * casetab.c (set_case_table):
2304 * category.c, category.h (word_boundary_p):
2305 * category.h (CHAR_HAS_CATEGORY):
2306 Use bool for booleans, instead of int.
2307
391ceac5
EZ
23082012-08-25 Eli Zaretskii <eliz@gnu.org>
2309
2310 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2311
2f221583
PE
23122012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2313
f4a681b0
PE
2314 On assertion failure, print backtrace if available.
2315 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2316 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2317 * Makefile.in (LIB_EXECINFO): New macro.
2318 (LIBES): Use it.
2319
2f221583
PE
2320 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2321 * bytecode.c (exec_byte_code):
2322 * callint.c (check_mark, Fcall_interactively):
2323 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2324 (getenv_internal, sync_process_alive, call_process_exited):
2325 * lisp.h (USE_SAFE_ALLOCA):
2326 Use bool for booleans, instead of int.
2327 * lisp.h, process.h: Adjust prototypes to match above changes.
2328 * callint.c (Fcall_interactively): Don't assume the mark's
2329 offset fits in 'int'.
2330
37ef52bb
PE
23312012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2332
2333 * buffer.c, buffer.h: Use bool for boolean.
2334 * buffer.c (reset_buffer_local_variables)
2335 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2336 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2337 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2338 (overlay_touches_p, overlay_strings, Foverlay_put)
2339 (report_overlay_modification, call_overlay_mod_hooks):
2340 (mmap_enlarge, mmap_set_vars):
2341 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2342 Use bool for booleans, instead of int.
2343 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2344 since the 1-or-0 return value is always ignored anyway.
2345 (mmap_initialized_p):
2346 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2347 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2348
2cc21167
PE
23492012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2350
2351 * bidi.c: Use bool for boolean.
2352 This is a bit more readable, and makes the text segment of bidi.o
2353 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2354 Presumably it's faster too.
2355 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2356 Now bool.
2357 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2358 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2359 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2360 (bidi_explicit_dir_char, bidi_level_of_next_char)
2361 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2362 Use bool for booleans, instead of int.
2363 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2364 (bidi_unshelve_cache): Adjust decls to match code.
2365
7db4ddf4
MR
23662012-08-23 Martin Rudalics <rudalics@gmx.at>
2367
2368 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2369 argument.
2370
b1bb8011
PE
23712012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2372
2373 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2374 * atimer.h: Include <stdbool.h>.
2375
ff687885
DN
23762012-08-22 Dan Nicolaescu <dann@gnu.org>
2377
2378 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2379 compile time tests instead of run time tests on systems that do
2380 not use them.
2381 (FRAME_MAC_P): Remove leftover from deleted code.
2382 * frame.c (syms_of_frame): Remove leftover from deleted code.
2383
4ce7a138
JD
23842012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2385
2386 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2387
d733ec6d
PE
23882012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2389
2390 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2391 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 2392 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
2393 (fontset_add): Return void, for FONTSET_ADD.
2394
d0d2d26f
PE
23952012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2396
fce31d69
PE
2397 * alloc.c: Use bool for booleans.
2398 (gc_in_progress, abort_on_gc)
2399 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2400 (dont_register_blocks) [GC_MALLOC_CHECK]:
2401 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2402 (check_string_bytes, make_specified_string, memory_full)
2403 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2404 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2405 (mark_stack, valid_pointer_p, make_pure_string)
2406 (Fgarbage_collect, survives_gc_p, gc_sweep):
2407 Use bool for booleans, instead of int.
2408 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2409 Remove unused local.
2410 * alloc.c (PURE_POINTER_P):
2411 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2412 * editfns.c (Fformat):
2413 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2414 (Fdo_auto_save):
2415 * fns.c (sweep_weak_table):
2416 * lisp.h (suppress_checking, push_message, survives_gc_p)
2417 (make_pure_string, gc_in_progress, abort_on_gc):
2418 * lread.c (readchar, read1):
2419 * print.c (Fprin1_to_string):
2420 * xdisp.c (push_message):
2421 Use bool for booleans affected directly or indirectly by
2422 alloc.c's changes.
2423
d0d2d26f
PE
2424 Make recently-introduced setters macros.
2425 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2426 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2427 (set_fontset_default, set_fontset_fallback): Rename from their
2428 upper-case counterparts, and make them functions rather than macros.
2429 This is more consistent with the other recently-introduced setters.
2430 These don't need to be inline, since they're local.
2431
d18e2bb6
JD
24322012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2433
2434 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2435 the loop (Bug#12247).
2436
1b9d9d16
PE
24372012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2438
2439 * lisp.h (vcopy): Use memcpy rather than our own loop.
2440 This fixes a performance regression introduced by the recent
2441 addition of vcopy. This means 'vcopy' will need to be modified
2442 for a copying collector, but that's OK. Also, tighten the
2443 checking in the assertion.
2444
b2f09701
EZ
24452012-08-21 Eli Zaretskii <eliz@gnu.org>
2446
2447 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2448 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2449 non-base glyph for the width of the base character, according to
e1f29348
BR
2450 what x_draw_composite_glyph_string_foreground expects.
2451 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
2452 expectations, to produce correct width of the composed character.
2453 Reverse the sign of the DU offset produced by ScriptPlace.
2454
9b994fed
PE
24552012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2456
2457 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2458
086ca913
DA
24592012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2460
2461 Avoid direct writes to contents member of struct Lisp_Vector.
2462 * lisp.h (vcopy): New function to copy data into vector.
2463 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2464 * fns.c (Ffillarray): Use ASET.
2465 * keyboard.c (timer_check_2): Use AREF and ASET.
2466 (append_tool_bar_item, Frecent_keys): Use vcopy.
2467 * lread.c (read_vector): Use ASET.
2468 * msdos.c (Frecent_doskeys): Use vcopy.
2469 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2470 (Finternal_merge_in_global_face): Use ASET and vcopy.
2471 * xfont.c (xfont_list_pattern): Likewise.
2472
5481664a
MR
24732012-08-21 Martin Rudalics <rudalics@gmx.at>
2474
2475 * window.c (Fwindow_point): For the selected window always return
2476 the position of its buffer's point.
2477 (Fset_window_point): For the selected window always go in its
2478 buffer to the specified position.
2479
6d470bdd
DA
24802012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2481
2482 Setter macros for fontsets.
2483 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2484 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2485 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2486 Adjust users.
2487
24564fe1
GM
24882012-08-20 Glenn Morris <rgm@gnu.org>
2489
2490 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2491 Don't assume that `ln -f' works.
2492
0a05a035
EZ
24932012-08-20 Eli Zaretskii <eliz@gnu.org>
2494
2495 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2496 and later about non-assignments with no effect. See discussion at
2497 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2498 details.
2499
e46f2325
DA
25002012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2501
2502 Inline setter functions for Lisp_Objects slots of struct specbinding.
2503 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2504 Adjust users.
2505
734fbd86
MR
25062012-08-20 Martin Rudalics <rudalics@gmx.at>
2507
2508 * window.c (select_window): Always make selected window's buffer
2509 current.
2510
f1a95992
DA
25112012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2512
2513 Use AREF and ASET for docstrings of category tables.
2514 * category.h (CATEGORY_DOCSTRING): Use AREF.
2515 (SET_CATEGORY_DOCSTRING): Use ASET.
2516 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2517
e83064be
DA
25182012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2519
2520 Inline setter functions for hash table members.
2521 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2522 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2523 (set_hash_key_and_value, set_hash_index, set_hash_next)
2524 (set_hash_hash): New functions.
2525 * charset.c, fns.c: Adjust users.
2526
4ce60d2e
DA
25272012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2528
2529 Inline getter and setter functions for per-buffer values.
2530 * buffer.h (per_buffer_default, set_per_buffer_default)
2531 (per_buffer_value, set_per_buffer_value): New functions.
2532 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2533 * buffer.c, data.c: Adjust users.
2534
c06c9690
JB
25352012-08-20 Juanma Barranquero <lekktu@gmail.com>
2536
2537 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2538
32bd4250
PE
25392012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2540
bad03192 2541 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
2542 as gnulib does this if the system doesn't.
2543 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
2544 Remove declaration. MS-Windows declares it on stdlib.h which is
2545 included by conf_post.h.
b69a6d22
PE
2546 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2547 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2548 * vm-limit.c: Include <unistd.h>, for 'environ'.
2549
22d7feb2
PE
2550 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2551 (start_of_data): Remove decl; mem-limits.h provides it.
2552
32bd4250
PE
2553 * xdisp.c (handle_invisible_prop): Make it a bit faster
2554 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2555
450809af
CY
25562012-08-19 Chong Yidong <cyd@gnu.org>
2557
2558 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2559 ends (Bug#3874).
2560
9e677988
AS
25612012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2562
6b1319ce
AS
2563 * .gdbinit: Use call instead of set when calling a function in the
2564 inferior.
2565
9e677988
AS
2566 * data.c (set_internal): Don't use set_blv_found.
2567 (Fkill_local_variable): Likewise.
2568
d7191076
AA
25692012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2570
2571 * nsfont.m (ns_ascii_average_width): Ensure the string
2572 ascii_printable is initialized with a null-terminated character
2573 array. Otherwise, it can contain undesired extra characters.
2574
e757f1c6
PE
25752012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2576
2577 port new setting code to Sun C 5.8 2005/10/13
2578 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2579 Return void, not Lisp_Object. Otherwise, the compiler
2580 complains about (A?B:C) where B is void and C is Lisp_Object
2581 when compiling CHAR_TABLE_SET, due to the recent change to
2582 the API of sub_char_table_set_contents.
2583
a999ce26
CY
25842012-08-18 Chong Yidong <cyd@gnu.org>
2585
2586 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2587 for the string case (Bug#3874).
2588
3f22b86f
PE
25892012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2590
39eb03f1
PE
2591 * buffer.h (BSET): Remove (Bug#12215).
2592 Replace all uses with calls to new setter functions.
2593 (bset_bidi_paragraph_direction, bset_case_canon_table)
2594 (bset_case_eqv_table, bset_directory, bset_display_count)
2595 (bset_display_time, bset_downcase_table)
2596 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2597 (bset_last_selected_window, bset_local_var_alist)
2598 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2599 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2600 (bset_width_table):
2601 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2602 (bset_auto_fill_function, bset_auto_save_file_format)
2603 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2604 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2605 (bset_cache_long_line_scans, bset_case_fold_search)
2606 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2607 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2608 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2609 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2610 (bset_header_line_format, bset_indicate_buffer_boundaries)
2611 (bset_indicate_empty_lines, bset_invisibility_spec)
2612 (bset_left_fringe_width, bset_major_mode, bset_mark)
2613 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2614 (bset_name, bset_overwrite_mode, bset_pt_marker)
2615 (bset_right_fringe_width, bset_save_length)
2616 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2617 (bset_scroll_up_aggressively, bset_selective_display)
2618 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2619 (bset_word_wrap, bset_zv_marker):
2620 * category.c (bset_category_table):
2621 * syntax.c (bset_syntax_table):
2622 New setter functions.
2623
6a09a33b
PE
2624 * process.h (PSET): Remove (Bug#12215).
2625 Replace all uses with calls to new setter functions.
2626 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2627 (PROCESS_INLINE): New macro.
2628 (pset_childp): New setter function.
2629 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2630 * process.c (PROCESS_INLINE):
2631 Define to EXTERN_INLINE, so that the corresponding functions
2632 are compiled into code.
2633 (pset_buffer, pset_command, pset_decode_coding_system)
2634 (pset_decoding_buf, pset_encode_coding_system)
2635 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2636 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2637 (pset_type, pset_write_queue): New setter functions.
2638
e8c17b81
PE
2639 * window.h (WSET): Remove (Bug#12215).
2640 Replace all uses with calls to new setter functions.
2641 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2642 (WINDOW_INLINE): New macro.
2643 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2644 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2645 (wset_total_lines, wset_vertical_scroll_bar)
2646 (wset_window_end_pos, wset_window_end_valid)
2647 (wset_window_end_vpos): New setter functions.
2648 * window.c (WINDOW_INLINE):
2649 Define to EXTERN_INLINE, so that the corresponding functions
2650 are compiled into code.
2651 (wset_combination_limit, wset_dedicated, wset_display_table)
2652 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2653 (wset_new_normal, wset_new_total, wset_next_buffers)
2654 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2655 (wset_prev_buffers, wset_right_fringe_width)
2656 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2657 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2658 (wset_window_parameters):
2659 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2660 (wset_column_number_displayed, wset_region_showing):
2661 New setter functions.
2662
3f22b86f
PE
2663 * termhooks.h (TSET): Remove (Bug#12215).
2664 Replace all uses with calls to new setter functions.
2665 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2666 (TERMHOOKS_INLINE): New macro.
2667 (tset_charset_list, tset_selection_alist): New setter functions.
2668 * terminal.c (TERMHOOKS_INLINE):
2669 Define to EXTERN_INLINE, so that the corresponding functions
2670 are compiled into code.
2671 (tset_param_alist): New setter function.
2672
742af32f
PE
26732012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2674
15dbb4d6
PE
2675 * keyboard.h (KSET): Remove (Bug#12215).
2676 Replace all uses with calls to new setter functions.
2677 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2678 (KEYBOARD_INLINE): New macro.
2679 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2680 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2681 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2682 New setter functions.
2683 * keyboard.c (KEYBOARD_INLINE):
2684 Define to EXTERN_INLINE, so that the corresponding functions
2685 are compiled into code.
2686 (kset_echo_string, kset_kbd_queue)
2687 (kset_keyboard_translate_table, kset_last_prefix_arg)
2688 (kset_last_repeatable_command, kset_local_function_key_map)
2689 (kset_overriding_terminal_local_map, kset_real_last_command)
2690 (kset_system_key_syms): New setter functions.
2691
f00af5b1
PE
2692 * frame.h (FSET): Remove (Bug#12215).
2693 Replace all uses with calls to new setter functions.
2694 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2695 (FRAME_INLINE): New macro.
2696 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2697 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2698 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2699 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2700 (fset_param_alist, fset_root_window, fset_scroll_bars)
2701 (fset_selected_window, fset_title, fset_tool_bar_items)
2702 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2703 * frame.c (FRAME_INLINE):
2704 Define to EXTERN_INLINE, so that the corresponding functions
2705 are compiled into code.
2706 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2707
0c94c8d6
PE
2708 A few more naming-convention fixes for getters and setters.
2709 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2710 and rename from buffer_overlays_set_before.
2711 (set_buffer_overlays_after): Move here from buffer.h, and rename
2712 from buffer_overlays_set_after.
2713 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2714 All uses changed.
2715 (set_buffer_intervals): Rename from buffer_set_intervals.
2716 * intervals.c (set_interval_object): Move here from intervals.h,
2717 and rename from interval_set_object.
2718 (set_interval_left): Move here from intervals.h, and rename from
2719 interval_set_left.
2720 (set_interval_right): Move here from intervals.h, and rename from
2721 interval_set_right.
2722 (copy_interval_parent): Move here from intervals.h, and rename from
2723 interval_copy_parent.
2724 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2725 (set_interval_plist): Rename from interval_set_plist.
2726 Return void, not Lisp_Object, since no caller uses the result.
2727 * lisp.h (string_intervals): Rename from string_get_intervals.
2728 (set_string_intervals): Rename from string_set_intervals.
2729
34dabdb7
PE
2730 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2731 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 2732 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
2733 All uses changed. See the end of
2734 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2735
742af32f
PE
2736 * lisp.h (CSET): Remove (Bug#12215).
2737 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2738 (set_char_table_purpose): New functions,
2739 replacing CSET. All uses changed. For example, replace
2740 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 2741 "set_char_table_parent (char_table, parent);".
742af32f
PE
2742 The old version was confusing because it used the same name
2743 'parent' for two different things.
2744
a04e2c62
DA
27452012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2746
2747 Functions to get and set Lisp_Object fields of buffer-local variables.
2748 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2749 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2750 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2751 * data.c, eval.c, frame.c: Adjust users.
2752
383dcbf9
CY
27532012-08-17 Chong Yidong <cyd@gnu.org>
2754
2755 * xfaces.c (merge_face_vectors): If the target font specfies a
2756 font spec, make the font's attributes take precedence over
2757 directly-specified attributes.
2758 (merge_face_ref): Recognize :font.
2759
44386687
DA
27602012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2761
2762 Do not use memcpy for copying intervals.
2763 * intervals.c (reproduce_interval): New function.
2764 (reproduce_tree, reproduce_tree_obj): Use it.
2765 (reproduce_tree_obj): Remove prototype.
2766
927c7216
PE
27672012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2768
2769 * lisp.h (duration_to_sec_usec): Remove unused decl.
2770
93044f7b
AA
27712012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2772
2773 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2774 to an allocated instance of NSString, not to the class itself.
2775
9851e4a5
JB
27762012-08-17 Juanma Barranquero <lekktu@gmail.com>
2777
2778 * makefile.w32-in (C_CTYPE_H): New macro.
2779 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2780 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2781 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2782
620f13b0
PE
27832012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2784
2785 Use ASCII tests for character types.
2786 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2787 * xfns.c, xterm.c:
2788 Don't include <ctype.h>; was not needed.
2789 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2790 * sysdep.c, xfaces.c:
2791 Include <c-ctype.h> instead of <ctype.h>.
2792 * nsterm.m: Include <c-ctype.h>.
2793 * charset.c (read_hex):
2794 * doc.c (Fsnarf_documentation):
2795 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2796 (DRIVE_LETTER) [DOS_NT]:
2797 (Ffile_name_directory, Fexpand_file_name)
2798 (Fsubstitute_in_file_name):
2799 * font.c (font_parse_xlfd, font_parse_fcname):
2800 * frame.c (x_set_font_backend):
2801 * gtkutil.c (xg_get_font):
2802 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2803 * nsimage.m (hexchar):
2804 * nsterm.m (ns_xlfd_to_fontname):
2805 * sysdep.c (system_process_attributes):
2806 * xfaces.c (hash_string_case_insensitive):
2807 Use C-locale tests instead of locale-specific tests for character
2808 types, since we want the ASCII interpretation here, not the
2809 interpretation suitable for whatever happens to be the current locale.
2810
52162052
MR
28112012-08-16 Martin Rudalics <rudalics@gmx.at>
2812
2813 Consistently check windows for validity/liveness
2814 (Bug#11984, Bug#12025, Bug#12026).
2815 * lisp.h (CHECK_VALID_WINDOW): New macro.
2816 * window.c (decode_window): Rename to decode_live_window.
2817 (decode_valid_window, Fwindow_valid_p): New functions.
2818 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2819 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2820 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2821 (Fwindow_prev_sibling, Fwindow_combination_limit)
2822 (Fset_window_combination_limit, Fwindow_use_time)
2823 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2824 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2825 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2826 (Fwindow_hscroll, Fset_window_hscroll)
2827 (Fwindow_redisplay_end_trigger)
2828 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2829 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2830 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2831 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2832 (Fwindow_end, Fset_window_point, Fset_window_start)
2833 (Fpos_visible_in_window_p, Fwindow_line_height)
2834 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2835 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2836 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2837 (Fset_window_parameter, Fwindow_display_table)
2838 (Fset_window_display_table, Fdelete_other_windows_internal)
2839 (Fset_window_buffer, Fset_window_new_total)
2840 (Fset_window_new_normal, Fdelete_window_internal)
2841 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2842 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2843 (Fwindow_scroll_bars): Check whether argument window is a valid or
2844 live window. Update doc-strings.
2845 (syms_of_window): New symbol Qwindow_valid_p.
2846 * keyboard.c (Fposn_at_x_y): Check whether argument
2847 frame_or_window denotes a valid window.
2848
2751c80f
DA
28492012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2850
2851 Fix previous char table change.
2852 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2853 * chartab.c (optimize_sub_char_table): Likewise.
2854
032a42c8
CY
28552012-08-16 Chong Yidong <cyd@gnu.org>
2856
a2d19368
CY
2857 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2858
032a42c8
CY
2859 * xfont.c (xfont_open):
2860 * xftfont.c (xftfont_open): Set the font's max_width field.
2861
2862 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2863 min_width to space_width and average_width to the average over
2864 printable ASCII characters.
2865 (ns_char_width): Code cleanup.
2866 (ns_ascii_average_width): New utility function.
2867
2868 * font.h (struct font): Update comments.
2869
a098c930
DA
28702012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2871
032a42c8 2872 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
2873 * lisp.h (CSET): New macro.
2874 (char_table_set_extras, char_table_set_contents)
2875 (sub_char_table_set_contents): New function.
2876 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2877 * syntax.c: Adjust users.
2878
8be3a09c
SM
28792012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2880
2881 * eval.c (eval_sub): Bind lexical-binding.
2882 * lread.c (Qlexical_binding): Make non-static.
2883
ac4845a6
JD
28842012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2885
ddee6515
JD
2886 * nsmenu.m (popupSession): Remove.
2887 (pop_down_menu): Remove endModalSession.
2888 (timeout_handler:): New method.
2889 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2890 Call runModalForWindow. Check timer_fired when it returns.
2891 If not set, cancel timer and break out of loop.
2892 Otherwise loop again, with a new timeout.
2893
2894 * nsterm.m: Include fcntl.h if present.
2895 (fd_entry, t_readfds, inNsSelect): Remove.
2896 (select_writefds, select_valid, select_timeout, selfds)
2897 (select_mutex, apploopnr): Add.
2898 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2899 Otherwise call kbd_buffer_store_event.
2900 (ns_send_appdefined): Remove release of fd_entry.
2901 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2902 Increment and decrement apploopnr.
2903 (ns_select): If no file descriptors, just do a NSTimer.
2904 Otherwise copy read/write masks and start select thread (fd_handler).
2905 Start main loop and wait for application defined event.
2906 Inform select thread to stop selecting after main loop is exited.
2907 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 2908 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
2909 (fd_handler:): Loop forever, wait for info from the main thread
2910 to either start or stop selecting. When select returns, send
2911 and appdefined event.
2912 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2913 If not call kbd_buffer_store_event.
2914
2915 * nsterm.h (EmacsApp): fd_handler takes id argument.
2916 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2917
ac4845a6
JD
2918 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2919
eb424fe3
EZ
29202012-08-15 Eli Zaretskii <eliz@gnu.org>
2921
2922 * region-cache.c (move_cache_gap): Update gap_len using the actual
2923 growth of the boundaries array. Do not change cache_len.
2924 (Bug#12196)
2925
4e6a86c6
DA
29262012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2927
2928 Generalize and cleanup font subsystem checks.
2929 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
2930 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2931 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 2932
5bf192ca
DA
29332012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2934
2935 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2936
f2045622
CY
29372012-08-15 Chong Yidong <cyd@gnu.org>
2938
8be3a09c
SM
2939 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2940 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2941 extract the font descriptor instead of just the font name.
2942 In that case, return a font spec instead of a string.
f2045622
CY
2943 (x_last_font_name): Move to this file from xfns.c.
2944
2945 * xfns.c (Fx_select_font): The return value can also be a font
2946 spec. Move x_last_font_name management to gtkutil.c.
2947
2948 * xfaces.c: Make font weight and style symbols non-static.
2949
7f6feb56
SM
29502012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2951
2952 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2953 (bug#12117).
2954
fecbd8ff
SM
29552012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2956
2957 * alloc.c (Fgarbage_collect): Use plural form consistently.
2958
9b8d5165
EZ
29592012-08-14 Eli Zaretskii <eliz@gnu.org>
2960
2961 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2962 iteration through the command loop. Fixes a problem whereby mouse
2963 movements are ignored until the first mouse click.
2964
f5d9e83a
PE
29652012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2966
2967 Use bool, not int, for Lisp booleans.
2968 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2969 makes Emacs a bit smaller and presumably a bit faster.
2970 * lisp.h: Include <stdbool.h>.
2971 (struct Lisp_Boolfwd, defvar_bool):
2972 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2973 * regex.c [!emacs]: Include <stdbool.h>.
2974 (false, true): Remove; <stdbool.h> does this for us now.
2975
55802e4a
CY
29762012-08-14 Chong Yidong <cyd@gnu.org>
2977
4abcdac8
CY
2978 * character.c (Fcharacterp): Doc fix (Bug#12076).
2979
2980 * data.c (Findirect_variable): Doc fix (Bug#11040).
2981
55802e4a
CY
2982 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2983
2984 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 2985 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 2986
8e99d072
BR
29872012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2988
2989 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2990 (bug#12022).
2991
08908aca
MR
29922012-08-14 Martin Rudalics <rudalics@gmx.at>
2993
2994 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2995 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2996 * minibuf.c (choose_minibuf_frame, read_minibuf):
2997 * w32fns.c (x_create_tip_frame):
2998 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2999 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3000
56120d6f
PE
30012012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3002
3003 * intervals.c (offset_intervals): Remove obsolete comment.
3004
67b77c0b
AS
30052012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3006
3007 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3008
f48b82fd
GR
30092012-08-14 Gergely Risko <gergely@risko.hu>
3010
3011 * coding.c (decode_coding): Record buffer modification before
3012 disabling undo_list (Bug#11773).
3013
fd318b54
DA
30142012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3015
3016 Revert and cleanup some recent overlay changes.
3017 * buffer.h (enum overlay_type): Remove.
3018 (buffer_get_overlays, buffer_set_overlays): Likewise.
3019 (buffer_set_overlays_before, buffer_set_overlays_after):
3020 New function. Adjust users.
3021 (unchain_both): Add eassert.
3022
41a62dd9
DA
30232012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3024
3025 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3026
5884c324
PE
30272012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3028
3029 * gtkutil.c (xg_mark_data): Don't assume C99.
3030
ca06f160
JD
30312012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3032
3033 * gtkutil.c (xg_frame_tb_info): New struct.
3034 (TB_INFO_KEY): New define.
3035 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3036 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3037 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3038 if not present.
3039 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 3040 is up to date. Otherwise store new data.
ca06f160
JD
3041 (free_frame_tool_bar): Free xg_frame_tb_info if present.
3042
7864a3f7
DA
30432012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3044
3045 Use KSET for write access to Lisp_Object members of struct kboard.
3046 * keyboard.h (KSET): New macro.
3047 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3048 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3049 * xterm.c: Adjust users.
3050
4c31be61
DA
30512012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3052
3053 Use BSET for write access to Lisp_Object members of struct buffer.
3054 * buffer.h (BSET): New macro.
3055 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3056 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3057 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3058 * window.c, xdisp.c, xfns.c: Adjust users.
3059
14ae4239
BT
30602012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
3061
3062 * lread.c (syms_of_lread): Initialize Vlexical_binding.
3063
32bcadb4
JD
30642012-08-11 Jan Djärv <jan.h.d@swipnet.se>
3065
3d29b2ce 3066 * nsterm.m (not_in_argv): New function.
fc0c31f8 3067 (application:openFile, application:openTempFile:):
3d29b2ce
JD
3068 (application:openFileWithoutUI:, application:openFiles:): Open file
3069 if not_in_argv returns non-zero (bug#12171).
3070
32bcadb4 3071 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
3072 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
3073 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
3074 (xg_get_font_name): Use those functions/macros here.
3075 Reported by Frans Oilinki <moilinki@gmail.com>.
3076
9ff9402d 30772012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
3078
3079 * unexmacosx.c (copy_data_segment): Copy initialized data in
3080 statically linked libraries from input file rather than memory.
3081
db74a5fc
YM
3082 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
3083 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
3084 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
3085
25e65510
GM
30862012-08-10 Glenn Morris <rgm@gnu.org>
3087
3088 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
3089 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
3090
7961135c
DA
30912012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3092
3093 Fix last change to allow compilation with low optimization levels.
3094 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
3095 Reported by Jan Djärv <jan.h.d@swipnet.se>.
3096
42b3a444
DA
30972012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3098
3099 Use common inline syntax in intervals.h.
3100 * intervals.h (INTERVALS_INLINE): New macro.
3101 Change all users from LISP_INLINE.
3102
9fb0c957
DA
31032012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3104
3105 Define Qnone once for all platforms.
3106 * frame.c (Qnone): Define here.
3107 (syms_of_frame): DEFSYM it.
3108 * lisp.h (Qnone): New declaration.
3109 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
3110 * xfns.c: Remove duplication. Adjust users.
3111
65e8ee52
DA
31122012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3113
3114 Remove unused macros from intervals.h.
3115 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
3116 * intervals.c: Adjust comment.
3117
9b855fd6
EZ
31182012-08-10 Eli Zaretskii <eliz@gnu.org>
3119
3120 * w32fns.c <w32_unicode_gui>: New static variable.
3121 (globals_of_w32fns): Initialize it according to os_subtype.
3122 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3123 testing os_subtype.
3124
39cb9e56 31252012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
3126 Eli Zaretskii <eliz@gnu.org>
3127
3128 Fix bug #10299 with Unicode characters sent by customized
3129 keyboards created by MSKLC.
3130 * w32fns.c (INIT_WINDOW_CLASS): New macro.
3131 (w32_init_class): Use it to initialize the Emacs class with either
3132 ANSI or Unicode API calls.
3133 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3134 later.
3135 (w32_wnd_proc): If the character code sent by WM_CHAR or
3136 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3137 original message. Call DefWindowProcW on NT and later.
3138
9374581a
GM
31392012-08-10 Glenn Morris <rgm@gnu.org>
3140
4b94e8cf
GM
3141 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3142
9374581a
GM
3143 * lisp.h (DIRECTORY_SEP): Let configure set it.
3144
a2752828
DA
31452012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
3146
3147 Use TSET for write access to Lisp_Object slots of struct terminal.
3148 * termhooks.h (TSET): New macro.
3149 * coding.c, terminal.c, xselect.c: Adjust users.
3150
cc92c454
SM
31512012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
3152
3153 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
3154 the failing expression, include them in the error message.
3155 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3156 * lisp.h (internal_condition_case_n): Update declaration.
3157
4cb3e6b3
DA
31582012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3159
3160 Inline functions to examine and change buffer overlays.
3161 * buffer.c (unchain_both): New function.
3162 * buffer.h (buffer_get_overlays, buffer_set_overlays):
3163 (buffer_has_overlays): New function.
3164 (enum overlay_type): New enum.
3165 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3166 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3167
8707c1e5
DA
31682012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3169
3170 Inline functions to examine and change buffer intervals.
3171 * alloc.c (mark_interval_tree): Remove.
3172 (MARK_INTERVAL_TREE): Simplify.
3173 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
3174 * intervals.c (buffer_balance_intervals): New function.
3175 (graft_intervals_into_buffer): Adjust indentation.
3176 (set_intervals_multibyte): Simplify.
3177 * buffer.h (BUF_INTERVALS): Remove.
3178 (buffer_get_intervals, buffer_set_intervals): New function.
3179 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3180 * intervals.c, textprop.c: Adjust users.
3181
ad8c997f
DA
31822012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3183
3184 Inline functions to examine and change string intervals.
3185 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3186 (string_get_intervals, string_set_intervals): New function.
3187 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3188 * lread.c, print.c, textprop.c: Adjust users.
3189
32ac3a6b
GM
31902012-08-08 Glenn Morris <rgm@gnu.org>
3191
3192 * lisp.mk (lisp): Remove language/persian.elc.
3193
77c7bcb1
DA
31942012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3195
3196 Cleanup intervals.
3197 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3198 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
3199 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3200 Adjust comment. Move under #if 0.
77c7bcb1
DA
3201 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3202 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3203
9c08a8d4
DA
32042012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3205
3206 Check total length of intervals with eassert.
3207 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3208 * intervals.c: Change all users to eassert.
3209
26d16b35
EZ
32102012-08-07 Eli Zaretskii <eliz@gnu.org>
3211
14ae4239
BT
3212 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
3213 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
3214 INTERNAL_FIELD in Lisp_Cons.
3215
c644523b
DA
32162012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3217
3218 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
3219 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
3220 name since all xname users are fixed long time ago. Do not
3221 use INTERNAL_FIELD.
3222 (set_symbol_name, set_symbol_function, set_symbol_plist):
3223 (set_symbol_next, set_overlay_plist): New function.
3224 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
3225 (struct Lisp_Overlay): Likewise.
3226 (CVAR, MVAR, SVAR): Remove.
3227 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
3228 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
3229 * xterm.c: Adjust users.
3230 * .gdbinit: Change to use name field of struct Lisp_Symbol
3231 where appropriate.
3232
6a3d20cc
DA
32332012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3234
3235 Basic functions to set Lisp_Object and pointer slots of intervals.
3236 * intervals.h (interval_set_parent, interval_set_object):
3237 (interval_set_left, interval_set_right, interval_set_plist):
3238 (interval_copy_parent): New function.
3239 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
3240 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
3241 Adjust indentation.
6a3d20cc
DA
3242 (INTERVAL_SIZE): Remove. Adjust users.
3243 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3244
4d2b044c
DA
32452012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3246
3247 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3248 * process.h (PGET): Remove.
3249 (struct Lisp_Process): Do not use INTERNAL_FIELD.
3250 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3251
d3d50620
DA
32522012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3253
3254 Drop WGET and revert read access to Lisp_Objects slots of struct window.
3255 * window.h (WGET): Remove.
3256 (struct window): Do not use INTERNAL_FIELD.
3257 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3258 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3259 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3260 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3261 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3262 Adjust users.
3263
d10a51dc
CY
32642012-08-07 Chong Yidong <cyd@gnu.org>
3265
3266 * window.c (Fwindow_edges, Fwindow_pixel_edges)
3267 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3268 (Fdelete_window_internal): Signal an error if the window is not on
3269 a live frame (Bug#12025).
3270
e69b0960
DA
32712012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3272
3273 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3274 * frame.h (FGET): Remove.
3275 (struct frame): Do not use INTERNAL_FIELD.
3276 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3277 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3278 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3279 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3280
25a20a3a
JB
32812012-08-06 Juanma Barranquero <lekktu@gmail.com>
3282
3283 * w32.c: Silence compiler warnings.
3284 (map_w32_filename): Remove unused variable `is_fat'.
3285 (chase_symlinks): Add parentheses around expression.
3286
1c6f11f4
GM
32872012-08-06 Glenn Morris <rgm@gnu.org>
3288
1db4583a
GM
3289 * sysdep.c: Respect BROKEN_GETWD.
3290
1c6f11f4
GM
3291 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3292 Let configure handle it.
3293 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3294
2b90362b
DA
32952012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3296
3297 Use GCALIGNMENT where appropriate.
3298 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3299 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3300 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3301
5f50daf2
EZ
33022012-08-06 Eli Zaretskii <eliz@gnu.org>
3303
14ae4239
BT
3304 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3305 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 3306
cbcc7007
SM
33072012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3308
3309 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3310 that should be sufficient for everyone.
3311
4d365fa4
JD
33122012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3313
3314 * keyboard.c (timer_check_2): Add break so timer_check returns next
3315 timeout.
3316
dd86bd82
DA
33172012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3318
3319 Fix Windows build errors introduced after converting to WGET and WSET.
3320 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3321 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3322
054e1668
JD
33232012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3324
3325 * nsterm.m (ns_frame_rehighlight): Use FSET.
3326
3327 * nsmenu.m (ns_update_menubar): Use FSET.
3328
21238f11
DA
33292012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3330
3331 Separate read and write access to Lisp_Object slots of Lisp_Process.
3332 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3333 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3334
077288cf
DA
33352012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3336
3337 Separate read and write access to Lisp_Object slots of struct window.
3338 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3339 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3340 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3341 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3342 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3343 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3344 Adjust users.
3345
71688bd7
DA
33462012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3347
3348 Fix Windows build errors introduced after converting to FGET and FSET.
3349 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3350 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3351 (w32_judge_scroll_bars): Change to use FSET.
3352 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3353
f99bac93
DA
33542012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3355
3356 Fix replacement typo.
3357 * window.c (replace_window): Set root_window instead of
3358 selected_window. This fixes a total window subsystem
3359 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3360
8c2a0f2d
GM
33612012-08-06 Glenn Morris <rgm@gnu.org>
3362
3363 * lisp.mk (lisp): Add language/persian.elc.
3364
edd74c35
DA
33652012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3366
3367 Separate read and write access to Lisp_Object slots of struct frame.
3368 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3369 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3370 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3371 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3372 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3373
8671676c
AS
33742012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3375
3376 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3377
663e2b3f
DA
33782012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3379
3380 Generalize common compile-time constants.
3381 * lisp.h (header_size, bool_header_size, word_size): Now here.
3382 (struct Lisp_Vector): Add comment.
3383 (struct Lisp_Bool_Vector): Move up to define handy constants.
3384 (VECSIZE, PSEUDOVECSIZE): Simplify.
3385 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3386 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3387 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3388 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3389 * xfont.c, xmenu.c: Use word_size where appropriate.
3390
d32e47af
LM
33912012-08-05 Lawrence Mitchell <wence@gmx.li>
3392
3393 * search.c (Freplace_match): Treat \? in the replacement text
3394 literally (Bug#8161).
3395
e5d9c0d1
CY
33962012-08-05 Chong Yidong <cyd@gnu.org>
3397
3398 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3399 * frame.c (Vdelete_frame_functions):
3400 * emacs.c (Vkill_emacs_hook): Doc fix.
3401
8da0576b
EZ
34022012-08-04 Eli Zaretskii <eliz@gnu.org>
3403
3404 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3405 --with-x-toolkit=no builds.
3406 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3407
02676e5d
CY
34082012-08-04 Chong Yidong <cyd@gnu.org>
3409
3410 * syntax.c (Fmodify_syntax_entry): Doc fix.
3411
97147da9
EZ
34122012-08-04 Eli Zaretskii <eliz@gnu.org>
3413
76151e2c
EZ
3414 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3415 * w32.c (init_environment): Change the default values of many
3416 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
3417 them into environment when they were not already defined.
3418 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 3419 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
3420 (check_windows_init_file): Now external, not static.
3421 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
3422 called when Vload_path is already set up.
3423
3424 * w32.h (check_windows_init_file): Add prototype.
3425
3426 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3427 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3428 compatibility with Posix platforms.
3429 (main): Move the call to check_windows_init_file to here from
3430 w32.c.
3431 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3432 any, in the DEFALT argument into the root of the Emacs build or
3433 installation tree, as appropriate.
3434
3435 * callproc.c (init_callproc_1): Call decode_env_path instead of
3436 doing its equivalent by hand.
3437 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3438 the code that sets Vexec_path run on MS-Windows.
3439
3440 * lread.c (init_lread): Add comments to #ifdef's.
3441
97147da9
EZ
3442 * msdos.c (dos_set_window_size, IT_update_begin)
3443 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3444 instead of direct references.
3445
185ee146
PE
34462012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3447
3448 Export DEFAULT_REHASH_* to GDB.
3449 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3450 Now constants, not macros.
3451
8834c57a
PE
34522012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3453
98c6f1e3
PE
3454 Remove unnecessary casts involving pointers.
3455 These casts are no longer needed now that we assume C89 or later,
3456 since they involve casting to or from void *.
3457 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3458 (make_pure_float, make_pure_vector):
3459 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3460 * macros.c (Fstart_kbd_macro):
3461 * menu.c (find_and_return_menu_selection):
3462 * minibuf.c (read_minibuf_noninteractive):
3463 * sysdep.c (closedir):
3464 * xdisp.c (x_produce_glyphs):
3465 * xfaces.c (compare_fonts_by_sort_order):
3466 * xfns.c (x_real_positions, select_visual):
3467 * xselect.c (x_stop_queuing_selection_requests)
3468 (x_get_window_property, x_get_window_property_as_lisp_data):
3469 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3470 Remove unnecessary pointer casts.
3471 * alloc.c (record_xmalloc): New function.
3472 * lisp.h (record_xmalloc): New decl.
3473 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3474 more like a function. This is because the pointer cast is not
3475 needed. All uses changed.
3476 * print.c (print_string, print_error_message): Avoid length recalc.
3477
8834c57a
PE
3478 Improve fix for macroexp crash with debugging (Bug#12118).
3479 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3480 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3481 not supposed to be invoked from the garbage collector.
3482 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3483 (gc_aset): New function, which is like ASET but can be
3484 used in the garbage collector.
3485 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3486 (set_hash_index): Use it instead of ASET.
3487
6dad7178
EZ
34882012-08-03 Eli Zaretskii <eliz@gnu.org>
3489
3490 Support symlinks on latest versions of MS-Windows.
3491 * w32.c: Include winioctl.h and aclapi.h.
3492 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3493 (revert_to_self): Forward declarations of static functions.
3494 <static BOOL g_b_init_get_security_info>:
3495 <g_b_init_create_symbolic_link>: New static flags.
3496 (globals_of_w32): Initialize them to zero.
3497 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3498 (map_w32_filename): Improve commentary. Simplify switch.
3499 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3500 headers (most versions of MinGW w32api don't).
3501 (get_security_info, create_symbolic_link)
3502 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3503 New functions.
3504 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3505 in the argument file name.
3506 (sys_access): Call unc_volume_file_attributes only if
3507 GetFileAttributes fails with network-related error codes.
3508 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3509 have the required privileges.
14ae4239 3510 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
3511 get_file_security_desc.
3512 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
3513 with addition of handling of symlinks and support for 'lstat'.
3514 If possible, get file's attributes and security information by
6dad7178
EZ
3515 handle, not by name. Produce S_IFLNK bit for symlinks, when
3516 called from 'lstat'.
3517 (stat, lstat): New functions, call 'stat_worker'.
3518 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3519 symlinks when the underlying filesystem supports them.
3520
f162bcc3
PE
35212012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3522
79ea6c20
PE
3523 Fix macroexp crash on Windows with debugging (Bug#12118).
3524 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3525 checking subscripts; problem introduced with the recent
3526 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3527 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3528 since it's used in non-static inline functions now.
3529
c0ce93fd
PE
3530 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3531 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 3532
f162bcc3
PE
3533 Use C99-style 'extern inline' if available.
3534 * buffer.h (BUFFER_INLINE):
3535 * category.h (CATEGORY_INLINE):
3536 * character.h (CHARACTER_INLINE):
3537 * charset.h (CHARSET_INLINE):
3538 * composite.h (COMPOSITE_INLINE):
3539 * dispextern.h (DISPEXTERN_INLINE):
3540 * lisp.h (LISP_INLINE):
3541 * systime.h (SYSTIME_INLINE):
3542 New macro, replacing 'static inline' in this header.
3543 * buffer.h, category.h, character.h, charset.h, composite.h:
3544 * dispextern.h, lisp.h, systime.h:
3545 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3546 * alloc.c (LISP_INLINE):
3547 * buffer.c (BUFFER_INLINE):
3548 * category.c (CATEGORY_INLINE):
3549 * character.c (CHARACTER_INLINE):
3550 * charset.c (CHARSET_INLINE):
3551 * composite.c (COMPOSITE_INLINE):
3552 * dispnew.c (DISPEXTERN_INLINE):
3553 * sysdep.c (SYSTIME_INLINE):
3554 Define to EXTERN_INLINE, so that the corresponding functions
3555 are compiled into code.
3556 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3557 (INLINE_HEADER_END): New macros.
3558 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3559 since it's used in non-static inline functions now.
a8333d03 3560 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 3561
837b365b
GM
35622012-08-02 Glenn Morris <rgm@gnu.org>
3563
d66b744d
GM
3564 * s/: Remove empty directory.
3565
837b365b
GM
3566 * s/ms-w32.h: Move to ../nt/inc.
3567 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3568 Update for new ms-w32.h location.
3569
13294f95
PE
35702012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3571
3572 Port to Solaris 8.
3573 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3574
90df0db3
GM
35752012-08-02 Glenn Morris <rgm@gnu.org>
3576
3577 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3578 hard-coding the path separator.
3579
4939150c
PE
35802012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3581
3582 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3583 This how ASET and AREF are supposed to work, and makes
3584 it easier to think about future improvements. See
3585 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3586 * charset.h (set_charset_attr): New function.
3587 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3588 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3589 (aref_addr): New function. All uses of &AREF(...) changed.
3590 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3591 (set_hash_index): New functions. All lvalue-style uses of
3592 HASH_KEY etc. changed.
3593 * keyboard.c (set_prop): New function. All lvalue-style uses
3594 of PROP changed.
3595
947b2afd
AA
35962012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3597
3598 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3599 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3600 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3601 * nsfns.m (ns_set_name_as_filename): Likewise.
3602 * nsmenu.m (ns_update_menubar): Likewise.
3603 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3604
4f5d0325
EZ
36052012-08-01 Eli Zaretskii <eliz@gnu.org>
3606
2008beae
EZ
3607 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3608 Adapt to latest changes in field names of the corresponding Lisp
288479f6 3609 objects.
2008beae 3610
4f5d0325
EZ
3611 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3612
fe3cc771
GM
36132012-08-01 Glenn Morris <rgm@gnu.org>
3614
3615 * s/msdos.h: Remove file.
3616 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3617 * Makefile.in (S_FILE): Remove.
3618 (config_h): Remove S_FILE.
3619
c90acc54
JB
36202012-08-01 Juanma Barranquero <lekktu@gmail.com>
3621
3622 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3623 Remove; moved to nt/config.nt.
3624
d8a05828
DA
36252012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3626
3627 Use INTERNAL_FIELD for conses and overlays.
3628 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3629 Remove obsolete comment.
3630 (MVAR): New macro.
3631 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3632 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3633
8271d590
DA
36342012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3635
3636 Use INTERNAL_FIELD for symbols.
3637 * lisp.h (SVAR): New macro. Adjust users.
3638 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3639 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3640
3193acd2
DA
36412012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3642
3643 Use INTERNAL_FIELD for processes.
3644 * process.h (PVAR): New macro. Adjust style.
3645 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3646 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3647
3a45383a
DA
36482012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3649
3650 Use INTERNAL_FIELD for windows.
3651 * window.h (WVAR): New macro.
3652 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3653 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3654 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3655 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3656 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3657 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3658
c1dbc63c
PE
36592012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3660
3661 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3662
5c0c0e8a
GM
36632012-08-01 Glenn Morris <rgm@gnu.org>
3664
3665 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3666 Move to configure.ac.
3667
552a99b4
JB
36682012-08-01 Juanma Barranquero <lekktu@gmail.com>
3669
3670 * makefile.w32-in (CONFIG_H): Update dependencies.
3671 (CONF_POST_H): New macro.
3672
3673 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3674
8d8e2dfe
GM
36752012-07-31 Glenn Morris <rgm@gnu.org>
3676
bc96620a
GM
3677 * Makefile.in (S_FILE): No longer set by configure.
3678
476b1b2d
GM
3679 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3680 is available.
3681 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3682
b2c7a106
GM
3683 * process.h (NULL_DEVICE):
3684 * emacs.c (SEPCHAR):
3685 * editfns.c (USER_FULL_NAME): Let configure set them.
3686
d53d062a
GM
3687 * s/README, s/template.h: Remove files.
3688
4515017f
GM
3689 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3690
8d8e2dfe
GM
3691 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3692 Move to configure.ac.
3693
5b20b3cc
EZ
36942012-07-31 Eli Zaretskii <eliz@gnu.org>
3695
1e0afd9a
EZ
3696 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3697 resulting renaming of 'struct frame' members.
3698
5b20b3cc
EZ
3699 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3700
3701 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3702 after introduction of FVAR.
3703
f1310128
JD
37042012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3705
79e721e0
JD
3706 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3707
3708 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3709 instead of compositeToPoint.
3710 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3711
8d7c7eed 3712 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 3713
e34f7f79
DA
37142012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3715
3716 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3717 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 3718 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
3719 (BVAR): Change to use INTERNAL_FIELD.
3720 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3721 (KVAR): Change to use INTERNAL_FIELD.
3722 * frame.h (FVAR): New macro.
3723 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
3724 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3725 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3726 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
3727 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3728
c09bfb2f
DA
37292012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3730
3731 Miscellaneous fixes for non-default X toolkits.
3732 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3733 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3734 Move under #ifdef USE_LUCID.
3735 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3736 definition and usage to avoid warnings.
3737
14c114ae
JD
37382012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3739
3740 * nsterm.m (openFiles): Fix previous checkin.
3741
3bd21e82
PE
37422012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3743
3744 * indent.c (compute_motion): Remove unused local.
3745
c1529ded
GM
37462012-07-31 Glenn Morris <rgm@gnu.org>
3747
400d5621
GM
3748 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3749
268e2432
GM
3750 * conf_post.h [USG5_4]:
3751 Move remaining contents of s/usg5-4-common.h here.
3752 * s/usg5-4-common.h: Remove file.
3753
7552f3ee
GM
3754 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3755 * s/irix6-5.h: Remove file.
3756
6a381852
GM
3757 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3758 * s/darwin.h: Remove file.
3759
c1529ded
GM
3760 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3761 * s/hpux10-20.h: Remove file, which is now empty.
3762
b429a4ee
GM
37632012-07-30 Glenn Morris <rgm@gnu.org>
3764
3765 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3766 * Makefile.in (config_h): Add conf_post.h.
3767 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3768
adff3182
JD
37692012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3770
3771 * nsterm.m (ns_do_open_file): New variable.
b9031d69 3772 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
3773 (openFile, openTempFile, openFileWithoutUI, openFiles):
3774 Open files only if ns_do_open_file.
adff3182 3775
c32af1e4
PE
37762012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3777
7393bcbb
PE
3778 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3779 This no-op macro hasn't been needed for many years.
3780 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3781
c32af1e4
PE
3782 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3783 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3784 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3785 gdb_make_enums_visible.
3786 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3787 (DIRECTORY_SEP): Now a constant, not a macro.
3788
302fc036
EZ
37892012-07-30 Eli Zaretskii <eliz@gnu.org>
3790
3791 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3792 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3793
3794 * w32term.c <w32_keyboard_codepage>: Renamed from
3795 keyboard_codepage and now external. All users changed.
3796
3797 * w32term.h: Add declaration of w32_keyboard_codepage.
3798
3799 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3800 the codepage to translate keys to Unicode. If this argument is
3801 -1, use the value returned by GetConsoleCP. All callers changed.
3802
88fb40b4
PE
38032012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3804
0aee6912
PE
3805 Update .PHONY listings in makefiles.
3806 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3807 bootstrap-clean, distclean, maintainer-clean, versioclean,
3808 extraclean, frc.
3809
88fb40b4
PE
3810 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3811 This is a bit clearer. Fix some commentary typos.
3812
0a763bd1
GM
38132012-07-30 Glenn Morris <rgm@gnu.org>
3814
32bac6d6
GM
3815 * s/netbsd.h: Let configure include signal.h if needed.
3816 Remove file, which is now empty.
3817
b65e7c46
GM
3818 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3819 Let configure set them.
3820 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3821 No more need to undefine.
0a763bd1 3822
169304bd
AS
38232012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3824
3825 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3826 non-single-byte char when adding meta modifier. (Bug#12090)
3827
6cd7a139
DA
38282012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3829
3830 Convert safe_call to use variable number of arguments.
3831 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3832 (safe_call2): Fix comment.
3833 * lisp.h (safe_call): Adjust prototype.
3834 * coding.c (encode_coding_object): Change to use safe_call2.
3835 * xfaces.c (merge_face_heights): Change to use safe_call1.
3836
d34d6ffc
GM
38372012-07-30 Glenn Morris <rgm@gnu.org>
3838
7b8a48e4 3839 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 3840 does that unconditionally. Remove file, which is now empty.
7b8a48e4 3841
d34d6ffc
GM
3842 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3843 Remove empty files.
3844
03a660a6
PE
38452012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3846
3847 Export to GDB most of lisp.h's remaining object-like macros.
3848 * lisp.h (min, max): Move earlier, because they're used earlier now.
3849 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3850 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3851 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3852 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3853 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3854 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3855 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3856 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3857 Now constants, for GDB. They need not be macros.
3858 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3859 Now constants, for GDB, as well as macros, for static initializers.
3860 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3861 Move to after the definition of struct Lisp_Char_Table,
3862 since the former now needs that type defined.
3863 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3864 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3865 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3866 New enums, for gdb_make_enums_visible.
3867 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 3868 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
3869 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3870 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3871 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3872 enum maxargs, enum MAX_ALLOCA.
3873 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3874 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3875 no longer needed, now that they are done in lisp.h.
3876
e499d0ee
DA
38772012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3878
3879 Cleanup string bytes checking.
3880 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3881 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3882 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3883 (check_sblock, compact_small_strings): Simplify.
3884
d5040d2d
PE
38852012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3886
3887 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3888 These macros are confusing and no longer need to be defined, as
3889 the enum values now suffice. All uses replaced with definiens.
3890 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3891
7f259ae6
JB
38922012-07-29 Juanma Barranquero <lekktu@gmail.com>
3893
3894 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3895 ($(BLD)/w32console.$(O)): Update dependencies.
3896
7e63e0c3
DA
38972012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3898
3899 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3900 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3901 time. Adjust users.
3902 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3903
ffd817eb
JD
39042012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3905
3906 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3907 setting sitelisp (Bug#12010).
3908
417a7a0e
EZ
39092012-07-29 Eli Zaretskii <eliz@gnu.org>
3910
14ae4239 3911 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
3912
3913 * w32heap.c (cache_system_info):
3914 * w32.c (sys_rename):
3915 * w32proc.c (find_child_console, sys_kill): All users changed.
3916
387d4d92
PE
39172012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3918
3919 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3920
55a6cca6
EZ
39212012-07-29 Eli Zaretskii <eliz@gnu.org>
3922
3923 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3924
dbcf001c
DA
39252012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3926
3927 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
3928 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3929 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 3930
e2688e4a
DA
39312012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3932
3933 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3934 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3935 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3936 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3937 (replace_range, replace_range_2, del_range_2): Change to eassert.
3938 * marker.c (byte_char_debug_check): Adjust style.
3939
b46a6a83
PE
39402012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3941
3942 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3943 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3944 long-ago-commented-out code that talks about "WIN32".
3945 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3946 All uses changed.
3947
e32a5799
PE
39482012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3949
3950 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3951 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3952 Simplify by using alignof.
3953 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3954 * lisp.h: Include <stdalign.h>.
3955 (GCALIGNMENT): New macro and constant.
3956 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3957 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3958 (stdalign): New macro, if not already defined.
3959
df81cd29
EZ
39602012-07-28 Eli Zaretskii <eliz@gnu.org>
3961
01bd1b0d
EZ
3962 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3963 * w32inevt.c: Include w32inevt.h.
3964 (w32_read_console_input): New inline function, calls either
3965 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3966 w32_console_unicode_input.
3967 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3968 (w32_kbd_patch_key, key_event): Use the codepage returned by
3969 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3970 (key_event): use uChar.UnicodeChar only if
3971 w32_console_unicode_input is non-zero.
3972
3973 * w32console.c: Include w32heap.h.
3974 <w32_console_unicode_input>: New global variable.
3975 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3976 family of Windows, zero otherwise.
3977
3978 * w32inevt.h: Declare w32_console_unicode_input.
3979
df81cd29
EZ
3980 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3981 --without-x. (Bug#11742)
3982
c20fdd9e
PE
39832012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3984
3985 Adjust GDB to reflect pvec_type changes (Bug#12036).
3986 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
3987 2012-07-04 changes to pseudovector representation.
3988 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 3989
32770973 39902012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
3991
3992 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3993 bus address.
3994 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3995
3438fe21
EZ
39962012-07-27 Eli Zaretskii <eliz@gnu.org>
3997
bcfbc9de
EZ
3998 * alloc.c (listn): Fix the order the arguments are consed onto the
3999 list.
4000
3438fe21
EZ
4001 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4002 enumeration constants, as PURE and HEAP are too general, and clash
4003 with other headers and sources, such as gmalloc.c and the
4004 MS-Windows system headers. All users changed.
4005
eeaea515
DA
40062012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4007
4008 Revert last save_excursion_save and save_excursion_restore changes.
4009 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4010 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4011
073c88c2
DA
40122012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4013
4014 Fix recently-introduced typos in Windows port.
4015 Reported by Martin Rudalics <rudalics@gmx.at>.
4016 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 4017 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 4018
4706125e
PE
40192012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4020
4021 Improve GDB symbol export (Bug#12036).
4022 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4023 arms of an 'if', not using conditional expressions; otherwise GDB
4024 complains about the types in the unevaluated arm when the argument
4025 is an integer literal.
4026 (xgetint): Simplify expression.
4027 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4028 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4029 Zaretskii in <http://bugs.gnu.org/12036#13>.
4030 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4031 needed now that we have gdb_make_enums_visible.
4032 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4033 (enum enum_USE_LSB_TAG):
4034 New enum types, packaging up enums that need to be exported to GDB.
4035
694b6c97
DA
40362012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4037
4038 Utility function to make a list from specified amount of objects.
4039 * lisp.h (enum constype): New datatype.
4040 (listn): New prototype.
4041 * alloc.c (listn): New function.
4042 (Fmemory_use_count, syms_of_alloc): Use it.
4043 * buffer.c (syms_of_buffer): Likewise.
4044 * callint.c (syms_of_callint): Likewise.
4045 * charset.c (define_charset_internal): Likewise.
4046 * coding.c (syms_of_coding): Likewise.
4047 * keymap.c (syms_of_keymap): Likewise.
4048 * search.c (syms_of_search): Likewise.
4049 * syntax.c (syms_of_syntax): Likewise.
4050 * w32.c (init_environment): Likewise.
4051 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4052 * xdisp.c (syms_of_xdisp): Likewise.
4053 * xfns.c (syms_of_xfns): Likewise.
4054
6195f384
DA
40552012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4056
4057 Fast save_excursion_save and save_excursion_restore.
4058 * lisp.h (struct Lisp_Excursion): New data type.
4059 (PVEC_EXCURSION): New pseudovector type.
4060 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
4061 to deal with it. Adjust comments.
4062 (init_marker, attach_marker): New prototype.
4063 (unchain_marker): Adjust prototype.
4064 * marker.c (attach_marker): Change to global.
4065 (init_marker): New function.
4066 * alloc.c (Fmake_marker, build_marker): Use it.
4067 (build_marker): More easserts.
4068 (mark_object): Handle struct Lisp_Excursion.
4069 * editfns.c (save_excursion_save, save_excursion_restore):
4070 Reimplement to use struct Lisp_Excursion. Add comments.
4071
5eceb8fb
PE
40722012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4073
4074 Fix export of symbols to GDB (Bug#12036).
4075 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
4076 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
4077 emacs.c, as this is a more-suitable home. Had this been done earlier
4078 the fix for 12036 would have avoided some of the problems noted in
4079 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
4080 would have been more obvious.
562157c8
PE
4081 * emacs.c: Do not include <verify.h>; no longer needed.
4082 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
4083 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
4084 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4085 Remove; now done in lisp.h.
4086 * lisp.h (PUBLISH_TO_GDB): New macro.
4087 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
4088 (DATA_SEG_BITS): Use it.
4089 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
4090 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
4091 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
4092 not be usable in #if. This simplifies things.
4093
d6749401
JB
40942012-07-26 Juanma Barranquero <lekktu@gmail.com>
4095
4096 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
4097
1781b9e9
PE
40982012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4099
d89518db 4100 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
4101 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
4102 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
4103 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
4104 Adjust to changes in lisp.h and emacs.c, by using
4105 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
4106 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
4107 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
4108 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
4109 instead of gdb_valbits.
4110 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
4111 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
4112 instead of gdb_array_mark_flag.
4113 (xboolvector): Get size from $->size, not $->header.size.
4114 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
4115 (xreload, hook-run, hookpost-run): Remove.
4116 * emacs.c: Include <verify.h>.
4117 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
4118 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
4119 Remove.
4120 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
4121 (gdb_USE_LSB_TAG): New enum constants.
4122 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4123 Also define these as enum constants, so they're visible to GDB.
4124 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4125 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4126 as constants, so they're visible to GDB.
4127 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4128 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4129 Now enum constants, not macros, so they're visible to GDB.
4130 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4131 more convenient now. All uses changed.
4132 (VALMASK) [USE_LSB_TAG]: Also define in this case.
4133 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4134
3628596a
DA
41352012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
4136
4137 Explicitly free restriction data that are not needed anymore.
4138 * editfns.c (save_restriction_restore): Free restriction data.
4139
7abaf5cc
SM
41402012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
4141
4142 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4143 add argument, tune behavior, and adjust all callers.
4144
71f88e00
PE
41452012-07-25 Paul Eggert <eggert@cs.ucla.edu>
4146
4147 Use typedef for EMACS_INT, EMACS_UINT.
4148 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4149 than macros. This simplifies debugging in the usual case, since
4150 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4151 and it allows expressions involving EMACS_INT casts.
4152 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4153
57ec3034
JD
41542012-07-25 Jan Djärv <jan.h.d@swipnet.se>
4155
4156 * nsterm.m (ns_read_socket): Return early if there is a modal
4157 window (Bug#12043).
4158
8137e7b3
MR
41592012-07-25 Martin Rudalics <rudalics@gmx.at>
4160
4161 * frame.c (Fredirect_frame_focus): In doc-string don't mention
4162 that FOCUS-FRAME can be omitted.
4163
04e9897c
DA
41642012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
4165
4166 Adjust buffer text indirection counters at the end of Fkill_buffer.
4167 * buffer.c (Fkill_buffer): Adjust indirection counters when the
4168 buffer is definitely dead. This should really fix an issue reported
4169 by Christoph Scholtes again. (Bug#12007).
4170 (init_buffer_once): Initialize indirection counters of
4171 buffer_defaults and buffer_local_symbols (for sanity and safety).
4172
8a0484e1
EZ
41732012-07-24 Eli Zaretskii <eliz@gnu.org>
4174
4175 * xdisp.c (init_iterator): Don't compute dimensions of truncation
4176 and continuation glyphs on tooltip frames, leave them at zero.
4177 Avoids continued lines in tooltips. (Bug#11832)
4178
fa691a83
DA
41792012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
4180
4181 Simplify copy_overlay.
04e9897c 4182 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
4183 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4184
436bc8e0
EZ
41852012-07-23 Eli Zaretskii <eliz@gnu.org>
4186
4187 * print.c (print_object): Don't crash when a frame's name is nil
4188 or invalid. (Bug#12025)
4189
4190 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4191 it signals an error when a tooltip frame is being created.
4192
d7a7fda3
DA
41932012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4194
4195 Cleanup miscellaneous objects allocation and initialization.
4196 * alloc.c (allocate_misc): Change to static. Add argument to
4197 specify the subtype. Adjust comment and users.
4198 (build_overlay): New function.
4199 * buffer.c (copy_overlays, Fmake_overlay): Use it.
4200 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4201 (allocate_misc): Remove prototype.
4202 (build_overlay): Add prototype.
4203
42042012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
4205
4206 Swap buffer text indirection counters in Fbuffer_swap_text.
4207 * buffer.c (Fbuffer_swap_text): Swap indirections too.
4208 This avoids crash reported by Christoph Scholtes at
4209 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4210
9d7fa573
JD
42112012-07-22 Jan Djärv <jan.h.d@swipnet.se>
4212
4213 * nsmenu.m (Popdown_data): New struct.
4214 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
4215 free Popdown_data.
4216 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
4217 (initWithContentRect): Make imgView and contentView non-static
4218 and autorelease them. Also autorelease img and matrix (Bug#12005).
4219 (dealloc): Remove (Bug#12005).
4220
0dd6d66d
DA
42212012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4222
4223 Adjust consing_since_gc when objects are explicitly freed.
4224 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
4225 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
4226 (free_cons, free_misc): Subtract object size from consing_since_gc.
4227
d36d71df
DA
42282012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4229
4230 Simplify and cleanup markers positioning code.
4231 * marker.c (attach_marker): More useful eassert.
4232 (live_buffer, set_marker_internal): New function.
4233 (Fset_marker, set_marker_restricted): Use set_marker_internal.
4234 (set_marker_both, set_marker_restricted_both): Use live_buffer.
4235
fb9ea40f
PE
42362012-07-22 Paul Eggert <eggert@cs.ucla.edu>
4237
4238 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
4239 as it's limited by the amount of memory, not by INT_MAX.
4240
2d5c5f7d
EZ
42412012-07-21 Eli Zaretskii <eliz@gnu.org>
4242
07fb592e
EZ
4243 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
4244 in special-event-map. See the discussion at
4245 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4246 for the reasons.
4247
37a9eac8 4248 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
4249 info.dwItemData. Fixes crashes on 64-bit Windows.
4250 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 4251
c4328746
JD
42522012-07-21 Jan Djärv <jan.h.d@swipnet.se>
4253
fc0c31f8 4254 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 4255 (conversationIdentifier): Return value is NSInteger.
784051c4 4256 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 4257
6e5d1c12
CY
42582012-07-21 Chong Yidong <cyd@gnu.org>
4259
4260 * window.c (decode_any_window): Signal an error if the window is
4261 on a dead frame (Bug#11984).
4262
9928463d
DA
42632012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4264
4265 Add indirection counting to speed up Fkill_buffer.
4266 * buffer.h (struct buffer): New member.
4267 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4268 (Fmake_indirect_buffer): Set indirection counter to -1, increment
4269 base buffer indirection counter.
4270 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4271 (Fkill_buffer): Adjust indirection counters as needed, don't walk
4272 through buffer list if indirection counter is 0.
4273
f8643a6b
DA
42742012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4275
4276 Extend the value returned by Fgarbage_collect with heap statistics.
4277 * alloc.c (Qheap): New symbol.
4278 (syms_of_alloc): DEFSYM it.
4279 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4280 (Fmemory_free): Remove.
4281 (syms_of_alloc): Don't defsubr it.
4282 * buffer.c (Fcompact_buffer): Remove.
4283 (syms_of_buffer): Don't defsubr it.
4284
dac616ff
DA
42852012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4286
4287 Make maybe_gc inline.
4288 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4289 * lisp.h (consing_since_gc, gc_relative_threshold)
4290 (memory_full_cons_threshold): Revert declaration.
4291 (maybe_gc): Remove prototype, define as inline.
4292 * alloc.c: Remove old commented-out code.
4293 (consing_since_gc, gc_relative_threshold)
4294 (memory_full_cons_threshold): Revert to global.
4295 (maybe_gc): Remove.
4296
d7ea76b4
DA
42972012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4298
4299 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4300 * lisp.h (build_unibyte_string): New function.
4301 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4302 * sysdep.c, w32fns.c, xfns.c: Use it.
4303 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4304 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4305 Adjust users accordingly.
4306 * font.h (font_open_by_name): Adjust prototype.
4307
765e61e3
DA
43082012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4309
4310 Cleanup calls to Fgarbage_collect.
4311 * lisp.h (maybe_gc): New prototype.
4312 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4313 Remove declarations.
4314 * alloc.c (maybe_gc): New function.
4315 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4316 Make them static.
4317 * bytecode.c (MAYBE_GC): Use maybe_gc.
4318 * eval.c (eval_sub, Ffuncall): Likewise.
4319 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4320 to avoid dependency from auto-save feature.
4321
52b852c7
PE
43222012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4323
4324 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4325 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4326 'for_each_per_buffer_object_at'.
4327 All uses changed. It's better to use upper-case for macros that
4328 cannot be implemented as functions, to give the reader a clue
4329 that they're special.
4330
5db81e33
SM
43312012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4332
4333 * alloc.c (Fgarbage_collect): Tweak docstring.
4334
5b835e1d
DA
43352012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4336
4337 Tweak the value returned from Fgarbage_collect again.
4338 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4339 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4340 Adjust documentation.
4341 (total_vector_bytes): Rename to total_vector_slots, adjust
4342 accounting.
4343 (total_free_vector_bytes): Rename to total_free_vector_slots,
4344 adjust accounting.
4345 (Qstring_bytes, Qvector_slots): New symbols.
4346 (syms_of_alloc): DEFSYM them.
4347
9cd47b72
DA
43482012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4349
4350 Buffer compaction primitive which may be used from Lisp.
4351 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4352 (syms_of_buffer): Register Fcompact_buffer.
4353 * alloc.c (Fgarbage_collect): Use compact_buffer.
4354 * buffer.h (compact_buffer): New prototype.
4355 (struct buffer_text): New member.
4356
d17337e5
DA
43572012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4358
4359 New macro to iterate over all buffers, miscellaneous cleanups.
4360 * lisp.h (all_buffers): Remove declaration.
4361 * buffer.h (all_buffers): Add declaration, with comment.
4362 (for_each_buffer): New macro.
4363 * alloc.c (Fgarbage_collect, mark_object): Use it.
4364 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4365 (init_buffer): Likewise.
4366 * data.c (Fset_default): Likewise.
4367 * coding.c (code_conversion_restore): Remove redundant check
4368 for dead buffer.
4369 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4370
60cfd278
AS
43712012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4372
4373 Fix bug that created negative-length intervals.
4374 * intervals.c (merge_interval_right, merge_interval_left):
4375 Do not zero out this interval if it is absorbed by its children,
4376 as this interval's total length doesn't change in that case. See
4377 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4378
d06714cb
PE
43792012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4380
83713154
PE
4381 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4382 when invoking (make-bool-vector N t) and N is a positive
4383 multiple of 8 -- the last 8 bits were mistakenly cleared.
4384
d06714cb
PE
4385 Remove some struct layout assumptions in bool vectors.
4386 * alloc.c (bool_header_size): New constant.
4387 (header_size, word_size): Move earlier, as they're now used earlier.
4388 Use 'word_size' in a few more places, where it's appropriate.
4389 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4390 padding before the data member of a bool vector.
4391 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4392 than doing the check by hand with an abort ().
4393
464d5a5e
SM
43942012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4395
5fbc0409
SM
4396 * eval.c (Fdefvar): Don't check constants since we only set the var if
4397 it's not yet defined anyway (bug#11904).
4398
464d5a5e
SM
4399 * lisp.h (last_undo_boundary): Declare new var.
4400 * keyboard.c (command_loop_1): Set it.
4401 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4402 were auto-added by the command loop (bug#11774).
4403
8dc2e44a
AS
44042012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4405
4406 * w32font.c (Qsymbol): Remove local definition.
4407 (syms_of_w32font): Don't DEFSYM it.
4408
169925ec
DA
44092012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4410
4411 Fix sweep_vectors to handle large bool vectors correctly.
4412 * alloc.c (sweep_vectors): Account total_vector_bytes for
4413 bool vectors larger than VBLOCK_BYTES_MAX.
4414
5fbfb018
CY
44152012-07-18 Chong Yidong <cyd@gnu.org>
4416
4417 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4418 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4419
3ab6e069
DA
44202012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4421
4422 Return more descriptive data from Fgarbage_collect.
4423 Suggested by Stefan Monnier in
4424 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4425 * alloc.c (bounded_number): New function.
4426 (total_buffers, total_vectors): New variable.
4427 (total_string_size): Rename to total_string_bytes, adjust users.
4428 (total_vector_size): Rename to total_vector_bytes, adjust users.
4429 (sweep_vectors): Account total_vectors and total_vector_bytes.
4430 (Fgarbage_collect): New return value. Adjust documentation.
4431 (gc_sweep): Account total_buffers.
4432 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4433 (VECTOR_SIZE): Remove.
4434 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4435 (Qinterval, Qmisc): New symbols.
4436 (syms_of_data): Initialize them.
4437 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4438 (Qcons, Qbuffer): New declarations.
4439
6d02fe5b
PE
44402012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4441
4442 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4443 Round up, not down. Improve doc.
4444
b7ffe040
DA
44452012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4446
4447 Restore old code in allocate_string_data to avoid Faset breakage.
4448 Reported by Julien Danjou <julien@danjou.info> in
4449 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4450 * alloc.c (allocate_string_data): Restore old code with minor
4451 adjustments, fix comment to explain this subtle issue.
4452
4dc7c8d5
SM
44532012-07-17 Eli Zaretskii <eliz@gnu.org>
4454
4455 Remove FILE_SYSTEM_CASE.
4456 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4457
4458 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4459 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4460 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4461 call-process-region passes it through expand-file-name.
4462
4463 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4464
44652012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4466
4467 Fix crash when creating indirect buffer (Bug#11917)
4468 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4469 Don't handle unbound variables specially if non-zero.
4470 (Fbuffer_local_variables): Pass zero.
4471 (clone_per_buffer_values): Pass non-zero.
4472
44732012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4474
4475 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4476 to make the loop interruptible.
4477
44782012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4479
4480 * gnutls.c (emacs_gnutls_handshake): Only retry if
4481 GNUTLS_E_INTERRUPTED.
4482
cce7fefc
DA
44832012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4484
4485 Cleanup and convert miscellaneous checks to eassert.
4486 * alloc.c (mark_interval): Fix comment, partially rephrase
4487 old comment from intervals.h (see below).
4488 * intervals.c (find_interval, adjust_intervals_for_insertion)
4489 (delete_interval, adjust_intervals_for_deletion)
4490 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4491 Convert to eassert.
4492 (adjust_intervals_for_insertion, make_new_interval):
4493 Remove obsolete and unused code.
4494 * intervals.h (struct interval): Remove obsolete comment.
4495 * textprotp.c (erase_properties): Remove unused code.
4496 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4497 (Fremove_list_of_text_properties): Convert to eassert.
4498
9ea10cc3
CY
44992012-07-17 Chong Yidong <cyd@gnu.org>
4500
4501 * editfns.c (Finsert_char): Doc fix.
4502
3900d5de
DA
45032012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4504
4505 Fix previous change to make Fmemory_free always accurate.
4506 * alloc.c (make_interval): Update total_free_intervals.
4507 (make_float): Likewise for total_free_floats.
4508 (free_cons, Fcons): Likewise for total_free_conses.
4509 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4510 Likewise for total_free_vector_bytes.
4511 (Fmake_symbol): Likewise for total_free_symbols.
4512 (bytes_free): Remove.
4513
7098646f
DA
45142012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4515
4516 Simple free memory accounting feature.
4517 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4518 (sweep_vectors): Accumulate size of free vectors.
4519 (Fgarbage_collect): Setup bytes_free.
4520 (Fmemory_free): New function.
4521 (syms_of_alloc): Register it.
4522
22657b40
DA
45232012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4524
4525 Cleanup overlays checking.
4526 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4527 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4528 eassert and OVERLAYP.
4529 (sort_overlays): Change to use OVERLAYP.
4530
ddfc8813
RK
45312012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4532
4533 * editfns.c (Finsert_char): Make it interactive, and make the
4534 second arg optional. Copy interactive spec and docstring from
4535 ucs-insert.
4536
7c26cf3c
PE
45372012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4538
4539 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4540 Unlike the other wrapped functions, fabs has an unspecified
4541 effect on errno.
4542
5d127af9
JD
45432012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4544
4545 * nsterm.m (keyDown): Interpret flags without left/right bits
4546 as the left key (Bug#11670).
4547
6a0dd1d7
DA
45482012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4549
4550 Remove empty and useless init functions.
4551 * lisp.h (init_character_once, init_fns, init_image)
4552 (init_filelock, init_sound): Remove prototype.
4553 * character.c (init_character_once): Remove.
4554 * filelock.c (init_filelock): Likewise.
4555 * fns.c (init_fns): Likewise.
4556 * image.c (init_image): Likewise.
4557 * sound.c (init_sound): Likewise.
4558 * emacs.c (main): Adjust accordingly.
4559
7a6136fd
DA
45602012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4561
4562 * gtkutil.h: Tiny cleanups.
4563 (use_old_gtk_file_dialog): Remove useless declaration.
4564 (xg_uses_old_file_dialog): Add suggested const attribute.
4565
ce811ad9
EZ
45662012-07-15 Eli Zaretskii <eliz@gnu.org>
4567
4568 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4569 (bidi_paragraph_init): Use it to limit search forward for a strong
4570 directional character in abnormally large paragraphs full of
4571 neutral or weak characters. (Bug#11943)
4572
c9adfeaa
SF
45732012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4574
4575 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4576 the toolbar (Bug#9451).
4577 (xg_make_tool_item): Give the widget event box a transparent
4578 background.
4579
fff62aa9
DA
45802012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4581
4582 Cleanup basic allocation variables and functions.
4583 * alloc.c (ignore_warnings, init_intervals, init_float)
4584 (init_cons, init_symbol, init_marker): Remove.
4585 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4586 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4587 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4588 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4589 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4590 (staticidx, init_alloc_once, init_strings, free_ablock):
4591 Remove redundant initialization.
4592 * fns.c (init_weak_hash_tables): Remove.
4593 * lisp.h (init_weak_hash_tables): Remove prototype.
4594
9730daca
DA
45952012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4596
4597 Use zero_vector where appropriate.
4598 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4599 accordingly.
4600 * lisp.h (zero_vector): New declaration.
4601 * font.c (null_vector): Remove.
4602 (syms_of_font): Remove initialization and staticpro.
4603 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4604 * keymap.c (Faccessible_keymaps): Likewise.
4605
2e2d2a13
LL
46062012-07-15 Leo Liu <sdl.web@gmail.com>
4607
4608 * fringe.c: Fix typo in comments.
4609
cd276f6e
LL
46102012-07-14 Leo Liu <sdl.web@gmail.com>
4611
4612 * fringe.c: Add a new bitmap exclamation-mark.
4613
5a1131d9
EZ
46142012-07-14 Eli Zaretskii <eliz@gnu.org>
4615
4616 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4617
4618 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4619 (HAVE_MENUS): Don't define, defined by editing config.in with
4620 msdos/sed2v2.inp.
4621 (GMALLOC_INHIBIT_VALLOC): Don't define.
4622 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4623
22e983b7
JB
46242012-07-14 Juanma Barranquero <lekktu@gmail.com>
4625
4626 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4627
5b3f250f
GM
46282012-07-14 Glenn Morris <rgm@gnu.org>
4629
4630 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4631 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4632 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4633
33d63ff4
GM
46342012-07-13 Glenn Morris <rgm@gnu.org>
4635
5b633342
GM
4636 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4637
33d63ff4
GM
4638 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4639 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4640
b55b9f85
JD
46412012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4642
0dc8cf50
JD
4643 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4644 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4645 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4646 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4647 where appropriate.
4648 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4649 as boolean expression.
4650 (x_set_window_size): Remove unused variable toolbar.
4651 (ns_get_color_default, ns_mod_to_lisp): Remove.
4652 (ns_mouse_position): Remove unused variables xchar and ychar.
4653 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4654 (ns_set_vertical_scroll_bar): Remove unused variable count.
4655 (ns_delete_terminal): Remove unused variable i.
4656 (ns_term_init): Remove unused variables r, g and b.
4657 (mouseDown): Remove unused variable window.
4658 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4659 (initFrameFromEmacs): Remove unused variable vbextra.
4660 (mouseEntered): Remove unused variables p and dpyinfo.
4661 (mouseExited): Remove unused variables p and r.
4662 (ns_define_frame_cursor, ns_clear_frame_area)
4663 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4664 (menuDown): Assign [sender tag] to variable and cast the variable.
4665
4666 * nsterm.h (menuDown): Add id as type to argument sender.
4667 (ns_display_info_for_name): Add Lisp_Object argument.
4668 (ns_term_init): Add Lisp_Object argument.
4669 (ns_map_event_to_object): Add void argument.
4670 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4671 prototype with arguments and only declare if __OBJC__.
4672 (nxatoms_of_nsselect): Add void argument.
4673 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4674 (ns_alloc_autorelease_pool): Add void argument.
4675 (ns_release_autorelease_pool): Add void* argument.
4676 (ns_get_defaults_value): Add const char* argument.
4677
4678 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4679 (initFromContents): Use SSDATA where appropriate.
4680 (ns_update_menubar): Add braces to ambigous if-else.
4681 (initWithTitle): Put () around assignment in if statement.
4682 (ns_menu_show): Remove unused variables window and keymap.
4683 (update_frame_tool_bar): Remove unused variable selected_p.
4684 (initWithContentRect): Remove unused variable this_cmd_name.
4685
4686 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4687 appropriate.
4688 (setXBMColor): Remove unused variable len.
4689 (setPixmapData): Put () around assignment in loop statement.
4690
4691 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4692 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4693 where appropriate.
4694 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4695 around assignment in loop statement.
4696 (nsfont_open): Remove unused variable i.
4697 (nsfont_open): Remove unused variable len.
4698 (nsfont_draw): Remove unused variable cs.
4699
4700 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4701 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4702 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4703 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4704 (Fns_font_name, Fns_perform_service)
4705 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4706 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4707 (ns_set_name): Remove unused variable view.
4708 (x_set_menu_bar_lines): Remove unused variable olines.
4709 (x_set_tool_bar_lines): Remove unused variable root_window.
4710 (Fns_list_colors): Put () around assignment in while statement.
4711 (Fns_perform_service): Remove unused variable len.
4712 (Fns_display_usable_bounds): Remove unused variable top.
4713 (syms_of_nsfns): Remove unused variable i.
4714
b55b9f85
JD
4715 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4716 memcpy (Bug#11907).
4717
ed9265fc 47182012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
4719
4720 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4721 and free it with DestroyExceptionInfo (Bug#11558).
4722
ef099b57
JB
47232012-07-13 Juanma Barranquero <lekktu@gmail.com>
4724
4725 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4726 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4727 Set here, not in nt/config.nt.
4728
ea814a5d
EZ
47292012-07-13 Eli Zaretskii <eliz@gnu.org>
4730
4731 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4732 cursor overflow into the last glyph on display line when the right
4733 fringe is off. (Bug#11832)
4734
1a952767
PE
47352012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4736
4737 * xdisp.c (produce_special_glyphs): Now static.
4738 * dispextern.h (produce_special_glyphs): Remove decl.
4739
983188fd
GM
47402012-07-13 Glenn Morris <rgm@gnu.org>
4741
8d7c7eed 4742 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
4743 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4744
983188fd
GM
4745 * s/usg5-4-common.h (USG, USG5):
4746 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4747 * s/sol2-6.h (SOLARIS2):
4748 * s/irix6-5.h (IRIX6_5):
4749 * s/hpux10-20.h (USG, USG5, HPUX):
4750 * s/gnu-linux.h (USG, GNU_LINUX):
4751 * s/freebsd.h (BSD_SYSTEM):
4752 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4753 * s/cygwin.h (CYGWIN):
4754 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4755 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4756
d1e68667 47572012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
4758
4759 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 4760
6de0e799
GM
47612012-07-13 Glenn Morris <rgm@gnu.org>
4762
739ae010
GM
4763 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4764
dbee5793
GM
4765 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4766
6de0e799
GM
4767 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4768 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4769
b82da769
GM
47702012-07-12 Glenn Morris <rgm@gnu.org>
4771
4fae5a7a 4772 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
4773
4774 * process.c (init_process_emacs): Rename from init_process.
4775 The old name is also the name of a Mach system call.
4776 * lisp.h, emacs.c: Update for this name change.
4777 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4778 longer needed.
4779
5a979817
EZ
47802012-07-12 Eli Zaretskii <eliz@gnu.org>
4781
4782 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4783 memmove call that removes glyphs covered by the left truncation
4784 glyph. Improve commentary.
4785 (display_line): Fix display of continuation glyphs on GUI frames
4786 when the right fringe is turned off and variable-size fonts are
4787 used in the window. Move the code that appends a stretch glyph to
4788 produce_special_glyphs, so that it could be used for truncation
4789 and continuation glyphs alike.
4790 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4791 glyph of a suitably computed width, to align the special glyphs at
4792 the window margin. Code moved from display_line. (Bug#11832)
4793
3e91a053
GM
47942012-07-12 Glenn Morris <rgm@gnu.org>
4795
ba9e4b84
GM
4796 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4797
4798 * s/gnu-linux.h, s/hpux10-20.h:
4799 Do not unconditionally define HAVE_XRMSETDATABASE.
4800
3e91a053
GM
4801 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4802
b300b1f4
PE
48032012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4804
4805 Fix typos that broke OS X build.
4806 Reported by Randal L. Schwartz in
4807 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4808 * nsterm.m (ns_timeout): Add missing local decl.
4809 (ns_get_color): snprintf -> sprintf, to fix typo.
4810
6e777848
GM
48112012-07-12 Glenn Morris <rgm@gnu.org>
4812
3f922c37
GM
4813 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4814 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4815 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4816 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4817
0ab7b23a
GM
4818 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4819 Move PTY_OPEN to configure.
4820
6e777848
GM
4821 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4822 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4823 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4824
4a7edc24
DA
48252012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4826
4827 Use empty_unibyte_string where applicable.
4828 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4829 * lread.c (read1): Likewise.
4830 * xsettings.c (syms_of_xsettings): Likewise.
4831
308aab79
GM
48322012-07-12 Glenn Morris <rgm@gnu.org>
4833
42bd1719
GM
4834 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4835 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
4836 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4837 * s/hpux10-20.h (RUN_TIME_REMAP):
4838 * s/bsd-common.h (TABDLY): Move to configure.
4839
4840 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4841
4842 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4843
ea0bbd17 4844 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 4845 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
4846
4847 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 4848
308aab79
GM
4849 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4850 * s/template.h: Move NARROWPROTO to configure.
4851
ee1cf5cf
GM
48522012-07-11 Glenn Morris <rgm@gnu.org>
4853
30fe9bf4
GM
4854 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4855 unused since 2011-01-17 change to systty.h.
4856
ee1cf5cf
GM
4857 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4858 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4859 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4860
63e47e07
PE
48612012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4862
4863 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4864
c43fb4c3
GM
48652012-07-11 Glenn Morris <rgm@gnu.org>
4866
4867 * s/darwin.h, s/gnu-linux.h, s/template.h:
4868 Move INTERRUPT_INPUT to configure.
4869
e8df9267
DA
48702012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4871
4872 Minor adjustments to interning code.
4873 * lisp.h (intern, intern_c_string): Redefine as static inline
4874 wrappers for intern_1 and intern_c_string_1, respectively.
4875 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
4876 * lread.c (intern_1, intern_c_string_1, oblookup):
4877 Simplify Vobarray checking.
e8df9267
DA
4878 * font.c (font_intern_prop): Likewise. Adjust comment.
4879 * w32font.c (intern_font_name): Likewise.
4880
34348bd4
AS
48812012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4882
d96a1e0c
AS
4883 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4884
34348bd4
AS
4885 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4886 of Fcar/Fcdr if possible.
4887 * font.c (check_otf_features): Likewise.
4888 * fontset.c (Fnew_fontset): Likewise.
4889 * gnutls.c (Fgnutls_boot): Likewise.
4890 * minibuf.c (read_minibuf): Likewise.
4891 * msdos.c (IT_set_frame_parameters): Likewise.
4892 * xmenu.c (Fx_popup_dialog): Likewise.
4893 * w32menu.c (Fx_popup_dialog): Likewise.
4894
c8add24e
GM
48952012-07-11 Glenn Morris <rgm@gnu.org>
4896
4b575b3c
GM
4897 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4898 since nothing has defined it on these platforms.
4899
09f4e3b0
GM
4900 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4901 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4902
172bedef
GM
4903 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4904 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4905 Move CLASH_DETECTION to configure.
4906
249685df
GM
4907 * s/gnu.h: Remove file, which is now empty.
4908
c8add24e
GM
4909 * s/gnu.h, s/gnu-linux.h:
4910 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4911
b41253a3
JW
49122012-07-11 John Wiegley <johnw@newartisans.com>
4913
4914 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4915 function attribute, so we only use it if it exists in the
4916 compiler.
4917
d923b542
DA
49182012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4919
4920 Avoid call to strlen in fast_c_string_match_ignore_case.
4921 * search.c (fast_c_string_match_ignore_case): Change to use
4922 length argument. Adjust users accordingly.
4923 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4924
5ebbef1d
PE
49252012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4926
bb352260
PE
4927 Assume mkdir, rmdir.
4928 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4929 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4930
57054ddd
PE
4931 Assume rename.
4932 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4933
b747d3f7
PE
4934 Assume perror.
4935 * s/hpux10-20.h (HAVE_PERROR): Remove.
4936 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4937 Remove dummy definition, as this problem was obsolete long ago.
4938
5ebbef1d
PE
4939 Assume strerror.
4940 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4941
984e7f30
DA
49422012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4943
4944 Avoid calls to strlen in font processing functions.
4945 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
4946 (font_open_by_name): Change to use length argument.
4947 Adjust users accordingly.
d923b542
DA
4948 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4949 Adjust prototypes.
4950 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4951 Change to return ptrdiff_t.
984e7f30
DA
4952 (xfont_list_pattern, xfont_match): Use length returned by
4953 xfont_decode_coding_xlfd.
4954 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4955
20e94fdd
GM
49562012-07-11 Glenn Morris <rgm@gnu.org>
4957
9d596af3
GM
4958 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4959 Move DONT_REOPEN_PTY to configure.
4960
20e94fdd
GM
4961 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4962 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4963
e99a530f
PE
49642012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4965
22ffb973
PE
4966 Remove "#define unix" that is no longer needed (Bug#11905).
4967 * s/aix4-2.h (unix): Remove; no longer needed.
4968
e9a9ae03
PE
4969 EMACS_TIME simplification (Bug#11875).
4970 This replaces macros (which typically do not work in GDB)
4971 with functions, typedefs and enums, making the code easier to debug.
4972 The functional style also makes code easier to read and maintain.
4973 * systime.h: Include <sys/time.h> on all hosts, not just if
4974 WINDOWSNT, since 'struct timeval' is needed in general.
4975 (EMACS_TIME): Now a typedef, not a macro.
4976 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4977 not macros.
4978 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4979 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4980 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4981 (EMACS_TIME_LE): Now functions, not macros.
4982 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4983 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4984 which are not functions. All uses rewritten to use:
4985 (make_emacs_time): New function.
4986 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4987 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4988 not functions. All uses rewritten to use the following, respectively:
4989 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4990 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 4991 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
4992 * fileio.c (Fcopy_file):
4993 * xterm.c (XTflash): Get the current time closer to when it's used.
4994 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4995
ffacb126
PE
4996 * bytecode.c (targets): Suppress -Woverride-init warnings.
4997
e99a530f
PE
4998 Simplify by avoiding confusing use of strncpy etc.
4999 * doc.c (Fsnarf_documentation):
5000 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5001 * frame.c (Fmake_terminal_frame):
5002 * gtkutil.c (get_utf8_string):
5003 * lread.c (openp):
5004 * nsmenu.m (ns_update_menubar):
5005 * regex.c (regerror):
5006 Prefer memcpy to strncpy and strncat when either will do.
5007 * fileio.c (Fsubstitute_in_file_name):
5008 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5009 (menu_separator_name_p):
5010 * nsmenu.m (ns_update_menubar):
5011 Prefer memcmp to strncmp when either will do.
5012 * nsterm.m: Include <ftoastr.h>.
5013 (ns_get_color):
5014 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5015 Prefer snprintf to strncpy.
5016 * nsterm.m (ns_term_init):
5017 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5018 * nsterm.m (ns_term_init):
5019 Avoid the need for strncpy, by using build_string or
5020 make_unibyte_string directly. Use dtoastr, not snprintf.
5021 * process.c (Fmake_network_process): Diagnose service names that
5022 are too long, rather than silently truncating them or creating
5023 non-null-terminated names.
5024 (Fnetwork_interface_info): Likewise, for interface names.
5025 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5026 Prefer sprintf to strncat.
5027 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5028 Prefer vsnprintf to vsprintf + strncpy.
5029
c59592b3
GM
50302012-07-10 Glenn Morris <rgm@gnu.org>
5031
5032 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5033 Clarify fallback case.
5034
7d7bbefd
DA
50352012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5036
5037 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5038 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5039 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 5040 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
5041 where argument type is known to be a Lisp_Cons.
5042
3a4c8000
TT
50432012-07-10 Tom Tromey <tromey@redhat.com>
5044
5045 * bytecode.c (BYTE_CODE_THREADED): New macro.
5046 (BYTE_CODES): New macro. Replaces all old byte-code defines.
5047 (enum byte_code_op): New type.
5048 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5049 (exec_byte_code): Use them. Use token threading when applicable.
5050
2a0213a6
DA
50512012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5052
5053 Optimize pure C strings initialization.
5054 * lisp.h (make_pure_string): Fix prototype.
5055 (build_pure_c_string): New function, defined as static inline. This
5056 provides a better opportunity to optimize away calls to strlen when
5057 the function is called with compile-time constant argument.
5058 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
5059 argument, adjust users accordingly. Use build_pure_c_string where
5060 appropriate.
5061 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
5062 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
5063 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
5064
cb1caeaf
DA
50652012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5066
5067 Avoid calls to strlen in miscellaneous functions.
5068 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
5069 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
5070 * lread.c (openp): Likewise.
5071
c293e30c
DA
50722012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5073
5074 Avoid calls to strlen in path processing functions.
5075 * fileio.c (file_name_as_directory): Add comment. Change to add
5076 srclen argument and return the length of result. Adjust users
5077 accordingly.
5078 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
5079 swap 1st and 2nd arguments to obey the common convention.
5080 Adjust users accordingly.
c293e30c
DA
5081 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
5082
9e059e3f
GM
50832012-07-10 Glenn Morris <rgm@gnu.org>
5084
d02eb359
GM
5085 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
5086 Move PENDING_OUTPUT_COUNT definition to configure.
5087
882cf227
GM
5088 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
5089 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
5090 * s/gnu.h (DATA_START): Move definitions to configure.
5091
af6e839f
GM
5092 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
5093 We include usg5-4-common.h, which defines them both.
5094
40289a12
GM
5095 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
5096 O_RDONLY already includes it).
5097
9e059e3f
GM
5098 Stop ns builds setting the EMACSLOADPATH environment variable.
5099 * nsterm.m (ns_load_path): Rename from ns_init_paths.
5100 Now it does not set EMACSLOADPATH, just returns the load-path string.
5101 * nsterm.h: Update accordingly.
5102 * lread.c [HAVE_NS]: Include nsterm.h.
5103 (init_lread) [HAVE_NS]: Use ns_load_path.
5104 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
5105
7c4e8ec0
GM
51062012-07-09 Glenn Morris <rgm@gnu.org>
5107
d4f600ff
GM
5108 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
5109 since the included bsd-common.h does so.
5110
cbb31951
GM
5111 Stop ns builds setting the EMACSPATH environment variable.
5112 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
5113 (ns_init_paths): Do not set EMACSPATH.
5114 * nsterm.h (ns_exec_path): Add it.
5115 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
5116 Use ns_exec_path.
5117
7c4e8ec0
GM
5118 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
5119
26bccfae
PE
51202012-07-09 Paul Eggert <eggert@cs.ucla.edu>
5121
a0bee46f
PE
5122 * process.c (wait_reading_process_output): 'waitchannels' was unset
5123 when read_kbd || !NILP (wait_for_cell); fix this.
5124
5994c183
PE
5125 Add GCC-style 'const' attribute to functions that can use it.
5126 * character.h (char_resolve_modifier_mask):
5127 * keyboard.h (make_ctrl_char):
5128 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5129 (init_character_once, next_almost_prime, init_fns, init_image)
5130 (flush_pending_output, init_sound):
5131 * mem-limits.h (start_of_data):
5132 * menu.h (finish_menu_items):
5133 Add ATTRIBUTE_CONST.
5134 * emacs.c (DEFINE_DUMMY_FUNCTION):
5135 Declare the dummy function with ATTRIBUTE_CONST.
5136 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5137 Add decls with ATTRIBUTE_CONST.
5138
26bccfae
PE
5139 Minor improvements to make_formatted_string.
5140 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5141 where int is good enough, as vsprintf returns an int.
5142 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5143
a8290ec3
DA
51442012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5145
5146 Use make_formatted_string to avoid double length calculation.
5147 * lisp.h (make_formatted_string): New prototype.
5148 * alloc.c (make_formatted_string): New function.
5149 * buffer.c (Fgenerate_new_buffer_name): Use it.
5150 * dbus.c (syms_of_dbusbind): Likewise.
5151 * editfns.c (Fcurrent_time_zone): Likewise.
5152 * filelock.c (get_boot_time): Likewise.
5153 * frame.c (make_terminal_frame, set_term_frame_name)
5154 (x_report_frame_params): Likewise.
5155 * image.c (gs_load): Likewise.
5156 * minibuf.c (get_minibuffer): Likewise.
5157 * msdos.c (dos_set_window_size): Likewise.
5158 * process.c (make_process): Likewise.
5159 * xdisp.c (ensure_echo_area_buffers): Likewise.
5160 * xsettings.c (apply_xft_settings): Likewise.
5161
d01ba2f1
GM
51622012-07-09 Glenn Morris <rgm@gnu.org>
5163
5164 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5165 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5166 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5167 * nsterm.h (ns_etc_directory): Add it.
5168 * callproc.c [HAVE_NS]: Include nsterm.h.
5169 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5170
f1f924b6
DA
51712012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5172
5173 Move marker debugging code under MARKER_DEBUG.
5174 * marker.c (MARKER_DEBUG): Move marker debugging code under
5175 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5176 for bootstrap with --enable-checking (~3x slowdown reported
5177 by Juanma Barranquero <lekktu@gmail.com>).
5178 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5179
ab531b66
PE
51802012-07-08 Paul Eggert <eggert@cs.ucla.edu>
5181
5182 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5183 See <http://bugs.gnu.org/11825#29>.
5184
c4b3bc8a
EZ
51852012-07-08 Eli Zaretskii <eliz@gnu.org>
5186
5187 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5188 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
5189 (display_line): Add commentary about displaying truncation glyphs
5190 on GUI frames.
5191 (produce_special_glyphs): Move here from term.c.
5192
5193 * term.c (produce_special_glyphs): Move to xdisp.c.
5194
5195 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5196 section.
c4b3bc8a 5197
b676b881
AS
51982012-07-07 Andreas Schwab <schwab@linux-m68k.org>
5199
f17c5273
AS
5200 * xdisp.c (display_line): Avoid warning about implicit declaration
5201 of FRAME_FONT.
5202
298819b9
AS
5203 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5204
b676b881
AS
5205 * lisp.h: Remove empty conditional.
5206
6045c4fd
PE
52072012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5208
b3350bf9
PE
5209 * lread.c (load_path_check): Now static.
5210
6045c4fd
PE
5211 Fix some minor --with-ns problems found by static checking.
5212 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
5213 (x_set_font) [!HAVE_X_WINDOWS]:
5214 * image.c (xpm_load_image) [HAVE_NS]:
5215 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
5216 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
5217 Remove unused local.
5218 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
5219 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
5220 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
5221 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
5222 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
5223 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
5224 Fix pointer signedness problem.
5225 * xfaces.c (FRAME_X_FONT_TABLE):
5226 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
5227
929e7845
GM
52282012-07-07 Glenn Morris <rgm@gnu.org>
5229
5230 * lread.c (load_path_check): New function, split from init_lread.
5231 (init_lread): Reorganize. Motivation:
5232 If EMACSLOADPATH is set, check/warn about that rather than the
5233 defaults, which we are not going to use. Hence we can remove
5234 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
5235 Don't warn if site-lisp directories are missing.
5236 If not installed, start from a blank load-path, since
5237 PATH_LOADSEARCH refers to the eventual installation directories.
5238
58dd0aa4
EZ
52392012-07-07 Eli Zaretskii <eliz@gnu.org>
5240
5241 Support truncation and continuation glyphs on GUI frames, when
5242 fringes are disabled. (Bug#11832)
5243 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
5244 continuation glyphs even if on GUI frames.
5245 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
5246 or both, are absent.
5247 (start_display, move_it_in_display_line_to): Handle the case of a
5248 GUI frame without a fringe to display continuation or truncation
5249 glyphs.
5250 (insert_left_trunc_glyphs): Support GUI frames: make sure
5251 truncation glyphs overwrite enough glyphs from the current line to
5252 have sufficient space in pixels.
5253 (display_line): Support truncation and continuation glyphs on GUI
5254 frames. If some spare pixels are left on the line after inserting
5255 the truncation glyphs, fill that space with a stretch glyph of a
5256 suitably computed width.
5257
5258 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5259 produce_glyphs, to support GUI sessions.
5260
31571fd7
PE
52612012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5262
5a16b9bc
PE
5263 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5264
f3047c75
PE
5265 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5266
31571fd7
PE
5267 Do not require float-time's arg to fit in time_t (Bug#11825).
5268 This works better on hosts where time_t is unsigned, and where
5269 float-time is applied to the (negative) difference between two times.
5270 * editfns.c (decode_time_components): Last arg is now double *,
5271 not int *, and means to store all the result as a double, without
5272 worrying about whether the seconds part fits in time_t.
5273 All callers changed.
5274 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5275 All callers changed.
5276 (Ffloat_time): Do not fail merely because the specified time falls
5277 outside of time_t range.
5278
4516fbef
GM
52792012-07-07 Glenn Morris <rgm@gnu.org>
5280
5281 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5282 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5283 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5284
07adc2c6
JB
52852012-07-07 Juanma Barranquero <lekktu@gmail.com>
5286
5287 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5288 Update dependencies.
5289
5290 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5291
fd573f31
PE
52922012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5293
fee5959d
PE
5294 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5295 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5296 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5297 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5298 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5299 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5300
fd573f31
PE
5301 * xfont.c (compare_font_names): Redo to omit the need for casts.
5302
ddadbc0e
AS
53032012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5304
fca8d6b6
AS
5305 * xfns.c (Fx_change_window_property): Doc fix.
5306 * w32fns.c (Fx_change_window_property): Doc fix.
5307
ddadbc0e
AS
5308 * w32fns.c (Fx_window_property): Accept the same arguments as the
5309 X Windows version. Doc fix.
5310 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5311
ed9265fc 53122012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
5313 Eli Zaretskii <eliz@gnu.org>
5314
5315 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5316 Windows-specific code from nt/config.nt moved here.
5317 Obsolete settings removed.
5318
216ee680
PE
53192012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5320
5321 * process.c: Avoid unnecessary calls to gettime.
5322 (wait_reading_process_output): Don't get the time of day
5323 when gobbling data immediately and not waiting, as there's no need
5324 for it in that case. This removes a FIXME.
5325
bdd091e4
JD
53262012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5327
5328 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5329 is defined (Bug#11768).
5330
9d44f8ce
DA
53312012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5332
5333 Fix marker debugging code.
5334 * marker.c (byte_char_debug_check): Do not perform the check
5335 if buffer is not multibyte.
090bd7cb
JB
5336 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5337 Call byte_char_debug_check with correct arguments.
9d44f8ce 5338
90fc4786
DA
53392012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5340
5341 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
5342 * marker.c (byte_char_debug_check, count_markers):
5343 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
5344 (byte_debug_flag): Remove.
5345 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5346 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5347
7b7ae965
DA
53482012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5349
4e57b342
DA
5350 Avoid code repetition in marker-related functions.
5351 * marker.c (attach_marker): New function.
5352 (Fset_marker, set_marker_restricted, set_marker_both)
5353 (set_marker_restricted_both): Use it.
5354 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5355 Consistently rename charno to charpos.
5356 (marker_position): Add eassert.
5357 (marker_byte_position): Convert to eassert.
5358
53592012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5360
5361 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 5362 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 5363 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 5364
657924ff
DA
53652012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5366
5367 Introduce fast path for the widely used marker operation.
5368 * alloc.c (build_marker): New function.
5369 * lisp.h (build_marker): New prototype.
5370 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5371 * composite.c (autocmp_chars): Likewise.
5372 * editfns.c (buildmark): Remove.
5373 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5374 (save_restriction_save): Use build_marker.
5375 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5376 * window.c (save_window_save): Likewise.
5377
041a49a6
DA
53782012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5379
5380 Do not use Fdelete_overlay in delete_all_overlays
5381 to avoid redundant calls to unchain_overlay.
5382 * buffer.c (drop_overlay): New function.
5383 (delete_all_overlays, Fdelete_overlay): Use it.
5384 * minibuf.c (get_minibuffer): Fix comment.
5385
7dca65a4
PE
53862012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5387
5388 Port to OpenBSD 5.1 amd64.
5389 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5390 This is needed for OpenBSD, and should be harmless on all BSD systems.
5391 Also, include <sys/sysctl.h>, as it should be available on all
5392 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5393 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5394 use p_pid member, not kp_proc.pid.
5395
8eb876e2
GM
53962012-07-06 Glenn Morris <rgm@gnu.org>
5397
5398 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5399
38182d90
PE
54002012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5401
5402 More xmalloc and related cleanup.
5403 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5404 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5405 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5406 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5407 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5408 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5409 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5410 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5411 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5412 * xterm.c:
5413 Omit needless casts involving void * pointers and allocation.
5414 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5415 as the former is more robust if P's type is changed.
5416 Prefer xzalloc to xmalloc + memset 0.
5417 Simplify malloc-or-realloc to realloc.
5418 Don't worry about xmalloc returning a null pointer.
5419 Prefer xstrdup to xmalloc + strcpy.
5420 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5421 growing it.
5422 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5423 alloca of a constant.
5424
6dd5a677
EZ
54252012-07-05 Eli Zaretskii <eliz@gnu.org>
5426
5427 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5428 hscroll is larger than the line width. Fixes long and futile
5429 looping inside extend_face_to_end_of_line (on a TTY) producing
5430 glyphs that are not needed and thrown away.
5431
6b312f0f
DA
54322012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5433
5434 * marker.c (set_marker_restricted_both): Simplify by using
5435 clip_to_bounds.
5436
f520ef9b
PE
54372012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5438
5439 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5440
383b7c95
JD
54412012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5442
5443 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5444 not defined (Bug#11768).
5445 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5446 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5447 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5448 followed by gtk_box_set_homogeneous (Bug#11768).
5449 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
5450 (update_theme_scrollbar_width, xg_create_scroll_bar):
5451 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
5452 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5453 (is_box_type): New function (Bug#11768).
5454 (xg_tool_item_stale_p): Call is_box_type.
5293d758 5455 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
5456 with default display (Bug#11768).
5457
d6e7bf45
EZ
54582012-07-05 Eli Zaretskii <eliz@gnu.org>
5459
5460 * xdisp.c (window_hscroll_limited): New function.
5461 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5462 coordinates when window's hscroll is set to insanely large
5463 values. (Bug#11857)
5464
431391ec
JB
54652012-07-05 Juanma Barranquero <lekktu@gmail.com>
5466
5467 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5468 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5469
23f86fce
DA
54702012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5471
5472 Cleanup xmalloc.
5473 * lisp.h (xzalloc): New prototype. Omit needless casts.
5474 * alloc.c (xzalloc): New function. Omit needless casts.
5475 * charset.c: Omit needless casts. Convert all calls to
5476 xmalloc with following memset to xzalloc.
5477 * dispnew.c: Likewise.
5478 * fringe.c: Likewise.
5479 * image.c: Likewise.
5480 * sound.c: Likewise.
5481 * term.c: Likewise.
5482 * w32fns.c: Likewise.
5483 * w32font.c: Likewise.
5484 * w32term.c: Likewise.
5485 * xfaces.c: Likewise.
5486 * xfns.c: Likewise.
5487 * xterm.c: Likewise.
5488 * atimer.c: Omit needless casts.
5489 * buffer.c: Likewise.
5490 * callproc.c: Likewise.
5491 * ccl.c: Likewise.
5492 * coding.c: Likewise.
5493 * composite.c: Likewise.
5494 * doc.c: Likewise.
5495 * doprnt.c: Likewise.
5496 * editfns.c: Likewise.
5497 * emacs.c: Likewise.
5498 * eval.c: Likewise.
5499 * filelock.c: Likewise.
5500 * fns.c: Likewise.
5501 * gtkutil.c: Likewise.
5502 * keyboard.c: Likewise.
5503 * lisp.h: Likewise.
5504 * lread.c: Likewise.
5505 * minibuf.c: Likewise.
5506 * msdos.c: Likewise.
5507 * print.c: Likewise.
5508 * process.c: Likewise.
5509 * region-cache.c: Likewise.
5510 * search.c: Likewise.
5511 * sysdep.c: Likewise.
5512 * termcap.c: Likewise.
5513 * terminal.c: Likewise.
5514 * tparam.c: Likewise.
5515 * w16select.c: Likewise.
5516 * w32.c: Likewise.
5517 * w32reg.c: Likewise.
5518 * w32select.c: Likewise.
5519 * w32uniscribe.c: Likewise.
5520 * widget.c: Likewise.
5521 * xdisp.c: Likewise.
5522 * xmenu.c: Likewise.
5523 * xrdb.c: Likewise.
5524 * xselect.c: Likewise.
5525
0497dc44
PE
55262012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5527
5528 * fileio.c (time_error_value): Check the right error number.
5529 Problem reported by Troels Nielsen in
5530 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5531
356e7178
PE
55322012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5533
4e71fd89
PE
5534 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5535 This should be fixed in a better way; see Eli Zaretskii in
5536 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5537 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5538
f0941253
PE
5539 * fileio.c (time_error_value): Rename from special_mtime.
5540 The old name's problems were noted by Eli Zaretskii in
5541 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5542
065c9eb4
PE
5543 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5544 This variable's comment says Emacs needs at least one GDB-visible
5545 symbol of type enum pvec_type, to work around GDB problems.
5546 The symbol's value doesn't matter.
5547
356e7178
PE
5548 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5549 that causes compilation to fail on pre-C99 compilers.
5550
ed9265fc 55512012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
5552
5553 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5554 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5555
3884d954
DA
55562012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5557
d209e2fb 5558 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
5559 headers for buffer_defaults and buffer_local_symbols.
5560 Reported by Juanma Barranquero <lekktu@gmail.com>.
5561
ee28be33
SM
55622012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5563
5564 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5565 * lisp.h (enum pvec_type): Use fewer bits.
5566 (PSEUDOVECTOR_SIZE_BITS): New constant.
5567 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5568 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5569 change in pvec_type.
5570 (PSEUDOVECTOR_TYPEP): New macro.
5571 (TYPED_PSEUDOVECTORP): Use it.
5572 * fns.c (internal_equal): Adapt code to extract pvectype.
5573 * emacs.c (gdb_pvec_type): Update type.
5574 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5575 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5576 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5577 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5578 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5579 abusing vector->header.next.nbytes.
5580 (live_vector_p): Use PVEC_TYPE.
5581 (mark_object): Adapt code to extract pvectype. Use switch.
5582
c7f2cd7f
PE
55832012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5584
5585 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5586 Tighten new eassert a bit.
5587
8ce70ed2
DA
55882012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5589
5590 Fix compilation with --enable-gcc-warnings and -O1
5591 optimization level.
5592 * doprnt.c (doprnt): Change type of tem to int, initialize
5593 to avoid compiler warning. Add eassert.
5594 * search.c (simple_search): Initialize match_byte to avoid
5595 compiler warning. Add eassert.
5596
dea7f1e5
PE
55972012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5598
24a212eb
PE
5599 Avoid weird behavior with large horizontal scrolls.
5600 Without this change, for example, large hscroll values would
5601 mess up Emacs's display on Fedora 15 x86, presumably due to
5602 overflows in int calculations in the display code.
5603 Also, if buffers had long lines, Emacs would freeze.
5604 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5605 (set_window_hscroll): New function, containing the old guts of
5606 Fset_window_hscroll. Return the clipped value.
5607 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5608 This avoids the need to check against PTRDIFF_MAX.
5609
dea7f1e5
PE
5610 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5611
76046526
DA
56122012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5613
5614 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5615
39adff0d
PE
56162012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5617
63807d47
PE
5618 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5619 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5620 since GCC 4.4.6 issues a bogus warning for them.
5621
39adff0d
PE
5622 Fix bugs in file timestamp newness comparisons.
5623 * fileio.c (Ffile_newer_than_file_p):
5624 * lread.c (Fload): Use full timestamp resolution of files,
5625 not just the 1-second resolution, so that files that are only
5626 slightly newer still count as newer.
5627 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5628 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5629
dbeed9a6
PE
56302012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5631
5632 * fileio.c: Improve handling of file time marker. (Bug#11852)
5633 (special_mtime): New function.
5634 (Finsert_file_contents, Fverify_visited_file_modtime):
5635 Use it to set special mtime values consistently.
5636
636334d6
AS
56372012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5638
5639 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5640 marker for non-existing file. (Bug#11852)
5641
e2017fe2
GM
56422012-07-03 Glenn Morris <rgm@gnu.org>
5643
5644 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5645 and did not make it into globals.h).
5646
404dbd37
TT
56472012-07-03 Tom Tromey <tromey@redhat.com>
5648
5649 * window.c (Fset_window_margins, Fset_window_fringes)
5650 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5651 * textprop.c (Fprevious_property_change): No longer static.
5652 * syntax.c (Fsyntax_table_p): No longer static.
5653 * process.c (Fget_process, Fprocess_datagram_address): No longer
5654 static.
5655 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5656 * keyboard.c (Fcommand_execute): No longer static.
5657 Remove EXFUN.
5658 * insdel.c (Fcombine_after_change_execute): No longer static.
5659 * image.c (Finit_image_library): No longer static.
5660 * fileio.c (Fmake_symbolic_link): No longer static.
5661 * eval.c (Ffetch_bytecode): No longer static.
5662 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
5663 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5664 No longer static.
404dbd37
TT
5665 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5666 static.
5667 * dired.c (Ffile_attributes): No longer static.
5668 * composite.c (Fcomposition_get_gstring): No longer static.
5669 * callproc.c (Fgetenv_internal): No longer static.
5670
5671 * ccl.h: Remove EXFUNs.
5672 * buffer.h: Remove EXFUNs.
5673 * dispextern.h: Remove EXFUNs.
5674 * intervals.h: Remove EXFUNs.
5675 * fontset.h: Remove EXFUN.
5676 * font.h: Remove EXFUNs.
5677 * dosfns.c (system_process_attributes): Remove EXFUN.
5678 * keymap.h: Remove EXFUNs.
5679 * lisp.h: Remove EXFUNs.
5680 * w32term.h: Remove EXFUNs.
5681 * window.h: Remove EXFUNs.
5682 * xsettings.h: Remove EXFUN.
5683 * xterm.h: Remove EXFUN.
5684
8e4fd1e1
GM
56852012-07-03 Glenn Morris <rgm@gnu.org>
5686
5687 * lisp.h (Frandom): Make it visible to C.
5688 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5689 buffer for invisible buffers. (Bug#1229)
5690
ca95b3eb
DA
56912012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5692
5693 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5694 values which aren't power of 2.
14ae4239
BT
5695 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5696 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
5697 accordingly.
5698
7555c33f
SM
56992012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5700
5701 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5702
5703 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5704
d12e8f5a
DA
57052012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5706
5707 * alloc.c (allocate_vector_block): Remove redundant
5708 calls to mallopt if DOUG_LEA_MALLOC is defined.
5709 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5710 avoid calls to mallopt if zero_vector is returned.
5711
296094c3
DA
57122012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5713
5714 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5715 is enabled, avoid dereferencing NULL current_sblock if
5716 running undumped.
5717
36429c89
DA
57182012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5719
5720 Cleanup basic buffer management.
5721 * buffer.h (struct buffer): Change layout to use generic vector
5722 marking code. Fix some comments. Change type of 'clip_changed'
5723 to bitfield. Remove unused #ifndef old.
5724 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5725 (GET_OVERLAYS_AT): Fix indentation.
5726 (for_each_per_buffer_object_at): New macro.
5727 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5728 (Fbuffer_local_variables): Use it.
5729 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5730 * alloc.c (allocate_buffer): Adjust to match new layout of
5731 struct buffer. Fix comment.
5732 (mark_overlay): New function.
5733 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5734 Lisp area of struct buffer.
5735 (mark_object): Use it. Adjust marking of misc objects
5736 and related comments.
5737
3b3e4cac
PE
57382012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5739
5740 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5741 wrapper that is not needed because the wrapped code is a no-op (zero
5742 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5743 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5744
cf5c0175
DA
57452012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5746
5747 * alloc.c (mark_buffer): Simplify. Remove prototype.
5748 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 5749 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
5750 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5751 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 5752
ca26824c
GM
57532012-06-30 Glenn Morris <rgm@gnu.org>
5754
2e4c5312
GM
5755 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5756
ca26824c
GM
5757 * epaths.in (PATH_SITELOADSEARCH): New.
5758 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5759 This is rather than relying on --enable-locallisppath elements
5760 having "site-lisp" in their names. (Bug#10208#25, 11658)
5761
0d23c240
EZ
57622012-06-30 Eli Zaretskii <eliz@gnu.org>
5763
c9240d7a
EZ
5764 * w32proc.c (sys_select): Accept and ignore one more argument.
5765
5766 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5767
0d23c240 5768 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 5769 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
5770
5771 * sysdep.c: Don't include dos.h and dosfns.h.
5772
5773 * process.c (sys_select):
5774 * msdos.c (sys_select): Accept one more argument and ignore it.
5775
5776 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5777 adapt data types and code to that.
5778
5779 * dosfns.c:
5780 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5781 which clashes with the gnulib function of the same name.
5782
af5a5a98
AS
57832012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5784
c5e4379c
AS
5785 * font.c (font_style_to_value, font_style_symbolic)
5786 (font_prop_validate_style): Add type checks for values in
5787 font_style_table.
5788
af5a5a98
AS
5789 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5790 argument.
5791 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5792 uses.
5793
8d38f461
EZ
57942012-06-29 Eli Zaretskii <eliz@gnu.org>
5795
2e5a6631
EZ
5796 * xdisp.c (try_window_id): Undo last change.
5797
8d38f461
EZ
5798 * w32.c (getwd): Adjust commentary about startup_dir.
5799 (init_environment): Always call sys_access, even in non-MSVC
5800 builds. Don't chdir to the directory of the Emacs executable.
5801 This undoes code from 1997 which was justified by the need to
5802 "avoid conflicts when removing and renaming directories". But its
5803 downside was that every relative file name was being interpreted
5804 relative to the directory of the Emacs executable, which can never
5805 be TRT. In particular, it broke sys_access when called with
5806 relative file names.
5807 (sys_access): Map GetLastError to errno.
5808
2af3565e
DA
58092012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5810
5811 * window.h (struct window): Change type of 'fringes_outside_margins'
5812 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 5813 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
5814 Adjust comment.
5815 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5816 to ptrdiff_t.
5817
c8d3a25c 58182012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 5819
c8d3a25c
GM
5820 * gnutls.c (emacs_gnutls_handshake):
5821 Add QUIT to make the loop interruptible.
57570cd3 5822
c8d3a25c 58232012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 5824
c8d3a25c
GM
5825 * charset.c (init_charset): Make lack of etc/charsets fatal.
5826
3e984ee8
DA
58272012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5828
5829 * editfns.c (region_limit): Fix type mismatch.
5830
ef884f23
DA
58312012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5832
5833 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5834 undefined. Convert from xassert to eassert.
5835 * nsmenu.m: Convert from xassert to eassert.
5836 * nsterm.m: Likewise.
5837
7d7e0027
SM
58382012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5839
5840 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5841
aa754e6a
PE
58422012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5843
5844 Avoid integer overflow on scroll-left and scroll-right.
5845 * window.c (HSCROLL_MAX): New macro.
5846 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5847 overflow when requested scroll falls outside ptrdiff_t range.
5848
80b00b08
DA
58492012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5850
5851 * window.h (struct window): Change type of 'hscroll',
5852 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5853 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5854 Adjust users accordingly.
5855 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5856 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5857 from EMACS_INT to ptrdiff_t.
5858 (make_window): Omit redundant initialization.
5859
62b2bcf6
JB
58602012-06-28 Juanma Barranquero <lekktu@gmail.com>
5861
5862 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5863
45942c7d
DA
58642012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5865
5866 * window.h (struct window): Change type of 'use_time' and
5867 'sequence_number' from Lisp_Object to int.
5868 * frame.c (make_frame): Adjust users accordingly.
5869 * print.c (print_object): Likewise.
5870 * window.c (select_window, Fwindow_use_time, make_parent_window)
5871 (make_window): Likewise.
5872
e509cfa6
DA
58732012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5874
5875 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5876 enabled with --enable-checking=[all,glyphs] configure option.
5877 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5878 adjust comments accordingly.
5879 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5880 undefined, adjust comments accordingly.
5881 * image.c: Likewise.
5882 * scroll.c: Likewise.
5883 * w32fns.c: Likewise.
5884 * w32term.c: Likewise.
5885 * xdisp.c: Likewise.
5886 * xfaces.c: Likewise.
5887 * xfns.c: Likewise.
5888 * xterm.c: Likewise.
5889
a54e2c05
DA
58902012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5891
5892 Generalize run-time debugging checks.
5893 * dispextern.h (XASSERTS): Remove.
5894 * fontset.c (xassert): Remove.
5895 Convert from xassert to eassert.
5896 * alloc.c: Convert from xassert to eassert.
5897 * bidi.c: Likewise.
5898 * dispnew.c: Likewise.
5899 * fns.c: Likewise.
5900 * fringe.c: Likewise.
5901 * ftfont.c: Likewise.
5902 * gtkutil.c: Likewise.
5903 * image.c: Likewise.
5904 * keyboard.c: Likewise.
5905 * menu.c: Likewise.
5906 * process.c: Likewise.
5907 * scroll.c: Likewise.
5908 * sound.c: Likewise.
5909 * term.c: Likewise.
5910 * w32console.c: Likewise.
5911 * w32fns.c: Likewise.
5912 * w32term.c: Likewise.
5913 * window.c: Likewise.
5914 * xdisp.c: Likewise.
5915 * xfaces.c: Likewise.
5916 * xfns.c: Likewise.
5917 * xselect.c: Likewise.
5918 * xterm.c: Likewise.
5919
1ec4b7b2
SM
59202012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5921
5922 * fns.c (maybe_resize_hash_table): Output message when growing the
5923 purify-hashtable.
5924
2014308a
DA
59252012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5926
5927 * alloc.c (allocate_string_data): Remove dead code.
5928 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5929 avoid GCC warning about unused macro.
5930
246155eb
DA
59312012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5932
5933 * alloc.c (allocate_string): Omit intervals initialization.
5934 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5935 as in make_pure_string and make_pure_c_string.
5936
43184b7b
DA
59372012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5938
d209e2fb 5939 * alloc.c (allocate_string): Fix last change.
43184b7b 5940
3fe6dd74
DA
59412012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5942
d209e2fb 5943 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
5944 to memset, add explicit initialization where appropriate.
5945
1ba6038a
GM
59462012-06-27 Glenn Morris <rgm@gnu.org>
5947
5948 * lisp.mk (lisp): Remove paths.elc.
5949
c89926a5
CY
59502012-06-27 Chong Yidong <cyd@gnu.org>
5951
5952 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5953
ed6b3510
JW
59542012-06-26 John Wiegley <johnw@newartisans.com>
5955
1ec4b7b2 5956 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
5957 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5958
ed6b3510
JW
5959 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5960 when building with Clang.
5961
8edd4a2b
SM
59622012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5963
5964 * eval.c (Fapply): Allow calling it with a single argument.
5965
f6f62d1b
EZ
59662012-06-26 Eli Zaretskii <eliz@gnu.org>
5967
5968 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5969 _stricmp and _strnicmp.
5970 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5971
62efea5e
DA
59722012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5973
5974 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5975 allocated window.
5976 (allocate_process): Likewise for new process.
8edd4a2b 5977 (allocate_terminal): Change to use offsetof.
62efea5e
DA
5978 (allocate_frame): Likewise.
5979 * frame.c (make_frame): Omit redundant initialization.
5980 * window.c (make_parent_window): Use memset.
5981 (make_window): Omit redundant initialization.
5982 * process.c (make_process): Omit redundant initialization.
5983 * terminal.c (create_terminal): Likewise.
5984
42997f4d
DA
59852012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5986
5987 * term.c (delete_tty): Remove redundant call to memset.
5988
1130ecfc
DA
59892012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5990
5991 * alloc.c: Remove build_string.
5992 * lisp.h: Define build_string as static inline. This provides
5993 a better opportunity to optimize away calls to strlen when the
5994 function is called with compile-time constant argument.
5995 * image.c (imagemagick_error): Convert to build_string.
5996 * w32proc.c (sys_spawnve): Likewise.
5997 * xterm.c (x_term_init): Likewise.
5998
cf38a720
PE
59992012-06-26 Paul Eggert <eggert@cs.ucla.edu>
6000
99027bdd
PE
6001 Use sprintf return value instead of invoking strlen on result.
6002 In the old days this wasn't portable, since some sprintf
6003 implementations returned char *. But they died out years ago and
6004 Emacs already assumes sprintf returns int.
6005 Similarly for float_to_string.
6006 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6007 * ccl.c (ccl_driver):
6008 * character.c (string_escape_byte8):
6009 * data.c (Fnumber_to_string):
6010 * doprnt.c (doprnt):
6011 * print.c (print_object):
6012 * xdisp.c (message_dolog):
6013 * xfns.c (syms_of_xfns):
6014 Use sprintf or float_to_string result to avoid need to call strlen.
6015 * data.c (Fnumber_to_string):
6016 Use make_unibyte_string, since the string must be ASCII.
6017 * lisp.h, print.c (float_to_string): Now returns int length.
6018 * term.c (produce_glyphless_glyph):
6019 Use sprintf result rather than recomputing it.
6020
cf38a720
PE
6021 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6022 * Makefile.in (ALL_CFLAGS):
6023 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6024 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6025
3511c784
DA
60262012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6027
0a08eb21 6028 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
6029 strcasecmp if available.
6030 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6031
fb7da12e
AS
60322012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6033
6034 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6035 Avoid comma operator.
6036 * menu.c (push_submenu_start, push_submenu_end)
6037 (push_left_right_boundary, push_menu_pane): Likewise.
6038 * msdos.c (dos_rawgetc): Likewise.
6039
afa2ffd8
DA
60402012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6041
6042 * xfns.c (xic_create_fontsetname): Remove redundant calls
6043 to memset.
6044
b3b4476b
PE
60452012-06-25 Paul Eggert <eggert@cs.ucla.edu>
6046
4495ff38
PE
6047 * gtkutil.c (get_utf8_string): Remove redundant assignment.
6048 sprintf already null-terminates its output.
6049
b3b4476b
PE
6050 * xfns.c (x_window): Remove redundant cast.
6051
b00876c9
DA
60522012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6053
6054 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6055 `const char *' to `char *' to avoid compiler warning.
6056
d188e26b
PE
60572012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6058
885d1d74
PE
6059 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6060 instead of truncating it to 63 (admittedly a generous limit).
6061
d188e26b
PE
6062 * process.c: Fix spelling and caps in comments.
6063
e2f560b1
DN
60642012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
6065
e86db54b 6066 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
6067 * sysdep.c (setpgrp): Remove definition, not used in this file.
6068
7583a3a1
JB
60692012-06-24 Juanma Barranquero <lekktu@gmail.com>
6070
6071 * makefile.w32-in: Update dependencies.
6072
696056c2
EZ
60732012-06-24 Eli Zaretskii <eliz@gnu.org>
6074
6075 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
6076 (SYSTIME_H): Add nt/inc/sys/time.h.
6077
6078 * systime.h [WINDOWSNT]: Include sys/time.h.
6079
6080 * s/ms-w32.h (struct timespec): Definition moved from
6081 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
6082
845ca893
PE
60832012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6084
6085 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
6086 * buffer.h (buffer_slot_type_mismatch):
6087 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6088 * eval.c (unwind_to_catch):
6089 * image.c (my_png_error, my_error_exit):
6090 * keyboard.c (quit_throw_to_read_char, user_error)
6091 (Fexit_recursive_edit, Fabort_recursive_edit):
6092 * lisp.h (die, args_out_of_range, args_out_of_range_3)
6093 (wrong_type_argument, buffer_overflow, __executable_start)
6094 (memory_full, buffer_memory_full, string_overflow, Fthrow)
6095 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
6096 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
6097 (fatal):
6098 (child_setup) [!DOS_NT]:
6099 * lread.c (end_of_file_error, invalid_syntax):
6100 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6101 * puresize.h (pure_write_error):
6102 * search.c (matcher_overflow):
6103 * sound.c (sound_perror, alsa_sound_perror):
6104 * sysdep.c, syssignal.h (croak):
6105 * term.c (maybe_fatal, vfatal):
6106 * textprop.c (text_read_only):
6107 * undo.c (user_error):
6108 * unexmacosx.c (unexec_error):
6109 * xterm.c (x_ins_del_lines, x_delete_glyphs):
6110 Use _Noreturn rather than NO_RETURN.
6111 No need for separate decl merely because of _Noreturn.
6112 * sound.c (sound_warning, parse_sound):
6113 Remove unnecessary forward decls.
6114
f1dd8073
PE
61152012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6116
6117 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
6118 * lisp.h (WAIT_READING_MAX): New macro.
6119 * dispnew.c (Fsleep_for, sit_for):
6120 * keyboard.c (kbd_buffer_get_event):
6121 * process.c (Faccept_process_output):
6122 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6123 This improves on the previous patch, which introduced a bug
6124 when time_t is unsigned and as wide as intmax_t.
6125 See <http://bugs.gnu.org/9000#51>.
6126
b82c1755
EZ
61272012-06-23 Eli Zaretskii <eliz@gnu.org>
6128
6129 * dispnew.c (sit_for, Fsleep_for):
6130 * keyboard.c (kbd_buffer_get_event):
6131 * process.c (Faccept_process_output): Avoid compiler warnings when
6132 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6133
ca300656
JB
61342012-06-23 Juanma Barranquero <lekktu@gmail.com>
6135
049ec95b
JB
6136 * makefile.w32-in: Update dependencies.
6137
ca300656
JB
6138 * w32.c (ltime): Add return type and declare static.
6139 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6140
db7b8d06
PE
61412012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6142
6143 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6144 Privately reported by Herbert J. Skuhra.
6145 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6146 All uses changed.
6147 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6148 not make_lisp_timeval, when the argument is of type EMACS_TIME.
6149
0bd8297f
EZ
61502012-06-23 Eli Zaretskii <eliz@gnu.org>
6151
96512555
EZ
6152 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6153 last argument of make_unibyte_string.
6154
0bd8297f
EZ
6155 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6156 language ID in the event parameters.
6157
6158 * w32term.c (w32_read_socket): Put the new keyboard codepage into
6159 event.code, not the obscure "character set ID".
6160
63def6b6
CY
61612012-06-23 Chong Yidong <cyd@gnu.org>
6162
6163 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6164
e8a02204
EZ
61652012-06-23 Eli Zaretskii <eliz@gnu.org>
6166
388cdec0
EZ
6167 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6168 * w32.c (fdutimens): New function.
6169
6170 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6171
6172 * s/ms-w32.h (pselect): Redirect to sys_select.
6173
6174 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6175
e8a02204
EZ
6176 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6177 in the logic of incrementing and decrementing the value of
6178 use_relocatable_buffers.
6179
d054f3fb
PE
61802012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6181
6182 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6183 Privately reported by Herbert J. Skuhra.
6184 [__FreeBSD__]: Remove "*/" typo after "#include".
6185 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6186 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6187 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6188 Don't assume EMACS_TIME and struct timeval are the same type.
6189
d35af63c
PE
61902012-06-22 Paul Eggert <eggert@cs.ucla.edu>
6191
6192 Support higher-resolution time stamps (Bug#9000).
6193 The time stamps are only nanosecond-resolution at the C level,
6194 since that's the best that any real-world system supports now.
6195 But they are picosecond-resolution at the Lisp level, as that's
6196 easy, and leaves room for future OS improvements.
6197
6198 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6199 (LIBES): Use it.
6200
6201 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6202 Don't get current time unless it's needed.
6203
6204 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6205 now provides it if it's absent.
6206 (start_atimer): Port to higher-res time stamps.
6207 Check for time stamp overflow. Don't get current time more
6208 often than is needed.
6209
6210 * buffer.h (struct buffer): Buffer modtime now has high resolution.
6211 Include systime.h, not time.h.
6212 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
6213
6214 * dired.c: Include stat-time.h.
6215 (Ffile-attributes): File times now have higher resolution.
6216
6217 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
6218 (struct image): Timestamp now has higher resolution.
6219
6220 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
6221 has at least microseconds now. All uses removed.
6222 (update_frame, update_single_window, update_window, update_frame_1)
6223 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 6224 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
6225
6226 * editfns.c (time_overflow): Now extern.
6227 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
6228 (float-time, Fformat_time_string, Fcurrent_time_string)
6229 (Fcurrent_time_zone): Accept and generate higher-resolution
6230 time stamps.
6231 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
6232 (decode_time_components, lisp_seconds_argument): New functions.
6233 (make_time): Now static.
6234 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
6235 Report an error if the time is invalid, rather than having the caller
6236 do that.
6237
6238 * fileio.c: Include <stat-time.h>
6239 (Fcopy_file): Copy higher-resolution time stamps.
6240 Prefer to set the time stamp via a file descriptor if that works.
6241 (Fset_file_times, Finsert_file_contents, Fwrite_region)
6242 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
6243 (Fvisited_file_modtime, Fset_visited_file_modtime):
6244 Support higher-resolution time stamps.
6245
6246 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6247
6248 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6249
6250 * image.c (prepare_image_for_display, clear_image_cache)
6251 (lookup_image): Port to higer-resolution time stamps.
6252
6253 * keyboard.c (start_polling, bind_polling_period):
6254 Check for time stamp overflow.
6255 (read_char, kbd_buffer_get_event, timer_start_idle)
6256 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6257 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6258 Port to higher-resolution time stamps. Do not assume time_t is signed.
6259 (decode_timer): New function. Timers are now vectors of length 9,
6260 not 8, to accommodate the picosecond component.
6261 (timer_check_2): Use it.
6262
6263 * nsterm.m (select_timeout, timeval_subtract): Remove.
6264 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6265 as they're a bit more accurate and handle overflow better.
6266 (ns_select): Change prototype to be compatible with pselect.
6267 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6268 * nsterm.h (ns_select): Adjust prototype.
6269
6270 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6271 us-resolution time stamps.
6272 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6273
6274 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6275
6276 * lisp.h (time_overflow): New decl.
6277 (wait_reading_process_output): First arg is now intmax_t, not int,
6278 to accommodate larger waits.
6279
6280 * process.h (struct Lisp_Process.read_output_delay):
6281 Now counts nanoseconds, not microseconds.
6282 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6283 EMACS_HAS_USECS.
6284 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6285 (wait_reading_process_output):
6286 Port to ns-resolution time stamps.
6287 (Faccept_process_output, wait_reading_process_output):
6288 Check for time stamp overflow. Do not assume time_t is signed.
6289 (select_wrapper): Remove; we now use pselect.
6290 (Fprocess_attributes): Now generates ns-resolution time stamps.
6291
6292 * sysdep.c: Include utimens.h. Don't include utime.h
6293 or worry about struct utimbuf; gnulib does that for us now.
6294 (gettimeofday): Remove; gnulib provides a substitute.
6295 (make_timeval): New function.
6296 (set_file_times): Now sets ns-resolution time stamps.
6297 New arg FD; all uses changed.
6298 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6299 (system_process_attributes):
6300 Now returns ns-resolution time stamp. All uses changed.
6301 Check for time stamp overflow.
6302
6303 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6304 provides a substitute now.
6305
6306 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6307 since it guarantees struct timespec.
6308 (EMACS_TIME): Now struct timespec, so that we can support
6309 ns-resolution time stamps.
6310 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6311 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6312 (EMACS_USECS): Remove.
6313 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6314 so multiply the arg by 1000 before storing it.
6315 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6316 New macros.
6317 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6318 Port to ns-resolution time stamps.
6319 (EMACS_TIME_NEG_P): Remove; replaced by....
6320 (EMACS_TIME_SIGN): New macro.
6321 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6322 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6323 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6324 (make_timeval, make_lisp_time, decode_time_components): New decls.
6325 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6326 that it mishandled time_t overflow. You can't compare by subtracting!
6327 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6328 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6329
6330 * term.c: Include <sys/time.h>.
6331 (timeval_to_Time): New function, for proper overflow wraparound.
6332 (term_mouse_position, term_mouse_click): Use it.
6333
6334 * undo.c (record_first_change): Support higher-resolution time stamps
6335 in the undo buffer.
6336 (Fprimitive_undo): Use them when restoring time stamps.
6337
6338 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6339 (w32_get_internal_run_time):
6340 Port to higher-resolution Emacs time stamps.
6341 (ltime): Now accepts single 64-bit integer, as that's more convenient
6342 for callers.
6343
6344 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6345
6346 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6347 for compatibility with pselect. Support ns-resolution time stamps.
6348
6349 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6350
6351 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6352 Check for time stamp overflow, and support ns-resolution time stamps.
6353
6354 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6355 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6356 (timeval_subtract): Remove; no longer needed.
6357 (XTflash, XTring_bell, x_wait_for_event):
6358 Port to ns-resolution time stamps. Don't assume time_t is signed.
6359
b6a92dfe
CY
63602012-06-22 Chong Yidong <cyd@gnu.org>
6361
6362 * xdisp.c (x_consider_frame_title): Revert last change.
6363
d251c37c
EZ
63642012-06-22 Eli Zaretskii <eliz@gnu.org>
6365
6366 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6367 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6368 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6369 staticidx goes up to 1597 out of 1600 = 0x640.)
6370
f10deafb
PE
63712012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6372
6373 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6374 Otherwise, the umask might be mistakenly 0 while handling input signals.
6375
ec6de1e2
SM
63762012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6377
6378 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6379
28be1ada
DA
63802012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6381
6382 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6383 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6384 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6385 access to `contents' member of Lisp_Vector objects with AREF and ASET
6386 where appropriate.
6387
c6bf3022
CY
63882012-06-19 Chong Yidong <cyd@gnu.org>
6389
6390 * frame.c (delete_frame): When selecting a frame on a different
6391 text terminal, do not alter the terminal's top-frame.
6392
6393 * xdisp.c (format_mode_line_unwind_data): Record the target
6394 frame's selected window and its terminal's top-frame.
6395 (unwind_format_mode_line): Restore them.
6396 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6397 Callers changed.
6398 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6399 since tty frames can be explicitly named.
6400 (prepare_menu_bars): Likewise.
6401
6402 * term.c (Ftty_top_frame): New function.
6403
defd4196
PE
64042012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6405
6406 Port byte-code-meter to modern targets.
6407 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6408 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 6409 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
6410 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6411 (METER_1, METER_2): Simplify.
6412
1053a871
SM
64132012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6414
6415 * data.c (Fdefalias): Return `symbol' (bug#11686).
6416
b7e8d081
MR
64172012-06-18 Martin Rudalics <rudalics@gmx.at>
6418
6419 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
6420 gets killed during executing of this function (Bug#11665).
6421 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
6422 (Vkill_buffer_query_functions): In doc-string say that functions
6423 run by this hook should not change the current buffer.
6424
7ea2b339
PE
64252012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6426
6427 Fix recently-introduced process.c problems found by static checking.
6428 * process.c (write_queue_push, write_queue_pop, send_process):
6429 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6430 (write_queue_pop): Fix pointer signedness problem.
6431 (send_process): Remove unused local.
6432
96a313a1
CY
64332012-06-17 Chong Yidong <cyd@gnu.org>
6434
6435 * xdisp.c (redisplay_internal): No need to redisplay terminal
6436 frames that are not on top.
6437
20ca2e94
TN
64382012-06-17 Troels Nielsen <bn.troels@gmail.com>
6439
6440 * process.c (make_process): Initialize write_queue.
6441 (write_queue_push, write_queue_pop): New functions.
6442 (send_process): Use them to maintain correct ordering of process
6443 writes (Bug#10815).
6444
9a900ca9
PE
64452012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6446
310fbfa8
PE
6447 * lisp.h (eassert): Assume C89 or later.
6448 This removes the need for CHECK.
6449 (CHECK): Remove. Its comments about always evaluating its
6450 argument were confusing, as 'eassert' typically does not evaluate
6451 its argument.
6452
27bb1ca4
PE
6453 * coding.c (produce_chars): Use ptrdiff_t, not int.
6454
9a900ca9
PE
6455 * xterm.c (x_draw_underwave): Check for integer overflow.
6456 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6457
41b7f8bc 64582012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
6459
6460 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6461 referenced (Bug#11583).
6462
9b0e3eba
AA
64632012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6464
6465 Implement wave-style variant of underlining.
6466 * dispextern.h (face_underline_type): New enum.
6467 (face): Add field for underline type.
6468 * nsterm.m (ns_draw_underwave): New function.
6469 (ns_draw_text_decoration): Use it.
6470 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6471 New functions.
6472 (x_draw_glyph_string): Use them.
6473 * xfaces.c (Qline, Qwave): New Lisp objects.
6474 (check_lface_attrs, merge_face_ref)
1053a871
SM
6475 (Finternal_set_lisp_face_attribute, realize_x_face):
6476 Handle wave-style underline face attributes.
9b0e3eba
AA
6477 * xterm.c (x_draw_underwave): New function.
6478 (x_draw_glyph_string): Use it.
6479
0fb52f11
JB
64802012-06-16 Juanma Barranquero <lekktu@gmail.com>
6481
6482 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6483 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6484 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6485 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6486 ($(BLD)/w32select.$(O)): Update dependencies.
6487
e5560ff7
AS
64882012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6489
6490 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6491 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6492 * character.c (_fetch_multibyte_char_p): Remove.
6493 * alloc.c: Include "character.h" before "buffer.h".
6494 * bidi.c: Likewise.
6495 * buffer.c: Likewise.
6496 * bytecode.c: Likewise.
6497 * callint.c: Likewise.
6498 * callproc.c: Likewise.
6499 * casefiddle.c: Likewise.
6500 * casetab.c: Likewise.
6501 * category.c: Likewise.
6502 * cmds.c: Likewise.
6503 * coding.c: Likewise.
6504 * composite.c: Likewise.
6505 * dired.c: Likewise.
6506 * dispnew.c: Likewise.
6507 * doc.c: Likewise.
6508 * dosfns.c: Likewise.
6509 * editfns.c: Likewise.
6510 * emacs.c: Likewise.
6511 * fileio.c: Likewise.
6512 * filelock.c: Likewise.
6513 * font.c: Likewise.
6514 * fontset.c: Likewise.
6515 * fringe.c: Likewise.
6516 * indent.c: Likewise.
6517 * insdel.c: Likewise.
6518 * intervals.c: Likewise.
6519 * keyboard.c: Likewise.
6520 * keymap.c: Likewise.
6521 * lread.c: Likewise.
6522 * macros.c: Likewise.
6523 * marker.c: Likewise.
6524 * minibuf.c: Likewise.
6525 * nsfns.m: Likewise.
6526 * nsmenu.m: Likewise.
6527 * print.c: Likewise.
6528 * process.c: Likewise.
6529 * regex.c: Likewise.
6530 * region-cache.c: Likewise.
6531 * search.c: Likewise.
6532 * syntax.c: Likewise.
6533 * term.c: Likewise.
6534 * textprop.c: Likewise.
6535 * undo.c: Likewise.
6536 * unexsol.c: Likewise.
6537 * w16select.c: Likewise.
6538 * w32fns.c: Likewise.
6539 * w32menu.c: Likewise.
6540 * window.c: Likewise.
6541 * xdisp.c: Likewise.
6542 * xfns.c: Likewise.
6543 * xmenu.c: Likewise.
6544 * xml.c: Likewise.
6545 * xselect.c: Likewise.
6546
2f07e6af
EZ
65472012-06-16 Eli Zaretskii <eliz@gnu.org>
6548
1053a871
SM
6549 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6550 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 6551 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
6552 row.
6553 (handle_face_prop): Use chunk-relative overlay string index when
6554 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
6555 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6556 the rightmost. (Bug#11720)
2f07e6af 6557
29b83cec
AS
65582012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6559
6560 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6561 (CATEGORY_MEMBER): Enforce 1/0 value.
6562 * category.c (_temp_category_set): Remove.
6563
4c5501e9
EZ
65642012-06-16 Eli Zaretskii <eliz@gnu.org>
6565
6566 * window.c (Fdelete_other_windows_internal)
6567 (Fdelete_window_internal): Don't access frame's mouse highlight
6568 info of the initial frame. (Bug#11677)
6569
2b570124
PE
65702012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6571
e93864f9
PE
6572 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6573 Assume USE_2_TAGS_FOR_INTS.
6574 (xreload): Adjust $tagmask width to match recent lisp.h change.
6575
2b570124
PE
6576 Simplify lisp.h in minor ways that should not affect code.
6577 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6578 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6579 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6580 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6581 (INTTYPEBITS): New macro, for clarity.
6582 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
6583 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6584 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
6585 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6586 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6587
81755f69
JB
65882012-06-13 Juanma Barranquero <lekktu@gmail.com>
6589
6590 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6591
16192a57
GM
65922012-06-13 Glenn Morris <rgm@gnu.org>
6593
6594 * s/bsd-common.h (BSD4_3):
6595 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6596
646b5f55
AS
65972012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6598
6599 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6600 instead of union.
6601 (XLI, XIL): Define.
1053a871
SM
6602 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6603 Use them.
6604 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 6605 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 6606 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
6607 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6608 * frame.c (delete_frame): Remove outdated comment.
6609 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6610 USE_LISP_UNION_TYPE.
6611 (Fw32_unregister_hot_key): Likewise.
6612 (Fw32_toggle_lock_key): Likewise.
6613 * w32menu.c (add_menu_item): Likewise.
6614 (w32_menu_display_help): Use XIL instead of checking
6615 USE_LISP_UNION_TYPE.
6616 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6617 (init_heap): Likewise.
6618 * w32term.c (w32_read_socket): Update comment.
6619
1d3823c9
GM
66202012-06-13 Glenn Morris <rgm@gnu.org>
6621
c62ff706
GM
6622 * s/usg5-4-common.h, src/s/unixware.h:
6623 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6624
1d3823c9
GM
6625 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6626
bfe3e0a2
PE
66272012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6628
6629 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6630 * alloc.c (make_number) [!defined make_number]:
6631 Remove, as lisp.h always defines this now.
6632 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6633 (roundup_size): Verify that it is a power of 2.
6634 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6635 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6636 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6637 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6638 USE_LSB_TAG now is always defined to be either 0 or 1.
6639 All uses changed.
6640 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6641 code works fine either way, and efficiency is not a concern here,
6642 as the union type is for debugging, not for production.
6643 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6644 Use an inline function on all platforms when using the union type,
6645 since this is simpler and 'static inline' can be used portably
6646 within Emacs now.
6647 (LISP_INITIALLY_ZERO): New macro.
6648 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6649 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6650
45fa9c0f
GM
66512012-06-12 Glenn Morris <rgm@gnu.org>
6652
b4492cba
GM
6653 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6654
6655 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 6656
45fa9c0f
GM
6657 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6658 Move BROKEN_SIGIO to configure.
6659
6660 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6661 Move NO_TERMIO to configure.
6662
0e25d334
CY
66632012-06-12 Chong Yidong <cyd@gnu.org>
6664
6665 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6666 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6667 MagickExportImagePixels is undefined.
6668
43682bb6
PE
66692012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6670
6671 * image.c (imagemagick_load_image): Remove unused label.
6672
a9be7d2b
GM
66732012-06-11 Glenn Morris <rgm@gnu.org>
6674
6675 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6676 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6677 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6678 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6679
3017f87f
SM
66802012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6681
6682 * alloc.c (make_byte_code): New function.
6683 (Fmake_byte_code): Use it. Don't purify here.
6684 * lread.c (read1): Use it as well to avoid extra allocation.
6685
1b9b4cf4
CY
66862012-06-11 Chong Yidong <cyd@gnu.org>
6687
6688 * image.c (imagemagick_load_image): Implement transparency.
6689
95988fcf
AS
66902012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6691
6692 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6693 account for preceding backslashes. (Bug#11663)
6694
cd4eb164
CY
66952012-06-09 Chong Yidong <cyd@gnu.org>
6696
6697 * term.c: Support italics in capable terminals (Bug#9652).
6698 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6699 (turn_on_face): Output using TS_enter_italic_mode if available.
6700 Don't handle unused blinking and alt-charset cases.
6701 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6702 and tty_alt_charset_p cases.
6703 (tty_capable_p, init_tty): Support italics.
6704
6705 * termchar.h (struct tty_display_info): Add field for italics.
6706 Remove unused blink field.
6707
6708 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6709 Handle slant.
6710
6711 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6712 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6713 tty_alt_charset_p. Add tty_italic_p.
6714
ff88beb8
MA
67152012-06-09 Michael Albinus <michael.albinus@gmx.de>
6716
6717 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6718 dbus_type_is_basic if available.
6719 (xd_extract_signed, xd_extract_unsigned): Rename from
6720 extract_signed and extract_unsigned, respectively. Adapt callers.
6721
44286096
CY
67222012-06-09 Chong Yidong <cyd@gnu.org>
6723
1682701f
CY
6724 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6725
44286096
CY
6726 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6727 case (Bug#9752).
6728
d86feb17
PE
67292012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6730
6731 * xdisp.c (vmessage): Treat frame message as multibyte.
6732 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6733 would generate the diagnostic "Making \302\247 buffer-local while
6734 let-bound!".
6735
d5c20fe8
EZ
67362012-06-08 Eli Zaretskii <eliz@gnu.org>
6737
6738 * dispnew.c (showing_window_margins_p): Undo last change, which
6739 was done due to an inadvertent commit.
6740 (adjust_frame_glyphs_for_frame_redisplay): Do call
6741 showing_window_margins_p.
6742
513749ee
SM
67432012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6744
6745 * eval.c (Fmake_var_non_special): New primitive.
6746 (syms_of_eval): Defsubr it.
6747 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6748
d4a8f5c1
JB
67492012-06-08 Juanma Barranquero <lekktu@gmail.com>
6750
6751 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6752 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6753
8bbbc977
EZ
67542012-06-08 Eli Zaretskii <eliz@gnu.org>
6755
6756 * alloc.c (allocate_vectorlike): Fix last change.
6757
f3372c87
DA
67582012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6759
6760 Block-based vector allocation of small vectors.
6761 * lisp.h (struct vectorlike_header): New field `nbytes',
6762 adjust comment accordingly.
6763 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 6764 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
6765 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6766 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6767 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6768 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6769 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6770 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6771 (roundup_size): New constant.
6772 (struct vector_block): New data type.
6773 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 6774 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
6775 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6776 (sweep_vectors): New functions.
6777 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 6778 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
6779 or equal to VBLOCK_BYTES_MAX.
6780 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6781 (init_alloc_once): Add call to init_vectors.
6782
4f18a4ed
SM
67832012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6784
6785 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6786
86f158bc
PE
67872012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6788
6789 * doprnt.c (doprnt): Truncate multibyte char correctly.
6790 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6791 would mishandle a string argument "Xc" if X was a multibyte
6792 character of length 2: it would truncate after X's first byte
6793 rather than including all of X.
6794
c5cfcbe0
CY
67952012-06-06 Chong Yidong <cyd@gnu.org>
6796
6797 * buffer.c (word_wrap): Doc fix.
6798
c05cf390
PE
67992012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6800
6801 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6802
0c3461de
GM
68032012-06-03 Glenn Morris <rgm@gnu.org>
6804
6805 * xdisp.c (tool-bar-style): Doc fix.
6806
c71232db
UM
68072012-06-03 Ulrich Müller <ulm@gentoo.org>
6808
6809 * Makefile.in (PAXCTL): Define.
6810 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6811 binary via PaX flags if the paxctl utility is available.
6812 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6813 Restore PaX flags to their default. (Bug#11398)
6814
383f7350
CY
68152012-06-03 Chong Yidong <cyd@gnu.org>
6816
6817 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6818 buffer (Bug#11226).
6819
5f2c76c6
CY
68202012-06-03 Chong Yidong <cyd@gnu.org>
6821
6822 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6823 (note_mode_line_or_margin_highlight): If there is no help echo,
6824 use mode-line-default-help-echo. Handle the case where the mouse
6825 position is past the end of the mode line string.
6826
6827 * buffer.c (buffer_local_value_1): New function, split from
6828 Fbuffer_local_value; can return Qunbound.
6829 (Fbuffer_local_value): Use it.
6830 (Vmode_line_format): Docstring tweaks.
6831
773d47f6
PE
68322012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6833
6834 * sysdep.c (system_process_attributes): Improve comment.
6835
f2d6a3df
SM
68362012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6837
6838 * keyboard.c: Export real-this-command to Elisp.
6839 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6840 and DEFVAR it. Update all users.
6841
63810350
PE
68422012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6843
7bd5c1f4
PE
6844 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6845
63810350
PE
6846 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6847 Convert pctcpu and pctmem to Lisp float properly.
6848 Let the compiler fold better, as 100.0/0x8000 is exact.
6849
a2821611
AS
68502012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6851
6852 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6853 cons_block.
6854
5fceba1d
PE
68552012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6856
6857 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6858
c98ff5dd
DA
68592012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6860
6861 For a 'struct window', replace some Lisp_Object fields to
6862 bitfields where appropriate, remove unused fields.
6863 * window.h (struct window): Remove unused 'last_mark_x' and
6864 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6865 change it's type from Lisp_Object to bitfield.
6866 Change type of 'force_start', 'optional_new_start',
6867 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 6868 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 6869
ca34e0be
PE
68702012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6871
6872 Pacify gcc -Wdouble-precision when using Xaw.
6873 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6874 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6875 Use 'float' consistently, rather than 'float' in most places
6876 and 'double' in a couple of places.
6877
efc00ab1 68782012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
6879
6880 * xdisp.c (handle_stop): Detect whether we have overlay strings
6881 loaded by testing it->current.overlay_string_index to be
6882 non-negative, instead of checking whether n_overlay_strings is
6883 positive. (Bug#11587)
6884
efc00ab1 68852012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
6886
6887 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6888
6889 * doc.c (Fsubstitute_command_keys): Doc fix.
6890
efc00ab1 68912012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
6892
6893 * search.c (search_buffer): Remove calls to
6894 r_alloc_inhibit_buffer_relocation, as it is now called by
6895 maybe_unify_char, which was the cause of relocation of buffer text
6896 in bug#11519.
6897
efc00ab1 68982012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
6899
6900 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6901 for the duration of call to load_charset, to avoid problems with
6902 callers of maybe_unify_char that access buffer text through C
6903 pointers.
6904
6905 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6906 decrement the inhibition flag, instead of just setting or
6907 resetting it.
6908
ba93a187
PE
69092012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6910
6911 Remove obsolete '#define static' cruft.
6912 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6913 This #undef was "temporary" in 2000; it is no longer needed
6914 now that '#define static' has gone away.
6915 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6916 (gray_bitmap_bits): Remove; no longer needed.
6917 All uses replaced with definiens.
6918 * xterm.c: Include "bitmaps/gray.xbm".
6919
9e4bf381
PE
69202012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6921
6922 Clean up __executable_start, monstartup when --enable-profiling.
6923 The following changes affect the code only when profiling.
6924 * dispnew.c (__executable_start): Rename from safe_bcopy.
6925 Define only on platforms that need it.
6926 * emacs.c: Include <sys/gmon.h> when profiling.
6927 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6928 (__executable_start): Remove decl, since lisp.h does it now.
6929 (safe_bcopy): Remove decl; no longer has that name.
6930 (main): Coalesce #if into single bit of code, for simplicity.
6931 Cast pointers to uintptr_t, since standard libraries want integers
6932 and not pointers.
6933 * lisp.h (__executable_start): New decl.
6934
32d72c2f
GM
69352012-05-31 Glenn Morris <rgm@gnu.org>
6936
6937 * image.c (Fimagemagick_types): Doc fix.
6938
baac5bc7
JM
69392012-05-30 Jim Meyering <meyering@redhat.com>
6940
6941 * callproc.c (Fcall_process_region): Include directory component
6942 in mkstemp error message (Bug#11586).
6943
72cb32cf
PE
69442012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6945
6946 * alloc.c, lisp.h (make_pure_vector): Now static.
6947
61b108cc
SM
69482012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6949
6950 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6951 Move to byte-run.el.
6952 (Fautoload): Do the hash-doc more carefully.
6953 * data.c (Fdefalias): Purify definition, except for keymaps.
6954 (Qdefun): Move from eval.c.
6955 * lisp.h (Qdefun): Remove.
6956 * lread.c (read1): Tiny simplification.
6957
471fe23d
TN
69582012-05-29 Troels Nielsen <bn.troels@gmail.com>
6959
934f3f58 6960 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
6961 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6962 Bug#9642, but explicitly check that the buffer the overlay would
6963 be moved to is live and rearrange lines to make sure that errors
6964 will not put the overlay in an inconsistent state.
6965 (Fdelete_overlay): Cosmetics.
6966
85d0efd1
EZ
69672012-05-28 Eli Zaretskii <eliz@gnu.org>
6968
6969 * w32term.c (my_bring_window_to_top): New function.
6970 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
6971 could be different from the original one.
6972 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
6973 (Bug#11513)
6974
6975 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6976 by calling BringWindowToTop.
6977
6978 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6979 (WM_EMACS_END): Increase by one.
6980
da92a98c
PE
69812012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6982
6983 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6984 This avoids undefined behavior that might cause the eassert
6985 to not catch an out-of-range value.
6986
74d1f848
JB
69872012-05-28 Juanma Barranquero <lekktu@gmail.com>
6988
6989 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6990 Update dependencies.
6991
9e1a06fc
EZ
69922012-05-27 Eli Zaretskii <eliz@gnu.org>
6993
6994 * bidi.c (bidi_mirror_char): Fix last change.
6995
f3dd7312
AS
69962012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6997
6998 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6999 when referring to sectname field in printf format.
7000
81899c91
PE
70012012-05-27 Paul Eggert <eggert@cs.ucla.edu>
7002
57b81a9f
PE
7003 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7004 Only r_alloc_inhibit_buffer_relocation needed to be added;
7005 the others were already declared.
7006
81899c91
PE
7007 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7008 before checking whether it's out of range. Put the check inside
7009 eassert. See
7010 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7011
33017faf 70122012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
7013
7014 * callproc.c (Fcall_process): Restore a line that was accidentally
7015 commented out in the 2011-02-13 change (bug#11547).
7016
33017faf 70172012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
7018
7019 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7020 defined on ralloc.c.
7021
7022 * buffer.c [REL_ALLOC]: Remove prototypes of
7023 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7024 they are now on lisp.h.
7025
7026 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7027
7028 * search.c (search_buffer): Use it to inhibit relocation of buffer
7029 text while re_search_2 is doing its job, because re_search_2 is
7030 passed C pointers to buffer text. (Bug#11519)
7031
23415acf
EZ
7032 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7033 Update value to 24.
7034
44e27368
EZ
7035 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7036 state after an additional call to move_it_in_display_line_to, keep
7037 the values of it->max_ascent and it->max_descent found for the
7038 entire line.
7039 (pos_visible_p): Revert the comparison against bottom_y to what it
7040 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7041 (Bug#11464)
7042
c1892f11
PE
70432012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7044
7045 Fix coding-related core dumps with gcc -ftrapv.
7046 The code was computing A - B, where A and B are pointers, and B is
7047 random garbage. This can lead to core dumps on platforms that
7048 have special pointer registers, and it also leads to core dumps on
7049 x86-64 when compiled with gcc -ftrapv. The fix is to compute
7050 A - B only when B is initialized properly.
7051 * coding.c (coding_set_source, coding_set_destination): Return void.
7052 (coding_change_source, coding_change_destinations): New functions,
7053 with the old behaviors of coding_set_source and coding_set_destination.
7054 All callers that need an offset changed to use these new functions.
7055
eb7afdad
GM
70562012-05-26 Glenn Morris <rgm@gnu.org>
7057
7058 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
7059
f12fdf02
EZ
70602012-05-26 Eli Zaretskii <eliz@gnu.org>
7061
53a63be6 7062 Extend mouse support on W32 text-mode console.
61b108cc
SM
7063 * xdisp.c (draw_row_with_mouse_face):
7064 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 7065
eb3f6f01 7066 * w32console.c: Include window.h.
61b108cc
SM
7067 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
7068 New functions.
eb3f6f01
EZ
7069 (initialize_w32_display): Initialize mouse-highlight data.
7070
53a63be6
EZ
7071 * w32inevt.c: Include termchar.h and window.h.
7072 (do_mouse_event): Support mouse-autoselect-window. When the mouse
7073 moves, call note_mouse_highlight. If help_echo changed, call
7074 gen_help_event to produce help-echo message in the echo area.
7075 Call clear_mouse_face if mouse_face_hidden is set in the mouse
7076 highlight info.
7077
4cfd81f6
PE
70782012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7079
7080 * lread.c (read1): Simplify slightly to avoid an overflow warning
7081 with GCC 4.7.0 on x86-64.
7082
4446092a
EZ
70832012-05-26 Eli Zaretskii <eliz@gnu.org>
7084
7085 * bidi.c (bidi_mirror_char): Revert last change: an int is
7086 definitely wide enough here.
7087
42b2a986 70882012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 7089
42b2a986 7090 Fix integer width and related bugs (Bug#9874).
eb106a49 7091 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
7092 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
7093 (string_bytes, check_sblock, allocate_string_data):
7094 (compact_small_strings, Fmake_bool_vector, make_string)
7095 (make_unibyte_string, make_multibyte_string)
7096 (make_string_from_bytes, make_specified_string)
7097 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
7098 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
7099 (mark_vectorlike):
7100 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7101 (allocate_pseudovector):
7102 Use int, not EMACS_INT, where int is wide enough.
7103 (inhibit_garbage_collection, Fgarbage_collect):
7104 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7105 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
7106 int might not be wide enough.
7107 (bidi_cache_search, bidi_cache_find, bidi_init_it)
7108 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
7109 (bidi_at_paragraph_end, bidi_find_paragraph_start)
7110 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7111 (bidi_level_of_next_char, bidi_move_to_visually_next):
7112 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7113 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
7114 (Fkill_buffer, Fset_buffer_major_mode)
7115 (advance_to_char_boundary, Fbuffer_swap_text)
7116 (Fset_buffer_multibyte, overlays_at, overlays_in)
7117 (overlay_touches_p, struct sortvec, record_overlay_string)
7118 (overlay_strings, recenter_overlay_lists)
7119 (adjust_overlays_for_insert, adjust_overlays_for_delete)
7120 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
7121 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
7122 (Foverlay_recenter, last_overlay_modification_hooks_used)
7123 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7124 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
7125 (validate_region): Omit unnecessary test for b <= e,
7126 since that's guaranteed by the previous test.
d311d28c
PE
7127 (adjust_overlays_for_delete): Avoid pos + length overflow.
7128 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7129 (report_overlay_modification):
7130 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7131 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7132 Omit pointer cast, which isn't needed anyway, and doesn't work
7133 after the EMACS_INT -> ptrdiff_t change.
02481186 7134 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
7135 * buffer.h: Adjust decls to match defn changes elsewhere.
7136 (struct buffer_text, struct buffer):
7137 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7138 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
7139 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7140 not int, to avoid needless 32-bit limit on 64-bit hosts.
7141 (exec_byte_code): Use tighter memory-full test, one that checks
7142 for alloca overflow. Don't compute the address of the object just
7143 before an array, as that's not portable. Use EMACS_INT, not
7144 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
7145 * callint.c (Fcall_interactively):
7146 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7147 * callproc.c (call_process_kill, Fcall_process):
7148 Don't assume pid_t fits into an Emacs fixnum.
7149 (call_process_cleanup, Fcall_process, child_setup):
7150 Don't assume pid_t fits into int.
7151 (call_process_cleanup, Fcall_process, delete_temp_file)
7152 (Fcall_process_region):
7153 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7154 (Fcall_process): Simplify handling of volatile integers.
7155 Use int, not EMACS_INT, where int will do.
7156 * casefiddle.c (casify_object, casify_region, operate_on_word)
7157 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7158 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7159 (casify_object): Avoid integer overflow when overallocating buffer.
7160 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 7161 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
7162 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7163 * category.h (CATEGORYP): Don't assume arg is nonnegative.
7164 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7165 integers are now checked earlier. All uses replaced with XINT.
7166 (ccl_driver):
7167 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7168 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
7169 (ccl_driver, Fregister_code_conversion_map):
7170 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
7171 (resolve_symbol_ccl_program): Check that vector header is in range.
7172 Always copy the vector, so that we can check its contents reliably
7173 now rather than having to recheck each instruction as it's being
7174 executed. Check that vector words fit in 'int'.
7175 (ccl_get_compiled_code, Fregister_ccl_program)
7176 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7177 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7178 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7179 contents are in range.
7180 (Fccl_execute_on_string): Check that status is in range.
7181 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7182 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7183 Accept and return EMACS_INT, not int, because callers can pass values
7184 out of 'int' range.
7185 (c_string_width, strwidth, lisp_string_width, chars_in_text)
7186 (multibyte_chars_in_text, parse_str_as_multibyte)
7187 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7188 (str_as_unibyte, str_to_unibyte, string_count_byte8)
7189 (string_escape_byte8, Fget_byte):
7190 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 7191 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
7192 avoid mishandling large integers.
7193 * character.h: Adjust decls to match defn changes elsewhere.
7194 * charset.c (load_charset_map_from_file, find_charsets_in_text)
7195 (Ffind_charset_region):
7196 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7197 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7198 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 7199 Don't assume fixnum fits in int.
d311d28c
PE
7200 (load_charset_map_from_vector, Fmap_charset_chars):
7201 Remove now-unnecessary CHECK_NATNUMs.
7202 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
7203 Don't rely on undefined behavior with signed left shift overflow.
7204 Don't assume unsigned int fits into fixnum, or that fixnum fits
7205 into unsigned int. Don't require max_code to be a valid fixnum;
7206 that's not true for gb10830 4-byte on a 32-bit host. Allow
7207 invalid_code to be a cons, for the same reason. Require code_offset
7208 to be a character. Avoid int overflow if max_char is close
7209 to INT_MAX.
7210 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7211 this is intended anyway and avoids some undefined behavior.
7212 (load_charset_map): Pass unsigned, not int, as 2nd arg of
7213 INDEX_TO_CODE_POINT, as that's what it expects.
7214 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
7215 * charset.h (DECODE_CHAR): Return int, not unsigned;
7216 this is what was intended anyway, and it avoids undefined behavior.
7217 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
7218 integer-overflow issues.
7219 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
7220 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
7221 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
7222 * chartab.c (Fmake_char_table, Fset_char_table_range)
7223 (uniprop_get_decoder, uniprop_get_encoder):
7224 Don't assume fixnum fits in int.
7225 * cmds.c (move_point): New function, that does the gist of
7226 Fforward_char and Fbackward_char, but does so while checking
7227 for integer overflow more accurately.
c96e5d6a 7228 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
7229 (Fforward_line, Fend_of_line, internal_self_insert)
7230 (internal_self_insert):
7231 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7232 Fix a FIXME, by checking for integer overflow when calculating
7233 target_clm and actual_clm.
7234 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 7235 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
7236 (ASSURE_DESTINATION, coding_alloc_by_realloc)
7237 (coding_alloc_by_making_gap, alloc_destination)
7238 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
7239 (encode_coding_utf_16, detect_coding_emacs_mule)
7240 (decode_coding_emacs_mule, encode_coding_emacs_mule)
7241 (detect_coding_iso_2022, decode_coding_iso_2022)
7242 (encode_invocation_designation, encode_designation_at_bol)
7243 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7244 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7245 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7246 (encode_coding_ccl, encode_coding_raw_text)
7247 (detect_coding_charset, decode_coding_charset)
7248 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7249 (produce_composition, produce_charset, produce_annotation)
7250 (decode_coding, handle_composition_annotation)
7251 (handle_charset_annotation, consume_chars, decode_coding_gap)
7252 (decode_coding_object, encode_coding_object, detect_coding_system)
7253 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7254 (code_convert_region, code_convert_string)
8f50130c
PE
7255 (Fdefine_coding_system_internal)
7256 (coding_set_source, coding_set_destination):
d311d28c
PE
7257 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7258 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7259 (Fdefine_coding_system_internal):
7260 Don't assume fixnums fit in int.
7261 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 7262 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
7263 (Funencodable_char_position, Fcheck_coding_systems_region)
7264 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 7265 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 7266 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 7267 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 7268 Don't access memory outside of the args array.
d311d28c 7269 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
7270 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7271 result of ENCODE_CHAR.
d311d28c
PE
7272 * coding.h: Adjust decls to match defn changes elsewhere.
7273 (struct coding_system):
7274 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7275 * composite.c (get_composition_id, find_composition)
7276 (run_composition_function, update_compositions)
7277 (compose_text, composition_gstring_put_cache)
7278 (composition_gstring_p, composition_gstring_width)
7279 (fill_gstring_header, fill_gstring_body, autocmp_chars)
7280 (composition_compute_stop_pos, composition_reseat_it)
7281 (composition_update_it, struct position_record)
7282 (find_automatic_composition, composition_adjust_point)
7283 (Fcomposition_get_gstring, Ffind_composition_internal):
7284 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7285 (update_compositions):
7286 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7287 * composite.h: Adjust decls to match defn changes elsewhere.
7288 (struct composition):
7289 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7290 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7291 Do not attempt to compute the address of the object just before a
7292 buffer; this is not portable.
7293 (Faref, Faset):
7294 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7295 (Faset): Use int, not EMACS_INT, where int is wide enough.
7296 (Fstring_to_number): Don't assume fixnums fit in int.
7297 (Frem): Don't assume arg is nonnegative.
7298 * dbusbind.c (xd_append_arg): Check for integers out of range.
7299 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 7300 (extract_signed, extract_unsigned): New functions.
243e0530
PE
7301 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7302 (xd_get_connection_references): Return ptrdiff_t, not int.
7303 All uses changed.
7304 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7305 (xd_read_message_1):
7306 Use int, not unsigned, where the dbus API uses int.
7307 (Fdbus_message_internal): Don't overflow mtype.
7308 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
7309 * dired.c (directory_files_internal, file_name_completion, scmp)
7310 (file_name_completion_stat):
7311 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7312 (file_name_completion): Don't overflow matchcount.
7313 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7314 * dispextern.h: Adjust decls to match defn changes elsewhere.
7315 (struct text_pos, struct glyph, struct bidi_saved_info)
7316 (struct bidi_string_data, struct bidi_it, struct composition_it)
7317 (struct it):
7318 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7319 (struct display_pos, struct composition_it, struct it):
7320 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7321 * dispnew.c (increment_matrix_positions)
7322 (increment_row_positions, mode_line_string)
7323 (marginal_area_string):
7324 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 7325 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
7326 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7327 (duration_to_sec_usec): New function, to check for overflow better.
7328 (Fsleep_for, sit_for): Use it.
7329 * doc.c (get_doc_string, store_function_docstring):
7330 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7331 (get_doc_string, Fsnarf_documentation):
7332 Use int, not EMACS_INT, where int is wide enough.
7333 (get_doc_string):
7334 Use SAFE_ALLOCA, not alloca.
7335 Check for overflow when converting EMACS_INT to off_t.
7336 * doprnt.c (doprnt):
7337 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7338 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7339 Don't assume uid_t fits into fixnum.
7340 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7341 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7342 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7343 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7344 (general_insert_function)
7345 (Finsert_char, make_buffer_string, make_buffer_string_both)
7346 (update_buffer_properties, Fbuffer_substring)
7347 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7348 (Fsubst_char_in_region, check_translation)
7349 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7350 (transpose_markers, Ftranspose_regions):
7351 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7352 (clip_to_bounds): Move to lisp.h as an inline function).
7353 (Fconstrain_to_field): Don't assume integers are nonnegative.
7354 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7355 (Fsubst_char_in_region, Fsave_restriction):
7356 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7357 (Femacs_pid): Don't assume pid_t fits into fixnum.
7358 (lo_time): Use int, not EMACS_INT, when int suffices.
7359 (lisp_time_argument): Check for usec out of range.
7360 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
7361 (Fuser_login_name, Fuser_full_name): Signal an error
7362 if a uid argument is out of range, rather than relying on
7363 undefined behavior.
c8d5c857
PE
7364 (Fformat_time_string): Remove now-unnecessary check.
7365 lisp_time_argument checks for out-of-range usec now.
243e0530 7366 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
7367 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7368 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7369 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7370 (init_cmdargs, Fdump_emacs):
7371 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7372 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7373 the bottom (typically) 32 bits of the fixnum.
7374 * eval.c (specpdl_size, call_debugger):
7375 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7376 (when_entered_debugger, Fbacktrace_debug):
7377 Don't assume fixnum can fit in int.
7378 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7379 the object just before a buffer; this is not portable.
7380 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7381 (grow_specpdl, unbind_to):
7382 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7383 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7384 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 7385 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
7386 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7387 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7388 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7389 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7390 (a_write, e_write):
7391 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7392 (Fcopy_file, non_regular_nbytes, read_non_regular)
7393 (Finsert_file_contents):
7394 Use int, not EMACS_INT, where int is wide enough.
7395 (READ_BUF_SIZE): Verify that it fits in int.
7396 (Finsert_file_contents): Check that counts are in proper range,
7397 rather than assuming fixnums fit into ptrdiff_t etc.
7398 Don't assume fixnums fit into int.
125b3835 7399 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
7400 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7401 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
7402 (string_char_to_byte, string_byte_to_char)
7403 (string_make_multibyte, string_to_multibyte)
7404 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7405 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7406 (substring_both, Fdelete, internal_equal, Ffillarray)
7407 (Fclear_string, mapcar1)
7408 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7409 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7410 (larger_vector, make_hash_table, maybe_resize_hash_table)
7411 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7412 (Fmaphash, secure_hash):
7413 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7414 (concat): Check for string index and length overflow.
7415 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7416 (Frequire):
7417 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7418 (larger_vector): New API (vec, incr_min, size_max) replaces old
7419 one (vec, new_size, init). This catches size overflow.
7420 INIT was removed because it was always Qnil.
7421 All callers changed.
7422 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7423 the upper bound on a hash table index size.
7424 (make_hash_table, maybe_resize_hash_table): Use it.
7425 (secure_hash): Computer start_byte and end_byte only after
7426 they're known to be in ptrdiff_t range.
7427 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7428 (Ffont_get_glyphs, Ffont_at):
7429 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7430 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7431 (Flist_fonts, Fopen_font):
7432 Don't assume fixnum can fit in int.
7433 (check_gstring): Don't assume index can fit in int.
7434 (font_match_p): Check that fixnum is a character, not a nonnegative
7435 fixnum, since the later code needs to stuff it into an int.
7436 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7437 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7438 conversion overflow issues.
7439 (Fopen_font): Check for integer out of range.
7440 (Ffont_get_glyphs): Don't assume index can fit in int.
7441 * font.h: Adjust decls to match defn changes elsewhere.
7442 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7443 integer overflow.
7444 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7445 printmax_t, where ptrdiff_t is wide enough.
7446 (Finternal_char_font):
7447 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7448 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7449 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7450 (Fset_frame_position, x_set_frame_parameters)
7451 (x_set_line_spacing, x_set_border_width)
7452 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7453 Check that fixnums are in proper range for system types.
7454 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7455 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7456 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7457 Use SAFE_ALLOCA_LISP, not alloca.
7458 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7459 intptr_t is wide enough.
7460 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7461 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7462 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7463 Check for fixnum out of range.
7464 * ftfont.c (ftfont_list): Don't assume index fits in int.
7465 Check that fixnums are in proper range for system types.
7466 (ftfont_shape_by_flt):
7467 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
7468 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7469 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7470 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7471 Check that fixnums are in proper range for system types.
7472 * gnutls.h: Adjust decls to match defn changes elsewhere.
7473 * gtkutil.c (xg_dialog_run):
7474 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7475 (update_frame_tool_bar):
7476 Check that fixnums are in proper range for system types.
7477 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 7478 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
7479 * indent.c (last_known_column, last_known_column_point):
7480 (current_column_bol_cache):
7481 (skip_invisible, current_column, check_display_width):
7482 (check_display_width, scan_for_column, current_column_1)
7483 (Findent_to, Fcurrent_indentation, position_indentation)
7484 (indented_beyond_p, Fmove_to_column, compute_motion):
7485 (Fcompute_motion, Fvertical_motion):
7486 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7487 (last_known_column_modified): Use EMACS_INT, not int.
7488 (check_display_width):
7489 (Fcompute_motion):
7490 Check that fixnums and floats are in proper range for system types.
7491 (compute_motion): Don't assume index or fixnum fits in int.
7492 (compute_motion, Fcompute_motion):
7493 Use int, not EMACS_INT, when it is wide enough.
7494 (vmotion): Omit local var start_hpos that is always 0; that way
7495 we don't need to worry about overflow in expressions involving it.
7496 * indent.h: Adjust decls to match defn changes elsewhere.
7497 (struct position):
7498 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7499 Use int, not EMACS_INT, where int is wide enough.
7500 Remove unused members ovstring_chars_done and tab_offset;
7501 all uses removed.
7502 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7503 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7504 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7505 (make_gap, copy_text, insert, insert_and_inherit)
7506 (insert_before_markers, insert_before_markers_and_inherit)
7507 (insert_1, count_combining_before, count_combining_after)
7508 (insert_1_both, insert_from_string)
7509 (insert_from_string_before_markers, insert_from_string_1)
7510 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7511 (adjust_after_replace, adjust_after_insert, replace_range)
7512 (replace_range_2, del_range, del_range_1, del_range_byte)
7513 (del_range_both, del_range_2, modify_region)
7514 (prepare_to_modify_buffer, signal_before_change)
7515 (signal_after_change, Fcombine_after_change_execute):
7516 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7517 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7518 (balance_an_interval, split_interval_right, split_interval_left)
7519 (find_interval, next_interval, update_interval)
7520 (adjust_intervals_for_insertion, delete_node, delete_interval)
7521 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7522 (static_offset_intervals, offset_intervals)
7523 (merge_interval_right, merge_interval_left, make_new_interval)
7524 (graft_intervals_into_buffer, temp_set_point_both)
7525 (temp_set_point, set_point, adjust_for_invis_intang)
7526 (set_point_both, move_if_not_intangible, get_property_and_range)
7527 (get_local_map, copy_intervals, copy_intervals_to_string)
7528 (compare_string_intervals, set_intervals_multibyte_1):
7529 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7530 * intervals.h: Adjust decls to match defn changes elsewhere.
7531 (struct interval):
7532 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7533 * keyboard.c (this_command_key_count, this_single_command_key_start)
7534 (before_command_key_count, before_command_echo_length, echo_now)
7535 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7536 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7537 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7538 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7539 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7540 (last_non_minibuf_size, last_point_position, echo_truncate)
7541 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7542 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7543 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7544 (stuff_buffered_input):
7545 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7546 (last_auto_save, command_loop_1, read_char):
7547 Use EMACS_INT, not int, to avoid integer overflow.
7548 (record_char): Avoid overflow in total_keys computation.
7549 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7550 * keyboard.h: Adjust decls to match defn changes elsewhere.
7551 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7552 (Fkey_description, Fdescribe_vector, Flookup_key):
7553 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7554 (click_position): New function, to check that positions are in range.
7555 (Fcurrent_active_maps):
7556 (describe_command):
7557 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7558 (Faccessible_keymaps, Fkey_description):
7559 (preferred_sequence_p):
7560 Don't assume fixnum can fit into int.
7561 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7562 Check for integer overflow in size calculations.
7563 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7564 avoid mishandling large integers.
7565 * lisp.h: Adjust decls to match defn changes elsewhere.
7566 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7567 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7568 (struct Lisp_Marker):
7569 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7570 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
7571 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7572 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7573 All callers changed.
7574 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7575 Assume the arg has valid form, since it always does.
7576 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7577 unsigned integer system type.
7578 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7579 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7580 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7581 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7582 (duration_to_sec_usec): New decl.
7583 * lread.c (read_from_string_index, read_from_string_index_byte)
7584 (read_from_string_limit, readchar, unreadchar, openp)
7585 (read_internal_start, read1, oblookup):
7586 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7587 (Fload, readevalloop, Feval_buffer, Feval_region):
7588 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7589 (openp): Check for out-of-range argument to 'access'.
7590 (read1): Use int, not EMACS_INT, where int is wide enough.
7591 Don't assume fixnum fits into int.
6efdadfd 7592 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
7593 (read_filtered_event): Use duration_to_sec_usec
7594 to do proper overflow checking on durations.
d311d28c
PE
7595 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7596 in size calculation.
7597 (Fexecute_kbd_macro):
7598 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7599 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7600 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7601 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7602 (set_marker_both, set_marker_restricted_both, marker_position)
7603 (marker_byte_position, Fbuffer_has_markers_at):
7604 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7605 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 7606 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
7607 It now merely ensures that the menu is large enough, without
7608 necessarily growing it, as this avoids some integer overflow issues.
7609 All callers changed.
7610 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7611 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7612 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7613 Use SAFE_ALLOCA_LISP, not alloca.
7614 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7615 to EMACS_INT. Check that fixnums are in proper range for system types.
7616 * minibuf.c (minibuf_prompt_width, string_to_object)
7617 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7618 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7619 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7620 (get_minibuffer, read_minibuf_unwind):
7621 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7622 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7623 this simplifies overflow checking. All callers changed.
7624 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7625 (Ftest_completion):
7626 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7627 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7628 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7629 Check that fixnums are in proper range for system types.
7630 (Fx_create_frame, Fx_show_tip):
7631 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7632 * nsfont.m (ns_findfonts, nsfont_list_family):
7633 Don't assume fixnum fits in long.
7634 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7635 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7636 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7637 wide enough.
17fdb222 7638 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
7639 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7640 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7641 (PRINTDECLARE, PRINTPREPARE):
7642 (strout, print_string):
7643 (print, print_preprocess, print_check_string_charset_prop)
7644 (print_object):
7645 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7646 (PRINTDECLARE):
7647 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7648 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7649 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 7650 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 7651 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
7652 (print_error_message): Use SAFE_ALLOCA, not alloca.
7653 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
7654 (print_depth, new_backquote_output, print_number_index):
7655 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
7656 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7657 (Fset_process_window_size, Fformat_network_address)
7658 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 7659 (sigchld_handler):
d311d28c 7660 Check that fixnums are in proper range for system types.
d44287d4 7661 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
7662 Check for process-ids out of pid_t range rather than relying on
7663 undefined behavior.
e4d81efc 7664 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
7665 (Fformat_network_address, read_process_output, send_process)
7666 (Fprocess_send_region, status_notify):
7667 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7668 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7669 (wait_reading_process_output, read_process_output, exec_sentinel):
7670 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7671 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7672 (Faccept_process_output): Use duration_to_sec_usec to do proper
7673 overflow checking on durations.
dde14581
PE
7674 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7675 Don't assume pid_t fits in int.
02481186
PE
7676 * process.h (struct Lisp_Process): Members tick and update_tick
7677 are now of type EMACS_INT, not int.
b62b53e8
PE
7678 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7679 configured --with-wide-int.
d311d28c
PE
7680 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7681 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7682 * search.c (looking_at_1, string_match_1):
7683 (fast_string_match, fast_c_string_match_ignore_case)
7684 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7685 (scan_newline, find_before_next_newline, search_command)
7686 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7687 (set_search_regs, wordify):
7688 (Freplace_match):
7689 (Fmatch_data):
7690 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7691 (string_match_1, search_buffer, set_search_regs):
7692 (Fmatch_data):
7693 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7694 (wordify): Check for overflow in size calculation.
7695 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7696 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7697 Check that fixnums are in proper range for system types.
7698 * sound.c (struct sound_device)
7699 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7700 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7701 (Fplay_sound_internal):
7702 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 7703 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
7704 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7705 (Fparse_partial_sexp):
7706 Don't assume fixnums can fit in int.
7707 (struct lisp_parse_state, find_start_pos, find_start_value)
7708 (find_start_value_byte, find_start_begv)
7709 (update_syntax_table, char_quoted, dec_bytepos)
7710 (find_defun_start, prev_char_comend_first, back_comment):
7711 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7712 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7713 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7714 (Finternal_describe_syntax_value): Check that match_lisp is a
7715 character, not an integer, since the code stuffs it into int.
7716 (scan_words, scan_sexps_forward):
7717 Check that fixnums are in proper range for system types.
7718 (Fforward_word):
7719 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7720 (scan_sexps_forward):
7721 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7722 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7723 * syntax.h: Adjust decls to match defn changes elsewhere.
7724 (struct gl_state_s):
7725 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
7726 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7727 MOST_POSITIVE_FIXNUM.
d311d28c
PE
7728 * sysdep.c (wait_for_termination_1, wait_for_termination)
7729 (interruptible_wait_for_termination, mkdir):
7730 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7731 (emacs_read, emacs_write):
7732 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
7733 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7734 and double all fit in int.
d311d28c
PE
7735 * term.c (set_tty_color_mode):
7736 Check that fixnums are in proper range for system types.
7737 * termhooks.h (struct input_event):
7738 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7739 * textprop.c (validate_interval_range, interval_of)
7740 (Fadd_text_properties, set_text_properties_1)
7741 (Fremove_text_properties, Fremove_list_of_text_properties)
7742 (Ftext_property_any, Ftext_property_not_all)
7743 (copy_text_properties, text_property_list, extend_property_ranges)
7744 (verify_interval_modification):
7745 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7746 (Fnext_single_char_property_change)
7747 (Fprevious_single_char_property_change):
7748 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
7749 (copy_text_properties):
7750 Check for integer overflow in index calculation.
d311d28c
PE
7751 * undo.c (last_boundary_position, record_point, record_insert)
7752 (record_delete, record_marker_adjustment, record_change)
7753 (record_property_change):
7754 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7755 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7756 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7757 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7758 (Fx_hide_tip, Fx_file_dialog):
7759 * w32menu.c (set_frame_menubar):
7760 Use ptrdiff_t, not int, for consistency with rest of code.
7761 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7762 (select_window, Fdelete_other_windows_internal)
7763 (window_scroll_pixel_based, window_scroll_line_based)
7764 (Frecenter, Fset_window_configuration):
7765 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7766 (Fset_window_hscroll, run_window_configuration_change_hook)
7767 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 7768 (Fscroll_other_window, Frecenter):
d311d28c
PE
7769 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7770 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7771 Don't assume fixnum fits in int.
7772 (Fset_window_scroll_bars):
7773 Check that fixnums are in proper range for system types.
7774 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7775 (string_pos, c_string_pos, number_of_chars, init_iterator)
7776 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7777 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7778 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
7779 (face_before_or_after_it_pos, handle_invisible_prop)
7780 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
7781 (display_prop_intangible_p, string_buffer_position_lim)
7782 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7783 (get_overlay_strings_1, get_overlay_strings)
7784 (iterate_out_of_display_property, forward_to_next_line_start)
7785 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7786 (get_next_display_element, set_iterator_to_next)
7787 (get_visually_first_element, compute_stop_pos_backwards)
7788 (handle_stop_backwards, next_element_from_buffer)
7789 (move_it_in_display_line_to, move_it_in_display_line)
7790 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7791 (add_to_log, message_dolog, message_log_check_duplicate)
7792 (message2, message2_nolog, message3, message3_nolog
7793 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7794 (current_message_1, truncate_echo_area, truncate_message_1)
7795 (set_message, set_message_1, store_mode_line_noprop)
7796 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7797 (text_outside_line_unchanged_p, check_point_in_composition)
7798 (reconsider_clip_changes)
7799 (redisplay_internal, set_cursor_from_row, try_scrolling)
7800 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7801 (redisplay_window, find_last_unchanged_at_beg_row)
7802 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7803 (trailing_whitespace_p, find_row_edges, display_line)
7804 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7805 (display_mode_element, store_mode_line_string)
7806 (pint2str, pint2hrstr, decode_mode_spec)
7807 (display_count_lines, display_string, draw_glyphs)
7808 (x_produce_glyphs, x_insert_glyphs)
7809 (rows_from_pos_range, mouse_face_from_buffer_pos)
7810 (fast_find_string_pos, mouse_face_from_string_pos)
7811 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7812 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7813 (safe_call, init_from_display_pos, handle_fontified_prop)
7814 (handle_single_display_spec, load_overlay_strings)
7815 (with_echo_area_buffer, setup_echo_area_for_printing)
7816 (display_echo_area, echo_area_display)
7817 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7818 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
7819 (redisplay_window, dump_glyph_row, display_mode_line)
7820 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 7821 (handle_display_spec, display_prop_string_p):
d311d28c
PE
7822 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7823 (handle_single_display_spec, build_desired_tool_bar_string)
7824 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7825 (get_specified_cursor_type):
7826 Check that fixnums are in proper range for system types.
7827 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7828 (Flookup_image_map):
7829 Don't assume fixnums fit in int.
7830 (compare_overlay_entries):
7831 Avoid mishandling comparisons due to subtraction overflow.
7832 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7833 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7834 (handle_tool_bar_click):
7835 Use int, not unsigned, since we prefer signed and the signedness
7836 doesn't matter here.
7837 (get_next_display_element, next_element_from_display_vector):
7838 Use int, not EMACS_INT, when int is wide enough.
7839 (start_hourglass): Use duration_to_sec_usec to do proper
7840 overflow checking on durations.
7841 * xfaces.c (Fbitmap_spec_p):
7842 Check that fixnums are in proper range for system types.
7843 (compare_fonts_by_sort_order):
7844 Avoid mishandling comparisons due to subtraction overflow.
7845 (Fx_family_fonts, realize_basic_faces):
7846 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7847 (Fx_family_fonts):
7848 Don't assume fixnum fits in int.
7849 Use SAFE_ALLOCA_LISP, not alloca.
7850 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7851 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7852 (face_at_buffer_position, face_for_overlay_string)
7853 (face_at_string_position):
7854 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7855 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7856 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7857 (Fx_show_tip):
7858 Check that fixnums are in proper range for system types.
7859 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7860 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7861 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7862 (Fx_change_window_property): Don't assume fixnums fit in int.
7863 * xfont.c (xfont_chars_supported):
7864 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7865 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7866 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7867 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7868 * xml.c (parse_region):
7869 * xrdb.c (magic_file_p):
7870 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7871 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7872 (x_get_local_selection, x_reply_selection_request)
7873 (x_handle_selection_request, wait_for_property_change):
7874 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7875 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7876 short is wide enough.
7877 (x_send_client_event): Don't assume fixnum fits in int.
7878 * xterm.c (x_x_to_emacs_modifiers):
7879 Don't assume EMACS_INT overflows nicely into int.
7880 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7881 may come from Lisp.
7882 (handle_one_xevent): NATNUMP can eval its arg twice.
7883 (x_connection_closed):
7884 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7885 * xterm.h: Adjust decls to match defn changes elsewhere.
7886 (struct scroll_bar): Use struct vectorlike_header
7887 rather than rolling our own approximation.
7888 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7889
c6574eb5
GM
78902012-05-25 Glenn Morris <rgm@gnu.org>
7891
7892 * lisp.mk (lisp): Update for more files being compiled now.
7893
e8d32c7e
SM
78942012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7895
48def666
SM
7896 * lread.c: Remove `read_pure' which makes no difference.
7897 (read_pure): Remove var.
7898 (unreadpure): Remove function.
7899 (readevalloop): Don't call read_list with -1 flag.
7900 (read1, read_vector): Don't test read_pure any more.
7901 (read_list): Simplify.
7902
e8d32c7e
SM
7903 * fileio.c, character.h: Minor style tweaks.
7904
4b2addb7
DA
79052012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7906
7907 * window.h (clip_changed): Remove useless declaration.
7908
584461b2
JB
79092012-05-22 Juanma Barranquero <lekktu@gmail.com>
7910
7911 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7912 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7913
34374650
PE
79142012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7915
7916 Remove src/m/*.
7917 This directory predates autoconf and is no longer needed nowadays.
7918 Move its few remaining bits of functionality to where they're needed.
7919 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7920 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7921 * m/template.h: Remove.
7922 * Makefile.in (M_FILE): Remove. All uses removed.
7923 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7924 * lisp.h (USE_LSB_TAG):
7925 * mem-limits.h (EXCEEDS_LISP_PTR):
7926 Use VAL_MAX, not VALBITS, in #if.
7927 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7928 (EMACS_UINT): Define unconditionally now.
7929 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7930 (BITS_PER_EMACS_INT): New constants, replacing
7931 what used to be in config.h, but not useful in #if.
7932 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7933 define them any more.
7934 (VAL_MAX): New macro.
7935 (VALMASK): Use it.
7936 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7937 BITS_PER_EMACS_INT, in #if.
7938 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7939 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7940 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7941 * s/ms-w32.h (DATA_START):
7942 Move here from removed file m/intel386.h.
7943 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7944 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7945
261cb4bb
PE
79462012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7947
7948 Assume C89 or later.
7949 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7950 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7951 (xrealloc):
7952 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7953 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7954 * textprop.c, tparam.c (NULL): Remove.
7955 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7956 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7957 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7958 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7959 * xterm.c (input_signal_count): Assume volatile works.
7960
ff23cd9f
KB
79612012-05-21 Ken Brown <kbrown@cornell.edu>
7962
7963 * xgselect.c (xg_select): Fix first argument in call to 'select'
7964 (bug#11508).
7965
1b170bc6
KB
79662012-05-20 Ken Brown <kbrown@cornell.edu>
7967
7968 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 7969 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 7970
b2f4d39f
KB
79712012-05-19 Ken Brown <kbrown@cornell.edu>
7972
7973 * xfns.c (x_in_use): Remove `static' qualifier.
7974 * xterm.h (x_in_use): Declare.
7975 * xgselect.c: Include xterm.h.
7976 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7977 and `display_arg' (bug#9754).
7978
003fdae2
PE
79792012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7980
9232a6d9
PE
7981 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7982
003fdae2
PE
7983 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7984 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7985
784b56e2
EZ
79862012-05-18 Eli Zaretskii <eliz@gnu.org>
7987
7988 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7989
7990 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 7991 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
7992
7993 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7994 reference to image_cache->refcount.
7995 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7996
a0a79cde
JL
79972012-05-17 Juri Linkov <juri@jurta.org>
7998
7999 * search.c (Fword_search_regexp, Fword_search_backward)
8000 (Fword_search_forward, Fword_search_backward_lax)
8001 (Fword_search_forward_lax): Move functions to isearch.el
8002 (bug#10145, bug#11381).
8003
b0572523
PE
80042012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8005
8006 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8007
9660f5fc
SM
80082012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8009
8010 * lread.c (init_obarray): Declare Qt and Qnil as special.
8011
4374de83
GM
80122012-05-14 Glenn Morris <rgm@gnu.org>
8013
8014 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 8015 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 8016
dc44c39a
PE
80172012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8018
078c97cb
PE
8019 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8020
dc44c39a
PE
8021 * unexaix.c: Port to more-recent AIX compilers.
8022 (report_error, report_error_1, make_hdr, copy_sym)
8023 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8024 Make arguments const char *, not char *, to avoid violations of C
8025 standard and to fix some AIX warnings reported by Gilles Pion.
8026
e18afed7 80272012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
8028
8029 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8030 already have overlays loaded.
8031 (handle_single_display_spec): Before returning without displaying
8032 fringe bitmap, synchronize the bidi iterator with the main display
8033 iterator, by calling iterate_out_of_display_property.
8034 (iterate_out_of_display_property): Detect buffer iteration by
8035 testing that it->string is a Lisp string.
8036 (get_next_display_element): When the current object is exhausted,
8037 and there's something on it->stack, call set_iterator_to_next to
8038 proceed with what's on the stack, instead of returning zero.
8039 (set_iterator_to_next): If called at the end of a Lisp string,
8040 proceed to consider_string_end without incrementing string
8041 position. Don't increment display vector index past the end of
8042 the display vector. (Bug#11417)
c8fb9dc6
EZ
8043 (pos_visible_p): Don't report a position visible when move_it_to
8044 stopped at the last line of window, which happens to be scanned
8045 backwards by the bidi iteration. (Bug#11464)
ac268e67 8046
e18afed7 80472012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
8048
8049 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8050 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
8051 are on a TTY, and thus unable to display on the fringes.
8052 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
8053 so we need to signal to the caller that this is a "replacing"
8054 display spec. This fixes display when the spec is invalid or we
8055 are on a TTY.
8056
e18afed7 80572012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
8058
8059 * unexaix.c (make_hdr): Fix typo in prototype.
8060 This bug broke the build on AIX. Problem reported by Gilles Pion.
8061
9d0a235a
MA
80622012-05-14 Michael Albinus <michael.albinus@gmx.de>
8063
8064 * keyboard.c (kbd_buffer_get_event): Read special events also in
8065 batch mode. (Bug#11415)
8066
9e6b06ed
GM
80672012-05-12 Glenn Morris <rgm@gnu.org>
8068
8069 * ns.mk: Update for ns_appbindir no longer having trailing "/".
8070
c1a1d7a3
EZ
80712012-05-12 Eli Zaretskii <eliz@gnu.org>
8072
8073 * lisp.mk (lisp): Add newcomment.elc.
8074
3fe7cdc8
GM
80752012-05-12 Glenn Morris <rgm@gnu.org>
8076
8077 * Makefile.in (MKDIR_P): New, set by configure.
8078 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
8079
53f7d2c0
PE
80802012-05-11 Paul Eggert <eggert@cs.ucla.edu>
8081
8082 Remove unused function hourglass_started.
8083 * dispextern.h (hourglass_started):
8084 * w32fns.c (hourglass_started):
8085 * xdisp.c (hourglass_started): Remove.
8086
75aafb17
JB
80872012-05-10 Juanma Barranquero <lekktu@gmail.com>
8088
8089 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
8090 Update dependencies.
8091
12959e8e
PE
80922012-05-10 Paul Eggert <eggert@cs.ucla.edu>
8093
97107e2e
PE
8094 * xgselect.c (xg_select): Put maxfds+1 into a var.
8095 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
8096
12959e8e
PE
8097 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
8098
836d29b3
DA
80992012-05-10 Dave Abrahams <dave@boostpro.com>
8100
8101 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
8102 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
8103
5cb67954
MA
81042012-05-09 Michael Albinus <michael.albinus@gmx.de>
8105
8106 * dbusbind.c (xd_registered_buses): New internal Lisp object.
8107 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
8108 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
8109 Initialize xd_registered_buses.
8110
3478ec45
PE
81112012-05-09 Paul Eggert <eggert@cs.ucla.edu>
8112
b263a6b0
PE
8113 Untag more efficiently if USE_LSB_TAG.
8114 This is based on a proposal by YAMAMOTO Mitsuharu in
8115 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
8116 For an admittedly artificial (nth 8000 longlist) benchmark on
8117 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
8118 Emacs's overall text size by 1%.
8119 * lisp.h (XUNTAG): New macro.
8120 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
8121 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
8122 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8123 * eval.c (Fautoload):
8124 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8125 * frame.h (XFRAME): Use XUNTAG.
8126
3478ec45
PE
8127 Port recent dbusbind.c changes to 32-bit --with-wide-int.
8128 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8129 Remove unportable assumptions about print widths of types like
8130 dbus_uint32_t.
8131 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8132 intptr_t when converting between pointer and integer, to avoid GCC
8133 warnings about wrong width.
8134
666b903b 81352012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
8136
8137 * w32proc.c (new_child): Force Windows to reserve only 64KB of
8138 stack for each reader_thread, instead of defaulting to 8MB
8139 determined by the linker. This avoids failures in creating
8140 subprocesses on Windows 7, see the discussion in this thread:
8141 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8142
b120cc17
JC
81432012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
8144
8145 Fix up display of the *Minibuf-0* buffer in the mini window.
8146 * keyboard.c (read_char): Don't clear the echo area if there's no
8147 message to clear.
8148 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 8149 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 8150
9a4b36f8
MA
81512012-05-07 Michael Albinus <michael.albinus@gmx.de>
8152
8153 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8154 batch mode.
8155
e5f9458f
CY
81562012-05-06 Chong Yidong <cyd@gnu.org>
8157
8158 * lisp.mk (lisp): Update.
8159
eceeb5fc 81602012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
8161
8162 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8163
71873e2b
SM
81642012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
8165
8166 * data.c (PUT_ERROR): New macro.
8167 (syms_of_data): Use it. Add new error type `user-error'.
8168 * undo.c (user_error): New function.
8169 (Fprimitive_undo): Use it.
8170 * print.c (print_error_message): Adjust print style for `user-error'.
8171 * keyboard.c (user_error): New function.
8172 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8173
ab0fa4e4
PE
81742012-05-03 Paul Eggert <eggert@cs.ucla.edu>
8175
8176 Do not limit current-time-string to years 1000..9999.
8177 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8178 (Fcurrent_time_string): Support any year that is supported by the
8179 underlying localtime representation. Don't use asctime, as it
8180 has undefined behavior for years outside the range -999..9999.
8181
7ed806a7
PE
81822012-05-02 Paul Eggert <eggert@cs.ucla.edu>
8183
8184 Fix race conditions involving setenv, gmtime, localtime, asctime.
8185 Without this fix, interrupts could mess up code that uses these
8186 nonreentrant functions, since setting TZ invalidates existing
8187 tm_zone or tzname values, and since most of these functions return
8188 pointers to static storage.
8189 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8190 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8191 Grow the critical sections to include not just invoking
8192 localtime/gmtime, but also accessing these functions' results
8193 including their tm_zone values if any, and any related TZ setting.
8194 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
8195 so that the struct tm is saved in the critical section.
8196 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
8197 motivated by the fact that memory allocation needs to be outside
8198 the critical section.
8199
0c16dfed
DA
82002012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
8201
8202 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8203 with RESET_INTERVAL.
8204
8205 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8206 Remove duplicated buffer name initialization.
8207
3f83ace8
JM
82082012-05-02 Jim Meyering <jim@meyering.net>
8209
8210 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8211
c7b8541e
JM
8212 * xfns.c (x_window): Use xstrdup (Bug#11375).
8213
90207a15 82142012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
8215
8216 * xdisp.c (pos_visible_p): If already at a newline from the
8217 display string before the 'while' loop, don't walk back the glyphs
8218 from it3.glyph_row. Solves assertion violation when the display
8219 string begins with a newline (egg.el). (Bug#11367)
8220
b593d6a9
AH
82212012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
8222
8223 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
8224 Move to simple.el.
8225
4737362e
GM
82262012-05-01 Glenn Morris <rgm@gnu.org>
8227
99cf43f9
GM
8228 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
8229 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
8230 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
8231 All were removed before 23.1.
8232
9311dcff
GM
8233 * dispnew.c: Remove HAVE_LIBNCURSES test;
8234 it is always true on relevant platforms.
8235
4d5c6349
GM
8236 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
8237 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
8238
4737362e
GM
8239 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
8240
74dd3a6b
AS
82412012-04-30 Andreas Schwab <schwab@linux-m68k.org>
8242
8243 * .gdbinit (xpr): Remove checks for no longer existing misc types.
8244 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8245 Remove.
8246
13c379ee
PE
82472012-04-28 Paul Eggert <eggert@cs.ucla.edu>
8248
8249 Do not avoid creating empty evaporating overlays (Bug#9642).
8250 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8251 That is, do not delete an evaporating overlay if it becomes
8252 empty after its bounds are adjusted to fit within its buffer.
8253 This fix caused other problems, and I'm reverting it until we get
8254 to the bottom of them.
8255
a8e7d6d7 82562012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
8257
8258 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8259
a8e7d6d7 82602012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
8261
8262 * xdisp.c (pos_visible_p): If the window start position is beyond
8263 ZV, start the display from buffer beginning. Prevents assertion
8264 violation in init_iterator when the minibuffer window is scrolled
8265 via the scroll bar.
8266
8267 * window.c (window_scroll_pixel_based): Likewise.
8268
a8e7d6d7 82692012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
8270
8271 * keymap.c (where_is_internal): Doc fix (Bug#10872).
8272
a8e7d6d7 82732012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
8274
8275 * fileio.c (Fcopy_file, Fset_file_selinux_context):
8276 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
8277
a8e7d6d7 82782012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 8279
b593d6a9
AH
8280 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8281 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 8282
1c6900d9
EZ
82832012-04-26 Eli Zaretskii <eliz@gnu.org>
8284
4c3fa1d9
EZ
8285 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8286 display element, check also the underlying string or buffer
8287 character. (Bug#11341)
8288
1c6900d9
EZ
8289 * w32menu.c: Include w32heap.h.
8290 (add_menu_item): If the call to AppendMenuW (via
8291 unicode_append_menu) fails, disable Unicode menus only if we are
8292 running on Windows 9X/Me.
8293
42bf8205
AS
82942012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8295
8296 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8297 (xgetint): Add missing shift for LSB tags.
8298
b1bac16e
MR
82992012-04-24 Martin Rudalics <rudalics@gmx.at>
8300
8301 * keyboard.c (read_char): Don't wipe echo area for select window
8302 events: These might get delayed via `mouse-autoselect-window'
8303 (Bug#11304).
8304
d69621cc
JB
83052012-04-24 Juanma Barranquero <lekktu@gmail.com>
8306
8307 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8308 manipulation of :loaded-from data.
8309
02fd101b
JB
83102012-04-23 Juanma Barranquero <lekktu@gmail.com>
8311
8312 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8313 now a cons (bug#11311).
8314
888bec30
PE
83152012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8316
89a438bd
PE
8317 Do not create empty overlays with the evaporate property (Bug#9642).
8318 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8319 if it becomes empty after its bounds are adjusted to fit within
8320 its buffer. Without this fix, in a nonempty buffer (let ((o
8321 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8322 yields an empty overlay that has the evaporate property, which is
8323 not supposed to happen.
8324
1068fe4d
PE
8325 Fix minor GTK3 problems found by static checking.
8326 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8327 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8328 (struct _EmacsFixedClass, emacs_fixed_get_type):
8329 Move decls here from emacsgtkfixed.h, since they needn't be public.
8330 (emacs_fixed_get_type): Now static.
8331 (emacs_fixed_class_init): Omit unused local.
8332 (emacs_fixed_child_type): Remove; unused.
8333 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8334 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8335 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8336 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8337 (EMACS_FIXED_GET_CLASS): Remove; unused.
8338 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8339
888bec30
PE
8340 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8341 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8342
de85e130
PE
83432012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8344
d0baac98 8345 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 8346 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
8347 (__malloc_size_t, __malloc_ptrdiff_t):
8348 Remove. All uses removed, replaced by the definiens if needed,
8349 since we can assume C89 or better now.
8350 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8351 (protect_malloc_state, align, get_contiguous_space)
8352 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8353 (malloc_atfork_handler_child, malloc_enable_thread)
8354 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8355 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8356 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8357 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8358 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8359 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8360 Define using prototypes, not old style.
8361 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8362 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8363 (align): Don't assume that signed integer overflow wraps around.
8364 Omit unused local var.
8365 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8366 (_free_internal_nolock, memalign, mallochook, reallochook):
8367 Omit no-longer-needed casts.
8368 (valloc): Use getpagesize, not __getpagesize.
8369 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8370 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8371
de85e130
PE
8372 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8373
dcbf5805
MA
83742012-04-22 Michael Albinus <michael.albinus@gmx.de>
8375
8376 Move functions from C to Lisp. Make non-blocking method calls
8377 the default. Implement further D-Bus standard interfaces.
8378
8379 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8380 (QCdbus_request_name_allow_replacement)
8381 (QCdbus_request_name_replace_existing)
8382 (QCdbus_request_name_do_not_queue)
8383 (QCdbus_request_name_reply_primary_owner)
8384 (QCdbus_request_name_reply_in_queue)
8385 (QCdbus_request_name_reply_exists)
8386 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8387 (QCdbus_registered_serial, QCdbus_registered_method)
8388 (QCdbus_registered_signal): New Lisp objects.
8389 (XD_DEBUG_MESSAGE): Use sizeof.
8390 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8391 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8392 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8393 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8394 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8395 (xd_signature, xd_append_arg): Allow float for integer types.
8396 (xd_get_connection_references): New function.
b593d6a9
AH
8397 (xd_get_connection_address): Rename from xd_initialize.
8398 Return cached address.
dcbf5805
MA
8399 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8400 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8401 level.
8402 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 8403 Return number of refcounts.
dcbf5805
MA
8404 (Fdbus_get_unique_name): Make stronger parameter check.
8405 (Fdbus_message_internal): New defun.
8406 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8407 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8408 (Fdbus_send_signal, Fdbus_register_service)
8409 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8410 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8411 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8412 (Vdbus_compiled_version, Vdbus_runtime_version)
8413 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8414 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8415 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
8416 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8417 Adapt docstring.
dcbf5805 8418
52828e02
PE
84192012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8420
da05bc4c
PE
8421 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8422 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8423 Do not assume ptrdiff_t is the same width as 'int'.
8424
52828e02
PE
8425 * alloc.c: Handle unusual debugging option combinations.
8426 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8427 since the two debugging options are incompatible.
8428 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8429 is defined.
8430 (mem_init, mem_insert, mem_insert_fixup):
8431 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8432 (NEED_MEM_INSERT): Remove; no longer needed.
8433
f01769f9
LL
84342012-04-22 Leo Liu <sdl.web@gmail.com>
8435
8436 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8437
5790543d
PE
84382012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8439
8440 * sysdep.c [__FreeBSD__]: Minor cleanups.
8441 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8442 Use Emacs indenting style more consistently. Avoid some casts.
8443 Use 'double' consistently rather than mixing 'float' and 'double'.
8444
b91b7e4d
EW
84452012-04-21 Eduard Wiebe <usenet@pusto.de>
8446
b593d6a9
AH
8447 * sysdep.c (list_system_processes, system_process_attributes):
8448 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 8449
6114eb15
AS
84502012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8451
8452 * lisp.mk (lisp): Update.
8453
2f38dff7
PE
84542012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8455
8456 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8457 It is never used otherwise.
8458
4ae29f89
SM
84592012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8460
8461 * print.c (print_preprocess): Only check print_depth if print-circle
8462 is nil.
8463 (print_object): Check for cycles even when print-circle is nil and
8464 print-gensym is t, but only check print_depth if print-circle is nil.
8465
f30d612a
CY
84662012-04-20 Chong Yidong <cyd@gnu.org>
8467
8468 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8469 set the status to "failed" and ensure that sentinel is run.
8470
c07a4c0b 84712012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
8472
8473 * process.c (Fset_process_inherit_coding_system_flag)
8474 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 8475 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 8476
c07a4c0b 84772012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
8478
8479 * xdisp.c (string_buffer_position_lim): Limit starting position to
8480 BEGV.
8481 (set_cursor_from_row): If called for a mode-line or header-line
8482 row, return zero immediately.
8483 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
8484 farther than the first row after the header line, if any.
8485 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
8486 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8487
c07a4c0b 84882012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8489
4ae29f89
SM
8490 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8491 (bug#11238).
ad3a2b41 8492
c07a4c0b 84932012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 84942012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
8495
8496 configure: new option --enable-gcc-warnings (Bug#11207)
8497 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8498 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8499 (ALL_CFLAGS): Use new macros rather than old.
8500 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8501 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8502 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8503 -Wunused-result, -Wunused-variable. This should go away once
8504 the Emacs and Gnulib regex code is merged.
8505 (xmalloc, xrealloc): Now static.
8506
aba027e8
PE
85072012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8508
8509 * dired.c (Fsystem_groups): Remove unused local.
8510
e5a36063
GM
85112012-04-17 Glenn Morris <rgm@gnu.org>
8512
8513 * dired.c (Fsystem_users): Doc fix.
8514
316411f0
DA
85152012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8516
8517 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8518 (syms_of_dired): Add them.
8519
9426aba4
PE
85202012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8521
b62a57be
PE
8522 Fix minor alloc.c problems found by static checking.
8523 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8524 New extern decls, to avoid calling undeclared functions.
8525 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8526 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8527 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8528 (NEED_MEM_INSERT): New macro.
8529 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 8530 Remove one incorrect comment and fix another.
b62a57be 8531
3539f31f
PE
8532 Fix minor ralloc.c problems found by static checking.
8533 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8534 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8535 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8536 (r_alloc_sbrk): Now static.
8537
a041960a
PE
8538 Improve ralloc.c interface checking.
8539 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8540 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8541 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8542 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8543 [REL_ALLOC]: ... to here, to check interface.
8544 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8545 Remove decls. This fixes an "It stinks!".
8546
9426aba4
PE
8547 * alloc.c (which_symbols): Fix alignment issue / type clash.
8548
d55c12ed
AS
85492012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8550
8551 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8552 (struct Lisp_Misc_Any): Likewise.
8553 (struct Lisp_Free): Likewise.
8554 * alloc.c (union aligned_Lisp_Symbol): Define.
8555 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8556 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8557 (union aligned_Lisp_Misc): Define.
8558 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8559 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 8560 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 8561
b948ce8b
PE
85622012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8563
8564 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8565 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8566 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8567 * s/netbsd.h, s/sol2-6.h:
8568 Remove definition of GC_MARK_STACK, since the default now works.
8569 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8570 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8571 no longer the default.
8572 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8573
35dc09a1 85742012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8575
35dc09a1
GM
8576 * lread.c (lisp_file_lexically_bound_p):
8577 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 8578
35dc09a1
GM
85792012-04-14 Eli Zaretskii <eliz@gnu.org>
8580
8581 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8582 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8583
85842012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8585
8586 * nsterm.m (constrainFrameRect): Always constrain when there is only
8587 one screen (Bug#10962).
8588
bcd86815
KB
85892012-04-13 Ken Brown <kbrown@cornell.edu>
8590
8591 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8592
c25df26e
RT
85932012-04-13 Reuben Thomas <rrt@sc3d.org>
8594
8595 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8596
0fc59f1e
DC
85972012-04-11 Daniel Colascione <dancol@dancol.org>
8598
8599 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8600 against is gone. It's better to use vfork now so that when Cygwin
8601 gains a new, working vfork, we use it automatically (bug#10398).
8602
de8c03dc
SM
86032012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8604
8605 * window.c (save_window_save): Obey window-point-insertion-type.
8606
2f097256
GM
86072012-04-11 Glenn Morris <rgm@gnu.org>
8608
8609 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8610
453b951e
SM
86112012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8612
8613 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8614
75f1671a 86152012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
8616
8617 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8618 (force_quit_count): New var.
8619 (handle_interrupt): Use it.
8620
2a8ce227
JB
86212012-04-10 Juanma Barranquero <lekktu@gmail.com>
8622
8623 * w32.c (w32_delayed_load): Record the full path of the library
8624 being loaded (bug#10424).
8625
935396c0
GM
86262012-04-09 Glenn Morris <rgm@gnu.org>
8627
05920a43
GM
8628 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8629 not just in the obarray, before snarfing them. (Bug#11036)
8630
935396c0
GM
8631 * Makefile.in ($(leimdir)/leim-list.el):
8632 Pass EMACS rather than BUILT_EMACS.
8633
a18ecafa
TZ
86342012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8635
8636 * process.c (make_process):
8637 * process.h: Add integer `gnutls_handshakes_tried' member to
8638 process struct.
8639
6bbef4e5
JC
8640 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8641 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
8642
8643 * gnutls.c (gnutls_log_function2i): Convenience log function.
8644 (emacs_gnutls_read): Use new log functions,
8645 `gnutls_handshakes_tried' process member, and
8646 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8647 attempts per process (connection).
8648
b4d3bc10
CY
86492012-04-09 Chong Yidong <cyd@gnu.org>
8650
8651 * eval.c (Fuser_variable_p, user_variable_p_eh)
8652 (lisp_indirect_variable): Functions deleted.
8653 (Fdefvar): Caller changed.
8654
8655 * callint.c (Finteractive, Fcall_interactively):
8656 * minibuf.c (Fread_variable): Callers changed.
8657
70f4d973
EZ
86582012-04-09 Eli Zaretskii <eliz@gnu.org>
8659
8660 * xdisp.c (set_cursor_from_row): If the display string appears in
8661 the buffer at position that is closer to point than the position
8662 after the display string, display the cursor on the first glyph of
8663 the display string. Fixes cursor display when a 'display' text
8664 property immediately follows invisible text. (Bug#11094)
8665
cb3c2e3e
PE
86662012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8667
8668 composite.c: use 'double' consistently
8669 * composite.c (get_composition_id): Use 'double' consistently
8670 instead of converting 'float' to 'double' and vice versa; this is
8671 easier to understand and avoids a GCC warning.
8672
fd06db5d
GM
86732012-04-09 Glenn Morris <rgm@gnu.org>
8674
50fe702a
GM
8675 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8676 preparation for dumping it with emacs. (Bug#4789)
8677 (leimdir): New variable.
8678 ($(leimdir)/leim-list.el): New rule.
8679 (emacs$(EXEEXT)): Depend on leim-list.el.
8680
fd06db5d
GM
8681 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8682 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8683 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8684
55c131ee
AS
86852012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8686
8687 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8688 proper alignment.
8689
9209588f
JB
86902012-04-07 Juanma Barranquero <lekktu@gmail.com>
8691
8692 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8693 Remove unused local variable.
8694
e3fb2efb
PE
86952012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8696
8697 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8698 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8699 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8700 objects, as mark_maybe_pointer will catch them otherwise.
8701 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8702 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8703
b5385551
PE
87042012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8705
8706 Fix typo that broke non-Windows builds.
8707 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8708
9078ead6
EZ
87092012-04-07 Eli Zaretskii <eliz@gnu.org>
8710
8711 Support building on MS-Windows with libxml2.
8712
8713 * makefile.w32-in (OBJ2): Add xml.$(O).
8714 (GLOBAL_SOURCES): Add xml.c.
8715 ($(BLD)/xml.$(O)): New dependency list.
8716
8717 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8718 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8719 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8720 [!WINDOWSNT]: New macros.
8721 (init_libxml2_functions, libxml2_loaded_p): New functions.
8722 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8723 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8724 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8725 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8726 linked in).
6bbef4e5
JC
8727 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8728 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
8729 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8730
8731 * emacs.c: Don't include libxml/parser.h.
8732 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8733 xmlCleanupParser directly.
8734
8735 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8736
3811fdf3
EZ
87372012-04-07 Eli Zaretskii <eliz@gnu.org>
8738
8739 * indent.c (Fvertical_motion): If there is a display string at
8740 point, use it.vpos to compute how many lines to backtrack after
8741 move_it_to point. (Bug#11133)
8742
2f8e16b2
EZ
87432012-04-06 Eli Zaretskii <eliz@gnu.org>
8744
8745 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8746 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8747 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8748 macros related to unification of CJK characters. For the details,
8749 see the discussion following the message here:
8750 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8751
3d439cd1
CY
87522012-04-04 Chong Yidong <cyd@gnu.org>
8753
8754 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8755
8bc53d00
EZ
87562012-04-01 Eli Zaretskii <eliz@gnu.org>
8757
8758 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8759 instead of alloca. (Bug#11138)
8760
3b0512a3
AS
87612012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8762
8763 * w32menu.c (is_simple_dialog): Properly check lisp types.
8764 (Bug#11141)
8765
8427ddd2
EZ
87662012-03-31 Eli Zaretskii <eliz@gnu.org>
8767
979022ef
EZ
8768 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8769 position we get to after a call to move_it_to fails the
8770 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8771 only if we wind up in a string from display property. (Bug#11063)
8772
a6b1c7cc
EZ
8773 * window.c (Fdelete_other_windows_internal): Invalidate the row
8774 and column information about mouse highlight, so that redisplay
8775 restores it after reallocating the glyph matrices. (Bug#7464)
8776
8427ddd2
EZ
8777 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8778 string comes from a `display' text property, use the buffer
8779 position of that property as if we actually saw that position in
8780 the row's glyphs.
697ba24b
EZ
8781 (move_it_by_lines): Remove the assertion that
8782 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8783 violated when there's a before-string at the beginning of a line.
8784 (Bug#11063)
8427ddd2 8785
65a0a738
EZ
87862012-03-30 Eli Zaretskii <eliz@gnu.org>
8787
8788 * xdisp.c (append_space_for_newline): If the default face was
8789 remapped, use the remapped face for the appended newline.
8790 (extend_face_to_end_of_line): Use the remapped default face for
8791 extending the face to the end of the line.
8792 (display_line): Call extend_face_to_end_of_line when the default
8793 face was remapped. (Bug#11068)
8794
581355cc
EZ
87952012-03-29 Eli Zaretskii <eliz@gnu.org>
8796
8797 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8798
e8fc049f
SM
87992012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8800
8801 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8802
4fb9a543
GM
88032012-03-27 Glenn Morris <rgm@gnu.org>
8804
8805 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8806 Doc fixes.
8807
679910f1
KH
88082012-03-26 Kenichi Handa <handa@m17n.org>
8809
8810 * dispextern.h (struct glyph): Fix previous change. Change the
8811 bit length of glyphless.ch to 25 (Bug#11082).
8812
90d49b7f
CY
88132012-03-26 Chong Yidong <cyd@gnu.org>
8814
8815 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8816 (command_loop_1): Use it; inhibit selection update for
8817 handle-select-window too (Bug#8996).
8818
f514f6f0
FP
88192012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8820
e8fc049f 8821 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 8822
bf43fa51
KH
88232012-03-25 Kenichi Handa <handa@m17n.org>
8824
8825 * dispextern.h (struct glyph): Change the bit length of
8826 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8827
8a0c01dd
EZ
88282012-03-24 Eli Zaretskii <eliz@gnu.org>
8829
8830 * s/ms-w32.h (tzname): Include time.h before redirecting to
8831 _tzname. Fixes the MSVC build. (Bug#9960)
8832
7d1c3a76
AS
88332012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8834
8ed79523
AS
8835 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8836 characters.
8837
7d1c3a76
AS
8838 * xterm.c (XTread_socket): Only modify handling_signal if
8839 !SYNC_INPUT. (Bug#11080)
8840
e99a9b8b
EZ
88412012-03-23 Eli Zaretskii <eliz@gnu.org>
8842
8843 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8844 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8845 when fetching a multibyte character consumes more bytes than
8846 CHAR_BYTES returns, due to unification of CJK characters in
8847 string_char. (Bug#11073)
8848
5063c0e1
TN
88492012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8850
8851 * process.c (wait_reading_process_output): Handle pty disconnect
8852 by refraining from sending oneself a SIGCHLD (bug#10933).
8853
9f851fbd
CY
88542012-03-22 Chong Yidong <cyd@gnu.org>
8855
8856 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8857
5063c0e1 8858 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
8859 Mark string as coming from a prefix property.
8860 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8861 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8862
fb5b8aca
CY
88632012-03-21 Chong Yidong <cyd@gnu.org>
8864
8865 * xfaces.c (Vface_remapping_alist): Doc fix.
8866
62356a1b
EZ
88672012-03-20 Eli Zaretskii <eliz@gnu.org>
8868
8869 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
8870 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8871 Doc fixes.
62356a1b 8872
025de85b
CY
88732012-03-20 Chong Yidong <cyd@gnu.org>
8874
8875 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8876 to reflect default non-nil value of redisplay-dont-pause.
8877
4827f94e
KH
88782012-03-19 Kenichi Handa <handa@m17n.org>
8879
8880 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8881 it fit in a valid range (Bug#11003).
8882
e50a24a2
EZ
88832012-03-18 Eli Zaretskii <eliz@gnu.org>
8884
8885 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8886 that is not from display property, accept the row as a "cursor
8887 row" if one of the string's character has a non-nil `cursor'
8888 property. Fixes cursor positioning when there are newlines in
8889 overlay strings, e.g. in icomplete.el. (Bug#11035)
8890
9af5ed87
PE
88912012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8892
8893 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8894
d1f55f16
CY
88952012-03-12 Chong Yidong <cyd@gnu.org>
8896
8897 * eval.c (inhibit_lisp_code): Rename from
8898 inhibit_window_configuration_change_hook; move from window.c.
8899
8900 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8901 * window.c (run_window_configuration_change_hook)
8902 (syms_of_window): Callers changed.
8903
66c5eebd
CY
89042012-03-11 Chong Yidong <cyd@gnu.org>
8905
413df973
CY
8906 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8907
66c5eebd
CY
8908 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8909
1de11f56
CY
89102012-03-10 Chong Yidong <cyd@gnu.org>
8911
8912 * frame.c (other_visible_frames): Don't assume the selected frame
8913 is visible (Bug#10955).
8914
cae07000
SM
89152012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8916
8917 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8918
89c94350
JD
89192012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8920
8921 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8922 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8923 zero (Bug#10954).
8924
999dd333
GM
89252012-03-03 Glenn Morris <rgm@gnu.org>
8926
01a6dcc8 8927 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 8928
de0100f2
EZ
89292012-03-02 Eli Zaretskii <eliz@gnu.org>
8930
8931 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8932 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
8933 (redisplay_window, next_element_from_string): Fix typos in
8934 comments.
3e441275
EZ
8935 (redisplay_window): Pass to move_it_vertically the margin in
8936 pixels, not in screen lines.
de0100f2 8937
96a72ee9
GM
89382012-03-02 Glenn Morris <rgm@gnu.org>
8939
8940 * buffer.c (buffer-list-update-hook): Doc fix.
8941
312508d7
EZ
89422012-02-29 Eli Zaretskii <eliz@gnu.org>
8943
8944 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8945 push_it before setting up the iterator for the first overlay
8946 string, even if we have an empty string loaded.
8947 (next_overlay_string): If there's an empty string on the iterator
8948 stack, pop the stack. (Bug#10903)
8949
27f3c637
PE
89502012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8951
8952 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8953 Suggested by Stefan Monnier in
8954 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8955 * alloc.c (widen_to_Lisp_Object): New static function.
8956 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8957 and widening them to Lisp_Objects. This would work even if
8958 USE_LSB_TAG is defined and wide integers are used, which might
8959 happen in a future version of Emacs.
8960
3c9dfce6
CY
89612012-02-25 Chong Yidong <cyd@gnu.org>
8962
fa74b241
CY
8963 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8964 Doc fix.
8965
3c9dfce6
CY
8966 * xselect.c (Fx_selection_exists_p): Doc fix.
8967 (x_clipboard_manager_save_all): Print an informative message
8968 before saving to clipboard manager.
8969
9486df08
CY
89702012-02-24 Chong Yidong <cyd@gnu.org>
8971
8972 * keyboard.c (process_special_events): Handle all X selection
8973 requests in kbd_buffer, not just the next one (Bug#8869).
8974
f01d3321
CY
89752012-02-23 Chong Yidong <cyd@gnu.org>
8976
8977 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8978 call when setting menu-bar-lines and tool-bar-lines parameters.
8979 (unwind_create_frame_1): New helper function.
8980
8981 * window.c (inhibit_window_configuration_change_hook): New var.
8982 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 8983 (syms_of_window): Initialize it.
f01d3321 8984
86b847b6
CY
89852012-02-22 Chong Yidong <cyd@gnu.org>
8986
8987 * xterm.c (x_draw_image_relief): Add missing type check for
8988 Vtool_bar_button_margin (Bug#10743).
8989
a59225b1
CY
89902012-02-21 Chong Yidong <cyd@gnu.org>
8991
8992 * fileio.c (Vfile_name_handler_alist): Doc fix.
8993
8994 * buffer.c (Fget_file_buffer): Protect against invalid file
8995 handler return value.
8996
310f5bd4
PE
89972012-02-20 Paul Eggert <eggert@cs.ucla.edu>
8998
cb3a28cc
PE
8999 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9000 when computing $valmask.
9001
310f5bd4
PE
9002 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9003 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9004 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9005 It's useless in that case, and it can cause problems on hosts
9006 that allocate halves of EMACS_INT values separately.
9007 Reported by Dan Horák. Diagnosed by Andreas Schwab in
9008 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9009 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9010 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
9011 it avoids undefined behavior on hosts where shifting right by more
9012 than the word width has undefined behavior.
9013
2375c96a
CY
90142012-02-19 Chong Yidong <cyd@gnu.org>
9015
9016 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9017 (Funhandled_file_name_directory, Ffile_name_as_directory)
9018 (Fdirectory_file_name, Fexpand_file_name)
9019 (Fsubstitute_in_file_name): Protect against invalid file handler
9020 return values (Bug#10845).
9021
3eb49e71
EZ
90222012-02-18 Eli Zaretskii <eliz@gnu.org>
9023
9024 * .gdbinit (pitx): Fix incorrect references to fields of the
9025 iterator stack.
9026
7b926f3f
CY
90272012-02-17 Chong Yidong <cyd@gnu.org>
9028
9029 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9030
11273115
PE
90312012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9032
9033 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9034 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9035
c3a70e2b
CY
90362012-02-15 Chong Yidong <cyd@gnu.org>
9037
9038 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9039 marked as special. Also, starting docstrings with * is obsolete.
9040
0ca43699
AS
90412012-02-13 Andreas Schwab <schwab@linux-m68k.org>
9042
9043 * gnutls.c (emacs_gnutls_write): Fix last change.
9044
2e8f3c56
LI
90452012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
9046
9047 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9048 send_process.
9049
af70074f
SM
90502012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
9051
9052 * keymap.c (Fsingle_key_description): Handle char ranges.
9053
95986d52
CY
90542012-02-12 Chong Yidong <cyd@gnu.org>
9055
afd83bd1
CY
9056 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9057 as that creates a dangerous corner case.
9058
95986d52
CY
9059 * window.c (Fdelete_window_internal): Invalidate the mouse
9060 highlight (Bug#9904).
9061
bd7da63e
GM
90622012-02-12 Glenn Morris <rgm@gnu.org>
9063
9064 * xselect.c (Fx_own_selection_internal)
9065 (Fx_get_selection_internal, Fx_disown_selection_internal)
9066 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
9067 * nsselect.m (Fx_own_selection_internal)
9068 (Fx_disown_selection_internal, Fx_selection_exists_p)
9069 (Fx_selection_owner_p, Fx_get_selection_internal):
9070 Sync docs and argument specs with the xselect.c versions.
9071
77abcbc2
LI
90722012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
9073
9074 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
9075
90b671e2
EZ
90762012-02-11 Eli Zaretskii <eliz@gnu.org>
9077
1c0ca0b7
EZ
9078 * w32select.c (Fx_selection_exists_p): Sync doc string and
9079 argument list with xselect.c. (Bug#10783)
9080
9081 * w16select.c (Fx_selection_exists_p): Sync doc string and
9082 argument list with xselect.c. (Bug#10783)
90b671e2 9083
49241268
GM
90842012-02-10 Glenn Morris <rgm@gnu.org>
9085
9086 * fns.c (Fsecure_hash): Doc fix.
9087
f998bbe7 90882012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
9089
9090 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
9091
0992bd9c
CY
90922012-02-07 Chong Yidong <cyd@gnu.org>
9093
9094 * buffer.c (Fbuffer_local_variables)
9095 (buffer_lisp_local_variables): Handle unbound vars correctly;
9096 don't let Qunbound leak into Lisp.
9097
af008560
GM
90982012-02-07 Glenn Morris <rgm@gnu.org>
9099
dd605cc4
GM
9100 * image.c (Fimagemagick_types): Doc fix.
9101
af008560
GM
9102 * image.c (imagemagick-render-type): Change it from a lisp object
9103 to an integer. Move the doc here from the lisp manual.
9104 Treat all values not equal to 0 the same.
9105
1449fa1d
CY
91062012-02-06 Chong Yidong <cyd@gnu.org>
9107
9108 * doc.c (store_function_docstring): Avoid applying docstring of
9109 alias to base function (Bug#2603).
9110
3723ec07
AS
91112012-02-04 Andreas Schwab <schwab@linux-m68k.org>
9112
9113 * .gdbinit (pp1, pv1): Remove redundant defines.
9114 (pr): Use pp.
9115
79c1cc1e
CY
91162012-02-04 Chong Yidong <cyd@gnu.org>
9117
9118 * nsterm.m: Declare a global (Bug#10694).
9119
d7f29f8e
EZ
91202012-02-04 Eli Zaretskii <eliz@gnu.org>
9121
cae07000
SM
9122 * w32.c (get_emacs_configuration_options):
9123 Include --enable-checking, if specified, in the return value.
d7f29f8e 9124
3b95a6f9
MR
91252012-02-04 Martin Rudalics <rudalics@gmx.at>
9126
9127 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9128 after rounding frame sizes. (Bug#9723)
9129
d6fa96a6
EZ
91302012-02-04 Eli Zaretskii <eliz@gnu.org>
9131
9132 * keyboard.c (adjust_point_for_property): Don't position point
9133 before BEGV. (Bug#10696)
9134
df0b2940
PE
91352012-02-03 Paul Eggert <eggert@cs.ucla.edu>
9136
9137 Handle overflow when computing char display width (Bug#9496).
9138 * character.c (char_width): Return EMACS_INT, not int.
9139 (char_width, c_string_width): Check for overflow when
9140 computing the width; this is possible now that individual
9141 characters can have unbounded width. Problem introduced
9142 by merge from Emacs 23 on 2012-01-19.
9143
6bee44d6
MA
91442012-02-02 Michael Albinus <michael.albinus@gmx.de>
9145
9146 * dbusbind.c (Fdbus_register_method): Mention the return value
9147 :ignore in the docstring.
9148
44f92739
GM
91492012-02-02 Glenn Morris <rgm@gnu.org>
9150
1b9f60cc
GM
9151 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9152
44f92739
GM
9153 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9154 Unconditionally set to t. (Bug#10673)
9155 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9156 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9157 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9158
c5d3843c
KH
91592012-02-02 Kenichi Handa <handa@m17n.org>
9160
9161 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
9162 0, do not call append_composite_glyph.
9163
159462d4 91642012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
9165
9166 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9167 NULL (Bug#6988).
9168 (x_produce_glyphs): If the component of a composition is a null
9169 string, set it->pixel_width to 1 to avoid zero-width glyph.
9170
78cef877
EZ
91712012-02-01 Eli Zaretskii <eliz@gnu.org>
9172
9173 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9174 first 2 arguments are identical. This makes inserting large
9175 output from a subprocess an order of magnitude faster on
9176 MS-Windows, where all sbrk'ed memory is always contiguous.
9177
97897668
GM
91782012-01-31 Glenn Morris <rgm@gnu.org>
9179
9180 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 9181 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
9182 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9183
31fd3586
GM
91842012-01-29 Glenn Morris <rgm@gnu.org>
9185
9186 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9187
0e24a8b2
CY
91882012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
9189
9190 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9191
cc0adcb0
CY
91922012-01-28 Chong Yidong <cyd@gnu.org>
9193
9194 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9195
acc28cb9
CY
91962012-01-26 Chong Yidong <cyd@gnu.org>
9197
9c69cfb7
CY
9198 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9199
acc28cb9
CY
9200 * search.c (Fsearch_forward, Fsearch_backward): Document negative
9201 repeat counts (Bug#10507).
9202
48da7392
GM
92032012-01-26 Glenn Morris <rgm@gnu.org>
9204
9205 * lread.c (syms_of_lread): Doc fix.
9206
14af5f7f
CY
92072012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
9208
9209 * coding.c (encode_designation_at_bol): Change return value to
9210 EMACS_INT.
9211
0b21c100
CY
92122012-01-25 Chong Yidong <cyd@gnu.org>
9213
9214 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
9215
3c2907f7
CY
92162012-01-21 Chong Yidong <cyd@gnu.org>
9217
9218 * floatfns.c (Fcopysign): Make the second argument non-optional,
9219 since nil is not allowed anyway.
9220
959ad23f
AS
92212012-01-21 Andreas Schwab <schwab@linux-m68k.org>
9222
9223 * process.c (read_process_output): Use p instead of XPROCESS (proc).
9224 (send_process): Likewise.
9225
34a02f46
MR
92262012-01-19 Martin Rudalics <rudalics@gmx.at>
9227
9228 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
9229 (Vwindow_persistent_parameters): Do not use Qstate.
9230 Rewrite doc-strings.
34a02f46 9231
1259009a 92322012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
9233
9234 * character.c (char_width): New function.
70d4fdf6
GM
9235 (Fchar_width, c_string_width, lisp_string_width):
9236 Use char_width (Bug#9496).
25ed9e61 9237
6a6ee00d
MR
92382012-01-16 Martin Rudalics <rudalics@gmx.at>
9239
9240 * window.c (Vwindow_persistent_parameters): New variable.
9241 (Fset_window_configuration, save_window_save): Handle persistent
9242 window parameters.
9243
c85efaf7
EZ
92442012-01-14 Eli Zaretskii <eliz@gnu.org>
9245
9246 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9247 thrashing the stack of the thread. (Bug#9087)
9248
5944709e
PE
92492012-01-12 Paul Eggert <eggert@cs.ucla.edu>
9250
9251 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9252
e71f5d99
EZ
92532012-01-11 Eli Zaretskii <eliz@gnu.org>
9254
9255 * xdisp.c (rows_from_pos_range): Handle the case where the
9256 highlight ends on a newline. (Bug#10464)
9257 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9258 he end column for display of highlight that ends on a newline
9259 before a R2L line.
9260
ce316182
GM
92612012-01-11 Glenn Morris <rgm@gnu.org>
9262
9263 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9264 from load-path also when installation-directory is nil. (Bug#10208)
9265
5b43da69
GM
92662012-01-10 Glenn Morris <rgm@gnu.org>
9267
74cc8ff9
GM
9268 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9269
7d8d6e4e
GM
9270 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9271 Update template values to be closer to their typical values these days.
5b43da69 9272
a0db8d43
EZ
92732012-01-09 Eli Zaretskii <eliz@gnu.org>
9274
9275 * xdisp.c (rows_from_pos_range): Accept additional argument
9276 DISP_STRING, and accept any glyph in a row whose object is that
9277 string as eligible for mouse highlight. Fixes mouse highlight of
9278 display strings from overlays. (Bug#10464)
9279
9a0115ab 92802012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 9281
b9110d6a 9282 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
9283 * fileio.c (auto_saving_dir_umask): New static var.
9284 (Fmake_directory_internal): Use it.
9285 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9286 creating the directory. The old code temporarily assigns
9287 too-generous permissions to the directory.
9288 (do_auto_save_eh): Clear it.
b9110d6a 9289 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
9290 that the var is always cleared.
9291
6c1bd3f3
EZ
92922012-01-07 Eli Zaretskii <eliz@gnu.org>
9293
9294 * search.c (scan_buffer): Pass character positions to
9295 know_region_cache, not byte positions. (Bug#6540)
9296
069d2b50
L
92972012-01-07 LynX <_LynX@bk.ru> (tiny change)
9298
9299 * w32.c (sys_rename): Report EXDEV when rename of a directory
9300 fails because the target is on another logical disk. (Bug#10284)
9301
75bf0d33
DB
93022012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9303
9304 * xterm.c (x_embed_request_focus): New function.
9305
9306 * xterm.h: Add prototype.
9307
9308 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9309
1c6e5a32
GM
93102012-01-05 Glenn Morris <rgm@gnu.org>
9311
9312 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9313
651e947e
EZ
93142012-01-01 Eli Zaretskii <eliz@gnu.org>
9315
9316 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9317 Load gnutls_transport_set_lowat only if GnuTLS version is below
9318 2.11.1.
9319 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9320 GnuTLS versions below 2.11.1.
9321
3778cdd8
AL
93222011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9323
9324 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9325 to the doc string advising against its use for altering the way
9326 windows are scrolled.
9327
0e5317f7
KH
93282011-12-28 Kenichi Handa <handa@m17n.org>
9329
9330 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9331 coding-system ASCII compatible only when it does not produce BOM
9332 on encoding (Bug#10383).
9333
93d5ca1f
JD
93342011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9335
9336 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9337 can scroll.
9338 (create_and_show_popup_menu): Always use menu_position_func for
9339 Gtk3 (Bug#10361).
9340
ca22b785
AS
93412011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9342
9343 * callint.c (Fcall_interactively): Don't truncate prompt string.
9344
d048e1e6
EZ
93452011-12-23 Eli Zaretskii <eliz@gnu.org>
9346
9347 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9348 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 9349 resumed from there (after widening). (Bug#10360)
d048e1e6 9350
5ccaba1f
JD
93512011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9352
9353 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9354
204ee57f
JD
93552011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9356
b81d40f0
JB
9357 * nsterm.m (x_free_frame_resources):
9358 Release f->output_data.ns->miniimage.
204ee57f
JD
9359 (ns_index_color): Fix indentation. Do not retain
9360 color_table->colors[i].
9361
9362 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9363 before returning.
9364
9365 * nsfns.m (x_set_background_color): Assign return value from
9366 ns_index_color to face-background instead of NSColor*.
9367 (ns_implicitly_set_icon_type): Fix indentation.
9368 Change assignment in for loop to comparison.
9369
9370 * emacs.c (ns_pool): New variable.
9371 (main): Assign ns_pool.
9372 (Fkill_emacs): Call ns_release_autorelease_pool.
9373
9374 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9375 autorelease fdesc, release fdAttrs and tdict.
9376 (ns_get_covering_families): Release charset.
9377 (ns_findfonts): Release NSFontDescriptor created with new.
9378 (ns_uni_to_glyphs): Fix indentation.
9379 (setString): Release attrStr before assigning new value.
9380
c803b2b7
JD
93812011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9382
678f4426
JD
9383 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9384 and NS_IMPL_COCOA.
9385 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9386 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9387
cd394be1 93882011-12-18 David Reitter <reitter@cmu.edu>
678f4426 9389
5fecd5fc
JD
9390 * nsterm.m (ns_term_init): Subscribe for notifications
9391 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9392 to method trackingNotification in EmacsMenu.
9393
9394 * nsmenu.m (trackingMenu): New variable.
3771cb17 9395 (trackingNotification): New method (from Aquamacs).
5fecd5fc 9396 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 9397 from Aquamacs (Bug#7030).
678f4426
JD
9398
93992011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 9400
c803b2b7
JD
9401 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9402 (symbol_to_nsstring): Fix indentation.
9403 (ns_symbol_to_pb): New function.
cae07000
SM
9404 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9405 (Fns_rotate_cut_buffers_internal): Remove.
9406 (Fns_store_selection_internal): Rename from
c803b2b7
JD
9407 Fns_store_cut_buffer_internal.
9408 (ns_get_foreign_selection, Fx_own_selection_internal)
9409 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
9410 (Fns_get_selection_internal, Fns_store_selection_internal):
9411 Use ns_symbol_to_pb and check if return value is nil.
9412 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9413 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
9414 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9415 renamed to Sns_store_selection_internal.
9416 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9417 and remove this function.
9418 (ns_handle_selection_clear): Remove, never used.
9419 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9420 here.
9421
e1b01a3a
KB
94222011-12-17 Ken Brown <kbrown@cornell.edu>
9423
9424 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9425 GID is unknown (Bug#10257).
9426
2adb6e85
PE
94272011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9428
9429 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9430 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9431 which caused a build failure on GNU/Linux IA-64. This problem was
9432 introduced by my 2011-10-07 patch.
9433
d1d7b339
JL
94342011-12-15 Juri Linkov <juri@jurta.org>
9435
9436 * image.c (imagemagick_error): New function. (Bug#10112)
9437 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9438 Use `imagemagick_error' where ImageMagick functions return
9439 `MagickFalse'.
9440 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9441 proper order.
9442
100d5755
KH
94432011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9444
9445 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9446 fill background (Bug#8992).
9447
454592a6
MR
94482011-12-13 Martin Rudalics <rudalics@gmx.at>
9449
9450 * window.c (Vwindow_combination_resize)
9451 (Vwindow_combination_limit): Use t instead of non-nil in
9452 doc-strings.
61d4b438
MR
9453 (Vrecenter_redisplay): Add first sentence of doc-string on
9454 separate line.
53524d93 9455 (Frecenter): Fix doc-string typo.
454592a6 9456
3633e3aa
KH
94572011-12-11 Kenichi Handa <handa@m17n.org>
9458
9459 * coding.c (Funencodable_char_position): Pay attention to the
9460 buffer text relocation (Bug#9389).
9461
7b9d523a 94622011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 9463
7b9d523a
JD
9464 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9465 gtk_init (Bug#10100).
9466
b73189c6
EZ
94672011-12-10 Eli Zaretskii <eliz@gnu.org>
9468
9469 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9470 IT->string is nil. (Bug#10263)
9471
f7dfe5d6
JD
94722011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9473
83faebb4
JD
9474 * nsterm.h (x_free_frame_resources): Declare.
9475
f7dfe5d6
JD
9476 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9477 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9478
9479 * nsterm.h (ns_get_defaults_value): Declare.
9480
9481 * nsterm.m (ns_default): Call ns_get_defaults_value.
9482
7cd4e72c
EZ
94832011-12-09 Eli Zaretskii <eliz@gnu.org>
9484
9485 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9486 (Bug#10170)
9487
b34d7317
YM
94882011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9489
9490 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9491 that where the value of an _OBJC_* symbol points to is in the .bss
9492 section (Bug#10240).
9493
76470ad1
KH
94942011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9495
9496 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 9497 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 9498
745fff94
KH
94992011-12-08 Kenichi Handa <handa@m17n.org>
9500
9501 * ftfont.c (get_adstyle_property): Fix previous change
9502 (Bug#10233).
9503
6e44397c
JB
95042011-12-07 Juanma Barranquero <lekktu@gmail.com>
9505
9506 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9507 dirs from the default value of EMACSLOADPATH (bug#10208).
9508
7efa6272
GM
95092011-12-07 Glenn Morris <rgm@gnu.org>
9510
9511 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9512 installation and source directories as well. (Bug#10208)
9513
f6fc4d87
CY
95142011-12-06 Chong Yidong <cyd@gnu.org>
9515
9516 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9517
2bf26180
GM
95182011-12-06 Glenn Morris <rgm@gnu.org>
9519
9520 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9521 as an error, not just -1. (Bug#10217)
9522
3a6ad4f0
CY
95232011-12-05 Chong Yidong <cyd@gnu.org>
9524
9525 * keyboard.c (process_special_events): New function.
9526 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9527
75a3b399
PE
95282011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9529
9530 * coding.c (encode_designation_at_bol): Don't use uninitialized
9531 local variable (Bug#9318).
9532
c3c9e25e
KH
95332011-12-05 Kenichi Handa <handa@m17n.org>
9534
9535 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9536 return Qnil (Bug#8046, Bug#10193).
9537
5eb05ea3
KH
95382011-12-05 Kenichi Handa <handa@m17n.org>
9539
9540 * coding.c (encode_designation_at_bol): New args charbuf_end and
9541 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
9542 (coding_set_source): Return how many bytes coding->source was
9543 relocated.
9544 (coding_set_destination): Return how many bytes
9545 coding->destination was relocated.
9546 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 9547 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
9548
95492011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9550
9551 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9552 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9553 macro (Bug#9318).
9554
95552011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9556
9557 The following changes are to fix Bug#9318.
9558
a79703f5 9559 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
9560 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9561 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 9562 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 9563
7dbda6df
JB
95642011-12-05 Juanma Barranquero <lekktu@gmail.com>
9565
9566 * lisp.h (process_quit_flag): Fix external declaration.
9567
6d5eb5b0
SM
95682011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9569
9570 Don't macro-inline non-performance-critical code.
9571 * eval.c (process_quit_flag): New function.
9572 * lisp.h (QUIT): Use it.
9573
a0c3fad0
JD
95742011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9575
9576 * nsfns.m (get_geometry_from_preferences): New function.
9577 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9578
6c07aac2
AS
95792011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9580
9581 * emacs.c (Qkill_emacs): Define.
9582 (syms_of_emacs): Initialize it.
9583 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9584 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
9585 (quit_throw_to_read_char): Add parameter `from_signal'.
9586 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
9587 * lisp.h (QUIT): Call Fkill_emacs if requested.
9588
c052ead4
JD
95892011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9590
9591 * widget.c (update_wm_hints): Return if wmshell is null.
9592 (widget_update_wm_size_hints): New function.
9593
9594 * widget.h (widget_update_wm_size_hints): Declare.
9595
9596 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9597 widget_update_wm_size_hints (Bug#10104).
9598
9e49252b
EZ
95992011-12-03 Eli Zaretskii <eliz@gnu.org>
9600
9601 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9602 before a newline, prepare the bidi iterator for consuming the
9603 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 9604 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 9605
02b16839
JL
96062011-12-02 Juri Linkov <juri@jurta.org>
9607
9608 * search.c (Fword_search_regexp): New Lisp function created from
9609 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9610 (Fword_search_backward, Fword_search_forward)
9611 (Fword_search_backward_lax, Fword_search_forward_lax):
9612 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9613 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9614
0068070e
SM
96152011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9616
9617 * fileio.c (Finsert_file_contents): Move after-change-function call
9618 to before the "handled:" label, since all "goto handled" appear in
9619 cases where the *-change-functions have already been properly called
9620 (bug#10117).
9621
3360a3fc
AS
96222011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9623
9624 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9625 waiting for input. (Bug#10169)
9626
73d6c093
EZ
96272011-11-30 Eli Zaretskii <eliz@gnu.org>
9628
9629 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9630 verifies glyph row's hash code--we have just reallocated the
9631 glyphs, so their contents can be complete garbage. (Bug#10164)
9632
febe6bea
JB
96332011-11-30 Juanma Barranquero <lekktu@gmail.com>
9634
9635 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9636
801a4313
EZ
96372011-11-30 Eli Zaretskii <eliz@gnu.org>
9638
9639 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9640 attributes are tested _before_ calling verify_row_hash, to protect
9641 against GCC re-ordering of the tests. (Bug#10164)
9642
2b56b87e
JD
96432011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9644
9645 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9646
9647 * xterm.c (handle_one_xevent): Only set async_visible and friends
9648 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 9649 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
9650 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9651
dbf31225
PE
96522011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9653
9654 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9655 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9656 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9657 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9658 All uses changed to use GCPRO1 etc.
9659 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9660 Revert to old implementation (i.e., before 2011-03-11).
9661
1305621b
YM
96622011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9663
9664 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9665 of scroll runs so as to avoid assigning disabled bogus rows and
9666 unnecessary graphics copy operations.
9667
8c9afb46
EZ
96682011-11-27 Eli Zaretskii <eliz@gnu.org>
9669
9670 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9671 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9672 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9673 (malloc, free, realloc, calloc): Redirect to e_* only when
9674 compiling Emacs.
9675
9676 * lisp.h (GCTYPEBITS): Move before first use.
9677 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9678 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9679 this macro definition.
9680
9681 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9682 _MSC_VER.
9683
54e9e3bf
JD
96842011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9685
6d5eb5b0
SM
9686 * gtkutil.c (xg_create_frame_widgets):
9687 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
9688 present with Gtk+ 2.0.
9689
83aca1cb
PE
96902011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9691
9692 * fileio.c (Finsert_file_contents): Undo previous change; see
9693 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9694
5b76caa4
PE
96952011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9696
9697 Rename locals to avoid shadowing.
9698 * fileio.c (Finsert_file_contents):
9699 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9700 * process.c (wait_reading_process_output):
9701 Rename inner 'proc' to 'p' to avoid shadowing.
9702 Indent for consistency with usual Emacs style.
9703
8c535114
EZ
97042011-11-25 Eli Zaretskii <eliz@gnu.org>
9705
9706 * xdisp.c (redisplay_window): If cursor row is not fully visible
9707 after recentering, and scroll-conservatively is set to a large
9708 number, scroll window by a few more lines to make the cursor fully
9709 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
9710 (start_display): Don't move to the next line if the display should
9711 start at a newline that is part of a display vector or an overlay
9712 string. (Bug#10119)
8c535114 9713
fa4fdb5c
JL
97142011-11-24 Juri Linkov <juri@jurta.org>
9715
9716 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9717 after the `MagickPingImage' call. (Bug#10112)
9718
90ec88df
CY
97192011-11-23 Chong Yidong <cyd@gnu.org>
9720
9721 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9722
56e2e794
MR
97232011-11-23 Martin Rudalics <rudalics@gmx.at>
9724
9725 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9726 making another buffer current. (Bug#10114)
9727
b6e64c41
GM
97282011-11-23 Glenn Morris <rgm@gnu.org>
9729
9730 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9731
6b21de18
CY
97322011-11-23 Chong Yidong <cyd@gnu.org>
9733
9734 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9735 using it (Bug#5984).
9736
b12cd789
EZ
97372011-11-22 Eli Zaretskii <eliz@gnu.org>
9738
9739 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9740 and header-lines, as they don't have one computed for them.
9741 (Bug#10098)
9742
9743 * .gdbinit (prow): Make displayed values more self-explaining.
9744 Add row's hash code.
9745
261b6fd4
LMI
97462011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9747
9748 * process.c (wait_reading_process_output): Fix asynchrounous
9749 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 9750 (wait_reading_process_output): Add comment and URL.
261b6fd4 9751
e7cfd277
JD
97522011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9753
9754 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9755
a9b9b7f5
CY
97562011-11-21 Chong Yidong <cyd@gnu.org>
9757
9758 * window.c (Fnext_window, Fprevious_window): Doc fix.
9759
b0d15b4f
SM
97602011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9761
9762 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9763
fe7a3057
JB
97642011-11-20 Juanma Barranquero <lekktu@gmail.com>
9765
9766 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9767
d2999b1a
MR
97682011-11-20 Martin Rudalics <rudalics@gmx.at>
9769
9770 * window.c (Fset_window_combination_limit): Rename argument
9771 STATUS to LIMIT.
9772 (Vwindow_combination_limit): Remove "status" from doc-string.
9773
d5ff9cd0
AS
97742011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9775
9776 * m/ibms390.h: Remove.
9777 * m/ibms390x.h: Don't include "ibms390.h".
9778
a5bb9bd3
SM
97792011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9780
9781 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9782 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9783
cd1181db
JB
97842011-11-20 Juanma Barranquero <lekktu@gmail.com>
9785
9786 * casetab.c (Fset_case_table):
9787 * charset.c (Fcharset_after): Fix typos.
9788
615a3b8d 97892011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 9790
17e845af
PE
9791 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9792 Otherwise, valgrind does not work on some platforms.
9793 Problem reported by Andreas Schwab in
6a0bf43d
PE
9794 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9795 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9796 is set, removing the need for VIRT_ADDRESS_VARIES.
9797 (PURE_P): Use a more-efficient implementation that needs just one
9798 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9799 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9800 to 4 (xorl, subq, cmpq, setbe).
9801 * alloc.c (pure): Always extern now, since that's the
9802 VIRT_ADDR_VARIES behavior.
9803 (PURE_POINTER_P): Use a single comparison, not two, for
9804 consistency with the new puresize.h.
9805 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9806 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9807 Remove VIRT_ADDR_VARIES no longer needed.
9808
f8fe6f96
EZ
98092011-11-19 Eli Zaretskii <eliz@gnu.org>
9810
9811 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9812 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9813 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9814 behave as if the cursor position were at the window margin.
9815
9816 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9817 and the cursor position is out of bounds, behave as if the cursor
9818 position were at the window margin. (Bug#10075)
9819
df05a53c
CY
98202011-11-18 Chong Yidong <cyd@gnu.org>
9821
9822 * window.c (Fwindow_combination_limit): Make first argument
9823 non-optional, since it is meaningless for live windows like the
9824 selected window.
61ccba97 9825
2071918e
DA
98262011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9827
9828 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9829
b50a28de
SM
98302011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9831
9832 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9833 (graft_intervals_into_buffer): Simplify.
9834
015137db
EZ
98352011-11-18 Eli Zaretskii <eliz@gnu.org>
9836
9837 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9838 hash values of the two rows.
9839 (copy_row_except_pointers): Preserve the used[] arrays and the
9840 hash values of the two rows. (Bug#10035)
68c95424 9841 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
9842
9843 * xdisp.c (row_hash): New function, body extracted from
9844 compute_line_metrics.
9845 (compute_line_metrics): Call row_hash, instead of computing the
9846 hash code inline.
9847
9848 * dispnew.c (verify_row_hash): Call row_hash for computing the
9849 hash code of a row, instead of duplicating code from xdisp.c.
9850
9851 * dispextern.h (row_hash): Add prototype.
9852
a2addb04
TH
98532011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9854
9855 * frame.c (delete_frame): Don't delete the terminal when the last
9856 X frame is closed if emacs is built with GTK toolkit.
9857
df85d315
JB
98582011-11-17 Juanma Barranquero <lekktu@gmail.com>
9859
9860 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9861
a0c2d0ae
MR
98622011-11-17 Martin Rudalics <rudalics@gmx.at>
9863
9864 * window.c (Vwindow_splits): Rename to
9865 Vwindow_combination_resize. Suggested by Juri Linkov.
9866 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9867 of Vwindow_splits.
9868
58179cce
JB
98692011-11-16 Juanma Barranquero <lekktu@gmail.com>
9870
7877f373
JB
9871 * nsfns.m (Fns_font_name):
9872 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 9873
b6f67890
MR
98742011-11-16 Martin Rudalics <rudalics@gmx.at>
9875
9876 * window.h (window): Rename slot "nest" to "combination_limit".
9877 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9878 (Fset_window_nest): Rename to Fset_window_combination_limit.
9879 (Vwindow_nest): Rename to Vwindow_combination_limit.
9880 (recombine_windows, make_parent_window, make_window)
9881 (Fsplit_window_internal, saved_window)
9882 (Fset_window_configuration, save_window_save): Rename all
9883 occurrences of window_nest to window_combination_limit.
9884
c7015153
JB
98852011-11-15 Juanma Barranquero <lekktu@gmail.com>
9886
9887 * image.c (imagemagick_load_image): Fix typo.
9888
322ad6ec
EZ
98892011-11-14 Eli Zaretskii <eliz@gnu.org>
9890
9891 * xdisp.c (display_line): Move the call to
9892 highlight_trailing_whitespace before the call to
9893 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
9894 faces of all the glyphs to compute ROW's hash value.
9895 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 9896
f067b8ec
JB
98972011-11-14 Juanma Barranquero <lekktu@gmail.com>
9898
9899 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9900 just return (bug#10044).
9901
1e5b2111
EZ
99022011-11-12 Eli Zaretskii <eliz@gnu.org>
9903
7ef3cbd5
EZ
9904 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9905 with user-defined heap size. Bump the default size of the temacs
9906 heap to 27MB, to avoid memory warning when running temacs.
9907 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9908
1e5b2111
EZ
9909 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9910 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
9911 (verify_row_hash) [XASSERTS]: New function.
9912 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9913 that the hash value of glyph rows is correct.
1e5b2111 9914
89d61221
MR
99152011-11-12 Martin Rudalics <rudalics@gmx.at>
9916
9917 * window.h (window): Remove splits slot.
9918 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9919 (Fdelete_other_windows_internal, make_parent_window)
9920 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9921 (Fset_window_configuration, save_window_save): Don't deal with
9922 split status of windows.
9923 (saved_window): Remove splits slot.
9924 (Vwindow_splits): Rewrite doc-string.
9925
97f18cc8
JD
99262011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9927
9928 * xfns.c (unwind_create_frame):
9929 * nsfns.m (unwind_create_frame):
9930 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9931 Vframe_list (Bug#9999).
9932
22a648b4
DA
99332011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9934
0b381c7e 9935 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 9936
659afede
KH
99372011-11-11 Kenichi Handa <handa@m17n.org>
9938
9939 * callproc.c (Fcall_process): Set the member dst_multibyte of
9940 process_coding.
9941
9ac0394b
KH
99422011-11-11 Johan Bockgård <bojohan@gnu.org>
9943
9944 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9945 avoid a crash (bug#9496).
9946
2fbdc249
CY
99472011-11-09 Chong Yidong <cyd@gnu.org>
9948
9949 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9950 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9951
ac6b1f81
PE
99522011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9953
9954 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9955
09db192c
PE
99562011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9957
9958 Avoid some portability problems by eschewing 'extern inline' functions.
9959 The trivial performance wins aren't worth the portability hassles; see
9960 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9961 et seq.
9962 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9963 (window_box_width, window_box_left, window_box_left_offset)
9964 (window_box_right, window_box_right_offset): Undo previous change,
9965 by removing the "extern"s.
9966 * intervals.c (adjust_intervals_for_insertion)
9967 (adjust_intervals_for_deletion): Undo previous change,
9968 making these static again.
9969 (offset_intervals, temp_set_point_both, temp_set_point)
9970 (copy_intervals_to_string): No longer inline.
9971 * xdisp.c (window_text_bottom_y, window_box_width)
9972 (window_box_height, window_box_left_offset)
9973 (window_box_right_offset, window_box_left, window_box_right)
9974 (window_box): No longer inline.
9975
105216ed
CY
99762011-11-08 Chong Yidong <cyd@gnu.org>
9977
9978 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
9979 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9980 Signal an error if not a live window.
105216ed
CY
9981 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9982 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9983
ae9e237f
JB
99842011-11-07 Juanma Barranquero <lekktu@gmail.com>
9985
9986 * lisp.h (syms_of_abbrev): Remove declaration.
9987 Reported by CHENG Gao <chenggao@royau.me>.
9988
c7aa8333
EZ
99892011-11-07 Eli Zaretskii <eliz@gnu.org>
9990
9991 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9992 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
9993 of temacs in GUI mode.
9994
be7f5545
MR
99952011-11-07 Martin Rudalics <rudalics@gmx.at>
9996
9997 * window.h: Declare delete_all_child_windows instead of
9998 delete_all_subwindows.
9999 * window.c (Fwindow_nest, Fset_window_nest)
10000 (Fset_window_new_total, Fset_window_new_normal)
10001 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10002 (delete_all_subwindows): Rename to delete_all_child_windows.
10003 (Fdelete_other_windows_internal, Fset_window_configuration):
10004 Call delete_all_child_windows instead of delete_all_subwindows.
10005 * frame.c (delete_frame): Call delete_all_child_windows instead
10006 of delete_all_subwindows.
10007
ca78dc43
PE
100082011-11-07 Paul Eggert <eggert@cs.ucla.edu>
10009
10010 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10011 This is also needed for porting to any host where GC_MARK_STACK is
10012 not GC_MAKE_GCPROS_NOOPS.
10013 (which_symbols): Use it.
10014
a0241d01
KH
100152011-11-07 Kenichi Handa <handa@m17n.org>
10016
10017 * coding.c (coding_set_destination): Check coding->src_pos only
10018 when coding->src_object is a buffer (bug#9910).
10019
10020 * process.c (send_process): Set the member src_multibyte of coding
10021 to 0 (bug#9911) when sending a unibyte text.
10022
10023 * callproc.c (Fcall_process): Set the member src_multibyte of
10024 process_coding to 0 (bug#9912).
10025
a64bfdfa 100262011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
10027
10028 * xmenu.c (cleanup_widget_value_tree): New function.
10029 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10030 calling free_menubar_widget_value_tree directly (Bug#9830).
10031
cb41b32a
PE
100322011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10033
10034 Fix some portability problems with 'inline'.
10035 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10036 (window_box_width, window_box_left, window_box_left_offset)
10037 (window_box_right, window_box_right_offset): Declare extern.
10038 Otherwise, these inline functions do not conform to C99 and
10039 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
10040 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10041 * intervals.c (adjust_intervals_for_insertion)
10042 (adjust_intervals_for_deletion): Now extern, because otherwise the
10043 extern inline functions 'offset_intervals' couldn't refer to it.
10044 (static_offset_intervals): Remove.
10045 (offset_intervals): Rewrite using the old contents of
10046 static_offset_intervals. The old version didn't conform to C99
10047 because an extern inline function contained a reference to an
10048 identifier with static linkage.
10049
b7041366
AS
100502011-11-06 Andreas Schwab <schwab@linux-m68k.org>
10051
10052 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10053 GC.
10054
88a37c4d
EZ
100552011-11-06 Eli Zaretskii <eliz@gnu.org>
10056
10057 * xdisp.c (init_iterator, reseat_to_string): Don't set the
10058 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
10059 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10060 return Qleft_to_right.
10061
49745b39
CY
100622011-11-06 Chong Yidong <cyd@gnu.org>
10063
10064 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
10065 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
10066 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
10067 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
10068 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
10069 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
10070 (Fwindow_vscroll): Doc fix.
10071 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
10072 argument, since it makes no sense to pass a live window and for
10073 consistency with window-child.
10074
1f05cd82
CS
100752011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
10076
10077 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
10078 support MSVC.
10079
22610910
JR
100802011-11-05 Jason Rumney <jasonr@gnu.org>
10081
10082 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
10083 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
10084 fonts (Bug#6029).
10085 (add_font_entity_to_list): Fix logic errors in mixed boolean and
10086 bitwise arithmetic preventing use of unicode-sip and non-truetype
10087 opentype fonts.
10088
a06776b2
EZ
100892011-11-05 Eli Zaretskii <eliz@gnu.org>
10090
3ad924ba
EZ
10091 * s/ms-w32.h (fstat, stat, utime): Move redirections to
10092 "emacs"-only part.
10093
a06776b2
EZ
10094 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
10095 initialization code to keep similarity to xfns.c after changes
10096 from 2011-11-05.
10097
c9e7db78
JD
100982011-11-05 Jan Djärv <jan.h.d@swipnet.se>
10099
a97f8f3f
JD
10100 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
10101 (unwind_create_frame): New function (Bug#9943).
10102 (Fx_create_frame): Restructure code to be more similar to the one in
10103 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
10104 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
10105 Move terminal->reference_count++ just before making the frame official
10106 (Bug#9943).
10107
10108 * nsterm.m (x_free_frame_resources): New function.
10109 (x_destroy_window): Move code to x_free_frame_resources.
10110
c9e7db78 10111 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
10112 (Fx_create_frame, x_create_tip_frame):
10113 Move terminal->reference_count++ just before making the frame
75f1671a 10114 official. Move initialization of image_cache_refcount and
c9e7db78
JD
10115 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
10116
a6fc3b5c
EZ
101172011-11-05 Eli Zaretskii <eliz@gnu.org>
10118
10119 Support MSVC build with newer versions of Visual Studio.
10120 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
10121 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
10122 nt/gmake.defs.
10123
10124 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10125 which are not supported by MSVC.
10126 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10127 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10128 bitfields.
10129 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10130 types in bitfields.
10131 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10132
10133 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10134
58179cce 101352011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
10136
10137 Support MSVC build with newer versions of Visual Studio.
10138 * w32.c: Don't include w32api.h for MSVC.
10139 (init_environment) [_MSC_VER]: Call sys_access, not _access.
10140
10141 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10142 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10143 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10144 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10145 e_* cousins.
10146 (alloca) [_MSC_VER]: Define to _alloca.
10147
10148 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10149
10150 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10151
a58c13ed
EZ
101522011-11-04 Eli Zaretskii <eliz@gnu.org>
10153
10154 * xdisp.c (note_mouse_highlight): If either of
10155 previous/next-single-property-change returns nil, treat that as
10156 the beginning or the end of the buffer. (Bug#9955)
10157
fe0b6370
JD
101582011-11-04 Jan Djärv <jan.h.d@swipnet.se>
10159
a58c13ed 10160 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
10161 label is not null (Bug#9951).
10162 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10163 may be NULL.
10164
89bd5ee1
EZ
101652011-11-04 Eli Zaretskii <eliz@gnu.org>
10166
10167 * window.c (Fwindow_body_size): Mention in the doc string that the
10168 return value is in frame's canonical units. (Bug#9949)
10169
84c3edb9
EZ
101702011-11-03 Eli Zaretskii <eliz@gnu.org>
10171
4e2fb5c7
EZ
10172 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
10173
84c3edb9 10174 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 10175 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 10176 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 10177
bc17a887
EZ
101782011-11-01 Eli Zaretskii <eliz@gnu.org>
10179
10180 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10181 Don't stop backward scan on the continuation glyph, even though
10182 its CHARPOS is positive.
6d5eb5b0
SM
10183 (mouse_face_from_buffer_pos, note_mouse_highlight):
10184 Rename cover_string to disp_string.
bc17a887 10185
4ee88440
MR
101862011-11-01 Martin Rudalics <rudalics@gmx.at>
10187
10188 * window.c (temp_output_buffer_show): Don't use
10189 Vtemp_buffer_show_specifiers.
10190 (Vtemp_buffer_show_specifiers): Remove unused variable.
10191
c2ff3c02
EZ
101922011-10-30 Eli Zaretskii <eliz@gnu.org>
10193
10194 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10195 past the beginning of the current glyph matrix.
10196
58179cce 101972011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
10198
10199 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10200 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10201 HAVE_GTK3 (Bug#9869).
b77a6a7f 10202
3b574623
JD
10203 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10204 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10205
b77a6a7f
JD
10206 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10207
10208 * xterm.c: Declare x_handle_net_wm_state to return int.
10209 (handle_one_xevent): Check if we are iconified but don't have
10210 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
10211 (get_current_wm_state): Return non-zero if not hidden,
10212 check for _NET_WM_STATE_HIDDEN (Bug#9893).
10213 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
10214 (x_handle_net_wm_state): Return what get_current_wm_state returns.
10215 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
10216
196e41e4
PE
102172011-10-29 Paul Eggert <eggert@cs.ucla.edu>
10218
10219 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
10220 so that this new function doesn't get optimized away by a
10221 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
10222
021f2e1a
AS
102232011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10224
10225 * frame.h (MOUSE_HL_INFO): Remove excess parens.
10226
8b058d44
EZ
102272011-10-29 Eli Zaretskii <eliz@gnu.org>
10228
10229 Fix the `xbytecode' command.
10230 * .gdbinit (xprintbytestr): New command.
b50a28de 10231 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
10232 (xbytecode): Print the byte-code string as well.
10233
4452fb80
EZ
102342011-10-29 Kim Storm <storm@cua.dk>
10235
8b058d44
EZ
10236 * alloc.c (which_symbols): New function.
10237
21b72067
AS
102382011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10239
10240 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
10241 line. (Bug#9903)
10242
83ed7b5c
GM
102432011-10-29 Glenn Morris <rgm@gnu.org>
10244
10245 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10246 Not clear what it was for, and it causes various bugs. (Bug#9839)
10247
5a7a728b
EZ
102482011-10-28 Eli Zaretskii <eliz@gnu.org>
10249
10250 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10251 possible random value that matches one of those tested as
10252 condition to clear the mouse face.
10253
d3d0842f
CY
102542011-10-28 Chong Yidong <cyd@gnu.org>
10255
10256 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10257
31b39d13
DN
102582011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
10259
10260 * window.c (make_window): Initialize phys_cursor_on_p.
10261
9aba6043
SM
102622011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
10263
10264 * lisp.h (struct Lisp_Symbol): Update comments.
10265
c20992f4
JB
102662011-10-28 Juanma Barranquero <lekktu@gmail.com>
10267
10268 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10269
db4f02f2
EZ
102702011-10-28 Eli Zaretskii <eliz@gnu.org>
10271
10272 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
10273 <oslsachem@gmail.com> for helping to debug this.
10274
10275 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10276 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10277 (g_b_init_get_glyph_outline_w): New static variables.
10278 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10279 (GetGlyphOutlineW_Proc): New typedefs.
10280 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
10281 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10282 New functions.
10283 (w32font_open_internal, compute_metrics):
10284 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
10285 instead of calling the "wide" APIs directly.
10286
10287 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10288
10289 * w32.h (syms_of_w32font): Add prototype.
10290
87e68db4
JB
102912011-10-27 Juanma Barranquero <lekktu@gmail.com>
10292
10293 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10294 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10295 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10296 (Fmove_to_window_line): Doc fix.
10297
435c1d67
CY
102982011-10-27 Chong Yidong <cyd@gnu.org>
10299
10300 * process.c (make_process): Set gnutls_state to NULL.
10301
10302 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10303 non-NULL, regardless of GNUTLS_INITSTAGE.
10304 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10305 an error. Set process slots as soon as we allocate them.
10306
10307 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10308
9c6c6f49
CY
103092011-10-27 Chong Yidong <cyd@gnu.org>
10310
9aba6043
SM
10311 * gnutls.c (emacs_gnutls_deinit): New function.
10312 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
10313 (Fgnutls_deinit, Fgnutls_boot): Use it.
10314
10315 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10316 (deactivate_process): Call emacs_gnutls_deinit.
10317
657d08d3
JB
103182011-10-27 Juanma Barranquero <lekktu@gmail.com>
10319
10320 * image.c (x_create_x_image_and_pixmap):
10321 * w32.c (sys_rename, w32_delayed_load):
10322 * w32font.c (fill_in_logfont):
10323 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10324
5430d399
JB
103252011-10-26 Juanma Barranquero <lekktu@gmail.com>
10326
10327 * w32fns.c (w32_default_color_map): New function,
10328 extracted from Fw32_default_color_map.
a7ef684b 10329 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 10330
fe0055fa
PE
103312011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10332
10333 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10334
e6346438
SM
103352011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10336
10337 * keyboard.c (test_undefined): New function (bug#9751).
10338 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10339
e112cc37
ET
103402011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10341
10342 * sysdep.c (init_sys_modes): Fix the check for the controlling
10343 terminal (Bug#6649).
10344
7b5d6677
EZ
103452011-10-20 Eli Zaretskii <eliz@gnu.org>
10346
10347 * dispextern.h (struct bidi_it): New member next_en_type.
10348
10349 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10350 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10351 current character, check also for next_en_type being WEAK_EN.
10352 (bidi_resolve_weak): Don't enter the expensive loop if the current
10353 position is before next_en_pos. Record the bidi type of the first
10354 non-ET, non-BN character we find, in addition to its position.
10355 (bidi_level_of_next_char): Invalidate next_en_type when
10356 next_en_pos is over-stepped.
10357
7da0b018
PE
103582011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10359
10360 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10361 * editfns.c: Rewrite current-time-zone so that it invokes
10362 the equivalent of (format-time-string "%Z") to get the time zone name.
10363 This fixes a bug when the time zone name contains characters that
10364 need converting from the system time locale to Emacs internal format.
10365 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10366 that patch fixed format-time-string to do the conversion, but
10367 I forgot to fix current-time-zone.
10368 (format_time_string): New function, containing most of
10369 what Fformat_time_string used to contain.
10370 (Fformat_time_string): Rewrite in terms of format_time_string.
10371 This doesn't change this function's behavior.
10372 (current-time-zone): Rewrite to use format_time_string.
10373 This fixes the bug reported by Michael Schierl in
10374 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10375 Jason Rumney's 2007-06-07 change worked around this bug, but
10376 didn't fix it.
10377 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10378
8547b010
EZ
103792011-10-19 Eli Zaretskii <eliz@gnu.org>
10380
10381 * xdisp.c (start_display): If the character at POS is displayed
10382 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
10383 (try_window_reusing_current_matrix): If a line ends in a display
10384 vector or the next line starts in a display vector, continue
10385 redrawing the window even though the character position of
10386 start_row was reached.
8547b010
EZ
10387 (Bug#9771, part 2)
10388
4e948d15
CY
103892011-10-18 Chong Yidong <cyd@gnu.org>
10390
10391 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10392 with nobreak-char-display too.
10393
4787455f
EZ
103942011-10-18 Eli Zaretskii <eliz@gnu.org>
10395
10396 Fix part 3 of bug#9771.
10397 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10398 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10399 non-neutral characters if the current character is a paragraph
10400 separator (a.k.a. Newline). This avoids running the same
10401 expensive loop twice, once when we consume the preceding newline
10402 and the other time when the line actually needs to be displayed.
10403 Avoid the loop when we see neutrals on the base embedding level
10404 following a character whose directionality is the same as the
10405 paragraph's. This avoids running the expensive loop when a line
10406 ends in a long sequence of neutrals, like control characters.
10407 Add assertion against STRONG_AL type. Slightly rearrange code
10408 that determines the type of a neutral given the first non-neutral
10409 that follows it.
10410 (bidi_level_of_next_char): Set next_en_pos to zero when
10411 invalidating its info.
10412
2c91f553
EZ
104132011-10-17 Eli Zaretskii <eliz@gnu.org>
10414
10415 * xdisp.c (push_display_prop): Determine whether to record string
10416 or buffer position by IT->string, not by IT->method. Allow
10417 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
10418 (move_it_vertically_backward): Don't look for character position
10419 immediately after the newline when in a continuation line.
10420 (Bug#9771, part 1)
2c91f553 10421
c7b08b0d
MR
104222011-10-15 Martin Rudalics <rudalics@gmx.at>
10423
10424 * window.c (coordinates_in_window): Rewrite and delabelize
10425 vertical border check. (Bug#5357) (Bug#9618)
10426
6b02f655
SM
104272011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10428
10429 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10430 errors in XSetWindowBorder (bug#9310).
10431
81d40c92
DA
104322011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10433
10434 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10435 avoid crash when xmalloc overrun checking is enabled.
10436
d4172c3b
EZ
104372011-10-13 Eli Zaretskii <eliz@gnu.org>
10438
10439 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10440 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10441 cursor motion with <left> and <right> arrow keys.
10442
10443 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10444 some callers set that themselves.
10445
b00eea75
EZ
104462011-10-12 Eli Zaretskii <eliz@gnu.org>
10447
10448 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10449 display string and the previous row comes from the same string and
10450 is empty. (Bug#9739) (Bug#9738)
10451
8fe012c4
SM
104522011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10453
10454 * doc.c (get_doc_string): Encode file name (bug#9735).
10455
0074aef2
EZ
104562011-10-12 Eli Zaretskii <eliz@gnu.org>
10457
79beb178
EZ
10458 * bidi.c (bidi_level_of_next_char):
10459 * xdisp.c (get_visually_first_element): Remove old incorrect
10460 comments regarding the Unicode Line Separator character.
10461
0074aef2
EZ
10462 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10463
6e4b3fbe
DA
104642011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10465
10466 * alloc.c (Fgc_status): Do not access beyond zombies array
10467 boundary if nzombies > MAX_ZOMBIES.
10468 * alloc.c (dump_zombies): Add missing format specifier.
10469
0324f3af
PE
104702011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10471
b5525cac
PE
10472 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10473 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10474
0324f3af
PE
10475 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10476 Some packages use them to denote characters with modifiers.
10477
e9b5f888
AS
104782011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10479
10480 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10481 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10482 matching a pp-number. Rename parameter var to var1.
10483
127827c0
SM
104842011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10485
10486 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10487
c8fd3bd0
GM
104882011-10-08 Glenn Morris <rgm@gnu.org>
10489
10490 * callint.c (Fcall_interactively): Give a more explicit error for the
10491 'c' case with a non-character input. (Bug#8479)
10492
352ec8ff
EZ
104932011-10-08 Eli Zaretskii <eliz@gnu.org>
10494
03669ccb
EZ
10495 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10496 lines.
7061c986
EZ
10497 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10498 lines that are hscrolled on the left.
03669ccb 10499
352ec8ff
EZ
10500 * dispnew.c (buffer_posn_from_coords): Account for a possible
10501 presence of header-line. (Bug#4426)
10502
a66cfb1c
SM
105032011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10504
6b02f655
SM
10505 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10506 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 10507
7c5ee88e
PE
105082011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10509
10510 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10511 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10512 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10513 this makes Emacs dump core during garbage collection on rare
10514 occasions. sizeof is obviously inferior to offsetof here, so
10515 stick with offsetof.
10516 (GC_POINTER_ALIGNMENT): New macro.
10517 (mark_memory): Omit 3rd (offset) arg; caller changed.
10518 Don't assume EMACS_INT alignment is the same as pointer alignment.
10519
df1bbe5b
SM
105202011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10521
10522 * keyboard.c (read_key_sequence_remapped): New var.
10523 (read_key_sequence): Compute remapping in the right buffer.
10524 (command_loop_1): Use read_key_sequence's remapping directly.
10525
51553db6
SM
105262011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10527
32c1fffd
SM
10528 * dired.c (file_name_completion): Don't expand file name.
10529 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10530 before checking file name handler.
10531
51553db6
SM
10532 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10533 they've been requested explicitly (bug#9591).
10534
b6bd1599 105352011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
10536
10537 * keymap.c (Fsingle_key_description): Use make_specified_string
10538 instead of build_string to build string from push_key_description.
10539 (Bug#5193)
10540
f701dc2a
PE
105412011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10542
4222c55d
PE
10543 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10544 This fixes a Y2038 bug on 64-bit hosts.
10545 * buffer.c (reset_buffer):
10546 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10547 (Fclear_buffer_auto_save_failure):
10548 Use 0, not -1, to represent an unset failure time, since time_t
10549 might not be signed.
10550
f701dc2a
PE
10551 Remove dependency on glibc malloc internals.
10552 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10553 Move back here from lisp.h, but with their new implementations.
10554 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10555 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10556 * charset.c (charset_table_init): New static var.
10557 (syms_of_charset): Use it instead of xmalloc. This removes a
10558 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10559 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10560 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10561 Move back to alloc.c.
10562 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10563 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10564
9ceebf39
JD
105652011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10566
10567 * nsterm.m (windowDidResize): Call x_set_window_size only when
10568 ns_in_resize is true. Otherwise set pixelwidth/height and
10569 call change_frame_size (Bug#9628).
10570
cb993c58
PE
105712011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10572
3930c88b
PE
10573 Port --enable-checking=all to Fedora 14 x86-64.
10574 * charset.c (syms_of_charset): Also account for glibc malloc's
10575 internal overhead when calculating the initial malloc maximum.
10576
cb993c58
PE
10577 Port --enable-checking=all to Fedora 14 x86.
10578 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10579 Move to lisp.h.
10580 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10581 (overrun_check_realloc, overrun_check_free):
10582 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10583 That way, xmalloc returns a properly-aligned pointer even if
10584 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10585 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10586 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10587 into account when calculating the initial malloc maximum.
10588 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10589 Move here from alloc.c, so that charset.c can use it too.
10590 Properly align; the old code wasn't right for common 32-bit hosts
10591 when configured with --enable-checking=all.
10592 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10593 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10594
31bed486
EZ
105952011-09-29 Eli Zaretskii <eliz@gnu.org>
10596
04c70788 10597 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
10598 use EDOM.
10599
fbcaa2f3
EZ
106002011-09-28 Eli Zaretskii <eliz@gnu.org>
10601
10602 * xdisp.c (compute_display_string_end): If there's no display
10603 string at CHARPOS, return -1.
10604
10605 * bidi.c (bidi_fetch_char): When compute_display_string_end
10606 returns a negative value, treat the character as a normal
10607 character not covered by a display string. (Bug#9624)
10608
a239d4e9
JB
106092011-09-28 Juanma Barranquero <lekktu@gmail.com>
10610
10611 * lread.c (Fread_from_string): Fix typo in docstring.
10612
88652fd5
EZ
106132011-09-27 Eli Zaretskii <eliz@gnu.org>
10614
10615 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10616 newline, reseat the iterator instead of bidi-iterating there one
10617 character at a time. (Bug#9610)
32c1fffd
SM
10618 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10619 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 10620
ed497dd4
AS
106212011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10622
10623 * lread.c (readevalloop): Use correct code for NBSP.
10624 (read1): Likewise. (Bug#9608)
10625
b2bf61aa
MA
106262011-09-25 Michael Albinus <michael.albinus@gmx.de>
10627
10628 * dbusbind.c (Fdbus_register_signal): When service is not
10629 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10630
32bbb17c
GM
106312011-09-25 Glenn Morris <rgm@gnu.org>
10632
10633 * buffer.c (truncate-lines): Doc fix.
10634
94e0933e
CY
106352011-09-24 Chong Yidong <cyd@stupidchicken.com>
10636
10637 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10638 (Fset_window_next_buffers): Doc fix.
10639
cddde921
GM
106402011-09-24 Glenn Morris <rgm@gnu.org>
10641
10642 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10643
1260aef1
PE
106442011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10645
25b4bfa0
PE
10646 Fix minor problems found by static checking.
10647 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
10648 * indent.c (Fvertical_motion): Fix == vs = typo.
10649
e3cbd34b
EZ
106502011-09-24 Eli Zaretskii <eliz@gnu.org>
10651
a66cfb1c
SM
10652 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10653 Default value is now t. Doc fix.
6bf7006f 10654
e3cbd34b 10655 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 10656 logic when moving up, not only when moving down. Fix the
e3cbd34b 10657 confusing name and values of the it_overshoot_expected variable;
32c1fffd 10658 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
10659
10660 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10661 CHARPOS is covered by a display string which includes newlines.
10662 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10663 is covered by a display string with embedded newlines.
10664
a3de0cbd
MA
106652011-09-24 Michael Albinus <michael.albinus@gmx.de>
10666
10667 * dbusbind.c (Fdbus_register_signal): Add match rule to
10668 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
10669 (Fdbus_register_method, Vdbus_registered_objects_table):
10670 Fix docstring.
a3de0cbd 10671
b260039d
JM
106722011-09-24 Jim Meyering <meyering@redhat.com>
10673
32c1fffd 10674 do not ignore write error for any output size
b260039d
JM
10675 The previous change was incomplete.
10676 While it makes emacs --batch detect the vast majority of stdout
10677 write failures, errors were still ignored whenever the output size is
10678 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10679 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10680 && echo FAIL: ignored write error
10681 FAIL: ignored write error
10682 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10683 && echo FAIL: ignored write error
10684 FAIL: ignored write error
10685 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10686
8eca8a7c
AS
106872011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10688
10689 * emacs.c (Fkill_emacs): In noninteractive mode exit
10690 non-successfully if a write error occurred on stdout. (Bug#9574)
10691
3341db62
EZ
106922011-09-21 Eli Zaretskii <eliz@gnu.org>
10693
10694 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10695 the xassert test.
10696
10697 * dispextern.h (struct it): Update the comment documenting what
10698 can it->OBJECT be.
10699
8c203dbf
EZ
107002011-09-20 Eli Zaretskii <eliz@gnu.org>
10701
10702 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10703 a display string, extend search for cursor position to end of row.
10704 (find_row_edges): If the row ends in a newline from a display
10705 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10706 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
10707 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10708 non-empty line. Fixes confusing cursor motion with arrow keys at
10709 the beginning of a line that starts with whitespace.
8c203dbf 10710
a4824228
LMI
107112011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10712
10713 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10714 (bug#9493).
10715
33ed493b
CY
107162011-09-18 Chong Yidong <cyd@stupidchicken.com>
10717
10718 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10719 boolean (Bug#9154).
10720
56cd55c8
EZ
107212011-09-18 Eli Zaretskii <eliz@gnu.org>
10722
10723 * xdisp.c (display_line): Record maximum and minimum buffer
10724 positions even if no glyphs were produced (e.g., by a zero-width
10725 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10726 buffer positions that will be removed from the glyph row because
10727 they don't fit.
c02dcedf
EZ
10728 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10729 column is beyond frame width: don't subtract 1 "pixel" when
10730 computing width of the stretch.
3e62b7e0
EZ
10731 (reseat_at_next_visible_line_start): Undo the change made on
10732 2011-09-17 that saved paragraph information and restored it after
10733 the call to `reseat'. (Bug#9545)
56cd55c8 10734
5ed99d36 107352011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
10736
10737 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10738 and turn window cursor on if cleared (Bug#9415).
10739
5ed99d36 107402011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
10741
10742 * search.c (boyer_moore): Take unibyte characters from pattern
10743 literally. (Bug#9458)
10744
9bade7b2
EZ
107452011-09-18 Eli Zaretskii <eliz@gnu.org>
10746
10747 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10748
e5e9d610
PE
107492011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10750
87e4427a
PE
10751 Fix minor problem found by static checking.
10752 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10753 initialized, to pacify gcc -Wuninitialized.
10754
e5e9d610
PE
10755 * fileio.c: Report proper errno when syscall falls.
10756 (Finsert_file_contents): Save and restore errno,
10757 so that report_file_error outputs the correct diagnostic.
10758 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10759
a1674f0b
EZ
107602011-09-18 Eli Zaretskii <eliz@gnu.org>
10761
10762 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10763
fbfb6dd4
EZ
107642011-09-17 Eli Zaretskii <eliz@gnu.org>
10765
10766 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10767 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10768
bb187662
EZ
107692011-09-17 Eli Zaretskii <eliz@gnu.org>
10770
1137e8b8 10771 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 10772 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
10773
10774 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10775 (bidi_find_paragraph_start): Search back for paragraph beginning
10776 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10777 (bidi_move_to_visually_next): Only trigger paragraph-related
10778 computations when the last character is a newline or at EOB, not
10779 just any NEUTRAL_B. (Bug#9470)
10780
bb187662
EZ
10781 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10782 truncated lines if point is covered by a display string. (Bug#9524)
10783
2e621251
PE
107842011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10785
10786 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10787 (cons_to_x_long): New function.
10788 (lisp_data_to_selection_data): Use it. Correct the test for
10789 short-versus-long data; it was negated. Break out of vector
10790 loop, for efficiency, when a long datum is discovered.
10791
91a15bc6
SM
107922011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10793
10794 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10795
b41c3a35
EZ
107962011-09-16 Eli Zaretskii <eliz@gnu.org>
10797
10798 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10799 GCC PR/17406) by declaring this function with external scope.
10800
7812ba2d
PE
108012011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10802
10803 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10804 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10805
cf7edc2a
AS
108062011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10807
10808 * editfns.c (Fformat): Correctly handle text properties on "%%".
10809
bd01620e
EZ
108102011-09-15 Eli Zaretskii <eliz@gnu.org>
10811
10812 * xterm.c (x_draw_composite_glyph_string_foreground):
10813 * w32term.c (x_draw_composite_glyph_string_foreground):
10814 * term.c (encode_terminal_code):
10815 * composite.c (composition_update_it, get_composition_id):
10816 * xdisp.c (get_next_display_element)
10817 (fill_composite_glyph_string): Add comments about special meaning
10818 of TAB characters in a composition.
10819
a02719a3
PE
108202011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10821
10822 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
10823 This occurs when processing a multibyte format.
10824 Problem reported by Wolfgang Jenker.
a02719a3 10825
72589a3c
JB
108262011-09-15 Johan Bockgård <bojohan@gnu.org>
10827
10828 * xdisp.c (try_cursor_movement): Only check for exact match if
10829 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10830
1c14176c
PE
108312011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10832
10833 Remove unused external symbols.
10834 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10835 * xdisp.c (calc_pixel_width_or_height): Now static.
10836 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10837 * indent.c (check_display_width):
10838 * w32term.c: Fix comment to match code.
10839 * xterm.c, xterm.h (x_catching_errors): Remove.
10840
d2eea5b5
PE
108412011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10842
10843 * xselect.c: Use signed conversions more consistently (Bug#9498).
10844 (selection_data_to_lisp_data): Assume incoming selection data are
10845 signed integers, not unsigned. This is to be consistent with
10846 outgoing selection data, which was modified to use signed integers
10847 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10848 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10849 expects long, not unsigned long.
10850
46888499
EZ
108512011-09-14 Eli Zaretskii <eliz@gnu.org>
10852
10853 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10854 computation of loop end. Reported by Johan Bockgård
10855 <bojohan@gnu.org>.
10856
ef8ef9fb
CY
108572011-09-13 Chong Yidong <cyd@stupidchicken.com>
10858
10859 * frame.c (Fother_visible_frames_p): Function deleted.
10860
fa819fed
EZ
108612011-09-12 Eli Zaretskii <eliz@gnu.org>
10862
10863 * indent.c (compute_motion): Process display vector front to back
10864 rather than the other way around. (Bug#2496)
10865
2ba8e008
SM
108662011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10867
10868 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10869
20f53c69
CY
108702011-09-11 Chong Yidong <cyd@stupidchicken.com>
10871
10872 * minibuf.c (Fread_from_minibuffer): Doc fix.
10873
d562d7a4
EZ
108742011-09-11 Eli Zaretskii <eliz@gnu.org>
10875
10876 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10877 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10878
1c4d7f3d
LMI
108792011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10880
10881 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10882 value for non-existent files.
10883
b885bf36
EZ
108842011-09-11 Eli Zaretskii <eliz@gnu.org>
10885
10886 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10887 set its "size" to -1. This will set the modtime_size field of
10888 the corresponding buffer to -1, which is what
10889 verify-visited-file-modtime expects for files that do not exist.
10890 (Bug#9139)
10891
6612f0bf
PE
108922011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10893
10894 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10895 here ...
10896 * lisp.h: ... from here. push_key_description is no longer
10897 defined in keyboard.c, so its declaration should not be in
10898 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10899 logically belongs with push_key_description.
10900
dfb3f755
PE
109012011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10902
10903 * buffer.h: Include <sys/types.h> instead of <time.h>.
10904 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10905 Problem reported by Herbert J. Skuhra.
10906
3134906c
LMI
109072011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10908
10909 * xml.c (parse_region): Make the parsing work for
10910 non-comment-starting XML files again (bug#9144).
10911
8d903f4e
AS
109122011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10913
10914 * image.c (gif_load): Fix calculation of bottom and right corner.
10915 (Bug#9468)
10916
80ad64f4
EZ
109172011-09-10 Eli Zaretskii <eliz@gnu.org>
10918
10919 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10920 redisplay in small windows.
10921
208a048d
EZ
109222011-09-09 Eli Zaretskii <eliz@gnu.org>
10923
10924 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10925
9b1c252e
MR
109262011-09-08 Martin Rudalics <rudalics@gmx.at>
10927
10928 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10929 Operate on live windows only.
10930
2949f33b
JB
109312011-09-08 Juanma Barranquero <lekktu@gmail.com>
10932
10933 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10934
e08dcafd
EZ
109352011-09-07 Eli Zaretskii <eliz@gnu.org>
10936
10937 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10938 only under bidi iteration.
10939
115b96bd
JD
109402011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10941
10942 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10943
c8199d0f
PE
109442011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10945
10946 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10947 Without this fix, the command to link temacs failed due to an
10948 undefined symbol __builtin_isnan. This is because
10949 /usr/include/iso/math_c99.h #defines isnan(x) to
10950 __builtin_isnan(x), but the bundled gcc, which identifies itself
10951 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10952 a __builtin_isnan.
10953 * floatfns.c (isnan): #undef, and then #define to a clone of
10954 what's in data.c.
10955 (Fisnan): Always define, since it's always available now.
10956 (syms_of_floatfns): Always define isnan at the Lisp level.
10957
e39b275c 109582011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
10959
10960 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10961
b2db44d9 109622011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 10963
f4af5137 10964 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
10965 The previous code assumed that file offsets (off_t values) fit in
10966 EMACS_INT variables, which is not true on typical 32-bit hosts.
10967 The code messed up by falsely reporting buffer overflow in cases
10968 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10969 when "big" contains more than 2**29 bytes, even though this
10970 inserts just one byte and does not overflow the buffer.
10971 (Finsert_file_contents): Store file offsets as off_t
10972 values, not as EMACS_INT values. Check for overflow when
10973 converting between EMACS_INT and off_t. When checking for
10974 buffer overflow or for overlap, take the offsets into account.
10975 Don't use EMACS_INT for small values where int suffices.
10976 When checking for overlap, fix a typo: ZV was used where
10977 ZV_BYTE was intended.
10978 (Fwrite_region): Don't assume off_t fits into 'long'.
10979 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10980
ecfc0a49
MA
109812011-09-05 Michael Albinus <michael.albinus@gmx.de>
10982
10983 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10984
6511acf2 109852011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 10986
0999621a 10987 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
10988
10989 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 10990 (esprintf, exprintf, evxprintf): New functions.
62f19c19 10991 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 10992 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
10993 (modify_event_symbol): Do not assume that the length of
10994 name_alist_or_stem is safe to alloca and fits in int.
10995 (Fexecute_extended_command): Likewise for function name and binding.
10996 (Frecursion_depth): Wrap around reliably on integer overflow.
10997 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10998 since some callers pass EMACS_INT values.
10999 (Fsingle_key_description): Don't crash if symbol name contains more
11000 than MAX_ALLOCA bytes.
11001 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11002 (get_minibuffer): Arg is now EMACS_INT, not int.
11003 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 11004 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
11005 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11006
2be7d702
PE
11007 * dbusbind.c (signature_cat): New function.
11008 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
11009 Do not overrun buffer; instead, report string overflow.
11010
9d1df220
PE
11011 * dispnew.c (add_window_display_history): Don't overrun buffer.
11012 Truncate instead; this is OK since it's just a log.
11013
33ef5c64
PE
11014 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11015 even if the time zone offset is outlandishly large.
11016 Don't mishandle offset == INT_MIN.
11017
66c6fdd5
PE
11018 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11019 when creating daemon; the previous buffer-overflow check was incorrect.
11020
d749b01b
PE
11021 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11022 which has the guts of the old verror function.
11023
b5cd1905
PE
11024 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11025 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11026
6e1a67fb
PE
11027 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11028 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 11029 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 11030 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
11031 length of string rather than counting it via multiple sprintfs;
11032 that's simpler and more reliable.
c21721cc
PE
11033 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11034 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11035 sprintf, in case result does not fit in int.
11036
c57b67fc
PE
11037 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11038 (fontset_from_font): Print it.
11039
8a401434
PE
11040 * frame.c (tty_frame_count): Now printmax_t, not int.
11041 (make_terminal_frame, set_term_frame_name): Print it.
11042 (x_report_frame_params): In X, window IDs are unsigned long,
11043 not signed long, so print them as unsigned.
11044 (validate_x_resource_name): Check for implausibly long names,
11045 and don't assume name length fits in 'int'.
11046 (x_get_resource_string): Don't blindly alloca invocation name;
11047 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
11048 not fit in int.
11049
6e1a67fb
PE
11050 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11051 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
11052 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11053
0df02bf3
PE
11054 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11055 Use esprintf, not sprintf, in case result does not fit in int.
11056
48e30793
PE
11057 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11058 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11059 it as a large positive number.
11060 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
11061 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11062
a66ff6d8
PE
11063 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
11064 in case result does not fit in int.
11065
aca216ff
PE
11066 * print.c (float_to_string): Detect width overflow more reliably.
11067 (print_object): Make sprintf buffer a bit bigger, to avoid potential
11068 buffer overrun. Don't assume list length fits in 'int'. Treat
11069 print length of 0 as 0, not as infinity; to be consistent with other
11070 uses of print length in this function. Don't overflow print length
11071 index. Don't assume hash table size fits in 'long', or that
11072 vectorlike size fits in 'unsigned long'.
11073
31c286f7
PE
11074 * process.c (make_process): Use printmax_t, not int, to format
11075 process-name gensyms.
11076
55e5faa1
PE
11077 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
11078
80f2e268
PE
11079 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
11080 to avoid potential buffer overrun.
11081
670741ab
PE
11082 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
11083 if X resource line is longer than 512 bytes.
11084
b7163a50
PE
11085 * xfns.c (x_window): Make sprintf buffer a bit bigger
11086 to avoid potential buffer overrun.
11087
ae58ff1f
PE
11088 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
11089
c43c8a6a
PE
11090 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
11091
3f8236f4
PE
110922011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11093
53e9fe90 11094 Integer overflow fixes for scrolling, etc.
6511acf2
PE
11095 Without these, Emacs silently mishandles large integers sometimes.
11096 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
11097 it were "C-u 1 M-x recenter" on a typical 64-bit host.
11098
6511acf2
PE
11099 * xdisp.c (try_window_id): Check Emacs fixnum range before
11100 converting to 'int'.
806add1d 11101
6511acf2 11102 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
11103 Check that an Emacs fixnum is in range before assigning it to 'int'.
11104 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
11105 values converted from Emacs fixnums.
11106 (Frecenter): Don't wrap around a line count if it is out of 'int'
11107 range; instead, treat it as an extreme value.
11108 (Fset_window_configuration, compare_window_configurations):
11109 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
11110
6511acf2
PE
11111 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
11112 that can exceed INT_MAX. Check that EMACS_INT value is in range
11113 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
11114 (match_limit): Don't assume that a fixnum can fit in 'int'.
11115
6511acf2 11116 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
11117 exceed INT_MAX.
11118
6511acf2 11119 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
11120 (Fvertical_motion): Don't wrap around LINES values that don't fit
11121 in 'int'. Instead, treat them as extreme values. This is good
11122 enough for windows, which can't have more than INT_MAX lines anyway.
11123
fcb901a7
LMI
111242011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11125
0f2f6b6d
LMI
11126 * Require libxml/parser.h to avoid compilation warning.
11127
fcb901a7
LMI
11128 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11129
11130 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11131 since this reportedly can destroy thread storage.
11132
6e20a0d4
CY
111332011-08-30 Chong Yidong <cyd@stupidchicken.com>
11134
11135 * syntax.c (find_defun_start): Update all cache variables if
11136 exiting early (Bug#9401).
11137
148ae00e
EZ
111382011-08-30 Eli Zaretskii <eliz@gnu.org>
11139
f6cfbd8f
EZ
11140 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11141
148ae00e
EZ
11142 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11143 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
11144 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
11145
11146 * term.c (tty_append_glyph): New function.
11147 (produce_stretch_glyph): Static function and its prototype deleted.
11148
a66cfb1c
SM
11149 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11150 Add prototypes.
148ae00e 11151
c4a07a4c
PE
111522011-08-29 Paul Eggert <eggert@cs.ucla.edu>
11153
11154 * image.c (parse_image_spec): Check for nonnegative, not for positive,
11155 when checking :margin (Bug#9390).
11156 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 11157 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
11158 so that the name doesn't mislead. All uses changed.
11159
6bc8cd65
JB
111602011-08-28 Johan Bockgård <bojohan@gnu.org>
11161
11162 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11163 set_tty_hooks.
11164
dca4927e
EZ
111652011-08-27 Eli Zaretskii <eliz@gnu.org>
11166
11167 * xdisp.c (move_it_to): Don't bail out early when reaching
11168 position beyond to_charpos, if we are scanning backwards.
11169 (move_it_vertically_backward): When DY == 0, make sure we get to
11170 the first character in the line after the newline.
11171
f2cad773
PE
111722011-08-27 Paul Eggert <eggert@cs.ucla.edu>
11173
11174 * ccl.c: Improve and simplify overflow checking (Bug#9196).
11175 (ccl_driver): Do not generate an out-of-range pointer.
11176 (Fccl_execute_on_string): Remove unnecessary check for
11177 integer overflow, noted by Stefan Monnier in
11178 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11179 Remove a FIXME that didn't need fixing.
11180 Simplify the newly-introduced buffer reallocation code.
11181
0cae2cdb
JB
111822011-08-27 Juanma Barranquero <lekktu@gmail.com>
11183
11184 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11185
5fc295a4 111862011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 11187
70c60eb2 11188 Integer and memory overflow issues (Bug#9196).
726e0ab1 11189
d31850da
PE
11190 * doc.c (get_doc_string): Rework so that
11191 get_doc_string_buffer_size is the actual buffer size, rather than
11192 being 1 less than the actual buffer size; this makes xpalloc more
11193 convenient.
11194
a69fbedb
PE
11195 * image.c (x_allocate_bitmap_record, cache_image):
11196 * xselect.c (Fx_register_dnd_atom):
11197 Simplify previous changes by using xpalloc.
11198
fe5c5d37
PE
11199 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11200 since either will do and ptrdiff_t is convenient with xpalloc.
11201
0065d054
PE
11202 * charset.c (charset_table_size)
11203 (struct charset_sort_data.priority): Now ptrdiff_t.
11204 (charset_compare): Don't overflow if priorities differ greatly.
11205 (Fsort_charsets): Don't assume list length fits in int.
11206 Check for size-calculation overflow when allocating sort data.
11207 (syms_of_charset): Allocate an initial charset table that is
11208 just under 64 KiB, to avoid problems with glibc malloc and mmap.
11209
11210 * cmds.c (internal_self_insert): Check for size-calculation overflow.
11211
11212 * composite.h (struct composition.glyph_len): Now int, not unsigned.
11213 The actual value is always <= INT_MAX, and leaving it unsigned made
11214 overflow checking harder.
11215
11216 * dispextern.h (struct glyph_matrix.rows_allocated)
11217 (struct face_cache.size): Now ptrdiff_t, for convenience in use
11218 with xpalloc. The values are still always <= INT_MAX.
11219
11220 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
11221
11222 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
11223 (SAFE_NALLOCA): New macro.
11224
11225 * region-cache.c (struct boundary.pos, find_cache_boundary)
11226 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
11227 (set_cache_region, invalidate_region_cache)
11228 (revalidate_region_cache, know_region_cache, region_cache_forward)
11229 (region_cache_backward, pp_cache):
11230 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
11231 so that ptrdiff_t * can be passed to xpalloc.
11232 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
11233 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
11234 (pp_cache): Don't assume cache_len fits in int.
11235 * region-cache.h: Adjust extern decls to match.
11236
11237 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
11238 EMACS_INT, since either will do, for xpalloc.
11239
11240 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
11241 (xnmalloc, xnrealloc, xpalloc): New functions.
11242
726e0ab1
PE
11243 * bidi.c (bidi_shelve_header_size): New constant.
11244 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11245 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11246
51f30bc5 11247 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
11248 * buffer.c (overlays_at, overlays_in, record_overlay_string)
11249 (overlay_strings):
11250 Don't update size of array until after memory allocation succeeds,
11251 because xmalloc/xrealloc may not return.
0065d054
PE
11252 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11253 now that we have proper integer overflow checking.
11254 (record_overlay_string, overlay_strings): Catch overflows when
11255 calculating size of overlay_str_buf.
726e0ab1 11256
0065d054
PE
11257 * callproc.c (Fcall_process): Check for size overflow when
11258 calculating size of args2.
11259 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11260 Normally we prefer signed values, but sticking with ptrdiff_t would
11261 require adding more-complicated checks.
726e0ab1
PE
11262
11263 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11264 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11265 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 11266 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
11267
11268 * character.c (Fstring): Check for size-calculation overflow.
11269
11270 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11271 unnecessary integer overflow. Check for size overflow.
11272 (encode_coding_object): Don't update size until xmalloc succeeds.
11273
11274 * composite.c (get_composition_id): Check for overflow in glyph
11275 length calculations.
11276
11277 Integer and memory overflow fixes for display code.
11278 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11279 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11280 (scrolling_window): Check for overflow in size calculations.
11281 (line_draw_cost, realloc_glyph_pool, add_row_entry):
11282 Don't assume glyph table len fits in int.
11283 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11284 (row_table_size): Now ptrdiff_t, not int.
11285 (scrolling_window): Avoid overflow in size calculations.
11286 Don't update size until allocation succeeds.
11287 * fns.c (concat): Check for overflow in size calculations.
11288 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11289 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11290 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11291
11292 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11293 (get_doc_string): Check for size calculation overflow.
11294 Don't update size until allocation succeeds.
11295 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11296 EMACS_INT, where ptrdiff_t will do.
11297 (Fsubstitute_command_keys): Check for string overflow.
11298
11299 * editfns.c (set_time_zone_rule): Don't assume environment length
11300 fits in int.
11301 (message_length): Now ptrdiff_t, not int.
11302 (Fmessage_box): Don't update size until allocation succeeds.
11303 Don't assume message length fits in int.
11304 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11305
0065d054
PE
11306 * emacs.c (main): Do not reallocate argv, since there is a null at
11307 the end that can be overwritten, and this way there's no need to
11308 worry about size-calculation overflow.
11309 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
11310
11311 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11312 alloc succeeds.
11313 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11314
11315 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11316 (x_set_scroll_bar_width, x_figure_window_size):
11317 Check for integer overflow.
11318 (x_set_alpha): Do not assume XINT fits in int.
11319
11320 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11321 This is for the members text_lines, text_cols, total_lines, total_cols,
11322 where the system imposes an 'int' limit.
11323
11324 * fringe.c (Fdefine_fringe_bitmap):
11325 Don't update size until alloc works.
11326
11327 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11328 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11329
11330 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11331 Check for size-calculation overflow.
11332 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11333 do, as we prefer signed integers.
11334 (id_to_widget.max_size, id_to_widget.used)
11335 (xg_store_widget_in_map, xg_remove_widget_from_map)
11336 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11337 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11338 Use and return ptrdiff_t, not int.
11339 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11340 * gtkutil.h: Change prototypes to match the above.
11341
11342 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11343 are duplicate now that they've been promoted to lisp.h.
11344 (x_allocate_bitmap_record, x_alloc_image_color)
11345 (make_image_cache, cache_image, xpm_load):
11346 Don't update size until alloc is done.
11347 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11348 (x_detect_edges):
3256efce 11349 Check for size calculation overflow.
726e0ab1
PE
11350 (ct_colors_allocated_max): New constant.
11351 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11352 overflow.
3256efce 11353
726e0ab1
PE
11354 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11355 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11356 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11357 Use ptrdiff_t, not int, to count maps.
11358 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
11359 calculations. Don't update size until allocation succeeds.
11360 Redo calculations to avoid overflow.
726e0ab1
PE
11361 * keyboard.h: Change prototypes to match the above.
11362
11363 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11364 to count maps.
11365 (current_minor_maps): Check for size calculation overflow.
11366 * keymap.h: Change prototypes to match the above.
11367
11368 * lread.c (read1, init_obarray): Don't update size until alloc done.
11369
11370 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11371 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11372
726e0ab1
PE
11373 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11374 Now ptrdiff_t, not int.
11375 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11376 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11377
11378 * process.c (Fnetwork_interface_list): Check for overflow
11379 in size calculation.
11380
11381 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11382
11383 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11384 overflow. Don't bother calling xmalloc when xrealloc will do.
11385
11386 * search.c (Freplace_match): Check for size calculation overflow.
11387 (Fset_match_data): Don't assume list lengths fit in 'int'.
11388
11389 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11390 for command line length. Do not attempt to address one before the
11391 beginning of an array, as that's not portable.
11392
11393 * term.c (max_frame_lines): Remove; unused.
11394 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11395 not int.
11396 (encode_terminal_code, calculate_costs): Check for size
11397 calculation overflow.
11398 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11399 table lengths and related sizes. Don't update size until alloc
11400 done. Redo calculations to avoid overflow.
11401 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11402
11403 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11404 subtracting pointers.
11405 (gobble_line): Check for overflow more carefully. Don't update size
11406 until alloc done.
11407
11408 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11409 Don't update size until alloc done.
11410 Redo size calculations to avoid overflow.
11411 Check for size calculation overflow.
0065d054 11412 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
11413
11414 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11415 Use ptrdiff_t, not int, for sizes.
11416 (store_mode_line_noprop_char): Don't update size until alloc done.
11417
0065d054
PE
11418 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11419 Use ptrdiff_t, not int, for sizes.
11420 (Finternal_make_lisp_face, cache_face):
11421 Check for size calculation overflow.
11422 (cache_face): Treat size calculation overflows as if they were
11423 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
11424
11425 * xfns.c (x_encode_text, x_set_name_internal)
11426 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11427 sizes, since they can exceed INT_MAX in size. Check for size
11428 calculation overflow.
11429
0065d054
PE
11430 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11431 (xg_select): Check for size calculation overflow.
726e0ab1
PE
11432 Don't update size until alloc done.
11433
0065d054 11434 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 11435 as sprintf is limited to int lengths.
1d526e2f 11436
252c5ee1
PE
11437 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11438 (X_LONG_MIN): New macros.
864d7ce7
PE
11439 Use them to make the following changes clearer.
11440 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11441 This change doesn't affect the value now, but it may help remind
11442 future maintainers not to raise the value too much later.
11443 (SELECTION_QUANTUM): Remove, replacing with ...
11444 (selection_quantum): ... new function, which avoids overflow.
11445 All uses changed.
11446 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11447 assumption that selection length fits in 'int'.
11448 (x_reply_selection_request, x_handle_selection_request)
11449 (x_get_window_property, receive_incremental_selection)
11450 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11451 (lisp_data_to_selection_data, clean_local_selection_data):
11452 Use ptrdiff_t, not int, to record length of selection.
11453 (x_reply_selection_request, x_get_window_property)
11454 (receive_incremental_selection, x_property_data_to_lisp):
11455 Redo calculations to avoid overflow.
11456 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 11457 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
11458 something.
11459 (x_get_window_property, receive_incremental_selection)
11460 (lisp_data_to_selection_data, x_property_data_to_lisp):
11461 Check for size-calculation overflow.
11462 (x_get_window_property, receive_incremental_selection)
11463 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11464 Don't store size until memory allocation succeeds.
11465 (x_get_window_property): Plug memory leak on memory exhaustion.
11466 Don't double-block input; malloc is safe here. Don't assume 2**34
11467 - 4 fits in unsigned long. Add an xassert to check
11468 XGetWindowProperty overflow. Be more careful about overflow
11469 calculations, and distinguish size from memory overflow better.
11470 (receive_incremental_selection): When tracing, don't assume
11471 unsigned int is less than INT_MAX.
11472 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11473 harmful) conversions of unsigned short to int.
11474 (lisp_data_to_selection_data): Don't assume that integers
11475 in the range -65535 through -1 fit in an X unsigned short.
11476 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11477 result parameters unless successful. Rely on cons_to_unsigned
11478 to report problems with elements; the old code wasn't right anyway.
11479 (x_check_property_data): Check for int overflow; we cannot use
11480 a wider type due to X limits.
11481 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11482
726e0ab1 11483 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 11484
0065d054
PE
11485 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11486 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
11487 (x_color_cells): Don't store size until memory allocation succeeds.
11488 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 11489 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
11490 (x_term_init): Don't assume length fits in int (sprintf is limited
11491 to int size).
bc18e09d 11492
ebfa62c0
PE
11493 Use ptrdiff_t for composition IDs.
11494 * character.c (lisp_string_width):
11495 * composite.c (composition_table_size, n_compositions)
11496 (get_composition_id, composition_gstring_from_id):
11497 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11498 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11499 * window.c (Frecenter):
11500 Use ptrdiff_t, not int, for composition IDs.
11501 * composite.c (get_composition_id): Check for integer overflow.
11502 * composite.h: Adjust prototypes to match the above changes.
11503
d3411f89
PE
11504 Use ptrdiff_t for hash table indexes.
11505 * category.c (hash_get_category_set):
11506 * ccl.c (ccl_driver):
11507 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11508 * coding.c (coding_system_charset_list, detect_coding_system):
11509 * coding.h (struct coding_system.id):
11510 * composite.c (get_composition_id, gstring_lookup_cache):
11511 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11512 * image.c (xpm_get_color_table_h):
11513 * lisp.h (hash_lookup, hash_put):
11514 * minibuf.c (Ftest_completion):
11515 Use ptrdiff_t for hash table indexes, not int (which is too
11516 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11517 32-bit --with-wide-int hosts).
11518
e097a6fa
PE
11519 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11520 Add a FIXME comment about memory leaks.
11521 (syms_of_charset): Don't assume xmalloc returns.
11522
5637687f
PE
11523 Don't assume that stated character widths fit in int.
11524 * character.c (Fchar_width, c_string_width, lisp_string_width):
11525 * character.h (CHAR_WIDTH):
11526 * indent.c (MULTIBYTE_BYTES_WIDTH):
11527 Use sanitize_char_width to avoid undefined and/or bad behavior
11528 with outlandish widths.
a66cfb1c 11529 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
11530 now that we have two such functions. All uses changed.
11531 (sanitize_char_width): New inline function.
11532
a2271ba2
PE
11533 Don't assume that tab-width fits in int.
11534 * character.h (sanitize_width): New inline function.
11535 (SANE_TAB_WIDTH): New macro.
11536 (ASCII_CHAR_WIDTH): Use it.
11537 * indent.c (sane_tab_width): Remove. All uses replaced by
11538 SANE_TAB_WIDTH (current_buffer).
11539 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11540
18c52557
PE
11541 * fileio.c: Integer overflow issues with file modes.
11542 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11543
caeeedc1
PE
11544 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11545 Remove unreachable code.
11546 (read_hex, load_charset_map_from_file): Check for integer overflow.
11547
6df6ae42 11548 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
11549 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11550 (x_send_scroll_bar_event): Likewise. Check that the size does not
11551 exceed limits imposed by XClientMessageEvent, as well as the usual
11552 ptrdiff_t and size_t limits.
11553
b13995db
PE
11554 * keyboard.c: Overflow, signedness and related fixes.
11555 (make_lispy_movement): Use same integer type in forward decl
11556 that is used in the definition.
11557 (read_key_sequence, keyremap_step):
11558 Change bufsize argument back to int, undoing my 2011-03-30 change.
11559 We prefer signed types, and int is wide enough here.
11560 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11561 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11562 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11563 length, not size_t. Use ptrdiff_t for index, not int.
11564 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11565 possibility of integer overflow.
11566
13464394
PE
11567 Overflow, signedness and related fixes for images.
11568
11569 * dispextern.h (struct it.stack[0].u.image.image_id)
11570 (struct_it.image_id, struct image.id, struct image_cache.size)
11571 (struct image_cache.used, struct image_cache.ref_count):
11572 * gtkutil.c (update_frame_tool_bar):
11573 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11574 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11575 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11576 * nsmenu.m (update_frame_tool_bar):
11577 * xdisp.c (calc_pixel_width_or_height):
11578 * xfns.c (image_cache_refcount):
11579 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11580 on typical 64-bit hosts.
11581
11582 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11583 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11584 Omit unnecessary casts to int.
11585 (parse_image_spec): Check that integers fall into 'int' range
11586 when the callers expect that.
11587 (image_ascent): Redo ascent calculation to avoid int overflow.
11588 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11589 (lookup_image): Remove unnecessary tests.
11590 (xbm_image_p): Locals are now of int, not EMACS_INT,
11591 since parse_image_check makes sure they fit into int.
11592 (png_load, gif_load, svg_load_image):
11593 Prefer int to unsigned where either will do.
11594 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
11595 old tiff_error_handler and tiff_warning_handler.
11596 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
11597 stack buffer overflows. It uses only the features of vsnprintf
11598 that are common to both POSIX and native Microsoft.
11599 (tiff_error_handler, tiff_warning_handler): Use it.
11600 (tiff_load, gif_load, imagemagick_load_image):
11601 Don't assume :index value fits in 'int'.
11602 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11603 (imagemagick_load_image): Check that crop parameters fit into
11604 the integer types that MagickCropImage accepts. Don't assume
11605 Vimagemagick_render_type has a nonnegative value. Don't assume
11606 size_t fits in 'long'.
11607 (gs_load): Use printmax_t to print the widest integers possible.
11608 Check for integer overflow when computing image height and width.
11609
c11821d4
EZ
116102011-08-26 Eli Zaretskii <eliz@gnu.org>
11611
11612 * xdisp.c (redisplay_window): Don't force window start if point
11613 will be invisible in the resulting window. (Bug#9324)
11614
0c95fcf7
EZ
116152011-08-25 Eli Zaretskii <eliz@gnu.org>
11616
11617 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11618 the display spec is of the form `(space ...)'.
11619 (handle_display_spec): Return the value returned by
11620 handle_single_display_spec, not just 1 or zero.
11621 (handle_single_display_spec): If the display spec is of the form
11622 `(space ...)', and specifies display in the text area, return 2
11623 rather than 1.
fee65a97 11624 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
11625 accurately, and prefer exact match for point under bidi.
11626 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
11627
11628 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11629 into disp_prop; all users changed.
11630
11631 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11632 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11633 for the text covered by the display property.
11634
e4ed06f1
CY
116352011-08-25 Chong Yidong <cyd@stupidchicken.com>
11636
11637 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11638 Change return value to nil.
11639 (Frecord_buffer): Delete unused function.
11640
f67cdd7f
EZ
116412011-08-24 Eli Zaretskii <eliz@gnu.org>
11642
5980d4c6
EZ
11643 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11644 buffers, return left-to-right.
8610fe8b
EZ
11645 (set_cursor_from_row): Consider candidate row a win if its glyph
11646 represents a newline and point is on that newline. Fixes cursor
11647 positioning on the newline at EOL of R2L text within L2R
11648 paragraph, and vice versa.
11649 (try_cursor_movement): Check continued rows, in addition to
11650 continuation rows. Fixes unwarranted scroll when point enters a
11651 continued line of R2L text within an L2R paragraph, or vice versa.
11652 (cursor_row_p): Consider the case of point being equal to
11653 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11654 from the end of a short line to the beginning of a continued line
11655 of R2L text within L2R paragraph.
11656 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11657 composed characters.
5980d4c6 11658
f67cdd7f
EZ
11659 * bidi.c (bidi_check_type): Use xassert.
11660 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11661 members.
11662
bca633fb
EZ
116632011-08-23 Eli Zaretskii <eliz@gnu.org>
11664
11665 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11666 a character.
11667
4a5885a7
CY
116682011-08-23 Chong Yidong <cyd@stupidchicken.com>
11669
11670 * nsfont.m (ns_otf_to_script): Fix typo.
11671
0902a04e
KH
116722011-08-22 Kenichi Handa <handa@m17n.org>
11673
11674 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11675 extra slot even if the purpose is char-code-property-table.
11676
1a2e6670
EZ
116772011-08-23 Eli Zaretskii <eliz@gnu.org>
11678
8ddde651
EZ
11679 * xdisp.c (redisplay_window): When computing centering_position,
11680 account for the height of the header line. (Bug#8874)
11681
425cc014
EZ
11682 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11683 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11684 candidate is selected by the mouse, and that candidate has a
11685 composed character under the mouse.
11686
1a2e6670
EZ
11687 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11688 coordinates reported by pos-visible-in-window-p for a composed
11689 character in column zero.
11690
8b76d6f8
SM
116912011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11692
11693 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11694
dac347dd
EZ
116952011-08-22 Eli Zaretskii <eliz@gnu.org>
11696
11697 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11698 consider it a hit if to_charpos is anywhere in the range of the
11699 composed buffer positions.
11700
e013fb34
CY
117012011-08-22 Chong Yidong <cyd@stupidchicken.com>
11702
11703 * image.c (gif_load): Don't assume that each subimage has the same
11704 dimensions as the base image. Handle disposal method that is
11705 "undefined" by the gif spec (Bug#9335).
11706
bd1ba3e8
CY
117072011-08-20 Chong Yidong <cyd@stupidchicken.com>
11708
11709 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 11710 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 11711
54a1215b
EZ
117122011-08-19 Eli Zaretskii <eliz@gnu.org>
11713
823564e5
EZ
11714 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11715 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11716 from an Org mode buffer to a Speedbar frame.
11717
54a1215b
EZ
11718 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11719 a composition, take its buffer position from IT->cmp_it.charpos.
11720 Fixes cursor positioning at the beginning of a line that begins
11721 with a composed character.
11722
9778ebcc
EZ
117232011-08-18 Eli Zaretskii <eliz@gnu.org>
11724
0be6ee06
EZ
11725 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11726 character bidirectional type, use STRONG_L instead. Fixes crashes
11727 in a buffer produced by `describe-categories'.
11728
9778ebcc
EZ
11729 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11730 members before the level stack, so they would be saved and
11731 restored when copying iterator state. Fixes incorrect reordering
11732 around TABs covered by display properties.
11733
156bffbe
AS
117342011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11735
6b02f655 11736 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 11737
72ad093b
CY
117382011-08-17 Chong Yidong <cyd@stupidchicken.com>
11739
11740 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
11741 (internal_condition_case_2, internal_condition_case_n):
11742 Remove unnecessary aborts (Bug#9081).
72ad093b 11743
35774242
EZ
117442011-08-17 Eli Zaretskii <eliz@gnu.org>
11745
11746 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11747 has no `load' handler, try opening the file locally. (Bug#9311)
11748
db76dd85
KB
117492011-08-16 Ken Brown <kbrown@cornell.edu>
11750
11751 * gmalloc.c: Expand comment.
11752
b215eee5
EZ
117532011-08-16 Eli Zaretskii <eliz@gnu.org>
11754
11755 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11756 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11757
a4579d33
KB
117582011-08-16 Ken Brown <kbrown@cornell.edu>
11759
11760 Fix memory allocation problems in Cygwin build (Bug#9273).
11761
11762 * unexcw.c ( __malloc_initialized): Declare external variable.
11763 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11764
8b76d6f8
SM
11765 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11766 New variables.
a4579d33
KB
11767 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11768 dumped emacs.
11769 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11770 in the static heap.
11771 [CYGWIN] (special_realloc): New function.
11772 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11773 requests to realloc storage in the static heap.
11774
3ebec551
PE
117752011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11776
11777 * bidi.c (bidi_initialize): Remove unused local.
11778
9fd8be00
EZ
117792011-08-15 Eli Zaretskii <eliz@gnu.org>
11780
6b02f655
SM
11781 * bidimirror.h:
11782 * biditype.h: Remove file.
11783 * makefile.w32-in ($(BLD)/bidi.$(O)):
11784 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
11785
11786 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11787
11788 * chartab.c: Improve commentary for the uniprop_table API.
11789
32413314
EZ
11790 * bidi.c (bidi_paragraph_init): Support zero value of
11791 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
11792 (bidi_initialize): Use uniprop_table instead of including
11793 biditype.h and bidimirror.h.
32413314 11794
9fd8be00
EZ
11795 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11796 coordinates of the iterator when restoring from ppos_it.
11797 (Bug#9296)
11798
5cf2b69b
KH
117992011-08-14 Kenichi Handa <handa@m17n.org>
11800
11801 * process.c (create_process): Call setup_process_coding_systems
72ad093b 11802 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 11803
daf17d00
EZ
118042011-08-14 Eli Zaretskii <eliz@gnu.org>
11805
11806 * xdisp.c (move_it_in_display_line_to): Don't invoke
11807 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11808 ppos_it. Fixes vertical cursor motion when line beginning is
11809 covered by an image. (Bug#9296)
11810
08e3161a
JD
118112011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11812
11813 * nsterm.h (ns_run_ascript): Declare.
11814 (NSAPP_DATA2_RUNASSCRIPT): Define.
11815
11816 * nsfns.m (as_script, as_result, as_status): New static variables.
11817 (ns_run_ascript): New function.
5e617bc2 11818 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
11819 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11820 the event loop. Get status from as_status (Bug#7276).
11821
11822 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11823 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11824 the event loop (Bug#7276).
11825
a3720aa2
AS
118262011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11827
11828 * gnutls.c (QCgnutls_bootprop_priority)
11829 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11830 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11831 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11832 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11833 (QCgnutls_bootprop_verify_hostname_error)
11834 (QCgnutls_bootprop_callbacks_verify): Rename from
11835 Qgnutls_bootprop_..., all uses changed.
11836
11837 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11838 uses changed.
11839
0a0d27fb
PE
118402011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11841
19d5c50c
PE
11842 * xfaces.c (Qframe_set_background_mode): Now static.
11843 * dispextern.h (Qframe_set_background_mode): Remove decl.
11844
0a0d27fb
PE
11845 * process.c (Fnetwork_interface_info): Declare local only if needed.
11846
377538cb
JD
118472011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11848
11849 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11850 (Fnetwork_interface_list): Allocate in increments of bytes instead
11851 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11852 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11853 sockaddr.
11854 (struct ifflag_def): notrailers is smart on OSX.
11855 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11856 Get hardware address with getifaddrs if available.
11857
08fff70c
EZ
118582011-08-12 Eli Zaretskii <eliz@gnu.org>
11859
11860 * xdisp.c (iterate_out_of_display_property): xassert that
11861 IT->position is set to within IT->object's boundaries. Break from
11862 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
11863 when IT->position is set up wrongly due to some bug.
11864 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
11865 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11866 entry. Force push_it to save on the stack the current
11867 buffer/string position, to be restored by pop_it. Fix flags in
11868 the iterator structure wrt the object coming from a display
11869 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11870 properties. (Bug#9284)
11871
7be1c708 118722011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 11873
7be1c708
CY
11874 * fontset.c (fontset_get_font_group): Add proper type checks.
11875 (Bug#9172)
aac0c6e3 11876
7be1c708 118772011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 11878
7be1c708
CY
11879 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11880 and LC_VERSION_MIN_MACOSX.
11881 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11882 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 11883
97bb72a6
EZ
118842011-08-08 Eli Zaretskii <eliz@gnu.org>
11885
11886 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
11887 no-display-properties-and-no-overlays under bidi display.
11888 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 11889 properties and overlays.
97bb72a6 11890
d5617611
CY
118912011-08-08 Chong Yidong <cyd@stupidchicken.com>
11892
37e11a63
CY
11893 * editfns.c (Fset_time_zone_rule): Document relationship with the
11894 setenv function.
11895
d5617611
CY
11896 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11897 the font entity extracted from the cache (Bug#8109).
11898
58872834
CY
118992011-08-07 Chong Yidong <cyd@stupidchicken.com>
11900
11901 * composite.c (autocmp_chars): Don't reset point. That is done by
11902 restore_point_unwind (Bug#5984).
11903
75bfc667
JL
119042011-08-07 Juri Linkov <juri@jurta.org>
11905
11906 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11907 to show the arg `TIME' instead of `TIMEVAL'.
11908
d1410150
EZ
119092011-08-06 Eli Zaretskii <eliz@gnu.org>
11910
11911 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11912 display property strides EOL and includes a newline, as in
11913 longlines-mode. (Bug#9254)
75b771e4
EZ
11914 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11915 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
11916
11917 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11918 is non-zero, even if the data buffer is NULL. Fixes a crash in
11919 vertical-motion with longlines-mode. (Bug#9254)
11920
35928349
EZ
119212011-08-05 Eli Zaretskii <eliz@gnu.org>
11922
ec7cc85b
EZ
11923 * bidi.c <bidi_cache_total_alloc>: Now static.
11924 (bidi_initialize): Initialize bidi_cache_total_alloc.
11925
8b76d6f8 11926 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
11927 cache. (Bug#9221)
11928
11929 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11930 amount allocated this far in `bidi_cache_total_alloc'.
11931 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11932 non-zero, only free the data buffer without restoring the cache
11933 contents. All callers changed.
11934
11935 * dispextern.h (bidi_unshelve_cache): Update prototype.
11936
11937 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11938 (move_it_in_display_line, move_it_to)
11939 (move_it_vertically_backward, move_it_by_lines): Replace the call
11940 to xfree to an equivalent call to bidi_unshelve_cache.
11941 (move_it_in_display_line_to): Fix logic of returning
412b6358 11942 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 11943
e2e2423b
EZ
119442011-08-05 Eli Zaretskii <eliz@gnu.org>
11945
11946 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11947 came from a string character with a `cursor' property. (Bug#9229)
11948
ae9e757a
JD
119492011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11950
11951 * Makefile.in (LIB_PTHREAD): New variable.
11952 (LIBES): Add LIB_PTHREAD (Bug#9216).
11953
11954 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11955 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11956
213bd7f2
AS
119572011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11958
6b02f655 11959 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 11960
99aaf75f
JD
119612011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11962
11963 * xterm.c (x_find_topmost_parent): New function.
11964 (x_set_frame_alpha): Find topmost parent window with
11965 x_find_topmost_parent and set the property there also (bug#9181).
11966 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11967
c74e9d86
PE
119682011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11969
11970 * callproc.c (Fcall_process): Avoid vfork clobbering
11971 the local vars buffer, coding_systems, current_dir.
11972
640c8776
SM
119732011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11974
11975 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11976
f26d0e4c
PE
119772011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11978
8a10d76c
PE
11979 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11980 so that it is not optimized away.
11981
f26d0e4c
PE
11982 * xdisp.c (compute_display_string_pos): Remove unused local.
11983
55439c61
EZ
119842011-08-02 Eli Zaretskii <eliz@gnu.org>
11985
11986 Fix slow cursor motion and scrolling in large buffers with
11987 selective display, like Org Mode buffers. (Bug#9218)
11988
11989 * dispextern.h (struct bidi_it): New member disp_prop_p.
11990
11991 * xdisp.c: Remove one-slot cache of display string positions.
11992 (compute_display_string_pos): Accept an additional argument
5e617bc2 11993 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
11994 for a display string or property. If found, set DISP_PROP_P
11995 non-zero.
11996
11997 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
11998 DISP_PROP_P, and pass it to compute_display_string_pos.
11999 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
12000 non-zero. All callers of bidi_fetch_char changed.
12001
fb33fa43
SM
120022011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
12003
12004 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12005
b099e063
DM
120062010-12-03 Don March <don@ohspite.net>
12007
12008 * keymap.c (Fdefine_key): Fix non-prefix key error message when
12009 last character M-[char] is translated to ESC [char] (bug#7541).
12010
5cc7f7af
KH
120112011-08-02 Kenichi Handa <handa@m17n.org>
12012
d0fffa3f 12013 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
12014
12015 * chartab.c (uniprop_table): Make it non-static.
12016
525d5e6e
EZ
120172011-08-01 Eli Zaretskii <eliz@gnu.org>
12018
12019 * xdisp.c (forward_to_next_line_start): Accept additional argument
12020 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12021 on the newline.
12022 (reseat_at_next_visible_line_start): Use the bidi iterator state
12023 returned by forward_to_next_line_start to restore the state of
12024 it->bidi_it after backing up to previous newline. (Bug#9212)
12025
31011111
AS
120262011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12027
12028 * regex.c (re_comp): Protoize.
12029 (re_exec): Fix return type.
12030 (regexec): Fix type of `ret'. (Bug#9203)
12031
476371c4
PE
120322011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12033
e5d76069
PE
12034 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12035 This is needed if max-image-size is a floating-point number.
12036
9a79b20c
AS
120372011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12038
12039 * print.c (print_object): Print empty symbol as ##.
12040
12041 * lread.c (read1): Read ## as empty symbol.
12042
d8c2fa78
AA
120432011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12044
12045 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12046 setting frame foreground color (Bug#9175).
12047 (x_set_background_color): Likewise.
12048
ffe57a7a
AA
12049 * nsmenu.m (-setText): Size tooltip dimensions precisely to
12050 contents (Bug#9176).
12051 (EmacsTooltip -init): Remove bezels and add shadows to
12052 tooltip windows.
12053
bf3492a5
AA
12054 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12055 or scroll bar (Bug#8470).
12056
d55e9c53
AA
12057 * nsfont.m (nsfont_open): Remove assignment to voffset and
12058 unnecessary vars hshink, expand, hd, full_height, min_height.
12059 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12060
12061 * nsterm.h (nsfont_info): Remove voffset field.
12062
d8c2fa78 120632011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
12064
12065 Implement strike-through and overline on NextStep (Bug#8863).
12066
12067 * nsfont.m (nsfont_open): Use underline position provided by font,
12068 instead of hard-coded value of 2.
12069 (nsfont_draw): Call ns_draw_text_decoration instead.
12070
12071 * nsterm.h: Add declaration for ns_draw_text_decoration.
12072
12073 * nsterm.m (ns_draw_text_decoration): New function for drawing
12074 underline, overline, and strike-through.
12075 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
12076 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 12077 accommodate underlining, etc.
4843aac3 12078
4cc60b9b
EZ
120792011-07-28 Eli Zaretskii <eliz@gnu.org>
12080
bc7ece87
EZ
12081 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
12082 default.
4cc60b9b 12083
476371c4
PE
120842011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12085
66606eea
PE
12086 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
12087 Without this fix, if a signal arrives just after memory fills up,
12088 'malloc' might be invoked reentrantly.
12089
476371c4
PE
12090 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
12091 In other words, assume that every image size is allowed, on non-X
12092 hosts. This assumption is probably wrong, but it lets Emacs compile.
12093
f3fcc40d
AS
120942011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12095
12096 * regex.c (re_iswctype): Convert return values to boolean.
12097
350c992f
EZ
120982011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
12099
12100 * xdisp.c (compute_display_string_pos): Don't use cached display
12101 string position if the buffer had its restriction changed.
12102 (Bug#9184)
12103
5266b4bb
PE
121042011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12105
12106 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12107
2573a837 121082011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 12109
41f55ccd 12110 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 12111
39e378da
PE
12112 * bidi.c: Integer size and overflow fixes.
12113 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
12114 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
12115 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12116 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
12117 (bidi_find_other_level_edge):
12118 Use ptrdiff_t instead of EMACS_INT where either will do.
12119 This works better on 32-bit hosts configured --with-wide-int.
12120 (bidi_cache_ensure_space): Check for size-calculation overflow.
12121 Use % rather than repeated addition, for better worst-case speed.
12122 Don't set bidi_cache_size until after xrealloc returns, because it
12123 might not return.
12124 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
12125 (bidi_cache_ensure_space): Also check that the bidi cache size
12126 does not exceed that of the largest Lisp string or buffer. See Eli
12127 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 12128
5e927815
PE
12129 * alloc.c (__malloc_size_t): Remove.
12130 All uses replaced by size_t. See Andreas Schwab's note
12131 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12132
ca4aa935
PE
12133 * image.c: Improve checking for integer overflow.
12134 (check_image_size): Assume that f is nonnull, since
12135 it is always nonnull in practice. This is one less thing to
12136 worry about when checking for integer overflow later.
12137 (x_check_image_size): New function, which checks for integer
12138 overflow issues inside X.
12139 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12140 This removes the need for a memory_full check.
12141 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12142 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12143 (xbm_read_bitmap_data): Change locals back to 'int', since
12144 their values must fit in 'int'.
12145 (xpm_load_image, png_load, tiff_load):
12146 Invoke x_create_x_image_and_pixmap earlier,
12147 to avoid much needless work if the image is too large.
12148 (tiff_load): Treat overly large images as if
12149 x_create_x_image_and_pixmap failed, not as malloc failures.
12150 (gs_load): Use x_check_image_size.
12151
5f8f9cc2
PE
12152 * gtkutil.c: Omit integer casts.
12153 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12154 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12155
5adf60bc
PE
12156 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12157
c8907a93
PE
12158 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12159 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12160 would wrongly return t on a 64-bit host.
12161
e3c25c68
PE
12162 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12163 The plain *_OVERFLOW macros run afoul of GCC bug 49705
12164 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12165 and therefore cause GCC to emit a bogus diagnostic in some cases.
12166
3f791afe
PE
12167 * image.c: Integer signedness and overflow and related fixes.
12168 This is not an exhaustive set of fixes, but it's time to
12169 record what I've got.
12170 (lookup_pixel_color, check_image_size): Remove redundant decls.
12171 (check_image_size): Don't assume that arbitrary EMACS_INT values
12172 fit in 'int', or that arbitrary 'double' values fit in 'int'.
12173 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12174 (tiff_load, imagemagick_load_image):
12175 Check for overflow in size calculations.
12176 (x_create_x_image_and_pixmap): Remove unnecessary test for
12177 xmalloc returning NULL; that can't happen.
12178 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12179 (xpm_color_bucket): Use better integer hashing function.
12180 (xpm_cache_color): Don't possibly over-allocate memory.
12181 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12182 (gif_memory_source):
12183 Use ptrdiff_t, not int or size_t, to record sizes.
12184 (png_load): Don't assume values greater than 2**31 fit in 'int'.
12185 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12186 either works, as we prefer signed integers.
12187 (tiff_read_from_memory, tiff_write_from_memory):
12188 Return tsize_t, not size_t, since that's what the TIFF API wants.
12189 (tiff_read_from_memory): Don't fail simply because the read would
12190 go past EOF; instead, return a short read.
12191 (tiff_load): Omit no-longer-needed casts.
12192 (Fimagemagick_types): Don't assume size fits into 'int'.
12193
3cc5a532
PE
12194 Improve hashing quality when configured --with-wide-int.
12195 * fns.c (hash_string): New function, taken from sxhash_string.
12196 Do not discard information about ASCII character case; this
12197 discarding is no longer needed.
12198 (sxhash-string): Use it. Change sig to match it. Caller changed.
12199 * lisp.h: Declare it.
12200 * lread.c (hash_string): Remove, since we now use fns.c's version.
12201 The fns.c version returns a wider integer if --with-wide-int is
12202 specified, so this should help the quality of the hashing a bit.
12203
b312a492
PE
12204 * emacs.c: Integer overflow minor fix.
12205 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
12206 Define only if GNU_LINUX.
12207 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12208
dfd153ae
PE
12209 * dispnew.c: Integer signedness and overflow fixes.
12210 Remove unnecessary forward decls, that were a maintenance hassle.
12211 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12212 All uses changed.
12213 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
12214 (scrolling_window): Use ptrdiff_t, not int, for byte count.
12215 (prepare_desired_row, line_draw_cost):
12216 Use int, not unsigned, where either works.
12217 (save_current_matrix, restore_current_matrix):
12218 Use ptrdiff_t, not size_t, where either works.
12219 (init_display): Check for overflow more accurately, and without
12220 relying on undefined behavior.
12221
a81d11a3
PE
12222 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
12223 Remove, replacing with the new symbols in lisp.h. All uses changed.
12224 * fileio.c (make_temp_name):
12225 * filelock.c (lock_file_1, lock_file):
12226 * xdisp.c (message_dolog):
12227 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
12228 Use pMd etc. instead.
12229 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
12230 replacing the pWIDE etc. symbols removed from editfns.c.
12231
3300e6fd
PE
12232 * keyboard.h (num_input_events): Now uintmax_t.
12233 This is (very slightly) less likely to mess up due to wraparound.
12234 All uses changed.
12235
fd05c7e9
PE
12236 * buffer.c: Integer signedness fixes.
12237 (alloc_buffer_text, enlarge_buffer_text):
12238 Use ptrdiff_t rather than size_t when either will do, as we prefer
12239 signed integers.
12240
903fe15d
PE
12241 * alloc.c: Integer signedness and overflow fixes.
12242 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
12243 (__malloc_size_t): Default to size_t, not to int.
12244 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12245 (Fgarbage_collect, mark_object_loop_halt, mark_object):
12246 Prefer ptrdiff_t to size_t when either would do, as we prefer
12247 signed integers.
12248 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12249 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12250 Now const. Initialize with values that are in range even if char
12251 is signed.
12252 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12253 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
12254 These functions do the right thing with sizes > 2**32.
12255 (check_depth): Now ptrdiff_t, not int.
12256 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12257 Adjust to new way of storing sizes. Check for size overflow bugs
12258 in rest of code.
12259 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
12260 slightly wrong anyway, as it missed one instance of
12261 XMALLOC_OVERRUN_CHECK_OVERHEAD.
12262 (refill_memory_reserve): Omit needless cast to size_t.
12263 (mark_object_loop_halt): Mark as externally visible.
12264
ac82cc6a
PE
12265 * xselect.c: Integer signedness and overflow fixes.
12266 (Fx_register_dnd_atom, x_handle_dnd_message):
12267 Use ptrdiff_t, not size_t, since we prefer signed.
12268 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12269 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12270 x_dnd_atoms_size and x_dnd_atoms_length.
12271
c2d1e36d
PE
12272 * doprnt.c: Prefer signed to unsigned when either works.
12273 * eval.c (verror):
12274 * doprnt.c (doprnt):
12275 * lisp.h (doprnt):
12276 * xdisp.c (vmessage):
12277 Use ptrdiff_t, not size_t, when using or implementing doprnt,
12278 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12279 prefer signed arithmetic to avoid comparison confusion.
12280 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12281 but is a bit tricky.
12282
0e926e56
PE
12283 Assume freestanding C89 headers, string.h, stdlib.h.
12284 * data.c, doprnt.c, floatfns.c, print.c:
12285 Include float.h unconditionally.
12286 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12287 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12288 * regex.c: Likewise for stddef.h, string.h.
12289 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12290 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12291 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12292 (STDC_HEADERS): Remove obsolete defines.
12293 * sysdep.c: Include limits.h unconditionally.
12294
9cfdb3ec
PE
12295 Assume support for memcmp, memcpy, memmove, memset.
12296 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12297 * regex.c (memcmp, memcpy):
12298 Remove; we assume C89 now.
12299
12300 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12301 (__malloc_safe_bcopy): Remove; no longer needed.
12302
cf950e6b 12303 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
12304 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12305 well either way, and we prefer signed to unsigned.
12306
dbf38e02
LMI
123072011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12308
12309 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12310 closes the connection while we're reading (bug#9182).
12311
d6f0886c 123122011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 12313
d6f0886c
JD
12314 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12315 are specified (Bug#9168).
24e0f6b1 12316
2eb1f9e6
PE
123172011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12318
12319 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12320 Found by GCC static checking and --with-wide-int on a 32-bit host.
12321
22381272 123222011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
12323
12324 * xdisp.c (compute_display_string_pos): Fix logic of caching
12325 previous display string position. Initialize cached_prev_pos to
12326 -1. Fixes slow-down at the beginning of a buffer.
12327
f25e39b4
EZ
123282011-07-24 Eli Zaretskii <eliz@gnu.org>
12329
12330 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12331 for attrs[LFACE_FONTSET_INDEX].
12332
04c4b52e
PE
123332011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12334
12335 * xml.c (parse_region): Remove unused local
12336 that was recently introduced.
12337
c1734fbd
EZ
123382011-07-23 Eli Zaretskii <eliz@gnu.org>
12339
be18c5a5
EZ
12340 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12341 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12342
c1734fbd
EZ
12343 * xdisp.c (move_it_in_display_line_to): Record the best matching
12344 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
12345 exit if none of the characters scanned was an exact match.
12346 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
12347 when exact match is impossible due to invisible text, and the
12348 lines are truncated.
12349
a258d627
JD
123502011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12351
12352 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12353 for OSX >= 10.7.
12354
b6d5a689
EZ
123552011-07-22 Eli Zaretskii <eliz@gnu.org>
12356
0f74f785
EZ
12357 Fix a significant slow-down of cursor motion with C-n, C-p,
12358 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12359 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 12360 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
12361 (next_element_from_buffer): Call compute_stop_pos_backwards to
12362 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
12363 base_level_stop.
12364 (reseat): Don't look for prev_stop, as that could mean a very long
12365 run.
12366 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12367 <cached_disp_overlay_modiff>: Cache for last found display string
12368 position.
551918c1 12369 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
12370 about the same buffer in the same area of character positions, and
12371 the buffer wasn't changed since the time the display string
12372 position was cached.
551918c1 12373
b2d0c91a
EZ
123742011-07-22 Eli Zaretskii <eliz@gnu.org>
12375
12376 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12377 is an integer, which is important for empty lines. (Bug#9149)
12378
043604ee
CY
123792011-07-22 Chong Yidong <cyd@stupidchicken.com>
12380
12381 * frame.c (Fmodify_frame_parameters): In tty case, update the
12382 default face if necessary (Bug#4238).
12383
da4adb04
CY
123842011-07-21 Chong Yidong <cyd@stupidchicken.com>
12385
12386 * editfns.c (Fstring_to_char): No need to explain what a character
12387 is in the docstring (Bug#6576).
12388
9abd0532
LMI
123892011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12390
12391 * xml.c (parse_region): Make sure we always return a tree.
12392
36881d16
HK
123932011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12394
12395 * xml.c (parse_region): If a document contains only comments,
12396 return that, too.
12397
1e98674d
LMI
123982011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12399
12400 * xml.c (make_dom): Return comments, too.
12401
590bd467
PE
124022011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12403
12404 Port to OpenBSD.
12405 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12406 and the surrounding thread.
12407 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12408 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12409 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12410 timer goes off.
12411 * s/openbsd.h (BROKEN_SIGIO): Define.
12412 * unexelf.c (unexec) [__OpenBSD__]:
12413 Don't update the .mdebug section of the Alpha COFF symbol table.
12414
f41628b2
LMI
124152011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12416
12417 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12418 (bug#8460).
12419
b59b67c5
PE
124202011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12421
15e3a074
PE
12422 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12423 This fixes some race conditions on the permissions of any newly
12424 created file.
12425
41bed37d
PE
12426 * alloc.c (valid_pointer_p): Use pipe, not open.
12427 This fixes some permissions issues when debugging.
12428
b59b67c5
PE
12429 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12430 If fchown fails to set both uid and gid, try to set just gid,
12431 as that is sometimes allowed. Adjust the file's mode to eliminate
12432 setuid or setgid bits that are inappropriate if fchown fails.
12433
925a6be7
SM
124342011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12435
12436 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12437 to compare Lisp_Objects.
12438 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12439 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12440 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12441
52968808
AS
124422011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12443
0a6a104b
AS
12444 * lread.c (read_integer): Unread even EOF character.
12445 (read1): Likewise. Properly record start position of symbol.
12446
52968808
AS
12447 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12448 symbol character follows.
12449
9e381cdd
PE
124502011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12451
12452 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12453 This works around a problem with the previous change to Fcopy_file.
12454 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12455 and without this change, GCC might complain about discarding
12456 fchown's return value.
12457
b5641435
JB
124582011-07-16 Juanma Barranquero <lekktu@gmail.com>
12459
12460 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12461
a8031457
PE
124622011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12463
12464 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12465
dd889327
LMI
124662011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12467
750c33f7
LMI
12468 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12469 it's used from the C level.
12470
dd889327
LMI
12471 * process.c: Use the same condition for POLL_FOR_INPUT in both
12472 keyboard.c and process.c (bug#1858).
12473
87e86684
LM
124742011-07-09 Lawrence Mitchell <wence@gmx.li>
12475
12476 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12477 (Fgnutls_boot): Use it.
12478
64348f40
AS
124792011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12480
12481 * doc.c (Fsubstitute_command_keys): Revert last change.
12482
1d698799
LMI
124832011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12484
f863868c
LMI
12485 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12486 quotes the next character, and doesn't affect other longer
12487 sequences (bug#8935).
12488
1d698799
LMI
12489 * lread.c (syms_of_lread): Clarify that is isn't only
12490 `eval-buffer' and `eval-defun' that's affected by
12491 `lexical-binding' (bug#8460).
12492
aa4b6df6
EZ
124932011-07-15 Eli Zaretskii <eliz@gnu.org>
12494
12495 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 12496 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 12497
5d856da6
PE
124982011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12499
ad6042bb
PE
12500 Fix minor problems found by static checking.
12501 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12502 (elsz): Now a signed constant, not a size_t var. We prefer signed
12503 types to unsigned, to avoid integer comparison confusion. Without
12504 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12505 "cannot optimize loop, the loop counter may overflow", a symptom
12506 of the confusion.
f00bbb22 12507 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
12508 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12509
6468f31c
LMI
125102011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12511
49080b10
LMI
12512 * search.c (Fre_search_backward): Mention `case-fold-search' in
12513 all the re_search_* functions (bug#8138).
12514
6468f31c
LMI
12515 * keyboard.c (Fopen_dribble_file): Document when the file is
12516 closed (bug#8056).
12517
c965adc5
EZ
125182011-07-14 Eli Zaretskii <eliz@gnu.org>
12519
df9733bf
EZ
12520 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12521 bidi_cache_idx.
12522
0bb23927
EZ
12523 Support bidi reordering of display and overlay strings.
12524 * xdisp.c (compute_display_string_pos)
12525 (compute_display_string_end): Accept additional argument STRING.
12526 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12527 (reseat_to_string): Initialize bidi_it->string.s and
12528 bidi_it->string.schars.
12529 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
12530 NULL (avoids a crash in bidi_paragraph_init).
12531 Initialize itb.string.lstring.
0bb23927
EZ
12532 (init_iterator): Call bidi_init_it only of a valid
12533 buffer position was specified. Initialize paragraph_embedding to
12534 L2R.
12535 (reseat_to_string): Initialize the bidi iterator.
12536 (display_string): If we need to ignore text properties of
12537 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12538 original value of -1 will not work with bidi.)
12539 (compute_display_string_pos): First arg is now struct
12540 `text_pos *'; all callers changed. Support display properties on
12541 Lisp strings.
12542 (compute_display_string_end): Support display properties on Lisp
12543 strings.
12544 (init_iterator, reseat_1, reseat_to_string): Initialize the
12545 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12546 when iterating on a string not from display properties).
640c8776
SM
12547 (compute_display_string_pos, compute_display_string_end):
12548 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
12549 arrow keys.
12550 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
12551 base_level_stop; instead, set base_level_stop to BEGV.
12552 Fixes crashes in vertical-motion.
0bb23927
EZ
12553 (next_element_from_buffer): Improve commentary for when
12554 the iterator is before prev_stop.
12555 (init_iterator): Initialize bidi_p from the default value of
12556 bidi-display-reordering, not from buffer-local value. Use the
12557 buffer-local value only if initializing for buffer iteration.
12558 (handle_invisible_prop): Support invisible properties on strings
12559 that are being bidi-reordered.
12560 (set_iterator_to_next): Support bidi reordering of C strings and
12561 Lisp strings.
12562 (next_element_from_string): Support bidi reordering of Lisp
12563 strings.
12564 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
12565 (display_string): Support display of R2L glyph rows.
12566 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
12567 (init_iterator): Don't initialize it->bidi_p for strings
12568 here.
12569 (reseat_to_string): Initialize it->bidi_p for strings here.
12570 (next_element_from_string, next_element_from_c_string)
12571 (next_element_from_buffer): Add xassert's for correspondence
12572 between IT's object being iterated and it->bidi_it.string
12573 structure.
12574 (face_before_or_after_it_pos): Support bidi iteration.
12575 (next_element_from_c_string): Handle the case of the first string
12576 character that is not the first one in the visual order.
12577 (get_visually_first_element): New function, refactored from common
12578 parts of next_element_from_buffer, next_element_from_string, and
12579 next_element_from_c_string.
12580 (tool_bar_lines_needed, redisplay_tool_bar)
12581 (display_menu_bar): Force left-to-right direction. Add a FIXME
12582 comment for making that be controlled by a user option.
12583 (push_it, pop_it): Save and restore the state of the
12584 bidi iterator. Save and restore the bidi_p flag.
12585 (pop_it): Iterate out of display property for string iteration as
12586 well.
12587 (iterate_out_of_display_property): Support iteration over strings.
12588 (handle_single_display_spec): Set up it->bidi_it for iteration
12589 over a display string, and call bidi_init_it.
12590 (handle_single_display_spec, next_overlay_string)
12591 (get_overlay_strings_1, push_display_prop): Set up the bidi
12592 iterator for displaying display or overlay strings.
12593 (forward_to_next_line_start): Don't use the shortcut if
12594 bidi-iterating.
12595 (back_to_previous_visible_line_start): If handle_display_prop
12596 pushed the iterator stack, restore the internal state of the bidi
12597 iterator by calling bidi_pop_it same number of times.
12598 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12599 and we are bidi-iterating, don't decrement the iterator position;
12600 instead, set the first_elt flag in the bidi iterator, to produce
12601 the same effect.
12602 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12603 (push_display_prop): xassert that we are iterating a buffer.
12604 (push_it, pop_it): Save and restore paragraph_embedding member.
12605 (handle_single_display_spec, next_overlay_string)
12606 (get_overlay_strings_1, reseat_1, reseat_to_string)
12607 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12608 correctly. Don't assume unibyte strings are not bidi-reordered.
12609 (compute_display_string_pos)
12610 (compute_display_string_end): Fix handling the case of C string.
12611 (push_it, pop_it): Save and restore from_disp_prop_p.
12612 (handle_single_display_spec, push_display_prop): Set the
12613 from_disp_prop_p flag.
12614 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12615 (pop_it): Call iterate_out_of_display_property only if we are
12616 popping after iteration over a string that came from a display
12617 property. Fix a typo in popping stretch info. Add an assertion
12618 for verifying that the iterator position is in sync with the bidi
12619 iterator.
12620 (handle_single_display_spec, get_overlay_strings_1)
12621 (push_display_prop): Fix initialization of paragraph direction for
12622 string when that of the parent object is not yet determined.
12623 (reseat_1): Call bidi_init_it to resync the bidi
12624 iterator with IT's position. (Bug#7616)
12625 (find_row_edges): If ROW->start.pos gives position
12626 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12627 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12628 Reset the from_disp_prop_p flag.
12629 (SAVE_IT, RESTORE_IT): New macros.
12630 (pos_visible_p, face_before_or_after_it_pos)
12631 (back_to_previous_visible_line_start)
12632 (move_it_in_display_line_to, move_it_in_display_line)
12633 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12634 (try_scrolling, redisplay_window, display_line): Use them when
12635 saving a temporary copy of the iterator and restoring it back.
12636 (back_to_previous_visible_line_start, reseat_1)
12637 (init_iterator): Empty the bidi cache "stack".
12638 (move_it_in_display_line_to): If iterator ended up at
12639 EOL, but we never saw any buffer positions smaller than
12640 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12641 motion in bidi-reordered lines.
12642 (move_it_in_display_line_to): Record prev_method and prev_pos
12643 immediately before the call to set_iterator_to_next. Fixes cursor
12644 motion in bidi-reordered lines with stretch glyphs and strings
12645 displayed in margins. (Bug#8133) (Bug#8867)
12646 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12647 TO_CHARPOS.
640c8776
SM
12648 (pos_visible_p): Support positions in bidi-reordered lines.
12649 Save and restore bidi cache.
0bb23927
EZ
12650
12651 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12652 (bidi_paragraph_info): Delete unused struct.
12653 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12654 (bidi_cache_start): New variable.
12655 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12656 to zero.
12657 (bidi_cache_fetch_state, bidi_cache_search)
12658 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12659 (bidi_cache_find, bidi_peek_at_next_level)
12660 (bidi_level_of_next_char, bidi_find_other_level_edge)
12661 (bidi_move_to_visually_next): Compare cache index with
12662 bidi_cache_start rather than with zero.
12663 (bidi_fetch_char): Accept new argument STRING; all callers
12664 changed. Support iteration over a string. Support strings with
12665 display properties. Support unibyte strings. Fix the type of
12666 `len' according to what STRING_CHAR_AND_LENGTH expects.
12667 (bidi_paragraph_init, bidi_resolve_explicit_1)
12668 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
12669 (bidi_level_of_next_char, bidi_move_to_visually_next):
12670 Support iteration over a string.
0bb23927
EZ
12671 (bidi_set_sor_type, bidi_resolve_explicit_1)
12672 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12673 can now be zero (for strings); special values 0 and -1 were
12674 changed to -1 and -2, respectively.
12675 (bidi_char_at_pos): New function.
12676 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12677 Call it instead of FETCH_MULTIBYTE_CHAR.
12678 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12679 initialized to valid values.
12680 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12681 values.
12682 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12683 the test for valid cached positions. Fix the logic for looking up
12684 the sentinel state in the cache. GCPRO the Lisp string we are
12685 iterating.
12686 (bidi_push_it, bidi_pop_it): New functions.
12687 (bidi_initialize): Initialize the bidi cache start stack pointer.
12688 (bidi_cache_ensure_space): New function, refactored from part of
12689 bidi_cache_iterator_state. Don't assume the required size is just
12690 one BIDI_CACHE_CHUNK away.
12691 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12692 (bidi_count_bytes, bidi_char_at_pos): New functions.
12693 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12694 always valid if bidi_cache_idx is valid.
12695 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12696 is valid if it's going to be used.
12697 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12698 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
12699 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12700 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
12701 (bidi_find_other_level_edge, bidi_cache_start_stack):
12702 All variables related to cache indices are now EMACS_INT.
c965adc5 12703
0bb23927
EZ
12704 * dispextern.h (struct bidi_string_data): New structure.
12705 (struct bidi_it): New member `string'. Make flag members be 1-bit
12706 fields, and put them last in the struct.
640c8776
SM
12707 (compute_display_string_pos, compute_display_string_end):
12708 Update prototypes.
0bb23927
EZ
12709 (bidi_push_it, bidi_pop_it): Add prototypes.
12710 (struct iterator_stack_entry): New members bidi_p,
12711 paragraph_embedding, and from_disp_prop_p.
12712 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
12713 (bidi_shelve_cache, bidi_unshelve_cache):
12714 Declare prototypes.
0bb23927
EZ
12715
12716 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12717 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12718 and vector-like objects.
12719
12720 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12721 cache around display iteration.
12722
12723 * window.c (Fwindow_end, window_scroll_pixel_based)
12724 (displayed_window_lines, Frecenter): Save and restore the bidi
12725 cache around display iteration.
12726
3bbd2265
LMI
127272011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12728
12729 * editfns.c (Fdelete_region): Clarify the use of the named
12730 parameters (bug#6788).
12731
adc47434
MR
127322011-07-14 Martin Rudalics <rudalics@gmx.at>
12733
12734 * indent.c (Fvertical_motion): Set and restore w->pointm when
12735 saving and restoring the window's buffer (Bug#9006).
12736
837c31f8
LMI
127372011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12738
12739 * editfns.c (Fstring_to_char): Clarify just what is returned
12740 (bug#6576). Text by Eli Zaretskii.
12741
ac389d0c
JB
127422011-07-13 Juanma Barranquero <lekktu@gmail.com>
12743
12744 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12745
0be0ce47
EZ
127462011-07-13 Eli Zaretskii <eliz@gnu.org>
12747
12748 * buffer.c (mmap_find): Fix a typo.
12749
cd18e7e3
JB
127502011-07-13 Johan Bockgård <bojohan@gnu.org>
12751
12752 Fix execution of x selection hooks.
12753 * xselect.c (Qx_lost_selection_functions)
12754 (Qx_sent_selection_functions): New vars.
12755 (syms_of_xselect): DEFSYM them.
12756 (x_handle_selection_request): Pass Qx_sent_selection_functions
12757 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12758 (x_handle_selection_clear,x_clear_frame_selections):
12759 Pass Qx_lost_selection_functions rather than
12760 Vx_lost_selection_functions to Frun_hook_with_args.
12761
47ea7f44
PE
127622011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12763
ac389d0c 12764 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
12765 The old code sometimes used this field without initializing it.
12766
47ea7f44
PE
12767 * alloc.c (gc_sweep): Don't read past end of array.
12768 In theory, the old code could also have corrupted Emacs internals,
12769 though it'd be very unlikely.
12770
bc985c87
AS
127712011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12772
12773 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 12774 argument. (Bug#4026)
bc985c87 12775
0cf34688
LMI
127762011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12777
b3dadd76
LMI
12778 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12779 key" (bug#4257).
12780
0cf34688
LMI
12781 * window.c (Fset_window_start): Doc fix (bug#4199).
12782 (Fset_window_hscroll): Ditto.
12783
270768cd
PE
127842011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12785
077e3dda 12786 Fix minor new problems caught by GCC 4.6.1.
270768cd 12787 * term.c (init_tty): Remove unused local.
490011a6 12788 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 12789 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 12790 not used otherwise.
270768cd 12791
b1f58454
CY
127922011-07-12 Chong Yidong <cyd@stupidchicken.com>
12793
12794 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12795
22b9578d
LMI
127962011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12797
6e70ab07
LMI
12798 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12799 are the mini-buffer and the echo area (bug#3320).
12800
22b9578d
LMI
12801 * term.c (init_tty): Remove support for supdup, c10 and perq
12802 terminals, which are no longer supported (bug#1482).
12803
8974cc9f
JB
128042011-07-10 Johan Bockgård <bojohan@gnu.org>
12805
12806 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12807
a560d974
JD
128082011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12809
12810 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12811 for non-popups (Bug#3642).
12812
1dae0f0a
AS
128132011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12814
268c2c36 12815 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 12816 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
12817 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12818 * cm.c (losecursor): Likewise.
1dae0f0a
AS
12819 * data.c (fmod): Likewise.
12820 * dispnew.c (swap_glyphs_in_rows): Likewise.
12821 * emacs.c (memory_warning_signal): Likewise.
12822 * floatfns.c (float_error): Likewise.
12823 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12824 (otf_open, font_otf_capability, generate_otf_features)
12825 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12826 Likewise.
12827 * image.c (pbm_read_file): Likewise.
12828 * indent.c (string_display_width): Likewise.
12829 * intervals.c (check_for_interval, search_for_interval)
12830 (inc_interval_count, count_intervals, root_interval)
12831 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12832 * lread.c (defalias): Likewise.
268c2c36 12833 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
12834 * regex.c (set_image_of_range_1, set_image_of_range)
12835 (regex_grow_registers): Likewise.
12836 * sysdep.c (strerror): Likewise.
12837 * termcap.c (valid_filename_p, tprint, main): Likewise.
12838 * tparam.c (main): Likewise.
12839 * unexhp9k800.c (run_time_remap, save_data_space)
12840 (update_file_ptrs, read_header, write_header, calculate_checksum)
12841 (copy_file, copy_rest, display_header): Likewise.
12842 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12843 Likewise.
12844 * xdisp.c (check_it): Likewise.
12845 * xfaces.c (register_color, unregister_color, unregister_colors):
12846 Likewise.
12847 * xfns.c (print_fontset_result): Likewise.
12848 * xrdb.c (member, fatal, main): Likewise.
12849
99033785
PE
128502011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12851
12852 Fix minor problems found by static checking (Bug#9031).
12853 * chartab.c (char_table_set_range, map_sub_char_table):
12854 Remove unused locals.
12855 (uniprop_table): Now static.
12856 * composite.c (_work_char): Remove unused static var.
12857
9cb2ac56
JB
128582011-07-09 Juanma Barranquero <lekktu@gmail.com>
12859
12860 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12861
f25661f0
JD
128622011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12863
12864 * gtkutil.c (qttip_cb): Remove code without function.
12865
8278c4fe
EZ
128662011-07-09 Eli Zaretskii <eliz@gnu.org>
12867
12868 * w32.c (pthread_sigmask): New stub.
12869
1692ae2d 128702011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 12871
8a6ebd58 12872 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
12873 sigprocmask is portable only for single-threaded applications, and
12874 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
12875 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12876 (LIBES): Use it.
12877 * callproc.c (Fcall_process):
12878 * process.c (create_process):
12879 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12880 Use pthread_sigmask, not sigprocmask.
123403e4 12881
1b854618
JD
128822011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12883
12884 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12885 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12886 wrong (Bug#8591).
12887
3fe4b549
JD
128882011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12889
0ce7e563
JD
12890 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12891 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12892 (xg_hide_tooltip): Fix comment.
12893
3fe4b549
JD
12894 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12895 in registerServicesMenuSendTypes.
12896 (validRequestorForSendType): Don't check ns_return_types.
12897
12898 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12899 ns_return_type.
12900
5df75e47
JR
129012011-07-08 Jason Rumney <jasonr@gnu.org>
12902
22610910
JR
12903 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12904 SH_SHOW for hidden windows (Bug#5482).
12905
5df75e47
JR
12906 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12907 frame struct members of non-existent frames (Bug#6284).
12908
699c10bd
JD
129092011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12910
4393663b
JD
12911 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12912 variable firstTime not needed on OSX >= 10.6.
12913 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12914 >= 10.5. Use setKnobProportion, setDoubleValue.
12915
12916 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12917 (MAC_OS_X_VERSION_10_5): Define if not defined.
12918 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12919 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12920 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12921
12922 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 12923 cString and lossyCString on OSX >= 10.4.
4393663b 12924
58179cce 12925 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
12926 sizeToFit on OSX >= 10.2.
12927
12928 * nsimage.m (allocInitFromFile): Don't use deprecated method
12929 bestRepresentationForDevice on OSX >= 10.6.
12930
12931 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12932 to avoid warning.
12933
12934 * emacs.c: Declare unexec_init_emacs_zone.
12935
a63e0781
JD
12936 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12937
699c10bd
JD
12938 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12939
12940 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12941 on svcsMenu (Bug#8842).
12942
12943 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12944 ns_return_types.
12945 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12946
12947 * nsterm.m (QUTF8_STRING): Declare.
12948 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12949 (validRequestorForSendType): Return type is (id).
12950 Change indexOfObjectIdenticalTo to indexOfObject.
12951 Check if we have local selection before returning self (Bug#8842).
12952 (writeSelectionToPasteboard): Put local selection into paste board
12953 if we have a local selection (Bug#8842).
12954 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12955
12956 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12957 (ns_get_local_selection): Declare.
12958
54e10184
LMI
129592011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12960
9888ff71
LMI
12961 * keymap.c (describe_map_tree): Don't insert a double newline at
12962 the end of the buffer (bug#1169) and return whether we inserted
12963 something.
12964
54e10184
LMI
12965 * callint.c (Fcall_interactively): Change "reading args" to
12966 "providing args" to try to clarify what it does (bug#1010).
12967
15fa4783
KH
129682011-07-07 Kenichi Handa <handa@m17n.org>
12969
12970 * composite.c (composition_compute_stop_pos): Ignore a static
12971 composition starting before CHARPOS (Bug#8915).
12972
12973 * xdisp.c (handle_composition_prop): Likewise.
12974
a8815b00
EZ
129752011-07-07 Eli Zaretskii <eliz@gnu.org>
12976
12977 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12978 (Bug#9015)
12979
ef7b981d 129802011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
12981
12982 * character.h (unicode_category_t): New enum type.
12983
12984 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12985 (Qchar_code_property_table): New variable.
12986 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12987 (UNIPROP_COMPRESSED_FORM_P): New macros.
12988 (char_table_ascii): Uncompress the compressed values.
12989 (sub_char_table_ref): New arg is_uniprop. Callers changed.
12990 Uncompress the compressed values.
ac389d0c 12991 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
12992 (char_table_ref_and_range): Uncompress the compressed values.
12993 (sub_char_table_set): New arg is_uniprop. Callers changed.
12994 Uncompress the compressed values.
12995 (sub_char_table_set_range): Args changed. Callers changed.
12996 (char_table_set_range): Adjuted for the above change.
12997 (map_sub_char_table): Delete args default_val and parent. Add arg
12998 top. Give decoded values to a Lisp function.
640c8776 12999 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
13000 values to a Lisp function. Gcpro more variables.
13001 (uniprop_table_uncompress)
13002 (uniprop_decode_value_run_length): New functions.
13003 (uniprop_decoder, uniprop_decoder_count): New variables.
13004 (uniprop_get_decoder, uniprop_encode_value_character)
13005 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13006 New functions.
13007 (uniprop_encoder, uniprop_encoder_count): New variables.
13008 (uniprop_get_encoder, uniprop_table)
13009 (Funicode_property_table_internal, Fget_unicode_property_internal)
13010 (Fput_unicode_property_internal): New functions.
13011 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13012 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 13013 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
13014 char-code-property-alist.
13015
640c8776 13016 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
13017 Vunicode_category_table.
13018
640c8776 13019 * font.c (font_range): Adjust for the change of
c805dec0
KH
13020 Vunicode_category_table.
13021
76b397fb
DN
130222011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13023
13024 * m/iris4d.h: Remove file, move contents ...
13025 * s/irix6-5.h: ... here.
13026
22b4128e
PE
130272011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13028
13029 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
13030 * alloc.c (mark_buffer):
13031 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13032 (clone_per_buffer_values): Don't assume that
22b4128e
PE
13033 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13034 This isn't true in general, and it's particularly not true
13035 if Emacs is configured with --with-wide-int.
13036 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13037 New macros, used in the buffer.c change.
13038
869795d6
JD
130392011-07-05 Jan Djärv <jan.h.d@swipnet.se>
13040
13041 * xsettings.c: Use both GConf and GSettings if both are available.
13042 (store_config_changed_event): Add comment.
13043 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13044 (store_tool_bar_style_changed): New functions.
5e617bc2 13045 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
13046 (struct xsettings): Move font inside HAVE_XFT.
13047 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 13048 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 13049 Move inside HAVE_XFT.
640c8776 13050 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
13051 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13052 also.
13053 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 13054 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 13055 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
13056 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13057 (parse_settings): Move check for font inside HAVE_XFT.
13058 (read_settings, apply_xft_settings): Add comment.
13059 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
13060 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
13061 call store_font_name_changed.
13062 (xft_settings_event): Add comment.
13063 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
13064 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
13065 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
13066 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
13067 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
13068 (xsettings_get_system_font, xsettings_get_system_normal_font):
13069 Add comment.
869795d6 13070
d8ed26bd
PE
130712011-07-05 Paul Eggert <eggert@cs.ucla.edu>
13072
13073 Random fixes. E.g., (random) never returned negative values.
13074 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
13075 subseconds part to the entropy, as that's a bit more random.
13076 Prefer signed to unsigned, since the signedness doesn't matter and
13077 in general we prefer signed. When given a limit, use a
13078 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
13079 latter isn't right if USE_2_TAGS_FOR_INTS.
13080 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
13081 not 0..VALMASK. Don't discard "excess" bits that random () returns.
13082
cabf1cac
SM
130832011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
13084
13085 * textprop.c (text_property_stickiness):
13086 Obey Vtext_property_default_nonsticky.
13087 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
13088 * w32fns.c (syms_of_w32fns):
13089 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
13090
6e9b2be9
PE
130912011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13092
13093 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
13094 This is more efficient than Ffile_directory_p and avoids a minor race.
13095
90186c68
LMI
130962011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
13097
7c301272
LMI
13098 * buffer.c (Foverlay_put): Say what the return value is
13099 (bug#7835).
13100
c4f2d8d4
LMI
13101 * fileio.c (barf_or_query_if_file_exists): Check first if the file
13102 is a directory before asking whether to use the file name
13103 (bug#7564).
ad637907
LMI
13104 (barf_or_query_if_file_exists): Make the "File is a directory"
13105 error be more correct.
c4f2d8d4 13106
90186c68
LMI
13107 * fns.c (Frequire): Remove the mention of the .gz files, since
13108 that's installation-specific, but keep the mention of
13109 `get-load-suffixes'.
13110
da64016e
PE
131112011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13112
13113 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
13114 Report string overflow if the output is too long.
13115
7d47b580
JB
131162011-07-04 Juanma Barranquero <lekktu@gmail.com>
13117
a555cb87
JB
13118 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
13119 (syms_of_gnutls): Remove duplicate DEFSYM for
13120 Qgnutls_bootprop_verify_hostname_error, an error for
13121 Qgnutls_bootprop_verify_error (which is no longer used).
13122
7d47b580
JB
13123 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13124 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
13125 Also (re)move comments that are misplaced or no longer relevant.
13126
1e49bfab
LMI
131272011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13128
13129 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13130
1485f4c0
CY
131312011-07-03 Chong Yidong <cyd@stupidchicken.com>
13132
13133 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13134 and background color parameters if they have been changed.
13135
a9ab721e
LMI
131362011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13137
13138 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13139
cf7cff57
PE
131402011-07-03 Paul Eggert <eggert@cs.ucla.edu>
13141
2e13213d
PE
13142 * xsettings.c (SYSTEM_FONT): Define only when used.
13143 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13144
cf7cff57
PE
13145 * keymap.c (access_keymap_1): Now static.
13146
7a8e04f7
CY
131472011-07-02 Chong Yidong <cyd@stupidchicken.com>
13148
13149 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13150 leave any prefix arg for the up event (Bug#1586).
13151
61352f62
LMI
131522011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
13153
69bb1ef7
LMI
13154 * lread.c (syms_of_lread): Mention single symbols defined by
13155 `defvar' or `defconst' (bug#7154).
13156
61352f62 13157 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 13158 (Frequire): Mention get-load-suffixes.
61352f62 13159
28545e04
MR
131602011-07-02 Martin Rudalics <rudalics@gmx.at>
13161
13162 * window.h (window): Remove clone_number slot.
13163 * window.c (Fwindow_clone_number, Fset_window_clone_number):
13164 Remove.
13165 (make_parent_window, make_window, saved_window)
13166 (Fset_window_configuration, save_window_save): Don't deal with
13167 clone numbers.
13168 * buffer.c (Qclone_number): Remove declaration.
13169 (sort_overlays, overlay_strings): Don't deal with clone numbers.
13170
3349e122
SM
131712011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
13172
13173 Add multiple inheritance to keymaps.
13174 * keymap.c (Fmake_composed_keymap): New function.
13175 (Fset_keymap_parent): Simplify.
13176 (fix_submap_inheritance): Remove.
13177 (access_keymap_1): New function extracted from access_keymap to handle
13178 embedded parents and handle lists of maps.
13179 (access_keymap): Use it.
13180 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13181 (Fcopy_keymap): Handle embedded parents.
13182 (Fcommand_remapping, define_as_prefix): Simplify.
13183 (Fkey_binding): Simplify.
13184 (syms_of_keymap): Move minibuffer-local-completion-map,
13185 minibuffer-local-filename-completion-map,
13186 minibuffer-local-must-match-map, and
13187 minibuffer-local-filename-must-match-map to Elisp.
13188 (syms_of_keymap): Defsubr make-composed-keymap.
13189 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13190 (parse_menu_item): Trivial simplification.
13191
3279eb87
GM
131922011-07-01 Glenn Morris <rgm@gnu.org>
13193
13194 * Makefile.in (SETTINGS_LIBS): Fix typo.
13195
39cb9e56 131962011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
13197
13198 * coding.c (Fencode_coding_string): Record the last coding system
13199 used, as the function doc string says (bug#8738).
13200
0949d2b6
JD
132012011-07-01 Jan Djärv <jan.h.d@swipnet.se>
13202
13203 * xsettings.c (store_monospaced_changed): Take new font as arg and
13204 check for change against current_mono_font.
13205 (EMACS_TYPE_SETTINGS): Remove this and related defines.
13206 (emacs_settings_constructor, emacs_settings_get_property)
13207 (emacs_settings_set_property, emacs_settings_class_init)
13208 (emacs_settings_init, gsettings_obj): Remove.
13209 (something_changedCB): New function for HAVE_GSETTINGS.
13210 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13211 with value as argument.
13212 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
13213 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 13214 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
13215 "changed".
13216
13217 * xgselect.c: Add defined (HAVE_GSETTINGS).
13218 (xgselect_initialize): Ditto.
13219
13220 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
13221 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
13222 xg_select.
13223
bbc6b304
PE
132242011-07-01 Paul Eggert <eggert@cs.ucla.edu>
13225
13226 * eval.c (struct backtrace): Simplify and port the data structure.
13227 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
13228 signed bit field, as this assumption is not portable and it makes
13229 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
13230 "char debug_on_exit : 1" as this is not portable either; instead,
13231 use the portable "unsigned int debug_on_exit : 1". Remove unused
13232 member evalargs. Remove obsolete comments about cc bombing out.
13233
9851bfc5
JD
132342011-06-30 Jan Djärv <jan.h.d@swipnet.se>
13235
51bb811f 13236 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
13237 Let HAVE_GSETTINGS override HAVE_GCONF.
13238 (store_monospaced_changed): New function.
13239 (EMACS_SETTINGS): A new type derived from GObject to handle
13240 GSettings notifications.
13241 (emacs_settings_constructor, emacs_settings_get_property)
13242 (emacs_settings_set_property, emacs_settings_class_init):
13243 New functions.
13244 (gsettings_client, gsettings_obj): New variables.
13245 (GSETTINGS_SCHEMA): New define.
13246 (something_changedCB): Call store_monospaced_changed.
13247 (init_gsettings): New function.
13248 (xsettings_initialize): Call init_gsettings.
13249 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13250 to NULL.
13251
640c8776 13252 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
13253 GCONF_CFLAGS/LIBS.
13254
5386012d
MR
132552011-06-29 Martin Rudalics <rudalics@gmx.at>
13256
13257 * window.c (resize_root_window, grow_mini_window)
13258 (shrink_mini_window): Rename Qresize_root_window to
13259 Qwindow_resize_root_window and Qresize_root_window_vertically to
13260 Qwindow_resize_root_window_vertically.
13261
f13e0b08
PE
132622011-06-28 Paul Eggert <eggert@cs.ucla.edu>
13263
13264 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13265
94515237
JB
132662011-06-27 Juanma Barranquero <lekktu@gmail.com>
13267
13268 * makefile.w32-in: Redesign dependencies so they reflect more
13269 clearly which files are directly included by each source file,
13270 and not through other includes.
13271
e43b6e43
MR
132722011-06-27 Martin Rudalics <rudalics@gmx.at>
13273
13274 * buffer.c (Qclone_number): Declare static and DEFSYM it.
13275 (sort_overlays, overlay_strings): When an overlay's clone number
13276 matches the window's clone number process the overlay even if
13277 the overlay's window property doesn't match the current window.
13278
d68443dc
MR
13279 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13280 (Fwindow_hchild): Rename to Fwindow_left_child.
13281 (Fwindow_next): Rename to Fwindow_next_sibling.
13282 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
13283 (resize_window_check): Rename to window_resize_check.
13284 (resize_window_apply): Rename to window_resize_apply.
13285 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13286 (Fdelete_other_windows_internal, resize_frame_windows)
13287 (Fsplit_window_internal, Fdelete_window_internal)
13288 (grow_mini_window, shrink_mini_window)
13289 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 13290
c7e73be5
JD
132912011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13292
13293 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13294 (emacs_fixed_set_min_size): Remove.
13295 (emacs_fixed_new): Take frame as argument.
13296
13297 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13298 (_EmacsFixedPrivate): Remove minwidth/height.
13299 Add struct frame *f.
13300 (emacs_fixed_init): Initialize priv->f.
13301 (get_parent_class, emacs_fixed_set_min_size): Remove.
13302 (emacs_fixed_new): Set priv->f to argument.
13303 (emacs_fixed_get_preferred_width)
13304 (emacs_fixed_get_preferred_height): Use min_width/height from
13305 frames size_hint to set minimum and natural (Bug#8919).
13306 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13307 and use min_width/height from frames size_hint to set
13308 min_width/height (Bug#8919).
13309
13310 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
13311 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13312 Fix indentation.
c7e73be5 13313
cf99dcf8
EZ
133142011-06-26 Eli Zaretskii <eliz@gnu.org>
13315
13316 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13317 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13318 called at ZV.
13319
029529ac
CY
133202011-06-26 Chong Yidong <cyd@stupidchicken.com>
13321
13322 * process.c (wait_reading_process_output): Bypass select if
13323 waiting for a cell while ignoring keyboard input, and input is
13324 pending. Suggested by Jan Djärv (Bug#8869).
13325
7a7ef429
PE
133262011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13327
13328 Use gnulib's dup2 module instead of rolling our own.
13329 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13330
11fdef7d 133312011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
13332
13333 * dispnew.c (scrolling_window): Before scrolling, turn off a
13334 mouse-highlight in the window being scrolled.
13335
cd3520a4
JB
133362011-06-24 Juanma Barranquero <lekktu@gmail.com>
13337
13338 Move DEFSYM to lisp.h and use everywhere.
13339
13340 * character.h (DEFSYM): Move declaration...
13341 * lisp.h (DEFSYM): ...here.
13342
13343 * gnutls.c:
13344 * minibuf.c:
13345 * w32menu.c:
13346 * w32proc.c:
13347 * w32select.c: Don't include character.h.
13348
13349 * alloc.c (syms_of_alloc):
13350 * buffer.c (syms_of_buffer):
13351 * bytecode.c (syms_of_bytecode):
13352 * callint.c (syms_of_callint):
13353 * casefiddle.c (syms_of_casefiddle):
13354 * casetab.c (init_casetab_once):
13355 * category.c (init_category_once, syms_of_category):
13356 * ccl.c (syms_of_ccl):
13357 * cmds.c (syms_of_cmds):
13358 * composite.c (syms_of_composite):
13359 * dbusbind.c (syms_of_dbusbind):
13360 * dired.c (syms_of_dired):
13361 * dispnew.c (syms_of_display):
13362 * doc.c (syms_of_doc):
13363 * editfns.c (syms_of_editfns):
13364 * emacs.c (syms_of_emacs):
13365 * eval.c (syms_of_eval):
13366 * fileio.c (syms_of_fileio):
13367 * fns.c (syms_of_fns):
13368 * frame.c (syms_of_frame):
13369 * fringe.c (syms_of_fringe):
13370 * insdel.c (syms_of_insdel):
13371 * keymap.c (syms_of_keymap):
13372 * lread.c (init_obarray, syms_of_lread):
13373 * macros.c (syms_of_macros):
13374 * msdos.c (syms_of_msdos):
13375 * print.c (syms_of_print):
13376 * process.c (syms_of_process):
13377 * search.c (syms_of_search):
13378 * sound.c (syms_of_sound):
13379 * syntax.c (init_syntax_once, syms_of_syntax):
13380 * terminal.c (syms_of_terminal):
13381 * textprop.c (syms_of_textprop):
13382 * undo.c (syms_of_undo):
13383 * w32.c (globals_of_w32):
13384 * window.c (syms_of_window):
13385 * xdisp.c (syms_of_xdisp):
13386 * xfaces.c (syms_of_xfaces):
13387 * xfns.c (syms_of_xfns):
13388 * xmenu.c (syms_of_xmenu):
13389 * xsettings.c (syms_of_xsettings):
13390 * xterm.c (syms_of_xterm): Use DEFSYM.
13391
4228cf16
TZ
133922011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13393
cd3520a4 13394 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 13395
7fcccf1e
PE
133962011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13397
7efb4e0e
PE
13398 Integer and buffer overflow fixes (Bug#8873).
13399
ff5844ad
PE
13400 * print.c (printchar, strout): Check for string overflow.
13401 (PRINTPREPARE, printchar, strout):
13402 Don't set size unless allocation succeeds.
13403
90532f02
PE
13404 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13405 for sizes. Check for string overflow more accurately.
13406 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13407
6d84508d
PE
13408 * macros.c: Integer and buffer overflow fixes.
13409 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13410 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13411 Use ptrdiff_t, not int, for sizes.
13412 Don't increment bufsize until after realloc succeeds.
13413 Check for size-calculation overflow.
13414 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13415
437b2cb4
PE
13416 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13417
8b9ac8b4
PE
13418 * lread.c: Integer overflow fixes.
13419 (read_integer): Radix is now EMACS_INT, not int,
13420 to improve quality of diagnostics for out-of-range radices.
13421 Calculate buffer size correctly for out-of-range radices.
13422 (read1): Check for integer overflow in radices, and in
13423 read-circle numbers.
82cb60d3
PE
13424 (read_escape): Avoid int overflow.
13425 (Fload, openp, read_buffer_size, read1)
13426 (substitute_object_recurse, read_vector, read_list, map_obarray):
13427 Use ptrdiff_t, not int, for sizes.
13428 (read1): Use EMACS_INT, not int, for sizes.
20270765 13429 Check for size overflow.
8b9ac8b4 13430
7fcccf1e
PE
13431 * image.c (cache_image): Check for size arithmetic overflow.
13432
bfbbd7e7
PE
13433 * lread.c: Integer overflow issues.
13434 (saved_doc_string_size, saved_doc_string_length)
13435 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13436 Now ptrdiff_t, not int.
13437 (read1): Don't assume doc string length fits in int. Check for
13438 out-of-range doc string lengths.
13439 (read_list): Don't assume file position fits in int.
39019e54 13440 (read_escape): Check for hex character overflow.
bfbbd7e7 13441
4e323265
LL
134422011-06-22 Leo Liu <sdl.web@gmail.com>
13443
13444 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13445 Move to minibuffer.el.
13446
85fece3e
PE
134472011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13448
20b84ce9 13449 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
13450 The following patches are for when GLYPH_DEBUG && !XASSERT.
13451 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13452 * dispnew.c (flush_stdout):
13453 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13454 Mark as externally visible.
13455 * dispnew.c (check_window_matrix_pointers): Now static.
13456 * dispnew.c (window_to_frame_vpos):
13457 * xfns.c (unwind_create_frame):
13458 * xterm.c (x_check_font): Remove unused local.
13459 * scroll.c (CHECK_BOUNDS):
13460 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13461 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13462 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13463 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13464 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13465 Now static.
13466 (debug_method_add): Use va_list and vsprintf rather than relying
13467 on undefined behavior with wrong number of arguments.
13468 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13469 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13470 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13471 since we're not interested in debugging glyphs with old libraries.
13472 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13473 GCC 4.6.0's static checking.
13474
0766b489
PE
134752011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13476
31fd4b32
PE
13477 Integer overflow and signedness fixes (Bug#8873).
13478 A few related buffer overrun fixes, too.
13479
b79e8648
PE
13480 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13481
0766b489
PE
13482 * dispextern.h (struct face.stipple):
13483 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13484 (x_bitmap_mask, x_allocate_bitmap_record)
13485 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13486 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13487 (x_create_bitmap_from_xpm_data):
13488 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13489 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13490 (.bitmaps_last):
13491 * xfaces.c (load_pixmap):
13492 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13493 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13494 (.bitmaps_last, struct x_output.icon_bitmap):
13495 Use ptrdiff_t, not int, for bitmap indexes.
13496 (x_allocate_bitmap_record): Check for size overflow.
13497 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13498
b081724f
PE
13499 Use ptrdiff_t, not int, for overlay counts.
13500 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13501 * editfns.c (overlays_around, get_pos_property):
13502 * textprop.c (get_char_property_and_overlay):
13503 * xdisp.c (next_overlay_change, note_mouse_highlight):
13504 * xfaces.c (face_at_buffer_position):
21514da7
PE
13505 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13506 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13507 (Fnext_overlay_change, Fprevious_overlay_change)
13508 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 13509 Use ptrdiff_t, not int, for sizes.
21514da7 13510 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 13511
3de73e5e
PE
13512 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13513
2606c57b
PE
13514 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13515 (x_session_initialize): Do not assume string length fits in int.
13516
aaafe47a
PE
13517 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13518 This is unlikely, but can occur if DPI is outlandish.
13519
2674ddc8 13520 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
13521 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13522
28154962
PE
13523 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13524 * xrdb.c (magic_file_p, search_magic_path):
13525 Omit last arg SUFFIX; it was always 0. All callers changed.
13526 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13527
7de51af5
PE
13528 * xfont.c (xfont_match): Avoid need for strlen.
13529
25ed6cc3
PE
13530 * xfns.c: Don't assume strlen fits in int.
13531 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13532
4eab31dd
PE
13533 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13534 not unsigned long, as we prefer signed integers. All callers changed.
13535 Detect integer overflow in repeat count.
13536 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 13537 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 13538
171e2a58
PE
13539 * termcap.c: Don't assume sizes fit in int and never overflow.
13540 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13541 (gobble_line): Check for size-calculation overflow.
13542
ad39faca 13543 * minibuf.c (Fread_buffer):
6e5bb2dc 13544 * lread.c (intern, intern_c_string):
74ca2eb3
PE
13545 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13546 Don't assume string length fits in int.
13547
52c61c22 13548 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
13549 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13550
b5b8c9e5
PE
13551 * font.c: Don't assume string length fits in int.
13552 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13553 Use ptrdiff_t, not int.
ccd6111c
PE
13554 (font_intern_prop): Don't assume string length fits in int.
13555 Don't assume integer property fits in fixnum.
13556 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 13557
882f0d81 13558 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 13559 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
13560 Reformulate so as not to need the command string.
13561 Invoke gzip -cd rather than gunzip, as it's more portable.
13562 (lock_info_type, lock_file_1, lock_file):
13563 Don't assume pid_t and time_t fit in unsigned long.
13564 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13565 (current_lock_owner): Prefer signed type for sizes.
13566 Use memcpy, not strncpy, where memcpy is what is really wanted.
13567 Don't assume (via atoi) that time_t and pid_t fit in int.
13568 Check for time_t and/or pid_t out of range, e.g., via a network share.
13569 Don't alloca where an auto var works fine.
13570
93f4cf88
PE
13571 * fileio.c: Fix some integer overflow issues.
13572 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13573 Don't assume string length fits in int.
13574 (directory_file_name): Don't assume string length fits in long.
13575 (make_temp_name): Don't assume pid fits in int, or that its print
13576 length is less than 20.
13577
f3e92b69
PE
13578 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13579
1bfdaf10
PE
13580 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13581
35016e9a
PE
13582 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13583
3d1e65a1
PE
13584 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13585 We prefer signed integers, even for size calculations.
13586
0b963a93
PE
13587 * emacs.c: Don't assume string length fits in 'int'.
13588 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13589 (main): Don't invoke strlen when not needed.
13590
573f4b54
PE
13591 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13592 (XD_DEBUG_MESSAGE): Don't waste a byte.
13593
989f33ba
PE
13594 * callproc.c (getenv_internal_1, getenv_internal)
13595 (Fgetenv_internal):
965d34eb
PE
13596 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13597
e4d29b33
PE
13598 * lread.c (invalid_syntax): Omit length argument.
13599 All uses changed. This doesn't fix a bug, but it simplifies the
13600 code away from its former Hollerith-constant appearance, and it's
13601 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 13602 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 13603
eb49b136
PE
13604 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13605 This didn't break anything, but it didn't help either.
13606 It's confusing to put a bogus integer in a place where the actual
13607 value does not matter.
9f62aeb1 13608 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 13609 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 13610
15375a22
PE
13611 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13612 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13613 implementation.
b61cc01c
PE
13614 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13615 We prefer signed types, and the value cannot exceed the EMACS_INT
13616 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
13617 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13618 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13619 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 13620
53b2623d
PE
13621 * indent.c (sane_tab_width): New function.
13622 (current_column, scan_for_column, Findent_to, position_indentation)
13623 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 13624 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 13625
51cab52b 13626 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 13627
f2ed8a70
PE
13628 * lisp.h (lint_assume): New macro.
13629 * composite.c (composition_gstring_put_cache):
13630 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13631
abe80cc6
PE
13632 * editfns.c, insdel.c:
13633 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 13634
b02c740e
PE
13635 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13636
ebc96716
PE
13637 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13638
b4e50fa0 13639 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 13640 Use much-faster test for byte-length change.
311d5d7c 13641 Don't assume string byte-length fits in 'int'.
a4cf38e4 13642 Check that character arg fits in 'int'.
85461888 13643 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 13644
c0c1ee9f
PE
13645 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13646
a498d7f4
PE
13647 * fns.c (concat): Catch string overflow earlier.
13648 Do not rely on integer wraparound.
13649
51cab52b
PE
13650 * dispextern.h (struct it.overlay_strings_charpos)
13651 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
13652 * xdisp.c (forward_to_next_line_start)
13653 (back_to_previous_visible_line_start)
13654 (reseat_at_next_visible_line_start, next_element_from_buffer):
13655 Don't arbitrarily truncate the value of 'selective' to int.
13656
76031fad
PE
13657 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13658
5eb55db9
PE
13659 * composite.c: Don't truncate sizes to 'int'.
13660 (composition_gstring_p, composition_reseat_it)
13661 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
13662 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13663 not EMACS_UINT, for indexes.
5eb55db9 13664
0703a717
PE
13665 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13666
d6202519
PE
13667 * buffer.c: Include <verify.h>.
13668 (struct sortvec.priority, struct sortstr.priority):
8961a454 13669 Now EMACS_INT, not int.
c20998a7 13670 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
13671 (struct sortstr.size, record_overlay_string)
13672 (struct sortstrlist.size, struct sortlist.used):
13673 Don't truncate size to int.
13674 (record_overlay_string): Check for size-calculation overflow.
d6202519 13675 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 13676
d5a19415
JM
136772011-06-22 Jim Meyering <meyering@redhat.com>
13678
029529ac 13679 Don't leak an XBM-image-sized buffer
d5a19415
JM
13680 * image.c (xbm_load): Free the image buffer after using it.
13681
a9041e6c
PE
136822011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13683
13684 Port to Sun C.
13685 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13686 that Sun C diagnosed.
13687 * fns.c (secure_hash): Fix pointer signedness issue.
13688 * intervals.c (static_offset_intervals): New function.
13689 (offset_intervals): Use it.
13690
7f3f739f
LL
136912011-06-21 Leo Liu <sdl.web@gmail.com>
13692
13693 * deps.mk (fns.o):
13694 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13695 sha512.h.
13696
13697 * fns.c (secure_hash): Rename from crypto_hash_function and change
13698 the first arg to accept symbols.
5b66d427 13699 (Fsecure_hash): New primitive.
7f3f739f
LL
13700 (syms_of_fns): New symbols.
13701
76147d94
DD
137022011-06-20 Deniz Dogan <deniz@dogan.se>
13703
13704 * process.c (Fset_process_buffer): Clarify return value in
13705 docstring.
13706
7d7d0045
CY
137072011-06-18 Chong Yidong <cyd@stupidchicken.com>
13708
13709 * dispnew.c (add_window_display_history): Use BVAR.
13710
13711 * xdisp.c (debug_method_add): Use BVAR.
13712 (check_window_end, dump_glyph_matrix, dump_glyph)
13713 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13714
13715 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13716 Likewise.
13717
13718 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13719 check till after the cache is created in init_frame_faces.
13720
ff2bc410
SM
137212011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13722
13723 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13724
28177add
PE
137252011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13726
dd3482fe
PE
13727 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13728 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13729 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13730
393d71f3 13731 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
13732 * fileio.c (Finsert_file_contents):
13733 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13734 Remove the old (too-loose) buffer overflow checks.
13735 They weren't needed, since make_gap checks for buffer overflow.
13736 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13737 The old code merely checked for Emacs fixnum overflow, and relied
13738 on undefined (wraparound) behavior. The new code avoids undefined
13739 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13740
2e6813b0 13741 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
13742 Tune. Don't use wider integers than needed. Don't use alloca.
13743 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 13744
599a9e4f
PE
13745 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13746
99561444
PE
13747 * insdel.c, lisp.h (buffer_overflow): New function.
13748 (insert_from_buffer_1, replace_range, replace_range_2):
13749 * insdel.c (make_gap_larger):
13750 * editfns.c (Finsert_char):
13751 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13752
28177add
PE
13753 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13754
e69dafad
PE
137552011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13756
4baa020d 13757 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 13758
b1c46f02
PE
13759 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13760 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13761
e69dafad
PE
13762 * fileio.c: Don't assume EMACS_INT fits in off_t.
13763 (emacs_lseek): New static function.
13764 (Finsert_file_contents, Fwrite_region): Use it.
13765 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13766
566684ea
PE
13767 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13768
e6966cd6
PE
13769 * fns.c: Don't overflow int when computing a list length.
13770 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13771 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13772 truncation on 64-bit hosts. Check for QUIT every
13773 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13774 faster and is responsive enough.
13775 (Flength): Report an error instead of overflowing an integer.
13776 (Fsafe_length): Return a float if the value is not representable
13777 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 13778 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 13779 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 13780
dd0b0efb
PE
13781 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13782 (header_size, word_size): New constants.
13783 (allocate_vectorlike): Don't check size overflow here.
13784 (allocate_vector): Check it here instead, since this is the only
13785 caller of allocate_vectorlike that could cause overflow.
13786 Check that the new vector's length is representable as a fixnum.
13787
86fe5cfe
PE
13788 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13789 The previous code was bogus. For example, next_almost_prime (32)
13790 returned 39, which is undesirable as it is a multiple of 3; and
13791 next_almost_prime (24) returned 25, which is a multiple of 5 so
13792 why was the code bothering to check for multiples of 7?
13793
80e88859
PE
13794 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13795
4a2f0ad6
PE
13796 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13797
f66c7cf8
PE
13798 Variadic C functions now count arguments with ptrdiff_t.
13799 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13800 Back then I didn't know that the Emacs coding style prefers signed int.
13801 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
13802 were being counted with int, which may truncate counts on 64-bit
13803 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
13804 * lisp.h (struct Lisp_Subr.function.aMANY)
13805 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13806 Arg counts are now ptrdiff_t, not size_t.
13807 All variadic functions and their callers changed accordingly.
13808 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13809 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13810 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13811 * callint.c (Fcall_interactively): Check arg count for overflow,
13812 to avoid potential buffer overrun. Use signed char, not 'int',
13813 for 'varies' array, so that we needn't bother to check its size
13814 calculation for overflow.
13815 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13816 * eval.c (apply_lambda):
13817 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13818 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13819 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13820
a1759b76
PE
13821 * callint.c (Fcall_interactively): Don't use index var as event count.
13822
d96be9fc
PE
13823 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13824 * mem-limits.h (SIZE): Remove; no longer used.
13825
a690a978 13826 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 13827
578c21e6
PE
13828 Remove unnecessary casts.
13829 * xterm.c (x_term_init):
13830 * xfns.c (x_set_border_pixel):
13831 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13832 These aren't needed now that we assume ANSI C.
13833
96f53c6c
PE
13834 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13835 It's more likely to cause problems (due to unsigned overflow)
13836 than to cure them.
13837
83c77d31
PE
13838 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13839
ee2079f1
PE
13840 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13841
6da65536
PE
13842 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13843
7147c4a4
PE
13844 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13845
193e32d9
PE
13846 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13847
e5533da6
PE
13848 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13849
9910e595
PE
13850 GLYPH_CODE_FACE returns EMACS_INT, not int.
13851 * dispextern.h (merge_faces):
13852 * xfaces.c (merge_faces):
01103c44
PE
13853 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13854 Don't assume EMACS_INT fits in int.
9910e595 13855
2638320e
PE
13856 * character.h (CHAR_VALID_P): Remove unused parameter.
13857 * fontset.c, lisp.h, xdisp.c: All uses changed.
13858
045eb8d9
PE
13859 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13860
c1f134b5
PE
13861 * fns.c (concat): Minor tuning based on overflow analysis.
13862 This doesn't fix any bugs. Use int to hold character, instead
13863 of constantly refetching from Emacs object. Use XFASTINT, not
13864 XINT, for value known to be a character. Don't bother comparing
13865 a single byte to 0400, as it's always less.
13866
395fcb93 13867 * floatfns.c (Fexpt):
327eeec8
PE
13868 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13869
abbd3d23
PE
13870 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13871 for characters.
13872
684a03ef
PE
13873 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13874
0fed43f3
PE
13875 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13876 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13877 incorrectly succeed when S was a string, because 4294967386 was
13878 truncated before it was used.
13879
8fd02eb7
PE
13880 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13881 Otherwise, an out-of-range integer could cause undefined behavior
13882 on a 64-bit host.
13883
f8c86b69
PE
13884 * composite.c: Use int, not EMACS_INT, for characters.
13885 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13886 EMACS_INT, for values that are known to be in character range.
13887 This doesn't fix any bugs but is the usual style inside Emacs and
13888 may generate better code on 32-bit machines.
13889
34206dd2
PE
13890 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13891 This is for reasons similar to the recent CHAR_STRING fix.
13892 * charset.c (Fencode_char): Check that character arg is actually
13893 a character. Pass an int to ENCODE_CHAR.
13894 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13895 wider than 'int', as a compile-time check to prevent future regressions
13896 in this area.
13897
c5958d4c 13898 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
13899
13900 Make sure a 64-bit char is never passed to CHAR_STRING.
13901 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13902 by silently ignoring the top 32 bits, allowing some values
13903 that were far too large to be valid characters.
13904 * character.h: Include <verify.h>.
13905 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13906 arguments are no wider than unsigned, as a compile-time check
13907 to prevent future regressions in this area.
13908 * data.c (Faset):
01103c44 13909 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
13910 (Fsubst_char_in_region):
13911 * fns.c (concat):
13912 * xdisp.c (decode_mode_spec_coding):
13913 Adjust to CHAR_STRING's new requirement.
13914 * editfns.c (Finsert_char, Fsubst_char_in_region):
13915 * fns.c (concat): Check that character args are actually
13916 characters. Without this test, these functions did the wrong
13917 thing with wildly out-of-range values on 64-bit hosts.
13918
d37ca623
PE
13919 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13920 These casts should not be needed on 32-bit hosts, either.
13921 * keyboard.c (read_char):
13922 * lread.c (Fload): Remove casts to unsigned.
13923
ea204efb
PE
13924 * lisp.h (UNSIGNED_CMP): New macro.
13925 This fixes comparison bugs on 64-bit hosts.
13926 (ASCII_CHAR_P): Use it.
13927 * casefiddle.c (casify_object):
01103c44 13928 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
13929 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13930 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13931 * dispextern.h (FACE_FROM_ID):
13932 * keyboard.c (read_char): Use UNSIGNED_CMP.
13933
41cb286c
PE
13934 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13935 not to EMACS_INT, to avoid GCC warning.
13936
4a1b9832
PE
13937 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13938
55daad71
PE
13939 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13940 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13941 isn't needed on 32-bit machines.
8f95c75c 13942
01103c44
PE
13943 * buffer.c (Fgenerate_new_buffer_name):
13944 Use EMACS_INT for count, not int.
0ceccced 13945 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
13946
13947 * data.c (Qcompiled_function): Now static.
13948
c6f072e7
PE
13949 * window.c (window_body_lines): Now static.
13950
20ce5912
PE
13951 * image.c (gif_load): Rename local to avoid shadowing.
13952
9c4c5f81
PE
13953 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13954 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13955 * alloc.c (make_save_value): Integer argument is now of type
13956 ptrdiff_t, not int.
13957 (mark_object): Use ptrdiff_t, not int.
13958 * lisp.h (pD): New macro.
13959 * print.c (print_object): Use it.
13960
c0c5c8ae
PE
13961 * alloc.c: Use EMACS_INT, not int, to count objects.
13962 (total_conses, total_markers, total_symbols, total_vector_size)
13963 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
13964 (total_free_floats, total_floats, total_free_intervals)
13965 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
13966 Now EMACS_INT, not int. All uses changed.
13967 (Fgarbage_collect): Compute overall total using a double, so that
13968 integer overflow is less likely to be a problem. Check for overflow
13969 when converting back to an integer.
5a25e253
PE
13970 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13971 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13972 These were 'int' variables that could overflow on 64-bit hosts;
13973 they were never used, so remove them instead of repairing them.
211a0b2a 13974 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
13975 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13976 Previously, this ceilinged at INT_MAX, but that doesn't work on
13977 64-bit machines.
e46bb31a 13978 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 13979
c78baabf 13980 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 13981 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
13982 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13983 when a (possibly-narrower) signed value would do just as well.
13984 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 13985
c9d624c6
PE
13986 * alloc.c: Catch some string size overflows that we were missing.
13987 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13988 for convenience in STRING_BYTES_MAX.
13989 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13990 The definition here is exact; the one in lisp.h was approximate.
13991 (allocate_string_data): Check for string overflow. This catches
13992 some instances we weren't catching before. Also, it catches
13993 size_t overflow on (unusual) hosts where SIZE_MAX <= min
13994 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13995 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 13996
c9d624c6
PE
13997 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13998 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 13999 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 14000
353032ce
PE
14001 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14002
2bccce07
PE
14003 * alloc.c (Fmake_string): Check for out-of-range init.
14004
0ac30604
SM
140052011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14006
14007 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14008
c195f2de
JD
140092011-06-14 Jan Djärv <jan.h.d@swipnet.se>
14010
14011 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14012 xg_get_default_scrollbar_width.
14013
14014 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14015 (int_gtk_range_get_value): Move to the scroll bar part of the file.
14016 (style_changed_cb): Call update_theme_scrollbar_width and call
14017 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14018 all frames (Bug#8505).
14019 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14020 Call gtk_window_set_resizable if HAVE_GTK3.
14021 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14022 and height if HAVE_GTK3 (Bug#8505).
14023 (scroll_bar_width_for_theme): New variable.
14024 (update_theme_scrollbar_width): New function.
14025 (xg_get_default_scrollbar_width): Move code to
14026 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14027 (xg_initialize): Call update_theme_scrollbar_width.
14028
14029 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14030
14031 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14032
e10ac9f1
MR
140332011-06-12 Martin Rudalics <rudalics@gmx.at>
14034
14035 * frame.c (make_frame): Call other_buffer_safely instead of
14036 other_buffer.
14037
14038 * window.c (temp_output_buffer_show): Call display_buffer with
14039 second argument Vtemp_buffer_show_specifiers and reset latter
14040 immediately after the call.
14041 (Vtemp_buffer_show_specifiers): New variable.
14042 (auto_window_vscroll_p, next_screen_context_lines)
14043 (Vscroll_preserve_screen_position): Remove leading asterisks from
14044 doc-strings.
14045
2d3c217e 140462011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 14047
7b7f97e8 14048 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
14049 * buffer.c (Qclone_number): Remove for now, as it's unused.
14050 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14051 (record_buffer): Remove unused local.
14052 * frame.c (other_visible_frames, frame_buffer_list): Now static.
14053 (set_frame_buffer_list): Remove; unused.
14054 * frame.h (other_visible_frames): Remove decl.
14055 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14056 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14057 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14058 if HAVE_GPM.
14059 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14060 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
14061 Define only if HAVE_GPM.
14062 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
14063 (update_hints_inhibit): Remove; never set. All uses removed.
14064 * widgetprv.h (emacsFrameClassRec): Remove decl.
14065 * window.c (delete_deletable_window): Now returns void, since it
14066 wasn't returning anything.
14067 (compare_window_configurations): Remove unused locals.
14068 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
14069 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
14070 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
14071 the same widths as pointers. This follows up on the 2011-05-06 patch.
14072 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
14073 * xterm.h: Likewise.
14074 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
14075
1384b89e
JB
140762011-06-12 Juanma Barranquero <lekktu@gmail.com>
14077
14078 * makefile.w32-in: Update dependencies.
14079 (LISP_H): Add lib/intprops.h.
14080
1100a63c
CY
140812011-06-11 Chong Yidong <cyd@stupidchicken.com>
14082
14083 * image.c (gif_load): Add animation frame delay to the metadata.
14084 (syms_of_image): Use DEFSYM. New symbol `delay'.
14085
6198ccd0
MR
140862011-06-11 Martin Rudalics <rudalics@gmx.at>
14087
14088 * window.c (delete_deletable_window): Re-add.
14089 (Fset_window_configuration): Rewrite to handle dead buffers and
14090 consequently deletable windows.
14091 (window_tree, Fwindow_tree): Remove. Supply functionality in
14092 window.el.
14093 (compare_window_configurations): Simplify code.
14094
b6e3633c
AS
140952011-06-11 Andreas Schwab <schwab@linux-m68k.org>
14096
1ab0dee5
AS
14097 * image.c (imagemagick_load_image): Fix type mismatch.
14098 (Fimagemagick_types): Likewise.
14099
b6e3633c
AS
14100 * window.h (replace_buffer_in_windows): Declare.
14101
9397e56f
MR
141022011-06-11 Martin Rudalics <rudalics@gmx.at>
14103
14104 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
14105 Qclone_number. Remove external declaration of Qdelete_window.
14106 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
14107 code.
640c8776
SM
14108 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
14109 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
14110 (Fother_buffer): Rewrite doc-string. Major rewrite for new
14111 buffer list implementation.
14112 (other_buffer_safely): New function.
14113 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
14114 calls to replace_buffer_in_windows and
14115 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
14116 if allowed.
14117 (record_buffer): Inhibit quitting and rewrite using quittable
14118 functions. Run Qbuffer_list_update_hook if allowed.
14119 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
14120 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
14121 Move switch-to-buffer to window.el.
9397e56f
MR
14122 (bury-buffer): Move to window.el.
14123 (Vbuffer_list_update_hook): New variable.
14124
14125 * lisp.h (other_buffer_safely): Add prototype in buffer.c
14126 section.
14127
14128 * window.h (resize_frame_windows): Move up in code.
14129 (Fwindow_frame): Remove EXFUN.
14130 (replace_buffer_in_all_windows): Remove prototype.
14131 (replace_buffer_in_windows_safely): Add prototype.
14132
14133 * window.c: Declare Qdelete_window static again. Move down
14134 declaration of select_count.
14135 (Fnext_window, Fprevious_window): Rewrite doc-strings.
14136 (Fother_window): Move to window.el.
14137 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14138 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14139 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14140 window.el.
14141 (replace_buffer_in_windows): Implement by calling
14142 Qreplace_buffer_in_windows.
14143 (replace_buffer_in_all_windows): Remove with some functionality
14144 moved into replace_buffer_in_windows_safely.
14145 (replace_buffer_in_windows_safely): New function.
14146 (select_window_norecord, select_frame_norecord): Move in front
14147 of run_window_configuration_change_hook. Remove now obsolete
14148 declarations.
640c8776
SM
14149 (Fset_window_buffer): Rewrite doc-string.
14150 Call Qrecord_window_buffer.
9397e56f
MR
14151 (keys_of_window): Move binding for other-window to window.el.
14152
b50691aa
CY
141532011-06-11 Chong Yidong <cyd@stupidchicken.com>
14154
14155 * dispextern.h (struct image): Replace data member, whose int_val
14156 and ptr_val fields were not used by anything, with a single
14157 lisp_val object.
14158
14159 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14160 (gif_clear_image, gif_load, imagemagick_load_image)
14161 (gs_clear_image, gs_load): Callers changed.
14162
3f754b86
PE
141632011-06-10 Paul Eggert <eggert@cs.ucla.edu>
14164
cca69397
PE
14165 * buffer.h: Include <time.h>, for time_t.
14166 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
14167
109e28d0
PE
14168 Fix minor problems found by static checking.
14169
60737f02
PE
14170 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14171
4b66faf3
PE
14172 Make identifiers static if they are not used in other modules.
14173 * data.c (Qcompiled_function, Qframe, Qvector):
14174 * image.c (QimageMagick, Qsvg):
14175 * minibuf.c (Qmetadata):
14176 * window.c (resize_window_check, resize_root_window): Now static.
14177 * window.h (resize_window_check, resize_root_window): Remove decls.
14178
109e28d0
PE
14179 * window.c (window_deletion_count, delete_deletable_window):
14180 Remove; unused.
46a4ce9e
PE
14181 (window_body_lines): Now static.
14182 (Fdelete_other_windows_internal): Mark vars as initialized.
14183 Make sure 'resize_failed' is initialized.
14184 (run_window_configuration_change_hook): Rename local to avoid shadowing.
14185 (resize_window_apply): Remove unused local.
14186 * window.h (delete_deletable_window): Remove decl.
14187
109e28d0 14188 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
14189 (imagemagick_load_image): Fix pointer signedness problem by changing
14190 last arg from unsigned char * to char *. All uses changed.
14191 Also, fix a local for similar reasons.
14192 Remove unused locals. Remove locals to avoid shadowing.
14193 (fn_rsvg_handle_free): Remove; unused.
14194 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 14195 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 14196
3f754b86
PE
14197 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14198
2547adb1
CY
141992011-06-10 Chong Yidong <cyd@stupidchicken.com>
14200
14201 * image.c (gif_load): Fix omitted cast error introduced by
14202 2011-06-06 change.
14203
2c8e37d4
MR
142042011-06-10 Martin Rudalics <rudalics@gmx.at>
14205
14206 * window.h (resize_proportionally, orig_total_lines)
14207 (orig_top_line): Remove from window structure.
14208 (set_window_height, set_window_width, change_window_heights)
14209 (Fdelete_window): Remove prototypes.
14210 (resize_frame_windows): Remove duplicate declaration.
14211
440a42e3
EZ
142122011-06-10 Eli Zaretskii <eliz@gnu.org>
14213
14214 * window.h (resize_frame_windows, resize_window_check)
14215 (delete_deletable_window, resize_root_window)
14216 (resize_frame_windows): Declare prototypes.
14217
14218 * window.c (resize_window_apply): Make definition be "static" to
14219 match the prototype.
14220
562dd5e9
MR
142212011-06-10 Martin Rudalics <rudalics@gmx.at>
14222
14223 * window.c: Remove declarations of Qwindow_size_fixed,
14224 window_min_size_1, window_min_size_2, window_min_size,
14225 size_window, window_fixed_size_p, enlarge_window, delete_window.
14226 Remove static from declaration of Qdelete_window, it's
14227 temporarily needed by Fbury_buffer.
14228 (replace_window): Don't assign orig_top_line and
14229 orig_total_lines.
14230 (Fdelete_window, delete_window): Remove. Window deletion is
14231 handled by window.el.
640c8776
SM
14232 (window_loop): Remove DELETE_OTHER_WINDOWS case.
14233 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
14234 (Fdelete_other_windows): Remove. Deleting other windows is
14235 handled by window.el.
14236 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
14237 handled in window.el.
14238 (window_min_size_2, window_min_size_1, window_min_size): Remove.
14239 Window minimum sizes are handled in window.el.
14240 (shrink_windows, size_window, set_window_height)
14241 (set_window_width, change_window_heights, window_height)
14242 (window_width, CURBEG, CURSIZE, enlarge_window)
14243 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
14244 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
14245 handled in window.el.
14246 (make_dummy_parent): Rename to make_parent_window and give it a
14247 second argument horflag.
14248 (make_window): Don't set resize_proportionally any more.
14249 (Fsplit_window): Remove. Windows are split in window.el.
14250 (save_restore_action, save_restore_orig_size)
14251 (shrink_window_lowest_first, save_restore_orig_size): Remove.
14252 Resize mini windows in window.el.
14253 (grow_mini_window, shrink_mini_window): Implement by calling
14254 Qresize_root_window_vertically, resize_window_check and
14255 resize_window_apply.
640c8776
SM
14256 (saved_window, Fset_window_configuration, save_window_save):
14257 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
14258 resize_proportionally.
14259 (window_min_height, window_min_width): Move to window.el.
14260 (keys_of_window): Move bindings for delete-other-windows,
14261 split-window, delete-window and enlarge-window to window.el.
14262
14263 * buffer.c: Temporarily extern Qdelete_window.
14264 (Fbury_buffer): Temporarily call Qdelete_window instead of
14265 Fdelete_window (Fbury_buffer will move to window.el soon).
14266
14267 * frame.c (set_menu_bar_lines_1): Remove code handling
14268 orig_top_line and orig_total_lines.
14269
14270 * dispnew.c (adjust_frame_glyphs_initially): Don't use
14271 set_window_height but set heights directly.
14272 (change_frame_size_1): Use resize_frame_windows.
14273
14274 * xdisp.c (init_xdisp): Don't use set_window_height but set
14275 heights directly.
14276
640c8776
SM
14277 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14278 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
14279 run_window_configuration_change_hook.
14280
14281 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14282 instead of change_window_heights and run
14283 run_window_configuration_change_hook.
14284
1a13852e
MR
142852011-06-09 Martin Rudalics <rudalics@gmx.at>
14286
14287 * window.c (replace_window): Rename second argument REPLACEMENT to
14288 NEW. New third argument SETFLAG. Rewrite.
14289 (delete_window, make_dummy_parent): Call replace_window with
14290 third argument 1.
14291 (window_list_1): Move down in code.
14292 (run_window_configuration_change_hook): Move set_buffer part
14293 before select_frame_norecord part in order to unwind correctly.
14294 Rename count1 to count.
14295 (recombine_windows, delete_deletable_window, resize_root_window)
14296 (Fdelete_other_windows_internal)
14297 (Frun_window_configuration_change_hook, make_parent_window)
14298 (resize_window_check, resize_window_apply, Fresize_window_apply)
14299 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
14300 (Fdelete_window_internal, Fresize_mini_window_internal):
14301 New functions.
1a13852e
MR
14302 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14303
f3d1777e
MR
143042011-06-08 Martin Rudalics <rudalics@gmx.at>
14305
496e208e
MR
14306 * window.h (window): Add some new members to window structure -
14307 normal_lines, normal_cols, new_total, new_normal, clone_number,
14308 splits, nest, prev_buffers, next_buffers.
14309 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 14310 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 14311
f3d1777e
MR
14312 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14313 Remove.
496e208e
MR
14314 (make_dummy_parent): Set new members of windows structure.
14315 (make_window): Move down in code. Handle new members of window
14316 structure.
14317 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14318 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14319 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14320 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
14321 (Fset_window_next_buffers, Fset_window_clone_number):
14322 New functions.
496e208e
MR
14323 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14324 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14325 Doc-string fixes.
14326 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14327 Argument WINDOW can be now internal window too.
14328 (Fwindow_use_time): Move up in code.
14329 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14330 Rewrite doc-string.
14331 (Fset_window_configuration, saved_window)
14332 (Fcurrent_window_configuration, save_window_save): Handle new
14333 members of window structure.
b9e809c2
MR
14334 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14335 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14336 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14337 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14338 Qget_mru_window, Qresize_root_window,
14339 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14340 Qauto_buffer_name; staticpro them.
f3d1777e 14341
abde8f8c
MR
143422011-06-07 Martin Rudalics <rudalics@gmx.at>
14343
14344 * window.c (Fwindow_total_size, Fwindow_left_column)
14345 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14346 (Fwindow_list_1): New functions.
14347 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
14348 (Fwindow_width, Fscroll_left, Fscroll_right):
14349 Use window_body_cols instead of window_box_text_cols.
14350 (delete_window, Fset_window_configuration):
14351 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
14352 (delete_all_subwindows): Take a window as argument and not a
14353 structure. Rewrite.
190b47e6
MR
14354 (window_loop): Remove handling of GET_LRU_WINDOW and
14355 GET_LARGEST_WINDOW.
14356 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
14357
14358 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
14359 window_box_text_cols. delete_all_subwindows now takes a
14360 Lisp_Object as argument.
abde8f8c 14361
640c8776
SM
14362 * indent.c (compute_motion, Fcompute_motion):
14363 Use window_body_cols instead of window_box_text_cols.
abde8f8c 14364
fa8a67e6
MR
14365 * frame.c (delete_frame): Call delete_all_subwindows with root
14366 window as argument.
14367
a54e3482
DC
143682011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14369
14370 * fns.c (Fputhash): Document return value.
14371
60002bf5
CY
143722011-06-06 Chong Yidong <cyd@stupidchicken.com>
14373
14374 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14375
0c671da6 143762011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 14377
b862a52a 14378 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 14379
be44ca6c
PE
14380 Check for overflow when converting integer to cons and back.
14381 * charset.c (Fdefine_charset_internal, Fdecode_char):
14382 Use cons_to_unsigned to catch overflow.
14383 (Fencode_char): Use INTEGER_TO_CONS.
14384 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14385 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14386 * data.c (long_to_cons, cons_to_long): Remove.
14387 (cons_to_unsigned, cons_to_signed): New functions.
14388 These signal an error for invalid or out-of-range values.
14389 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14390 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14391 * font.c (Ffont_variation_glyphs):
14392 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14393 * lisp.h: Include <intprops.h>.
14394 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14395 (cons_to_signed, cons_to_unsigned): New decls.
14396 (long_to_cons, cons_to_long): Remove decls.
14397 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14398 (Fprimitive_undo): Use CONS_TO_INTEGER.
14399 * xfns.c (Fx_window_property): Likewise.
14400 * xselect.c: Include <limits.h>.
14401 (x_own_selection, selection_data_to_lisp_data):
14402 Use INTEGER_TO_CONS.
14403 (x_handle_selection_request, x_handle_selection_clear)
14404 (x_get_foreign_selection, Fx_disown_selection_internal)
14405 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14406 (lisp_data_to_selection_data): Use cons_to_unsigned.
14407 (x_fill_property_data): Use cons_to_signed.
14408 Report values out of range.
14409
d1f3d2af
PE
14410 Check for buffer and string overflow more precisely.
14411 * buffer.h (BUF_BYTES_MAX): New macro.
14412 * lisp.h (STRING_BYTES_MAX): New macro.
14413 * alloc.c (Fmake_string):
14414 * character.c (string_escape_byte8):
14415 * coding.c (coding_alloc_by_realloc):
14416 * doprnt.c (doprnt):
14417 * editfns.c (Fformat):
14418 * eval.c (verror):
14419 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14420 since they may not be the same number.
14421 * editfns.c (Finsert_char):
14422 * fileio.c (Finsert_file_contents):
14423 Likewise for BUF_BYTES_MAX.
14424
dd52fcea
PE
14425 * image.c: Use ptrdiff_t, not int, for sizes.
14426 (slurp_file): Switch from int to ptrdiff_t.
14427 All uses changed.
14428 (slurp_file): Check that file size fits in both size_t (for
14429 malloc) and ptrdiff_t (for sanity and safety).
14430
7f9bbdbb
PE
14431 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14432 if b->modtime has its maximal value.
14433
dfe18f82
PE
14434 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14435
84acfcf0
PE
14436 Don't assume time_t can fit into int.
14437 * buffer.h (struct buffer.modtime): Now time_t, not int.
14438 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14439 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14440
ccd9a01a
PE
14441 Minor fixes for signed vs unsigned integers.
14442 * character.h (MAYBE_UNIFY_CHAR):
14443 * charset.c (maybe_unify_char):
14444 * keyboard.c (read_char, reorder_modifiers):
14445 XINT -> XFASTINT, since the integer must be nonnegative.
14446 * ftfont.c (ftfont_spec_pattern):
14447 * keymap.c (access_keymap, silly_event_symbol_error):
14448 XUINT -> XFASTINT, since the integer must be nonnegative.
14449 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14450 since it makes no difference and we prefer signed.
14451 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14452 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14453 nonnegative.
14454
d6d100dd
SM
144552011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14456
14457 * window.h (Fwindow_frame): Declare.
14458
2b6148e4
PE
144592011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14460
14461 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14462 (SPARE_MEMORY): Always define.
14463 (LARGE_REQUEST): Remove.
14464 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14465
f230ecc9
MR
144662011-06-06 Martin Rudalics <rudalics@gmx.at>
14467
727e958e
MR
14468 * lisp.h: Move EXFUNS for Fframe_root_window,
14469 Fframe_first_window and Fset_frame_selected_window to window.h.
14470
14471 * window.h: Move EXFUNS for Fframe_root_window,
14472 Fframe_first_window and Fset_frame_selected_window here from
14473 lisp.h.
14474
14475 * frame.c (Fwindow_frame, Fframe_first_window)
14476 (Fframe_root_window, Fframe_selected_window)
14477 (Fset_frame_selected_window): Move to window.c.
14478 (Factive_minibuffer_window): Move to minibuf.c.
14479 (Fother_visible_frames_p): New function.
14480
14481 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14482
f230ecc9
MR
14483 * window.c (decode_window, decode_any_window): Move up in code.
14484 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14485 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
14486 (Fwindow_buffer): Move up and rewrite doc-string.
14487 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14488 (Fwindow_prev): New functions.
727e958e
MR
14489 (Fwindow_frame): Move here from frame.c. Accept any window as
14490 argument.
14491 (Fframe_root_window, Fframe_first_window)
14492 (Fframe_selected_window): Move here from frame.c. Accept frame
14493 or arbitrary window as argument. Update doc-strings.
14494 (Fminibuffer_window): Move up in code.
14495 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
14496 (Fset_frame_selected_window): Move here from frame.c.
14497 Marginal rewrite.
727e958e
MR
14498 (Fselected_window, select_window, Fselect_window): Move up in
14499 code. Minor doc-string fixes.
f230ecc9 14500
4d09bcf6
PE
145012011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14502
14503 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14504 Do not assume that spare memory exists; that assumption is valid
14505 only if SYSTEM_MALLOC.
14506 (LARGE_REQUEST): New macro, so that the issue of large requests
14507 is separated from the issue of spare memory.
14508
810928a2
AS
145092011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14510
172418ad
AS
14511 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14512 format. (Bug#8806)
14513
43f862f7
AS
14514 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14515
810928a2
AS
14516 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14517 before statements.
14518
a059fe24
JD
145192011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14520
14521 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14522
14523 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14524
14525 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14526 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14527
989bf368
JB
145282011-06-05 Juanma Barranquero <lekktu@gmail.com>
14529
14530 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14531
4b80f674
CY
145322011-06-04 Chong Yidong <cyd@stupidchicken.com>
14533
14534 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14535 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
14536 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14537 New error handlers.
4b80f674
CY
14538 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14539 Obey Vx_select_enable_clipboard_manager. Catch errors in
14540 x_clipboard_manager_save (Bug#8779).
14541 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 14542 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 14543
99a33b77 145442011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
14545
14546 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14547
99a33b77 145482011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
14549
14550 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14551 in the current matrix if keep_current_p is non-zero.
14552
8264569d
EZ
145532011-06-04 Eli Zaretskii <eliz@gnu.org>
14554
14555 * bidi.c (bidi_level_of_next_char): Fix last change.
14556
57f97249
EZ
145572011-06-03 Eli Zaretskii <eliz@gnu.org>
14558
fec2107c 14559 Support bidi reordering of text covered by display properties.
57f97249 14560
fec2107c
EZ
14561 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14562 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14563 (bidi_cache_search, bidi_cache_iterator_state)
14564 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
14565 (bidi_level_of_next_char, bidi_move_to_visually_next):
14566 Support character positions inside a run of characters covered by a
fec2107c
EZ
14567 display string.
14568 (bidi_paragraph_init, bidi_resolve_explicit_1)
14569 (bidi_level_of_next_char): Call bidi_fetch_char and
14570 bidi_fetch_char_advance instead of FETCH_CHAR and
14571 FETCH_CHAR_ADVANCE.
14572 (bidi_init_it): Initialize new members.
14573 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14574 definitions.
14575 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14576 instead of using explicit *_CHAR codes.
d6d100dd
SM
14577 (bidi_resolve_explicit, bidi_resolve_weak):
14578 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
14579 bidirectional text is supported only in multibyte buffers.
14580 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14581 it to initialize the frame_window_p member of struct bidi_it.
14582 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14583 (bidi_resolve_explicit, bidi_resolve_weak)
14584 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14585 bidi_it->nchars is non-positive.
14586 (bidi_level_of_next_char): Don't try to lookup the cache for the
14587 next/previous character if nothing is cached there yet, or if we
14588 were just reseat()'ed to a new position.
c40e2fb2 14589
0e14fe90
EZ
14590 * xdisp.c (set_cursor_from_row): Set start and stop points
14591 according to the row's direction when priming the loop that looks
14592 for the glyph on which to display cursor.
14593 (single_display_spec_intangible_p): Function deleted.
14594 (display_prop_intangible_p): Reimplement to call
14595 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
14596 Accept 3 additional arguments needed by handle_display_spec.
14597 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
14598 values: lists, `(when COND...)' forms, etc.
14599 (single_display_spec_string_p): Support property values that are
14600 lists with the argument STRING its top-level element.
14601 (display_prop_string_p): Fix the condition for processing a
14602 property that is a list to be consistent with handle_display_spec.
fec2107c 14603 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
14604 last portion of handle_display_prop.
14605 (compute_display_string_pos): Accept additional argument
14606 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14607 value of a `display' property is a "replacing spec".
14608 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14609 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14610 the display property, but just return a value indicating whether
14611 the display property will replace the characters it covers.
14612 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14613 frame_window_p members of struct bidi_it.
d6d100dd
SM
14614 (compute_display_string_pos, compute_display_string_end):
14615 New functions.
fec2107c
EZ
14616 (push_it): Accept second argument POSITION, where pop_it should
14617 jump to continue iteration.
14618 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 14619
fec2107c
EZ
14620 * keyboard.c (adjust_point_for_property): Adjust the call to
14621 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
14622
14623 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
14624 (bidi_init_it): Update prototypes.
14625 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
14626 (compute_display_string_pos, compute_display_string_end):
14627 Declare prototypes.
fec2107c
EZ
14628 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14629 EMACS_INT.
fc6f18ce 14630
40087514 146312011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 14632
57f53182
PE
14633 Malloc failure behavior now depends on size of allocation.
14634 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14635 * lisp.h: Change signatures accordingly.
14636 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14637 All callers changed. (Bug#8762)
14638
14639 * gnutls.c: Use Emacs's memory allocators.
14640 Without this change, the gnutls library would invoke malloc etc.
14641 directly, which causes problems on non-SYNC_INPUT hosts, and which
14642 runs afoul of improving memory_full behavior. (Bug#8761)
14643 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14644 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14645 xfree instead of the default malloc, realloc, free.
14646 (Fgnutls_boot): No need to check for memory allocation failure,
14647 since xmalloc does that for us.
14648
ac32cd99 14649 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
14650 * category.c (hash_get_category_set):
14651 * ccl.c (ccl_driver):
14652 * charset.c (Fdefine_charset_internal):
14653 * charset.h (struct charset.hash_index):
14654 * composite.c (get_composition_id, gstring_lookup_cache)
14655 (composition_gstring_put_cache):
14656 * composite.h (struct composition.hash_index):
14657 * dispextern.h (struct image.hash):
14658 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14659 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14660 (hashfn_equal, hashfn_user_defined, make_hash_table)
14661 (maybe_resize_hash_table, hash_lookup, hash_put)
14662 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14663 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14664 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14665 * image.c (make_image, search_image_cache, lookup_image)
14666 (xpm_put_color_table_h):
14667 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 14668 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 14669 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 14670 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
14671 * alloc.c (allocate_vectorlike):
14672 Check for overflow in vector size calculations.
14673 * ccl.c (ccl_driver):
14674 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
14675 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14676 need to be updated by these changes.
40087514
PE
14677 * fns.c (make_hash_table, maybe_resize_hash_table):
14678 Check for integer overflow with large hash tables.
0de4bb68
PE
14679 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14680 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14681 (SXHASH_REDUCE): New macro.
14682 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14683 Use it instead of discarding useful hash info with large hash values.
14684 (sxhash_float): New function.
14685 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14686 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
14687 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14688 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
14689 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14690 Adjust signatures to match updated version of code.
14691 (consing_since_gc): Now EMACS_INT, since a single hash table can
14692 use more than INT_MAX bytes.
14693
698d32e2
DN
146942011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14695
14696 Make it possible to build with GCC-4.6+ -O2 -flto.
14697
14698 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14699
fd6fa53f
SM
147002011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14701
14702 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14703 Call minibuffer-inactive-mode.
14704
864db017
JB
147052011-05-31 Juanma Barranquero <lekktu@gmail.com>
14706
14707 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14708 Update dependencies.
14709
2ad0baf4
DN
147102011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14711
14712 * data.c (init_data): Remove code for UTS, this system is not
14713 supported anymore.
14714
4fcc2638
DN
147152011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14716
14717 Don't force ./temacs to start in terminal mode.
14718
14719 * frame.c (make_initial_frame): Initialize faces in all cases, not
14720 only when CANNOT_DUMP is defined.
14721 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14722
c56e0fd5
DN
147232011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14724
14725 * dispnew.c (add_window_display_history): Use const for the string
14726 pointer. Remove declaration, not needed.
14727
333d54da 147282011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 14729
55d4c1b2 14730 Use 'inline', not 'INLINE'.
333d54da 14731 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
14732 * alloc.c, fontset.c (INLINE): Remove.
14733 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14734 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14735 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14736 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14737 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14738
738db178
DN
147392011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14740
14741 Make it possible to run ./temacs.
14742
14743 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14744 syms_of_callproc does the same thing. Remove test for
14745 "initialized", do it in the caller.
14746 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14747
620c53a6
SM
147482011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14749
14750 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14751 (read_minibuf): Use get_minibuffer.
14752 (syms_of_minibuf): Use DEFSYM.
14753 (Qmetadata): New var.
14754 * data.c (Qbuffer): Don't make it static.
14755 (syms_of_data): Use DEFSYM.
14756
e003a292
PE
147572011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14758
14759 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14760 (CCL_CODE_MIN): New macro.
14761
ed008a6d
PE
147622011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14763
3687c2ef
PE
14764 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14765
ed008a6d
PE
14766 * eval.c (Qdebug): Now static.
14767 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14768 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14769 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14770
d66c4c7c
CY
147712011-05-29 Chong Yidong <cyd@stupidchicken.com>
14772
14773 * image.c: Various fixes to ImageMagick code comments.
14774 (Fimagemagick_types): Doc fix.
14775
5fbc2025
PE
147762011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14777
0196f88a
PE
14778 Minor fixes prompted by GCC 4.6.0 warnings.
14779
14780 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14781
5fbc2025
PE
14782 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14783 (x_clipboard_manager_save_all): Move extern decl to ...
14784 * xterm.h: ... here, so that it can be checked for consistency.
14785
1dd3c2d9
CY
147862011-05-29 Chong Yidong <cyd@stupidchicken.com>
14787
14788 * xselect.c (x_clipboard_manager_save_frame)
14789 (x_clipboard_manager_save_all): New functions.
14790 (Fx_clipboard_manager_save): Lisp function deleted.
14791
14792 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14793 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14794
14795 * xterm.h: Update prototype.
14796
5ba6571d
WX
147972011-05-28 William Xu <william.xwl@gmail.com>
14798
14799 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14800 exiting (Bug#8239).
14801
3eaff834
JM
148022011-05-28 Jim Meyering <meyering@redhat.com>
14803
e1900994 14804 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
14805 * fns.c (to_uchar): Define.
14806 (crypto_hash_function): Use it to convert some newly-signed
14807 variables to unsigned, to avoid sign-extension bugs. For example,
14808 without this change, (md5 "truc") would evaluate to
14809 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14810 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 14811 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 14812
0f6990a7
PE
148132011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14814
14815 Integer overflow fixes.
c8a9ca5a 14816
08686060
PE
14817 * dbusbind.c: Serial number integer overflow fixes.
14818 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
14819 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14820 to hold a serial number that is too large for a fixnum.
14821 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14822 Check for serial numbers out of range. Decode any serial number
59568bf0 14823 that was so large that it became a float. (Bug#8722)
08686060 14824
2d1fc3c7
PE
14825 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14826 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14827 Use XFASTINT rather than XUINT when numbers are nonnegative.
14828 (xd_append_arg, Fdbus_method_return_internal):
14829 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14830 arguments, check that Lisp number is nonnegative, rather than
59568bf0 14831 silently wrapping negative numbers around. (Bug#8722)
30217ff0 14832 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 14833 (Bug#8722)
2d1fc3c7 14834
c8a9ca5a
PE
14835 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14836
519e1d69
PE
14837 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14838
6df6ae42 14839 ccl: Add integer overflow checks.
30569699
PE
14840 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14841 (IN_INT_RANGE): New macros.
14842 (ccl_driver): Use them to check for integer overflow when
14843 decoding a CCL program. Many of the new checks are whether XINT (x)
14844 fits in int; it doesn't always, on 64-bit hosts. The new version
14845 doesn't catch all possible integer overflows, but it's an
847044ea 14846 improvement. (Bug#8719)
30569699 14847
c11285dc
PE
14848 * alloc.c (make_event_array): Use XINT, not XUINT.
14849 There's no need for unsigned here.
14850
fdccd48e
PE
14851 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14852 This follows up to the 2011-05-06 change that substituted uintptr_t
14853 for EMACS_INT. This case wasn't caught back then.
14854
37910ab2
PE
14855 Rework Fformat to avoid integer overflow issues.
14856 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14857 now (part of C89). Include <verify.h>.
14858 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14859 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14860 (Fformat): Avoid the prepass trying to compute sizes; it was only
14861 approximate and thus did not catch overflow reliably. Instead, walk
14862 through the format just once, formatting and computing sizes as we go,
14863 checking for integer overflow at every step, and allocating a larger
14864 buffer as needed. Keep track separately whether the format is
14865 multibyte. Keep only the most-recently calculated precision, rather
14866 than them all. Record whether each argument has been converted to
14867 string. Use EMACS_INT, not int, for byte and char and arg counts.
14868 Support field widths and precisions larger than INT_MAX. Avoid
14869 sprintf's undefined behavior with conversion specifications such as %#d
14870 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14871 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14872 formatting out-of-range floating point numbers with int
9173deec 14873 formats. (Bug#8668)
37910ab2 14874
2e6578fb
PE
14875 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14876
0ae6bdee
PE
14877 * data.c: Avoid integer truncation in expressions involving floats.
14878 * data.c: Include <intprops.h>.
14879 (arith_driver): When there's an integer overflow in an expression
14880 involving floating point, convert the integers to floating point
14881 so that the resulting value does not suffer from catastrophic
14882 integer truncation. For example, on a 64-bit host (* 4
14883 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14884 Do not rely on undefined behavior after integer overflow.
14885
de883a70
PE
14886 merge count_size_as_multibyte, parse_str_to_multibyte
14887 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 14888 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
14889 Check for integer overflow.
14890 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14891 since it's now a duplicate of the other. This is more of
14892 a character than a buffer op, so better that it's in character.c.
14893 * fns.c, print.c: Adjust to above changes.
14894
2ff916cb
PE
148952011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14896
14897 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14898
f1b54466
PE
148992011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14900
fb1ac845
PE
14901 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14902 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14903 (x_clipboard_manager_save): Now static.
14904 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14905
f1b54466
PE
14906 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14907 (crypto_hash_function): Now static.
14908 Fix pointer signedness problems. Avoid unnecessary initializations.
14909
a9f737ee
CY
149102011-05-27 Chong Yidong <cyd@stupidchicken.com>
14911
14912 * termhooks.h (Vselection_alist): Make it terminal-local.
14913
14914 * terminal.c (create_terminal): Initialize it.
14915
14916 * xselect.c: Support for clipboard managers.
14917 (Vselection_alist): Move to termhooks.h as terminal-local var.
14918 (LOCAL_SELECTION): New macro.
14919 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14920 (symbol_to_x_atom): Remove gratuitous arg.
14921 (x_handle_selection_request, lisp_data_to_selection_data)
14922 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
14923 (x_own_selection, x_get_local_selection, x_convert_selection):
14924 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
14925 (some_frame_on_display): Delete unused function.
14926 (Fx_own_selection_internal, Fx_get_selection_internal)
14927 (Fx_disown_selection_internal, Fx_selection_owner_p)
14928 (Fx_selection_exists_p): New optional frame arg.
14929 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14930 (x_handle_selection_clear): Don't treat other terminals with the
14931 same keyboard specially. Use the terminal-local Vselection_alist.
14932 (x_clear_frame_selections): Use Frun_hook_with_args.
14933
14934 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14935
14936 * xterm.h: Add support for those atoms.
14937
e067f0c1
CY
149382011-05-26 Chong Yidong <cyd@stupidchicken.com>
14939
14940 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14941 (converted_selections, conversion_fail_tag): New global variables.
14942 (x_selection_request_lisp_error): Free the above.
14943 (x_get_local_selection): Remove unnecessary code.
14944 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
14945 of converted selections stored in converted_selections.
14946 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
14947 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14948 (x_convert_selection): New function.
14949 (x_handle_selection_event): Simplify.
14950 (x_get_foreign_selection): Don't ignore incoming requests while
14951 waiting for an answer; this will fail when we implement
14952 SAVE_TARGETS, and seems unnecessary anyway.
14953 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14954 (Vx_sent_selection_functions): Doc fix.
14955
0f4aebc0
LL
149562011-05-26 Leo Liu <sdl.web@gmail.com>
14957
14958 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14959
e61124cd
YM
149602011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14961
14962 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14963
14964 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14965 for fringe update if it has periodic bitmap.
ac389d0c 14966 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
14967 and fringe_bitmap_periodic_p.
14968
14969 * fringe.c (get_fringe_bitmap_data): New function.
14970 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14971 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14972 row. Mark glyph row for fringe update if periodicity changed.
14973
14974 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14975 for fringe update unless it has periodic bitmap.
14976
f16d9837
KH
149772011-05-25 Kenichi Handa <handa@m17n.org>
14978
14979 * xdisp.c (get_next_display_element): Set correct it->face_id for
14980 a static composition.
14981
e1b90ef6
LL
149822011-05-24 Leo Liu <sdl.web@gmail.com>
14983
14984 * deps.mk (fns.o):
14985 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14986
14987 * fns.c (crypto_hash_function, Fsha1): New function.
14988 (Fmd5): Use crypto_hash_function.
14989 (syms_of_fns): Add Ssha1.
14990
7400048f
PE
149912011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14992
14993 * gnutls.c: Remove unused macros.
14994 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14995 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14996 Remove macros that are defined and never used.
14997 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14998
abb71cf4
CY
149992011-05-22 Chong Yidong <cyd@stupidchicken.com>
15000
15001 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15002 (Fx_get_selection_internal): Minor cleanup.
15003 (Fx_own_selection_internal): Rename arguments for consistency with
15004 select.el.
15005
6307db39
PE
150062011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15007
15008 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15009
f3d4e0a4
CY
150102011-05-22 Chong Yidong <cyd@stupidchicken.com>
15011
15012 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15013
4d8ade89
YM
150142011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15015
15016 * dispnew.c (scrolling_window): Don't exclude the case that the
15017 last enabled row in the desired matrix touches the bottom boundary.
15018
32078c8d
GM
150192011-05-21 Glenn Morris <rgm@gnu.org>
15020
15021 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
15022 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15023 and add some more files.
32078c8d 15024
7285dc67
EZ
150252011-05-20 Eli Zaretskii <eliz@gnu.org>
15026
15027 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15028 report_file_error introduced by the change from 2011-05-07.
15029
89d1bd22
PE
150302011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15031
15032 * systime.h (Time): Define only if emacs is defined.
15033 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15034 where the include path doesn't have X11/X.h by default. See
15035 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15036
cd394be1 150372011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
15038
15039 * composite.c (find_automatic_composition): Fix previous change.
15040
b9704ad9
GM
150412011-05-20 Glenn Morris <rgm@gnu.org>
15042
15043 * lisp.mk: New file, split from Makefile.in.
15044 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15045 (shortlisp): Remove.
15046 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15047
4a720484
GM
150482011-05-19 Glenn Morris <rgm@gnu.org>
15049
15050 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15051 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15052 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15053 (lisp): Set the order to that of loadup.el.
15054 (shortlisp): Make it a copy of $lisp.
15055 (SOME_MACHINE_LISP): Remove.
15056 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15057 Use just $shortlisp, not $SOME_MACHINE_LISP too.
15058
a28d4396
KH
150592011-05-18 Kenichi Handa <handa@m17n.org>
15060
15061 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
15062 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
15063 (find_automatic_composition): Mostly rewrite for efficiency.
15064
a2b1fa8e
JB
150652011-05-18 Juanma Barranquero <lekktu@gmail.com>
15066
15067 * makefile.w32-in: Update dependencies.
15068
8e1f5610
CS
150692011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
15070
15071 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 15072 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 15073
7025ee00 150742011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 15075
cdfa6eab
PE
15076 Fix some integer overflow issues, such as string length overflow.
15077
06d6db33
PE
15078 * insdel.c (count_size_as_multibyte): Check for string overflow.
15079
2b4560a8
PE
15080 * character.c (lisp_string_width): Check for string overflow.
15081 Use EMACS_INT, not int, for string indexes and lengths; in
15082 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
15083 the resulting string length overflows an EMACS_INT; instead,
15084 report a string overflow if no precision given. When checking for
15085 precision exhaustion, use a check that cannot possibly have
15086 integer overflow. (Bug#8675)
15087 * character.h (lisp_string_width): Adjust to new signature.
15088
cb93f9be
PE
15089 * alloc.c (string_overflow): New function.
15090 (Fmake_string): Use it. This doesn't change behavior, but saves
15091 a few bytes and will simplify future changes.
15092 * character.c (string_escape_byte8): Likewise.
15093 * lisp.h (string_overflow): New decl.
15094
1a1f3366
PE
15095 Fixups, following up to the user-interface timestamp change.
15096 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
15097 for UI timestamps, instead of unsigned long.
9fbd6841
PE
15098 * msdos.c (mouse_get_pos): Likewise.
15099 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
15100 * w32gui.h (Time): Define by including "systime.h" rather than by
15101 declaring it ourselves. (Bug#8664)
15102
d4e3e4d3
PE
15103 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
15104 * image.c (clear_image_cache): Likewise.
15105
f6a24d19
PE
15106 * term.c (term_mouse_position): Don't assume time_t wraparound.
15107
08dc5ae6
PE
15108 Be more systematic about user-interface timestamps.
15109 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
15110 and sometimes 'EMACS_UINT', to represent these timestamps.
15111 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
15112 This makes the code easier to follow, and makes it easier to catch
15113 integer overflow bugs such as Bug#8664.
15114 * frame.c (Fmouse_position, Fmouse_pixel_position):
15115 Use Time, not unsigned long, for user-interface timestamps.
15116 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
15117 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
15118 * keyboard.h (last_event_timestamp): Likewise.
15119 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15120 * menu.h (xmenu_show): Likewise.
15121 * term.c (term_mouse_position): Likewise.
15122 * termhooks.h (struct input_event.timestamp): Likewise.
15123 (struct terminal.mouse_position_hook): Likewise.
15124 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15125 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15126 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
15127 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15128 what it was before.
15129 * menu.h, termhooks.h: Include "systime.h", for Time.
15130
8e55734a
PE
15131 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15132 Don't assume that the difference between two unsigned long values
15133 can fit into an integer. At this point, we know button_down_time
15134 <= event->timestamp, so the difference must be nonnegative, so
15135 there's no need to cast the result if double-click-time is
15136 nonnegative, as it should be; check that it's nonnegative, just in
15137 case. This bug is triggered when events are more than 2**31 ms
86db42d2 15138 apart (about 25 days). (Bug#8664)
8e55734a 15139
841f1b75 15140 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 15141 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 15142
3e26f69c
PE
15143 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15144 that always fit in int. Use a sentinel instead of a counter, to
15145 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
15146 * frame.h (struct frame): Use int for menu_bar_items_used
15147 instead of EMACS_INT, since it always fits in int.
3e26f69c 15148
5cc152c0
PE
15149 * menu.c (grow_menu_items): Check for int overflow.
15150
d89eb65e
PE
15151 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15152
5235bd3e
PE
15153 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15154 Before, the code was not consistent. These values cannot exceed
15155 2**31 - 1 so there's no need to make them unsigned.
15156 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15157 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15158 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15159 as modifiers.
15160 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15161
bc827e23
PE
15162 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15163 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15164 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15165 presumably because the widths might not match.
15166
78eb494e
PE
15167 * window.c (size_window): Avoid needless test at loop start.
15168
04f2d78b
CB
151692011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
15170
15171 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15172
d2fc7e3d 151732011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
15174
15175 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15176
d2fc7e3d 151772011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
15178
15179 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15180 `width' to `bar_area_x' and `bar_area_width', respectively.
15181 (x_scroll_run): Take account of fringe background extension.
15182
04f2d78b
CB
15183 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15184 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
15185 `bar_area_width', respectively.
15186 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15187 background extension.
15188
79b70037
GM
151892011-05-10 Jim Meyering <meyering@redhat.com>
15190
15191 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15192
2f142cc5
JB
151932011-05-10 Juanma Barranquero <lekktu@gmail.com>
15194
15195 * image.c (Finit_image_library): Return t for built-in image types,
15196 like pbm and xbm. (Bug#8640)
15197
57679c86
AS
151982011-05-09 Andreas Schwab <schwab@linux-m68k.org>
15199
15200 * w32menu.c (set_frame_menubar): Fix submenu allocation.
15201
888c9e86
EZ
152022011-05-07 Eli Zaretskii <eliz@gnu.org>
15203
b0512a1d
EZ
15204 * w32console.c (Fset_screen_color): Doc fix.
15205 (Fget_screen_color): New function.
15206 (syms_of_ntterm): Defsubr it.
15207
7285dc67
EZ
15208 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15209 unlink the temporary file if Fcall_process didn't create it in the
15210 first place.
15211 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15212 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
15213 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
15214 cue to call_process_cleanup not to close that handle.
15215
4d3fcc8e
BK
152162011-05-07 Ben Key <bkey76@gmail.com>
15217
15218 * makefile.w32-in: The bootstrap-temacs rule now makes use of
15219 one of two shell specific rules, either bootstrap-temacs-CMD or
15220 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
15221 to the previous implementation of the bootstrap-temacs rule.
15222 The bootstrap-temacs-CMD rule is similar to the previous
15223 implementation of the bootstrap-temacs rule except that it
15224 makes use of the ESC_CFLAGS variable instead of the CFLAGS
15225 variable.
15226
15227 These changes, along with some changes to nt/configure.bat,
15228 nt/gmake.defs, and nt/nmake.defs, are required to extend my
15229 earlier fix to add support for --cflags and --ldflags options
15230 that include quotes so that it works whether make uses cmd or
15231 sh as the shell.
15232
b4289b64
MA
152332011-05-06 Michael Albinus <michael.albinus@gmx.de>
15234
15235 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
15236 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
15237 is a constant.
15238 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
15239 a string. Handle both cases.
15240 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
15241 (Fdbus_register_method): Use Qinvalid_function.
15242
af4c0e28
JB
152432011-05-06 Juanma Barranquero <lekktu@gmail.com>
15244
15245 * makefile.w32-in: Update dependencies.
15246 (LISP_H): Add inttypes.h and stdin.h.
15247 (PROCESS_H): Add unistd.h.
15248
c51453d9
EZ
152492011-05-06 Eli Zaretskii <eliz@gnu.org>
15250
15251 * lread.c: Include limits.h (fixes the MS-Windows build broken by
15252 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15253
8ff0ac3c 152542011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 15255
4c4b566b
PE
15256 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15257
aab2b9b5
PE
15258 * term.c (vfatal): Remove stray call to va_end.
15259 It's not needed and the C Standard doesn't allow it here anyway.
15260
c378da0b
PE
15261 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15262 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
15263
288b08c7
PE
15264 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15265 bytes.
15266
e3601888
PE
15267 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15268
db6c0e74
PE
15269 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15270
dd5963ea
PE
15271 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15272
88c9450f
PE
15273 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15274
2f9442b8
PE
15275 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15276
c032b5f8
PE
15277 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15278 * charset.c (Fdefine_charset_internal): Don't initialize
15279 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 15280 32-bit int (Bug#8600).
a108c10b
PE
15281
15282 * lread.c (read_integer): Be more consistent with string-to-number.
15283 Use string_to_number to do the actual conversion; this avoids
15284 rounding errors and fixes some other screwups. Without this fix,
15285 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15286 (digit_to_number): Move earlier, for benefit of read_integer.
15287 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 15288 not a digit in any supported base. (Bug#8602)
a108c10b 15289
ad5f9eea
PE
15290 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15291
aec1708a
PE
15292 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15293 to match comment at start of function. This also removes a
15294 GCC warning about overflow in a 32+64-bit port.
15295
47be4ab5
PE
15296 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15297
371cac43
PE
15298 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15299 Reported by Stefan Monnier in
15300 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
15301 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15302 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 15303
d01a7826
PE
15304 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15305 (EMACS_UINTPTR): Likewise, with uintptr_t.
15306
7fd47d5c
PE
15307 * lisp.h: Prefer 64-bit EMACS_INT if available.
15308 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15309 on 32-bit hosts that have 64-bit int, so that they can access
15310 large files.
122b0c86
PE
15311 However, temporarily disable this change unless the temporary
15312 symbol WIDE_EMACS_INT is defined.
7fd47d5c 15313
8727937b
PE
15314 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15315
8ac068ac
PE
15316 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15317 This removes an assumption that EMACS_INT and long are the same
15318 width as pointers. The assumption is true for Emacs porting targets
15319 now, but we want to make other targets possible.
15320 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15321 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15322 In the rest of the code, change types of integers that hold casted
15323 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15324 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15325 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15326 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15327 No need to cast type when ORing.
15328 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15329 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15330 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15331 assume EMACS_INT is the same width as char *.
15332 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15333 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15334 Remove no-longer-needed casts.
15335 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15336 (xg_tool_bar_help_callback, xg_make_tool_item):
15337 Use EMACS_INTPTR to hold an integer
15338 that will be cast to void *; this can avoid a GCC warning
15339 if EMACS_INT is not the same width as void *.
15340 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15341 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15342 (current_message_1, set_message_1):
15343 Use a local to convert to proper width without a cast.
15344 * xmenu.c (dialog_selection_callback): Likewise.
15345
ede49d71
PE
15346 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15347 Also, don't assume VALBITS / RAND_BITS is less than 5,
15348 and don't rely on undefined behavior when shifting a 1 left into
15349 the sign bit.
15350 * lisp.h (get_random): Change signature to match.
15351
2f30ecd0
PE
15352 * lread.c (hash_string): Use size_t, not int, for hash computation.
15353 Normally we prefer signed values; but hashing is special, because
15354 it's better to use unsigned division on hash table sizes so that
15355 the remainder is nonnegative. Also, size_t is the natural width
15356 for hashing into memory. The previous code used 'int', which doesn't
15357 retain enough info to hash well into very large tables.
15358 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15359
2a866e7b
PE
15360 * dbusbind.c: Don't possibly lose pointer info when converting.
15361 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15362 Use XPNTR rather than XHASH, so that the high-order bits of
15363 the pointer aren't lost when converting through void *.
15364
51639eac
PE
15365 * eval.c (Fautoload): Don't double-shift a pointer.
15366
92394119
PE
15367 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15368
dbdb9a7c
JB
153692011-05-06 Juanma Barranquero <lekktu@gmail.com>
15370
15371 * gnutls.c (DEF_GNUTLS_FN):
15372 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15373
db7a0b4f
AS
153742011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15375
15376 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15377 marker. (Bug#8610)
15378
cd394be1 153792011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
15380
15381 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15382 New version that can reserve upto 2GB of heap space.
15383
f7ff1b0f 153842011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
15385
15386 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15387
639c109b
TZ
153882011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15389
15390 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15391 `gnutls_certificate_set_x509_key_file'.
15392
d2127135
JB
153932011-05-05 Juanma Barranquero <lekktu@gmail.com>
15394
15395 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15396 Update dependencies.
15397
e968f4f3
JB
153982011-05-04 Juanma Barranquero <lekktu@gmail.com>
15399
15400 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15401 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15402 Remove unused parameter `fildes'.
15403 * process.c (read_process_output, send_process): Don't pass it.
15404
84d358f0
JB
154052011-05-04 Juanma Barranquero <lekktu@gmail.com>
15406
15407 Fix previous change: the library cache is defined in w32.c.
15408 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15409 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15410
0898ca10
JB
154112011-05-04 Juanma Barranquero <lekktu@gmail.com>
15412
15413 Implement dynamic loading of GnuTLS on Windows.
15414
15415 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15416 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15417 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15418 Declare.
15419
15420 * gnutls.c (Qgnutls_dll): Define.
15421 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15422 (gnutls_*): Declare function pointers.
15423 (init_gnutls_functions): New function to initialize function pointers.
15424 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15425 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15426 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15427 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15428 (emacs_gnutls_write, emacs_gnutls_read)
15429 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15430 (Fgnutls_available_p): New function.
15431 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15432 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15433 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15434
15435 * image.c: Include w32.h.
15436 (Vimage_type_cache): Delete.
15437 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15438 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15439 (w32_delayed_load): Move to w32.c.
15440
15441 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15442
15443 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15444 (w32_delayed_load): Move from image.c. When loading a library, record
15445 its filename in the :loaded-from property of the library id.
15446 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15447 Initialize and staticpro them.
15448 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15449
15450 * process.c: Include lisp.h before w32.h, not after.
15451 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15452 instead of gnutls_record_check_pending.
15453
15454 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15455
ff4de4aa
TZ
154562011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15457
15458 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15459 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15460 as passed in.
15461
abe95abb
JD
154622011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15463
15464 * xterm.c (x_set_frame_alpha): Do not set property on anything
15465 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15466
e16e55d4
JB
154672011-05-02 Juanma Barranquero <lekktu@gmail.com>
15468
15469 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15470
bafcf6a5
JB
154712011-05-02 Juanma Barranquero <lekktu@gmail.com>
15472
15473 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15474 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15475 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15476 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15477 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15478 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15479 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15480 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15481 (Qgnutls_bootprop_callbacks_verify): Make static.
15482
e7a6747f
AS
154832011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15484
19ed11ba
AS
15485 * callproc.c: Indentation fixup.
15486
e7a6747f 15487 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
15488 (wait_for_termination, interruptible_wait_for_termination):
15489 Move after wait_for_termination_1.
e7a6747f 15490
1ef14cb4
LMI
154912011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15492
15493 * sysdep.c (interruptible_wait_for_termination): New function
15494 which is like wait_for_termination, but allows keyboard
15495 interruptions.
15496
15497 * callproc.c (Fcall_process): Add (:file "file") as an option for
15498 the STDOUT buffer.
15499 (Fcall_process_region): Ditto.
15500
330d880c
EZ
155012011-04-30 Eli Zaretskii <eliz@gnu.org>
15502
8db90b73
EZ
15503 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15504 rather than `XVECTOR (FOO)->size'.
15505
330d880c
EZ
15506 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15507 inttypes.h, as a gnulib replacement is used if it not available in
15508 system headers.
15509
15cbd324
EZ
155102011-04-21 Eli Zaretskii <eliz@gnu.org>
15511
15512 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15513 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15514 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15515
15516 * coding.c (coding_alloc_by_realloc): Error out if destination
15517 will grow beyond MOST_POSITIVE_FIXNUM.
15518 (decode_coding_emacs_mule): Abort if there isn't enough place in
15519 charbuf for the composition carryover bytes. Reserve an extra
15520 space for up to 2 characters produced in a loop.
15521 (decode_coding_iso_2022): Abort if there isn't enough place in
15522 charbuf for the composition carryover bytes.
15523
155242011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 15525
ae940cca
EZ
15526 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15527 aborting when %lld or %lll format is passed.
15528 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15529 %llo or %llx format is passed. (Bug#8545)
15530
03ab8921
EZ
15531 * window.c (window_scroll_line_based): Use a marker instead of
15532 simple variables to record original value of point. (Bug#7952)
15533
afda1437
EZ
15534 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15535 produced by %s or %c overflows available buffer space. (Bug#8545)
15536
f76dee0c
PE
155372011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15538
15539 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 15540 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 15541
fdc5744d
JB
155422011-04-28 Juanma Barranquero <lekktu@gmail.com>
15543
15544 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15545
638f053a
JB
155462011-04-28 Juanma Barranquero <lekktu@gmail.com>
15547
15548 * keyboard.c (Qdelayed_warnings_hook): Define.
15549 (command_loop_1): Run `delayed-warnings-hook'
15550 if Vdelayed_warnings_list is non-nil.
15551 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15552 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15553
d178f871
EZ
155542011-04-28 Eli Zaretskii <eliz@gnu.org>
15555
15556 * doprnt.c (doprnt): Don't return value smaller than the buffer
15557 size if the message was truncated. (Bug#8545).
15558
b124fd93
JB
155592011-04-28 Juanma Barranquero <lekktu@gmail.com>
15560
15561 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15562 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15563
e810457d
PE
155642011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15565
15566 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15567
ea51cceb
JB
155682011-04-27 Juanma Barranquero <lekktu@gmail.com>
15569
15570 * makefile.w32-in: Update dependencies.
15571
94dcfacf
EZ
155722011-04-27 Eli Zaretskii <eliz@gnu.org>
15573
15574 Improve `doprnt' and its usage. (Bug#8545)
15575 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15576 `format_end'. Remove support for %l as a conversion specifier.
15577 Don't use xrealloc. Improve diagnostics when the %l size modifier
15578 is used. Update the commentary.
15579
15580 * eval.c (verror): Simplify calculation of size_t.
15581
15582 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15583 messages.
15584
f61f41d7
PE
155852011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15586
15587 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15588 change.
15589
96fb4434
PE
155902011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15591
15592 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15593 This makes this file independent of the recent pseudovector change.
15594
671875da 155952011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 15596
69e9b5a3
PE
15597 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15598
b5f869a7 15599 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 15600 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 15601 Remove unused local.
c8926152 15602 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 15603
841a1577 15604 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
15605 GCC 4.6.0 optimizes based on type-based alias analysis.
15606 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
15607 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15608 != &v->size, and therefore "v->size = 1; b->size = 2; return
15609 v->size;" must therefore return 1. This assumption is incorrect
15610 for Emacs, since it type-puns struct Lisp_Vector * with many other
15611 types. To fix this problem, this patch adds a new type struct
f904488f 15612 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
15613 and pseudovectors, and helps optimizing compilers not get fooled
15614 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15615 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
15616 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15617 the size member.
eab3844f
PE
15618 (XSETPVECTYPE): Rewrite in terms of new macro.
15619 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15620 This is a bit clearer, and further avoids the possibility of
15621 undesirable aliasing.
15622 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 15623 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
15624 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15625 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
15626 (ASIZE): Now uses header.size rather than size.
15627 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
15628 to avoid the hassle of writing XVECTOR (foo)->header.size.
15629 (struct vectorlike_header): New type.
eab3844f
PE
15630 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15631 object, to help avoid aliasing.
15632 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15633 (SUBRP): Likewise, since Lisp_Subr is a special case.
15634 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15635 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15636 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 15637 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
15638 changed to be "header.size" and "header.next".
15639 * buffer.h (struct buffer): Likewise.
15640 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15641 * frame.h (struct frame): Likewise.
15642 * process.h (struct Lisp_Process): Likewise.
15643 * termhooks.h (struct terminal): Likewise.
15644 * window.c (struct save_window_data, struct saved_window): Likewise.
15645 * window.h (struct window): Likewise.
15646 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15647 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15648 * buffer.c (init_buffer_once): Likewise.
15649 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15650 special case.
15651 * process.c (Fformat_network_address): Use local var for size,
15652 for brevity.
15653
0df1eac5
PE
15654 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15655
847ab9d1 15656 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
15657 * data.c (atof): Remove decl; no longer used or needed.
15658 (digit_to_number): Move to lread.c.
15659 (Fstring_to_number): Use new string_to_number function, to be
15660 consistent with how the Lisp reader treats infinities and NaNs.
15661 Do not assume that floating-point numbers represent EMACS_INT
15662 without losing information; this is not true on most 64-bit hosts.
15663 Avoid double-rounding errors, by insisting on integers when
15664 parsing non-base-10 numbers, as the documentation specifies.
15665 * lisp.h (string_to_number): New decl, replacing ...
15666 (isfloat_string): Remove.
bc0a5c13 15667 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 15668 (read1): Do not accept +. and -. as integers; this
452f4150
PE
15669 appears to have been a coding error. Similarly, do not accept
15670 strings like +-1e0 as floating point numbers. Do not report
15671 overflow for integer overflows unless the base is not 10 which
15672 means we have no simple and reliable way to continue.
15673 Break out the floating-point parsing into a new
15674 function string_to_number, so that Fstring_to_number parses
15675 floating point numbers consistently with the Lisp reader.
04f2d78b 15676 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
15677 (E_CHAR, EXP_INT): Remove, replacing with ...
15678 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15679 (string_to_number): New function, replacing isfloat_string.
15680 This function checks for valid syntax and produces the resulting
15681 Lisp float number too. Rework it so that string-to-number
bc0a5c13 15682 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
15683 so that overflow for non-base-10 numbers is reported only when
15684 there's no portable and simple way to convert to floating point.
452f4150 15685
67769ffc
PE
15686 * textprop.c (set_text_properties_1): Rewrite for clarity,
15687 and to avoid GCC warning about integer overflow.
15688
c20db43f
PE
15689 * intervals.h (struct interval): Use EMACS_INT for members
15690 where EMACS_UINT might cause problems. See
15691 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15692 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15693 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15694 All uses changed.
37aa2f85
PE
15695 (offset_intervals): Tell GCC not to worry about length overflow
15696 when negating a negative length.
c20db43f 15697
2538aa2f
PE
15698 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15699 (overrun_check_free): Likewise.
15700
f2d3008d
PE
15701 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15702 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15703 word size.
15704
ec8df744
PE
15705 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15706 (gnutls_make_error): Rename local to avoid shadowing.
15707 (gnutls_emacs_global_deinit): ifdef out; not used.
15708 (Fgnutls_boot): Use const for pointer to readonly storage.
15709 Comment out unused local. Fix pointer signedness problems.
15710
640ee02d
PE
15711 * lread.c (openp): Don't stuff size_t into an 'int'.
15712 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15713 about possible signed overflow.
15714
6048fb2a
PE
15715 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15716 (GDK_KEY_g): Don't define if already defined.
15717 (xg_prepare_tooltip): Avoid pointer signedness problem.
15718 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15719
fa3c87e1
PE
15720 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15721 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15722
2172544b
PE
15723 * xfns.c (Fx_window_property): Simplify a bit,
15724 to make a bit faster and to avoid GCC 4.6.0 warning.
15725 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15726
9b821a21
PE
15727 * fns.c (internal_equal): Don't assume size_t fits in int.
15728
3c616cfa
PE
15729 * alloc.c (compact_small_strings): Tighten assertion a little.
15730
c2982e87
PE
15731 Replace pEd with more-general pI, and fix some printf arg casts.
15732 * lisp.h (pI): New macro, generalizing old pEd macro to other
15733 conversion specifiers. For example, use "...%"pI"d..." rather
15734 than "...%"pEd"...".
15735 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 15736 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
15737 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15738 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15739 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15740 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15741 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15742 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15743 64-bit hosts.
15744 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15745 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15746 * print.c (safe_debug_print, print_object): Likewise.
15747 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15748 to int.
6f04d126
PE
15749 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15750 avoiding the 0 flag, which is not portable.
c2982e87
PE
15751 * process.c (Fmake_network_process): Use pI to avoid cast.
15752 * region-cache.c (pp_cache): Likewise.
15753 * xdisp.c (decode_mode_spec): Likewise.
15754 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15755 behavior on 64-bit hosts with printf arg.
6f04d126 15756 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
15757 (x_stop_queuing_selection_requests): Likewise.
15758 (x_get_window_property): Don't truncate byte count to an 'int'
15759 when tracing.
0b432f21 15760
5e073ec7
PE
15761 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15762 here, since it parses constructs like leading '-' and spaces,
15763 which are not wanted; and it overflows with large numbers.
15764 Instead, simply match F[0-9]+, which is what is wanted anyway.
15765
36372bf9
PE
15766 * alloc.c: Remove unportable assumptions about struct layout.
15767 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15768 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15769 (allocate_vectorlike, make_pure_vector): Use the new macros,
15770 plus offsetof, to remove unportable assumptions about struct layout.
15771 These assumptions hold on all porting targets that I know of, but
15772 they are not guaranteed, they're easy to remove, and removing them
15773 makes further changes easier.
15774
0b432f21
PE
15775 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15776 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
15777 (string_overrun_cookie): Now const. Use initializers that
15778 don't formally overflow signed char, to avoid warnings.
000098c1
PE
15779 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15780 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
15781 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15782 multiple of sizeof (EMACS_INT); it need not be, if
15783 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 15784 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 15785
895009e1
JB
157862011-04-26 Juanma Barranquero <lekktu@gmail.com>
15787
15788 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15789
6a7a1b0b
TZ
157902011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15791
15792 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 15793 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
15794 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15795
841a1577 157962011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
15797
15798 * lisp.h (Qdebug): List symbol.
895009e1 15799 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
15800 * keyboard.c (debug-on-event): New variable.
15801 (handle_user_signal): Break into debugger when debug-on-event
15802 matches the current signal symbol.
15803
f2d3ba6f
DN
158042011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15805
15806 * alloc.c (check_sblock, check_string_bytes)
15807 (check_string_free_list): Convert to standard C.
15808
42ce4c63
TZ
158092011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15810
15811 * w32.c (emacs_gnutls_push): Fix typo.
15812
825cd63c
EZ
158132011-04-25 Eli Zaretskii <eliz@gnu.org>
15814
fb11d64d
EZ
15815 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15816 "cast to pointer from integer of different size".
15817
825cd63c
EZ
15818 Improve doprnt and its use in verror. (Bug#8545)
15819 * doprnt.c (doprnt): Document the set of format control sequences
15820 supported by the function. Use SAFE_ALLOCA instead of always
15821 using `alloca'.
15822
15823 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15824 is one byte too soon. Don't use xrealloc; instead xfree and
15825 xmalloc anew.
15826
e061a11b
TZ
158272011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15828
15829 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15830 callbacks stage.
15831
15832 * gnutls.c: Renamed global_initialized to
15833 gnutls_global_initialized. Added internals for the
15834 :verify-hostname-error, :verify-error, and :verify-flags
15835 parameters of `gnutls-boot' and documented those parameters in the
15836 docstring. Start callback support.
9173deec
JB
15837 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15838 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15839 on error. Return error code.
e061a11b
TZ
15840 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15841 (emacs_gnutls_read): Likewise.
15842 (Fgnutls_boot): Return handshake error code.
15843 (emacs_gnutls_handle_error): New function.
15844 (wsaerror_to_errno): Likewise.
15845
15846 * w32.h (emacs_gnutls_pull): Add prototype.
15847 (emacs_gnutls_push): Likewise.
15848
15849 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15850 (emacs_gnutls_push): Likewise.
15851
158522011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15853
15854 * process.c (wait_reading_process_output): Check if GnuTLS
15855 buffered some data internally if no FDs are set for TLS
15856 connections.
15857
15858 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15859 (LIBS): Link to USER_LIBS.
15860 ($(BLD)/gnutls.$(0)): New target.
15861
fa6996bc
EZ
158622011-04-24 Eli Zaretskii <eliz@gnu.org>
15863
eb35682e
EZ
15864 * xdisp.c (handle_single_display_spec): Rename the
15865 display_replaced_before_p argument into display_replaced_p, to
15866 make it consistent with the commentary. Fix typos in the
15867 commentary.
15868
e2ad650c
EZ
15869 * textprop.c (syms_of_textprop): Remove dead code.
15870 (copy_text_properties): Delete obsolete commentary about an
15871 interface that was deleted long ago. Fix typos in the description
15872 of arguments.
15873
1b2de274
EZ
15874 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15875 to changes in oldXMenu/XMenu.h from 2011-04-16.
15876 <menu_help_message, prev_menu_help_message>: Constify.
15877 (IT_menu_make_room): menu->help_text is now `const char **';
15878 adjust.
15879
15880 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15881 to changes in oldXMenu/XMenu.h from 2011-04-16.
15882 (struct XMenu): Declare `help_text' `const char **'.
15883
15884 * xfaces.c <Qunspecified>: Make extern again.
15885
15886 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 15887 required by POSIX.
1b2de274 15888
762b15be
EZ
15889 * doc.c (get_doc_string): Improve the format passed to `error'.
15890
15891 * doprnt.c (doprnt): Improve commentary.
15892
15893 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15894
15895 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15896 them with etags.
15897
f1052e5d
EZ
15898 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15899 changes in globals.h immediately force recompilation.
762b15be
EZ
15900 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15901 $(CURDIR)/s/ms-w32.h.
15902 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 15903
fa6996bc
EZ
15904 * character.c (Fchar_direction): Function deleted.
15905 (syms_of_character): Don't defsubr it.
15906 <char-direction-table>: Deleted.
15907
e6c3da20
EZ
159082011-04-23 Eli Zaretskii <eliz@gnu.org>
15909
15910 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15911 * doprnt.c: Include limits.h.
15912 (SIZE_MAX): New macro.
04f2d78b
CB
15913 (doprnt): Return a size_t value. 2nd arg is now size_t.
15914 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
15915 Improve overflow protection. Support `l' modifier for integer
15916 conversions. Support %l conversion. Don't assume an EMACS_INT
15917 argument for integer conversions and for %c.
15918
15919 * lisp.h (doprnt): Restore prototype.
15920
15921 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15922 $(SRC)/character.h.
15923
15924 * Makefile.in (base_obj): Add back doprnt.o.
15925
15926 * deps.mk (doprnt.o): Add back prerequisites.
15927 (callint.o): Depend on character.h.
15928
15929 * eval.c (internal_lisp_condition_case): Include the handler
15930 representation in the error message.
15931 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15932 when breaking from the loop.
15933
15934 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15935
15936 * callint.c (Fcall_interactively): When displaying error message
15937 about invalid control letter, pass the character's codepoint, not
15938 a pointer to its multibyte form. Improve display of the character
15939 in octal and display also its hex code.
15940
15941 * character.c (char_string): Use %x to display the (unsigned)
15942 codepoint of an invalid character, to avoid displaying a bogus
15943 negative value.
15944
15945 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15946 `error', not SYMBOL_NAME itself.
15947
15948 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15949 character arguments to `error'.
15950
15951 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15952 to `error' in error message about FINAL_CHAR argument. Make sure
15953 FINAL_CHAR is a character, and use %c when it is passed as
15954 argument to `error'.
15955
4ffd0d6b 159562011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
15957
15958 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15959
15960 * w32.c: Include <time.h>.
15961 (sys_localtime): New function.
15962
4ffd0d6b 159632011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
15964
15965 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15966
4ffd0d6b 15967 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 15968
4ffd0d6b 159692011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 15970
4ffd0d6b
GM
15971 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15972 zombies (Bug#8467).
aac0c6e3 15973
04c56954
EZ
159742011-04-19 Eli Zaretskii <eliz@gnu.org>
15975
15976 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15977 gl_state.e_property when gl_state.object is Qt.
15978
15979 * insdel.c (make_gap_larger): Remove limitation of buffer size
15980 to <= INT_MAX.
15981
16a43933
CY
159822011-04-18 Chong Yidong <cyd@stupidchicken.com>
15983
15984 * xdisp.c (lookup_glyphless_char_display)
15985 (produce_glyphless_glyph): Handle cons cell entry in
15986 glyphless-char-display.
15987 (Vglyphless_char_display): Document it.
15988
15989 * term.c (produce_glyphless_glyph): Handle cons cell entry in
15990 glyphless-char-display.
15991
4581706e
CY
159922011-04-17 Chong Yidong <cyd@stupidchicken.com>
15993
15994 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15995
15996 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15997
15998 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15999 definition for no-X builds.
16000
4887c6e2 160012011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 16002
fd35b6f9
PE
16003 Static checks with GCC 4.6.0 and non-default toolkits.
16004
5c1ccb01
PE
16005 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16006
006c5daa
PE
16007 * process.c (keyboard_bit_set): Define only if SIGIO.
16008 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16009 (send_process): Repair possible setjmp clobbering.
16010
efc736d3
PE
16011 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16012
4e2fe2e6
PE
16013 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16014
f97334a2
PE
16015 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16016
4e75f29d
PE
16017 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16018 Define only if needed.
16019
90efadd1
PE
16020 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16021 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 16022 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 16023
3c647824
PE
16024 * dispextern.h (struct redisplay_interface): Rename param
16025 to avoid shadowing.
e264f262 16026 * termhooks.h (struct terminal): Likewise.
761383f4 16027 * xterm.c (xembed_send_message): Likewise.
3c647824 16028
b58c5c4a
PE
16029 * insdel.c (make_gap_smaller): Define only if
16030 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16031
cad59032
PE
16032 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16033 it.
16034
c339dc2e
PE
16035 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16036 so that we aren't warned about unused symbols.
16037
91a3e27b
PE
16038 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16039
399c71d3 16040 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 16041
8ffc96f5
PE
16042 * xfns.c (x_real_positions): Mark locals as initialized.
16043
eef9bc79
PE
16044 * xmenu.c (xmenu_show): Don't use uninitialized vars.
16045
098db9dd
PE
16046 * xterm.c: Fix problems found by static analysis with other toolkits.
16047 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
16048 (x_dispatch_event): Declare static if USE_GTK, and
16049 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 16050 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 16051 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
16052 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16053 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 16054
eb18f6cc
PE
16055 * xmenu.c (menu_help_callback): Pointer type fixes.
16056 Use const pointers when pointing at readonly data. Avoid pointer
16057 signedness clashes.
16058 (FALSE): Remove unused macro.
16059 (update_frame_menubar): Remove unused decl.
16060
1fe72bf8
PE
16061 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
16062
60d9e1db
PE
16063 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
16064 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
16065 (single_menu_item): Rename local to avoid shadowing.
16066
39261c26
PE
16067 * keyboard.c (make_lispy_event): Remove unused local var.
16068
018c5e19
PE
16069 * frame.c, frame.h (x_get_resource_string): Bring this back, but
16070 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
16071
63d2b86e
PE
16072 * bitmaps: Change bitmaps from unsigned char back to the X11
16073 compatible char. Avoid the old compiler warnings about
16074 out-of-range initializers by using, for example, '\xab' rather
16075 than 0xab.
16076
aefd87e1
PE
16077 * xgselect.c (xgselect_initialize): Check vs interface
16078 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
16079
bf501fb9
PE
16080 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
16081
e9829fdf
PE
16082 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
16083 to read-only memory.
16084
1086c095
PE
16085 * fns.c (vector): Remove; this old hack is no longer needed.
16086
2baccd04 16087 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 16088 Remove unused var.
dde42981 16089 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 16090
72391843 16091 * xrdb.c (x_load_resources): Omit unused local.
3565b346 16092
436c16df 16093 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 16094 (x_window): Rename locals to avoid shadowing.
dc5ddd85 16095 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 16096
92bb796d 16097 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 16098 (x_term_init): Remove local to avoid shadowing.
92bb796d 16099
764430a3 16100 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
16101
16102 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
16103 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
16104
d1dfb56c
EZ
161052011-04-16 Eli Zaretskii <eliz@gnu.org>
16106
c4354cb4
EZ
16107 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
16108
d1dfb56c
EZ
16109 Fix regex.c, syntax.c and friends for buffers > 2GB.
16110 * syntax.h (struct gl_state_s): Declare character position members
16111 EMACS_INT.
16112
16113 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
16114
04f2d78b
CB
16115 * textprop.c (verify_interval_modification, interval_of):
16116 Declare arguments EMACS_INT.
d1dfb56c
EZ
16117
16118 * intervals.c (adjust_intervals_for_insertion): Declare arguments
16119 EMACS_INT.
16120
16121 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
16122
16123 * indent.c (Fvertical_motion): Local variable it_start is now
16124 EMACS_INT.
16125
16126 * regex.c (re_match, re_match_2, re_match_2_internal)
16127 (bcmp_translate, regcomp, regexec, print_double_string)
16128 (group_in_compile_stack, re_search, re_search_2, regex_compile)
16129 (re_compile_pattern, re_exec): Declare arguments and local
16130 variables `size_t' and `ssize_t' and return values `regoff_t', as
16131 appropriate.
16132 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16133 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16134 <compile_stack_type>: `size' and `avail' are now `size_t'.
16135
16136 * regex.h <regoff_t>: Use ssize_t, not int.
16137 (re_search, re_search_2, re_match, re_match_2): Arguments that
16138 specify buffer/string position and length are now ssize_t and
16139 size_t. Return type is regoff_t.
16140
613052cd
BK
161412011-04-16 Ben Key <bkey76@gmail.com>
16142
16143 * nsfont.m: Fixed bugs in ns_get_family and
16144 ns_descriptor_to_entity that were caused by using free to
16145 deallocate memory blocks that were allocated by xmalloc (via
16146 xstrdup). This caused Emacs to crash when compiled with
16147 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16148 --enable-checking=xmallocoverrun). xfree is now used to
16149 deallocate these memory blocks.
16150
4170f62f 161512011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 16152
71b41406
PE
16153 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16154
9587a89d
PE
16155 emacs_write: Accept and return EMACS_INT for sizes.
16156 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16157 et seq.
16158 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16159 Accept and return EMACS_INT.
16160 (emacs_gnutls_write): Return the number of bytes written on
16161 partial writes.
16162 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
16163 (emacs_read, emacs_write): Remove check for negative size, as the
16164 Emacs source code has been audited now.
9587a89d
PE
16165 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16166 (emacs_read, emacs_write): Use it.
273a5f82
PE
16167 * process.c (send_process): Adjust to the new signatures of
16168 emacs_write and emacs_gnutls_write. Do not attempt to store
16169 a byte offset into an 'int'; it might overflow.
9587a89d 16170 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 16171
3e047f51
PE
16172 * sound.c: Don't assume sizes fit in 'int'.
16173 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 16174 Return EMACS_INT, not int.
3e047f51 16175 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
16176 Accept EMACS_INT, not int.
16177 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
16178 record read return values.
16179
cc39a9db
BK
161802011-04-15 Ben Key <bkey76@gmail.com>
16181
c9d0ec6d
JB
16182 * keyboard.c (Qundefined): Don't declare static since it is used
16183 in nsfns.m.
16184 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16185 static since they are used in nsfont.m.
cc39a9db 16186
6c60eb9f
SM
161872011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
16188
16189 * process.c (Qprocessp): Don't declare static.
16190 * lisp.h (Qprocessp): Declare again.
16191
7990b61a
JB
161922011-04-15 Juanma Barranquero <lekktu@gmail.com>
16193
16194 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16195
5d4cb038
PE
161962011-04-14 Paul Eggert <eggert@cs.ucla.edu>
16197
8bd7b830 16198 Improve C-level modularity by making more things 'static'.
cd64ea1d 16199
e3b27b31
PE
16200 Don't publish debugger-only interfaces to other modules.
16201 * lisp.h (safe_debug_print, debug_output_compilation_hack):
16202 (verify_bytepos, count_markers): Move decls to the only modules
16203 that need them.
16204 * region-cache.h (pp_cache): Likewise.
16205 * window.h (check_all_windows): Likewise.
16206 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16207
5d4cb038
PE
16208 * sysdep.c (croak): Now static, if
16209 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16210 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
16211
16212 * alloc.c (refill_memory_reserve): Now static if
16213 !defined REL_ALLOC || defined SYSTEM_MALLOC.
16214 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 16215
e87b6180
PE
16216 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
16217 Define only if USE_LUCID.
16218
ac64929e
PE
16219 * xrdb.c (x_customization_string, x_rm_string): Now static.
16220
6f37259d
PE
16221 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
16222 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
16223
1683e3ab
PE
16224 * xdisp.c (draw_row_with_mouse_face): Now static.
16225 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
16226
de9c2632
PE
16227 * window.h (check_all_windows): Mark externally visible.
16228
2b96acb7
PE
16229 * window.c (window_deletion_count): Now static.
16230
16231 * undo.c: Make symbols static if they're not exported.
16232 (last_undo_buffer, last_boundary_position, pending_boundary):
16233 Now static.
16234
50436f33
PE
16235 * textprop.c (interval_insert_behind_hooks): Now static.
16236 (interval_insert_in_front_hooks): Likewise.
16237
64520e5c
PE
16238 * term.c: Make symbols static if they're not exported.
16239 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
16240 (max_frame_lines, tty_set_terminal_modes):
16241 (tty_reset_terminal_modes, tty_turn_off_highlight):
16242 (get_tty_terminal): Now static.
16243 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
16244 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 16245 HAVE_WINDOW_SYSTEM.
64520e5c
PE
16246 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16247 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16248
1fa53021
PE
16249 * sysdep.c: Make symbols static if they're not exported.
16250 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16251 Now static.
16252 (sigprocmask_set, full_mask): Remove; unused.
16253 (wait_debugging): Mark as visible.
16254 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16255 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16256
d4b43b22
PE
16257 * syntax.c (syntax_temp): Define only if !__GNUC__.
16258
b7c513d0
PE
16259 * sound.c (current_sound_device, current_sound): Now static.
16260
989b29ad
PE
16261 * search.c (searchbufs, searchbuf_head): Now static.
16262
13a55a78
PE
16263 * scroll.c (scroll_cost): Remove; unused.
16264 * dispextern.h (scroll_cost): Remove decl.
16265
de68a1fc
PE
16266 * region-cache.h (pp_cache): Mark as externally visible.
16267
40ccffa6
PE
16268 * process.c: Make symbols static if they're not exported.
16269 (process_tick, update_tick, create_process, chan_process):
16270 (Vprocess_alist, proc_buffered_char, datagram_access):
16271 (fd_callback_data, send_process_frame, process_sent_to): Now static.
16272 (deactivate_process): Mark defn as static, as well as decl.
16273 * lisp.h (create_process): Remove decl.
16274 * process.h (chan_process, Vprocess_alist): Remove decls.
16275
ad64fc97
PE
16276 * print.c: Make symbols static if they're not exported.
16277 (print_depth, new_backquote_output, being_printed, print_buffer):
16278 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16279 (print_interval, print_number_index, initial_stderr_stream):
16280 Now static.
16281 * lisp.h (Fprinc): Remove decl.
16282 (debug_output_compilation_hack): Mark as externally visible.
16283
adddb265
PE
16284 * sysdep.c (croak): Move decl from here to syssignal.h.
16285 * syssignal.h (croak): Put it here, so the API can be checked when
16286 'croak' is called from dissociate_if_controlling_tty.
16287
1717ede2
PE
16288 * minibuf.c: Make symbols static if they're not exported.
16289 (minibuf_save_list, choose_minibuf_frame): Now static.
16290 * lisp.h (choose_minibuf_frame): Remove decl.
16291
fa5fb2bc
PE
16292 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16293
1e3890d1
PE
16294 * lread.c: Make symbols static if they're not exported.
16295 (read_objects, initial_obarray, oblookup_last_bucket_number):
16296 Now static.
16297 (make_symbol): Remove; unused.
16298 * lisp.h (initial_obarray, make_symbol): Remove decls.
16299
8a1414fa
PE
16300 * keyboard.c: Make symbols static if they're not exported.
16301 (single_kboard, recent_keys_index, total_keys, recent_keys):
16302 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16303 (this_single_command_key_start, echoing, last_auto_save):
16304 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16305 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16306 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16307 (Vlispy_mouse_stem, double_click_count):
16308 Now static.
16309 (force_auto_save_soon): Define only if SIGDANGER.
16310 (ignore_mouse_drag_p): Now static if
16311 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16312 (print_help): Remove; unused.
16313 (stop_character, last_timer_event): Mark as externally visible.
16314 * keyboard.h (ignore_mouse_drag_p): Declare only if
16315 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16316 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16317 * lisp.h (echoing): Remove decl.
16318 (force_auto_save_soon): Declare only if SIGDANGER.
16319 * xdisp.c (redisplay_window): Simplify code, to make it more
16320 obvious that ignore_mouse_drag_p is not accessed if !defined
16321 USE_GTK && !defined HAVE_NS.
16322
93ea6e8f
PE
16323 * intervals.c: Make symbols static if they're not exported.
16324 (merge_properties_sticky, merge_interval_right, delete_interval):
16325 Now static.
16326 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16327
77382fcc
PE
16328 * insdel.c: Make symbols static if they're not exported.
16329 However, leave prepare_to_modify_buffer alone. It's never
16330 called from outside this function, but that appears to be a bug.
16331 (combine_after_change_list, combine_after_change_buffer):
4889fc82 16332 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
16333 (adjust_after_replace_noundo): Remove; unused.
16334 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 16335 (signal_before_change): Remove decls.
77382fcc 16336
9306c32e
PE
16337 * indent.c (val_compute_motion, val_vmotion): Now static.
16338
cd44d2eb
PE
16339 * image.c: Make symbols static if they're not exported.
16340 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16341 if USE_GTK.
16342 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16343 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16344
ad9a7a06
PE
16345 * fringe.c (standard_bitmaps): Now static.
16346 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16347
81626931
PE
16348 * frame.c: Make symbols static if they're not exported.
16349 (x_report_frame_params, make_terminal_frame): Now static.
16350 (get_frame_param): Now static, unless HAVE_NS.
16351 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16352 (x_get_resource_string): Remove; not used.
16353 * frame.h (make_terminal_frame, x_report_frame_params):
16354 (x_get_resource_string); Remove decls.
16355 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16356 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16357
239f9db9
PE
16358 * font.c, fontset.c: Make symbols static if they're not exported.
16359 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16360 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16361 * font.c (font_close_object): Now static.
16362 * font.h (font_close_object): Remove.
16363 * fontset.c (FONTSET_OBJLIST): Remove.
16364 (free_realized_fontset) #if-0 the body, which does nothing.
16365 (face_suitable_for_char_p): #if-0, as it's never called.
16366 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
16367 * xfaces.c (face_at_string_position):
16368 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
16369 since 0 is always ASCII.
16370
dfcf3579
PE
16371 * fns.c (weak_hash_tables): Now static.
16372
5045092b
PE
16373 * fileio.c: Make symbols static if they're not exported.
16374 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16375 (Vwrite_region_annotation_buffers): Now static.
16376
57a96f5c
PE
16377 * eval.c: Make symbols static if they're not exported.
16378 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16379 * lisp.h (backtrace_list): Remove decl.
16380
35f08c38
PE
16381 * emacs.c: Make symbols static if they're not exported.
16382 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16383 (fatal_error_code, fatal_error_signal_hook, standard_args):
16384 Now static.
16385 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16386 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16387 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16388 * lisp.h (fatal_error_signal_hook): Remove decl.
16389 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16390
f44bd759
PE
16391 * editfns.c: Move a (normally-unused) function to its only use.
16392 * editfns.c, lisp.h (get_operating_system_release): Remove.
16393 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16394 worth the hassle of breaking this out.
16395
b532497d
PE
16396 * xterm.c: Make symbols static if they're not exported.
16397 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16398 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16399 (x_destroy_window, x_delete_display):
16400 Now static.
16401 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16402 (x_mouse_leave): Remove; unused.
16403 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16404 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16405 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16406 Remove decls.
16407 (x_mouse_leave): Declare only if WINDOWSNT.
16408 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16409 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16410 USE_X_TOOLKIT.
16411
1675728f
PE
16412 * ftxfont.c: Make symbols static if they're not exported.
16413 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16414 HAVE_FREETYPE.
16415 * font.h (ftxfont_driver): Likewise.
16416
e4cebfca
PE
16417 * xfns.c: Make symbols static if they're not exported.
16418 (x_last_font_name, x_display_info_for_name):
16419 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16420 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16421 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16422 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16423 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16424 (last_show_tip_args): Now static.
16425 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16426 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16427 (x_screen_planes): Remove; unused.
16428 * dispextern.h (x_screen_planes): Remove decl.
16429
5bf46f05
PE
16430 * dispnew.c: Make symbols static if they're not exported.
16431 * dispextern.h (redraw_garbaged_frames, scrolling):
16432 (increment_row_positions): Remove.
16433 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16434 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16435 Now static.
16436 (redraw_garbaged_frames): Remove; unused.
16437
435f4c28
PE
16438 * xfaces.c: Make symbols static if they're not exported.
16439 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16440 Remove decls.
16441 * xterm.h (defined_color): Remove decls.
16442 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16443 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16444 (menu_face_changed_default, defined_color, free_realized_face):
16445 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16446 (ascii_face_of_lisp_face): Remove; unused.
16447
8524aef3
PE
16448 * xdisp.c: Make symbols static if they're not exported.
16449 * dispextern.h (scratch_glyph_row, window_box_edges):
16450 (glyph_to_pixel_coords, set_cursor_from_row):
16451 (get_next_display_element, set_iterator_to_next):
16452 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16453 (show_mouse_face): Remove decls
16454 * frame.h (message_buf_print): Likewise.
16455 * lisp.h (pop_message, set_message, check_point_in_composition):
16456 Likewise.
16457 * xterm.h (set_vertical_scroll_bar): Likewise.
16458 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16459 (message_buf_print, scratch_glyph_row, displayed_buffer):
16460 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16461 (get_next_display_element, show_mouse_face, window_box_edges):
16462 (frame_to_window_pixel_xy, check_point_in_composition):
16463 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16464 (glyph_to_pixel_coords): Remove; unused.
16465
16390cd2
PE
16466 * dired.c (file_name_completion): Now static.
16467
16468 * dbusbind.c (xd_in_read_queued_messages): Now static.
16469
a25f4dfa
PE
16470 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16471 * data.c (circular_list_error): Remove.
16472
14a9c8df
PE
16473 * commands.h (last_point_position, last_point_position_buffer):
16474 (last_point_position_window): Remove decls.
16475 * keyboard.c: Make these variables static.
16476
04f2d78b
CB
16477 * coding.h (coding, code_convert_region, encode_coding_gap):
16478 Remove decls.
74ab6df5
PE
16479 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16480 (iso_code_class, detect_coding, code_convert_region): Now static.
16481 (encode_coding_gap): Remove; unused.
16482
38dfbee1
PE
16483 * chartab.c (chartab_chars, chartab_bits): Now static.
16484
a2cb4e63
PE
16485 * charset.h (charset_iso_8859_1): Remove decl.
16486 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16487 Now static.
16488
127198fd
PE
16489 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16490 * ccl.c (Vccl_program_table): Now static.
16491 (check_ccl_update): Remove; unused.
16492
d85b608f
PE
16493 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16494 * category.h: ... from here.
16495 * category.c (check_category_table, set_category_set): Now static.
16496
31cd66f3
PE
16497 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16498 * lisp.h: Remove these decls.
16499
c358e587
PE
16500 * buffer.c (buffer_count): Remove unused var.
16501
e78aecca
PE
16502 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16503 so that it's not optimized away.
16504 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16505 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16506 exported only to the debugger.
16507
e192d7d3 16508 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 16509 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 16510
92470028
PE
16511 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16512 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16513 was inaccessible from Lisp.
16514 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16515 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16516
244ed907
PE
16517 alloc.c: Import and export fewer symbols, and remove unused items.
16518 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16519 is defined.
16520 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16521 it's not optimized away by whole-program optimization.
16522 (message_enable_multibyte, free_misc): Remove.
16523 (catchlist, handlerlist, mark_backtrace):
16524 Declare only if BYTE_MARK_STACK.
16525 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16526 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16527 (message_enable_multibyte): Remove decl.
16528 (free_misc, interval_free_list, float_block, float_block_index):
16529 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16530 (cons_free_list, last_marked_index):
16531 Now static.
16532 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16533 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16534 (mark_backtrace): Define only if BYTE_MARK_STACK.
16535 * xdisp.c (message_enable_multibyte): Now static.
16536
61c2b50e 16537 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
16538 This makes it easier for human readers (and static analyzers)
16539 to see whether these variables are used from other modules.
16540 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16541 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16542 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16543 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16544 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16545 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16546 * xmenu.c, xselect.c:
16547 Declare Q* vars static if they are not used in other modules.
16548 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16549 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16550 Remove decls of unexported vars.
16551 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16552
95c82688
PE
16553 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16554
16a97296
PE
16555 Make Emacs functions such as Fatom 'static' by default.
16556 This makes it easier for human readers (and static analyzers)
16557 to see whether these functions can be called from other modules.
16558 DEFUN now defines a static function. To make the function external
16559 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
16560 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16561 (Finit_image_library):
16a97296
PE
16562 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16563 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16564 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16565 Remove decls, since these functions are now static.
16566 (Funintern, Fget_internal_run_time): New decls, since these functions
16567 were already external.
95c82688 16568
16a97296
PE
16569 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16570 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16571 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16572 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16573 * keyboard.c, keymap.c, lread.c:
16574 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16575 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16576 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16577 Mark functions with DEFUE instead of DEFUN,
16578 if they are used in other modules.
16579 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16580 decls for now-static functions.
16581 * buffer.h (Fdelete_overlay): Remove decl.
16582 * callproc.c (Fgetenv_internal): Mark as internal.
16583 * composite.c (Fremove_list_of_text_properties): Remove decl.
16584 (Fcomposition_get_gstring): New forward static decl.
16585 * composite.h (Fcomposite_get_gstring): Remove decl.
16586 * dired.c (Ffile_attributes): New forward static decl.
16587 * doc.c (Fdocumntation_property): New forward static decl.
16588 * eval.c (Ffetch_bytecode): New forward static decl.
16589 (Funintern): Remove extern decl; now in .h file where it belongs.
16590 * fileio.c (Fmake_symbolic_link): New forward static decl.
16591 * image.c (Finit_image_library): New forward static decl.
16592 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16593 * intervals.h (Fprevious_property_change):
16594 (Fremove_list_of_text_properties): Remove decls.
16595 * keyboard.c (Fthis_command_keys): Remove decl.
16596 (Fcommand_execute): New forward static decl.
16597 * keymap.c (Flookup_key): New forward static decl.
16598 (Fcopy_keymap): Now static.
16599 * keymap.h (Flookup_key): Remove decl.
16600 * process.c (Fget_process): New forward static decl.
16601 (Fprocess_datagram_address): Mark as internal.
16602 * syntax.c (Fsyntax_table_p): New forward static decl.
16603 (skip_chars): Remove duplicate decl.
16604 * textprop.c (Fprevious_property_change): New forward static decl.
16605 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16606 Now internal.
16607 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16608 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16609
785bbd42
PE
16610 * editfns.c (Fformat): Remove unreachable code.
16611
8b913b57
AS
166122011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16613
16614 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16615 change. (Bug#8496)
16616
a6744a35
EZ
166172011-04-13 Eli Zaretskii <eliz@gnu.org>
16618
16619 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16620 when at ZV. (Bug#8487)
16621
e7974947
AS
166222011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16623
baad03f0
AS
16624 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16625 (Bug#8437)
16626 * keyboard.c (parse_tool_bar_item): Likewise.
16627 * sound.c (sound_cleanup, alsa_close): Likewise.
16628 * termcap.c (tgetent): Likewise.
16629 * xfns.c (x_default_font_parameter): Likewise.
16630 * xsettings.c (read_and_apply_settings): Likewise.
16631
e7974947
AS
16632 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16633 (overrun_check_free): Protoize.
16634
28272684
PE
166352011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16636
16637 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16638 since callers should never pass a negative size.
16639 Change the signature to match that of plain 'read' and 'write'; see
16640 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16641 * lisp.h: Update prototypes of emacs_write and emacs_read.
16642
11997c76
EZ
166432011-04-11 Eli Zaretskii <eliz@gnu.org>
16644
16645 * xdisp.c (redisplay_window): Don't try to determine the character
16646 position of the scroll margin if the window start point w->startp
e896f03c 16647 is outside the buffer's accessible region. (Bug#8468)
11997c76 16648
8a2cbd72
EZ
166492011-04-10 Eli Zaretskii <eliz@gnu.org>
16650
16651 Fix write-region and its subroutines for buffers > 2GB.
16652 * fileio.c (a_write, e_write): Modify declaration of arguments and
16653 local variables to support buffers larger than 2GB.
16654 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16655
16656 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16657 argument, local variables, and return value.
16658
16659 * lisp.h: Update prototypes of emacs_write and emacs_read.
16660
16661 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16662
4073e537 166632011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 16664
1ebfdcb6
PE
16665 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16666
b2ded58d
PE
16667 Fix more problems found by GCC 4.6.0's static checks.
16668
7d66342c
PE
16669 * xdisp.c (vmessage): Use a better test for character truncation.
16670
bbf47d44
PE
16671 * charset.c (load_charset_map): <, not <=, for optimization,
16672 and to avoid potential problems with integer overflow.
9248994d 16673 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 16674 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 16675 * editfns.c (Fformat): Likewise.
1e69125e 16676 * syntax.c (skip_chars): Likewise.
3befa583 16677
e3019616
PE
16678 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16679 This also lets GCC 4.6.0 generate slightly better loop code.
16680
becfa255
PE
16681 * callint.c (Fcall_interactively): <, not <=, for optimization.
16682 (Fcall_interactively): Count the number of arguments produced,
16683 not the number of arguments given. This is simpler and lets GCC
16684 4.6.0 generate slightly better code.
16685
dae0cd48
PE
16686 * ftfont.c: Distingish more carefully between FcChar8 and char.
16687 The previous code passed unsigned char * to a functions like
16688 strlen and xstrcasecmp that expect char *, which does not
16689 conform to the C standard.
16690 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16691 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16692 char * when the C standard requires it.
16693
76032d70
PE
16694 * keyboard.c (read_char): Remove unused var.
16695
eb3f1cc8
PE
16696 * eval.c: Port to Windows vsnprintf (Bug#8435).
16697 Include <limits.h>.
16698 (SIZE_MAX): Define if the headers do not.
16699 (verror): Do not give up if vsnprintf returns a negative count.
16700 Instead, grow the buffer. This ports to Windows vsnprintf, which
16701 does not conform to C99. Problem reported by Eli Zaretskii.
16702 Also, simplify the allocation scheme, by avoiding the need for
16703 calling realloc, and removing the ALLOCATED variable.
16704
70476b54
PE
16705 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16706
12020a9e
PE
16707 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16708 But keep the doprint source code for now, as we might revamp it
16709 and use it again (Bug#8435).
ea6c7ae6
PE
16710 * lisp.h (doprnt): Remove.
16711 * Makefile.in (base_obj): Remove doprnt.o.
16712 * deps.mk (doprnt.o): Remove.
16713
5fdb398c
PE
16714 error: Print 32- and 64-bit integers portably (Bug#8435).
16715 Without this change, on typical 64-bit hosts error ("...%d...", N)
16716 was used to print both 32- and 64-bit integers N, which relied on
16717 undefined behavior.
61bdb816 16718 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
16719 * lisp.h (error, verror): Mark as printf-like functions.
16720 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16721 Report overflow in size calculations when allocating printf buffer.
16722 Do not truncate output string at its first null byte.
16723 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16724 Truncate the output at a character boundary, since vsnprintf does not
16725 do that.
16726 * charset.c (check_iso_charset_parameter): Convert internal
16727 character to string before calling 'error', since %c now has the
16728 printf meaning.
16729 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16730 overflow when computing char to be passed to 'error'. Do not
16731 pass Lisp_Object to 'error'; pass the integer instead.
16732 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16733 formatted with plain %d.
16734
b189fa66
PE
16735 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16736
bff87ef0
PE
16737 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16738
7e2cac20
PE
16739 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16740
ce4d90b5
PE
16741 * xterm.c (x_catch_errors): Remove duplicate declaration.
16742
266c9547
PE
16743 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16744
79c49ad2
PE
16745 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16746
368f4090
JM
167472011-04-10 Jim Meyering <meyering@redhat.com>
16748
16749 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16750 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16751 return ssize_t not "int", and use size_t as the buffer length.
16752 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16753 * gnutls.h: Update declarations.
16754 * process.c (read_process_output): Use ssize_t, to match.
16755 (send_process): Likewise.
16756
a32d4040
CY
167572011-04-09 Chong Yidong <cyd@stupidchicken.com>
16758
16759 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16760
8546720e 167612011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 16762
04f2d78b
CB
16763 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16764 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 16765
8546720e
GM
16766 * xterm.c (handle_one_xevent):
16767 * xmenu.c (create_and_show_popup_menu):
16768 * xselect.c (x_decline_selection_request)
16769 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 16770
0a2f5c1a 167712011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
16772
16773 Fix some uses of `int' instead of EMACS_INT.
16774 * search.c (string_match_1, fast_string_match)
16775 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16776 (scan_buffer, find_next_newline_no_quit)
16777 (find_before_next_newline, search_command, Freplace_match)
16778 (Fmatch_data): Make some `int' variables be EMACS_INT.
16779
16780 * xdisp.c (display_count_lines): 3rd argument and return value now
16781 EMACS_INT. All callers changed.
16782 (pint2hrstr): Last argument is now EMACS_INT.
16783
16784 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16785 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16786 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16787 (decode_coding_utf_16, decode_coding_emacs_mule)
16788 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16789 (decode_coding_ccl, decode_coding_charset)
16790 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16791 (decode_coding_iso_2022, decode_coding_emacs_mule)
16792 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16793 <char_offset, last_offset>: Declare EMACS_INT.
16794 (encode_coding_utf_8, encode_coding_utf_16)
16795 (encode_coding_emacs_mule, encode_invocation_designation)
16796 (encode_designation_at_bol, encode_coding_iso_2022)
16797 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16798 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16799 Declare EMACS_INT.
16800 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16801 (encode_invocation_designation): Last argument P_NCHARS is now
16802 EMACS_INT.
16803 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16804 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16805
16806 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16807 All users changed.
16808
16809 * ccl.c (Fccl_execute_on_string): Declare some variables
16810 EMACS_INT.
16811
8546720e 168122011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
16813
16814 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16815
4e19a977
CS
168162011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16817
16818 * process.c (Fformat_network_address): Doc fix.
16819
87302331
R
168202011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16821
ee7683eb 16822 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 16823
cbb59342
CY
168242011-04-08 Chong Yidong <cyd@stupidchicken.com>
16825
16826 * keyboard.c (read_char): Call Lisp function help-form-show,
16827 instead of using internal_with_output_to_temp_buffer.
16828 (Qhelp_form_show): New var.
e0d38eeb 16829 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
16830
16831 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16832
16833 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16834
e67a13ab
CY
168352011-04-06 Chong Yidong <cyd@stupidchicken.com>
16836
04f2d78b
CB
16837 * process.c (Flist_processes): Remove to Lisp.
16838 (list_processes_1): Delete.
e67a13ab 16839
973f782d
EZ
168402011-04-06 Eli Zaretskii <eliz@gnu.org>
16841
7c106b1e
EZ
16842 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16843
973f782d
EZ
16844 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16845
41cf7d1a 168462011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 16847
ca23cc88
PE
16848 Fix more problems found by GCC 4.6.0's static checks.
16849
f390e2d5
PE
16850 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16851
42eea0d0
PE
16852 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16853
b69769da 16854 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 16855
f9541e84
PE
16856 * xdisp.c (vmessage): Mark as a printf-like function.
16857
13841b55
PE
16858 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16859
c136c10f
PE
16860 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16861
5e2d4a30
PE
16862 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16863 printf-like functions.
16864 (tiff_load): Add casts to remove these marks before passing them
16865 to system-supplied API.
16866
583f48b9
PE
16867 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16868
b25d760e
PE
16869 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16870 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
16871 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16872 directly, rather than having caller test rule sign. This avoids
16873 some unnecessary tests.
16874 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16875 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16876 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 16877
bc7b6697 16878 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 16879 (xfont_open): Avoid unnecessary tests.
bc7b6697 16880
27ccc379
PE
16881 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16882
dcd5c89a
PE
16883 * composite.h, composite.c (composition_gstring_put_cache):
16884 Use EMACS_INT, not int, for length.
16885
b13a45c6
PE
16886 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16887 breaking out part of COMPOSITION_DECODE_RULE.
16888 (COMPOSITION_DECODE_RULE): Use it.
16889 * composite.c (get_composition_id): Remove unused local vars,
16890 by using the new macro.
16891
1e792e4d
PE
16892 * textprop.c (set_text_properties_1): Change while to do-while,
16893 since the condition is always true at first.
16894
dc6c6455 16895 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
16896 (interval_deletion_adjustment): Return unsigned value.
16897 All uses changed.
dc6c6455 16898
aba7731a
PE
16899 * process.c (list_processes_1, create_pty, read_process_output):
16900 (exec_sentinel): Remove vars that were set but not used.
afd4052b 16901 (create_pty): Remove unnecessary "volatile"s.
bc57d757 16902 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 16903 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 16904 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 16905
fdfc4bf3
PE
16906 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16907
fca8fe46 16908 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 16909 (update_syntax_table): Use unsigned instead of int.
fca8fe46 16910
06a0259a 16911 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 16912 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 16913 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 16914
e7b9e80f
PE
16915 * print.c (print_error_message): Avoid int overflow.
16916
56201685
PE
16917 * font.c (font_list_entities): Redo for clarity,
16918 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16919
78834453 16920 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 16921 (font_score): Avoid potential overflow in diff calculation.
78834453 16922
0bc0b309 16923 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 16924 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 16925
e610eaca
PE
16926 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16927
b895abce
PE
16928 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16929 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16930 can always succeed if overflow has undefined behavior.
16931
1f1d9321 16932 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 16933 (wordify): Omit three unnecessary tests.
1f1d9321 16934
c59478bc
PE
16935 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16936 All callers changed. This avoids the need for an unused var.
16937
79b73827
PE
16938 * casefiddle.c (casify_region): Remove var that is set but not used.
16939
a4db5dfe
PE
16940 * dired.c (file_name_completion): Remove var that is set but not used.
16941
43aae36e
PE
16942 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16943
2a47c44d 16944 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 16945 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 16946
a37c69bf
PE
16947 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16948 Check for integer overflow on size calculations.
16949
328ab8e7
PE
16950 * buffer.c (Fprevious_overlay_change): Remove var that is set
16951 but not used.
16952
e5a2a5cb
PE
16953 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16954 Remove vars that are set but not used.
8d84a6eb 16955 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 16956 (timer_check_2): Mark vars as initialized.
e5a2a5cb 16957
a60e5f68
PE
16958 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16959
f661cb61 16960 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 16961 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 16962
f0397f5a
PE
16963 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16964 that are set but not used.
16965
8664db06 16966 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 16967 if XCreateBitmapFromData fails (Bug#8410).
8664db06 16968
6abdaa4a
PE
16969 * xselect.c (x_get_local_selection, x_handle_property_notify):
16970 Remove vars that are set but not used.
16971
0ce7538d 16972 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 16973 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 16974
9ae848fc
PE
16975 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16976 Remove var that is set but not used.
0b918413
PE
16977 (scroll_bar_windows_size): Now size_t, not int.
16978 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16979 Check for overflow.
9ae848fc 16980
a5a62657
PE
16981 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16982 (map_tty_color) [!defined MSDOS]: Likewise.
16983
5c5cdd39
PE
16984 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16985
66ebf983
PE
16986 * coding.c: Remove vars that are set but not used.
16987 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16988 All callers changed.
16989 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16990 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16991 (decode_coding_charset): Remove vars that are set but not used.
16992
1be4d761
PE
16993 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16994 that is set but not used.
16995
47553fa8
PE
16996 * print.c (print_object): Remove var that is set but not used.
16997
1f7196bf 16998 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
16999 The gnulib version avoids calling malloc in the usual case,
17000 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17001 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17002 * filelock.c (current_lock_owner): Likewise.
17003 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17004 * sysdep.c: Include allocator.h, careadlinkat.h.
17005 (emacs_no_realloc_allocator): New static constant.
17006 (emacs_readlink): New function.
fdb61804
PE
17007 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17008 ../lib/careadlinkat.h.
d1fdcab7 17009
f84c17c7
SM
170102011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
17011
17012 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17013 first non-nil return value).
17014
ef3862ad
JD
170152011-04-03 Jan Djärv <jan.h.d@swipnet.se>
17016
17017 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17018 if not defined (Bug#8403).
17019
376a7006
JB
170202011-04-02 Juanma Barranquero <lekktu@gmail.com>
17021
17022 * xdisp.c (display_count_lines): Remove parameter `start',
17023 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17024 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17025 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17026 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17027 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17028 and thereabouts. All callers changed.
17029 (get_per_char_metric): Remove parameter `f', unused since
17030 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17031
6ca3801d
JM
170322011-04-02 Jim Meyering <meyering@redhat.com>
17033
17034 do not dereference NULL upon failed strdup
17035 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17036 (ns_get_family): Likewise.
17037
d8e2b5ba
JB
170382011-04-02 Juanma Barranquero <lekktu@gmail.com>
17039
17040 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17041
8c74fcbd
JD
170422011-04-02 Jan Djärv <jan.h.d@swipnet.se>
17043
17044 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17045 later (Bug#8403).
17046
7200d79c
SM
170472011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
17048
03408648 17049 Add lexical binding.
7200d79c 17050
03408648
SM
17051 * window.c (Ftemp_output_buffer_show): New fun.
17052 (Fsave_window_excursion):
17053 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17054
17055 * lread.c (lisp_file_lexically_bound_p): New function.
17056 (Fload): Bind Qlexical_binding.
17057 (readevalloop): Remove `evalfun' arg.
17058 Bind Qinternal_interpreter_environment.
17059 (Feval_buffer): Bind Qlexical_binding.
17060 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
17061 Mark as dynamic.
17062 (syms_of_lread): Declare `lexical-binding'.
17063
17064 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
17065
17066 * keyboard.c (eval_dyn): New fun.
17067 (menu_item_eval_property): Use it.
ca105506
SM
17068
17069 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 17070
03408648
SM
17071 * fns.c (concat, mapcar1): Accept byte-code-functions.
17072
17073 * eval.c (Fsetq): Handle lexical vars.
17074 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
17075 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
17076 (FletX, Flet): Obey lexical binding.
17077 (Fcommandp): Handle closures.
17078 (Feval): New `lexical' arg.
17079 (eval_sub): New function extracted from Feval. Use it almost
17080 everywhere where Feval was used. Look up vars in lexical env.
17081 Handle closures.
17082 (Ffunctionp): Move from subr.el.
17083 (Ffuncall): Handle closures.
17084 (apply_lambda): Remove `eval_flags'.
17085 (funcall_lambda): Handle closures and new byte-code-functions.
17086 (Fspecial_variable_p): New function.
17087 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
17088 but without exporting it to Lisp.
23aba0ea 17089
23aba0ea 17090 * doc.c (Fdocumentation, store_function_docstring):
03408648 17091 * data.c (Finteractive_form): Handle closures.
23aba0ea 17092
03408648
SM
17093 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
17094 interactive spec.
ba83908c 17095
04f2d78b
CB
17096 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
17097 New byte-codes.
03408648
SM
17098 (exec_byte_code): New function extracted from Fbyte_code to handle new
17099 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 17100
03408648 17101 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 17102
03408648 17103 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 17104
e2abce01
JB
171052011-03-31 Juanma Barranquero <lekktu@gmail.com>
17106
17107 * xdisp.c (redisplay_internal): Fix prototype.
17108
63696a73 171092011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 17110
63696a73 17111 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
17112 (try_scrolling): Use it when setting scroll_limit.
17113 Limit scrolling to 100 screen lines.
63696a73
EZ
17114 (redisplay_window): Even when falling back on "recentering",
17115 position point in the window according to scroll-conservatively,
17116 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
17117
17118 (try_scrolling): When point is above the window, allow searching
17119 as far as scroll_max, or one screenful, to compute vertical
17120 distance from PT to the scroll margin position. This prevents
17121 try_scrolling from unnecessarily failing when
17122 scroll-conservatively is set to a value slightly larger than the
17123 window height. Clean up the case of PT below the margin at bottom
17124 of window: scroll_max can no longer be INT_MAX. When aggressive
17125 scrolling is in use, don't let point enter the opposite scroll
17126 margin as result of the scroll.
17127 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
17128 threshold of 100 lines for never-recentering scrolling.
17129
e4cc2dfc
JB
171302011-03-31 Juanma Barranquero <lekktu@gmail.com>
17131
17132 * dispextern.h (move_it_by_lines):
17133 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17134 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
17135 (message_log_check_duplicate): Remove parameters `prev_bol' and
17136 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17137 (redisplay_internal): Remove parameter `preserve_echo_area',
17138 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
17139
17140 * indent.c (Fvertical_motion):
17141 * window.c (window_scroll_pixel_based, Frecenter):
17142 Don't pass `need_y_p' to `move_it_by_lines'.
17143
1c470562
SM
171442011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
17145
44f230aa
SM
17146 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17147 steal a few bits to be more compact.
17148 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17149 Remove unneeded casts.
17150
1c470562
SM
17151 * bytecode.c (Fbyte_code): CAR and CDR can GC.
17152
888adce9
ZK
171532011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
17154
17155 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17156 binding" message (bug#7967).
17157
f838ed7b
PE
171582011-03-30 Paul Eggert <eggert@cs.ucla.edu>
17159
77861b95
PE
17160 Fix more problems found by GCC 4.6.0's static checks.
17161
de6dbc14
PE
17162 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17163 Remove unused local var.
17164
f838ed7b
PE
17165 * editfns.c (Fmessage_box): Remove unused local var.
17166
792c7b2b
PE
17167 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17168 (note_mode_line_or_margin_highlight, note_mouse_highlight):
17169 Omit unused local vars.
c499e557 17170 * window.c (shrink_windows): Omit unused local var.
b01a1c29 17171 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
17172 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17173 Omit unused local var.
17174
ba0165e1
PE
17175 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17176 Don't assume string length fits in int.
32ad8845 17177 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 17178 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 17179
3c59b4c9
PE
17180 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17181 instead of alloca (Bug#8344).
17182
a3eed478 17183 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 17184 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 17185
eb4d412d
PE
17186 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17187
1658b401
PE
17188 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17189 concerns.
17190
17191 * term.c (produce_glyphless_glyph): Remove unnecessary test.
17192
17193 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 17194
9a2c6e05
PE
17195 * keyboard.c (syms_of_keyboard): Use the same style as later
17196 in this function when indexing through an array. This also
17197 works around GCC bug 48267.
17198
03d0a109
PE
17199 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17200
44f730c8
PE
17201 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17202
fe75f926
PE
17203 * chartab.c (sub_char_table_ref_and_range): Redo for slight
17204 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17205
ffa8c828
PE
17206 * keyboard.c, keyboard.h (num_input_events): Now size_t.
17207 This avoids undefined behavior on integer overflow, and is a bit
17208 more convenient anyway since it is compared to a size_t variable.
17209
c5101a77
PE
17210 Variadic C functions now count arguments with size_t, not int.
17211 This avoids an unnecessary limitation on 64-bit machines, which
17212 caused (substring ...) to crash on large vectors (Bug#8344).
17213 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
17214 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 17215 All variadic functions and their callers changed accordingly.
c5101a77
PE
17216 (struct gcpro.nvars): Now size_t, not int. All uses changed.
17217 * data.c (arith_driver, float_arith_driver): Likewise.
17218 * editfns.c (general_insert_function): Likewise.
17219 * eval.c (struct backtrace.nargs, interactive_p)
17220 (internal_condition_case_n, run_hook_with_args, apply_lambda)
17221 (funcall_lambda, mark_backtrace): Likewise.
17222 * fns.c (concat): Likewise.
17223 * frame.c (x_set_frame_parameters): Likewise.
17224 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
17225 0 if not found, not -1. All callers changed.
17226
dd3f25f7
PE
17227 * alloc.c (garbage_collect): Don't assume stack size fits in int.
17228 (stack_copy_size): Now size_t, not int.
17229 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
17230
461c2ab9
JB
172312011-03-28 Juanma Barranquero <lekktu@gmail.com>
17232
17233 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
17234 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17235 All callers changed.
17236
17237 * lisp.h (multibyte_char_to_unibyte):
17238 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
17239 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17240 * character.h (CHAR_TO_BYTE8):
17241 * cmds.c (internal_self_insert):
17242 * editfns.c (general_insert_function):
17243 * keymap.c (push_key_description):
17244 * search.c (Freplace_match):
17245 * xdisp.c (message_dolog, set_message_1): All callers changed.
17246
f6d62986
SM
172472011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
17248
17249 * keyboard.c (safe_run_hook_funcall): New function.
17250 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17251 don't set the hook to nil, but remove the offending function instead.
17252 (Qcommand_hook_internal): Remove, unused.
17253 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17254 Vcommand_hook_internal.
17255
17256 * eval.c (enum run_hooks_condition): Remove.
17257 (funcall_nil, funcall_not): New functions.
17258 (run_hook_with_args): Call each function through a `funcall' argument.
17259 Remove `cond' argument, now redundant.
17260 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17261 (Frun_hook_with_args_until_failure): Adjust accordingly.
17262 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17263
1db5b1ad
JB
172642011-03-28 Juanma Barranquero <lekktu@gmail.com>
17265
17266 * dispextern.h (string_buffer_position): Remove declaration.
17267
17268 * print.c (strout): Remove parameter `multibyte', unused since
17269 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
17270
17271 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17272 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17273 All callers changed.
17274
17275 * w32.c (_wsa_errlist): Use braces for struct initializers.
17276
17277 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17278 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17279 All callers changed.
17280 (string_buffer_position): Likewise. Also, make static (it's never
17281 used outside xdisp.c).
17282 (cursor_row_p): Remove parameter `w', unused since
17283 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
17284 (decode_mode_spec): Remove parameter `precision', introduced during
17285 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17286 All callers changed.
17287
5ffb62aa
JD
172882011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17289
17290 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17291
461c2ab9 172922011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
17293
17294 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17295 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17296 (ns_update_auto_hide_menu_bar): New functions.
17297 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17298 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17299 ns_constrain_all_frames.
17300 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17301 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17302
5c380ffb
JD
173032011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17304
17305 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17306
9af30bdf
GM
173072011-03-27 Glenn Morris <rgm@gnu.org>
17308
17309 * syssignal.h: Replace RETSIGTYPE with void.
17310 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17311 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17312 Replace SIGTYPE with void everywhere.
17313 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17314 * s/template.h (SIGTYPE): Remove commented out definition.
17315
e2abce01
JB
173162011-03-26 Eli Zaretskii <eliz@gnu.org>
17317
17318 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17319 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17320
f868cd8a
JB
173212011-03-26 Juanma Barranquero <lekktu@gmail.com>
17322
59eb0929
JB
17323 * w32.c (read_unc_volume): Use parameter `henum', instead of
17324 global variable `wget_enum_handle'.
17325
17326 * keymap.c (describe_vector): Remove parameters `indices' and
17327 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17328 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17329
f868cd8a
JB
17330 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17331
17332 * keyboard.c (timer_check): Remove parameter `do_it_now',
17333 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17334 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17335 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17336
17337 * keyboard.c (read_char):
17338 * w32menu.c (w32_menu_display_help):
17339 * xmenu.c (show_help_event, menu_help_callback):
17340 Adjust calls to `show_help_echo'.
17341
17342 * gtkutil.c (xg_maybe_add_timer):
17343 * keyboard.c (readable_events):
17344 * process.c (wait_reading_process_output):
17345 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17346
17347 * insdel.c (adjust_markers_gap_motion):
17348 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17349 (gap_left, gap_right): Don't call it.
17350
2ecf6fdb
CY
173512011-03-25 Chong Yidong <cyd@stupidchicken.com>
17352
17353 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17354 incurred during fontification.
17355
6b1f9ba4
JB
173562011-03-25 Juanma Barranquero <lekktu@gmail.com>
17357
17358 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17359 (DEFVAR_PER_BUFFER): Don't pass it.
17360
17361 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17362 (scrolling_window): Don't pass it.
17363
0f4a96b5
JB
173642011-03-25 Juanma Barranquero <lekktu@gmail.com>
17365
17366 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17367
17368 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17369 and `suffix'.
17370 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17371 of variables specific to SELinux and computation of `encoded_absname'.
17372
17373 * image.c (XPutPixel): Remove unused variable `height'.
17374
17375 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17376
17377 * unexw32.c (get_section_info): Remove unused variable `section'.
17378
17379 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17380 (system_process_attributes): Remove unused variable `sess'.
17381 (sys_read): Remove unused variable `err'.
17382
17383 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17384 (w32_wnd_proc): Remove unused variable `isdead'.
17385 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17386 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17387 (x_create_tip_frame): Remove unused variable `tem'.
17388
17389 * w32inevt.c (w32_console_read_socket):
17390 Remove unused variable `no_events'.
17391
17392 * w32term.c (x_draw_composite_glyph_string_foreground):
17393 Remove unused variable `width'.
17394
1149507c
JB
173952011-03-24 Juanma Barranquero <lekktu@gmail.com>
17396
17397 * w32term.c (x_set_glyph_string_clipping):
17398 Don't pass uninitialized region to CombineRgn.
17399
9c88f339
JB
174002011-03-23 Juanma Barranquero <lekktu@gmail.com>
17401
17402 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17403 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17404 (Fx_close_connection): Remove unused variable `i'.
17405
17406 * w32font.c (w32font_draw): Return number of glyphs.
17407 (w32font_open_internal): Remove unused variable `i'.
17408 (w32font_driver): Add missing initializer.
17409
17410 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17411 (fill_in_menu): Remove unused variable `items_added'.
17412
17413 * w32term.c (last_mouse_press_frame): Remove static global variable.
17414 (w32_clip_to_row): Remove unused variable `f'.
17415 (x_delete_terminal): Remove unused variable `i'.
17416
17417 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17418 (NOTHING): Remove unused static global variable.
17419 (uniscribe_check_otf): Remove unused variable `table'.
17420 (uniscribe_font_driver): Add missing initializers.
17421
dee091a3
JD
174222011-03-23 Julien Danjou <julien@danjou.info>
17423
17424 * term.c (Fsuspend_tty, Fresume_tty):
17425 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17426 * window.c (temp_output_buffer_show):
17427 * insdel.c (signal_before_change):
17428 * frame.c (Fhandle_switch_frame):
17429 * fileio.c (Fdo_auto_save):
17430 * emacs.c (Fkill_emacs):
17431 * editfns.c (save_excursion_restore):
17432 * cmds.c (internal_self_insert):
17433 * callint.c (Fcall_interactively):
17434 * buffer.c (Fkill_all_local_variables):
17435 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17436 Use Frun_hooks.
0f4a96b5 17437 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 17438 unconditionally since it does the check itself.
dee091a3 17439
2c520ab5 174402011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 17441
c9c49752
PE
17442 Fix more problems found by GCC 4.5.2's static checks.
17443
8abc3f12
PE
17444 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17445 the first time through the loop, since we know p0 < p1 then.
17446 This also avoids a gcc -Wstrict-overflow warning.
17447
a2d26660
PE
17448 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17449 leading to a memory leak, possible in functions like
17450 load_charset_map_from_file that can allocate an unbounded number
b12ef411 17451 of objects (Bug#8318).
a2d26660 17452
916c72e9
PE
17453 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17454 that could (at least in theory) be that large.
17455
19ab8a18
PE
17456 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17457 This is less likely to overflow, and avoids undefined behavior if
17458 overflow does occur. All callers changed. Use strtoul to scan
17459 for the unsigned long integer.
b7cbbd6f
PE
17460 (pint2hrstr): Simplify and tune code slightly.
17461 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 17462
f0641eff
PE
17463 * scroll.c (do_scrolling): Work around GCC bug 48228.
17464 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17465
7f650bb9
PE
17466 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17467 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
17468 (validate_x_resource_name): Simplify count usage.
17469 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 17470
37dd57d1
PE
17471 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17472 fail (Bug#8306).
81e56e61 17473
699979fc 17474 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 17475
401bf9b4
PE
17476 * process.c (Fmake_network_process): Use socklen_t, not int,
17477 where POSIX says socklen_t is required in portable programs.
17478 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 17479 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
17480 (Fmake_network_process, server_accept_connection):
17481 (wait_reading_process_output, read_process_output):
17482 Likewise.
17483
b93aacde
PE
17484 * process.c: Rename or move locals to avoid shadowing.
17485 (list_processes_1, Fmake_network_process):
17486 (read_process_output_error_handler, exec_sentinel_error_handler):
17487 Rename or move locals.
4dc343ee 17488 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 17489 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 17490 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 17491 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 17492 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 17493
af8a867c 17494 Make tparam.h and terminfo.c consistent.
44f230aa
SM
17495 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17496 Include tparam.h instead, since it declares them.
af8a867c
PE
17497 * cm.h (PC): Remove extern decl; tparam.h now does this.
17498 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17499 * terminfo.c: Include tparam.h, to check interfaces.
17500 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17501 (tparam): Adjust signature to match interface in tparam.h;
17502 this removes some undefined behavior. Check that outstring and len
17503 are zero, which they always are with Emacs.
17504 * tparam.h (PC, BC, UP): New extern decls.
17505
0248044d 17506 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 17507 (xftfont_open): Rename locals to avoid shadowing.
0248044d 17508
8ff096c1 17509 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
17510 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17511 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 17512 (ftfont_list): Remove unused local.
49eaafba
PE
17513 (get_adstyle_property, ftfont_pattern_entity):
17514 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17515 Rename locals to avoid shadowing.
8ff096c1 17516
e2be39f6
PE
17517 * xfont.c (xfont_list_family): Mark var as initialized.
17518
c9735e30
PE
17519 * xml.c (make_dom): Now static.
17520
8f5201ae
PE
17521 * composite.c (composition_compute_stop_pos): Rename local to
17522 avoid shadowing.
b246f932
PE
17523 (composition_reseat_it): Remove unused locals.
17524 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 17525 (composition_update_it): Mark var as initialized.
11b61122
PE
17526 (find_automatic_composition): Mark vars as initialized,
17527 with a FIXME (Bug#8290).
8f5201ae 17528
760fbc2c
PE
17529 character.h: Rename locals to avoid shadowing.
17530 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17531 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17532 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17533 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17534 to avoid shadowing.
17535
ff08eb85
PE
17536 * textprop.c (property_change_between_p): Remove; unused.
17537
fc7bf025
PE
17538 * intervals.c (interval_start_pos): Now static.
17539
235d7abc
PE
17540 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17541
44f230aa
SM
17542 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17543 Rename locals to avoid shadowing.
3e7d6594 17544
50060332
PE
17545 * sound.c (wav_play, au_play, Fplay_sound_internal):
17546 Fix pointer signedness.
d01f234b 17547 (alsa_choose_format): Remove unused local var.
c83b8872
PE
17548 (wav_play): Initialize a variable to 0, to prevent undefined
17549 behavior (Bug#8278).
50060332 17550
c4fc4e30
PE
17551 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17552
918436ed
PE
17553 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17554
c939f91b
PE
17555 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17556 clobbering (Bug#8298).
b9c7f648
PE
17557 * sysdep.c (sys_subshell): Likewise.
17558 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 17559
6bd8c144
PE
17560 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17561 This should get cleaned up, so that child_setup has the
17562 same signature on all platforms.
17563
7710357c 17564 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 17565 (relocate_fd): Rename locals to avoid shadowing.
7710357c 17566
c59da222
CY
175672011-03-22 Chong Yidong <cyd@stupidchicken.com>
17568
17569 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17570 not to be necessary, and produces flickering.
17571
66b87493
GM
175722011-03-20 Glenn Morris <rgm@gnu.org>
17573
17574 * config.in: Remove file.
17575
45b6f6d5
JB
175762011-03-20 Juanma Barranquero <lekktu@gmail.com>
17577
17578 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17579 are now in src/globals.h.
17580 (syms_of_minibuf): Remove spurious & from previous change.
17581
cd394be1 175822011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
17583
17584 * minibuf.c (completing-read-function): New variable.
17585 (completing-read-default): Rename from completing-read.
17586 (completing-read): Call completing-read-function.
17587
b14e3e21
CY
175882011-03-19 Juanma Barranquero <lekktu@gmail.com>
17589
17590 * xfaces.c (Fx_load_color_file):
17591 Read color file from absolute filename (bug#8250).
17592
f2b726e6
JB
175932011-03-19 Juanma Barranquero <lekktu@gmail.com>
17594
17595 * makefile.w32-in: Update dependencies.
17596
09f6ff02
EZ
175972011-03-17 Eli Zaretskii <eliz@gnu.org>
17598
17599 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17600
29a6015a
PE
176012011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17602
a3a6c54e
PE
17603 Fix more problems found by GCC 4.5.2's static checks.
17604
b766f867
PE
17605 * process.c (make_serial_process_unwind, send_process_trap):
17606 (sigchld_handler): Now static.
17607
be02381c
PE
17608 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17609 That way, the code declares only the vars that it needs.
17610 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17611 * s/cygwin.h (PTY_ITERATION): Likewise.
17612 * s/darwin.h (PTY_ITERATION): Likewise.
17613 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17614
57048744
PE
17615 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17616 * process.c (allocate_pty): Don't declare stb unless it's needed.
17617
7914961c 17618 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
17619 (CONSTANTLIM): Remove; unused.
17620 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17621 Define only if needed.
7914961c 17622
b3967b18
PE
17623 * unexelf.c (unexec): Name an expression,
17624 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
17625 Use a different way to cause a compilation error if anyone uses
17626 n rather than nn, a way that does not involve shadowing.
73366a00 17627 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 17628
29a6015a
PE
17629 * deps.mk (unexalpha.o): Remove; unused.
17630
43cfc33e 17631 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 17632 * unexec.h: New file.
ce701a33
PE
17633 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17634 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17635 Depend on unexec.h.
17636 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17637 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17638 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 17639 Change as necessary to match prototype in unexec.h.
ce701a33 17640
01f44d5a
PE
17641 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17642 shadowing.
4f63c6bb 17643 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 17644
a6670b0b
PE
17645 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17646 Rename locals to avoid shadowing.
17647
cef2010d 17648 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 17649 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 17650
d4d7173a
PE
17651 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17652
f08b802a
PE
17653 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17654 warning when compiling print.c.
17655
3ddb0639
PE
17656 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17657 instead of using an uninitialized var.
5ad03b97 17658 (font_sort_entities): Mark var as initialized.
3ddb0639 17659
170a2692
PE
17660 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17661
e663c700
PE
17662 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17663 pointers to constants.
89bc529a 17664 (font_parse_fcname): Remove unused vars.
7b81e2d0 17665 (font_delete_unmatched): Now static.
ea838e10 17666 (font_get_spec): Remove; unused.
13a547c6
PE
17667 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17668 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17669 Rename or move locals to avoid shadowing.
e663c700 17670
2a80c887 17671 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 17672 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 17673
1384fa33 17674 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 17675 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 17676
8b2c52e9
PE
17677 * alloc.c (mark_backtrace): Move decl from here ...
17678 * lisp.h: ... to here, so that it can be checked.
17679
475545b5 17680 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 17681 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
17682 (lisp_indirect_variable): Name an expression,
17683 to avoid gcc -Wbad-function-cast warning.
1faed8ae 17684 (Fdefvar): Rename locals to avoid shadowing.
475545b5 17685
b1349114 17686 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 17687 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 17688 Use const pointer when appropriate.
b1349114 17689
a2928364
PE
17690 * lisp.h (get_system_name, get_operating_system_release):
17691 Move decls here, to check interfaces.
17692 * process.c (get_operating_system_release): Move decl to lisp.h.
17693 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
17694 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17695 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17696 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
17697 (Fformat_time_string, Fencode_time, Finsert_char):
17698 (Ftranslate_region_internal, Fformat):
17699 Rename or remove local vars to avoid shadowing.
9710023e 17700 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 17701
a415e694
PE
17702 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17703 avoid shadowing.
17704
8ef4622d
PE
17705 * lisp.h (eassert): Check that the argument compiles, even if
17706 ENABLE_CHECKING is not defined.
17707
946f9a5b
PE
17708 * data.c (Findirect_variable): Name an expression, to avoid
17709 gcc -Wbad-function-cast warning.
112396d6 17710 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 17711 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
17712 (Fmake_variable_buffer_local, Fmake_local_variable):
17713 Mark variables as initialized.
52746918 17714 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 17715
e5aab7e7 17716 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
17717 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17718 Rename locals to avoid shadowing.
dff45157
PE
17719 (mark_stack): Move local variables into the #ifdef region where
17720 they're used.
7bc26fdb
PE
17721 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17722 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17723 needed otherwise.
17724 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17725 (GC_STRING_CHARS): Remove; not used.
d40d4be1 17726 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 17727
e5aab7e7
PE
17728 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17729 avoids undefined behavior in theory.
17730
4da60324
PE
17731 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17732
88043301
PE
17733 Use functions, not macros, for up- and down-casing (Bug#8254).
17734 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17735 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17736 to use the following functions instead of these macros.
17737 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17738 EMACS_INT, since callers assume the returned value fits in int.
17739 (upcase1): Likewise, for UPCASE_TABLE.
17740 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 17741 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 17742 the race-condition problem in the old DOWNCASE.
88043301 17743
19ed5445
PE
17744 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17745 Rename locals to avoid shadowing.
17746 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
17747 (regex_compile, re_search_2, re_match_2_internal):
17748 Remove unused local vars.
952db0d7
PE
17749 (FREE_VAR): Rewrite so as not to use empty "else",
17750 which gcc can warn about.
da053e48 17751 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
17752 (RETALLOC_IF): Define only if needed.
17753 (WORDCHAR_P): Likewise. This one is never needed, but is used
17754 only in a comment talking about a compiler bug, so put inside
17755 the #if 0 of that comment.
17756 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17757 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17758 Remove; unused.
19ed5445 17759
1f3561e4 17760 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
17761 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17762 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 17763
ded6f8f7
PE
17764 * search.c (simple_search): Remove unused var.
17765
dbd37a95
PE
17766 * dired.c (compile_pattern): Move decl from here ...
17767 * lisp.h: ... to here, so that it can be checked.
17768 (struct re_registers): New forward decl.
17769
7e47afad
PE
17770 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17771
85f24f61
PE
17772 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17773 All uses changed.
17774 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17775 Rename locals to avoid shadowing.
5671df8f 17776 (Fvertical_motion): Mark locals as initialized.
85f24f61 17777
181aa2be 17778 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 17779 (casify_region): Mark local as initialized.
181aa2be 17780
930d429c
PE
17781 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17782
7082eac6
PE
17783 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17784 New macros, so that the caller can use some names other than
17785 gcpro1, gcpro2, etc.
17786 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17787 of the new macros.
17788 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17789 argument, for consistency with GCPRO2_VAR, etc: it is now the
17790 prefix of the variable, not the variable itself. All uses
17791 changed.
38b2c076
PE
17792 * dired.c (directory_files_internal, file_name_completion):
17793 Rename locals to avoid shadowing.
17794
15206ed9
PE
17795 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17796 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17797 dired.c's scmp function, had undefined behavior.
17798 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17799 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17800 * buffer.h: ... to here, because these macros use current_buffer,
17801 and the new implementation with inline functions needs to have
17802 current_buffer in scope now, rather than later when the macros
17803 are used.
17804 (downcase, upcase1): New static inline functions.
17805 (DOWNCASE, UPCASE1): Reimplement using these functions.
17806 This avoids undefined behavior in expressions like
17807 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17808 from race conditions in accessing the global variables
17809 case_temp1 and case_temp2.
17810 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17811 * lisp.h (case_temp1, case_temp2): Remove their decls.
17812 * character.h (ASCII_CHAR_P): Move from here ...
17813 * lisp.h: ... to here, so that the inline functions mentioned
17814 above can use them.
17815
4a6bea26
PE
17816 * dired.c (directory_files_internal_unwind): Now static.
17817
f14b7e14
PE
17818 * fileio.c (file_name_as_directory, directory_file_name):
17819 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17820 Now static.
2893f146
PE
17821 (file_name_as_directory): Use const pointers when appropriate.
17822 (Fexpand_file_name): Likewise. In particular, newdir might
17823 point at constant storage, so make it a const pointer.
fd4ead52 17824 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
17825 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17826 signedness issues.
f839df0c
PE
17827 (Fset_file_times, Finsert_file_contents, auto_save_error):
17828 Rename locals to avoid shadowing.
f14b7e14 17829
5716756e 17830 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
17831 (Ftry_completion, Fall_completions): Rename or remove locals
17832 to avoid shadowing.
5716756e 17833
b4c3046a
PE
17834 * marker.c (bytepos_to_charpos): Remove; unused.
17835
b45db522
PE
17836 * lisp.h (verify_bytepos, count_markers): New decls,
17837 so that gcc does not warn that these functions aren't declared.
17838
85876d07
PE
17839 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17840 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 17841 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 17842 (copy_text): Remove unused local var.
85876d07 17843
03d78a21 17844 * filelock.c (within_one_second): Now static.
b3dd38ab 17845 (lock_file_1): Rename local to avoid shadowing.
03d78a21 17846
5df8f01b
PE
17847 * buffer.c (fix_overlays_before): Mark locals as initialized.
17848 (fix_start_end_in_overlays): Likewise. This function should be
17849 simplified by using pointers-to-pointers, but that's a different
17850 matter.
b1d876f1 17851 (switch_to_buffer_1): Now static.
8f54f30a
PE
17852 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17853 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 17854
a70072c9 17855 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 17856 Fix pointer signedness issue.
edced198
PE
17857 (sys_subshell): Mark local as volatile if checking for lint,
17858 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 17859 (MAXPATHLEN): Define only if needed.
a70072c9 17860
a0977c44
PE
17861 * process.c (serial_open, serial_configure): Move decls from here ...
17862 * systty.h: ... to here, so that they can be checked.
17863
a884fdcc
PE
17864 * fns.c (get_random, seed_random): Move extern decls from here ...
17865 * lisp.h: ... to here, so that they can be checked.
17866
604efe86 17867 * sysdep.c (reset_io): Now static.
b8950c94 17868 (wait_for_termination_signal): Remove; unused.
604efe86 17869
38fc62d9
PE
17870 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17871 (copy_keymap_item, append_key, push_text_char_description):
17872 Now static.
1004a21a 17873 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 17874 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
17875 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17876 (describe_map_tree):
17877 Rename locals to avoid shadowing.
38fc62d9 17878
2f2650da
PE
17879 * keyboard.c: Declare functions static if they are not used elsewhere.
17880 (echo_char, echo_dash, cmd_error, top_level_2):
17881 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
17882 (read_char, kbd_buffer_get_event, make_lispy_position):
17883 (make_lispy_event, make_lispy_movement, apply_modifiers):
17884 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17885 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17886 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 17887 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 17888 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 17889
a053e86c 17890 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
17891 (mark_kboards): Move decl here ...
17892 * alloc.c (mark_kboards): ... from here.
a053e86c 17893
4752793e
PE
17894 * lisp.h (force_auto_save_soon): New decl.
17895
74f10ca7 17896 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
17897 (DEFINE_DUMMY_FUNCTION): New macro.
17898 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17899 Use it.
c03cd23f
PE
17900 (main): Add casts to avoid warnings
17901 if GCC considers string literals to be constants.
74f10ca7 17902
022e70d4
PE
17903 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17904
59d6fe83
PE
17905 * dbusbind.c: Pointer signedness fixes.
17906 (xd_signature, xd_append_arg, xd_initialize):
17907 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17908 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17909 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17910 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17911
78320123
PE
17912 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17913 if GCC considers string literals to be constants.
49cebcca 17914 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 17915
35ac2a97
SM
179162011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17917
fb103ca9
SM
17918 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17919 (print_preprocess, print_object): New macro to fix last change.
17920
35ac2a97
SM
17921 * print.c (print_preprocess): Don't forget font objects.
17922
62973b41
JB
179232011-03-16 Juanma Barranquero <lekktu@gmail.com>
17924
17925 * emacs.c (USAGE3): Doc fixes.
17926
0e48bb22
AS
179272011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17928
17929 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17930 structure.
17931
7684e57b
JB
179322011-03-14 Juanma Barranquero <lekktu@gmail.com>
17933
17934 * lisp.h (VWindow_system, Qfile_name_history):
17935 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17936 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17937 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17938
17939 * w32select.c: Don't #include "keyboard.h".
c96bbc66 17940 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
17941
17942 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17943 * w32console.c (detect_input_pending, read_input_pending)
17944 (encode_terminal_code):
17945 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17946 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17947 (w32_system_caret_y, Qfile_name_history):
17948 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17949 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17950 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17951 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17952 * w32proc.c (Qlocal, report_file_error):
17953 * w32term.c (Vwindow_system, updating_frame):
17954 * w32uniscribe.c (initialized, uniscribe_font_driver):
17955 Remove unneeded extern declarations.
17956
2aa46d6c
CY
179572011-03-14 Chong Yidong <cyd@stupidchicken.com>
17958
c96bbc66 17959 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 17960
cffc6f3b
CY
179612011-03-13 Chong Yidong <cyd@stupidchicken.com>
17962
17963 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17964 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17965 These macros can no longer be used for assignment.
17966
44f230aa
SM
17967 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17968 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
17969 (record_buffer_markers, fetch_buffer_markers): New functions for
17970 recording and fetching special buffer markers.
17971 (set_buffer_internal_1, set_buffer_temp): Use them.
17972
17973 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17974
17975 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17976
17977 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17978 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17979
17980 * xdisp.c (hscroll_window_tree):
17981 (reconsider_clip_changes): Use PT instead of BUF_PT.
17982
d251f04b
EZ
179832011-03-13 Eli Zaretskii <eliz@gnu.org>
17984
17985 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17986 $(EMACS_ROOT)/lib/intprops.h.
17987
f0c77cd1
PE
179882011-03-13 Paul Eggert <eggert@cs.ucla.edu>
17989
3eca4629
PE
17990 Fix more problems found by GCC 4.5.2's static checks.
17991
7c86ee98
PE
17992 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17993 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
17994 (xg_free_frame_widgets): Make it clear that a local variable is
17995 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
17996 (gdk_window_get_screen): Make it clear that this macro is needed
17997 only if USE_GTK_TOOLTIP.
1e5524e7
PE
17998 (int_gtk_range_get_value): New function, which avoids a diagnostic
17999 from gcc -Wbad-function-cast.
18000 (xg_set_toolkit_scroll_bar_thumb): Use it.
18001 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18002 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
18003 (get_utf8_string, xg_get_file_with_chooser):
18004 Rename locals to avoid shadowing.
18005 (create_dialog): Move locals to avoid shadowing.
7c86ee98 18006
41729b81
PE
18007 * xgselect.c (xg_select): Remove unused var.
18008
f0c77cd1
PE
18009 * image.c (four_corners_best): Mark locals as initialized.
18010 (gif_load): Initialize transparent_p to zero (Bug#8238).
18011 Mark another local as initialized.
ec6cf4c6 18012 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 18013
ce0ad53d 18014 * image.c (clear_image_cache): Now static.
d5d5a617 18015 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 18016 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
18017 (x_edge_detection): Remove unnecessary cast that
18018 gcc -Wbad-function-cast diagnoses.
2037898d 18019 (gif_load): Fix pointer signedness.
6ae141d6
PE
18020 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18021 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 18022
33383987 180232011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 18024
d32df629
PE
18025 Improve quality of tests for time stamp overflow.
18026 For example, without this patch (encode-time 0 0 0 1 1
18027 1152921504606846976) returns the obviously-bogus value (-948597
18028 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18029 reports time overflow. See
18030 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
18031 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18032 * editfns.c: Include limits.h and intprops.h.
18033 (TIME_T_MIN, TIME_T_MAX): New macros.
18034 (time_overflow): Move earlier, to before first use.
18035 (hi_time, lo_time): New functions, for an accurate test for
18036 out-of-range times.
18037 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18038 (Fget_internal_run_time): Don't assume time_t fits in int.
18039 (make_time): Use list2 instead of Fcons twice.
18040 (Fdecode_time): More accurate test for out-of-range times.
18041 (check_tm_member): New function.
18042 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
18043 (lisp_time_argument): Don't rely on undefined left-shift and
18044 right-shift behavior when checking for time stamp overflow.
8be6f318 18045
fe31d94c
PE
18046 * editfns.c (time_overflow): New function, refactoring common code.
18047 (Fformat_time_string, Fdecode_time, Fencode_time):
18048 (Fcurrent_time_string): Use it.
18049
8be6f318
PE
18050 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18051 * dired.c (make_time): Move to ...
18052 * editfns.c (make_time): ... here.
18053 * systime.h: Note the move.
18054
09d9db2c 180552011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 18056
126bc0dc
YM
18057 * fringe.c (update_window_fringes): Remove unused variables.
18058
c47cbdfd
YM
18059 * unexmacosx.c (copy_data_segment): Also copy __got section.
18060 (Bug#8223)
18061
7ac80be9
EZ
180622011-03-12 Eli Zaretskii <eliz@gnu.org>
18063
c96bbc66 18064 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
18065 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
18066 Constify `char *' arguments and their references according to
18067 prototypes in tparam.h.
18068
ecb0f94d 18069 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 18070
7ac80be9
EZ
18071 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
18072 Adapt all references accordingly.
18073
18074 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
18075
ef1fd07e
TT
180762011-03-11 Tom Tromey <tromey@redhat.com>
18077
18078 * buffer.c (syms_of_buffer): Remove obsolete comment.
18079
7ef4b50c
EZ
180802011-03-11 Eli Zaretskii <eliz@gnu.org>
18081
18082 * termhooks.h (encode_terminal_code): Declare prototype.
18083
18084 * msdos.c (encode_terminal_code): Don't declare prototype.
18085
18086 * term.c (encode_terminal_code): Now external again, used by
18087 w32console.c and msdos.c.
18088
44f230aa
SM
18089 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
18090 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 18091
4b1ec863 180922011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 18093
1714f52b 18094 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 18095
4b1ec863
PE
18096 * fringe.c (update_window_fringes): Mark locals as initialized
18097 (Bug#8227).
18098 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 18099
524c7aa6
PE
18100 * alloc.c (mark_fringe_data): Move decl from here ...
18101 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
18102 to check its interface.
18103 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
18104
a5c0af81 18105 * fontset.c (free_realized_fontset): Now static.
7519b8cd 18106 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 18107 (fontset_font): Mark local as initialized.
a9a06e0b 18108 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 18109
b4716021
PE
18110 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
18111
811e9bac 18112 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 18113 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
18114 (x_own_selection, Fx_disown_selection_internal): Rename locals
18115 to avoid shadowing.
18116 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 18117
7e3ab302
PE
18118 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
18119 so that the caller can use some name other than gcpro1.
18120 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
18121 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18122 (Fx_backspace_delete_keys_p):
18123 Use them to avoid shadowing, and rename vars to avoid shadowing.
18124 (x_decode_color, x_set_name, x_window): Now static.
6b437900 18125 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 18126 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
18127 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18128 Remove unused locals.
7e3ab302
PE
18129 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18130 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18131 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18132 macros.
f78faa98 18133
e2b13473
PE
18134 * xterm.h (x_mouse_leave): New decl.
18135
77f23912
PE
18136 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18137 Remove unused functions.
cdf4ba58
PE
18138 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18139 (x_calc_absolute_position): Now static.
7411c686 18140 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 18141 Don't declare local "event" unless it's used.
ed7bf3a5
PE
18142 (x_iconify_frame, x_free_frame_resources): Don't declare locals
18143 unless they are used.
38d0b34a
PE
18144 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18145 (x_fatal_error_signal): Remove; not used.
a6067996
PE
18146 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18147 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18148 (x_error_catcher, x_connection_closed, x_error_handler):
18149 (x_error_quitter, xembed_send_message, x_iconify_frame):
18150 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 18151 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 18152 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 18153
44f230aa
SM
18154 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18155 Rename or move locals to avoid shadowing.
6b463e58 18156 (tty_defined_color, merge_face_heights): Now static.
5967d051 18157 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
18158 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18159 does not deduce is never used uninitialized.
73719eba
PE
18160 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18161 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 18162
426994c3 18163 * terminal.c (store_terminal_param): Now static.
5489860b 18164
032f1620 18165 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 18166 (set_frame_menubar): Remove unused local.
d4323972 18167 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
18168 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18169 since they might point to immutable storage.
281585b0
PE
18170 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18171 since it's unused otherwise.
032f1620 18172
367c19e5 18173 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 18174 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
18175 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18176 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 18177 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
18178 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18179 does not deduce are never used uninitialized.
70739cbe 18180
07b48fa9
PE
18181 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18182
8868a238 18183 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
18184 * window.c (window_loop, size_window):
18185 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 18186
7e5cf297 18187 * window.c (display_buffer): Now static.
d6550a9f
PE
18188 (size_window): Mark variables that gcc -Wuninitialized
18189 does not deduce are never used uninitialized.
a586633d
PE
18190 * window.h (check_all_windows): New decl, to forestall
18191 gcc -Wmissing-prototypes diagnostic.
5b555da1 18192 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 18193
f6095868
PE
18194 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18195 shadowing.
18196 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
18197 Include <limits.h>.
18198 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18199 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
18200 (load_charset_map): Mark variables that gcc -Wuninitialized
18201 does not deduce are never used uninitialized.
53df7c11 18202 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 18203
f38b440c
PE
18204 * coding.c (coding_set_source, coding_set_destination):
18205 Use "else { /* comment */ }" rather than "else /* comment */;"
18206 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
18207 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18208 a block, when the outer 'i' will do.
18209 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18210 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18211 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18212 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
18213 (Fdecode_sjis_char, Fdefine_coding_system_internal):
18214 Rename locals to avoid shadowing.
18215 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
18216 * coding.c (emacs_mule_char, encode_invocation_designation):
18217 Now static, since they're not used elsewhere.
413bb2db 18218 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 18219 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
18220 (decode_coding_emacs_mule): Mark variables that gcc
18221 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
18222 (detect_coding_iso_2022): Initialize a local variable that might
18223 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 18224 this initialization is needed. (Bug#8211)
5f58e762
PE
18225 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
18226 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
18227 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
18228 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
18229 Remove unused macros.
f38b440c 18230
232b38b9 18231 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 18232 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 18233 * character.c (string_count_byte8): Likewise.
232b38b9 18234
fb90da1b
PE
18235 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
18236 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
18237
fb93dbc2
PE
18238 * chartab.c (copy_sub_char_table): Now static, since it's not used
18239 elsewhere.
5c156ace
PE
18240 (sub_char_table_ref_and_range, char_table_ref_and_range):
18241 Rename locals to avoid shadowing.
bbcd0949 18242 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 18243
7d3b3862 18244 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 18245 (BIDI_BOB): Remove unused macro.
7d3b3862 18246
6be7d3da
PE
18247 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18248 deduce are never used uninitialized.
c2ed9c8b 18249 * term.c (encode_terminal_code): Likewise.
6be7d3da 18250
75f8807f 18251 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 18252
50938595
PE
18253 * tparam.h: New file.
18254 * term.c, tparam.h: Include it.
18255 * deps.mk (term.o, tparam.o): Depend on tparam.h.
18256 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18257 Move these decls to tparam.h, and make them agree with what
18258 is actually in tparam.c. The previous trick of using incompatible
18259 decls in different modules does not conform to the C standard.
18260 All callers of tparam changed to use tparam's actual API.
18261 * tparam.c (tparam1, tparam, tgoto):
18262 Use const pointers where appropriate.
18263
fbceeba2
PE
18264 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18265 * cm.h (struct cm): Likewise.
18266 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18267 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18268 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18269 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18270 (turn_on_face, init_tty): Likewise.
18271 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 18272
7f3f1250
PE
18273 * term.c (term_mouse_position): Rename local to avoid shadowing.
18274
e6ca6543
PE
18275 * alloc.c (mark_ttys): Move decl from here ...
18276 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18277
c40f8d15
AS
182782011-03-11 Andreas Schwab <schwab@linux-m68k.org>
18279
18280 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18281
cfe0661d
JB
182822011-03-09 Juanma Barranquero <lekktu@gmail.com>
18283
18284 * search.c (compile_pattern_1): Remove argument regp, unused since
18285 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18286 (compile_pattern): Don't pass it.
18287
0afb4571
J
182882011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18289
18290 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18291 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18292 for ! HAVE_GTK3.
18293 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18294
18295 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18296
18297 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18298 gdk_window_get_screen, gdk_window_get_geometry,
18299 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18300 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18301 (xg_get_pixbuf_from_pixmap): New function.
18302 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18303 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18304 Call xg_get_pixbuf_from_pixmap instead of
18305 gdk_pixbuf_get_from_drawable.
18306 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18307 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18308 (xg_check_special_colors): Use GtkStyleContext and its functions
18309 for HAVE_GTK3.
18310 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18311 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18312 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
18313 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18314 Call gtk_widget_get_preferred_size.
0afb4571
J
18315 (xg_frame_resized): gdk_window_get_geometry only takes 5
18316 parameters.
44f230aa
SM
18317 (xg_win_to_widget, xg_event_is_for_menubar):
18318 Call gdk_x11_window_lookup_for_display.
0afb4571
J
18319 (xg_set_widget_bg): New function.
18320 (delete_cb): New function.
895009e1 18321 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 18322 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
18323 (xg_set_background_color): Call xg_set_widget_bg.
18324 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18325 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18326 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18327 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18328 if ! HAVE_GTK3.
18329 (update_frame_tool_bar): Call gtk_widget_hide.
18330 (xg_initialize): Use GDK_KEY_g.
18331
18332 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18333 if ! HAVE_GTK3
18334 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18335
18336 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18337 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18338 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18339
1c2cc4ef
JB
183402011-03-08 Juanma Barranquero <lekktu@gmail.com>
18341
18342 * w32xfns.c (select_palette): Check success of RealizePalette against
18343 GDI_ERROR, not zero.
18344
33383987 18345See ChangeLog.11 for earlier changes.
aac0c6e3
MR
18346
18347;; Local Variables:
18348;; coding: utf-8
aac0c6e3
MR
18349;; End:
18350
2f097256 18351 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
18352
18353 This file is part of GNU Emacs.
18354
18355 GNU Emacs is free software: you can redistribute it and/or modify
18356 it under the terms of the GNU General Public License as published by
18357 the Free Software Foundation, either version 3 of the License, or
18358 (at your option) any later version.
18359
18360 GNU Emacs is distributed in the hope that it will be useful,
18361 but WITHOUT ANY WARRANTY; without even the implied warranty of
18362 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18363 GNU General Public License for more details.
18364
18365 You should have received a copy of the GNU General Public License
18366 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.