Incorporate Semantic's hideif components into hideif.el (replacing advice)
[bpt/emacs.git] / src / ChangeLog
CommitLineData
b3ecad33
PE
12012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2
0a99eee1
PE
3 Prefer plain 'static' to 'static inline' (Bug#12541).
4 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
5 (bidi_set_sor_type, bidi_push_embedding_level)
6 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
7 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
8 (bidi_cache_search, bidi_cache_ensure_space)
9 (bidi_cache_iterator_state, bidi_cache_find)
10 (bidi_peek_at_next_level, bidi_set_paragraph_end)
11 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
12 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
13 Now 'static', not 'static inline'.
14
b3ecad33
PE
15 Count overruns when profiling; change units to ns.
16 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
17 Give extra weight to samples after overruns, to attempt to count
18 the time more accurately.
19 (setup_cpu_timer): Change sampling interval units from ms to ns, since
20 the underlying primitives nominally do ns.
21 (Fprofiler_cpu_start): Document the change. Mention that
22 the sampling intervals are only approximate.
23
090cf9db
SM
242012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
25
26 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
27
28 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
29 case for the special 0 coding-system.
30
31 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
32 (Fmake_overlay): Remove redundant tests.
64edc777 33 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 34
81550bf4
JB
352012-10-02 Juanma Barranquero <lekktu@gmail.com>
36
37 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
38 Update dependencies.
39
aa1ba90e
PE
402012-10-01 Paul Eggert <eggert@cs.ucla.edu>
41
42 Fix a malloc race condition involving strsignal.
43 A signal can arrive in the middle of a malloc, and Emacs's signal
44 handler can invoke strsignal, which can invoke malloc, which is
45 not portable. This race condition bug makes Emacs hang on GNU/Linux.
46 Fix it by altering the signal handler so that it does not invoke
47 strsignal.
48 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
49 * process.c (status_message): Use const pointer, in case strsignal
50 is #defined to safe_strsignal.
51 * sysdep.c (sys_siglist, init_signals): Always define and
52 initialize a substitute sys_siglist if the system does not define
53 one, even if HAVE_STRSIGNAL.
54 (safe_strsignal): Rename from strsignal. Always define,
55 using sys_siglist. Return a const pointer.
56 * syssignal.h (safe_strsignal): New decl.
57 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
58
ace917bd
EZ
592012-10-01 Eli Zaretskii <eliz@gnu.org>
60
61 * w32proc.c (timer_loop): Fix code that waits for timer
62 expiration, to avoid high CPU usage.
63
9eb71b9c
SM
642012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
65
66 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
67 (sweep_weak_table): Remove redundant prototypes.
68
b3317662
FP
692012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
70
71 * emacs.c: Move the inclusion of TERM_HEADER after including
72 windows.h on WINDOWSNT. This avoids compilation problems with
73 MSVC.
74
f0e5f225
EZ
752012-10-01 Eli Zaretskii <eliz@gnu.org>
76
2d7d1608
EZ
77 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
78 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
79 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
80 as the previous version used 'void *'.
81
82 * ralloc.c (ROUNDUP): Fix last change.
83 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
84 'size_t'.
85
f0e5f225
EZ
86 * w32proc.c <disable_itimers>: New static flag.
87 (init_timers): Initialize it to zero, after creating the critical
88 sections used by the timer threads.
89 (term_timers): Set to 1 before deleting the critical sections.
90 (getitimer, setitimer): If disable_itimers is non-zero, return an
91 error indication without doing anything. Reported by Fabrice
92 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
93 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
94 return results.
95 [!HAVE_SETITIMER]: Behave as the previous version that didn't
96 support timers.
f0e5f225
EZ
97
98 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
99 term_ntproc after all the other bookkeeping, to get timers working
100 as long as possible.
101
82ef37c1
PE
1022012-10-01 Paul Eggert <eggert@cs.ucla.edu>
103
b3a4c387
PE
104 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
105 Suggested by Juri Linkov in
106 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
107
b0ab8123
PE
108 Prefer plain 'static' to 'static inline' (Bug#12541).
109 With static functions, modern compilers inline pretty well by
110 themselves; advice from programmers often hurts as much as it helps.
111 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
112 this change shrinks the text size of the Emacs executable by 1.1%
113 without affecting CPU significantly in my benchmark.
114 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
115 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
116 (mark_maybe_object, mark_maybe_pointer, bounded_number):
117 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
118 (bset_auto_fill_function, bset_auto_save_file_format)
119 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
120 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
121 (bset_cache_long_line_scans, bset_case_fold_search)
122 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
123 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
124 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
125 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
126 (bset_header_line_format, bset_indicate_buffer_boundaries)
127 (bset_indicate_empty_lines, bset_invisibility_spec)
128 (bset_left_fringe_width, bset_major_mode, bset_mark)
129 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
130 (bset_name, bset_overwrite_mode, bset_pt_marker)
131 (bset_right_fringe_width, bset_save_length)
132 (bset_scroll_bar_width, bset_scroll_down_aggressively)
133 (bset_scroll_up_aggressively, bset_selective_display)
134 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
135 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
136 (set_buffer_overlays_after):
137 * category.c (bset_category_table):
138 * charset.c (read_hex):
139 * coding.c (produce_composition, produce_charset)
140 (handle_composition_annotation, handle_charset_annotation)
141 (char_encodable_p):
142 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
143 (assign_row, set_frame_matrix_frame, make_current)
144 (add_row_entry):
145 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
146 * fns.c (maybe_resize_hash_table):
147 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
148 * gmalloc.c (register_heapinfo):
149 * image.c (lookup_image_type):
150 * intervals.c (set_interval_object, set_interval_left)
151 (set_interval_right, copy_interval_parent, rotate_right)
152 (rotate_left, balance_possible_root_interval):
153 * keyboard.c (kset_echo_string, kset_kbd_queue)
154 (kset_keyboard_translate_table, kset_last_prefix_arg)
155 (kset_last_repeatable_command, kset_local_function_key_map)
156 (kset_overriding_terminal_local_map, kset_real_last_command)
157 (kset_system_key_syms, clear_event, set_prop):
158 * lread.c (digit_to_number):
159 * marker.c (attach_marker, live_buffer, set_marker_internal):
160 * nsterm.m (ns_compute_glyph_string_overhangs):
161 * process.c (pset_buffer, pset_command)
162 (pset_decode_coding_system, pset_decoding_buf)
163 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
164 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
165 (pset_status, pset_tty_name, pset_type, pset_write_queue):
166 * syntax.c (bset_syntax_table, dec_bytepos):
167 * terminal.c (tset_param_alist):
168 * textprop.c (interval_has_some_properties)
169 (interval_has_some_properties_list):
170 * window.c (wset_combination_limit, wset_dedicated)
171 (wset_display_table, wset_hchild, wset_left_fringe_width)
172 (wset_left_margin_cols, wset_new_normal, wset_new_total)
173 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
174 (wset_right_fringe_width, wset_right_margin_cols)
175 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
176 (wset_vertical_scroll_bar_type, wset_window_parameters):
177 * xdisp.c (wset_base_line_number, wset_base_line_pos)
178 (wset_column_number_displayed, wset_region_showing)
179 (window_box_edges, run_window_scroll_functions)
180 (append_glyph_string_lists, prepend_glyph_string_lists)
181 (append_glyph_string, set_glyph_string_background_width)
182 (append_glyph, append_composite_glyph)
183 (take_vertical_position_into_account):
184 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
185 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
186 (lface_hash, lface_same_font_attributes_p, lookup_face):
187 * xml.c (libxml2_loaded_p):
188 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
189 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
190 Now 'static', not 'static inline'.
191
05584c31
PE
192 * bidi.c: Tune.
193 (bidi_copy_it): Do the whole copy with a single memcpy.
194 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
195
86ec63ba
PE
196 Revert the FOLLOW-SYMLINKS change for file-attributes.
197 Doing it right would require several changes to Tramp, and there's
198 not enough time to get that tested before the freeze today.
199 * dired.c (directory_files_internal, Ffile_attributes):
200 Undo last change.
201
82ef37c1
PE
202 * frame.c (x_report_frame_params): Port better to wider ints.
203 Do not assume that EMACS_UINT is the same width as uprintmax_t,
204 or that pointers can be printed in 15 decimal digits.
205 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
206
62aba0d4
FP
2072012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
208
209 Support x64 build on MS-Windows.
210 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
211 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
212 compatibility with x64.
5e4daaf3 213 (x_get_focus_frame): Add prototype.
62aba0d4
FP
214
215 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
216 defining an XRectangle structure.
217
218 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
219 arithmetics for compatibility with x64.
220
221 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
222 compatibility with x64.
223
224 * w32heap.h: Adjust prototypes and declarations.
225
226 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
227 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
228 DWORD, long, and unsigned long, for compatibility with x64.
229 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
230 (sbrk): Argument is now of type ptrdiff_t.
231
232 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
233 less than 0x0500.
234 (w32_msg_pump): Use WPARAM type for 'result'.
235
236 * w32.c (init_environment, get_emacs_configuration): Support AMD64
237 architecture.
238 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
239 compatibility with x64.
240
241 * vm-limit.c (lim_data): Now size_t.
242 (check_memory_limits): Adjust prototypes of real_morecore and
243 __morecore to receive argument of type ptrdiff_t. Use size_t for
244 five_percent and data_size.
245
246 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
247 variables, for compatibility with x64.
248 (rva_to_section, offset_to_section, relocate_offset)
249 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
250 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
251 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
252 for compatibility with x64.
253
254 * sysdep.c (STDERR_FILENO): Define if not already defined.
255
256 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
257 (__morecore): Argument type is now ptrdiff_t.
258 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
259 (relinquish): Use ptrdiff_t type for 'excess'.
260 (r_alloc_sbrk): Argument type is now ptrdiff_t.
261
262 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
263 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
264 instead of a literal number.
265
266 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
267 (min): Define only if not already defined.
268
269 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
270 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
271 hosts.
272
273 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
274 'bitmaps' is a pointer.
275
276 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
277
278 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
279
e7a2937b
PE
2802012-09-30 Paul Eggert <eggert@cs.ucla.edu>
281
282 file-attributes has a new optional arg FOLLOW-SYMLINKS.
283 * dired.c (directory_files_internal, Ffile_attributes):
284 New arg follow_symlinks. All uses changed.
285
b43d62ae
SM
2862012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
287
288 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
289
c06c382a
EZ
2902012-09-30 Eli Zaretskii <eliz@gnu.org>
291
292 Support atimers and CPU profiler via profile.c on MS-Windows.
293 * w32proc.c (sig_mask, crit_sig): New static variables.
294 (sys_signal): Support SIGALRM and SIGPROF.
295 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 296 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
297 sigfillset, and sigprocmask are no longer no-ops.
298 (sigismember): New function.
299 (struct itimer_data): New definition.
300 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
301 (crit_prof): New static variables.
302 (MAX_SINGLE_SLEEP): New definition.
303 (timer_loop, stop_timer_thread, term_timers, init_timers)
304 (start_timer_thread, getitimer, setitimer): New functions.
305 (alarm): No longer a no-op, calls setitimer.
306
307 * w32.c (term_ntproc): Call term_timers.
308 (init_ntproc): Make sure all signals are unblocked at startup, to
309 erase any traces of dumping. Call init_timers.
310
311 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
312 Windows-specific code to display the hourglass mouse pointer is no
313 longer used.
314 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
315 to hourglass timer expiration.
316 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
317 Remove, no longer used.
b43d62ae
SM
318 (w32_note_current_window, show_hourglass, hide_hourglass):
319 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
320 window systems.
321 (syms_of_w32fns): Don't initialize hourglass_timer.
322
323 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
324 WINDOWSNT as well.
325 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
326
327 * w32.h (init_timers, term_timers): Add prototypes.
328
95402d5f
KH
3292012-09-30 Kenichi Handa <handa@gnu.org>
330
331 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
332 to the buffer relocation which may be caused by ccl_driver.
333
dd946752
JD
3342012-09-30 Jan Djärv <jan.h.d@swipnet.se>
335
d7e642cc
JD
336 * xfns.c (Fx_file_dialog): Update comment.
337
338 * w32fns.c (Fx_file_dialog): Update comment.
339
340 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
341 Initialize panel name field if OSX >= 10.6.
342
343 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
344
dd946752
JD
345 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
346
347 * nsterm.m (NEW_STYLE_FS): New define.
348 (ns_fullscreen_hook, windowWillEnterFullScreen)
349 (windowDidEnterFullScreen, windowWillExitFullScreen)
350 (windowDidExitFullScreen, toggleFullScreen, handleFS)
351 (setFSValue): New functions.
352 (EmacsFSWindow): New implementation.
353 (canBecomeKeyWindow): New function for EmacsFSWindow.
354 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
355 (dealloc): Release nonfs_window if in fullscreen.
356 (updateFrameSize:): Call windowDidMove to update top/left.
357 (windowWillResize:toSize:): Check if frame is still maximized.
358 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
359 next_maximized, maximized_width, maximized_height and nonfs_window.
360 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
361 tbar_height.
362 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
363 fullscreen. Set maximized_width/height. Act on next_maximized.
364
365 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
366 (EmacsView): Add variables for fullscreen.
367 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
368 (EmacsFSWindow): New interface for fullscreen.
369
427730eb
JB
3702012-09-30 Juanma Barranquero <lekktu@gmail.com>
371
372 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
373
48de8b12
CY
3742012-09-30 Chong Yidong <cyd@gnu.org>
375
376 * fns.c (Frandom): Doc fix.
377
5938d519
MR
3782012-09-30 Martin Rudalics <rudalics@gmx.at>
379
380 * window.c (Vwindow_combination_limit): New default value.
381 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
382
cb5b0266
PE
3832012-09-30 Paul Eggert <eggert@cs.ucla.edu>
384
385 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
386 Suggested by Eli Zaretskii in
387 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
388
84f72efd
EZ
3892012-09-30 Eli Zaretskii <eliz@gnu.org>
390
391 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
392 HAVE_TIMER_SETTIME is defined.
393
9d4dcdc9
PE
3942012-09-30 Paul Eggert <eggert@cs.ucla.edu>
395
d89460ed
PE
396 Profiler improvements: more-accurate timers, overflow checks.
397 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
398 signal.h, setjmp.h. Include systime.h instead.
399 (saturated_add): New function.
400 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
401 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
402 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
403 New static vars.
84f72efd 404 (enum profiler_cpu_running): New enum.
d89460ed
PE
405 (profiler_cpu_running): Now of that enum type, not bool.
406 All uses changed to store the new value.
407 (handle_profiler_signal): Rename from sigprof_handler_1,
408 for consistency with other handlers. Do not check whether
409 cpu_log is a hash-table if garbage collecting, since it
410 doesn't matter in that case.
411 (deliver_profiler_signal): Rename from sigprof_handler,
412 for consistency with other handlers.
413 (setup_cpu_timer): New function, with much of what used to be in
414 Fprofiler_cpu_start. Check for out-of-range argument.
415 Prefer timer_settime if available, and prefer
416 thread cputime clocks, then process cputime clocks, then
417 monotonic clocks, to the old realtime clock. Use make_timeval
418 to round more-correctly when falling back to setitimer.
419 (Fprofiler_cpu_start): Use it.
420 (Fprofiler_cpu_stop): Prefer timer_settime if available.
421 Don't assume that passing NULL as the 2nd argument of setitimer
422 is the same as passing a pointer to all-zero storage.
423 Ignore SIGPROF afterwards.
424 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
425 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
426 non-fatal signal handlers. Ignore SIGPROF on startup.
427 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
428 in profiler.c, since sysdep.c now uses it.
429
9d4dcdc9
PE
430 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
431 Suggested by Eli Zaretskii in
432 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
433
8e5691a0
JB
4342012-09-29 Juanma Barranquero <lekktu@gmail.com>
435
436 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
437
e7c1b6ef
SM
4382012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
439
440 * lisp.h (struct backtrace): Remove indirection for `function' field.
441 * xdisp.c (redisplay_internal):
442 * profiler.c (record_backtrace, sigprof_handler_1):
443 * alloc.c (Fgarbage_collect):
444 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
445 (Fbacktrace_frame): Adjust accordingly.
446
e61d39cd 4472012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
448
449 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
450 (Frun_hook_with_args_until_failure): Doc fixes.
451
404043ea
EZ
4522012-09-28 Eli Zaretskii <eliz@gnu.org>
453
454 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
455 Qautomatic_redisplay and change the symbol name. All users changed.
456
704d3f45
TM
4572012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
458
459 * profiler.c (sigprof_handler): Fix race condition.
460
757140ff
GM
4612012-09-28 Glenn Morris <rgm@gnu.org>
462
463 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
464
a615a3ae
PE
4652012-09-27 Paul Eggert <eggert@cs.ucla.edu>
466
467 Check more robustly for timer_settime.
89d17fd0
PE
468 * Makefile.in (LIB_TIMER_TIME): New macro.
469 (LIBES): Add it.
a615a3ae
PE
470 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
471 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
472 call timer_settime.
473
3670daf7
TM
4742012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
475
476 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
477
6a586b7f
JB
4782012-09-26 Juanma Barranquero <lekktu@gmail.com>
479
480 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
481
41c8bfcf
PE
4822012-09-26 Paul Eggert <eggert@cs.ucla.edu>
483
484 * character.h (MAYBE_UNIFY_CHAR): Remove.
485 * charset.c, charset.h (maybe_unify_char): Now static.
486 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
487 Since this stuff is now private to charset.c, there's no need for
488 a public macro and no need to inline by hand.
489
3a880af4
SM
4902012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
491 Stefan Monnier <monnier@iro.umontreal.ca>
492 Juanma Barranquero <lekktu@gmail.com>
611b7507 493
3a880af4
SM
494 * profiler.c: New file.
495 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
496 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
497 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
498 * emacs.c (main): Call syms_of_profiler.
499 * alloc.c (Qautomatic_gc): New constant.
500 (MALLOC_PROBE): New macro.
501 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
502 (total_bytes_of_live_objects): New function.
503 (Fgarbage_collect): Use it. Record itself in backtrace_list.
504 Call malloc_probe for the memory profiler.
505 (syms_of_alloc): Define Qautomatic_gc.
506 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
507 race condition.
508 (struct backtrace): Move definition...
509 * lisp.h (struct backtrace): ..here.
510 (Qautomatic_gc, profiler_memory_running): Declare vars.
511 (malloc_probe, syms_of_profiler): Declare functions.
512 * xdisp.c (Qautomatic_redisplay): New constant.
513 (redisplay_internal): Record itself in backtrace_list.
514 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 515
5938d519 5162012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
5172012-09-25 Juanma Barranquero <lekktu@gmail.com>
518
519 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
520
e26fd2e4
PE
5212012-09-25 Paul Eggert <eggert@cs.ucla.edu>
522
523 Prefer POSIX timers if available.
524 They avoid a race if the timer is too close to the current time.
525 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
526 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 527 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 528
eedec3ee
EZ
5292012-09-25 Eli Zaretskii <eliz@gnu.org>
530
531 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
532 CHAR_STRING_ADVANCE.
533 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
534 STRING_CHAR_ADVANCE.
535
aa15c6bb
JB
5362012-09-25 Juanma Barranquero <lekktu@gmail.com>
537
538 Move Vlibrary_cache to emacs.c and reset before dumping.
539
540 * lisp.h (reset_image_types): Declare.
541 [WINDOWSNT] (Vlibrary_cache): Declare.
542
543 * image.c (reset_image_types): New function.
544
545 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
546 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
547 (Fdump_emacs): Reset Vlibrary_cache and image_types.
548
549 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
550 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
551
552 * w32.h (Vlibrary_cache): Do not declare.
553
54d629be
EZ
5542012-09-25 Eli Zaretskii <eliz@gnu.org>
555
16b22fef
EZ
556 * w32proc.c (sys_signal): Handle all signals defined by the
557 MS-Windows runtime, not just SIGCHLD. Actually install the signal
558 handlers for signals supported by Windows. Don't override
559 term_ntproc as the handler for SIGABRT.
560 (sigaction): Rewrite to call sys_signal instead of duplicating its
561 code.
562 (sys_kill): Improve commentary.
563
564 * w32.c (term_ntproc): Accept (and ignore) one argument, for
565 consistency with a signature of a signal handler. All callers
566 changed.
567 (init_ntproc): Accept an argument DUMPING. If dumping, don't
568 install term_ntproc as a signal handler for SIGABRT, as that
569 should be done by the dumped Emacs.
570
571 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
572
573 * w32select.c (term_w32select): Protect against repeated
574 invocation by setting clipboard_owner to NULL after calling
575 DestroyWindow.
576
577 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
578 and term_ntproc to their modified signatures.
579
54d629be
EZ
580 * character.c (char_string, string_char): Remove calls to
581 MAYBE_UNIFY_CHAR. See the discussion starting at
582 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
583 for the details.
584
59f7af81
CY
5852012-09-25 Chong Yidong <cyd@gnu.org>
586
587 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
588
22e8cf4a
SM
5892012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
590
591 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
592 when encountering an unknown bytecode.
593
578098f3
PE
5942012-09-24 Paul Eggert <eggert@cs.ucla.edu>
595
596 image.c, indent.c: Use bool for booleans.
597 * dispextern.h (struct image_type): Members valid_p, load, init
598 now return bool, not int. All uses changed.
599 * image.c: Omit unnecessary static decls.
600 (x_create_bitmap_mask, x_build_heuristic_mask):
601 Return void, not int, since callers don't care about the return value.
602 (x_create_bitmap_mask, define_image_type, valid_image_p)
603 (struct image_keyword, parse_image_spec, image_spec_value)
604 (check_image_size, image_background)
605 (image_background_transparent, x_clear_image_1)
606 (postprocess_image, lookup_image, x_check_image_size)
607 (x_create_x_image_and_pixmap, xbm_image_p)
608 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
609 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
610 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
611 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
612 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
613 (png_image_p, init_png_functions, png_load_body, png_load)
614 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
615 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
616 (init_gif_functions, gif_load, imagemagick_image_p)
617 (imagemagick_load_image, imagemagick_load, svg_image_p)
618 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
619 (gs_load):
620 * nsimage.m (ns_load_image):
621 * nsterm.m (ns_defined_color):
622 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
623 * xfns.c (x_defined_color):
624 * xterm.c (x_alloc_lighter_color_for_widget)
625 (x_alloc_nearest_color_1, x_alloc_nearest_color)
626 (x_alloc_lighter_color):
627 * indent.c (disptab_matches_widthtab, current_column)
628 (scan_for_column, string_display_width, indented_beyond_p)
629 (compute_motion, vmotion, Fvertical_motion):
630 Use bool for booleans.
631
a5f2b6ec
CY
6322012-09-24 Chong Yidong <cyd@gnu.org>
633
634 * chartab.c (Fset_char_table_default): Obsolete function removed.
635
18e27ea8
PE
6362012-09-23 Paul Eggert <eggert@cs.ucla.edu>
637
afea8a8a
PE
638 Move pid_t related decls out of lisp.h.
639 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
640 (interruptible_wait_for_termination):
641 Move these decls from lisp.h to syswait.h, since they use pid_t.
642 Needed on FreeBSD; see Herbert J. Skuhra in
643 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
644 * callproc.c: Include syswait.h.
645
18e27ea8
PE
646 gnutls.c, gtkutil.c: Use bool for boolean.
647 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
648 (emacs_gnutls_handle_error):
649 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
650 (xg_hide_tooltip, xg_create_frame_widgets)
651 (create_dialog, xg_uses_old_file_dialog)
652 (xg_get_file_with_chooser, xg_get_file_with_selection)
653 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
654 (xg_item_label_same_p, xg_update_menubar)
655 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
656 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
657 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
658 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
659 (update_frame_tool_bar, free_frame_tool_bar):
660 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
661 * nsmenu.m (ns_update_menubar):
662 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
663 * xfns.c (Fx_show_tip) [USE_GTK]:
664 Use bool for boolean.
665 * gtkutil.c (xg_update_frame_menubar):
666 * xmenu.c (update_frame_menubar):
667 Return void, not int, since caller ignores return value.
668 * gtkutil.c (xg_change_toolbar_position):
669 Return void, not 1.
670
af0e9f75
JB
6712012-09-23 Juanma Barranquero <lekktu@gmail.com>
672
673 * makefile.w32-in (BLOCKINPUT_H): Remove.
674 (SYSSIGNAL_H): New macro.
675 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
676 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
677 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
678 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
679 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
680 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
681 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
682 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
683 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
684 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
685 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
686 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
687 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
688 ($(BLD)/w32xfns.$(O)): Update dependencies.
689
5101529e
EZ
6902012-09-23 Eli Zaretskii <eliz@gnu.org>
691
692 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
693 fatal_error_backtrace.
694
695 * w32proc.c (sys_kill): Undo last change: don't do anything when
696 invoked to deliver SIGABRT to our own process. This is now
697 handled by emacs_raise.
698
2c3ee0ad
JB
6992012-09-23 Juanma Barranquero <lekktu@gmail.com>
700
701 * w32term.c (w32_read_socket): Remove leftover reference to
702 interrupt_input_pending.
703
62a1d661
PE
7042012-09-23 Paul Eggert <eggert@cs.ucla.edu>
705
706 Do not use SA_NODEFER.
707 Problem reported by Dani Moncayo in
708 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
709 * alloc.c (die):
710 * sysdep.c (emacs_abort): Do not reset signal handler.
711 * emacs.c (terminate_due_to_signal): Reset signal handler here.
712 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
713 wanted even on POSIXish hosts, and it doesn't work on Windows.
714
a0942b9a
JD
7152012-09-23 Jan Djärv <jan.h.d@swipnet.se>
716
717 * xterm.c (x_term_init): Call fixup_locale before and after calling
718 gtk_init (Bug#12392).
719
d07ff9db
CY
7202012-09-23 Chong Yidong <cyd@gnu.org>
721
722 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
723 Vdynamic_library_alist.
724
725 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
726 (Fgnutls_available_p): Caller changed.
727
728 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
729 (Flibxml_parse_xml_region): Likewise.
730
731 * dispextern.h (struct image_type): Remove arg from init function.
732
733 * image.c (Finit_image_library, lookup_image_type)
734 (define_image_type): Remove now-unneeded second arg.
735 (init_xpm_functions, init_png_functions, init_jpeg_functions)
736 (init_tiff_functions, init_gif_functions, init_svg_functions):
737 Arglist and w32_delayed_load calling convention changed.
738 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 739 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 740
4d7e6e51
PE
7412012-09-23 Paul Eggert <eggert@cs.ucla.edu>
742
743 Simplify and avoid signal-handling races (Bug#12471).
744 * alloc.c (die):
745 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
746 Avoid recursive loop if there's a fatal error in the function itself.
747 * atimer.c (pending_atimers):
748 * blockinput.h: Don't include "atimer.h"; no longer needed.
749 (interrupt_input_pending): Remove. All uses removed.
750 pending_signals now counts both atimers and ordinary interrupts.
751 This is less racy than having three separate pending-signal flags.
752 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
753 (input_blocked_p):
754 Rename from their upper-case counterparts BLOCK_INPUT,
755 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
756 INPUT_BLOCKED_P, and turn into functions. All uses changed.
757 This makes it easier to access volatile variables more accurately.
758 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
759 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
760 that's more reliable if the code is buggy and sets
761 interrupt_input_blocked to a negative value. All uses changed.
762 * atimer.c (deliver_alarm_signal):
763 Remove. No need to deliver this to the parent; any thread can
764 handle this signal now. All uses replaced by underlying handler.
765 * atimer.c (turn_on_atimers):
766 * dispnew.c (handle_window_change_signal):
767 * emacs.c (handle_danger_signal):
768 * keyboard.c (kbd_buffer_get_event):
769 Don't reestablish signal handler; not needed with sigaction.
770 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
771 (UNBLOCK_INPUT_TO):
772 Rework to avoid unnecessary accesses to volatile variables.
773 (UNBLOCK_INPUT_TO): Now a function.
774 (totally_unblock_input, unblock_input): New decls.
775 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
776 (init_data): Remove. Necessary stuff now done in init_signal.
777 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
778 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
779 (fatal_error_code): Remove; no longer needed.
780 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
781 it doesn't always backtrace. All uses changed. No need to reset
782 signal to default, since sigaction and/or die does that for us now.
783 Use emacs_raise (FOO), not kill (getpid (), FOO).
784 (main): Check more-accurately whether we're dumping.
785 Move fatal-error setup to sysdep.c
786 * floatfns.c: Do not include "syssignal.h"; no longer needed.
787 * gtkutil.c (xg_get_file_name, xg_get_font):
788 Remove no-longer-needed signal-mask manipulation.
789 * keyboard.c, process.c (POLL_FOR_INPUT):
790 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
791 * keyboard.c (read_avail_input): Remove.
792 All uses replaced by gobble_input.
793 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
794 (kbd_buffer_store_event_hold, gobble_input):
795 (record_asynch_buffer_change) [USABLE_SIGIO]:
796 (store_user_signal_events):
797 No need to mess with signal mask.
798 (gobble_input): If blocking input and there are terminals, simply
799 set pending_signals to 1 and return. All hooks changed to not
800 worry about whether input is blocked.
801 (process_pending_signals): Clear pending_signals before processing
802 them, in case a signal comes in while we're processing.
803 By convention callers now test pending_signals before calling us.
804 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
805 New functions, to support changes to blockinput.h.
806 (handle_input_available_signal): Now extern.
807 (reinvoke_input_signal): Remove. All uses replaced by
808 handle_async_input.
809 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
810 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
811 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
812 Clear sigmask reliably, even if Fsignal returns, which it can.
813 Omit unnecessary accesses to volatile var.
814 (quit_throw_to_read_char): No need to restore sigmask.
815 * keyboard.c (gobble_input, handle_user_signal):
816 * process.c (wait_reading_process_output):
817 Call signal-handling code rather than killing ourselves.
818 * lisp.h: Include <float.h>, for...
819 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
820 (pending_signals): Now volatile.
821 (syms_of_data): Now const if IEEE floating point.
822 (handle_input_available_signal) [USABLE_SIGIO]:
823 (terminate_due_to_signal, record_child_status_change): New decls.
824 * process.c (create_process): Avoid disaster if memory is exhausted
825 while we're processing a vfork, by tightening the critical section
826 around the vfork.
827 (send_process_frame, process_sent_to, handle_pipe_signal)
828 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
829 ignores SIGPIPE.
830 (send_process): No need for setjmp/longjmp any more, since the
831 SIGPIPE stuff is now gone. Instead, report an error if errno
832 is EPIPE.
833 (record_child_status_change): Now extern. PID and W are now args.
834 Return void, not bool. All callers changed.
835 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
836 Remove. All uses removed. This bug should be fixed now in a
837 different way.
838 (wait_for_termination_1): Use waitpid rather than sigsuspend,
839 and record the child status change directly. This avoids the
840 need to futz with the signal mask.
841 (process_fatal_action): Move here from emacs.c.
842 (emacs_sigaction_flags): New function, containing
843 much of what used to be in emacs_sigaction_init.
844 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
845 caught by emacs, to make races less likely.
846 (deliver_process_signal): Rename from handle_on_main_thread.
847 All uses changed.
848 (BACKTRACE_LIMIT_MAX): Now at top level.
849 (thread_backtrace_buffer, threadback_backtrace_pointers):
850 New static vars.
851 (deliver_thread_signal, deliver_fatal_thread_signal):
852 New functions, for more-accurate delivery of thread-specific signals.
853 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
854 (deliver_arith_signal): Handle in this thread, not
855 in the main thread, since it's triggered by this thread.
856 (maybe_fatal_sig): New function.
857 (init_signals): New arg DUMPING so that we can be more accurate
858 about whether we're dumping. Caller changed.
859 Treat thread-specific signals differently from process-general signals.
860 Block all signals while handling fatal error; that's safer.
861 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
862 on IEEE hosts.
863 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
864 Ignore SIGPIPE unless batch.
865 (emacs_backtrace): Output backtrace for the appropriate thread,
866 which is not necessarily the main thread.
867 * syssignal.h: Include <stdbool.h>.
868 (emacs_raise): New macro.
869 * xterm.c (x_connection_signal): Remove; no longer needed
870 now that we use sigaction.
871 (x_connection_closed): No need to mess with sigmask now.
872 (x_initialize): No need to reset SIGPIPE handler here, since
873 init_signals does this for us now.
874
8f4635e9
JD
8752012-09-23 Jan Djärv <jan.h.d@swipnet.se>
876
877 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 878 background rect may be larger (Bug#12245).
8f4635e9 879
3296976d
CY
8802012-09-23 Chong Yidong <cyd@gnu.org>
881
882 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
883
d41e491e
PE
8842012-09-22 Paul Eggert <eggert@cs.ucla.edu>
885
886 * .gdbinit: Just stop at fatal_error_backtrace.
887 See Stefan Monnier's request in
888 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
889 Remove no-longer-used query of system type.
890
c88b867f
CY
8912012-09-22 Chong Yidong <cyd@gnu.org>
892
893 * search.c (Freplace_match): Doc fix (Bug#12325).
894
895 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
896
897 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
898 (Fline_end_position): Doc fix.
899
900 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
901
bb4d86b4
CY
9022012-09-22 Chong Yidong <cyd@gnu.org>
903
904 * dispextern.h (struct image_type): Add new slot, storing a type
905 initialization function.
906
907 * image.c (define_image_type): Call the image initializer function
908 if it is defined. Arguments and return value changed.
909 (valid_image_p, make_image): Callers changed.
910 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
911 (gif_type, imagemagick_type, svg_type, gs_type):
912 Add initialization functions.
bb4d86b4
CY
913 (Finit_image_library): Call lookup_image_type.
914 (CHECK_LIB_AVAILABLE): Macro deleted.
915 (lookup_image_type): Call define_image_type here, rather than via
916 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
917 (syms_of_image): Move define_image_type calls for xbm_type and
918 pbm_type to lookup_image_type.
919
df9685f3
EZ
9202012-09-22 Eli Zaretskii <eliz@gnu.org>
921
922 * keyboard.c (timer_check_2): Move calculation of 'timers' and
923 'idle_timers' from here ...
924 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
925 lists, to avoid infloops when the timer does something stupid,
926 like reinvoke itself with the same or smaller time-out.
927 (Bug#12447)
928
8e17c9ba
MR
9292012-09-22 Martin Rudalics <rudalics@gmx.at>
930
931 * window.c (Fsplit_window_internal): Handle only Qt value of
932 Vwindow_combination_limit separately.
933 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
934 (Vwindow_combination_limit): New default value.
935 Rewrite doc-string.
8e17c9ba 936
589bd69b
EZ
9372012-09-22 Eli Zaretskii <eliz@gnu.org>
938
939 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
940 the new overlay string. (Bug#10159)
941
01108e3f
PE
9422012-09-22 Paul Eggert <eggert@cs.ucla.edu>
943
944 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
945 or that fprintf is async-signal-safe. POSIX doesn't require
946 either assumption.
947
82f8cd94
CY
9482012-09-22 Chong Yidong <cyd@gnu.org>
949
950 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
951 (Bug#8207).
952
3cccbd87
KH
9532012-09-22 Kenichi Handa <handa@gnu.org>
954
955 * composite.c (composition_reseat_it): Handle the case that a
956 grapheme cluster is not covered by a single font (Bug#12352).
957
09c01941
CY
9582012-09-21 Chong Yidong <cyd@gnu.org>
959
960 * image.c (define_image_type): Avoid adding duplicate types to
961 image_types (Bug#12463). Suggested by Jörg Walter.
962
acfa068f 9632012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
964
965 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
966 (print_load_command_name): Add case LC_DATA_IN_CODE.
967 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
968
acfa068f 9692012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
970
971 * eval.c (Frun_hook_with_args_until_success)
972 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
973
acfa068f 9742012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
975
976 * fileio.c (Ffile_selinux_context): Only call freecon when
977 lgetfilecon succeeded.
978 (Fset_file_selinux_context): Likewise. (Bug#12444)
979
acfa068f 9802012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
981
982 * xdisp.c (try_window_reusing_current_matrix): Under bidi
983 reordering, locate the cursor by calling set_cursor_from_row; if
984 that fails, clear the desired glyph matrix before returning a
985 failure indication to the caller. Fixes leaving garbled display
986 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
987 (compute_stop_pos_backwards): Fix a typo that caused crashes while
988 scrolling through multibyte text.
aa36e4d2 989
e99f70c8
SM
9902012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
991
992 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
993 calling mark_vectorlike since that's the one that marks the window.
994 (mark_discard_killed_buffers): Mark the final cdr.
995 * window.h (struct window): Move prev/next_buffers to the
996 non-standard fields.
997 * window.c (make_window): Initialize prev/next_buffers manually.
998
f75beb47
PE
9992012-09-20 Paul Eggert <eggert@cs.ucla.edu>
1000
1001 Omit unused arg EXPECTED from socket hooks.
1002 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1003 * nsterm.m (ns_term_init):
1004 * termhooks.h (struct terminal.read_socket_hook):
1005 * w32inevt.c (w32_console_read_socket):
1006 * w32term.c (w32_read_socket):
1007 * xterm.c (XTread_socket):
1008 Omit unused arg EXPECTED. All callers changed.
1009 (store_user_signal_events): Return void, not int, since callers no
1010 longer care about the return value. All uses changed.
1011
b019b76a
JB
10122012-09-20 Juanma Barranquero <lekktu@gmail.com>
1013
1014 * w32gui.h (XParseGeometry): Do not declare.
1015
05642592
PE
10162012-09-19 Paul Eggert <eggert@cs.ucla.edu>
1017
e4bce92a
PE
1018 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1019 Ignore 'expected'. See Eli Zaretskii in
1020 <http://bugs.gnu.org/12471#8> (last line).
1021
05642592
PE
1022 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
1023 (XParseGeometry): Now static. Substitute extremal values for
1024 values that are out of range.
1025
e543ae91
JD
10262012-09-19 Jan Djärv <jan.h.d@swipnet.se>
1027
1028 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1029
1030 * nsfns.m (XParseGeometry): Remove.
1031 (Fx_create_frame): Call x_set_offset to correctly interpret
1032 top_pos in geometry.
1033
3a880af4 1034 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
1035 (Fx_parse_geometry): If there is a space in string, call
1036 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1037
45ba16c7
EZ
10382012-09-17 Eli Zaretskii <eliz@gnu.org>
1039
c8b9f1bc
EZ
1040 * search.c (scan_buffer): Use character positions in calls to
1041 region_cache_forward and region_cache_backward, not byte
1042 positions. (Bug#12196)
1043
b4c932a2
EZ
1044 * w32term.c (w32_read_socket): Set pending_signals to 1, like
1045 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
1046
45ba16c7
EZ
1047 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1048 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1049 emacs_blocked_malloc, now deleted.
1050
eeceac93
PE
10512012-09-17 Paul Eggert <eggert@cs.ucla.edu>
1052
1053 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1054 The workaround was for improving performance on Solaris 2.4, but
1055 is getting in the way now. Emacs will still work if someone is
1056 still running Solaris 2.4 in a museum somewhere; Sun dropped
1057 support for Solaris 2.4 in 2003.
1058 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1059 * process.c (create_process) [HAVE_WORKING_VFORK]:
1060 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1061 since Emacs no longer uses vfork on that platform.
1062
78f83752
GM
10632012-09-17 Glenn Morris <rgm@gnu.org>
1064
1065 * emacs.c: Use COPYRIGHT.
1066
634b8cac
PE
10672012-09-16 Paul Eggert <eggert@cs.ucla.edu>
1068
0caaedb1
PE
1069 Remove configure's --without-sync-input option (Bug#12450).
1070 When auditing signal-handling in preparation for cleaning it up,
1071 I found that SYNC_INPUT has race conditions and would be a real
1072 pain to fix. Since it's an undocumented and deprecated
1073 configure-time option, now seems like a good time to remove it.
1074 Also see <http://bugs.gnu.org/11080#16>.
1075 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1076 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1077 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1078 (malloc_hysteresis):
1079 (check_depth) [XMALLOC_OVERRUN_CHECK]:
1080 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1081 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1082 (dont_register_blocks, bytes_used_when_reconsidered)
1083 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1084 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1085 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1086 Remove. All uses removed.
1087 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1088 implementation, one that depends on whether the new macro
1089 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1090 is defined.
1091 * atimer.c (run_timers, handle_alarm_signal):
1092 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1093 (handle_async_input, process_pending_signals)
1094 (handle_input_available_signal, init_keyboard):
1095 * nsterm.m (ns_read_socket):
1096 * process.c (wait_reading_process_output):
1097 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1098 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1099 (emacs_write):
1100 * xterm.c (XTread_socket):
1101 Assume SYNC_INPUT.
1102 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1103 * eval.c (handling_signal): Remove. All uses removed.
1104 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1105 All uses replaced with the SYNC_INPUT version.
1106 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1107 Remove decls.
1108 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1109 Now static.
1110
634b8cac
PE
1111 * font.c (Ffont_shape_gstring): Remove unused local.
1112
83da1b55
GM
11132012-09-16 Glenn Morris <rgm@gnu.org>
1114
518650a5
GM
1115 * Makefile.in (clean): No longer run nextstep's clean.
1116
83da1b55
GM
1117 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1118 (ns_frag): Remove.
1119 (ns-app): Move here from ns.mk, and simplify.
1120 (clean): Simplify nextstep entry.
1121 * ns.mk: Remove file.
1122
85a43e2e
KH
11232012-09-17 Kenichi Handa <handa@gnu.org>
1124
1125 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1126 not covert the last few charactes.
1127
ba13e616 11282012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
1129
1130 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1131 here, but just check the validity of glyphs in the glyph-string.
1132
a8c729af
MR
11332012-09-16 Martin Rudalics <rudalics@gmx.at>
1134
3a880af4
SM
1135 * window.c (Fwindow_parameter, Fset_window_parameter):
1136 Accept any window as argument (Bug#12452).
a8c729af 1137
c077c059
JD
11382012-09-16 Jan Djärv <jan.h.d@swipnet.se>
1139
1140 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1141 to ns_term_init to avoid memory leak.
1142
1143 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
1144 explicit retain/release.
1145 (ns_term_init): Only allow one display. Initialize outerpool and
1146 ns_*_types.
1147
39a57ad0
PE
11482012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1149
1150 Port _setjmp fix to POSIXish hosts as well as Microsoft.
1151 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
1152 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
1153 the Microsoft problem in a different way, by altering ../nt/config.nt.
1154
7105c8cb
EZ
11552012-09-15 Eli Zaretskii <eliz@gnu.org>
1156
1157 * w32xfns.c:
1158 * w32uniscribe.c:
1159 * w32term.c:
1160 * w32select.c:
1161 * w32reg.c:
1162 * w32proc.c:
1163 * w32menu.c:
1164 * w32inevt.c:
1165 * w32heap.c:
1166 * w32font.c:
1167 * w32fns.c:
1168 * w32console.c:
1169 * w32.c:
1170 * w16select.c: Remove inclusion of setjmp.h, as it is now included
1171 by lisp.h. This completes removal of setjmp.h inclusion
1172 erroneously announced in the previous commit. (Bug#12446)
1173
1174 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
1175 more accurate.
1176
1177 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
1178 not defined as a macro. The latter happens on MS-Windows.
1179 (Bug#12446)
1180
0328b6de
PE
11812012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1182
1183 Port better to POSIX hosts lacking _setjmp (Bug#12446).
1184 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 1185 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
1186 only reason for the instance was because "lisp.h" was included.
1187 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
1188 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
1189 and _longjmp with the new symbols. Emacs already uses _setjmp if
1190 available, so this change affects only POSIXish hosts that have
1191 sigsetjmp but not _setjmp, such as some versions of Solaris and
1192 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
1193 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
1194 (png_load_body) [HAVE_PNG]:
1195 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
1196 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
1197 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
1198 since PNG requires jmp_buf. This is the only exception to the
1199 general rule that we now use sys_setjmp and sys_longjmp.
1200 This exception is OK since this code does not change the signal
1201 mask or longjmp out of a signal handler.
1202
2af03429
PE
12032012-09-14 Paul Eggert <eggert@cs.ucla.edu>
1204
1205 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1206 Include "syssignal.h", for 'main_thread'.
1207
2f294edf
DA
12082012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
1209
1210 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
1211 * insdel.c (replace_range, replace_range_2):
1212 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
1213 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1214 Remove redundant check before calling offset_intervals.
1215
6b533e9c
MR
12162012-09-14 Martin Rudalics <rudalics@gmx.at>
1217
1218 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1219 current buffer (Bug#12387).
1220
2a7931e3
JB
12212012-09-14 Juanma Barranquero <lekktu@gmail.com>
1222
1223 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1224
c18e885b
PE
12252012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1226
1227 Use a more backwards-compatible timer format (Bug#12430).
1228 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1229 vector element, not from the 4th, since PSECS is now at the end.
1230 (Fcurrent_idle_time): Doc fix.
1231
d59a1afb
DA
12322012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
1233
1234 Function to mark objects and remove killed buffers at once.
1235 * alloc.c (discard_killed_buffers): Rename to ...
1236 (mark_discard_killed buffers) ... new name. Add marking
1237 of remaining objects. Fix comment. Adjust users.
1238 (mark_object): Do not touch frame buffer lists here.
1239 * frame.c (delete_frame): Reset frame buffer lists here.
1240
5f0cb45a
PE
12412012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1242
8ea47e3a
PE
1243 Better workaround for GNOME bug when --enable-gcc-warnings.
1244 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1245 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
1246 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1247
4a4bbad2
PE
1248 Simplify SIGIO usage (Bug#12408).
1249 The code that dealt with SIGIO was crufty and confusing, e.g., it
1250 played tricks like "#undef SIGIO" but these tricks were not used
1251 consistently. Simplify mostly by not #undeffing standard symbols,
1252 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1253 or not as we please) rather than "defined SIGIO" (standard symbol
1254 that we probably shouldn't #undef).
1255 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1256 Modules that need it can include it.
1257 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1258 * dispextern.h (ignore_sigio): New decl.
1259 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1260 unconditionally, since it's now a no-op if !USABLE_SIGIO.
1261 * emacs.c (shut_down_emacs):
1262 * keyboard.c (kbd_buffer_store_event_hold):
1263 Use ignore_sigio rather than invoking 'signal' directly.
1264 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1265 for FIONREAD.
1266 (FIONREAD, SIGIO): Do not #undef.
1267 (tty_read_avail_input): Use #error rather than a syntax error.
1268 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1269 for I_PIPE, used by SETUP_SLAVE_PTY.
1270 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1271 * sysdep.c (croak): Remove; no longer needed. This bit of
1272 temporary code, with Fred N. Fish's comment that it's temporary,
1273 has been in Emacs since at least 1992!
1274 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1275 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1276 * syssignal.h (croak): Remove decl.
1277 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1278 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1279 now that we're termios-only.
1280 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1281 * term.c (dissociate_if_controlling_tty): Use #error rather than
1282 a run-time error.
1283
5f0cb45a
PE
1284 Work around GCC and GNOME bugs when --enable-gcc-warnings.
1285 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1286 to work around GNOME bug 683906.
1287 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1288 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1289 This works around GCC bug 54561.
1290
40bce90b
PE
12912012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1292
1293 More fixes for 'volatile' and setjmp/longjmp.
1294 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1295 * image.c (struct png_load_context) [HAVE_PNG]: New type.
1296 (png_load_body) [HAVE_PNG]:
1297 (jpeg_load_body) [HAVE_JPEG]:
1298 New function, with most of the old parent function's body.
1299 (png_load) [HAVE_PNG]:
1300 (jpeg_load) [HAVE_JPEG]:
1301 Invoke the new function, to avoid longjmp munging our locals.
1302 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
1303 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
1304 longjmp is passed 2, as the C standard doesn't guarantee this.
1305 Instead, store the failure code into mgr->failure_code.
1306
bfeae2cf
SM
13072012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1308
1309 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
1310 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
1311 (syms_of_keyboard): Remove support for unread-command-char.
1312
8099e36b
EZ
13132012-09-12 Eli Zaretskii <eliz@gnu.org>
1314
1315 * w32proc.c (sys_kill): If PID is our process ID and the signal is
1316 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
1317 violation. (Bug#12426)
1318
92547ff9
PE
13192012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1320
1321 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
1322
45b82ad0
SM
13232012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1324
1325 * eval.c: Add `inhibit-debugger'.
1326 (Qinhibit_debugger): New symbol.
1327 (call_debugger): Bind it instead of Qdebug_on_error.
1328 (maybe_call_debugger): Test Vinhibit_debugger.
1329 (syms_of_eval): Define inhibit-debugger.
1330 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1331 (syms_of_xdisp): Remove inhibit-debug-on-message.
1332
5779a1dc
PE
13332012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1334
50f2e553
PE
1335 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1336 If a nonvolatile local variable is written before a _longjmp to
1337 the frame containing the variable, and is read after the _longjmp,
1338 the value read is indeterminate. Some local variables of type
1339 'struct handler' and 'struct catchtag' are used in this way, so
1340 mark each of their slots as volatile if the slot can be set before
1341 _longjmp and read afterwards.
1342 * lisp.h (struct handler): var and chosen_clause are now volatile.
1343 (struct catchtag): val, next, and pdlcount are now volatile.
1344
ae1d87e2
PE
1345 * bidi.c (bidi_push_it, bidi_pop_it):
1346 * fns.c (copy_hash_table):
1347 * image.c (define_image_type):
1348 * keyboard.c (kbd_buffer_store_event_hold):
1349 * process.c (Fprocess_send_eof):
1350 * xfaces.c (x_create_gc) [HAVE_NS]:
1351 * xgselect.c (xg_select):
1352 Prefer assignment to memcpy when either will do.
1353
5779a1dc
PE
1354 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1355 Use pointer-to-a-pointer to simplify and avoid a NILP check each
1356 time an item is removed. No need to mark this function 'inline';
1357 the compiler knows better than we do.
1358
c4c9756b
JD
13592012-09-11 Jan Djärv <jan.h.d@swipnet.se>
1360
1361 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1362 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1363 to change_frame_size (Bug#12388).
1364 (windowDidResize:): Pass YES to updateFrameSize.
1365
1366 * nsterm.h: Add delay parameter to updateFrameSize.
1367
d73e321c
DA
13682012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1369
1370 Discard killed buffers from deleted window and frame objects.
1371 This reduces an amount of references to killed buffers and
1372 helps GC to reclaim them faster.
1373 * alloc.c (discard_killed_buffers): New function.
1374 (mark_object): Use it for deleted windows and frames.
1375 (mark_object): If symbol's value is set up for a killed buffer
1376 or deleted frame, restore it's global binding.
1377 * data.c (swap_in_global_binding): Add GC notice.
1378 (swap_in_symval_forwarding): Use convenient set_blv_where.
1379 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1380 * window.h: ... to here.
1381
e578f381
DA
13822012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1383
1384 Convenient macro to check whether the buffer is live.
1385 * buffer.h (BUFFER_LIVE_P): New macro.
1386 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1387 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1388
3057e615
YM
13892012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1390
1391 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1392 composition cases (Bug#12364).
1393
1394 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1395 overhang of succeeding glyphs overlapping box cursor.
1396
1397 * w32term.c (x_draw_glyph_string): Likewise.
1398
6fda35f2
PE
13992012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1400
c990426a
PE
1401 Simplify, document, and port floating-point (Bug#12381).
1402 The porting part of this patch fixes bugs on non-IEEE platforms
1403 with frexp, ldexp, logb.
1404 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1405 Now static.
1406 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1407 support, by removing commented-out code and briefly listing the
1408 C89 functions excluded. The commented-out stuff was confusing
1409 maintenance, e.g., we thought we needed cbrt but it was commented out.
1410 (logb): Remove decl; no longer needed.
1411 (isfinite): New macro, if not already supplied.
1412 (isnan): Don't replace any existing macro.
1413 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1414 are present on all C89 platforms.
1415 (Ffrexp): Do not special-case zero, as frexp does the right thing
1416 for that case.
1417 (Flogb): Do not use logb, as it doesn't have the desired meaning
1418 on hosts that use non-base-2 floating point. Instead, stick with
1419 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1420 frexp, to avoid getting an unspecified result.
1421
6fda35f2
PE
1422 * xdisp.c (Qinhibit_debug_on_message): Now static.
1423
16130a58
JD
14242012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1425
1426 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1427 NSBezierPath (Bug#12131).
1428
d105a573
CY
14292012-09-10 Chong Yidong <cyd@gnu.org>
1430
1431 * fns.c (Fdelq, Fdelete): Doc fix.
1432
ff55dfe8
PE
14332012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1434
1435 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1436 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1437
e7032e7c
SM
14382012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1439
1440 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1441 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1442 Use it.
1443
e9957956
EZ
14442012-09-09 Eli Zaretskii <eliz@gnu.org>
1445
aba05ce9
EZ
1446 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1447 left fringe if the window has a left margin. This avoids leaving
1448 traces of the cursor because its leftmost pixel is not drawn over.
1449
e9957956
EZ
1450 * dispnew.c (update_window_line): When the left margin area of a
1451 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1452 that screen line. (Bug#12277)
1453
f6196b87
PE
14542012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1455
1456 Assume C89 or later for math functions (Bug#12381).
1457 This simplifies the code, and makes it a bit smaller and faster,
1458 and (most important) makes it easier to clean up signal handling
1459 since we can stop worring about floating-point exceptions in
1460 library code. That was a problem before C89, but the problem
1461 went away many years ago on all practical Emacs targets.
1462 * data.c, image.c, lread.c, print.c:
1463 Don't include <math.h>; no longer needed.
1464 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1465 might be autoconfigured, as that never happens.
1466 * data.c (fmod):
1467 * doprnt.c (DBL_MAX_10_EXP):
1468 * print.c (DBL_DIG):
1469 Remove. C89 or later always defines these.
1470 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1471 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1472 (arith_error, domain_error, domain_error2):
1473 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1474 no longer needed -- we simply return what C returns. All uses removed.
1475 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1476 the wrapped code.
1477 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1478 Remove. All uses expanded, as these macros are no longer used
1479 more than once and are now more trouble than they're worth.
1480 (Ftan): Use tan, not sin / cos.
1481 (Flogb): Assume C89 frexp.
1482 (fmod_float): Assume C89 fmod.
1483 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1484 (init_floatfns): Remove. All uses removed.
1485
9d7f1863
JD
14862012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1487
1488 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1489 compositeToPoint for OSX < 10.6 (Bug#12390).
1490
eabf0404
PE
14912012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1492
1493 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1494 This produces more-accurate results.
1495
0b3b1d23
JD
14962012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1497
1498 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1499 changes (Bug#12088).
1500
6dcef6ec
CY
15012012-09-08 Chong Yidong <cyd@gnu.org>
1502
1503 * syntax.c (Fstring_to_syntax): Doc fix.
1504
aa7d57c5
JD
15052012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1506
1507 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1508 in the internal border.
1509 (x_set_window_size): Remove static variables and their usage.
1510 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
1511 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1512 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
1513 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1514 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1515 (ns_fix_rect_ibw): Remove.
1516 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1517 (ns_dumpglyphs_box_or_relief): Ditto.
1518 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1519 adjustment.
1520 (ns_dumpglyphs_image): Ditto.
fc0c31f8 1521 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
1522 border adjustment.
1523 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1524 their usage. Add fringe_extended_p and its use as in other terms.
1525 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1526 scroll bar was removed.
1527 (updateFrameSize): New function.
1528 (windowDidResize): Move code to updateFrameSize and call it.
1529
1530 * nsterm.h (EmacsView): Add updateFrameSize.
1531
1a5432bc
CY
15322012-09-07 Chong Yidong <cyd@gnu.org>
1533
b4f5313e
CY
1534 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1535
1a5432bc
CY
1536 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1537
1a4f1e9b
PE
15382012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1539
1540 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
1541 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1542 Problem introduced when merging patches. Noted by Eli Zaretskii in
1543 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
1544 * floatfns.c: Comment fix.
1545 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1546 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1547 and anyway the declaration is harmless even if SIGDANGER is not defined.
1548 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1549 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1550 source files not surprisingly expected syssignal.h to define, or
1551 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1552 Include <sys/ioctl.h>, for FIONREAD.
1553 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1554 This eliminates a problem whereby other files mysteriously had
1555 to include "syssignal.h" before including "systty.h" if they
1556 wanted to use "#ifdef SIGIO".
1557
bc8000ff
EZ
15582012-09-07 Eli Zaretskii <eliz@gnu.org>
1559
3e6d6928
EZ
1560 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1561
1562 * w32.c (sigemptyset): Empty the set.
1563 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1564
bc8000ff
EZ
1565 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1566
b4fa72f2
DA
15672012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1568
1569 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1570 (mark_object): Likewise for frame objects.
1571
30730c93
PE
15722012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1573
1574 * syssignal.h (handle_on_main_thread): Always declare,
1575 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1576 This ports to platforms without HAVE_PTHREAD.
1577
2fe28299
PE
15782012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1579
1580 Signal-handler cleanup (Bug#12327).
1581 Emacs's signal handlers were written in the old 4.2BSD style with
1582 sigblock and sigmask and so forth, and this led to some
1583 inefficiencies and confusion. Rewrite these to use
1584 pthread_sigmask etc. without copying signal sets around. Also,
1585 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1586 'signal', and instead use functions that do not attempt to take
1587 over the system name space. This patch causes Emacs's text
1588 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1589 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1590 Do not include <signal.h> or "syssignal.h", as these
1591 modules do not use signals.
1592 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1593 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1594 Do not include <signal.h>, as "syssignal.h" does that for us now.
1595 * atimer.c (sigmask_atimers): New function.
1596 (block_atimers, unblock_atimers): New functions,
1597 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1598 All uses replaced.
1599 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1600 no longer needed here.
1601 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 1602 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
1603 * sysdep.c (struct save_signal): New member 'action', replacing
1604 old member 'handler'.
1605 (save_signal_handlers, restore_signal_handlers):
1606 Use sigaction instead of 'signal' to save and restore.
1607 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1608 New function. All users of 'signal' modified to use set_sighandler
1609 if they're writeonly, and to use sys_signal if they're read+write.
1610 (emacs_sigaction_init, forwarded_signal): New functions.
1611 (sys_signal): Remove. All uses replaced by calls to sigaction
1612 and emacs_sigaction_init, or by direct calls to 'signal'.
1613 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1614 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1615 all uses replaced by pthread_sigmask etc. calls.
1616 * syssignal.h: Include <signal.h>.
1617 (emacs_sigaction_init, forwarded_signal): New decls.
1618 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1619 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1620 (sigmask, sys_sigmask): Remove; no longer needed.
1621 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1622 (sigblock, sigunblock, sigfree):
1623 (sigsetmask) [!defined sigsetmask]:
1624 Remove. All uses replaced by pthread_sigmask.
1625 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1626 no longer need to be replaced, and its typical old uses
1627 are now done via emacs_sigaction_init and sigaction.
1628 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1629 (sys_sigdel): Remove; unused.
1630 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1631
0216c128
EZ
16322012-09-06 Eli Zaretskii <eliz@gnu.org>
1633
1634 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1635 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1636
c752cfa9
DA
16372012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1638
1639 Explicitly mark buffer_defaults and buffer_local_symbols.
1640 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1641 mark_local_symbols here.
1642 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1643 since special buffers aren't marked here any more.
1644 (allocate_buffer): Chain new buffer with all_buffers here...
1645 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1646 not here.
1647 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1648 (syms_of_buffer): Remove staticpro of the above.
1649 (init_buffer_once): Set names for buffer_defaults and
1650 buffer_local_symbols.
1651
a864ef14
PE
16522012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1653
1654 Use bool for booleans in font-related modules.
1655 * font.c (font_intern_prop, font_style_to_value)
1656 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1657 (generate_otf_features, font_check_otf_features, font_check_otf)
1658 (font_match_p, font_list_entities, font_at):
1659 * fontset.c (fontset_id_valid_p, reorder_font_vector
1660 (fontset_find_font, Fset_fontset_font)
1661 (face_suitable_for_char_p) [0]:
1662 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1663 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1664 (m17n_flt_initialized, ftfont_shape_by_flt):
1665 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1666 * nsfont.m (nsfont_draw):
1667 * w32font.c (w32font_draw):
1668 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1669 Use bool for booleans.
1670 * font.h: Adjust to above API changes.
1671 (struct font, struct font_driver, struct font_driver_list):
1672 Use bool for booleans.
1673 (struct font): Remove useless member encoding_type.
1674 All users removed.
1675 * fontset.c, xftfont.c: Omit unnecessary static decls.
1676
0699fc18
DA
16772012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1678
1679 * alloc.c (mark_object): Revert window marking code
1680 since it's unsafe for the Fset_window_configuration.
1681
20ef56db
PE
16822012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1683
2fe28299 1684 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
1685 Be more systematic about preserving errno whenever a signal
1686 handler returns, even if it's not in the main thread. Do this by
1687 renaming signal handlers to distinguish between signal delivery
1688 and signal handling. All uses changed.
1689 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1690 * data.c (deliver_arith_signal): Rename from arith_error.
1691 * dispnew.c (deliver_window_change_signal): Rename from
1692 window_change_signal.
1693 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1694 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1695 * keyboard.c (deliver_input_available_signal): Rename from
1696 input_available_signal.
1697 (deliver_user_signal): Rename from handle_user_signal.
1698 (deliver_interrupt_signal): Rename from interrupt_signal.
1699 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1700 (deliver_child_signal): Rename from sigchld_handler.
1701 * atimer.c (handle_alarm_signal):
1702 * data.c (handle_arith_signal):
1703 * dispnew.c (handle_window_change_signal):
1704 * emacs.c (handle_fatal_signal, handle_danger_signal):
1705 * keyboard.c (handle_input_available_signal):
1706 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1707 * process.c (handle_pipe_signal, handle_child_signal):
1708 New functions, with the actual signal-handling code taken from the
1709 original respective signal handlers, sans the sporadic attempts to
1710 preserve errno, since that's now done by handle_on_main_thread.
1711 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1712 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1713 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1714 Move to sysdep.c.
1715 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1716 Move initialization of main_thread to sysdep.c's init_signals.
1717 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1718 our usage, and simplifies the mainline code.
1719 (record_child_status_change): New static function, as a helper
1720 for handle_child_signal, and with most of the old child handler's
1721 contents.
1722 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1723 (handle_child_signal): Use the above.
1724 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1725 Moved here from emacs.c.
1726 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1727 code moved here from emacs.c's main function.
1728 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
1729 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
1730 This lets callers save and restore errno properly.
20ef56db 1731
e3ccf108
DA
17322012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1733
1734 Remove redundant or unused things here and there.
1735 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1736 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1737 * editfns.c (Fcompare_buffer_substrings): Likewise.
1738 * frame.h (struct terminal, struct font_driver_list):
1739 Remove redundant declarations.
1740 * window.h (Qleft, Qright): Likewise.
1741
697e1e39
DA
17422012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1743
1744 Do not mark objects from deleted buffers, windows and frames.
1745 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1746 (mark_object): Likewise for windows and frames.
1747
c1ca42ca
DA
17482012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1749
1750 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1751 buffer_defaults and buffer_local_symbols as valid objects.
1752 Return special value to denote them.
1753
014d93be
PE
17542012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1755
f75d7a91
PE
1756 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1757 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1758 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1759 (file_name_absolute_p, Fsubstitute_in_file_name):
1760 (check_executable, check_writable, Ffile_accessible_directory_p)
1761 (Fset_file_selinux_context, Fdefault_file_modes)
1762 (Finsert_file_contents, choose_write_coding_system)
1763 (Fwrite_region, build_annotations, a_write, e_write)
1764 (Fdo_auto_save):
1765 * filelock.c (boot_time_initialized, get_boot_time)
1766 (get_boot_time_1, lock_file_1, within_one_second):
1767 * floatfns.c (in_float):
1768 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1769 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1770 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1771 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1772 * window.c (compare_window_configurations):
1773 Use bool for booleans.
1774 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1775 (Fdefault_file_modes): Now mode_t, not int, for modes.
1776 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1777 (internal_delete_file): Now returns void, not a (boolean) int,
1778 since nobody was looking at the return value.
1779 * lisp.h, window.h: Adjust to above API changes.
1780
014d93be
PE
1781 * xdisp.c (set_message): Simplify and reindent last change.
1782
776f29e1
JB
17832012-09-05 Juanma Barranquero <lekktu@gmail.com>
1784
1785 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1786
7f7e0167
LI
17872012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1788
1789 * eval.c (call_debugger): Make the function non-static so that we
1790 can call it from set_message.
1791
1792 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1793 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1794
cf29dd84
PE
17952012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1796
1797 Give more-useful info on a fatal error (Bug#12328).
1798 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1799 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1800 of doing the work ourselves.
1801 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1802 do most of the work.
1803 (fatal_error_backtrace): New function, taken from the guts
1804 of the old fatal_error_signal, but with a new option to output
1805 a backtrace.
1806 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1807 info about the signal than just its number.
1808 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1809 * sysdep.c: Include <execinfo.h>
1810 (emacs_backtrace): New function, taken partly from the previous
1811 code of the 'die' function.
1812 (emacs_abort): Call fatal_error_backtrace rather than abort.
1813
972debf2
SM
18142012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1815
1816 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1817 eager (load-time) macro-expansion.
1818 * lisp.mk (lisp): Add macroexp.
1819
1088b922
PE
18202012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1821
1822 Simplify redefinition of 'abort' (Bug#12316).
1823 Do not try to redefine the 'abort' function. Instead, redo
1824 the code so that it calls 'emacs_abort' rather than 'abort'.
1825 This removes the need for the NO_ABORT configure-time macro
1826 and makes it easier to change the abort code to do a backtrace.
1827 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1828 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1829 Remove; sysdep.c's emacs_abort now takes its place.
1830 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1831 'abort' changed to use 'emacs_abort'.
1832 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1833 (abort) [!defined abort]: Rename to ...
1834 (emacs_abort): ... new name.
1835 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1836 the place of the old 'abort' in emacs.c.
1837 * w32.c, w32fns.c (abort): Do not #undef.
1838 * w32.c (emacs_abort): Rename from w32_abort.
1839
30934d33
EZ
18402012-09-04 Eli Zaretskii <eliz@gnu.org>
1841
1842 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1843 offsets[j].dv, since the y axis of the screen coordinates points
1844 down, while the y axis of the font definition coordinates points
1845 up. This fixes display of Arabic diacritics such as KASRA and
1846 KASRATAN. (Bug#11860)
1847
af26b72c
PE
18482012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1849
1850 Be more systematic about _setjmp vs setjmp.
1851 * alloc.c (test_setjmp, mark_stack):
1852 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1853 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1854 (png_load, my_error_exit, jpeg_load):
1855 * process.c (send_process_trap, send_process):
1856 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1857 The underscored versions are up to 30x faster on some hosts.
1858 Formerly, the code used setjmp+longjmp sometimes and
1859 _setjmp+_longjmp at other times, with no particular reason to
1860 prefer setjmp+longjmp.
1861
26d4541d
PE
18622012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1863
d42f4f0f 1864 Fix minor problem found by static checking.
26d4541d 1865 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 1866
c5e28e39
MR
18672012-09-03 Martin Rudalics <rudalics@gmx.at>
1868
1869 * buffer.c (Fdelete_all_overlays): New function.
1870
3eab3ca9
CY
18712012-09-03 Chong Yidong <cyd@gnu.org>
1872
1873 * gtkutil.c: Add extern decl for Qxft.
1874
c04889f8
PE
18752012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1876
1882aa38
PE
1877 * emacs.c, eval.c: Use bool for boolean.
1878 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1879 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1880 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1881 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1882 (main, decode_env_path, Fdaemon_initialized):
1883 * eval.c (call_debugger, Finteractive_p, interactive_p):
1884 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1885 (maybe_call_debugger, Fbacktrace):
1886 * process.c (read_process_output, exec_sentinel):
1887 Use bool for booleans.
1888 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1889 All callers changed.
1890 * eval.c (interactive_p): Omit always-true boolean argument
1891 EXCLUDE_SUBRS_P. All callers changed.
1892 * dispextern.h, lisp.h: Reflect above API changes.
1893 * firstfile.c (dummy): Use the address of 'main', whose signature
1894 won't change, instead of the address of 'initialize', whose
1895 signature just changed from int to bool.
1896 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1897 * msdos.c (fatal_error_in_progress): ... from here.
1898 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1899 of incrementing it.
1900 (redisplay_internal, unwind_redisplay): Simply clear
1901 REDISPLAYING_P when unwinding, instead of saving its previous,
1902 always-false value and then restoring it.
1903
a411ac43
PE
1904 Clean up some extern decls.
1905 Mostly, this hoists extern decls out of .c files and into .h files.
1906 That way, we're more likely to catch errors if the interfaces change.
1907 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1908 declare xg_mark_data.
1909 * dispextern.h (x_frame_parm_handlers):
1910 * font.h (Qxft):
1911 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1912 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1913 (Qultra_bold, Qoblique, Qitalic):
1914 Move extern decl here from .c file.
1915 * alloc.c (xg_mark_data) [USE_GTK]:
1916 * doc.c (Qclosure):
1917 * eval.c (Qlexical_binding):
1918 * fns.c (time) [!HAVE_UNISTD_H]:
1919 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1920 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1921 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1922 * lread.c (Qinternal_interpreter_environment):
1923 * minibuf.c (Qbuffer):
1924 * process.c (QCfamily, QCfilter):
1925 * widget.c (free_frame_faces):
1926 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1927 * xfont.c (x_clear_errors):
1928 * xterm.c (x_frame_parm_handlers):
1929 Remove now-redundant extern decls.
1930 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1931 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1932 Now static.
1933 * xfaces.c: Remove unnecessary static decls.
1934 * xterm.c (updating_frame): Remove decl of nonexistent object.
1935
c04889f8
PE
1936 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1937 when building globals.h, as the objects that are not built on
1938 this host are not needed to compile C files on this host.
1939
8b339673
JD
19402012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1941
1942 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1943
1944 * frame.h: Add missing prototype for x_wm_set_size_hint.
1945
a08d4ba7
PE
19462012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1947
1948 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1949 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1950 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1951 (Fsubstitute_command_keys):
1952 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1953 (save_excursion_save, save_excursion_restore)
1954 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1955 (format_time_string, general_insert_function)
1956 (make_buffer_string, make_buffer_string_both)
1957 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1958 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1959 (copy_text, insert_1, insert_1_both, insert_from_string)
1960 (insert_from_string_before_markers, insert_from_string_1)
1961 (insert_from_buffer, insert_from_buffer_1, replace_range)
1962 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1963 (del_range_2, modify_region):
1964 * intervals.c (intervals_equal, balance_possible_root_interval)
1965 (adjust_intervals_for_insertion, merge_properties_sticky)
1966 (graft_intervals_into_buffer, lookup_char_property)
1967 (adjust_for_invis_intang, set_point_both)
1968 (get_property_and_range, compare_string_intervals)
1969 (set_intervals_multibyte_1, set_intervals_multibyte):
1970 * keyboard.c (decode_timer):
1971 Use bool for boolean.
1972 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1973 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1974
48c948de
CY
19752012-09-02 Chong Yidong <cyd@gnu.org>
1976
1977 * keymap.c (push_key_description): Print M-TAB as C-M-i
1978 (Bug#11758).
1979
6c49a40b
JB
19802012-09-02 Juanma Barranquero <lekktu@gmail.com>
1981
1982 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1983 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1984 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1985 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1986 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1987 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1988 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1989
4dfbd238
EZ
19902012-09-01 Eli Zaretskii <eliz@gnu.org>
1991
7e510e28
EZ
1992 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1993 more than one grapheme cluster passed to the shaper: compute the
1994 offset adjustment values separately for each cluster. (Bug#11860)
1995
4dfbd238
EZ
1996 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1997 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1998 about implicit conversions from integer to pointer.
1999
86571ae0
DC
20002012-09-01 Daniel Colascione <dancol@dancol.org>
2001
2002 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2003 system used too early.
2004
0e23ef9d
PE
20052012-09-01 Paul Eggert <eggert@cs.ucla.edu>
2006
2007 Better seed support for (random).
2008 * emacs.c (main): Call init_random.
2009 * fns.c (Frandom): Set the seed from a string argument, if given.
2010 Remove long-obsolete Gentzel cruft.
2011 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
2012 (init_random): New function.
2013
17a2cbbd
DC
20142012-09-01 Daniel Colascione <dancol@dancol.org>
2015
2016 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
2017 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
2018 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
2019 x_wm_set_size_hint, x_query_colors, x_real_positions,
2020 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
2021 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
2022 all of which have been moved to common code.
2023
2024 * xfaces.c: Include TERM_HEADER instead of listing all possible
2025 window-system headers.
2026
2027 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2028 to match header.
2029
2030 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2031 directly accessing frame internals.
2032
f18cbb28 2033 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
2034 globals_of_w32font.
2035
2036 * process.c: Include TERM_HEADER instead of listing all possible
2037 window-system headers.
2038
3a880af4
SM
2039 * nsterm.h: Remove declarations now in frame.h.
2040 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
2041
2042 * menu.c: Include TERM_HEADER instead of listing all possible
2043 window-system headers.
2044
2045 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2046 window system.
2047
2048 * keyboard.c: Include TERM_HEADER instead of listing all possible
2049 window-system headers.
2050
2051 * image.c: Include TERM_HEADER instead of listing all possible
2052 window-system headers. Declare Vlibrary_cache when compiling for
2053 Windows.
2054
2055 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2056 window system declarations.
2057
2058 * frame.h: Move common functions here: set_frame_menubar,
2059 x_set_window_size, x_sync, x_get_focus_frame,
2060 x_set_mouse_position, x_set_mouse_pixel_position,
2061 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
2062 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
2063 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
2064 x_activate_menubar, x_real_positions, x_bitmap_icon,
2065 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
2066 and x_query_colors.
2067
2068 * frame.c: Include TERM_HEADER instead of listing all possible
2069 window-system headers.
2070
2071 * font.c: Include TERM_HEADER instead of listing all possible
2072 window-system headers.
2073
2074 * emacs.c: Include TERM_HEADER.
2075
f18cbb28
EZ
2076 * dispnew.c: Include TERM_HEADER instead of listing all possible
2077 window-system headers.
17a2cbbd 2078
f18cbb28 2079 * ccl.h: Include character.h.
17a2cbbd
DC
2080
2081 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2082 the current window system; include in list of objects to link into
2083 Emacs.
2084
c650a5de
DA
20852012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2086
2087 Remove mark_ttys function and fix tty_display_info initialization.
2088 * lisp.h (mark_ttys): Remove prototype.
2089 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2090 to mark_ttys because all possible values of 'top_frame' slot are
2091 the frames which are reachable from Vframe_list.
2092 * term.c (mark_ttys): Remove.
2093 (init_tty): Safely initialize 'top_frame' slot with Qnil.
2094
4e0f6479
DA
20952012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2096
2097 Change struct frame bitfields from unsigned char to unsigned.
2098 * frame.h (struct frame): Change type of 'display_preempted',
2099 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2100 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2101 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2102 bitfields from unsigned char to unsigned.
2103
8b96a52c
DA
21042012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2105
2106 Remove unused member of struct x_output and struct w32_output.
2107 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2108 * w32term.h (struct w32_output): Likewise.
2109
b4444c8a
JD
21102012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2111
2112 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2113 does not become zero (Bug#12234).
2114
b98521db
PE
21152012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2116
2117 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2118 for GCC 4.7.1 x86-64.
2119
31d02438
GM
21202012-08-30 Glenn Morris <rgm@gnu.org>
2121
2122 * lread.c (init_lread): For out-of-tree builds, only add the
2123 source directory's site-lisp dir to the load-path if it exists,
2124 consistent with in-tree builds. (Bug#12302)
2125
7f8941d8
JD
21262012-08-28 Jan Djärv <jan.h.d@swipnet.se>
2127
2128 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 2129 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
2130 (windowShouldClose:): Set window_closed.
2131 (dealloc): New member, free button_values.
fc0c31f8
JB
2132 (process_dialog:): Make member function. Remove window argument,
2133 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
2134 in button_values.
2135 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 2136 with tag. Remove return self, declare return value as void.
7f8941d8
JD
2137 (addString:row:): Remove return self, declare return value as void.
2138 (addSplit): Remove return self, declare return value as void.
2139 (clicked:): Remove return self, declare return value as void.
fc0c31f8 2140 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
2141 (initFromContents:isQuestion:): Adjust call to process_dialog.
2142 Code formatting change.
2143 (timeout_handler:): Set timer_fired to YES.
2144 (runDialogAt:): Set timer_fired to NO.
2145 Handle click on close button as quit.
2146
2147 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
2148 Add window_closed and button_values. Add void as return value for
2149 add(Button|String|Split). addButton takes int instead of Lisp_Object.
2150 Add process_dialog as new member.
2151
eada0861 21522012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 2153
eada0861
GM
2154 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
2155 is not one of the heaps we manage. (Bug#12242)
2156
21572012-08-28 Glenn Morris <rgm@gnu.org>
2158
2159 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
2160
457294dd
MR
21612012-08-28 Martin Rudalics <rudalics@gmx.at>
2162
2163 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
2164 auto-buffer-name window parameter. Install revision of reverted
2165 fix.
457294dd 2166
4f2daf31
DA
21672012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2168
2169 Do not allow to set major mode for a dead buffer.
2170 * buffer.c (Fset_buffer_major_mode): Signal an error
2171 if the buffer is dead.
2172 (Fother_buffer, other_buffer_safely): Remove redundant
2173 nested declaration.
2174
66322887
DA
21752012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2176
2177 Always use set_buffer_if_live to restore original buffer at unwind.
2178 * buffer.h (record_unwind_current_buffer): New function.
2179 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
2180 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
2181 * undo.c, window.c: Adjust users.
2182 * buffer.c (set_buffer_if_live): Fix comment.
2183
a3d794a1
DA
21842012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2185
2186 Fix usage of set_buffer_internal.
2187 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
2188 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
2189 * coding.c (decode_coding): Omit redundant test.
2190 * fileio.c (decide_coding_unwind): Likewise.
2191 * fns.c (secure_hash): Likewise.
2192 * insdel.c (modify_region): Likewise.
2193 * keyboard.c (command_loop_1): Likewise.
2194 * print.c (PRINTFINISH): Likewise.
2195 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
2196
59ea14cd
PE
21972012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2198
2199 * dispnew.c: Use bool for boolean.
2200 (frame_garbaged, display_completed, delayed_size_change)
2201 (fonts_changed_p, add_window_display_history)
2202 (add_frame_display_history, verify_row_hash)
2203 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
2204 (row_equal_p, realloc_glyph_pool)
2205 (allocate_matrices_for_frame_redisplay)
2206 (showing_window_margins_p)
2207 (adjust_frame_glyphs_for_frame_redisplay)
2208 (build_frame_matrix_from_leaf_window, make_current)
2209 (mirrored_line_dance, mirror_line_dance, update_frame)
2210 (update_window_tree, update_single_window)
2211 (check_current_matrix_flags, update_window, update_text_area)
2212 (update_window_line, set_window_update_flags, scrolling_window)
2213 (update_frame_1, scrolling, buffer_posn_from_coords)
2214 (do_pending_window_change, change_frame_size)
2215 (change_frame_size_1, sit_for):
2216 Use bool for boolean.
2217 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2218 and remove last int (actually boolean) argument, which was always 0.
2219 All callers changed.
2220 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2221 * dispextern.h (struct composition_it): Use bool for boolean.
2222 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2223 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2224 * dired.c (file_name_completion):
2225 Use bool for boolean. (This was missed in an earlier change.)
2226
95072a94
MR
22272012-08-27 Martin Rudalics <rudalics@gmx.at>
2228
2229 * window.c (Fset_window_configuration): Revert first part of
2230 last change.
2231
0f19feff
JD
22322012-08-27 Jan Djärv <jan.h.d@swipnet.se>
2233
2234 * nsterm.h (NSPanel): New class variable dialog_return.
2235
3a880af4
SM
2236 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2237 Initialize dialog_return.
0f19feff
JD
2238 (windowShouldClose:): Use stop instead of stopModalWithCode.
2239 (clicked:): Ditto, and also set dialog_return (Bug#12258).
2240 (timeout_handler:): Use stop instead of abortModal. Send a dummy
2241 event.
2242 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
2243 modal loop returns.
2244
f10fe38f
PE
22452012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2246
de1339b0
PE
2247 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2248 * composite.c (find_composition, composition_gstring_p)
2249 (composition_reseat_it, find_automatic_composition):
2250 * data.c (let_shadows_buffer_binding_p)
2251 (let_shadows_global_binding_p, set_internal, make_blv)
2252 (Fmake_variable_buffer_local, Fmake_local_variable)
2253 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2254 (cons_to_signed, arith_driver):
2255 * dbusbind.c (xd_in_read_queued_messages):
2256 * dired.c (directory_files_internal, file_name_completion):
2257 Use bool for booleans.
2258 * dired.c (file_name_completion):
2259 * process.h (fd_callback):
2260 Omit int (actually boolean) argument. It wasn't being used.
2261 All uses changed.
2262 * composite.h, lisp.h: Reflect above API changes.
2263
f10fe38f
PE
2264 * cmds.c, coding.c: Use bool for booleans.
2265 * cmds.c (move_point, Fself_insert_command):
2266 * coding.h (struct composition status, struct coding_system):
2267 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2268 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2269 (emacs_mule_char, decode_coding_emacs_mule)
2270 (encode_coding_emacs_mule, detect_coding_iso_2022)
2271 (decode_coding_iso_2022, encode_invocation_designation)
2272 (encode_designation_at_bol, encode_coding_iso_2022)
2273 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2274 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2275 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2276 (encode_coding_raw_text, detect_coding_charset)
2277 (decode_coding_charset, encode_coding_charset, detect_eol)
2278 (detect_coding, get_translation_table, produce_chars)
2279 (consume_chars, reused_workbuf_in_use)
2280 (make_conversion_work_buffer, code_conversion_save)
2281 (decode_coding_object, encode_coding_object)
2282 (detect_coding_system, char_encodable_p)
2283 (Funencodable_char_position, code_convert_region)
2284 (code_convert_string, code_convert_string_norecord)
2285 (Fset_coding_system_priority):
2286 * fileio.c (Finsert_file_contents):
2287 Use bool for booleans.
2288 * coding.h, lisp.h: Reflect above API changes.
2289 * coding.c: Remove unnecessary static function decls.
2290 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2291 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2292 not a boolean 'int', since callers never look at the return value.
2293 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2294 * coding.h (decoding_buffer_size, encoding_buffer_size)
2295 (emacs_mule_string_char): Remove unused extern decls.
2296 (struct iso_2022_spec, struct coding_system):
2297 Use 'unsigned int : 1' for boolean fields, since there's more than one.
2298 (struct emacs_mule_spec): Remove unused field 'full_support'.
2299 All initializations removed.
2300 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2301
5474c384
DA
23022012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2303
f10fe38f 2304 Fix spare memory change (Bug#12286).
5474c384
DA
2305 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
2306 (valid_lisp_object_p): Likewise.
2307
c4b6914d
MR
23082012-08-27 Martin Rudalics <rudalics@gmx.at>
2309
2310 * window.c (Fset_window_configuration): Record any window's old
2311 buffer if it's replaced (see Bug#8789). If the new current
2312 buffer doesn't appear in the selected window, go to its old
2313 point (Bug#12208).
2314
35aaa1ea
DA
23152012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2316
2317 Special MEM_TYPE_SPARE to denote reserved memory.
2318 * alloc.c (enum mem_type): New memory type.
2319 (refill_memory_reserve): Use new type for spare memory.
2320 This prevents live_cons_p and live_string_p from incorrect
2321 detection of uninitialized objects from spare memory as live.
2322
6af64513
PE
23232012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2324
8b2e00a3
PE
2325 Spelling fixes.
2326 * Makefile.in (.PHONY): versioclean -> versionclean.
2327
b52d6985
PE
2328 Remove unused external symbols.
2329 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2330 * window.c (Qwindow_valid_p, decode_valid_window):
2331 Now static, not extern.
2332 * data.c (Qinterval): Remove; unused.
2333 (syms_of_data): Do not define 'interval'.
2334 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2335 * window.h (decode_valid_window):
2336 Remove decls.
2337
d5172d4f
PE
2338 * character.c, charset.c, chartab.c: Use bool for booleans.
2339 * character.c (lisp_string_width, string_count_byte8)
2340 (string_escape_byte8):
2341 * charset.c (charset_map_loaded, load_charset_map, read_hex):
2342 (load_charset_map_from_file, map_charset_chars)
2343 (Fdefine_charset_internal, define_charset_internal)
2344 (Fdeclare_equiv_charset, find_charsets_in_text)
2345 (Ffind_charset_region, char_charset, Fiso_charset):
2346 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2347 (sub_char_table_set, sub_char_table_set_range)
2348 (char_table_set_range, optimize_sub_char_table)
2349 (map_sub_char_table):
2350 Use bool for boolean.
2351 * character.c (str_to_unibyte): Omit last boolean argument; it was
2352 always 0. All callers changed.
2353 * character.h, charset.h: Adjust to match previous changes.
2354 * character.h (char_printable_p): Remove decl of nonexistent function.
2355 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2356 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2357 are all boolean, so make them single-bit bitfields.
2358
6af64513
PE
2359 * lisp.h (ASET): Remove attempt to detect side effects.
2360 It was meant to be temporary and it often doesn't work,
2361 because when IDX has side effects the behavior of IDX==IDX
2362 is undefined. See Stefan Monnier in
2363 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2364
e1f29348
BR
23652012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2366
2367 * lisp.h (functionp): New function (extracted from Ffunctionp).
2368 (FUNCTIONP): Use it.
2369 * eval.c (Ffunctionp): Use it.
2370
17c05d74
PE
23712012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2372
0f46bc75
PE
2373 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2374 as that's faster and simpler than static storage. Don't bother
2375 with the g_main_context_query overhead if g_main_context_pending
2376 says no events are pending.
2377 (gfds, gfds_size): Remove these static vars.
2378 (xgselect_initialize): Remove; no longer needed.
2379 All uses and decls removed.
2380
ee4c0f69
PE
2381 * emacs.c (fatal_error_signal_hook): Remove.
2382 All uses removed. This leftover from old code was always 0.
2383
17c05d74
PE
2384 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2385 * casefiddle.c (casify_object, casify_region):
2386 * casetab.c (set_case_table):
2387 * category.c, category.h (word_boundary_p):
2388 * category.h (CHAR_HAS_CATEGORY):
2389 Use bool for booleans, instead of int.
2390
391ceac5
EZ
23912012-08-25 Eli Zaretskii <eliz@gnu.org>
2392
2393 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2394
2f221583
PE
23952012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2396
f4a681b0
PE
2397 On assertion failure, print backtrace if available.
2398 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2399 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2400 * Makefile.in (LIB_EXECINFO): New macro.
2401 (LIBES): Use it.
2402
2f221583
PE
2403 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2404 * bytecode.c (exec_byte_code):
2405 * callint.c (check_mark, Fcall_interactively):
2406 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2407 (getenv_internal, sync_process_alive, call_process_exited):
2408 * lisp.h (USE_SAFE_ALLOCA):
2409 Use bool for booleans, instead of int.
2410 * lisp.h, process.h: Adjust prototypes to match above changes.
2411 * callint.c (Fcall_interactively): Don't assume the mark's
2412 offset fits in 'int'.
2413
37ef52bb
PE
24142012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2415
2416 * buffer.c, buffer.h: Use bool for boolean.
2417 * buffer.c (reset_buffer_local_variables)
2418 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2419 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2420 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2421 (overlay_touches_p, overlay_strings, Foverlay_put)
2422 (report_overlay_modification, call_overlay_mod_hooks):
2423 (mmap_enlarge, mmap_set_vars):
2424 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2425 Use bool for booleans, instead of int.
2426 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2427 since the 1-or-0 return value is always ignored anyway.
2428 (mmap_initialized_p):
2429 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2430 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2431
2cc21167
PE
24322012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2433
2434 * bidi.c: Use bool for boolean.
2435 This is a bit more readable, and makes the text segment of bidi.o
2436 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2437 Presumably it's faster too.
2438 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2439 Now bool.
2440 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2441 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2442 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2443 (bidi_explicit_dir_char, bidi_level_of_next_char)
2444 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2445 Use bool for booleans, instead of int.
2446 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2447 (bidi_unshelve_cache): Adjust decls to match code.
2448
7db4ddf4
MR
24492012-08-23 Martin Rudalics <rudalics@gmx.at>
2450
2451 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2452 argument.
2453
b1bb8011
PE
24542012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2455
2456 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2457 * atimer.h: Include <stdbool.h>.
2458
ff687885
DN
24592012-08-22 Dan Nicolaescu <dann@gnu.org>
2460
2461 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2462 compile time tests instead of run time tests on systems that do
2463 not use them.
2464 (FRAME_MAC_P): Remove leftover from deleted code.
2465 * frame.c (syms_of_frame): Remove leftover from deleted code.
2466
4ce7a138
JD
24672012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2468
2469 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2470
d733ec6d
PE
24712012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2472
2473 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2474 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 2475 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
2476 (fontset_add): Return void, for FONTSET_ADD.
2477
d0d2d26f
PE
24782012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2479
fce31d69
PE
2480 * alloc.c: Use bool for booleans.
2481 (gc_in_progress, abort_on_gc)
2482 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2483 (dont_register_blocks) [GC_MALLOC_CHECK]:
2484 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2485 (check_string_bytes, make_specified_string, memory_full)
2486 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2487 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2488 (mark_stack, valid_pointer_p, make_pure_string)
2489 (Fgarbage_collect, survives_gc_p, gc_sweep):
2490 Use bool for booleans, instead of int.
2491 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2492 Remove unused local.
2493 * alloc.c (PURE_POINTER_P):
2494 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2495 * editfns.c (Fformat):
2496 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2497 (Fdo_auto_save):
2498 * fns.c (sweep_weak_table):
2499 * lisp.h (suppress_checking, push_message, survives_gc_p)
2500 (make_pure_string, gc_in_progress, abort_on_gc):
2501 * lread.c (readchar, read1):
2502 * print.c (Fprin1_to_string):
2503 * xdisp.c (push_message):
2504 Use bool for booleans affected directly or indirectly by
2505 alloc.c's changes.
2506
d0d2d26f
PE
2507 Make recently-introduced setters macros.
2508 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2509 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2510 (set_fontset_default, set_fontset_fallback): Rename from their
2511 upper-case counterparts, and make them functions rather than macros.
2512 This is more consistent with the other recently-introduced setters.
2513 These don't need to be inline, since they're local.
2514
d18e2bb6
JD
25152012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2516
2517 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2518 the loop (Bug#12247).
2519
1b9d9d16
PE
25202012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2521
2522 * lisp.h (vcopy): Use memcpy rather than our own loop.
2523 This fixes a performance regression introduced by the recent
2524 addition of vcopy. This means 'vcopy' will need to be modified
2525 for a copying collector, but that's OK. Also, tighten the
2526 checking in the assertion.
2527
b2f09701
EZ
25282012-08-21 Eli Zaretskii <eliz@gnu.org>
2529
2530 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2531 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2532 non-base glyph for the width of the base character, according to
e1f29348
BR
2533 what x_draw_composite_glyph_string_foreground expects.
2534 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
2535 expectations, to produce correct width of the composed character.
2536 Reverse the sign of the DU offset produced by ScriptPlace.
2537
9b994fed
PE
25382012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2539
2540 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2541
086ca913
DA
25422012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2543
2544 Avoid direct writes to contents member of struct Lisp_Vector.
2545 * lisp.h (vcopy): New function to copy data into vector.
2546 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2547 * fns.c (Ffillarray): Use ASET.
2548 * keyboard.c (timer_check_2): Use AREF and ASET.
2549 (append_tool_bar_item, Frecent_keys): Use vcopy.
2550 * lread.c (read_vector): Use ASET.
2551 * msdos.c (Frecent_doskeys): Use vcopy.
2552 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2553 (Finternal_merge_in_global_face): Use ASET and vcopy.
2554 * xfont.c (xfont_list_pattern): Likewise.
2555
5481664a
MR
25562012-08-21 Martin Rudalics <rudalics@gmx.at>
2557
2558 * window.c (Fwindow_point): For the selected window always return
2559 the position of its buffer's point.
2560 (Fset_window_point): For the selected window always go in its
2561 buffer to the specified position.
2562
6d470bdd
DA
25632012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2564
2565 Setter macros for fontsets.
2566 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2567 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2568 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2569 Adjust users.
2570
24564fe1
GM
25712012-08-20 Glenn Morris <rgm@gnu.org>
2572
2573 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2574 Don't assume that `ln -f' works.
2575
0a05a035
EZ
25762012-08-20 Eli Zaretskii <eliz@gnu.org>
2577
2578 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2579 and later about non-assignments with no effect. See discussion at
2580 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2581 details.
2582
e46f2325
DA
25832012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2584
2585 Inline setter functions for Lisp_Objects slots of struct specbinding.
2586 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2587 Adjust users.
2588
734fbd86
MR
25892012-08-20 Martin Rudalics <rudalics@gmx.at>
2590
2591 * window.c (select_window): Always make selected window's buffer
2592 current.
2593
f1a95992
DA
25942012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2595
2596 Use AREF and ASET for docstrings of category tables.
2597 * category.h (CATEGORY_DOCSTRING): Use AREF.
2598 (SET_CATEGORY_DOCSTRING): Use ASET.
2599 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2600
e83064be
DA
26012012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2602
2603 Inline setter functions for hash table members.
2604 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2605 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2606 (set_hash_key_and_value, set_hash_index, set_hash_next)
2607 (set_hash_hash): New functions.
2608 * charset.c, fns.c: Adjust users.
2609
4ce60d2e
DA
26102012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2611
2612 Inline getter and setter functions for per-buffer values.
2613 * buffer.h (per_buffer_default, set_per_buffer_default)
2614 (per_buffer_value, set_per_buffer_value): New functions.
2615 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2616 * buffer.c, data.c: Adjust users.
2617
c06c9690
JB
26182012-08-20 Juanma Barranquero <lekktu@gmail.com>
2619
2620 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2621
32bd4250
PE
26222012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2623
bad03192 2624 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
2625 as gnulib does this if the system doesn't.
2626 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
2627 Remove declaration. MS-Windows declares it on stdlib.h which is
2628 included by conf_post.h.
b69a6d22
PE
2629 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2630 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2631 * vm-limit.c: Include <unistd.h>, for 'environ'.
2632
22d7feb2
PE
2633 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2634 (start_of_data): Remove decl; mem-limits.h provides it.
2635
32bd4250
PE
2636 * xdisp.c (handle_invisible_prop): Make it a bit faster
2637 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2638
450809af
CY
26392012-08-19 Chong Yidong <cyd@gnu.org>
2640
2641 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2642 ends (Bug#3874).
2643
9e677988
AS
26442012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2645
6b1319ce
AS
2646 * .gdbinit: Use call instead of set when calling a function in the
2647 inferior.
2648
9e677988
AS
2649 * data.c (set_internal): Don't use set_blv_found.
2650 (Fkill_local_variable): Likewise.
2651
d7191076
AA
26522012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2653
2654 * nsfont.m (ns_ascii_average_width): Ensure the string
2655 ascii_printable is initialized with a null-terminated character
2656 array. Otherwise, it can contain undesired extra characters.
2657
e757f1c6
PE
26582012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2659
2660 port new setting code to Sun C 5.8 2005/10/13
2661 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2662 Return void, not Lisp_Object. Otherwise, the compiler
2663 complains about (A?B:C) where B is void and C is Lisp_Object
2664 when compiling CHAR_TABLE_SET, due to the recent change to
2665 the API of sub_char_table_set_contents.
2666
a999ce26
CY
26672012-08-18 Chong Yidong <cyd@gnu.org>
2668
2669 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2670 for the string case (Bug#3874).
2671
3f22b86f
PE
26722012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2673
39eb03f1
PE
2674 * buffer.h (BSET): Remove (Bug#12215).
2675 Replace all uses with calls to new setter functions.
2676 (bset_bidi_paragraph_direction, bset_case_canon_table)
2677 (bset_case_eqv_table, bset_directory, bset_display_count)
2678 (bset_display_time, bset_downcase_table)
2679 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2680 (bset_last_selected_window, bset_local_var_alist)
2681 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2682 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2683 (bset_width_table):
2684 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2685 (bset_auto_fill_function, bset_auto_save_file_format)
2686 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2687 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2688 (bset_cache_long_line_scans, bset_case_fold_search)
2689 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2690 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2691 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2692 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2693 (bset_header_line_format, bset_indicate_buffer_boundaries)
2694 (bset_indicate_empty_lines, bset_invisibility_spec)
2695 (bset_left_fringe_width, bset_major_mode, bset_mark)
2696 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2697 (bset_name, bset_overwrite_mode, bset_pt_marker)
2698 (bset_right_fringe_width, bset_save_length)
2699 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2700 (bset_scroll_up_aggressively, bset_selective_display)
2701 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2702 (bset_word_wrap, bset_zv_marker):
2703 * category.c (bset_category_table):
2704 * syntax.c (bset_syntax_table):
2705 New setter functions.
2706
6a09a33b
PE
2707 * process.h (PSET): Remove (Bug#12215).
2708 Replace all uses with calls to new setter functions.
2709 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2710 (PROCESS_INLINE): New macro.
2711 (pset_childp): New setter function.
2712 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2713 * process.c (PROCESS_INLINE):
2714 Define to EXTERN_INLINE, so that the corresponding functions
2715 are compiled into code.
2716 (pset_buffer, pset_command, pset_decode_coding_system)
2717 (pset_decoding_buf, pset_encode_coding_system)
2718 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2719 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2720 (pset_type, pset_write_queue): New setter functions.
2721
e8c17b81
PE
2722 * window.h (WSET): Remove (Bug#12215).
2723 Replace all uses with calls to new setter functions.
2724 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2725 (WINDOW_INLINE): New macro.
2726 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2727 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2728 (wset_total_lines, wset_vertical_scroll_bar)
2729 (wset_window_end_pos, wset_window_end_valid)
2730 (wset_window_end_vpos): New setter functions.
2731 * window.c (WINDOW_INLINE):
2732 Define to EXTERN_INLINE, so that the corresponding functions
2733 are compiled into code.
2734 (wset_combination_limit, wset_dedicated, wset_display_table)
2735 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2736 (wset_new_normal, wset_new_total, wset_next_buffers)
2737 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2738 (wset_prev_buffers, wset_right_fringe_width)
2739 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2740 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2741 (wset_window_parameters):
2742 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2743 (wset_column_number_displayed, wset_region_showing):
2744 New setter functions.
2745
3f22b86f
PE
2746 * termhooks.h (TSET): Remove (Bug#12215).
2747 Replace all uses with calls to new setter functions.
2748 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2749 (TERMHOOKS_INLINE): New macro.
2750 (tset_charset_list, tset_selection_alist): New setter functions.
2751 * terminal.c (TERMHOOKS_INLINE):
2752 Define to EXTERN_INLINE, so that the corresponding functions
2753 are compiled into code.
2754 (tset_param_alist): New setter function.
2755
742af32f
PE
27562012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2757
15dbb4d6
PE
2758 * keyboard.h (KSET): Remove (Bug#12215).
2759 Replace all uses with calls to new setter functions.
2760 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2761 (KEYBOARD_INLINE): New macro.
2762 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2763 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2764 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2765 New setter functions.
2766 * keyboard.c (KEYBOARD_INLINE):
2767 Define to EXTERN_INLINE, so that the corresponding functions
2768 are compiled into code.
2769 (kset_echo_string, kset_kbd_queue)
2770 (kset_keyboard_translate_table, kset_last_prefix_arg)
2771 (kset_last_repeatable_command, kset_local_function_key_map)
2772 (kset_overriding_terminal_local_map, kset_real_last_command)
2773 (kset_system_key_syms): New setter functions.
2774
f00af5b1
PE
2775 * frame.h (FSET): Remove (Bug#12215).
2776 Replace all uses with calls to new setter functions.
2777 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2778 (FRAME_INLINE): New macro.
2779 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2780 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2781 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2782 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2783 (fset_param_alist, fset_root_window, fset_scroll_bars)
2784 (fset_selected_window, fset_title, fset_tool_bar_items)
2785 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2786 * frame.c (FRAME_INLINE):
2787 Define to EXTERN_INLINE, so that the corresponding functions
2788 are compiled into code.
2789 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2790
0c94c8d6
PE
2791 A few more naming-convention fixes for getters and setters.
2792 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2793 and rename from buffer_overlays_set_before.
2794 (set_buffer_overlays_after): Move here from buffer.h, and rename
2795 from buffer_overlays_set_after.
2796 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2797 All uses changed.
2798 (set_buffer_intervals): Rename from buffer_set_intervals.
2799 * intervals.c (set_interval_object): Move here from intervals.h,
2800 and rename from interval_set_object.
2801 (set_interval_left): Move here from intervals.h, and rename from
2802 interval_set_left.
2803 (set_interval_right): Move here from intervals.h, and rename from
2804 interval_set_right.
2805 (copy_interval_parent): Move here from intervals.h, and rename from
2806 interval_copy_parent.
2807 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2808 (set_interval_plist): Rename from interval_set_plist.
2809 Return void, not Lisp_Object, since no caller uses the result.
2810 * lisp.h (string_intervals): Rename from string_get_intervals.
2811 (set_string_intervals): Rename from string_set_intervals.
2812
34dabdb7
PE
2813 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2814 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 2815 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
2816 All uses changed. See the end of
2817 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2818
742af32f
PE
2819 * lisp.h (CSET): Remove (Bug#12215).
2820 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2821 (set_char_table_purpose): New functions,
2822 replacing CSET. All uses changed. For example, replace
2823 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 2824 "set_char_table_parent (char_table, parent);".
742af32f
PE
2825 The old version was confusing because it used the same name
2826 'parent' for two different things.
2827
a04e2c62
DA
28282012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2829
2830 Functions to get and set Lisp_Object fields of buffer-local variables.
2831 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2832 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2833 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2834 * data.c, eval.c, frame.c: Adjust users.
2835
383dcbf9
CY
28362012-08-17 Chong Yidong <cyd@gnu.org>
2837
2838 * xfaces.c (merge_face_vectors): If the target font specfies a
2839 font spec, make the font's attributes take precedence over
2840 directly-specified attributes.
2841 (merge_face_ref): Recognize :font.
2842
44386687
DA
28432012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2844
2845 Do not use memcpy for copying intervals.
2846 * intervals.c (reproduce_interval): New function.
2847 (reproduce_tree, reproduce_tree_obj): Use it.
2848 (reproduce_tree_obj): Remove prototype.
2849
927c7216
PE
28502012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2851
2852 * lisp.h (duration_to_sec_usec): Remove unused decl.
2853
93044f7b
AA
28542012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2855
2856 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2857 to an allocated instance of NSString, not to the class itself.
2858
9851e4a5
JB
28592012-08-17 Juanma Barranquero <lekktu@gmail.com>
2860
2861 * makefile.w32-in (C_CTYPE_H): New macro.
2862 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2863 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2864 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2865
620f13b0
PE
28662012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2867
2868 Use ASCII tests for character types.
2869 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2870 * xfns.c, xterm.c:
2871 Don't include <ctype.h>; was not needed.
2872 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2873 * sysdep.c, xfaces.c:
2874 Include <c-ctype.h> instead of <ctype.h>.
2875 * nsterm.m: Include <c-ctype.h>.
2876 * charset.c (read_hex):
2877 * doc.c (Fsnarf_documentation):
2878 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2879 (DRIVE_LETTER) [DOS_NT]:
2880 (Ffile_name_directory, Fexpand_file_name)
2881 (Fsubstitute_in_file_name):
2882 * font.c (font_parse_xlfd, font_parse_fcname):
2883 * frame.c (x_set_font_backend):
2884 * gtkutil.c (xg_get_font):
2885 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2886 * nsimage.m (hexchar):
2887 * nsterm.m (ns_xlfd_to_fontname):
2888 * sysdep.c (system_process_attributes):
2889 * xfaces.c (hash_string_case_insensitive):
2890 Use C-locale tests instead of locale-specific tests for character
2891 types, since we want the ASCII interpretation here, not the
2892 interpretation suitable for whatever happens to be the current locale.
2893
52162052
MR
28942012-08-16 Martin Rudalics <rudalics@gmx.at>
2895
2896 Consistently check windows for validity/liveness
2897 (Bug#11984, Bug#12025, Bug#12026).
2898 * lisp.h (CHECK_VALID_WINDOW): New macro.
2899 * window.c (decode_window): Rename to decode_live_window.
2900 (decode_valid_window, Fwindow_valid_p): New functions.
2901 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2902 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2903 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2904 (Fwindow_prev_sibling, Fwindow_combination_limit)
2905 (Fset_window_combination_limit, Fwindow_use_time)
2906 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2907 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2908 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2909 (Fwindow_hscroll, Fset_window_hscroll)
2910 (Fwindow_redisplay_end_trigger)
2911 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2912 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2913 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2914 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2915 (Fwindow_end, Fset_window_point, Fset_window_start)
2916 (Fpos_visible_in_window_p, Fwindow_line_height)
2917 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2918 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2919 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2920 (Fset_window_parameter, Fwindow_display_table)
2921 (Fset_window_display_table, Fdelete_other_windows_internal)
2922 (Fset_window_buffer, Fset_window_new_total)
2923 (Fset_window_new_normal, Fdelete_window_internal)
2924 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2925 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2926 (Fwindow_scroll_bars): Check whether argument window is a valid or
2927 live window. Update doc-strings.
2928 (syms_of_window): New symbol Qwindow_valid_p.
2929 * keyboard.c (Fposn_at_x_y): Check whether argument
2930 frame_or_window denotes a valid window.
2931
2751c80f
DA
29322012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2933
2934 Fix previous char table change.
2935 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2936 * chartab.c (optimize_sub_char_table): Likewise.
2937
032a42c8
CY
29382012-08-16 Chong Yidong <cyd@gnu.org>
2939
a2d19368
CY
2940 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2941
032a42c8
CY
2942 * xfont.c (xfont_open):
2943 * xftfont.c (xftfont_open): Set the font's max_width field.
2944
2945 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2946 min_width to space_width and average_width to the average over
2947 printable ASCII characters.
2948 (ns_char_width): Code cleanup.
2949 (ns_ascii_average_width): New utility function.
2950
2951 * font.h (struct font): Update comments.
2952
a098c930
DA
29532012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2954
032a42c8 2955 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
2956 * lisp.h (CSET): New macro.
2957 (char_table_set_extras, char_table_set_contents)
2958 (sub_char_table_set_contents): New function.
2959 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2960 * syntax.c: Adjust users.
2961
8be3a09c
SM
29622012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2963
2964 * eval.c (eval_sub): Bind lexical-binding.
2965 * lread.c (Qlexical_binding): Make non-static.
2966
ac4845a6
JD
29672012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2968
ddee6515
JD
2969 * nsmenu.m (popupSession): Remove.
2970 (pop_down_menu): Remove endModalSession.
2971 (timeout_handler:): New method.
2972 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2973 Call runModalForWindow. Check timer_fired when it returns.
2974 If not set, cancel timer and break out of loop.
2975 Otherwise loop again, with a new timeout.
2976
2977 * nsterm.m: Include fcntl.h if present.
2978 (fd_entry, t_readfds, inNsSelect): Remove.
2979 (select_writefds, select_valid, select_timeout, selfds)
2980 (select_mutex, apploopnr): Add.
2981 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2982 Otherwise call kbd_buffer_store_event.
2983 (ns_send_appdefined): Remove release of fd_entry.
2984 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2985 Increment and decrement apploopnr.
2986 (ns_select): If no file descriptors, just do a NSTimer.
2987 Otherwise copy read/write masks and start select thread (fd_handler).
2988 Start main loop and wait for application defined event.
2989 Inform select thread to stop selecting after main loop is exited.
2990 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 2991 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
2992 (fd_handler:): Loop forever, wait for info from the main thread
2993 to either start or stop selecting. When select returns, send
2994 and appdefined event.
2995 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2996 If not call kbd_buffer_store_event.
2997
2998 * nsterm.h (EmacsApp): fd_handler takes id argument.
2999 (EmacsDialogPanel): Add timer_fired and timeout_handler.
3000
ac4845a6
JD
3001 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3002
eb424fe3
EZ
30032012-08-15 Eli Zaretskii <eliz@gnu.org>
3004
3005 * region-cache.c (move_cache_gap): Update gap_len using the actual
3006 growth of the boundaries array. Do not change cache_len.
3007 (Bug#12196)
3008
4e6a86c6
DA
30092012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3010
3011 Generalize and cleanup font subsystem checks.
3012 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
3013 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
3014 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 3015
5bf192ca
DA
30162012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3017
3018 * gtkutil.c (xg_get_font): Use pango_units_to_double.
3019
f2045622
CY
30202012-08-15 Chong Yidong <cyd@gnu.org>
3021
8be3a09c
SM
3022 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
3023 When using the new font chooser, use gtk_font_chooser_get_font_desc to
3024 extract the font descriptor instead of just the font name.
3025 In that case, return a font spec instead of a string.
f2045622
CY
3026 (x_last_font_name): Move to this file from xfns.c.
3027
3028 * xfns.c (Fx_select_font): The return value can also be a font
3029 spec. Move x_last_font_name management to gtkutil.c.
3030
3031 * xfaces.c: Make font weight and style symbols non-static.
3032
7f6feb56
SM
30332012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
3034
3035 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3036 (bug#12117).
3037
fecbd8ff
SM
30382012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
3039
3040 * alloc.c (Fgarbage_collect): Use plural form consistently.
3041
9b8d5165
EZ
30422012-08-14 Eli Zaretskii <eliz@gnu.org>
3043
3044 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3045 iteration through the command loop. Fixes a problem whereby mouse
3046 movements are ignored until the first mouse click.
3047
f5d9e83a
PE
30482012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3049
3050 Use bool, not int, for Lisp booleans.
3051 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3052 makes Emacs a bit smaller and presumably a bit faster.
3053 * lisp.h: Include <stdbool.h>.
3054 (struct Lisp_Boolfwd, defvar_bool):
3055 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3056 * regex.c [!emacs]: Include <stdbool.h>.
3057 (false, true): Remove; <stdbool.h> does this for us now.
3058
55802e4a
CY
30592012-08-14 Chong Yidong <cyd@gnu.org>
3060
4abcdac8
CY
3061 * character.c (Fcharacterp): Doc fix (Bug#12076).
3062
3063 * data.c (Findirect_variable): Doc fix (Bug#11040).
3064
55802e4a
CY
3065 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
3066
3067 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 3068 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 3069
8e99d072
BR
30702012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3071
3072 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3073 (bug#12022).
3074
08908aca
MR
30752012-08-14 Martin Rudalics <rudalics@gmx.at>
3076
3077 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3078 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3079 * minibuf.c (choose_minibuf_frame, read_minibuf):
3080 * w32fns.c (x_create_tip_frame):
3081 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3082 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3083
56120d6f
PE
30842012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3085
3086 * intervals.c (offset_intervals): Remove obsolete comment.
3087
67b77c0b
AS
30882012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3089
3090 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3091
f48b82fd
GR
30922012-08-14 Gergely Risko <gergely@risko.hu>
3093
3094 * coding.c (decode_coding): Record buffer modification before
3095 disabling undo_list (Bug#11773).
3096
fd318b54
DA
30972012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3098
3099 Revert and cleanup some recent overlay changes.
3100 * buffer.h (enum overlay_type): Remove.
3101 (buffer_get_overlays, buffer_set_overlays): Likewise.
3102 (buffer_set_overlays_before, buffer_set_overlays_after):
3103 New function. Adjust users.
3104 (unchain_both): Add eassert.
3105
41a62dd9
DA
31062012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3107
3108 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3109
5884c324
PE
31102012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3111
3112 * gtkutil.c (xg_mark_data): Don't assume C99.
3113
ca06f160
JD
31142012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3115
3116 * gtkutil.c (xg_frame_tb_info): New struct.
3117 (TB_INFO_KEY): New define.
3118 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3119 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3120 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3121 if not present.
3122 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 3123 is up to date. Otherwise store new data.
ca06f160
JD
3124 (free_frame_tool_bar): Free xg_frame_tb_info if present.
3125
7864a3f7
DA
31262012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3127
3128 Use KSET for write access to Lisp_Object members of struct kboard.
3129 * keyboard.h (KSET): New macro.
3130 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3131 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3132 * xterm.c: Adjust users.
3133
4c31be61
DA
31342012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3135
3136 Use BSET for write access to Lisp_Object members of struct buffer.
3137 * buffer.h (BSET): New macro.
3138 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3139 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3140 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3141 * window.c, xdisp.c, xfns.c: Adjust users.
3142
14ae4239
BT
31432012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
3144
3145 * lread.c (syms_of_lread): Initialize Vlexical_binding.
3146
32bcadb4
JD
31472012-08-11 Jan Djärv <jan.h.d@swipnet.se>
3148
3d29b2ce 3149 * nsterm.m (not_in_argv): New function.
fc0c31f8 3150 (application:openFile, application:openTempFile:):
3d29b2ce
JD
3151 (application:openFileWithoutUI:, application:openFiles:): Open file
3152 if not_in_argv returns non-zero (bug#12171).
3153
32bcadb4 3154 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
3155 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
3156 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
3157 (xg_get_font_name): Use those functions/macros here.
3158 Reported by Frans Oilinki <moilinki@gmail.com>.
3159
9ff9402d 31602012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
3161
3162 * unexmacosx.c (copy_data_segment): Copy initialized data in
3163 statically linked libraries from input file rather than memory.
3164
db74a5fc
YM
3165 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
3166 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
3167 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
3168
25e65510
GM
31692012-08-10 Glenn Morris <rgm@gnu.org>
3170
3171 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
3172 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
3173
7961135c
DA
31742012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3175
3176 Fix last change to allow compilation with low optimization levels.
3177 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
3178 Reported by Jan Djärv <jan.h.d@swipnet.se>.
3179
42b3a444
DA
31802012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3181
3182 Use common inline syntax in intervals.h.
3183 * intervals.h (INTERVALS_INLINE): New macro.
3184 Change all users from LISP_INLINE.
3185
9fb0c957
DA
31862012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3187
3188 Define Qnone once for all platforms.
3189 * frame.c (Qnone): Define here.
3190 (syms_of_frame): DEFSYM it.
3191 * lisp.h (Qnone): New declaration.
3192 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
3193 * xfns.c: Remove duplication. Adjust users.
3194
65e8ee52
DA
31952012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3196
3197 Remove unused macros from intervals.h.
3198 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
3199 * intervals.c: Adjust comment.
3200
9b855fd6
EZ
32012012-08-10 Eli Zaretskii <eliz@gnu.org>
3202
3203 * w32fns.c <w32_unicode_gui>: New static variable.
3204 (globals_of_w32fns): Initialize it according to os_subtype.
3205 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3206 testing os_subtype.
3207
39cb9e56 32082012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
3209 Eli Zaretskii <eliz@gnu.org>
3210
3211 Fix bug #10299 with Unicode characters sent by customized
3212 keyboards created by MSKLC.
3213 * w32fns.c (INIT_WINDOW_CLASS): New macro.
3214 (w32_init_class): Use it to initialize the Emacs class with either
3215 ANSI or Unicode API calls.
3216 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3217 later.
3218 (w32_wnd_proc): If the character code sent by WM_CHAR or
3219 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3220 original message. Call DefWindowProcW on NT and later.
3221
9374581a
GM
32222012-08-10 Glenn Morris <rgm@gnu.org>
3223
4b94e8cf
GM
3224 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3225
9374581a
GM
3226 * lisp.h (DIRECTORY_SEP): Let configure set it.
3227
a2752828
DA
32282012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
3229
3230 Use TSET for write access to Lisp_Object slots of struct terminal.
3231 * termhooks.h (TSET): New macro.
3232 * coding.c, terminal.c, xselect.c: Adjust users.
3233
cc92c454
SM
32342012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
3235
3236 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
3237 the failing expression, include them in the error message.
3238 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3239 * lisp.h (internal_condition_case_n): Update declaration.
3240
4cb3e6b3
DA
32412012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3242
3243 Inline functions to examine and change buffer overlays.
3244 * buffer.c (unchain_both): New function.
3245 * buffer.h (buffer_get_overlays, buffer_set_overlays):
3246 (buffer_has_overlays): New function.
3247 (enum overlay_type): New enum.
3248 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3249 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3250
8707c1e5
DA
32512012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3252
3253 Inline functions to examine and change buffer intervals.
3254 * alloc.c (mark_interval_tree): Remove.
3255 (MARK_INTERVAL_TREE): Simplify.
3256 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
3257 * intervals.c (buffer_balance_intervals): New function.
3258 (graft_intervals_into_buffer): Adjust indentation.
3259 (set_intervals_multibyte): Simplify.
3260 * buffer.h (BUF_INTERVALS): Remove.
3261 (buffer_get_intervals, buffer_set_intervals): New function.
3262 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3263 * intervals.c, textprop.c: Adjust users.
3264
ad8c997f
DA
32652012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3266
3267 Inline functions to examine and change string intervals.
3268 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3269 (string_get_intervals, string_set_intervals): New function.
3270 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3271 * lread.c, print.c, textprop.c: Adjust users.
3272
32ac3a6b
GM
32732012-08-08 Glenn Morris <rgm@gnu.org>
3274
3275 * lisp.mk (lisp): Remove language/persian.elc.
3276
77c7bcb1
DA
32772012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3278
3279 Cleanup intervals.
3280 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3281 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
3282 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3283 Adjust comment. Move under #if 0.
77c7bcb1
DA
3284 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3285 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3286
9c08a8d4
DA
32872012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3288
3289 Check total length of intervals with eassert.
3290 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3291 * intervals.c: Change all users to eassert.
3292
26d16b35
EZ
32932012-08-07 Eli Zaretskii <eliz@gnu.org>
3294
14ae4239
BT
3295 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
3296 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
3297 INTERNAL_FIELD in Lisp_Cons.
3298
c644523b
DA
32992012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3300
3301 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
3302 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
3303 name since all xname users are fixed long time ago. Do not
3304 use INTERNAL_FIELD.
3305 (set_symbol_name, set_symbol_function, set_symbol_plist):
3306 (set_symbol_next, set_overlay_plist): New function.
3307 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
3308 (struct Lisp_Overlay): Likewise.
3309 (CVAR, MVAR, SVAR): Remove.
3310 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
3311 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
3312 * xterm.c: Adjust users.
3313 * .gdbinit: Change to use name field of struct Lisp_Symbol
3314 where appropriate.
3315
6a3d20cc
DA
33162012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3317
3318 Basic functions to set Lisp_Object and pointer slots of intervals.
3319 * intervals.h (interval_set_parent, interval_set_object):
3320 (interval_set_left, interval_set_right, interval_set_plist):
3321 (interval_copy_parent): New function.
3322 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
3323 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
3324 Adjust indentation.
6a3d20cc
DA
3325 (INTERVAL_SIZE): Remove. Adjust users.
3326 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3327
4d2b044c
DA
33282012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3329
3330 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3331 * process.h (PGET): Remove.
3332 (struct Lisp_Process): Do not use INTERNAL_FIELD.
3333 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3334
d3d50620
DA
33352012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3336
3337 Drop WGET and revert read access to Lisp_Objects slots of struct window.
3338 * window.h (WGET): Remove.
3339 (struct window): Do not use INTERNAL_FIELD.
3340 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3341 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3342 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3343 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3344 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3345 Adjust users.
3346
d10a51dc
CY
33472012-08-07 Chong Yidong <cyd@gnu.org>
3348
3349 * window.c (Fwindow_edges, Fwindow_pixel_edges)
3350 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3351 (Fdelete_window_internal): Signal an error if the window is not on
3352 a live frame (Bug#12025).
3353
e69b0960
DA
33542012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3355
3356 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3357 * frame.h (FGET): Remove.
3358 (struct frame): Do not use INTERNAL_FIELD.
3359 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3360 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3361 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3362 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3363
25a20a3a
JB
33642012-08-06 Juanma Barranquero <lekktu@gmail.com>
3365
3366 * w32.c: Silence compiler warnings.
3367 (map_w32_filename): Remove unused variable `is_fat'.
3368 (chase_symlinks): Add parentheses around expression.
3369
1c6f11f4
GM
33702012-08-06 Glenn Morris <rgm@gnu.org>
3371
1db4583a
GM
3372 * sysdep.c: Respect BROKEN_GETWD.
3373
1c6f11f4
GM
3374 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3375 Let configure handle it.
3376 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3377
2b90362b
DA
33782012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3379
3380 Use GCALIGNMENT where appropriate.
3381 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3382 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3383 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3384
5f50daf2
EZ
33852012-08-06 Eli Zaretskii <eliz@gnu.org>
3386
14ae4239
BT
3387 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3388 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 3389
cbcc7007
SM
33902012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3391
3392 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3393 that should be sufficient for everyone.
3394
4d365fa4
JD
33952012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3396
3397 * keyboard.c (timer_check_2): Add break so timer_check returns next
3398 timeout.
3399
dd86bd82
DA
34002012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3401
3402 Fix Windows build errors introduced after converting to WGET and WSET.
3403 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3404 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3405
054e1668
JD
34062012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3407
3408 * nsterm.m (ns_frame_rehighlight): Use FSET.
3409
3410 * nsmenu.m (ns_update_menubar): Use FSET.
3411
21238f11
DA
34122012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3413
3414 Separate read and write access to Lisp_Object slots of Lisp_Process.
3415 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3416 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3417
077288cf
DA
34182012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3419
3420 Separate read and write access to Lisp_Object slots of struct window.
3421 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3422 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3423 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3424 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3425 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3426 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3427 Adjust users.
3428
71688bd7
DA
34292012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3430
3431 Fix Windows build errors introduced after converting to FGET and FSET.
3432 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3433 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3434 (w32_judge_scroll_bars): Change to use FSET.
3435 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3436
f99bac93
DA
34372012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3438
3439 Fix replacement typo.
3440 * window.c (replace_window): Set root_window instead of
3441 selected_window. This fixes a total window subsystem
3442 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3443
8c2a0f2d
GM
34442012-08-06 Glenn Morris <rgm@gnu.org>
3445
3446 * lisp.mk (lisp): Add language/persian.elc.
3447
edd74c35
DA
34482012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3449
3450 Separate read and write access to Lisp_Object slots of struct frame.
3451 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3452 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3453 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3454 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3455 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3456
8671676c
AS
34572012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3458
3459 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3460
663e2b3f
DA
34612012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3462
3463 Generalize common compile-time constants.
3464 * lisp.h (header_size, bool_header_size, word_size): Now here.
3465 (struct Lisp_Vector): Add comment.
3466 (struct Lisp_Bool_Vector): Move up to define handy constants.
3467 (VECSIZE, PSEUDOVECSIZE): Simplify.
3468 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3469 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3470 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3471 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3472 * xfont.c, xmenu.c: Use word_size where appropriate.
3473
d32e47af
LM
34742012-08-05 Lawrence Mitchell <wence@gmx.li>
3475
3476 * search.c (Freplace_match): Treat \? in the replacement text
3477 literally (Bug#8161).
3478
e5d9c0d1
CY
34792012-08-05 Chong Yidong <cyd@gnu.org>
3480
3481 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3482 * frame.c (Vdelete_frame_functions):
3483 * emacs.c (Vkill_emacs_hook): Doc fix.
3484
8da0576b
EZ
34852012-08-04 Eli Zaretskii <eliz@gnu.org>
3486
3487 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3488 --with-x-toolkit=no builds.
3489 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3490
02676e5d
CY
34912012-08-04 Chong Yidong <cyd@gnu.org>
3492
3493 * syntax.c (Fmodify_syntax_entry): Doc fix.
3494
97147da9
EZ
34952012-08-04 Eli Zaretskii <eliz@gnu.org>
3496
76151e2c
EZ
3497 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3498 * w32.c (init_environment): Change the default values of many
3499 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
3500 them into environment when they were not already defined.
3501 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 3502 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
3503 (check_windows_init_file): Now external, not static.
3504 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
3505 called when Vload_path is already set up.
3506
3507 * w32.h (check_windows_init_file): Add prototype.
3508
3509 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3510 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3511 compatibility with Posix platforms.
3512 (main): Move the call to check_windows_init_file to here from
3513 w32.c.
3514 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3515 any, in the DEFALT argument into the root of the Emacs build or
3516 installation tree, as appropriate.
3517
3518 * callproc.c (init_callproc_1): Call decode_env_path instead of
3519 doing its equivalent by hand.
3520 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3521 the code that sets Vexec_path run on MS-Windows.
3522
3523 * lread.c (init_lread): Add comments to #ifdef's.
3524
97147da9
EZ
3525 * msdos.c (dos_set_window_size, IT_update_begin)
3526 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3527 instead of direct references.
3528
185ee146
PE
35292012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3530
3531 Export DEFAULT_REHASH_* to GDB.
3532 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3533 Now constants, not macros.
3534
8834c57a
PE
35352012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3536
98c6f1e3
PE
3537 Remove unnecessary casts involving pointers.
3538 These casts are no longer needed now that we assume C89 or later,
3539 since they involve casting to or from void *.
3540 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3541 (make_pure_float, make_pure_vector):
3542 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3543 * macros.c (Fstart_kbd_macro):
3544 * menu.c (find_and_return_menu_selection):
3545 * minibuf.c (read_minibuf_noninteractive):
3546 * sysdep.c (closedir):
3547 * xdisp.c (x_produce_glyphs):
3548 * xfaces.c (compare_fonts_by_sort_order):
3549 * xfns.c (x_real_positions, select_visual):
3550 * xselect.c (x_stop_queuing_selection_requests)
3551 (x_get_window_property, x_get_window_property_as_lisp_data):
3552 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3553 Remove unnecessary pointer casts.
3554 * alloc.c (record_xmalloc): New function.
3555 * lisp.h (record_xmalloc): New decl.
3556 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3557 more like a function. This is because the pointer cast is not
3558 needed. All uses changed.
3559 * print.c (print_string, print_error_message): Avoid length recalc.
3560
8834c57a
PE
3561 Improve fix for macroexp crash with debugging (Bug#12118).
3562 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3563 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3564 not supposed to be invoked from the garbage collector.
3565 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3566 (gc_aset): New function, which is like ASET but can be
3567 used in the garbage collector.
3568 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3569 (set_hash_index): Use it instead of ASET.
3570
6dad7178
EZ
35712012-08-03 Eli Zaretskii <eliz@gnu.org>
3572
3573 Support symlinks on latest versions of MS-Windows.
3574 * w32.c: Include winioctl.h and aclapi.h.
3575 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3576 (revert_to_self): Forward declarations of static functions.
3577 <static BOOL g_b_init_get_security_info>:
3578 <g_b_init_create_symbolic_link>: New static flags.
3579 (globals_of_w32): Initialize them to zero.
3580 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3581 (map_w32_filename): Improve commentary. Simplify switch.
3582 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3583 headers (most versions of MinGW w32api don't).
3584 (get_security_info, create_symbolic_link)
3585 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3586 New functions.
3587 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3588 in the argument file name.
3589 (sys_access): Call unc_volume_file_attributes only if
3590 GetFileAttributes fails with network-related error codes.
3591 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3592 have the required privileges.
14ae4239 3593 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
3594 get_file_security_desc.
3595 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
3596 with addition of handling of symlinks and support for 'lstat'.
3597 If possible, get file's attributes and security information by
6dad7178
EZ
3598 handle, not by name. Produce S_IFLNK bit for symlinks, when
3599 called from 'lstat'.
3600 (stat, lstat): New functions, call 'stat_worker'.
3601 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3602 symlinks when the underlying filesystem supports them.
3603
f162bcc3
PE
36042012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3605
79ea6c20
PE
3606 Fix macroexp crash on Windows with debugging (Bug#12118).
3607 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3608 checking subscripts; problem introduced with the recent
3609 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3610 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3611 since it's used in non-static inline functions now.
3612
c0ce93fd
PE
3613 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3614 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 3615
f162bcc3
PE
3616 Use C99-style 'extern inline' if available.
3617 * buffer.h (BUFFER_INLINE):
3618 * category.h (CATEGORY_INLINE):
3619 * character.h (CHARACTER_INLINE):
3620 * charset.h (CHARSET_INLINE):
3621 * composite.h (COMPOSITE_INLINE):
3622 * dispextern.h (DISPEXTERN_INLINE):
3623 * lisp.h (LISP_INLINE):
3624 * systime.h (SYSTIME_INLINE):
3625 New macro, replacing 'static inline' in this header.
3626 * buffer.h, category.h, character.h, charset.h, composite.h:
3627 * dispextern.h, lisp.h, systime.h:
3628 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3629 * alloc.c (LISP_INLINE):
3630 * buffer.c (BUFFER_INLINE):
3631 * category.c (CATEGORY_INLINE):
3632 * character.c (CHARACTER_INLINE):
3633 * charset.c (CHARSET_INLINE):
3634 * composite.c (COMPOSITE_INLINE):
3635 * dispnew.c (DISPEXTERN_INLINE):
3636 * sysdep.c (SYSTIME_INLINE):
3637 Define to EXTERN_INLINE, so that the corresponding functions
3638 are compiled into code.
3639 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3640 (INLINE_HEADER_END): New macros.
3641 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3642 since it's used in non-static inline functions now.
a8333d03 3643 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 3644
837b365b
GM
36452012-08-02 Glenn Morris <rgm@gnu.org>
3646
d66b744d
GM
3647 * s/: Remove empty directory.
3648
837b365b
GM
3649 * s/ms-w32.h: Move to ../nt/inc.
3650 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3651 Update for new ms-w32.h location.
3652
13294f95
PE
36532012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3654
3655 Port to Solaris 8.
3656 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3657
90df0db3
GM
36582012-08-02 Glenn Morris <rgm@gnu.org>
3659
3660 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3661 hard-coding the path separator.
3662
4939150c
PE
36632012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3664
3665 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3666 This how ASET and AREF are supposed to work, and makes
3667 it easier to think about future improvements. See
3668 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3669 * charset.h (set_charset_attr): New function.
3670 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3671 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3672 (aref_addr): New function. All uses of &AREF(...) changed.
3673 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3674 (set_hash_index): New functions. All lvalue-style uses of
3675 HASH_KEY etc. changed.
3676 * keyboard.c (set_prop): New function. All lvalue-style uses
3677 of PROP changed.
3678
947b2afd
AA
36792012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3680
3681 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3682 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3683 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3684 * nsfns.m (ns_set_name_as_filename): Likewise.
3685 * nsmenu.m (ns_update_menubar): Likewise.
3686 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3687
4f5d0325
EZ
36882012-08-01 Eli Zaretskii <eliz@gnu.org>
3689
2008beae
EZ
3690 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3691 Adapt to latest changes in field names of the corresponding Lisp
288479f6 3692 objects.
2008beae 3693
4f5d0325
EZ
3694 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3695
fe3cc771
GM
36962012-08-01 Glenn Morris <rgm@gnu.org>
3697
3698 * s/msdos.h: Remove file.
3699 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3700 * Makefile.in (S_FILE): Remove.
3701 (config_h): Remove S_FILE.
3702
c90acc54
JB
37032012-08-01 Juanma Barranquero <lekktu@gmail.com>
3704
3705 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3706 Remove; moved to nt/config.nt.
3707
d8a05828
DA
37082012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3709
3710 Use INTERNAL_FIELD for conses and overlays.
3711 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3712 Remove obsolete comment.
3713 (MVAR): New macro.
3714 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3715 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3716
8271d590
DA
37172012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3718
3719 Use INTERNAL_FIELD for symbols.
3720 * lisp.h (SVAR): New macro. Adjust users.
3721 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3722 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3723
3193acd2
DA
37242012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3725
3726 Use INTERNAL_FIELD for processes.
3727 * process.h (PVAR): New macro. Adjust style.
3728 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3729 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3730
3a45383a
DA
37312012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3732
3733 Use INTERNAL_FIELD for windows.
3734 * window.h (WVAR): New macro.
3735 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3736 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3737 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3738 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3739 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3740 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3741
c1dbc63c
PE
37422012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3743
3744 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3745
5c0c0e8a
GM
37462012-08-01 Glenn Morris <rgm@gnu.org>
3747
3748 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3749 Move to configure.ac.
3750
552a99b4
JB
37512012-08-01 Juanma Barranquero <lekktu@gmail.com>
3752
3753 * makefile.w32-in (CONFIG_H): Update dependencies.
3754 (CONF_POST_H): New macro.
3755
3756 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3757
8d8e2dfe
GM
37582012-07-31 Glenn Morris <rgm@gnu.org>
3759
bc96620a
GM
3760 * Makefile.in (S_FILE): No longer set by configure.
3761
476b1b2d
GM
3762 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3763 is available.
3764 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3765
b2c7a106
GM
3766 * process.h (NULL_DEVICE):
3767 * emacs.c (SEPCHAR):
3768 * editfns.c (USER_FULL_NAME): Let configure set them.
3769
d53d062a
GM
3770 * s/README, s/template.h: Remove files.
3771
4515017f
GM
3772 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3773
8d8e2dfe
GM
3774 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3775 Move to configure.ac.
3776
5b20b3cc
EZ
37772012-07-31 Eli Zaretskii <eliz@gnu.org>
3778
1e0afd9a
EZ
3779 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3780 resulting renaming of 'struct frame' members.
3781
5b20b3cc
EZ
3782 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3783
3784 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3785 after introduction of FVAR.
3786
f1310128
JD
37872012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3788
79e721e0
JD
3789 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3790
3791 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3792 instead of compositeToPoint.
3793 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3794
8d7c7eed 3795 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 3796
e34f7f79
DA
37972012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3798
3799 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3800 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 3801 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
3802 (BVAR): Change to use INTERNAL_FIELD.
3803 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3804 (KVAR): Change to use INTERNAL_FIELD.
3805 * frame.h (FVAR): New macro.
3806 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
3807 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3808 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3809 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
3810 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3811
c09bfb2f
DA
38122012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3813
3814 Miscellaneous fixes for non-default X toolkits.
3815 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3816 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3817 Move under #ifdef USE_LUCID.
3818 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3819 definition and usage to avoid warnings.
3820
14c114ae
JD
38212012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3822
3823 * nsterm.m (openFiles): Fix previous checkin.
3824
3bd21e82
PE
38252012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3826
3827 * indent.c (compute_motion): Remove unused local.
3828
c1529ded
GM
38292012-07-31 Glenn Morris <rgm@gnu.org>
3830
400d5621
GM
3831 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3832
268e2432
GM
3833 * conf_post.h [USG5_4]:
3834 Move remaining contents of s/usg5-4-common.h here.
3835 * s/usg5-4-common.h: Remove file.
3836
7552f3ee
GM
3837 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3838 * s/irix6-5.h: Remove file.
3839
6a381852
GM
3840 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3841 * s/darwin.h: Remove file.
3842
c1529ded
GM
3843 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3844 * s/hpux10-20.h: Remove file, which is now empty.
3845
b429a4ee
GM
38462012-07-30 Glenn Morris <rgm@gnu.org>
3847
3848 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3849 * Makefile.in (config_h): Add conf_post.h.
3850 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3851
adff3182
JD
38522012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3853
3854 * nsterm.m (ns_do_open_file): New variable.
b9031d69 3855 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
3856 (openFile, openTempFile, openFileWithoutUI, openFiles):
3857 Open files only if ns_do_open_file.
adff3182 3858
c32af1e4
PE
38592012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3860
7393bcbb
PE
3861 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3862 This no-op macro hasn't been needed for many years.
3863 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3864
c32af1e4
PE
3865 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3866 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3867 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3868 gdb_make_enums_visible.
3869 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3870 (DIRECTORY_SEP): Now a constant, not a macro.
3871
302fc036
EZ
38722012-07-30 Eli Zaretskii <eliz@gnu.org>
3873
3874 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3875 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3876
3877 * w32term.c <w32_keyboard_codepage>: Renamed from
3878 keyboard_codepage and now external. All users changed.
3879
3880 * w32term.h: Add declaration of w32_keyboard_codepage.
3881
3882 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3883 the codepage to translate keys to Unicode. If this argument is
3884 -1, use the value returned by GetConsoleCP. All callers changed.
3885
88fb40b4
PE
38862012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3887
0aee6912
PE
3888 Update .PHONY listings in makefiles.
3889 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3890 bootstrap-clean, distclean, maintainer-clean, versioclean,
3891 extraclean, frc.
3892
88fb40b4
PE
3893 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3894 This is a bit clearer. Fix some commentary typos.
3895
0a763bd1
GM
38962012-07-30 Glenn Morris <rgm@gnu.org>
3897
32bac6d6
GM
3898 * s/netbsd.h: Let configure include signal.h if needed.
3899 Remove file, which is now empty.
3900
b65e7c46
GM
3901 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3902 Let configure set them.
3903 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3904 No more need to undefine.
0a763bd1 3905
169304bd
AS
39062012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3907
3908 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3909 non-single-byte char when adding meta modifier. (Bug#12090)
3910
6cd7a139
DA
39112012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3912
3913 Convert safe_call to use variable number of arguments.
3914 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3915 (safe_call2): Fix comment.
3916 * lisp.h (safe_call): Adjust prototype.
3917 * coding.c (encode_coding_object): Change to use safe_call2.
3918 * xfaces.c (merge_face_heights): Change to use safe_call1.
3919
d34d6ffc
GM
39202012-07-30 Glenn Morris <rgm@gnu.org>
3921
7b8a48e4 3922 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 3923 does that unconditionally. Remove file, which is now empty.
7b8a48e4 3924
d34d6ffc
GM
3925 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3926 Remove empty files.
3927
03a660a6
PE
39282012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3929
3930 Export to GDB most of lisp.h's remaining object-like macros.
3931 * lisp.h (min, max): Move earlier, because they're used earlier now.
3932 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3933 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3934 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3935 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3936 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3937 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3938 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3939 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3940 Now constants, for GDB. They need not be macros.
3941 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3942 Now constants, for GDB, as well as macros, for static initializers.
3943 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3944 Move to after the definition of struct Lisp_Char_Table,
3945 since the former now needs that type defined.
3946 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3947 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3948 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3949 New enums, for gdb_make_enums_visible.
3950 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 3951 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
3952 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3953 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3954 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3955 enum maxargs, enum MAX_ALLOCA.
3956 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3957 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3958 no longer needed, now that they are done in lisp.h.
3959
e499d0ee
DA
39602012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3961
3962 Cleanup string bytes checking.
3963 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3964 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3965 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3966 (check_sblock, compact_small_strings): Simplify.
3967
d5040d2d
PE
39682012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3969
3970 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3971 These macros are confusing and no longer need to be defined, as
3972 the enum values now suffice. All uses replaced with definiens.
3973 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3974
7f259ae6
JB
39752012-07-29 Juanma Barranquero <lekktu@gmail.com>
3976
3977 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3978 ($(BLD)/w32console.$(O)): Update dependencies.
3979
7e63e0c3
DA
39802012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3981
3982 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3983 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3984 time. Adjust users.
3985 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3986
ffd817eb
JD
39872012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3988
3989 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3990 setting sitelisp (Bug#12010).
3991
417a7a0e
EZ
39922012-07-29 Eli Zaretskii <eliz@gnu.org>
3993
14ae4239 3994 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
3995
3996 * w32heap.c (cache_system_info):
3997 * w32.c (sys_rename):
3998 * w32proc.c (find_child_console, sys_kill): All users changed.
3999
387d4d92
PE
40002012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4001
4002 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4003
55a6cca6
EZ
40042012-07-29 Eli Zaretskii <eliz@gnu.org>
4005
4006 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
4007
dbcf001c
DA
40082012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4009
4010 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
4011 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
4012 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 4013
e2688e4a
DA
40142012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4015
4016 Generalize marker debugging code under MARKER_DEBUG and use eassert.
4017 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
4018 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
4019 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
4020 (replace_range, replace_range_2, del_range_2): Change to eassert.
4021 * marker.c (byte_char_debug_check): Adjust style.
4022
b46a6a83
PE
40232012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4024
4025 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4026 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4027 long-ago-commented-out code that talks about "WIN32".
4028 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4029 All uses changed.
4030
e32a5799
PE
40312012-07-28 Paul Eggert <eggert@cs.ucla.edu>
4032
4033 Use Gnulib stdalign module (Bug#9772, Bug#9960).
4034 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4035 Simplify by using alignof.
4036 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4037 * lisp.h: Include <stdalign.h>.
4038 (GCALIGNMENT): New macro and constant.
4039 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
4040 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4041 (stdalign): New macro, if not already defined.
4042
df81cd29
EZ
40432012-07-28 Eli Zaretskii <eliz@gnu.org>
4044
01bd1b0d
EZ
4045 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
4046 * w32inevt.c: Include w32inevt.h.
4047 (w32_read_console_input): New inline function, calls either
4048 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4049 w32_console_unicode_input.
4050 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4051 (w32_kbd_patch_key, key_event): Use the codepage returned by
4052 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4053 (key_event): use uChar.UnicodeChar only if
4054 w32_console_unicode_input is non-zero.
4055
4056 * w32console.c: Include w32heap.h.
4057 <w32_console_unicode_input>: New global variable.
4058 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4059 family of Windows, zero otherwise.
4060
4061 * w32inevt.h: Declare w32_console_unicode_input.
4062
df81cd29
EZ
4063 * xdisp.c (init_iterator): Don't reference tip_frame in a build
4064 --without-x. (Bug#11742)
4065
c20fdd9e
PE
40662012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4067
4068 Adjust GDB to reflect pvec_type changes (Bug#12036).
4069 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
4070 2012-07-04 changes to pseudovector representation.
4071 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 4072
32770973 40732012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
4074
4075 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4076 bus address.
4077 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4078
3438fe21
EZ
40792012-07-27 Eli Zaretskii <eliz@gnu.org>
4080
bcfbc9de
EZ
4081 * alloc.c (listn): Fix the order the arguments are consed onto the
4082 list.
4083
3438fe21
EZ
4084 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4085 enumeration constants, as PURE and HEAP are too general, and clash
4086 with other headers and sources, such as gmalloc.c and the
4087 MS-Windows system headers. All users changed.
4088
eeaea515
DA
40892012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4090
4091 Revert last save_excursion_save and save_excursion_restore changes.
4092 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4093 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4094
073c88c2
DA
40952012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4096
4097 Fix recently-introduced typos in Windows port.
4098 Reported by Martin Rudalics <rudalics@gmx.at>.
4099 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 4100 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 4101
4706125e
PE
41022012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4103
4104 Improve GDB symbol export (Bug#12036).
4105 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4106 arms of an 'if', not using conditional expressions; otherwise GDB
4107 complains about the types in the unevaluated arm when the argument
4108 is an integer literal.
4109 (xgetint): Simplify expression.
4110 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4111 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4112 Zaretskii in <http://bugs.gnu.org/12036#13>.
4113 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4114 needed now that we have gdb_make_enums_visible.
4115 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4116 (enum enum_USE_LSB_TAG):
4117 New enum types, packaging up enums that need to be exported to GDB.
4118
694b6c97
DA
41192012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4120
4121 Utility function to make a list from specified amount of objects.
4122 * lisp.h (enum constype): New datatype.
4123 (listn): New prototype.
4124 * alloc.c (listn): New function.
4125 (Fmemory_use_count, syms_of_alloc): Use it.
4126 * buffer.c (syms_of_buffer): Likewise.
4127 * callint.c (syms_of_callint): Likewise.
4128 * charset.c (define_charset_internal): Likewise.
4129 * coding.c (syms_of_coding): Likewise.
4130 * keymap.c (syms_of_keymap): Likewise.
4131 * search.c (syms_of_search): Likewise.
4132 * syntax.c (syms_of_syntax): Likewise.
4133 * w32.c (init_environment): Likewise.
4134 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4135 * xdisp.c (syms_of_xdisp): Likewise.
4136 * xfns.c (syms_of_xfns): Likewise.
4137
6195f384
DA
41382012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4139
4140 Fast save_excursion_save and save_excursion_restore.
4141 * lisp.h (struct Lisp_Excursion): New data type.
4142 (PVEC_EXCURSION): New pseudovector type.
4143 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
4144 to deal with it. Adjust comments.
4145 (init_marker, attach_marker): New prototype.
4146 (unchain_marker): Adjust prototype.
4147 * marker.c (attach_marker): Change to global.
4148 (init_marker): New function.
4149 * alloc.c (Fmake_marker, build_marker): Use it.
4150 (build_marker): More easserts.
4151 (mark_object): Handle struct Lisp_Excursion.
4152 * editfns.c (save_excursion_save, save_excursion_restore):
4153 Reimplement to use struct Lisp_Excursion. Add comments.
4154
5eceb8fb
PE
41552012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4156
4157 Fix export of symbols to GDB (Bug#12036).
4158 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
4159 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
4160 emacs.c, as this is a more-suitable home. Had this been done earlier
4161 the fix for 12036 would have avoided some of the problems noted in
4162 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
4163 would have been more obvious.
562157c8
PE
4164 * emacs.c: Do not include <verify.h>; no longer needed.
4165 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
4166 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
4167 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4168 Remove; now done in lisp.h.
4169 * lisp.h (PUBLISH_TO_GDB): New macro.
4170 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
4171 (DATA_SEG_BITS): Use it.
4172 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
4173 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
4174 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
4175 not be usable in #if. This simplifies things.
4176
d6749401
JB
41772012-07-26 Juanma Barranquero <lekktu@gmail.com>
4178
4179 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
4180
1781b9e9
PE
41812012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4182
d89518db 4183 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
4184 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
4185 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
4186 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
4187 Adjust to changes in lisp.h and emacs.c, by using
4188 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
4189 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
4190 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
4191 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
4192 instead of gdb_valbits.
4193 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
4194 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
4195 instead of gdb_array_mark_flag.
4196 (xboolvector): Get size from $->size, not $->header.size.
4197 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
4198 (xreload, hook-run, hookpost-run): Remove.
4199 * emacs.c: Include <verify.h>.
4200 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
4201 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
4202 Remove.
4203 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
4204 (gdb_USE_LSB_TAG): New enum constants.
4205 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4206 Also define these as enum constants, so they're visible to GDB.
4207 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4208 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4209 as constants, so they're visible to GDB.
4210 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4211 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4212 Now enum constants, not macros, so they're visible to GDB.
4213 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4214 more convenient now. All uses changed.
4215 (VALMASK) [USE_LSB_TAG]: Also define in this case.
4216 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4217
3628596a
DA
42182012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
4219
4220 Explicitly free restriction data that are not needed anymore.
4221 * editfns.c (save_restriction_restore): Free restriction data.
4222
7abaf5cc
SM
42232012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
4224
4225 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4226 add argument, tune behavior, and adjust all callers.
4227
71f88e00
PE
42282012-07-25 Paul Eggert <eggert@cs.ucla.edu>
4229
4230 Use typedef for EMACS_INT, EMACS_UINT.
4231 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4232 than macros. This simplifies debugging in the usual case, since
4233 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4234 and it allows expressions involving EMACS_INT casts.
4235 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4236
57ec3034
JD
42372012-07-25 Jan Djärv <jan.h.d@swipnet.se>
4238
4239 * nsterm.m (ns_read_socket): Return early if there is a modal
4240 window (Bug#12043).
4241
8137e7b3
MR
42422012-07-25 Martin Rudalics <rudalics@gmx.at>
4243
4244 * frame.c (Fredirect_frame_focus): In doc-string don't mention
4245 that FOCUS-FRAME can be omitted.
4246
04e9897c
DA
42472012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
4248
4249 Adjust buffer text indirection counters at the end of Fkill_buffer.
4250 * buffer.c (Fkill_buffer): Adjust indirection counters when the
4251 buffer is definitely dead. This should really fix an issue reported
4252 by Christoph Scholtes again. (Bug#12007).
4253 (init_buffer_once): Initialize indirection counters of
4254 buffer_defaults and buffer_local_symbols (for sanity and safety).
4255
8a0484e1
EZ
42562012-07-24 Eli Zaretskii <eliz@gnu.org>
4257
4258 * xdisp.c (init_iterator): Don't compute dimensions of truncation
4259 and continuation glyphs on tooltip frames, leave them at zero.
4260 Avoids continued lines in tooltips. (Bug#11832)
4261
fa691a83
DA
42622012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
4263
4264 Simplify copy_overlay.
04e9897c 4265 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
4266 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4267
436bc8e0
EZ
42682012-07-23 Eli Zaretskii <eliz@gnu.org>
4269
4270 * print.c (print_object): Don't crash when a frame's name is nil
4271 or invalid. (Bug#12025)
4272
4273 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4274 it signals an error when a tooltip frame is being created.
4275
d7a7fda3
DA
42762012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4277
4278 Cleanup miscellaneous objects allocation and initialization.
4279 * alloc.c (allocate_misc): Change to static. Add argument to
4280 specify the subtype. Adjust comment and users.
4281 (build_overlay): New function.
4282 * buffer.c (copy_overlays, Fmake_overlay): Use it.
4283 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4284 (allocate_misc): Remove prototype.
4285 (build_overlay): Add prototype.
4286
42872012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
4288
4289 Swap buffer text indirection counters in Fbuffer_swap_text.
4290 * buffer.c (Fbuffer_swap_text): Swap indirections too.
4291 This avoids crash reported by Christoph Scholtes at
4292 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4293
9d7fa573
JD
42942012-07-22 Jan Djärv <jan.h.d@swipnet.se>
4295
4296 * nsmenu.m (Popdown_data): New struct.
4297 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
4298 free Popdown_data.
4299 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
4300 (initWithContentRect): Make imgView and contentView non-static
4301 and autorelease them. Also autorelease img and matrix (Bug#12005).
4302 (dealloc): Remove (Bug#12005).
4303
0dd6d66d
DA
43042012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4305
4306 Adjust consing_since_gc when objects are explicitly freed.
4307 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
4308 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
4309 (free_cons, free_misc): Subtract object size from consing_since_gc.
4310
d36d71df
DA
43112012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4312
4313 Simplify and cleanup markers positioning code.
4314 * marker.c (attach_marker): More useful eassert.
4315 (live_buffer, set_marker_internal): New function.
4316 (Fset_marker, set_marker_restricted): Use set_marker_internal.
4317 (set_marker_both, set_marker_restricted_both): Use live_buffer.
4318
fb9ea40f
PE
43192012-07-22 Paul Eggert <eggert@cs.ucla.edu>
4320
4321 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
4322 as it's limited by the amount of memory, not by INT_MAX.
4323
2d5c5f7d
EZ
43242012-07-21 Eli Zaretskii <eliz@gnu.org>
4325
07fb592e
EZ
4326 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
4327 in special-event-map. See the discussion at
4328 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4329 for the reasons.
4330
37a9eac8 4331 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
4332 info.dwItemData. Fixes crashes on 64-bit Windows.
4333 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 4334
c4328746
JD
43352012-07-21 Jan Djärv <jan.h.d@swipnet.se>
4336
fc0c31f8 4337 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 4338 (conversationIdentifier): Return value is NSInteger.
784051c4 4339 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 4340
6e5d1c12
CY
43412012-07-21 Chong Yidong <cyd@gnu.org>
4342
4343 * window.c (decode_any_window): Signal an error if the window is
4344 on a dead frame (Bug#11984).
4345
9928463d
DA
43462012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4347
4348 Add indirection counting to speed up Fkill_buffer.
4349 * buffer.h (struct buffer): New member.
4350 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4351 (Fmake_indirect_buffer): Set indirection counter to -1, increment
4352 base buffer indirection counter.
4353 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4354 (Fkill_buffer): Adjust indirection counters as needed, don't walk
4355 through buffer list if indirection counter is 0.
4356
f8643a6b
DA
43572012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4358
4359 Extend the value returned by Fgarbage_collect with heap statistics.
4360 * alloc.c (Qheap): New symbol.
4361 (syms_of_alloc): DEFSYM it.
4362 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4363 (Fmemory_free): Remove.
4364 (syms_of_alloc): Don't defsubr it.
4365 * buffer.c (Fcompact_buffer): Remove.
4366 (syms_of_buffer): Don't defsubr it.
4367
dac616ff
DA
43682012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4369
4370 Make maybe_gc inline.
4371 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4372 * lisp.h (consing_since_gc, gc_relative_threshold)
4373 (memory_full_cons_threshold): Revert declaration.
4374 (maybe_gc): Remove prototype, define as inline.
4375 * alloc.c: Remove old commented-out code.
4376 (consing_since_gc, gc_relative_threshold)
4377 (memory_full_cons_threshold): Revert to global.
4378 (maybe_gc): Remove.
4379
d7ea76b4
DA
43802012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4381
4382 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4383 * lisp.h (build_unibyte_string): New function.
4384 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4385 * sysdep.c, w32fns.c, xfns.c: Use it.
4386 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4387 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4388 Adjust users accordingly.
4389 * font.h (font_open_by_name): Adjust prototype.
4390
765e61e3
DA
43912012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4392
4393 Cleanup calls to Fgarbage_collect.
4394 * lisp.h (maybe_gc): New prototype.
4395 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4396 Remove declarations.
4397 * alloc.c (maybe_gc): New function.
4398 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4399 Make them static.
4400 * bytecode.c (MAYBE_GC): Use maybe_gc.
4401 * eval.c (eval_sub, Ffuncall): Likewise.
4402 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4403 to avoid dependency from auto-save feature.
4404
52b852c7
PE
44052012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4406
4407 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4408 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4409 'for_each_per_buffer_object_at'.
4410 All uses changed. It's better to use upper-case for macros that
4411 cannot be implemented as functions, to give the reader a clue
4412 that they're special.
4413
5db81e33
SM
44142012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4415
4416 * alloc.c (Fgarbage_collect): Tweak docstring.
4417
5b835e1d
DA
44182012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4419
4420 Tweak the value returned from Fgarbage_collect again.
4421 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4422 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4423 Adjust documentation.
4424 (total_vector_bytes): Rename to total_vector_slots, adjust
4425 accounting.
4426 (total_free_vector_bytes): Rename to total_free_vector_slots,
4427 adjust accounting.
4428 (Qstring_bytes, Qvector_slots): New symbols.
4429 (syms_of_alloc): DEFSYM them.
4430
9cd47b72
DA
44312012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4432
4433 Buffer compaction primitive which may be used from Lisp.
4434 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4435 (syms_of_buffer): Register Fcompact_buffer.
4436 * alloc.c (Fgarbage_collect): Use compact_buffer.
4437 * buffer.h (compact_buffer): New prototype.
4438 (struct buffer_text): New member.
4439
d17337e5
DA
44402012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4441
4442 New macro to iterate over all buffers, miscellaneous cleanups.
4443 * lisp.h (all_buffers): Remove declaration.
4444 * buffer.h (all_buffers): Add declaration, with comment.
4445 (for_each_buffer): New macro.
4446 * alloc.c (Fgarbage_collect, mark_object): Use it.
4447 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4448 (init_buffer): Likewise.
4449 * data.c (Fset_default): Likewise.
4450 * coding.c (code_conversion_restore): Remove redundant check
4451 for dead buffer.
4452 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4453
60cfd278
AS
44542012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4455
4456 Fix bug that created negative-length intervals.
4457 * intervals.c (merge_interval_right, merge_interval_left):
4458 Do not zero out this interval if it is absorbed by its children,
4459 as this interval's total length doesn't change in that case. See
4460 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4461
d06714cb
PE
44622012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4463
83713154
PE
4464 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4465 when invoking (make-bool-vector N t) and N is a positive
4466 multiple of 8 -- the last 8 bits were mistakenly cleared.
4467
d06714cb
PE
4468 Remove some struct layout assumptions in bool vectors.
4469 * alloc.c (bool_header_size): New constant.
4470 (header_size, word_size): Move earlier, as they're now used earlier.
4471 Use 'word_size' in a few more places, where it's appropriate.
4472 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4473 padding before the data member of a bool vector.
4474 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4475 than doing the check by hand with an abort ().
4476
464d5a5e
SM
44772012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4478
5fbc0409
SM
4479 * eval.c (Fdefvar): Don't check constants since we only set the var if
4480 it's not yet defined anyway (bug#11904).
4481
464d5a5e
SM
4482 * lisp.h (last_undo_boundary): Declare new var.
4483 * keyboard.c (command_loop_1): Set it.
4484 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4485 were auto-added by the command loop (bug#11774).
4486
8dc2e44a
AS
44872012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4488
4489 * w32font.c (Qsymbol): Remove local definition.
4490 (syms_of_w32font): Don't DEFSYM it.
4491
169925ec
DA
44922012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4493
4494 Fix sweep_vectors to handle large bool vectors correctly.
4495 * alloc.c (sweep_vectors): Account total_vector_bytes for
4496 bool vectors larger than VBLOCK_BYTES_MAX.
4497
5fbfb018
CY
44982012-07-18 Chong Yidong <cyd@gnu.org>
4499
4500 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4501 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4502
3ab6e069
DA
45032012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4504
4505 Return more descriptive data from Fgarbage_collect.
4506 Suggested by Stefan Monnier in
4507 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4508 * alloc.c (bounded_number): New function.
4509 (total_buffers, total_vectors): New variable.
4510 (total_string_size): Rename to total_string_bytes, adjust users.
4511 (total_vector_size): Rename to total_vector_bytes, adjust users.
4512 (sweep_vectors): Account total_vectors and total_vector_bytes.
4513 (Fgarbage_collect): New return value. Adjust documentation.
4514 (gc_sweep): Account total_buffers.
4515 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4516 (VECTOR_SIZE): Remove.
4517 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4518 (Qinterval, Qmisc): New symbols.
4519 (syms_of_data): Initialize them.
4520 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4521 (Qcons, Qbuffer): New declarations.
4522
6d02fe5b
PE
45232012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4524
4525 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4526 Round up, not down. Improve doc.
4527
b7ffe040
DA
45282012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4529
4530 Restore old code in allocate_string_data to avoid Faset breakage.
4531 Reported by Julien Danjou <julien@danjou.info> in
4532 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4533 * alloc.c (allocate_string_data): Restore old code with minor
4534 adjustments, fix comment to explain this subtle issue.
4535
4dc7c8d5
SM
45362012-07-17 Eli Zaretskii <eliz@gnu.org>
4537
4538 Remove FILE_SYSTEM_CASE.
4539 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4540
4541 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4542 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4543 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4544 call-process-region passes it through expand-file-name.
4545
4546 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4547
45482012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4549
4550 Fix crash when creating indirect buffer (Bug#11917)
4551 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4552 Don't handle unbound variables specially if non-zero.
4553 (Fbuffer_local_variables): Pass zero.
4554 (clone_per_buffer_values): Pass non-zero.
4555
45562012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4557
4558 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4559 to make the loop interruptible.
4560
45612012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4562
4563 * gnutls.c (emacs_gnutls_handshake): Only retry if
4564 GNUTLS_E_INTERRUPTED.
4565
cce7fefc
DA
45662012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4567
4568 Cleanup and convert miscellaneous checks to eassert.
4569 * alloc.c (mark_interval): Fix comment, partially rephrase
4570 old comment from intervals.h (see below).
4571 * intervals.c (find_interval, adjust_intervals_for_insertion)
4572 (delete_interval, adjust_intervals_for_deletion)
4573 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4574 Convert to eassert.
4575 (adjust_intervals_for_insertion, make_new_interval):
4576 Remove obsolete and unused code.
4577 * intervals.h (struct interval): Remove obsolete comment.
4578 * textprotp.c (erase_properties): Remove unused code.
4579 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4580 (Fremove_list_of_text_properties): Convert to eassert.
4581
9ea10cc3
CY
45822012-07-17 Chong Yidong <cyd@gnu.org>
4583
4584 * editfns.c (Finsert_char): Doc fix.
4585
3900d5de
DA
45862012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4587
4588 Fix previous change to make Fmemory_free always accurate.
4589 * alloc.c (make_interval): Update total_free_intervals.
4590 (make_float): Likewise for total_free_floats.
4591 (free_cons, Fcons): Likewise for total_free_conses.
4592 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4593 Likewise for total_free_vector_bytes.
4594 (Fmake_symbol): Likewise for total_free_symbols.
4595 (bytes_free): Remove.
4596
7098646f
DA
45972012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4598
4599 Simple free memory accounting feature.
4600 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4601 (sweep_vectors): Accumulate size of free vectors.
4602 (Fgarbage_collect): Setup bytes_free.
4603 (Fmemory_free): New function.
4604 (syms_of_alloc): Register it.
4605
22657b40
DA
46062012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4607
4608 Cleanup overlays checking.
4609 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4610 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4611 eassert and OVERLAYP.
4612 (sort_overlays): Change to use OVERLAYP.
4613
ddfc8813
RK
46142012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4615
4616 * editfns.c (Finsert_char): Make it interactive, and make the
4617 second arg optional. Copy interactive spec and docstring from
4618 ucs-insert.
4619
7c26cf3c
PE
46202012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4621
4622 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4623 Unlike the other wrapped functions, fabs has an unspecified
4624 effect on errno.
4625
5d127af9
JD
46262012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4627
4628 * nsterm.m (keyDown): Interpret flags without left/right bits
4629 as the left key (Bug#11670).
4630
6a0dd1d7
DA
46312012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4632
4633 Remove empty and useless init functions.
4634 * lisp.h (init_character_once, init_fns, init_image)
4635 (init_filelock, init_sound): Remove prototype.
4636 * character.c (init_character_once): Remove.
4637 * filelock.c (init_filelock): Likewise.
4638 * fns.c (init_fns): Likewise.
4639 * image.c (init_image): Likewise.
4640 * sound.c (init_sound): Likewise.
4641 * emacs.c (main): Adjust accordingly.
4642
7a6136fd
DA
46432012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4644
4645 * gtkutil.h: Tiny cleanups.
4646 (use_old_gtk_file_dialog): Remove useless declaration.
4647 (xg_uses_old_file_dialog): Add suggested const attribute.
4648
ce811ad9
EZ
46492012-07-15 Eli Zaretskii <eliz@gnu.org>
4650
4651 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4652 (bidi_paragraph_init): Use it to limit search forward for a strong
4653 directional character in abnormally large paragraphs full of
4654 neutral or weak characters. (Bug#11943)
4655
c9adfeaa
SF
46562012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4657
4658 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4659 the toolbar (Bug#9451).
4660 (xg_make_tool_item): Give the widget event box a transparent
4661 background.
4662
fff62aa9
DA
46632012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4664
4665 Cleanup basic allocation variables and functions.
4666 * alloc.c (ignore_warnings, init_intervals, init_float)
4667 (init_cons, init_symbol, init_marker): Remove.
4668 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4669 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4670 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4671 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4672 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4673 (staticidx, init_alloc_once, init_strings, free_ablock):
4674 Remove redundant initialization.
4675 * fns.c (init_weak_hash_tables): Remove.
4676 * lisp.h (init_weak_hash_tables): Remove prototype.
4677
9730daca
DA
46782012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4679
4680 Use zero_vector where appropriate.
4681 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4682 accordingly.
4683 * lisp.h (zero_vector): New declaration.
4684 * font.c (null_vector): Remove.
4685 (syms_of_font): Remove initialization and staticpro.
4686 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4687 * keymap.c (Faccessible_keymaps): Likewise.
4688
2e2d2a13
LL
46892012-07-15 Leo Liu <sdl.web@gmail.com>
4690
4691 * fringe.c: Fix typo in comments.
4692
cd276f6e
LL
46932012-07-14 Leo Liu <sdl.web@gmail.com>
4694
4695 * fringe.c: Add a new bitmap exclamation-mark.
4696
5a1131d9
EZ
46972012-07-14 Eli Zaretskii <eliz@gnu.org>
4698
4699 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4700
4701 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4702 (HAVE_MENUS): Don't define, defined by editing config.in with
4703 msdos/sed2v2.inp.
4704 (GMALLOC_INHIBIT_VALLOC): Don't define.
4705 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4706
22e983b7
JB
47072012-07-14 Juanma Barranquero <lekktu@gmail.com>
4708
4709 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4710
5b3f250f
GM
47112012-07-14 Glenn Morris <rgm@gnu.org>
4712
4713 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4714 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4715 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4716
33d63ff4
GM
47172012-07-13 Glenn Morris <rgm@gnu.org>
4718
5b633342
GM
4719 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4720
33d63ff4
GM
4721 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4722 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4723
b55b9f85
JD
47242012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4725
0dc8cf50
JD
4726 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4727 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4728 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4729 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4730 where appropriate.
4731 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4732 as boolean expression.
4733 (x_set_window_size): Remove unused variable toolbar.
4734 (ns_get_color_default, ns_mod_to_lisp): Remove.
4735 (ns_mouse_position): Remove unused variables xchar and ychar.
4736 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4737 (ns_set_vertical_scroll_bar): Remove unused variable count.
4738 (ns_delete_terminal): Remove unused variable i.
4739 (ns_term_init): Remove unused variables r, g and b.
4740 (mouseDown): Remove unused variable window.
4741 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4742 (initFrameFromEmacs): Remove unused variable vbextra.
4743 (mouseEntered): Remove unused variables p and dpyinfo.
4744 (mouseExited): Remove unused variables p and r.
4745 (ns_define_frame_cursor, ns_clear_frame_area)
4746 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4747 (menuDown): Assign [sender tag] to variable and cast the variable.
4748
4749 * nsterm.h (menuDown): Add id as type to argument sender.
4750 (ns_display_info_for_name): Add Lisp_Object argument.
4751 (ns_term_init): Add Lisp_Object argument.
4752 (ns_map_event_to_object): Add void argument.
4753 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4754 prototype with arguments and only declare if __OBJC__.
4755 (nxatoms_of_nsselect): Add void argument.
4756 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4757 (ns_alloc_autorelease_pool): Add void argument.
4758 (ns_release_autorelease_pool): Add void* argument.
4759 (ns_get_defaults_value): Add const char* argument.
4760
4761 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4762 (initFromContents): Use SSDATA where appropriate.
4763 (ns_update_menubar): Add braces to ambigous if-else.
4764 (initWithTitle): Put () around assignment in if statement.
4765 (ns_menu_show): Remove unused variables window and keymap.
4766 (update_frame_tool_bar): Remove unused variable selected_p.
4767 (initWithContentRect): Remove unused variable this_cmd_name.
4768
4769 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4770 appropriate.
4771 (setXBMColor): Remove unused variable len.
4772 (setPixmapData): Put () around assignment in loop statement.
4773
4774 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4775 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4776 where appropriate.
4777 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4778 around assignment in loop statement.
4779 (nsfont_open): Remove unused variable i.
4780 (nsfont_open): Remove unused variable len.
4781 (nsfont_draw): Remove unused variable cs.
4782
4783 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4784 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4785 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4786 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4787 (Fns_font_name, Fns_perform_service)
4788 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4789 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4790 (ns_set_name): Remove unused variable view.
4791 (x_set_menu_bar_lines): Remove unused variable olines.
4792 (x_set_tool_bar_lines): Remove unused variable root_window.
4793 (Fns_list_colors): Put () around assignment in while statement.
4794 (Fns_perform_service): Remove unused variable len.
4795 (Fns_display_usable_bounds): Remove unused variable top.
4796 (syms_of_nsfns): Remove unused variable i.
4797
b55b9f85
JD
4798 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4799 memcpy (Bug#11907).
4800
ed9265fc 48012012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
4802
4803 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4804 and free it with DestroyExceptionInfo (Bug#11558).
4805
ef099b57
JB
48062012-07-13 Juanma Barranquero <lekktu@gmail.com>
4807
4808 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4809 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4810 Set here, not in nt/config.nt.
4811
ea814a5d
EZ
48122012-07-13 Eli Zaretskii <eliz@gnu.org>
4813
4814 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4815 cursor overflow into the last glyph on display line when the right
4816 fringe is off. (Bug#11832)
4817
1a952767
PE
48182012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4819
4820 * xdisp.c (produce_special_glyphs): Now static.
4821 * dispextern.h (produce_special_glyphs): Remove decl.
4822
983188fd
GM
48232012-07-13 Glenn Morris <rgm@gnu.org>
4824
8d7c7eed 4825 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
4826 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4827
983188fd
GM
4828 * s/usg5-4-common.h (USG, USG5):
4829 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4830 * s/sol2-6.h (SOLARIS2):
4831 * s/irix6-5.h (IRIX6_5):
4832 * s/hpux10-20.h (USG, USG5, HPUX):
4833 * s/gnu-linux.h (USG, GNU_LINUX):
4834 * s/freebsd.h (BSD_SYSTEM):
4835 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4836 * s/cygwin.h (CYGWIN):
4837 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4838 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4839
d1e68667 48402012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
4841
4842 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 4843
6de0e799
GM
48442012-07-13 Glenn Morris <rgm@gnu.org>
4845
739ae010
GM
4846 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4847
dbee5793
GM
4848 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4849
6de0e799
GM
4850 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4851 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4852
b82da769
GM
48532012-07-12 Glenn Morris <rgm@gnu.org>
4854
4fae5a7a 4855 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
4856
4857 * process.c (init_process_emacs): Rename from init_process.
4858 The old name is also the name of a Mach system call.
4859 * lisp.h, emacs.c: Update for this name change.
4860 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4861 longer needed.
4862
5a979817
EZ
48632012-07-12 Eli Zaretskii <eliz@gnu.org>
4864
4865 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4866 memmove call that removes glyphs covered by the left truncation
4867 glyph. Improve commentary.
4868 (display_line): Fix display of continuation glyphs on GUI frames
4869 when the right fringe is turned off and variable-size fonts are
4870 used in the window. Move the code that appends a stretch glyph to
4871 produce_special_glyphs, so that it could be used for truncation
4872 and continuation glyphs alike.
4873 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4874 glyph of a suitably computed width, to align the special glyphs at
4875 the window margin. Code moved from display_line. (Bug#11832)
4876
3e91a053
GM
48772012-07-12 Glenn Morris <rgm@gnu.org>
4878
ba9e4b84
GM
4879 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4880
4881 * s/gnu-linux.h, s/hpux10-20.h:
4882 Do not unconditionally define HAVE_XRMSETDATABASE.
4883
3e91a053
GM
4884 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4885
b300b1f4
PE
48862012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4887
4888 Fix typos that broke OS X build.
4889 Reported by Randal L. Schwartz in
4890 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4891 * nsterm.m (ns_timeout): Add missing local decl.
4892 (ns_get_color): snprintf -> sprintf, to fix typo.
4893
6e777848
GM
48942012-07-12 Glenn Morris <rgm@gnu.org>
4895
3f922c37
GM
4896 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4897 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4898 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4899 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4900
0ab7b23a
GM
4901 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4902 Move PTY_OPEN to configure.
4903
6e777848
GM
4904 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4905 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4906 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4907
4a7edc24
DA
49082012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4909
4910 Use empty_unibyte_string where applicable.
4911 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4912 * lread.c (read1): Likewise.
4913 * xsettings.c (syms_of_xsettings): Likewise.
4914
308aab79
GM
49152012-07-12 Glenn Morris <rgm@gnu.org>
4916
42bd1719
GM
4917 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4918 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
4919 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4920 * s/hpux10-20.h (RUN_TIME_REMAP):
4921 * s/bsd-common.h (TABDLY): Move to configure.
4922
4923 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4924
4925 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4926
ea0bbd17 4927 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 4928 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
4929
4930 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 4931
308aab79
GM
4932 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4933 * s/template.h: Move NARROWPROTO to configure.
4934
ee1cf5cf
GM
49352012-07-11 Glenn Morris <rgm@gnu.org>
4936
30fe9bf4
GM
4937 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4938 unused since 2011-01-17 change to systty.h.
4939
ee1cf5cf
GM
4940 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4941 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4942 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4943
63e47e07
PE
49442012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4945
4946 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4947
c43fb4c3
GM
49482012-07-11 Glenn Morris <rgm@gnu.org>
4949
4950 * s/darwin.h, s/gnu-linux.h, s/template.h:
4951 Move INTERRUPT_INPUT to configure.
4952
e8df9267
DA
49532012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4954
4955 Minor adjustments to interning code.
4956 * lisp.h (intern, intern_c_string): Redefine as static inline
4957 wrappers for intern_1 and intern_c_string_1, respectively.
4958 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
4959 * lread.c (intern_1, intern_c_string_1, oblookup):
4960 Simplify Vobarray checking.
e8df9267
DA
4961 * font.c (font_intern_prop): Likewise. Adjust comment.
4962 * w32font.c (intern_font_name): Likewise.
4963
34348bd4
AS
49642012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4965
d96a1e0c
AS
4966 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4967
34348bd4
AS
4968 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4969 of Fcar/Fcdr if possible.
4970 * font.c (check_otf_features): Likewise.
4971 * fontset.c (Fnew_fontset): Likewise.
4972 * gnutls.c (Fgnutls_boot): Likewise.
4973 * minibuf.c (read_minibuf): Likewise.
4974 * msdos.c (IT_set_frame_parameters): Likewise.
4975 * xmenu.c (Fx_popup_dialog): Likewise.
4976 * w32menu.c (Fx_popup_dialog): Likewise.
4977
c8add24e
GM
49782012-07-11 Glenn Morris <rgm@gnu.org>
4979
4b575b3c
GM
4980 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4981 since nothing has defined it on these platforms.
4982
09f4e3b0
GM
4983 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4984 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4985
172bedef
GM
4986 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4987 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4988 Move CLASH_DETECTION to configure.
4989
249685df
GM
4990 * s/gnu.h: Remove file, which is now empty.
4991
c8add24e
GM
4992 * s/gnu.h, s/gnu-linux.h:
4993 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4994
b41253a3
JW
49952012-07-11 John Wiegley <johnw@newartisans.com>
4996
4997 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4998 function attribute, so we only use it if it exists in the
4999 compiler.
5000
d923b542
DA
50012012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5002
5003 Avoid call to strlen in fast_c_string_match_ignore_case.
5004 * search.c (fast_c_string_match_ignore_case): Change to use
5005 length argument. Adjust users accordingly.
5006 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
5007
5ebbef1d
PE
50082012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5009
bb352260
PE
5010 Assume mkdir, rmdir.
5011 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
5012 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
5013
57054ddd
PE
5014 Assume rename.
5015 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
5016
b747d3f7
PE
5017 Assume perror.
5018 * s/hpux10-20.h (HAVE_PERROR): Remove.
5019 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
5020 Remove dummy definition, as this problem was obsolete long ago.
5021
5ebbef1d
PE
5022 Assume strerror.
5023 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5024
984e7f30
DA
50252012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5026
5027 Avoid calls to strlen in font processing functions.
5028 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
5029 (font_open_by_name): Change to use length argument.
5030 Adjust users accordingly.
d923b542
DA
5031 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5032 Adjust prototypes.
5033 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5034 Change to return ptrdiff_t.
984e7f30
DA
5035 (xfont_list_pattern, xfont_match): Use length returned by
5036 xfont_decode_coding_xlfd.
5037 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5038
20e94fdd
GM
50392012-07-11 Glenn Morris <rgm@gnu.org>
5040
9d596af3
GM
5041 * s/darwin.h, s/freebsd.h, s/netbsd.h:
5042 Move DONT_REOPEN_PTY to configure.
5043
20e94fdd
GM
5044 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5045 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5046
e99a530f
PE
50472012-07-10 Paul Eggert <eggert@cs.ucla.edu>
5048
22ffb973
PE
5049 Remove "#define unix" that is no longer needed (Bug#11905).
5050 * s/aix4-2.h (unix): Remove; no longer needed.
5051
e9a9ae03
PE
5052 EMACS_TIME simplification (Bug#11875).
5053 This replaces macros (which typically do not work in GDB)
5054 with functions, typedefs and enums, making the code easier to debug.
5055 The functional style also makes code easier to read and maintain.
5056 * systime.h: Include <sys/time.h> on all hosts, not just if
5057 WINDOWSNT, since 'struct timeval' is needed in general.
5058 (EMACS_TIME): Now a typedef, not a macro.
5059 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5060 not macros.
5061 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
5062 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
5063 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
5064 (EMACS_TIME_LE): Now functions, not macros.
5065 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
5066 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
5067 which are not functions. All uses rewritten to use:
5068 (make_emacs_time): New function.
5069 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5070 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5071 not functions. All uses rewritten to use the following, respectively:
5072 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5073 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 5074 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
5075 * fileio.c (Fcopy_file):
5076 * xterm.c (XTflash): Get the current time closer to when it's used.
5077 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5078
ffacb126
PE
5079 * bytecode.c (targets): Suppress -Woverride-init warnings.
5080
e99a530f
PE
5081 Simplify by avoiding confusing use of strncpy etc.
5082 * doc.c (Fsnarf_documentation):
5083 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5084 * frame.c (Fmake_terminal_frame):
5085 * gtkutil.c (get_utf8_string):
5086 * lread.c (openp):
5087 * nsmenu.m (ns_update_menubar):
5088 * regex.c (regerror):
5089 Prefer memcpy to strncpy and strncat when either will do.
5090 * fileio.c (Fsubstitute_in_file_name):
5091 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5092 (menu_separator_name_p):
5093 * nsmenu.m (ns_update_menubar):
5094 Prefer memcmp to strncmp when either will do.
5095 * nsterm.m: Include <ftoastr.h>.
5096 (ns_get_color):
5097 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5098 Prefer snprintf to strncpy.
5099 * nsterm.m (ns_term_init):
5100 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5101 * nsterm.m (ns_term_init):
5102 Avoid the need for strncpy, by using build_string or
5103 make_unibyte_string directly. Use dtoastr, not snprintf.
5104 * process.c (Fmake_network_process): Diagnose service names that
5105 are too long, rather than silently truncating them or creating
5106 non-null-terminated names.
5107 (Fnetwork_interface_info): Likewise, for interface names.
5108 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5109 Prefer sprintf to strncat.
5110 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5111 Prefer vsnprintf to vsprintf + strncpy.
5112
c59592b3
GM
51132012-07-10 Glenn Morris <rgm@gnu.org>
5114
5115 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5116 Clarify fallback case.
5117
7d7bbefd
DA
51182012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5119
5120 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5121 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5122 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 5123 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
5124 where argument type is known to be a Lisp_Cons.
5125
3a4c8000
TT
51262012-07-10 Tom Tromey <tromey@redhat.com>
5127
5128 * bytecode.c (BYTE_CODE_THREADED): New macro.
5129 (BYTE_CODES): New macro. Replaces all old byte-code defines.
5130 (enum byte_code_op): New type.
5131 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5132 (exec_byte_code): Use them. Use token threading when applicable.
5133
2a0213a6
DA
51342012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5135
5136 Optimize pure C strings initialization.
5137 * lisp.h (make_pure_string): Fix prototype.
5138 (build_pure_c_string): New function, defined as static inline. This
5139 provides a better opportunity to optimize away calls to strlen when
5140 the function is called with compile-time constant argument.
5141 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
5142 argument, adjust users accordingly. Use build_pure_c_string where
5143 appropriate.
5144 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
5145 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
5146 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
5147
cb1caeaf
DA
51482012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5149
5150 Avoid calls to strlen in miscellaneous functions.
5151 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
5152 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
5153 * lread.c (openp): Likewise.
5154
c293e30c
DA
51552012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5156
5157 Avoid calls to strlen in path processing functions.
5158 * fileio.c (file_name_as_directory): Add comment. Change to add
5159 srclen argument and return the length of result. Adjust users
5160 accordingly.
5161 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
5162 swap 1st and 2nd arguments to obey the common convention.
5163 Adjust users accordingly.
c293e30c
DA
5164 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
5165
9e059e3f
GM
51662012-07-10 Glenn Morris <rgm@gnu.org>
5167
d02eb359
GM
5168 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
5169 Move PENDING_OUTPUT_COUNT definition to configure.
5170
882cf227
GM
5171 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
5172 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
5173 * s/gnu.h (DATA_START): Move definitions to configure.
5174
af6e839f
GM
5175 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
5176 We include usg5-4-common.h, which defines them both.
5177
40289a12
GM
5178 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
5179 O_RDONLY already includes it).
5180
9e059e3f
GM
5181 Stop ns builds setting the EMACSLOADPATH environment variable.
5182 * nsterm.m (ns_load_path): Rename from ns_init_paths.
5183 Now it does not set EMACSLOADPATH, just returns the load-path string.
5184 * nsterm.h: Update accordingly.
5185 * lread.c [HAVE_NS]: Include nsterm.h.
5186 (init_lread) [HAVE_NS]: Use ns_load_path.
5187 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
5188
7c4e8ec0
GM
51892012-07-09 Glenn Morris <rgm@gnu.org>
5190
d4f600ff
GM
5191 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
5192 since the included bsd-common.h does so.
5193
cbb31951
GM
5194 Stop ns builds setting the EMACSPATH environment variable.
5195 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
5196 (ns_init_paths): Do not set EMACSPATH.
5197 * nsterm.h (ns_exec_path): Add it.
5198 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
5199 Use ns_exec_path.
5200
7c4e8ec0
GM
5201 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
5202
26bccfae
PE
52032012-07-09 Paul Eggert <eggert@cs.ucla.edu>
5204
a0bee46f
PE
5205 * process.c (wait_reading_process_output): 'waitchannels' was unset
5206 when read_kbd || !NILP (wait_for_cell); fix this.
5207
5994c183
PE
5208 Add GCC-style 'const' attribute to functions that can use it.
5209 * character.h (char_resolve_modifier_mask):
5210 * keyboard.h (make_ctrl_char):
5211 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5212 (init_character_once, next_almost_prime, init_fns, init_image)
5213 (flush_pending_output, init_sound):
5214 * mem-limits.h (start_of_data):
5215 * menu.h (finish_menu_items):
5216 Add ATTRIBUTE_CONST.
5217 * emacs.c (DEFINE_DUMMY_FUNCTION):
5218 Declare the dummy function with ATTRIBUTE_CONST.
5219 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5220 Add decls with ATTRIBUTE_CONST.
5221
26bccfae
PE
5222 Minor improvements to make_formatted_string.
5223 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5224 where int is good enough, as vsprintf returns an int.
5225 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5226
a8290ec3
DA
52272012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5228
5229 Use make_formatted_string to avoid double length calculation.
5230 * lisp.h (make_formatted_string): New prototype.
5231 * alloc.c (make_formatted_string): New function.
5232 * buffer.c (Fgenerate_new_buffer_name): Use it.
5233 * dbus.c (syms_of_dbusbind): Likewise.
5234 * editfns.c (Fcurrent_time_zone): Likewise.
5235 * filelock.c (get_boot_time): Likewise.
5236 * frame.c (make_terminal_frame, set_term_frame_name)
5237 (x_report_frame_params): Likewise.
5238 * image.c (gs_load): Likewise.
5239 * minibuf.c (get_minibuffer): Likewise.
5240 * msdos.c (dos_set_window_size): Likewise.
5241 * process.c (make_process): Likewise.
5242 * xdisp.c (ensure_echo_area_buffers): Likewise.
5243 * xsettings.c (apply_xft_settings): Likewise.
5244
d01ba2f1
GM
52452012-07-09 Glenn Morris <rgm@gnu.org>
5246
5247 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5248 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5249 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5250 * nsterm.h (ns_etc_directory): Add it.
5251 * callproc.c [HAVE_NS]: Include nsterm.h.
5252 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5253
f1f924b6
DA
52542012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5255
5256 Move marker debugging code under MARKER_DEBUG.
5257 * marker.c (MARKER_DEBUG): Move marker debugging code under
5258 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5259 for bootstrap with --enable-checking (~3x slowdown reported
5260 by Juanma Barranquero <lekktu@gmail.com>).
5261 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5262
ab531b66
PE
52632012-07-08 Paul Eggert <eggert@cs.ucla.edu>
5264
5265 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5266 See <http://bugs.gnu.org/11825#29>.
5267
c4b3bc8a
EZ
52682012-07-08 Eli Zaretskii <eliz@gnu.org>
5269
5270 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5271 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
5272 (display_line): Add commentary about displaying truncation glyphs
5273 on GUI frames.
5274 (produce_special_glyphs): Move here from term.c.
5275
5276 * term.c (produce_special_glyphs): Move to xdisp.c.
5277
5278 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5279 section.
c4b3bc8a 5280
b676b881
AS
52812012-07-07 Andreas Schwab <schwab@linux-m68k.org>
5282
f17c5273
AS
5283 * xdisp.c (display_line): Avoid warning about implicit declaration
5284 of FRAME_FONT.
5285
298819b9
AS
5286 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5287
b676b881
AS
5288 * lisp.h: Remove empty conditional.
5289
6045c4fd
PE
52902012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5291
b3350bf9
PE
5292 * lread.c (load_path_check): Now static.
5293
6045c4fd
PE
5294 Fix some minor --with-ns problems found by static checking.
5295 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
5296 (x_set_font) [!HAVE_X_WINDOWS]:
5297 * image.c (xpm_load_image) [HAVE_NS]:
5298 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
5299 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
5300 Remove unused local.
5301 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
5302 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
5303 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
5304 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
5305 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
5306 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
5307 Fix pointer signedness problem.
5308 * xfaces.c (FRAME_X_FONT_TABLE):
5309 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
5310
929e7845
GM
53112012-07-07 Glenn Morris <rgm@gnu.org>
5312
5313 * lread.c (load_path_check): New function, split from init_lread.
5314 (init_lread): Reorganize. Motivation:
5315 If EMACSLOADPATH is set, check/warn about that rather than the
5316 defaults, which we are not going to use. Hence we can remove
5317 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
5318 Don't warn if site-lisp directories are missing.
5319 If not installed, start from a blank load-path, since
5320 PATH_LOADSEARCH refers to the eventual installation directories.
5321
58dd0aa4
EZ
53222012-07-07 Eli Zaretskii <eliz@gnu.org>
5323
5324 Support truncation and continuation glyphs on GUI frames, when
5325 fringes are disabled. (Bug#11832)
5326 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
5327 continuation glyphs even if on GUI frames.
5328 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
5329 or both, are absent.
5330 (start_display, move_it_in_display_line_to): Handle the case of a
5331 GUI frame without a fringe to display continuation or truncation
5332 glyphs.
5333 (insert_left_trunc_glyphs): Support GUI frames: make sure
5334 truncation glyphs overwrite enough glyphs from the current line to
5335 have sufficient space in pixels.
5336 (display_line): Support truncation and continuation glyphs on GUI
5337 frames. If some spare pixels are left on the line after inserting
5338 the truncation glyphs, fill that space with a stretch glyph of a
5339 suitably computed width.
5340
5341 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5342 produce_glyphs, to support GUI sessions.
5343
31571fd7
PE
53442012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5345
5a16b9bc
PE
5346 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5347
f3047c75
PE
5348 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5349
31571fd7
PE
5350 Do not require float-time's arg to fit in time_t (Bug#11825).
5351 This works better on hosts where time_t is unsigned, and where
5352 float-time is applied to the (negative) difference between two times.
5353 * editfns.c (decode_time_components): Last arg is now double *,
5354 not int *, and means to store all the result as a double, without
5355 worrying about whether the seconds part fits in time_t.
5356 All callers changed.
5357 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5358 All callers changed.
5359 (Ffloat_time): Do not fail merely because the specified time falls
5360 outside of time_t range.
5361
4516fbef
GM
53622012-07-07 Glenn Morris <rgm@gnu.org>
5363
5364 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5365 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5366 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5367
07adc2c6
JB
53682012-07-07 Juanma Barranquero <lekktu@gmail.com>
5369
5370 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5371 Update dependencies.
5372
5373 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5374
fd573f31
PE
53752012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5376
fee5959d
PE
5377 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5378 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5379 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5380 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5381 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5382 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5383
fd573f31
PE
5384 * xfont.c (compare_font_names): Redo to omit the need for casts.
5385
ddadbc0e
AS
53862012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5387
fca8d6b6
AS
5388 * xfns.c (Fx_change_window_property): Doc fix.
5389 * w32fns.c (Fx_change_window_property): Doc fix.
5390
ddadbc0e
AS
5391 * w32fns.c (Fx_window_property): Accept the same arguments as the
5392 X Windows version. Doc fix.
5393 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5394
ed9265fc 53952012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
5396 Eli Zaretskii <eliz@gnu.org>
5397
5398 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5399 Windows-specific code from nt/config.nt moved here.
5400 Obsolete settings removed.
5401
216ee680
PE
54022012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5403
5404 * process.c: Avoid unnecessary calls to gettime.
5405 (wait_reading_process_output): Don't get the time of day
5406 when gobbling data immediately and not waiting, as there's no need
5407 for it in that case. This removes a FIXME.
5408
bdd091e4
JD
54092012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5410
5411 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5412 is defined (Bug#11768).
5413
9d44f8ce
DA
54142012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5415
5416 Fix marker debugging code.
5417 * marker.c (byte_char_debug_check): Do not perform the check
5418 if buffer is not multibyte.
090bd7cb
JB
5419 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5420 Call byte_char_debug_check with correct arguments.
9d44f8ce 5421
90fc4786
DA
54222012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5423
5424 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
5425 * marker.c (byte_char_debug_check, count_markers):
5426 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
5427 (byte_debug_flag): Remove.
5428 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5429 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5430
7b7ae965
DA
54312012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5432
4e57b342
DA
5433 Avoid code repetition in marker-related functions.
5434 * marker.c (attach_marker): New function.
5435 (Fset_marker, set_marker_restricted, set_marker_both)
5436 (set_marker_restricted_both): Use it.
5437 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5438 Consistently rename charno to charpos.
5439 (marker_position): Add eassert.
5440 (marker_byte_position): Convert to eassert.
5441
54422012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5443
5444 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 5445 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 5446 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 5447
657924ff
DA
54482012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5449
5450 Introduce fast path for the widely used marker operation.
5451 * alloc.c (build_marker): New function.
5452 * lisp.h (build_marker): New prototype.
5453 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5454 * composite.c (autocmp_chars): Likewise.
5455 * editfns.c (buildmark): Remove.
5456 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5457 (save_restriction_save): Use build_marker.
5458 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5459 * window.c (save_window_save): Likewise.
5460
041a49a6
DA
54612012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5462
5463 Do not use Fdelete_overlay in delete_all_overlays
5464 to avoid redundant calls to unchain_overlay.
5465 * buffer.c (drop_overlay): New function.
5466 (delete_all_overlays, Fdelete_overlay): Use it.
5467 * minibuf.c (get_minibuffer): Fix comment.
5468
7dca65a4
PE
54692012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5470
5471 Port to OpenBSD 5.1 amd64.
5472 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5473 This is needed for OpenBSD, and should be harmless on all BSD systems.
5474 Also, include <sys/sysctl.h>, as it should be available on all
5475 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5476 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5477 use p_pid member, not kp_proc.pid.
5478
8eb876e2
GM
54792012-07-06 Glenn Morris <rgm@gnu.org>
5480
5481 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5482
38182d90
PE
54832012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5484
5485 More xmalloc and related cleanup.
5486 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5487 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5488 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5489 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5490 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5491 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5492 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5493 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5494 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5495 * xterm.c:
5496 Omit needless casts involving void * pointers and allocation.
5497 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5498 as the former is more robust if P's type is changed.
5499 Prefer xzalloc to xmalloc + memset 0.
5500 Simplify malloc-or-realloc to realloc.
5501 Don't worry about xmalloc returning a null pointer.
5502 Prefer xstrdup to xmalloc + strcpy.
5503 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5504 growing it.
5505 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5506 alloca of a constant.
5507
6dd5a677
EZ
55082012-07-05 Eli Zaretskii <eliz@gnu.org>
5509
5510 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5511 hscroll is larger than the line width. Fixes long and futile
5512 looping inside extend_face_to_end_of_line (on a TTY) producing
5513 glyphs that are not needed and thrown away.
5514
6b312f0f
DA
55152012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5516
5517 * marker.c (set_marker_restricted_both): Simplify by using
5518 clip_to_bounds.
5519
f520ef9b
PE
55202012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5521
5522 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5523
383b7c95
JD
55242012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5525
5526 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5527 not defined (Bug#11768).
5528 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5529 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5530 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5531 followed by gtk_box_set_homogeneous (Bug#11768).
5532 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
5533 (update_theme_scrollbar_width, xg_create_scroll_bar):
5534 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
5535 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5536 (is_box_type): New function (Bug#11768).
5537 (xg_tool_item_stale_p): Call is_box_type.
5293d758 5538 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
5539 with default display (Bug#11768).
5540
d6e7bf45
EZ
55412012-07-05 Eli Zaretskii <eliz@gnu.org>
5542
5543 * xdisp.c (window_hscroll_limited): New function.
5544 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5545 coordinates when window's hscroll is set to insanely large
5546 values. (Bug#11857)
5547
431391ec
JB
55482012-07-05 Juanma Barranquero <lekktu@gmail.com>
5549
5550 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5551 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5552
23f86fce
DA
55532012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5554
5555 Cleanup xmalloc.
5556 * lisp.h (xzalloc): New prototype. Omit needless casts.
5557 * alloc.c (xzalloc): New function. Omit needless casts.
5558 * charset.c: Omit needless casts. Convert all calls to
5559 xmalloc with following memset to xzalloc.
5560 * dispnew.c: Likewise.
5561 * fringe.c: Likewise.
5562 * image.c: Likewise.
5563 * sound.c: Likewise.
5564 * term.c: Likewise.
5565 * w32fns.c: Likewise.
5566 * w32font.c: Likewise.
5567 * w32term.c: Likewise.
5568 * xfaces.c: Likewise.
5569 * xfns.c: Likewise.
5570 * xterm.c: Likewise.
5571 * atimer.c: Omit needless casts.
5572 * buffer.c: Likewise.
5573 * callproc.c: Likewise.
5574 * ccl.c: Likewise.
5575 * coding.c: Likewise.
5576 * composite.c: Likewise.
5577 * doc.c: Likewise.
5578 * doprnt.c: Likewise.
5579 * editfns.c: Likewise.
5580 * emacs.c: Likewise.
5581 * eval.c: Likewise.
5582 * filelock.c: Likewise.
5583 * fns.c: Likewise.
5584 * gtkutil.c: Likewise.
5585 * keyboard.c: Likewise.
5586 * lisp.h: Likewise.
5587 * lread.c: Likewise.
5588 * minibuf.c: Likewise.
5589 * msdos.c: Likewise.
5590 * print.c: Likewise.
5591 * process.c: Likewise.
5592 * region-cache.c: Likewise.
5593 * search.c: Likewise.
5594 * sysdep.c: Likewise.
5595 * termcap.c: Likewise.
5596 * terminal.c: Likewise.
5597 * tparam.c: Likewise.
5598 * w16select.c: Likewise.
5599 * w32.c: Likewise.
5600 * w32reg.c: Likewise.
5601 * w32select.c: Likewise.
5602 * w32uniscribe.c: Likewise.
5603 * widget.c: Likewise.
5604 * xdisp.c: Likewise.
5605 * xmenu.c: Likewise.
5606 * xrdb.c: Likewise.
5607 * xselect.c: Likewise.
5608
0497dc44
PE
56092012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5610
5611 * fileio.c (time_error_value): Check the right error number.
5612 Problem reported by Troels Nielsen in
5613 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5614
356e7178
PE
56152012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5616
4e71fd89
PE
5617 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5618 This should be fixed in a better way; see Eli Zaretskii in
5619 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5620 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5621
f0941253
PE
5622 * fileio.c (time_error_value): Rename from special_mtime.
5623 The old name's problems were noted by Eli Zaretskii in
5624 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5625
065c9eb4
PE
5626 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5627 This variable's comment says Emacs needs at least one GDB-visible
5628 symbol of type enum pvec_type, to work around GDB problems.
5629 The symbol's value doesn't matter.
5630
356e7178
PE
5631 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5632 that causes compilation to fail on pre-C99 compilers.
5633
ed9265fc 56342012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
5635
5636 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5637 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5638
3884d954
DA
56392012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5640
d209e2fb 5641 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
5642 headers for buffer_defaults and buffer_local_symbols.
5643 Reported by Juanma Barranquero <lekktu@gmail.com>.
5644
ee28be33
SM
56452012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5646
5647 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5648 * lisp.h (enum pvec_type): Use fewer bits.
5649 (PSEUDOVECTOR_SIZE_BITS): New constant.
5650 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5651 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5652 change in pvec_type.
5653 (PSEUDOVECTOR_TYPEP): New macro.
5654 (TYPED_PSEUDOVECTORP): Use it.
5655 * fns.c (internal_equal): Adapt code to extract pvectype.
5656 * emacs.c (gdb_pvec_type): Update type.
5657 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5658 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5659 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5660 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5661 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5662 abusing vector->header.next.nbytes.
5663 (live_vector_p): Use PVEC_TYPE.
5664 (mark_object): Adapt code to extract pvectype. Use switch.
5665
c7f2cd7f
PE
56662012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5667
5668 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5669 Tighten new eassert a bit.
5670
8ce70ed2
DA
56712012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5672
5673 Fix compilation with --enable-gcc-warnings and -O1
5674 optimization level.
5675 * doprnt.c (doprnt): Change type of tem to int, initialize
5676 to avoid compiler warning. Add eassert.
5677 * search.c (simple_search): Initialize match_byte to avoid
5678 compiler warning. Add eassert.
5679
dea7f1e5
PE
56802012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5681
24a212eb
PE
5682 Avoid weird behavior with large horizontal scrolls.
5683 Without this change, for example, large hscroll values would
5684 mess up Emacs's display on Fedora 15 x86, presumably due to
5685 overflows in int calculations in the display code.
5686 Also, if buffers had long lines, Emacs would freeze.
5687 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5688 (set_window_hscroll): New function, containing the old guts of
5689 Fset_window_hscroll. Return the clipped value.
5690 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5691 This avoids the need to check against PTRDIFF_MAX.
5692
dea7f1e5
PE
5693 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5694
76046526
DA
56952012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5696
5697 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5698
39adff0d
PE
56992012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5700
63807d47
PE
5701 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5702 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5703 since GCC 4.4.6 issues a bogus warning for them.
5704
39adff0d
PE
5705 Fix bugs in file timestamp newness comparisons.
5706 * fileio.c (Ffile_newer_than_file_p):
5707 * lread.c (Fload): Use full timestamp resolution of files,
5708 not just the 1-second resolution, so that files that are only
5709 slightly newer still count as newer.
5710 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5711 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5712
dbeed9a6
PE
57132012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5714
5715 * fileio.c: Improve handling of file time marker. (Bug#11852)
5716 (special_mtime): New function.
5717 (Finsert_file_contents, Fverify_visited_file_modtime):
5718 Use it to set special mtime values consistently.
5719
636334d6
AS
57202012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5721
5722 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5723 marker for non-existing file. (Bug#11852)
5724
e2017fe2
GM
57252012-07-03 Glenn Morris <rgm@gnu.org>
5726
5727 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5728 and did not make it into globals.h).
5729
404dbd37
TT
57302012-07-03 Tom Tromey <tromey@redhat.com>
5731
5732 * window.c (Fset_window_margins, Fset_window_fringes)
5733 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5734 * textprop.c (Fprevious_property_change): No longer static.
5735 * syntax.c (Fsyntax_table_p): No longer static.
5736 * process.c (Fget_process, Fprocess_datagram_address): No longer
5737 static.
5738 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5739 * keyboard.c (Fcommand_execute): No longer static.
5740 Remove EXFUN.
5741 * insdel.c (Fcombine_after_change_execute): No longer static.
5742 * image.c (Finit_image_library): No longer static.
5743 * fileio.c (Fmake_symbolic_link): No longer static.
5744 * eval.c (Ffetch_bytecode): No longer static.
5745 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
5746 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5747 No longer static.
404dbd37
TT
5748 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5749 static.
5750 * dired.c (Ffile_attributes): No longer static.
5751 * composite.c (Fcomposition_get_gstring): No longer static.
5752 * callproc.c (Fgetenv_internal): No longer static.
5753
5754 * ccl.h: Remove EXFUNs.
5755 * buffer.h: Remove EXFUNs.
5756 * dispextern.h: Remove EXFUNs.
5757 * intervals.h: Remove EXFUNs.
5758 * fontset.h: Remove EXFUN.
5759 * font.h: Remove EXFUNs.
5760 * dosfns.c (system_process_attributes): Remove EXFUN.
5761 * keymap.h: Remove EXFUNs.
5762 * lisp.h: Remove EXFUNs.
5763 * w32term.h: Remove EXFUNs.
5764 * window.h: Remove EXFUNs.
5765 * xsettings.h: Remove EXFUN.
5766 * xterm.h: Remove EXFUN.
5767
8e4fd1e1
GM
57682012-07-03 Glenn Morris <rgm@gnu.org>
5769
5770 * lisp.h (Frandom): Make it visible to C.
5771 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5772 buffer for invisible buffers. (Bug#1229)
5773
ca95b3eb
DA
57742012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5775
5776 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5777 values which aren't power of 2.
14ae4239
BT
5778 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5779 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
5780 accordingly.
5781
7555c33f
SM
57822012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5783
5784 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5785
5786 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5787
d12e8f5a
DA
57882012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5789
5790 * alloc.c (allocate_vector_block): Remove redundant
5791 calls to mallopt if DOUG_LEA_MALLOC is defined.
5792 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5793 avoid calls to mallopt if zero_vector is returned.
5794
296094c3
DA
57952012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5796
5797 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5798 is enabled, avoid dereferencing NULL current_sblock if
5799 running undumped.
5800
36429c89
DA
58012012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5802
5803 Cleanup basic buffer management.
5804 * buffer.h (struct buffer): Change layout to use generic vector
5805 marking code. Fix some comments. Change type of 'clip_changed'
5806 to bitfield. Remove unused #ifndef old.
5807 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5808 (GET_OVERLAYS_AT): Fix indentation.
5809 (for_each_per_buffer_object_at): New macro.
5810 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5811 (Fbuffer_local_variables): Use it.
5812 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5813 * alloc.c (allocate_buffer): Adjust to match new layout of
5814 struct buffer. Fix comment.
5815 (mark_overlay): New function.
5816 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5817 Lisp area of struct buffer.
5818 (mark_object): Use it. Adjust marking of misc objects
5819 and related comments.
5820
3b3e4cac
PE
58212012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5822
5823 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5824 wrapper that is not needed because the wrapped code is a no-op (zero
5825 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5826 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5827
cf5c0175
DA
58282012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5829
5830 * alloc.c (mark_buffer): Simplify. Remove prototype.
5831 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 5832 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
5833 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5834 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 5835
ca26824c
GM
58362012-06-30 Glenn Morris <rgm@gnu.org>
5837
2e4c5312
GM
5838 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5839
ca26824c
GM
5840 * epaths.in (PATH_SITELOADSEARCH): New.
5841 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5842 This is rather than relying on --enable-locallisppath elements
5843 having "site-lisp" in their names. (Bug#10208#25, 11658)
5844
0d23c240
EZ
58452012-06-30 Eli Zaretskii <eliz@gnu.org>
5846
c9240d7a
EZ
5847 * w32proc.c (sys_select): Accept and ignore one more argument.
5848
5849 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5850
0d23c240 5851 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 5852 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
5853
5854 * sysdep.c: Don't include dos.h and dosfns.h.
5855
5856 * process.c (sys_select):
5857 * msdos.c (sys_select): Accept one more argument and ignore it.
5858
5859 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5860 adapt data types and code to that.
5861
5862 * dosfns.c:
5863 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5864 which clashes with the gnulib function of the same name.
5865
af5a5a98
AS
58662012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5867
c5e4379c
AS
5868 * font.c (font_style_to_value, font_style_symbolic)
5869 (font_prop_validate_style): Add type checks for values in
5870 font_style_table.
5871
af5a5a98
AS
5872 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5873 argument.
5874 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5875 uses.
5876
8d38f461
EZ
58772012-06-29 Eli Zaretskii <eliz@gnu.org>
5878
2e5a6631
EZ
5879 * xdisp.c (try_window_id): Undo last change.
5880
8d38f461
EZ
5881 * w32.c (getwd): Adjust commentary about startup_dir.
5882 (init_environment): Always call sys_access, even in non-MSVC
5883 builds. Don't chdir to the directory of the Emacs executable.
5884 This undoes code from 1997 which was justified by the need to
5885 "avoid conflicts when removing and renaming directories". But its
5886 downside was that every relative file name was being interpreted
5887 relative to the directory of the Emacs executable, which can never
5888 be TRT. In particular, it broke sys_access when called with
5889 relative file names.
5890 (sys_access): Map GetLastError to errno.
5891
2af3565e
DA
58922012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5893
5894 * window.h (struct window): Change type of 'fringes_outside_margins'
5895 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 5896 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
5897 Adjust comment.
5898 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5899 to ptrdiff_t.
5900
c8d3a25c 59012012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 5902
c8d3a25c
GM
5903 * gnutls.c (emacs_gnutls_handshake):
5904 Add QUIT to make the loop interruptible.
57570cd3 5905
c8d3a25c 59062012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 5907
c8d3a25c
GM
5908 * charset.c (init_charset): Make lack of etc/charsets fatal.
5909
3e984ee8
DA
59102012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5911
5912 * editfns.c (region_limit): Fix type mismatch.
5913
ef884f23
DA
59142012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5915
5916 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5917 undefined. Convert from xassert to eassert.
5918 * nsmenu.m: Convert from xassert to eassert.
5919 * nsterm.m: Likewise.
5920
7d7e0027
SM
59212012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5922
5923 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5924
aa754e6a
PE
59252012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5926
5927 Avoid integer overflow on scroll-left and scroll-right.
5928 * window.c (HSCROLL_MAX): New macro.
5929 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5930 overflow when requested scroll falls outside ptrdiff_t range.
5931
80b00b08
DA
59322012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5933
5934 * window.h (struct window): Change type of 'hscroll',
5935 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5936 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5937 Adjust users accordingly.
5938 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5939 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5940 from EMACS_INT to ptrdiff_t.
5941 (make_window): Omit redundant initialization.
5942
62b2bcf6
JB
59432012-06-28 Juanma Barranquero <lekktu@gmail.com>
5944
5945 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5946
45942c7d
DA
59472012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5948
5949 * window.h (struct window): Change type of 'use_time' and
5950 'sequence_number' from Lisp_Object to int.
5951 * frame.c (make_frame): Adjust users accordingly.
5952 * print.c (print_object): Likewise.
5953 * window.c (select_window, Fwindow_use_time, make_parent_window)
5954 (make_window): Likewise.
5955
e509cfa6
DA
59562012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5957
5958 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5959 enabled with --enable-checking=[all,glyphs] configure option.
5960 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5961 adjust comments accordingly.
5962 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5963 undefined, adjust comments accordingly.
5964 * image.c: Likewise.
5965 * scroll.c: Likewise.
5966 * w32fns.c: Likewise.
5967 * w32term.c: Likewise.
5968 * xdisp.c: Likewise.
5969 * xfaces.c: Likewise.
5970 * xfns.c: Likewise.
5971 * xterm.c: Likewise.
5972
a54e2c05
DA
59732012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5974
5975 Generalize run-time debugging checks.
5976 * dispextern.h (XASSERTS): Remove.
5977 * fontset.c (xassert): Remove.
5978 Convert from xassert to eassert.
5979 * alloc.c: Convert from xassert to eassert.
5980 * bidi.c: Likewise.
5981 * dispnew.c: Likewise.
5982 * fns.c: Likewise.
5983 * fringe.c: Likewise.
5984 * ftfont.c: Likewise.
5985 * gtkutil.c: Likewise.
5986 * image.c: Likewise.
5987 * keyboard.c: Likewise.
5988 * menu.c: Likewise.
5989 * process.c: Likewise.
5990 * scroll.c: Likewise.
5991 * sound.c: Likewise.
5992 * term.c: Likewise.
5993 * w32console.c: Likewise.
5994 * w32fns.c: Likewise.
5995 * w32term.c: Likewise.
5996 * window.c: Likewise.
5997 * xdisp.c: Likewise.
5998 * xfaces.c: Likewise.
5999 * xfns.c: Likewise.
6000 * xselect.c: Likewise.
6001 * xterm.c: Likewise.
6002
1ec4b7b2
SM
60032012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
6004
6005 * fns.c (maybe_resize_hash_table): Output message when growing the
6006 purify-hashtable.
6007
2014308a
DA
60082012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6009
6010 * alloc.c (allocate_string_data): Remove dead code.
6011 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
6012 avoid GCC warning about unused macro.
6013
246155eb
DA
60142012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6015
6016 * alloc.c (allocate_string): Omit intervals initialization.
6017 * alloc.c (make_uninit_multibyte_string): Initialize intervals
6018 as in make_pure_string and make_pure_c_string.
6019
43184b7b
DA
60202012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6021
d209e2fb 6022 * alloc.c (allocate_string): Fix last change.
43184b7b 6023
3fe6dd74
DA
60242012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6025
d209e2fb 6026 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
6027 to memset, add explicit initialization where appropriate.
6028
1ba6038a
GM
60292012-06-27 Glenn Morris <rgm@gnu.org>
6030
6031 * lisp.mk (lisp): Remove paths.elc.
6032
c89926a5
CY
60332012-06-27 Chong Yidong <cyd@gnu.org>
6034
6035 * doc.c (Fsubstitute_command_keys): Fix punctuation.
6036
ed6b3510
JW
60372012-06-26 John Wiegley <johnw@newartisans.com>
6038
1ec4b7b2 6039 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
6040 on Mac OS X Lion: __mod_init_func and __mod_term_func.
6041
ed6b3510
JW
6042 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6043 when building with Clang.
6044
8edd4a2b
SM
60452012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
6046
6047 * eval.c (Fapply): Allow calling it with a single argument.
6048
f6f62d1b
EZ
60492012-06-26 Eli Zaretskii <eliz@gnu.org>
6050
6051 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6052 _stricmp and _strnicmp.
6053 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6054
62efea5e
DA
60552012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6056
6057 * alloc.c (allocate_window): Zero out non-Lisp part of newly
6058 allocated window.
6059 (allocate_process): Likewise for new process.
8edd4a2b 6060 (allocate_terminal): Change to use offsetof.
62efea5e
DA
6061 (allocate_frame): Likewise.
6062 * frame.c (make_frame): Omit redundant initialization.
6063 * window.c (make_parent_window): Use memset.
6064 (make_window): Omit redundant initialization.
6065 * process.c (make_process): Omit redundant initialization.
6066 * terminal.c (create_terminal): Likewise.
6067
42997f4d
DA
60682012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6069
6070 * term.c (delete_tty): Remove redundant call to memset.
6071
1130ecfc
DA
60722012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6073
6074 * alloc.c: Remove build_string.
6075 * lisp.h: Define build_string as static inline. This provides
6076 a better opportunity to optimize away calls to strlen when the
6077 function is called with compile-time constant argument.
6078 * image.c (imagemagick_error): Convert to build_string.
6079 * w32proc.c (sys_spawnve): Likewise.
6080 * xterm.c (x_term_init): Likewise.
6081
cf38a720
PE
60822012-06-26 Paul Eggert <eggert@cs.ucla.edu>
6083
99027bdd
PE
6084 Use sprintf return value instead of invoking strlen on result.
6085 In the old days this wasn't portable, since some sprintf
6086 implementations returned char *. But they died out years ago and
6087 Emacs already assumes sprintf returns int.
6088 Similarly for float_to_string.
6089 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6090 * ccl.c (ccl_driver):
6091 * character.c (string_escape_byte8):
6092 * data.c (Fnumber_to_string):
6093 * doprnt.c (doprnt):
6094 * print.c (print_object):
6095 * xdisp.c (message_dolog):
6096 * xfns.c (syms_of_xfns):
6097 Use sprintf or float_to_string result to avoid need to call strlen.
6098 * data.c (Fnumber_to_string):
6099 Use make_unibyte_string, since the string must be ASCII.
6100 * lisp.h, print.c (float_to_string): Now returns int length.
6101 * term.c (produce_glyphless_glyph):
6102 Use sprintf result rather than recomputing it.
6103
cf38a720
PE
6104 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6105 * Makefile.in (ALL_CFLAGS):
6106 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6107 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6108
3511c784
DA
61092012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6110
0a08eb21 6111 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
6112 strcasecmp if available.
6113 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6114
fb7da12e
AS
61152012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6116
6117 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6118 Avoid comma operator.
6119 * menu.c (push_submenu_start, push_submenu_end)
6120 (push_left_right_boundary, push_menu_pane): Likewise.
6121 * msdos.c (dos_rawgetc): Likewise.
6122
afa2ffd8
DA
61232012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6124
6125 * xfns.c (xic_create_fontsetname): Remove redundant calls
6126 to memset.
6127
b3b4476b
PE
61282012-06-25 Paul Eggert <eggert@cs.ucla.edu>
6129
4495ff38
PE
6130 * gtkutil.c (get_utf8_string): Remove redundant assignment.
6131 sprintf already null-terminates its output.
6132
b3b4476b
PE
6133 * xfns.c (x_window): Remove redundant cast.
6134
b00876c9
DA
61352012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6136
6137 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6138 `const char *' to `char *' to avoid compiler warning.
6139
d188e26b
PE
61402012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6141
885d1d74
PE
6142 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6143 instead of truncating it to 63 (admittedly a generous limit).
6144
d188e26b
PE
6145 * process.c: Fix spelling and caps in comments.
6146
e2f560b1
DN
61472012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
6148
e86db54b 6149 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
6150 * sysdep.c (setpgrp): Remove definition, not used in this file.
6151
7583a3a1
JB
61522012-06-24 Juanma Barranquero <lekktu@gmail.com>
6153
6154 * makefile.w32-in: Update dependencies.
6155
696056c2
EZ
61562012-06-24 Eli Zaretskii <eliz@gnu.org>
6157
6158 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
6159 (SYSTIME_H): Add nt/inc/sys/time.h.
6160
6161 * systime.h [WINDOWSNT]: Include sys/time.h.
6162
6163 * s/ms-w32.h (struct timespec): Definition moved from
6164 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
6165
845ca893
PE
61662012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6167
6168 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
6169 * buffer.h (buffer_slot_type_mismatch):
6170 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6171 * eval.c (unwind_to_catch):
6172 * image.c (my_png_error, my_error_exit):
6173 * keyboard.c (quit_throw_to_read_char, user_error)
6174 (Fexit_recursive_edit, Fabort_recursive_edit):
6175 * lisp.h (die, args_out_of_range, args_out_of_range_3)
6176 (wrong_type_argument, buffer_overflow, __executable_start)
6177 (memory_full, buffer_memory_full, string_overflow, Fthrow)
6178 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
6179 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
6180 (fatal):
6181 (child_setup) [!DOS_NT]:
6182 * lread.c (end_of_file_error, invalid_syntax):
6183 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6184 * puresize.h (pure_write_error):
6185 * search.c (matcher_overflow):
6186 * sound.c (sound_perror, alsa_sound_perror):
6187 * sysdep.c, syssignal.h (croak):
6188 * term.c (maybe_fatal, vfatal):
6189 * textprop.c (text_read_only):
6190 * undo.c (user_error):
6191 * unexmacosx.c (unexec_error):
6192 * xterm.c (x_ins_del_lines, x_delete_glyphs):
6193 Use _Noreturn rather than NO_RETURN.
6194 No need for separate decl merely because of _Noreturn.
6195 * sound.c (sound_warning, parse_sound):
6196 Remove unnecessary forward decls.
6197
f1dd8073
PE
61982012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6199
6200 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
6201 * lisp.h (WAIT_READING_MAX): New macro.
6202 * dispnew.c (Fsleep_for, sit_for):
6203 * keyboard.c (kbd_buffer_get_event):
6204 * process.c (Faccept_process_output):
6205 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6206 This improves on the previous patch, which introduced a bug
6207 when time_t is unsigned and as wide as intmax_t.
6208 See <http://bugs.gnu.org/9000#51>.
6209
b82c1755
EZ
62102012-06-23 Eli Zaretskii <eliz@gnu.org>
6211
6212 * dispnew.c (sit_for, Fsleep_for):
6213 * keyboard.c (kbd_buffer_get_event):
6214 * process.c (Faccept_process_output): Avoid compiler warnings when
6215 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6216
ca300656
JB
62172012-06-23 Juanma Barranquero <lekktu@gmail.com>
6218
049ec95b
JB
6219 * makefile.w32-in: Update dependencies.
6220
ca300656
JB
6221 * w32.c (ltime): Add return type and declare static.
6222 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6223
db7b8d06
PE
62242012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6225
6226 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6227 Privately reported by Herbert J. Skuhra.
6228 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6229 All uses changed.
6230 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6231 not make_lisp_timeval, when the argument is of type EMACS_TIME.
6232
0bd8297f
EZ
62332012-06-23 Eli Zaretskii <eliz@gnu.org>
6234
96512555
EZ
6235 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6236 last argument of make_unibyte_string.
6237
0bd8297f
EZ
6238 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6239 language ID in the event parameters.
6240
6241 * w32term.c (w32_read_socket): Put the new keyboard codepage into
6242 event.code, not the obscure "character set ID".
6243
63def6b6
CY
62442012-06-23 Chong Yidong <cyd@gnu.org>
6245
6246 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6247
e8a02204
EZ
62482012-06-23 Eli Zaretskii <eliz@gnu.org>
6249
388cdec0
EZ
6250 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6251 * w32.c (fdutimens): New function.
6252
6253 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6254
6255 * s/ms-w32.h (pselect): Redirect to sys_select.
6256
6257 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6258
e8a02204
EZ
6259 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6260 in the logic of incrementing and decrementing the value of
6261 use_relocatable_buffers.
6262
d054f3fb
PE
62632012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6264
6265 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6266 Privately reported by Herbert J. Skuhra.
6267 [__FreeBSD__]: Remove "*/" typo after "#include".
6268 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6269 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6270 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6271 Don't assume EMACS_TIME and struct timeval are the same type.
6272
d35af63c
PE
62732012-06-22 Paul Eggert <eggert@cs.ucla.edu>
6274
6275 Support higher-resolution time stamps (Bug#9000).
6276 The time stamps are only nanosecond-resolution at the C level,
6277 since that's the best that any real-world system supports now.
6278 But they are picosecond-resolution at the Lisp level, as that's
6279 easy, and leaves room for future OS improvements.
6280
6281 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6282 (LIBES): Use it.
6283
6284 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6285 Don't get current time unless it's needed.
6286
6287 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6288 now provides it if it's absent.
6289 (start_atimer): Port to higher-res time stamps.
6290 Check for time stamp overflow. Don't get current time more
6291 often than is needed.
6292
6293 * buffer.h (struct buffer): Buffer modtime now has high resolution.
6294 Include systime.h, not time.h.
6295 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
6296
6297 * dired.c: Include stat-time.h.
6298 (Ffile-attributes): File times now have higher resolution.
6299
6300 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
6301 (struct image): Timestamp now has higher resolution.
6302
6303 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
6304 has at least microseconds now. All uses removed.
6305 (update_frame, update_single_window, update_window, update_frame_1)
6306 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 6307 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
6308
6309 * editfns.c (time_overflow): Now extern.
6310 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
6311 (float-time, Fformat_time_string, Fcurrent_time_string)
6312 (Fcurrent_time_zone): Accept and generate higher-resolution
6313 time stamps.
6314 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
6315 (decode_time_components, lisp_seconds_argument): New functions.
6316 (make_time): Now static.
6317 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
6318 Report an error if the time is invalid, rather than having the caller
6319 do that.
6320
6321 * fileio.c: Include <stat-time.h>
6322 (Fcopy_file): Copy higher-resolution time stamps.
6323 Prefer to set the time stamp via a file descriptor if that works.
6324 (Fset_file_times, Finsert_file_contents, Fwrite_region)
6325 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
6326 (Fvisited_file_modtime, Fset_visited_file_modtime):
6327 Support higher-resolution time stamps.
6328
6329 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6330
6331 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6332
6333 * image.c (prepare_image_for_display, clear_image_cache)
6334 (lookup_image): Port to higer-resolution time stamps.
6335
6336 * keyboard.c (start_polling, bind_polling_period):
6337 Check for time stamp overflow.
6338 (read_char, kbd_buffer_get_event, timer_start_idle)
6339 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6340 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6341 Port to higher-resolution time stamps. Do not assume time_t is signed.
6342 (decode_timer): New function. Timers are now vectors of length 9,
6343 not 8, to accommodate the picosecond component.
6344 (timer_check_2): Use it.
6345
6346 * nsterm.m (select_timeout, timeval_subtract): Remove.
6347 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6348 as they're a bit more accurate and handle overflow better.
6349 (ns_select): Change prototype to be compatible with pselect.
6350 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6351 * nsterm.h (ns_select): Adjust prototype.
6352
6353 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6354 us-resolution time stamps.
6355 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6356
6357 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6358
6359 * lisp.h (time_overflow): New decl.
6360 (wait_reading_process_output): First arg is now intmax_t, not int,
6361 to accommodate larger waits.
6362
6363 * process.h (struct Lisp_Process.read_output_delay):
6364 Now counts nanoseconds, not microseconds.
6365 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6366 EMACS_HAS_USECS.
6367 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6368 (wait_reading_process_output):
6369 Port to ns-resolution time stamps.
6370 (Faccept_process_output, wait_reading_process_output):
6371 Check for time stamp overflow. Do not assume time_t is signed.
6372 (select_wrapper): Remove; we now use pselect.
6373 (Fprocess_attributes): Now generates ns-resolution time stamps.
6374
6375 * sysdep.c: Include utimens.h. Don't include utime.h
6376 or worry about struct utimbuf; gnulib does that for us now.
6377 (gettimeofday): Remove; gnulib provides a substitute.
6378 (make_timeval): New function.
6379 (set_file_times): Now sets ns-resolution time stamps.
6380 New arg FD; all uses changed.
6381 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6382 (system_process_attributes):
6383 Now returns ns-resolution time stamp. All uses changed.
6384 Check for time stamp overflow.
6385
6386 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6387 provides a substitute now.
6388
6389 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6390 since it guarantees struct timespec.
6391 (EMACS_TIME): Now struct timespec, so that we can support
6392 ns-resolution time stamps.
6393 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6394 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6395 (EMACS_USECS): Remove.
6396 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6397 so multiply the arg by 1000 before storing it.
6398 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6399 New macros.
6400 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6401 Port to ns-resolution time stamps.
6402 (EMACS_TIME_NEG_P): Remove; replaced by....
6403 (EMACS_TIME_SIGN): New macro.
6404 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6405 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6406 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6407 (make_timeval, make_lisp_time, decode_time_components): New decls.
6408 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6409 that it mishandled time_t overflow. You can't compare by subtracting!
6410 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6411 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6412
6413 * term.c: Include <sys/time.h>.
6414 (timeval_to_Time): New function, for proper overflow wraparound.
6415 (term_mouse_position, term_mouse_click): Use it.
6416
6417 * undo.c (record_first_change): Support higher-resolution time stamps
6418 in the undo buffer.
6419 (Fprimitive_undo): Use them when restoring time stamps.
6420
6421 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6422 (w32_get_internal_run_time):
6423 Port to higher-resolution Emacs time stamps.
6424 (ltime): Now accepts single 64-bit integer, as that's more convenient
6425 for callers.
6426
6427 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6428
6429 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6430 for compatibility with pselect. Support ns-resolution time stamps.
6431
6432 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6433
6434 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6435 Check for time stamp overflow, and support ns-resolution time stamps.
6436
6437 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6438 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6439 (timeval_subtract): Remove; no longer needed.
6440 (XTflash, XTring_bell, x_wait_for_event):
6441 Port to ns-resolution time stamps. Don't assume time_t is signed.
6442
b6a92dfe
CY
64432012-06-22 Chong Yidong <cyd@gnu.org>
6444
6445 * xdisp.c (x_consider_frame_title): Revert last change.
6446
d251c37c
EZ
64472012-06-22 Eli Zaretskii <eliz@gnu.org>
6448
6449 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6450 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6451 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6452 staticidx goes up to 1597 out of 1600 = 0x640.)
6453
f10deafb
PE
64542012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6455
6456 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6457 Otherwise, the umask might be mistakenly 0 while handling input signals.
6458
ec6de1e2
SM
64592012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6460
6461 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6462
28be1ada
DA
64632012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6464
6465 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6466 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6467 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6468 access to `contents' member of Lisp_Vector objects with AREF and ASET
6469 where appropriate.
6470
c6bf3022
CY
64712012-06-19 Chong Yidong <cyd@gnu.org>
6472
6473 * frame.c (delete_frame): When selecting a frame on a different
6474 text terminal, do not alter the terminal's top-frame.
6475
6476 * xdisp.c (format_mode_line_unwind_data): Record the target
6477 frame's selected window and its terminal's top-frame.
6478 (unwind_format_mode_line): Restore them.
6479 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6480 Callers changed.
6481 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6482 since tty frames can be explicitly named.
6483 (prepare_menu_bars): Likewise.
6484
6485 * term.c (Ftty_top_frame): New function.
6486
defd4196
PE
64872012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6488
6489 Port byte-code-meter to modern targets.
6490 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6491 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 6492 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
6493 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6494 (METER_1, METER_2): Simplify.
6495
1053a871
SM
64962012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6497
6498 * data.c (Fdefalias): Return `symbol' (bug#11686).
6499
b7e8d081
MR
65002012-06-18 Martin Rudalics <rudalics@gmx.at>
6501
6502 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
6503 gets killed during executing of this function (Bug#11665).
6504 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
6505 (Vkill_buffer_query_functions): In doc-string say that functions
6506 run by this hook should not change the current buffer.
6507
7ea2b339
PE
65082012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6509
6510 Fix recently-introduced process.c problems found by static checking.
6511 * process.c (write_queue_push, write_queue_pop, send_process):
6512 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6513 (write_queue_pop): Fix pointer signedness problem.
6514 (send_process): Remove unused local.
6515
96a313a1
CY
65162012-06-17 Chong Yidong <cyd@gnu.org>
6517
6518 * xdisp.c (redisplay_internal): No need to redisplay terminal
6519 frames that are not on top.
6520
20ca2e94
TN
65212012-06-17 Troels Nielsen <bn.troels@gmail.com>
6522
6523 * process.c (make_process): Initialize write_queue.
6524 (write_queue_push, write_queue_pop): New functions.
6525 (send_process): Use them to maintain correct ordering of process
6526 writes (Bug#10815).
6527
9a900ca9
PE
65282012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6529
310fbfa8
PE
6530 * lisp.h (eassert): Assume C89 or later.
6531 This removes the need for CHECK.
6532 (CHECK): Remove. Its comments about always evaluating its
6533 argument were confusing, as 'eassert' typically does not evaluate
6534 its argument.
6535
27bb1ca4
PE
6536 * coding.c (produce_chars): Use ptrdiff_t, not int.
6537
9a900ca9
PE
6538 * xterm.c (x_draw_underwave): Check for integer overflow.
6539 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6540
41b7f8bc 65412012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
6542
6543 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6544 referenced (Bug#11583).
6545
9b0e3eba
AA
65462012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6547
6548 Implement wave-style variant of underlining.
6549 * dispextern.h (face_underline_type): New enum.
6550 (face): Add field for underline type.
6551 * nsterm.m (ns_draw_underwave): New function.
6552 (ns_draw_text_decoration): Use it.
6553 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6554 New functions.
6555 (x_draw_glyph_string): Use them.
6556 * xfaces.c (Qline, Qwave): New Lisp objects.
6557 (check_lface_attrs, merge_face_ref)
1053a871
SM
6558 (Finternal_set_lisp_face_attribute, realize_x_face):
6559 Handle wave-style underline face attributes.
9b0e3eba
AA
6560 * xterm.c (x_draw_underwave): New function.
6561 (x_draw_glyph_string): Use it.
6562
0fb52f11
JB
65632012-06-16 Juanma Barranquero <lekktu@gmail.com>
6564
6565 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6566 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6567 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6568 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6569 ($(BLD)/w32select.$(O)): Update dependencies.
6570
e5560ff7
AS
65712012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6572
6573 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6574 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6575 * character.c (_fetch_multibyte_char_p): Remove.
6576 * alloc.c: Include "character.h" before "buffer.h".
6577 * bidi.c: Likewise.
6578 * buffer.c: Likewise.
6579 * bytecode.c: Likewise.
6580 * callint.c: Likewise.
6581 * callproc.c: Likewise.
6582 * casefiddle.c: Likewise.
6583 * casetab.c: Likewise.
6584 * category.c: Likewise.
6585 * cmds.c: Likewise.
6586 * coding.c: Likewise.
6587 * composite.c: Likewise.
6588 * dired.c: Likewise.
6589 * dispnew.c: Likewise.
6590 * doc.c: Likewise.
6591 * dosfns.c: Likewise.
6592 * editfns.c: Likewise.
6593 * emacs.c: Likewise.
6594 * fileio.c: Likewise.
6595 * filelock.c: Likewise.
6596 * font.c: Likewise.
6597 * fontset.c: Likewise.
6598 * fringe.c: Likewise.
6599 * indent.c: Likewise.
6600 * insdel.c: Likewise.
6601 * intervals.c: Likewise.
6602 * keyboard.c: Likewise.
6603 * keymap.c: Likewise.
6604 * lread.c: Likewise.
6605 * macros.c: Likewise.
6606 * marker.c: Likewise.
6607 * minibuf.c: Likewise.
6608 * nsfns.m: Likewise.
6609 * nsmenu.m: Likewise.
6610 * print.c: Likewise.
6611 * process.c: Likewise.
6612 * regex.c: Likewise.
6613 * region-cache.c: Likewise.
6614 * search.c: Likewise.
6615 * syntax.c: Likewise.
6616 * term.c: Likewise.
6617 * textprop.c: Likewise.
6618 * undo.c: Likewise.
6619 * unexsol.c: Likewise.
6620 * w16select.c: Likewise.
6621 * w32fns.c: Likewise.
6622 * w32menu.c: Likewise.
6623 * window.c: Likewise.
6624 * xdisp.c: Likewise.
6625 * xfns.c: Likewise.
6626 * xmenu.c: Likewise.
6627 * xml.c: Likewise.
6628 * xselect.c: Likewise.
6629
2f07e6af
EZ
66302012-06-16 Eli Zaretskii <eliz@gnu.org>
6631
1053a871
SM
6632 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6633 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 6634 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
6635 row.
6636 (handle_face_prop): Use chunk-relative overlay string index when
6637 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
6638 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6639 the rightmost. (Bug#11720)
2f07e6af 6640
29b83cec
AS
66412012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6642
6643 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6644 (CATEGORY_MEMBER): Enforce 1/0 value.
6645 * category.c (_temp_category_set): Remove.
6646
4c5501e9
EZ
66472012-06-16 Eli Zaretskii <eliz@gnu.org>
6648
6649 * window.c (Fdelete_other_windows_internal)
6650 (Fdelete_window_internal): Don't access frame's mouse highlight
6651 info of the initial frame. (Bug#11677)
6652
2b570124
PE
66532012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6654
e93864f9
PE
6655 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6656 Assume USE_2_TAGS_FOR_INTS.
6657 (xreload): Adjust $tagmask width to match recent lisp.h change.
6658
2b570124
PE
6659 Simplify lisp.h in minor ways that should not affect code.
6660 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6661 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6662 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6663 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6664 (INTTYPEBITS): New macro, for clarity.
6665 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
6666 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6667 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
6668 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6669 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6670
81755f69
JB
66712012-06-13 Juanma Barranquero <lekktu@gmail.com>
6672
6673 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6674
16192a57
GM
66752012-06-13 Glenn Morris <rgm@gnu.org>
6676
6677 * s/bsd-common.h (BSD4_3):
6678 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6679
646b5f55
AS
66802012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6681
6682 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6683 instead of union.
6684 (XLI, XIL): Define.
1053a871
SM
6685 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6686 Use them.
6687 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 6688 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 6689 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
6690 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6691 * frame.c (delete_frame): Remove outdated comment.
6692 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6693 USE_LISP_UNION_TYPE.
6694 (Fw32_unregister_hot_key): Likewise.
6695 (Fw32_toggle_lock_key): Likewise.
6696 * w32menu.c (add_menu_item): Likewise.
6697 (w32_menu_display_help): Use XIL instead of checking
6698 USE_LISP_UNION_TYPE.
6699 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6700 (init_heap): Likewise.
6701 * w32term.c (w32_read_socket): Update comment.
6702
1d3823c9
GM
67032012-06-13 Glenn Morris <rgm@gnu.org>
6704
c62ff706
GM
6705 * s/usg5-4-common.h, src/s/unixware.h:
6706 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6707
1d3823c9
GM
6708 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6709
bfe3e0a2
PE
67102012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6711
6712 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6713 * alloc.c (make_number) [!defined make_number]:
6714 Remove, as lisp.h always defines this now.
6715 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6716 (roundup_size): Verify that it is a power of 2.
6717 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6718 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6719 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6720 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6721 USE_LSB_TAG now is always defined to be either 0 or 1.
6722 All uses changed.
6723 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6724 code works fine either way, and efficiency is not a concern here,
6725 as the union type is for debugging, not for production.
6726 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6727 Use an inline function on all platforms when using the union type,
6728 since this is simpler and 'static inline' can be used portably
6729 within Emacs now.
6730 (LISP_INITIALLY_ZERO): New macro.
6731 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6732 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6733
45fa9c0f
GM
67342012-06-12 Glenn Morris <rgm@gnu.org>
6735
b4492cba
GM
6736 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6737
6738 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 6739
45fa9c0f
GM
6740 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6741 Move BROKEN_SIGIO to configure.
6742
6743 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6744 Move NO_TERMIO to configure.
6745
0e25d334
CY
67462012-06-12 Chong Yidong <cyd@gnu.org>
6747
6748 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6749 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6750 MagickExportImagePixels is undefined.
6751
43682bb6
PE
67522012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6753
6754 * image.c (imagemagick_load_image): Remove unused label.
6755
a9be7d2b
GM
67562012-06-11 Glenn Morris <rgm@gnu.org>
6757
6758 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6759 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6760 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6761 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6762
3017f87f
SM
67632012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6764
6765 * alloc.c (make_byte_code): New function.
6766 (Fmake_byte_code): Use it. Don't purify here.
6767 * lread.c (read1): Use it as well to avoid extra allocation.
6768
1b9b4cf4
CY
67692012-06-11 Chong Yidong <cyd@gnu.org>
6770
6771 * image.c (imagemagick_load_image): Implement transparency.
6772
95988fcf
AS
67732012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6774
6775 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6776 account for preceding backslashes. (Bug#11663)
6777
cd4eb164
CY
67782012-06-09 Chong Yidong <cyd@gnu.org>
6779
6780 * term.c: Support italics in capable terminals (Bug#9652).
6781 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6782 (turn_on_face): Output using TS_enter_italic_mode if available.
6783 Don't handle unused blinking and alt-charset cases.
6784 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6785 and tty_alt_charset_p cases.
6786 (tty_capable_p, init_tty): Support italics.
6787
6788 * termchar.h (struct tty_display_info): Add field for italics.
6789 Remove unused blink field.
6790
6791 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6792 Handle slant.
6793
6794 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6795 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6796 tty_alt_charset_p. Add tty_italic_p.
6797
ff88beb8
MA
67982012-06-09 Michael Albinus <michael.albinus@gmx.de>
6799
6800 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6801 dbus_type_is_basic if available.
6802 (xd_extract_signed, xd_extract_unsigned): Rename from
6803 extract_signed and extract_unsigned, respectively. Adapt callers.
6804
44286096
CY
68052012-06-09 Chong Yidong <cyd@gnu.org>
6806
1682701f
CY
6807 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6808
44286096
CY
6809 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6810 case (Bug#9752).
6811
d86feb17
PE
68122012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6813
6814 * xdisp.c (vmessage): Treat frame message as multibyte.
6815 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6816 would generate the diagnostic "Making \302\247 buffer-local while
6817 let-bound!".
6818
d5c20fe8
EZ
68192012-06-08 Eli Zaretskii <eliz@gnu.org>
6820
6821 * dispnew.c (showing_window_margins_p): Undo last change, which
6822 was done due to an inadvertent commit.
6823 (adjust_frame_glyphs_for_frame_redisplay): Do call
6824 showing_window_margins_p.
6825
513749ee
SM
68262012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6827
6828 * eval.c (Fmake_var_non_special): New primitive.
6829 (syms_of_eval): Defsubr it.
6830 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6831
d4a8f5c1
JB
68322012-06-08 Juanma Barranquero <lekktu@gmail.com>
6833
6834 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6835 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6836
8bbbc977
EZ
68372012-06-08 Eli Zaretskii <eliz@gnu.org>
6838
6839 * alloc.c (allocate_vectorlike): Fix last change.
6840
f3372c87
DA
68412012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6842
6843 Block-based vector allocation of small vectors.
6844 * lisp.h (struct vectorlike_header): New field `nbytes',
6845 adjust comment accordingly.
6846 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 6847 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
6848 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6849 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6850 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6851 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6852 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6853 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6854 (roundup_size): New constant.
6855 (struct vector_block): New data type.
6856 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 6857 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
6858 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6859 (sweep_vectors): New functions.
6860 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 6861 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
6862 or equal to VBLOCK_BYTES_MAX.
6863 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6864 (init_alloc_once): Add call to init_vectors.
6865
4f18a4ed
SM
68662012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6867
6868 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6869
86f158bc
PE
68702012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6871
6872 * doprnt.c (doprnt): Truncate multibyte char correctly.
6873 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6874 would mishandle a string argument "Xc" if X was a multibyte
6875 character of length 2: it would truncate after X's first byte
6876 rather than including all of X.
6877
c5cfcbe0
CY
68782012-06-06 Chong Yidong <cyd@gnu.org>
6879
6880 * buffer.c (word_wrap): Doc fix.
6881
c05cf390
PE
68822012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6883
6884 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6885
0c3461de
GM
68862012-06-03 Glenn Morris <rgm@gnu.org>
6887
6888 * xdisp.c (tool-bar-style): Doc fix.
6889
c71232db
UM
68902012-06-03 Ulrich Müller <ulm@gentoo.org>
6891
6892 * Makefile.in (PAXCTL): Define.
6893 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6894 binary via PaX flags if the paxctl utility is available.
6895 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6896 Restore PaX flags to their default. (Bug#11398)
6897
383f7350
CY
68982012-06-03 Chong Yidong <cyd@gnu.org>
6899
6900 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6901 buffer (Bug#11226).
6902
5f2c76c6
CY
69032012-06-03 Chong Yidong <cyd@gnu.org>
6904
6905 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6906 (note_mode_line_or_margin_highlight): If there is no help echo,
6907 use mode-line-default-help-echo. Handle the case where the mouse
6908 position is past the end of the mode line string.
6909
6910 * buffer.c (buffer_local_value_1): New function, split from
6911 Fbuffer_local_value; can return Qunbound.
6912 (Fbuffer_local_value): Use it.
6913 (Vmode_line_format): Docstring tweaks.
6914
773d47f6
PE
69152012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6916
6917 * sysdep.c (system_process_attributes): Improve comment.
6918
f2d6a3df
SM
69192012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6920
6921 * keyboard.c: Export real-this-command to Elisp.
6922 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6923 and DEFVAR it. Update all users.
6924
63810350
PE
69252012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6926
7bd5c1f4
PE
6927 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6928
63810350
PE
6929 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6930 Convert pctcpu and pctmem to Lisp float properly.
6931 Let the compiler fold better, as 100.0/0x8000 is exact.
6932
a2821611
AS
69332012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6934
6935 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6936 cons_block.
6937
5fceba1d
PE
69382012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6939
6940 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6941
c98ff5dd
DA
69422012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6943
6944 For a 'struct window', replace some Lisp_Object fields to
6945 bitfields where appropriate, remove unused fields.
6946 * window.h (struct window): Remove unused 'last_mark_x' and
6947 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6948 change it's type from Lisp_Object to bitfield.
6949 Change type of 'force_start', 'optional_new_start',
6950 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 6951 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 6952
ca34e0be
PE
69532012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6954
6955 Pacify gcc -Wdouble-precision when using Xaw.
6956 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6957 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6958 Use 'float' consistently, rather than 'float' in most places
6959 and 'double' in a couple of places.
6960
efc00ab1 69612012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
6962
6963 * xdisp.c (handle_stop): Detect whether we have overlay strings
6964 loaded by testing it->current.overlay_string_index to be
6965 non-negative, instead of checking whether n_overlay_strings is
6966 positive. (Bug#11587)
6967
efc00ab1 69682012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
6969
6970 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6971
6972 * doc.c (Fsubstitute_command_keys): Doc fix.
6973
efc00ab1 69742012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
6975
6976 * search.c (search_buffer): Remove calls to
6977 r_alloc_inhibit_buffer_relocation, as it is now called by
6978 maybe_unify_char, which was the cause of relocation of buffer text
6979 in bug#11519.
6980
efc00ab1 69812012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
6982
6983 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6984 for the duration of call to load_charset, to avoid problems with
6985 callers of maybe_unify_char that access buffer text through C
6986 pointers.
6987
6988 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6989 decrement the inhibition flag, instead of just setting or
6990 resetting it.
6991
ba93a187
PE
69922012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6993
6994 Remove obsolete '#define static' cruft.
6995 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6996 This #undef was "temporary" in 2000; it is no longer needed
6997 now that '#define static' has gone away.
6998 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6999 (gray_bitmap_bits): Remove; no longer needed.
7000 All uses replaced with definiens.
7001 * xterm.c: Include "bitmaps/gray.xbm".
7002
9e4bf381
PE
70032012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7004
7005 Clean up __executable_start, monstartup when --enable-profiling.
7006 The following changes affect the code only when profiling.
7007 * dispnew.c (__executable_start): Rename from safe_bcopy.
7008 Define only on platforms that need it.
7009 * emacs.c: Include <sys/gmon.h> when profiling.
7010 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
7011 (__executable_start): Remove decl, since lisp.h does it now.
7012 (safe_bcopy): Remove decl; no longer has that name.
7013 (main): Coalesce #if into single bit of code, for simplicity.
7014 Cast pointers to uintptr_t, since standard libraries want integers
7015 and not pointers.
7016 * lisp.h (__executable_start): New decl.
7017
32d72c2f
GM
70182012-05-31 Glenn Morris <rgm@gnu.org>
7019
7020 * image.c (Fimagemagick_types): Doc fix.
7021
baac5bc7
JM
70222012-05-30 Jim Meyering <meyering@redhat.com>
7023
7024 * callproc.c (Fcall_process_region): Include directory component
7025 in mkstemp error message (Bug#11586).
7026
72cb32cf
PE
70272012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7028
7029 * alloc.c, lisp.h (make_pure_vector): Now static.
7030
61b108cc
SM
70312012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
7032
7033 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7034 Move to byte-run.el.
7035 (Fautoload): Do the hash-doc more carefully.
7036 * data.c (Fdefalias): Purify definition, except for keymaps.
7037 (Qdefun): Move from eval.c.
7038 * lisp.h (Qdefun): Remove.
7039 * lread.c (read1): Tiny simplification.
7040
471fe23d
TN
70412012-05-29 Troels Nielsen <bn.troels@gmail.com>
7042
934f3f58 7043 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
7044 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7045 Bug#9642, but explicitly check that the buffer the overlay would
7046 be moved to is live and rearrange lines to make sure that errors
7047 will not put the overlay in an inconsistent state.
7048 (Fdelete_overlay): Cosmetics.
7049
85d0efd1
EZ
70502012-05-28 Eli Zaretskii <eliz@gnu.org>
7051
7052 * w32term.c (my_bring_window_to_top): New function.
7053 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
7054 could be different from the original one.
7055 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
7056 (Bug#11513)
7057
7058 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7059 by calling BringWindowToTop.
7060
7061 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
7062 (WM_EMACS_END): Increase by one.
7063
da92a98c
PE
70642012-05-28 Paul Eggert <eggert@cs.ucla.edu>
7065
7066 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
7067 This avoids undefined behavior that might cause the eassert
7068 to not catch an out-of-range value.
7069
74d1f848
JB
70702012-05-28 Juanma Barranquero <lekktu@gmail.com>
7071
7072 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7073 Update dependencies.
7074
9e1a06fc
EZ
70752012-05-27 Eli Zaretskii <eliz@gnu.org>
7076
7077 * bidi.c (bidi_mirror_char): Fix last change.
7078
f3dd7312
AS
70792012-05-27 Andreas Schwab <schwab@linux-m68k.org>
7080
7081 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7082 when referring to sectname field in printf format.
7083
81899c91
PE
70842012-05-27 Paul Eggert <eggert@cs.ucla.edu>
7085
57b81a9f
PE
7086 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7087 Only r_alloc_inhibit_buffer_relocation needed to be added;
7088 the others were already declared.
7089
81899c91
PE
7090 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7091 before checking whether it's out of range. Put the check inside
7092 eassert. See
7093 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7094
33017faf 70952012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
7096
7097 * callproc.c (Fcall_process): Restore a line that was accidentally
7098 commented out in the 2011-02-13 change (bug#11547).
7099
33017faf 71002012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
7101
7102 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7103 defined on ralloc.c.
7104
7105 * buffer.c [REL_ALLOC]: Remove prototypes of
7106 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7107 they are now on lisp.h.
7108
7109 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7110
7111 * search.c (search_buffer): Use it to inhibit relocation of buffer
7112 text while re_search_2 is doing its job, because re_search_2 is
7113 passed C pointers to buffer text. (Bug#11519)
7114
23415acf
EZ
7115 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7116 Update value to 24.
7117
44e27368
EZ
7118 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7119 state after an additional call to move_it_in_display_line_to, keep
7120 the values of it->max_ascent and it->max_descent found for the
7121 entire line.
7122 (pos_visible_p): Revert the comparison against bottom_y to what it
7123 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7124 (Bug#11464)
7125
c1892f11
PE
71262012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7127
7128 Fix coding-related core dumps with gcc -ftrapv.
7129 The code was computing A - B, where A and B are pointers, and B is
7130 random garbage. This can lead to core dumps on platforms that
7131 have special pointer registers, and it also leads to core dumps on
7132 x86-64 when compiled with gcc -ftrapv. The fix is to compute
7133 A - B only when B is initialized properly.
7134 * coding.c (coding_set_source, coding_set_destination): Return void.
7135 (coding_change_source, coding_change_destinations): New functions,
7136 with the old behaviors of coding_set_source and coding_set_destination.
7137 All callers that need an offset changed to use these new functions.
7138
eb7afdad
GM
71392012-05-26 Glenn Morris <rgm@gnu.org>
7140
7141 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
7142
f12fdf02
EZ
71432012-05-26 Eli Zaretskii <eliz@gnu.org>
7144
53a63be6 7145 Extend mouse support on W32 text-mode console.
61b108cc
SM
7146 * xdisp.c (draw_row_with_mouse_face):
7147 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 7148
eb3f6f01 7149 * w32console.c: Include window.h.
61b108cc
SM
7150 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
7151 New functions.
eb3f6f01
EZ
7152 (initialize_w32_display): Initialize mouse-highlight data.
7153
53a63be6
EZ
7154 * w32inevt.c: Include termchar.h and window.h.
7155 (do_mouse_event): Support mouse-autoselect-window. When the mouse
7156 moves, call note_mouse_highlight. If help_echo changed, call
7157 gen_help_event to produce help-echo message in the echo area.
7158 Call clear_mouse_face if mouse_face_hidden is set in the mouse
7159 highlight info.
7160
4cfd81f6
PE
71612012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7162
7163 * lread.c (read1): Simplify slightly to avoid an overflow warning
7164 with GCC 4.7.0 on x86-64.
7165
4446092a
EZ
71662012-05-26 Eli Zaretskii <eliz@gnu.org>
7167
7168 * bidi.c (bidi_mirror_char): Revert last change: an int is
7169 definitely wide enough here.
7170
42b2a986 71712012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 7172
42b2a986 7173 Fix integer width and related bugs (Bug#9874).
eb106a49 7174 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
7175 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
7176 (string_bytes, check_sblock, allocate_string_data):
7177 (compact_small_strings, Fmake_bool_vector, make_string)
7178 (make_unibyte_string, make_multibyte_string)
7179 (make_string_from_bytes, make_specified_string)
7180 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
7181 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
7182 (mark_vectorlike):
7183 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7184 (allocate_pseudovector):
7185 Use int, not EMACS_INT, where int is wide enough.
7186 (inhibit_garbage_collection, Fgarbage_collect):
7187 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7188 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
7189 int might not be wide enough.
7190 (bidi_cache_search, bidi_cache_find, bidi_init_it)
7191 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
7192 (bidi_at_paragraph_end, bidi_find_paragraph_start)
7193 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7194 (bidi_level_of_next_char, bidi_move_to_visually_next):
7195 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7196 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
7197 (Fkill_buffer, Fset_buffer_major_mode)
7198 (advance_to_char_boundary, Fbuffer_swap_text)
7199 (Fset_buffer_multibyte, overlays_at, overlays_in)
7200 (overlay_touches_p, struct sortvec, record_overlay_string)
7201 (overlay_strings, recenter_overlay_lists)
7202 (adjust_overlays_for_insert, adjust_overlays_for_delete)
7203 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
7204 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
7205 (Foverlay_recenter, last_overlay_modification_hooks_used)
7206 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7207 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
7208 (validate_region): Omit unnecessary test for b <= e,
7209 since that's guaranteed by the previous test.
d311d28c
PE
7210 (adjust_overlays_for_delete): Avoid pos + length overflow.
7211 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7212 (report_overlay_modification):
7213 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7214 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7215 Omit pointer cast, which isn't needed anyway, and doesn't work
7216 after the EMACS_INT -> ptrdiff_t change.
02481186 7217 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
7218 * buffer.h: Adjust decls to match defn changes elsewhere.
7219 (struct buffer_text, struct buffer):
7220 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7221 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
7222 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7223 not int, to avoid needless 32-bit limit on 64-bit hosts.
7224 (exec_byte_code): Use tighter memory-full test, one that checks
7225 for alloca overflow. Don't compute the address of the object just
7226 before an array, as that's not portable. Use EMACS_INT, not
7227 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
7228 * callint.c (Fcall_interactively):
7229 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7230 * callproc.c (call_process_kill, Fcall_process):
7231 Don't assume pid_t fits into an Emacs fixnum.
7232 (call_process_cleanup, Fcall_process, child_setup):
7233 Don't assume pid_t fits into int.
7234 (call_process_cleanup, Fcall_process, delete_temp_file)
7235 (Fcall_process_region):
7236 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7237 (Fcall_process): Simplify handling of volatile integers.
7238 Use int, not EMACS_INT, where int will do.
7239 * casefiddle.c (casify_object, casify_region, operate_on_word)
7240 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7241 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7242 (casify_object): Avoid integer overflow when overallocating buffer.
7243 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 7244 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
7245 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7246 * category.h (CATEGORYP): Don't assume arg is nonnegative.
7247 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7248 integers are now checked earlier. All uses replaced with XINT.
7249 (ccl_driver):
7250 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7251 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
7252 (ccl_driver, Fregister_code_conversion_map):
7253 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
7254 (resolve_symbol_ccl_program): Check that vector header is in range.
7255 Always copy the vector, so that we can check its contents reliably
7256 now rather than having to recheck each instruction as it's being
7257 executed. Check that vector words fit in 'int'.
7258 (ccl_get_compiled_code, Fregister_ccl_program)
7259 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7260 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7261 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7262 contents are in range.
7263 (Fccl_execute_on_string): Check that status is in range.
7264 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7265 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7266 Accept and return EMACS_INT, not int, because callers can pass values
7267 out of 'int' range.
7268 (c_string_width, strwidth, lisp_string_width, chars_in_text)
7269 (multibyte_chars_in_text, parse_str_as_multibyte)
7270 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7271 (str_as_unibyte, str_to_unibyte, string_count_byte8)
7272 (string_escape_byte8, Fget_byte):
7273 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 7274 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
7275 avoid mishandling large integers.
7276 * character.h: Adjust decls to match defn changes elsewhere.
7277 * charset.c (load_charset_map_from_file, find_charsets_in_text)
7278 (Ffind_charset_region):
7279 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7280 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7281 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 7282 Don't assume fixnum fits in int.
d311d28c
PE
7283 (load_charset_map_from_vector, Fmap_charset_chars):
7284 Remove now-unnecessary CHECK_NATNUMs.
7285 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
7286 Don't rely on undefined behavior with signed left shift overflow.
7287 Don't assume unsigned int fits into fixnum, or that fixnum fits
7288 into unsigned int. Don't require max_code to be a valid fixnum;
7289 that's not true for gb10830 4-byte on a 32-bit host. Allow
7290 invalid_code to be a cons, for the same reason. Require code_offset
7291 to be a character. Avoid int overflow if max_char is close
7292 to INT_MAX.
7293 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7294 this is intended anyway and avoids some undefined behavior.
7295 (load_charset_map): Pass unsigned, not int, as 2nd arg of
7296 INDEX_TO_CODE_POINT, as that's what it expects.
7297 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
7298 * charset.h (DECODE_CHAR): Return int, not unsigned;
7299 this is what was intended anyway, and it avoids undefined behavior.
7300 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
7301 integer-overflow issues.
7302 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
7303 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
7304 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
7305 * chartab.c (Fmake_char_table, Fset_char_table_range)
7306 (uniprop_get_decoder, uniprop_get_encoder):
7307 Don't assume fixnum fits in int.
7308 * cmds.c (move_point): New function, that does the gist of
7309 Fforward_char and Fbackward_char, but does so while checking
7310 for integer overflow more accurately.
c96e5d6a 7311 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
7312 (Fforward_line, Fend_of_line, internal_self_insert)
7313 (internal_self_insert):
7314 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7315 Fix a FIXME, by checking for integer overflow when calculating
7316 target_clm and actual_clm.
7317 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 7318 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
7319 (ASSURE_DESTINATION, coding_alloc_by_realloc)
7320 (coding_alloc_by_making_gap, alloc_destination)
7321 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
7322 (encode_coding_utf_16, detect_coding_emacs_mule)
7323 (decode_coding_emacs_mule, encode_coding_emacs_mule)
7324 (detect_coding_iso_2022, decode_coding_iso_2022)
7325 (encode_invocation_designation, encode_designation_at_bol)
7326 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7327 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7328 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7329 (encode_coding_ccl, encode_coding_raw_text)
7330 (detect_coding_charset, decode_coding_charset)
7331 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7332 (produce_composition, produce_charset, produce_annotation)
7333 (decode_coding, handle_composition_annotation)
7334 (handle_charset_annotation, consume_chars, decode_coding_gap)
7335 (decode_coding_object, encode_coding_object, detect_coding_system)
7336 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7337 (code_convert_region, code_convert_string)
8f50130c
PE
7338 (Fdefine_coding_system_internal)
7339 (coding_set_source, coding_set_destination):
d311d28c
PE
7340 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7341 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7342 (Fdefine_coding_system_internal):
7343 Don't assume fixnums fit in int.
7344 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 7345 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
7346 (Funencodable_char_position, Fcheck_coding_systems_region)
7347 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 7348 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 7349 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 7350 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 7351 Don't access memory outside of the args array.
d311d28c 7352 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
7353 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7354 result of ENCODE_CHAR.
d311d28c
PE
7355 * coding.h: Adjust decls to match defn changes elsewhere.
7356 (struct coding_system):
7357 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7358 * composite.c (get_composition_id, find_composition)
7359 (run_composition_function, update_compositions)
7360 (compose_text, composition_gstring_put_cache)
7361 (composition_gstring_p, composition_gstring_width)
7362 (fill_gstring_header, fill_gstring_body, autocmp_chars)
7363 (composition_compute_stop_pos, composition_reseat_it)
7364 (composition_update_it, struct position_record)
7365 (find_automatic_composition, composition_adjust_point)
7366 (Fcomposition_get_gstring, Ffind_composition_internal):
7367 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7368 (update_compositions):
7369 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7370 * composite.h: Adjust decls to match defn changes elsewhere.
7371 (struct composition):
7372 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7373 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7374 Do not attempt to compute the address of the object just before a
7375 buffer; this is not portable.
7376 (Faref, Faset):
7377 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7378 (Faset): Use int, not EMACS_INT, where int is wide enough.
7379 (Fstring_to_number): Don't assume fixnums fit in int.
7380 (Frem): Don't assume arg is nonnegative.
7381 * dbusbind.c (xd_append_arg): Check for integers out of range.
7382 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 7383 (extract_signed, extract_unsigned): New functions.
243e0530
PE
7384 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7385 (xd_get_connection_references): Return ptrdiff_t, not int.
7386 All uses changed.
7387 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7388 (xd_read_message_1):
7389 Use int, not unsigned, where the dbus API uses int.
7390 (Fdbus_message_internal): Don't overflow mtype.
7391 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
7392 * dired.c (directory_files_internal, file_name_completion, scmp)
7393 (file_name_completion_stat):
7394 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7395 (file_name_completion): Don't overflow matchcount.
7396 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7397 * dispextern.h: Adjust decls to match defn changes elsewhere.
7398 (struct text_pos, struct glyph, struct bidi_saved_info)
7399 (struct bidi_string_data, struct bidi_it, struct composition_it)
7400 (struct it):
7401 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7402 (struct display_pos, struct composition_it, struct it):
7403 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7404 * dispnew.c (increment_matrix_positions)
7405 (increment_row_positions, mode_line_string)
7406 (marginal_area_string):
7407 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 7408 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
7409 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7410 (duration_to_sec_usec): New function, to check for overflow better.
7411 (Fsleep_for, sit_for): Use it.
7412 * doc.c (get_doc_string, store_function_docstring):
7413 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7414 (get_doc_string, Fsnarf_documentation):
7415 Use int, not EMACS_INT, where int is wide enough.
7416 (get_doc_string):
7417 Use SAFE_ALLOCA, not alloca.
7418 Check for overflow when converting EMACS_INT to off_t.
7419 * doprnt.c (doprnt):
7420 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7421 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7422 Don't assume uid_t fits into fixnum.
7423 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7424 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7425 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7426 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7427 (general_insert_function)
7428 (Finsert_char, make_buffer_string, make_buffer_string_both)
7429 (update_buffer_properties, Fbuffer_substring)
7430 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7431 (Fsubst_char_in_region, check_translation)
7432 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7433 (transpose_markers, Ftranspose_regions):
7434 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7435 (clip_to_bounds): Move to lisp.h as an inline function).
7436 (Fconstrain_to_field): Don't assume integers are nonnegative.
7437 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7438 (Fsubst_char_in_region, Fsave_restriction):
7439 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7440 (Femacs_pid): Don't assume pid_t fits into fixnum.
7441 (lo_time): Use int, not EMACS_INT, when int suffices.
7442 (lisp_time_argument): Check for usec out of range.
7443 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
7444 (Fuser_login_name, Fuser_full_name): Signal an error
7445 if a uid argument is out of range, rather than relying on
7446 undefined behavior.
c8d5c857
PE
7447 (Fformat_time_string): Remove now-unnecessary check.
7448 lisp_time_argument checks for out-of-range usec now.
243e0530 7449 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
7450 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7451 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7452 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7453 (init_cmdargs, Fdump_emacs):
7454 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7455 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7456 the bottom (typically) 32 bits of the fixnum.
7457 * eval.c (specpdl_size, call_debugger):
7458 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7459 (when_entered_debugger, Fbacktrace_debug):
7460 Don't assume fixnum can fit in int.
7461 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7462 the object just before a buffer; this is not portable.
7463 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7464 (grow_specpdl, unbind_to):
7465 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7466 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7467 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 7468 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
7469 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7470 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7471 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7472 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7473 (a_write, e_write):
7474 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7475 (Fcopy_file, non_regular_nbytes, read_non_regular)
7476 (Finsert_file_contents):
7477 Use int, not EMACS_INT, where int is wide enough.
7478 (READ_BUF_SIZE): Verify that it fits in int.
7479 (Finsert_file_contents): Check that counts are in proper range,
7480 rather than assuming fixnums fit into ptrdiff_t etc.
7481 Don't assume fixnums fit into int.
125b3835 7482 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
7483 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7484 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
7485 (string_char_to_byte, string_byte_to_char)
7486 (string_make_multibyte, string_to_multibyte)
7487 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7488 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7489 (substring_both, Fdelete, internal_equal, Ffillarray)
7490 (Fclear_string, mapcar1)
7491 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7492 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7493 (larger_vector, make_hash_table, maybe_resize_hash_table)
7494 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7495 (Fmaphash, secure_hash):
7496 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7497 (concat): Check for string index and length overflow.
7498 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7499 (Frequire):
7500 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7501 (larger_vector): New API (vec, incr_min, size_max) replaces old
7502 one (vec, new_size, init). This catches size overflow.
7503 INIT was removed because it was always Qnil.
7504 All callers changed.
7505 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7506 the upper bound on a hash table index size.
7507 (make_hash_table, maybe_resize_hash_table): Use it.
7508 (secure_hash): Computer start_byte and end_byte only after
7509 they're known to be in ptrdiff_t range.
7510 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7511 (Ffont_get_glyphs, Ffont_at):
7512 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7513 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7514 (Flist_fonts, Fopen_font):
7515 Don't assume fixnum can fit in int.
7516 (check_gstring): Don't assume index can fit in int.
7517 (font_match_p): Check that fixnum is a character, not a nonnegative
7518 fixnum, since the later code needs to stuff it into an int.
7519 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7520 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7521 conversion overflow issues.
7522 (Fopen_font): Check for integer out of range.
7523 (Ffont_get_glyphs): Don't assume index can fit in int.
7524 * font.h: Adjust decls to match defn changes elsewhere.
7525 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7526 integer overflow.
7527 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7528 printmax_t, where ptrdiff_t is wide enough.
7529 (Finternal_char_font):
7530 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7531 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7532 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7533 (Fset_frame_position, x_set_frame_parameters)
7534 (x_set_line_spacing, x_set_border_width)
7535 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7536 Check that fixnums are in proper range for system types.
7537 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7538 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7539 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7540 Use SAFE_ALLOCA_LISP, not alloca.
7541 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7542 intptr_t is wide enough.
7543 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7544 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7545 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7546 Check for fixnum out of range.
7547 * ftfont.c (ftfont_list): Don't assume index fits in int.
7548 Check that fixnums are in proper range for system types.
7549 (ftfont_shape_by_flt):
7550 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
7551 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7552 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7553 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7554 Check that fixnums are in proper range for system types.
7555 * gnutls.h: Adjust decls to match defn changes elsewhere.
7556 * gtkutil.c (xg_dialog_run):
7557 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7558 (update_frame_tool_bar):
7559 Check that fixnums are in proper range for system types.
7560 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 7561 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
7562 * indent.c (last_known_column, last_known_column_point):
7563 (current_column_bol_cache):
7564 (skip_invisible, current_column, check_display_width):
7565 (check_display_width, scan_for_column, current_column_1)
7566 (Findent_to, Fcurrent_indentation, position_indentation)
7567 (indented_beyond_p, Fmove_to_column, compute_motion):
7568 (Fcompute_motion, Fvertical_motion):
7569 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7570 (last_known_column_modified): Use EMACS_INT, not int.
7571 (check_display_width):
7572 (Fcompute_motion):
7573 Check that fixnums and floats are in proper range for system types.
7574 (compute_motion): Don't assume index or fixnum fits in int.
7575 (compute_motion, Fcompute_motion):
7576 Use int, not EMACS_INT, when it is wide enough.
7577 (vmotion): Omit local var start_hpos that is always 0; that way
7578 we don't need to worry about overflow in expressions involving it.
7579 * indent.h: Adjust decls to match defn changes elsewhere.
7580 (struct position):
7581 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7582 Use int, not EMACS_INT, where int is wide enough.
7583 Remove unused members ovstring_chars_done and tab_offset;
7584 all uses removed.
7585 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7586 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7587 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7588 (make_gap, copy_text, insert, insert_and_inherit)
7589 (insert_before_markers, insert_before_markers_and_inherit)
7590 (insert_1, count_combining_before, count_combining_after)
7591 (insert_1_both, insert_from_string)
7592 (insert_from_string_before_markers, insert_from_string_1)
7593 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7594 (adjust_after_replace, adjust_after_insert, replace_range)
7595 (replace_range_2, del_range, del_range_1, del_range_byte)
7596 (del_range_both, del_range_2, modify_region)
7597 (prepare_to_modify_buffer, signal_before_change)
7598 (signal_after_change, Fcombine_after_change_execute):
7599 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7600 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7601 (balance_an_interval, split_interval_right, split_interval_left)
7602 (find_interval, next_interval, update_interval)
7603 (adjust_intervals_for_insertion, delete_node, delete_interval)
7604 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7605 (static_offset_intervals, offset_intervals)
7606 (merge_interval_right, merge_interval_left, make_new_interval)
7607 (graft_intervals_into_buffer, temp_set_point_both)
7608 (temp_set_point, set_point, adjust_for_invis_intang)
7609 (set_point_both, move_if_not_intangible, get_property_and_range)
7610 (get_local_map, copy_intervals, copy_intervals_to_string)
7611 (compare_string_intervals, set_intervals_multibyte_1):
7612 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7613 * intervals.h: Adjust decls to match defn changes elsewhere.
7614 (struct interval):
7615 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7616 * keyboard.c (this_command_key_count, this_single_command_key_start)
7617 (before_command_key_count, before_command_echo_length, echo_now)
7618 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7619 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7620 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7621 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7622 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7623 (last_non_minibuf_size, last_point_position, echo_truncate)
7624 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7625 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7626 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7627 (stuff_buffered_input):
7628 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7629 (last_auto_save, command_loop_1, read_char):
7630 Use EMACS_INT, not int, to avoid integer overflow.
7631 (record_char): Avoid overflow in total_keys computation.
7632 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7633 * keyboard.h: Adjust decls to match defn changes elsewhere.
7634 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7635 (Fkey_description, Fdescribe_vector, Flookup_key):
7636 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7637 (click_position): New function, to check that positions are in range.
7638 (Fcurrent_active_maps):
7639 (describe_command):
7640 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7641 (Faccessible_keymaps, Fkey_description):
7642 (preferred_sequence_p):
7643 Don't assume fixnum can fit into int.
7644 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7645 Check for integer overflow in size calculations.
7646 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7647 avoid mishandling large integers.
7648 * lisp.h: Adjust decls to match defn changes elsewhere.
7649 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7650 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7651 (struct Lisp_Marker):
7652 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7653 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
7654 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7655 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7656 All callers changed.
7657 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7658 Assume the arg has valid form, since it always does.
7659 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7660 unsigned integer system type.
7661 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7662 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7663 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7664 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7665 (duration_to_sec_usec): New decl.
7666 * lread.c (read_from_string_index, read_from_string_index_byte)
7667 (read_from_string_limit, readchar, unreadchar, openp)
7668 (read_internal_start, read1, oblookup):
7669 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7670 (Fload, readevalloop, Feval_buffer, Feval_region):
7671 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7672 (openp): Check for out-of-range argument to 'access'.
7673 (read1): Use int, not EMACS_INT, where int is wide enough.
7674 Don't assume fixnum fits into int.
6efdadfd 7675 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
7676 (read_filtered_event): Use duration_to_sec_usec
7677 to do proper overflow checking on durations.
d311d28c
PE
7678 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7679 in size calculation.
7680 (Fexecute_kbd_macro):
7681 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7682 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7683 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7684 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7685 (set_marker_both, set_marker_restricted_both, marker_position)
7686 (marker_byte_position, Fbuffer_has_markers_at):
7687 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7688 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 7689 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
7690 It now merely ensures that the menu is large enough, without
7691 necessarily growing it, as this avoids some integer overflow issues.
7692 All callers changed.
7693 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7694 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7695 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7696 Use SAFE_ALLOCA_LISP, not alloca.
7697 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7698 to EMACS_INT. Check that fixnums are in proper range for system types.
7699 * minibuf.c (minibuf_prompt_width, string_to_object)
7700 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7701 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7702 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7703 (get_minibuffer, read_minibuf_unwind):
7704 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7705 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7706 this simplifies overflow checking. All callers changed.
7707 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7708 (Ftest_completion):
7709 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7710 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7711 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7712 Check that fixnums are in proper range for system types.
7713 (Fx_create_frame, Fx_show_tip):
7714 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7715 * nsfont.m (ns_findfonts, nsfont_list_family):
7716 Don't assume fixnum fits in long.
7717 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7718 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7719 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7720 wide enough.
17fdb222 7721 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
7722 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7723 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7724 (PRINTDECLARE, PRINTPREPARE):
7725 (strout, print_string):
7726 (print, print_preprocess, print_check_string_charset_prop)
7727 (print_object):
7728 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7729 (PRINTDECLARE):
7730 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7731 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7732 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 7733 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 7734 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
7735 (print_error_message): Use SAFE_ALLOCA, not alloca.
7736 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
7737 (print_depth, new_backquote_output, print_number_index):
7738 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
7739 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7740 (Fset_process_window_size, Fformat_network_address)
7741 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 7742 (sigchld_handler):
d311d28c 7743 Check that fixnums are in proper range for system types.
d44287d4 7744 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
7745 Check for process-ids out of pid_t range rather than relying on
7746 undefined behavior.
e4d81efc 7747 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
7748 (Fformat_network_address, read_process_output, send_process)
7749 (Fprocess_send_region, status_notify):
7750 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7751 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7752 (wait_reading_process_output, read_process_output, exec_sentinel):
7753 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7754 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7755 (Faccept_process_output): Use duration_to_sec_usec to do proper
7756 overflow checking on durations.
dde14581
PE
7757 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7758 Don't assume pid_t fits in int.
02481186
PE
7759 * process.h (struct Lisp_Process): Members tick and update_tick
7760 are now of type EMACS_INT, not int.
b62b53e8
PE
7761 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7762 configured --with-wide-int.
d311d28c
PE
7763 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7764 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7765 * search.c (looking_at_1, string_match_1):
7766 (fast_string_match, fast_c_string_match_ignore_case)
7767 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7768 (scan_newline, find_before_next_newline, search_command)
7769 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7770 (set_search_regs, wordify):
7771 (Freplace_match):
7772 (Fmatch_data):
7773 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7774 (string_match_1, search_buffer, set_search_regs):
7775 (Fmatch_data):
7776 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7777 (wordify): Check for overflow in size calculation.
7778 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7779 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7780 Check that fixnums are in proper range for system types.
7781 * sound.c (struct sound_device)
7782 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7783 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7784 (Fplay_sound_internal):
7785 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 7786 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
7787 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7788 (Fparse_partial_sexp):
7789 Don't assume fixnums can fit in int.
7790 (struct lisp_parse_state, find_start_pos, find_start_value)
7791 (find_start_value_byte, find_start_begv)
7792 (update_syntax_table, char_quoted, dec_bytepos)
7793 (find_defun_start, prev_char_comend_first, back_comment):
7794 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7795 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7796 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7797 (Finternal_describe_syntax_value): Check that match_lisp is a
7798 character, not an integer, since the code stuffs it into int.
7799 (scan_words, scan_sexps_forward):
7800 Check that fixnums are in proper range for system types.
7801 (Fforward_word):
7802 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7803 (scan_sexps_forward):
7804 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7805 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7806 * syntax.h: Adjust decls to match defn changes elsewhere.
7807 (struct gl_state_s):
7808 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
7809 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7810 MOST_POSITIVE_FIXNUM.
d311d28c
PE
7811 * sysdep.c (wait_for_termination_1, wait_for_termination)
7812 (interruptible_wait_for_termination, mkdir):
7813 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7814 (emacs_read, emacs_write):
7815 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
7816 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7817 and double all fit in int.
d311d28c
PE
7818 * term.c (set_tty_color_mode):
7819 Check that fixnums are in proper range for system types.
7820 * termhooks.h (struct input_event):
7821 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7822 * textprop.c (validate_interval_range, interval_of)
7823 (Fadd_text_properties, set_text_properties_1)
7824 (Fremove_text_properties, Fremove_list_of_text_properties)
7825 (Ftext_property_any, Ftext_property_not_all)
7826 (copy_text_properties, text_property_list, extend_property_ranges)
7827 (verify_interval_modification):
7828 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7829 (Fnext_single_char_property_change)
7830 (Fprevious_single_char_property_change):
7831 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
7832 (copy_text_properties):
7833 Check for integer overflow in index calculation.
d311d28c
PE
7834 * undo.c (last_boundary_position, record_point, record_insert)
7835 (record_delete, record_marker_adjustment, record_change)
7836 (record_property_change):
7837 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7838 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7839 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7840 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7841 (Fx_hide_tip, Fx_file_dialog):
7842 * w32menu.c (set_frame_menubar):
7843 Use ptrdiff_t, not int, for consistency with rest of code.
7844 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7845 (select_window, Fdelete_other_windows_internal)
7846 (window_scroll_pixel_based, window_scroll_line_based)
7847 (Frecenter, Fset_window_configuration):
7848 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7849 (Fset_window_hscroll, run_window_configuration_change_hook)
7850 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 7851 (Fscroll_other_window, Frecenter):
d311d28c
PE
7852 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7853 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7854 Don't assume fixnum fits in int.
7855 (Fset_window_scroll_bars):
7856 Check that fixnums are in proper range for system types.
7857 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7858 (string_pos, c_string_pos, number_of_chars, init_iterator)
7859 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7860 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7861 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
7862 (face_before_or_after_it_pos, handle_invisible_prop)
7863 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
7864 (display_prop_intangible_p, string_buffer_position_lim)
7865 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7866 (get_overlay_strings_1, get_overlay_strings)
7867 (iterate_out_of_display_property, forward_to_next_line_start)
7868 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7869 (get_next_display_element, set_iterator_to_next)
7870 (get_visually_first_element, compute_stop_pos_backwards)
7871 (handle_stop_backwards, next_element_from_buffer)
7872 (move_it_in_display_line_to, move_it_in_display_line)
7873 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7874 (add_to_log, message_dolog, message_log_check_duplicate)
7875 (message2, message2_nolog, message3, message3_nolog
7876 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7877 (current_message_1, truncate_echo_area, truncate_message_1)
7878 (set_message, set_message_1, store_mode_line_noprop)
7879 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7880 (text_outside_line_unchanged_p, check_point_in_composition)
7881 (reconsider_clip_changes)
7882 (redisplay_internal, set_cursor_from_row, try_scrolling)
7883 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7884 (redisplay_window, find_last_unchanged_at_beg_row)
7885 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7886 (trailing_whitespace_p, find_row_edges, display_line)
7887 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7888 (display_mode_element, store_mode_line_string)
7889 (pint2str, pint2hrstr, decode_mode_spec)
7890 (display_count_lines, display_string, draw_glyphs)
7891 (x_produce_glyphs, x_insert_glyphs)
7892 (rows_from_pos_range, mouse_face_from_buffer_pos)
7893 (fast_find_string_pos, mouse_face_from_string_pos)
7894 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7895 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7896 (safe_call, init_from_display_pos, handle_fontified_prop)
7897 (handle_single_display_spec, load_overlay_strings)
7898 (with_echo_area_buffer, setup_echo_area_for_printing)
7899 (display_echo_area, echo_area_display)
7900 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7901 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
7902 (redisplay_window, dump_glyph_row, display_mode_line)
7903 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 7904 (handle_display_spec, display_prop_string_p):
d311d28c
PE
7905 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7906 (handle_single_display_spec, build_desired_tool_bar_string)
7907 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7908 (get_specified_cursor_type):
7909 Check that fixnums are in proper range for system types.
7910 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7911 (Flookup_image_map):
7912 Don't assume fixnums fit in int.
7913 (compare_overlay_entries):
7914 Avoid mishandling comparisons due to subtraction overflow.
7915 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7916 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7917 (handle_tool_bar_click):
7918 Use int, not unsigned, since we prefer signed and the signedness
7919 doesn't matter here.
7920 (get_next_display_element, next_element_from_display_vector):
7921 Use int, not EMACS_INT, when int is wide enough.
7922 (start_hourglass): Use duration_to_sec_usec to do proper
7923 overflow checking on durations.
7924 * xfaces.c (Fbitmap_spec_p):
7925 Check that fixnums are in proper range for system types.
7926 (compare_fonts_by_sort_order):
7927 Avoid mishandling comparisons due to subtraction overflow.
7928 (Fx_family_fonts, realize_basic_faces):
7929 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7930 (Fx_family_fonts):
7931 Don't assume fixnum fits in int.
7932 Use SAFE_ALLOCA_LISP, not alloca.
7933 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7934 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7935 (face_at_buffer_position, face_for_overlay_string)
7936 (face_at_string_position):
7937 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7938 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7939 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7940 (Fx_show_tip):
7941 Check that fixnums are in proper range for system types.
7942 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7943 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7944 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7945 (Fx_change_window_property): Don't assume fixnums fit in int.
7946 * xfont.c (xfont_chars_supported):
7947 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7948 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7949 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7950 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7951 * xml.c (parse_region):
7952 * xrdb.c (magic_file_p):
7953 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7954 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7955 (x_get_local_selection, x_reply_selection_request)
7956 (x_handle_selection_request, wait_for_property_change):
7957 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7958 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7959 short is wide enough.
7960 (x_send_client_event): Don't assume fixnum fits in int.
7961 * xterm.c (x_x_to_emacs_modifiers):
7962 Don't assume EMACS_INT overflows nicely into int.
7963 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7964 may come from Lisp.
7965 (handle_one_xevent): NATNUMP can eval its arg twice.
7966 (x_connection_closed):
7967 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7968 * xterm.h: Adjust decls to match defn changes elsewhere.
7969 (struct scroll_bar): Use struct vectorlike_header
7970 rather than rolling our own approximation.
7971 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7972
c6574eb5
GM
79732012-05-25 Glenn Morris <rgm@gnu.org>
7974
7975 * lisp.mk (lisp): Update for more files being compiled now.
7976
e8d32c7e
SM
79772012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7978
48def666
SM
7979 * lread.c: Remove `read_pure' which makes no difference.
7980 (read_pure): Remove var.
7981 (unreadpure): Remove function.
7982 (readevalloop): Don't call read_list with -1 flag.
7983 (read1, read_vector): Don't test read_pure any more.
7984 (read_list): Simplify.
7985
e8d32c7e
SM
7986 * fileio.c, character.h: Minor style tweaks.
7987
4b2addb7
DA
79882012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7989
7990 * window.h (clip_changed): Remove useless declaration.
7991
584461b2
JB
79922012-05-22 Juanma Barranquero <lekktu@gmail.com>
7993
7994 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7995 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7996
34374650
PE
79972012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7998
7999 Remove src/m/*.
8000 This directory predates autoconf and is no longer needed nowadays.
8001 Move its few remaining bits of functionality to where they're needed.
8002 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8003 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8004 * m/template.h: Remove.
8005 * Makefile.in (M_FILE): Remove. All uses removed.
8006 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
8007 * lisp.h (USE_LSB_TAG):
8008 * mem-limits.h (EXCEEDS_LISP_PTR):
8009 Use VAL_MAX, not VALBITS, in #if.
8010 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
8011 (EMACS_UINT): Define unconditionally now.
8012 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
8013 (BITS_PER_EMACS_INT): New constants, replacing
8014 what used to be in config.h, but not useful in #if.
8015 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
8016 define them any more.
8017 (VAL_MAX): New macro.
8018 (VALMASK): Use it.
8019 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
8020 BITS_PER_EMACS_INT, in #if.
8021 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8022 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
8023 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8024 * s/ms-w32.h (DATA_START):
8025 Move here from removed file m/intel386.h.
8026 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8027 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8028
261cb4bb
PE
80292012-05-21 Paul Eggert <eggert@cs.ucla.edu>
8030
8031 Assume C89 or later.
8032 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8033 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8034 (xrealloc):
8035 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8036 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8037 * textprop.c, tparam.c (NULL): Remove.
8038 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8039 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8040 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
8041 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8042 * xterm.c (input_signal_count): Assume volatile works.
8043
ff23cd9f
KB
80442012-05-21 Ken Brown <kbrown@cornell.edu>
8045
8046 * xgselect.c (xg_select): Fix first argument in call to 'select'
8047 (bug#11508).
8048
1b170bc6
KB
80492012-05-20 Ken Brown <kbrown@cornell.edu>
8050
8051 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 8052 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 8053
b2f4d39f
KB
80542012-05-19 Ken Brown <kbrown@cornell.edu>
8055
8056 * xfns.c (x_in_use): Remove `static' qualifier.
8057 * xterm.h (x_in_use): Declare.
8058 * xgselect.c: Include xterm.h.
8059 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8060 and `display_arg' (bug#9754).
8061
003fdae2
PE
80622012-05-19 Paul Eggert <eggert@cs.ucla.edu>
8063
9232a6d9
PE
8064 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
8065
003fdae2
PE
8066 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
8067 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8068
784b56e2
EZ
80692012-05-18 Eli Zaretskii <eliz@gnu.org>
8070
8071 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8072
8073 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 8074 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
8075
8076 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8077 reference to image_cache->refcount.
8078 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8079
a0a79cde
JL
80802012-05-17 Juri Linkov <juri@jurta.org>
8081
8082 * search.c (Fword_search_regexp, Fword_search_backward)
8083 (Fword_search_forward, Fword_search_backward_lax)
8084 (Fword_search_forward_lax): Move functions to isearch.el
8085 (bug#10145, bug#11381).
8086
b0572523
PE
80872012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8088
8089 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8090
9660f5fc
SM
80912012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8092
8093 * lread.c (init_obarray): Declare Qt and Qnil as special.
8094
4374de83
GM
80952012-05-14 Glenn Morris <rgm@gnu.org>
8096
8097 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 8098 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 8099
dc44c39a
PE
81002012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8101
078c97cb
PE
8102 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8103
dc44c39a
PE
8104 * unexaix.c: Port to more-recent AIX compilers.
8105 (report_error, report_error_1, make_hdr, copy_sym)
8106 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8107 Make arguments const char *, not char *, to avoid violations of C
8108 standard and to fix some AIX warnings reported by Gilles Pion.
8109
e18afed7 81102012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
8111
8112 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8113 already have overlays loaded.
8114 (handle_single_display_spec): Before returning without displaying
8115 fringe bitmap, synchronize the bidi iterator with the main display
8116 iterator, by calling iterate_out_of_display_property.
8117 (iterate_out_of_display_property): Detect buffer iteration by
8118 testing that it->string is a Lisp string.
8119 (get_next_display_element): When the current object is exhausted,
8120 and there's something on it->stack, call set_iterator_to_next to
8121 proceed with what's on the stack, instead of returning zero.
8122 (set_iterator_to_next): If called at the end of a Lisp string,
8123 proceed to consider_string_end without incrementing string
8124 position. Don't increment display vector index past the end of
8125 the display vector. (Bug#11417)
c8fb9dc6
EZ
8126 (pos_visible_p): Don't report a position visible when move_it_to
8127 stopped at the last line of window, which happens to be scanned
8128 backwards by the bidi iteration. (Bug#11464)
ac268e67 8129
e18afed7 81302012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
8131
8132 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8133 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
8134 are on a TTY, and thus unable to display on the fringes.
8135 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
8136 so we need to signal to the caller that this is a "replacing"
8137 display spec. This fixes display when the spec is invalid or we
8138 are on a TTY.
8139
e18afed7 81402012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
8141
8142 * unexaix.c (make_hdr): Fix typo in prototype.
8143 This bug broke the build on AIX. Problem reported by Gilles Pion.
8144
9d0a235a
MA
81452012-05-14 Michael Albinus <michael.albinus@gmx.de>
8146
8147 * keyboard.c (kbd_buffer_get_event): Read special events also in
8148 batch mode. (Bug#11415)
8149
9e6b06ed
GM
81502012-05-12 Glenn Morris <rgm@gnu.org>
8151
8152 * ns.mk: Update for ns_appbindir no longer having trailing "/".
8153
c1a1d7a3
EZ
81542012-05-12 Eli Zaretskii <eliz@gnu.org>
8155
8156 * lisp.mk (lisp): Add newcomment.elc.
8157
3fe7cdc8
GM
81582012-05-12 Glenn Morris <rgm@gnu.org>
8159
8160 * Makefile.in (MKDIR_P): New, set by configure.
8161 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
8162
53f7d2c0
PE
81632012-05-11 Paul Eggert <eggert@cs.ucla.edu>
8164
8165 Remove unused function hourglass_started.
8166 * dispextern.h (hourglass_started):
8167 * w32fns.c (hourglass_started):
8168 * xdisp.c (hourglass_started): Remove.
8169
75aafb17
JB
81702012-05-10 Juanma Barranquero <lekktu@gmail.com>
8171
8172 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
8173 Update dependencies.
8174
12959e8e
PE
81752012-05-10 Paul Eggert <eggert@cs.ucla.edu>
8176
97107e2e
PE
8177 * xgselect.c (xg_select): Put maxfds+1 into a var.
8178 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
8179
12959e8e
PE
8180 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
8181
836d29b3
DA
81822012-05-10 Dave Abrahams <dave@boostpro.com>
8183
8184 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
8185 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
8186
5cb67954
MA
81872012-05-09 Michael Albinus <michael.albinus@gmx.de>
8188
8189 * dbusbind.c (xd_registered_buses): New internal Lisp object.
8190 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
8191 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
8192 Initialize xd_registered_buses.
8193
3478ec45
PE
81942012-05-09 Paul Eggert <eggert@cs.ucla.edu>
8195
b263a6b0
PE
8196 Untag more efficiently if USE_LSB_TAG.
8197 This is based on a proposal by YAMAMOTO Mitsuharu in
8198 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
8199 For an admittedly artificial (nth 8000 longlist) benchmark on
8200 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
8201 Emacs's overall text size by 1%.
8202 * lisp.h (XUNTAG): New macro.
8203 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
8204 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
8205 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8206 * eval.c (Fautoload):
8207 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8208 * frame.h (XFRAME): Use XUNTAG.
8209
3478ec45
PE
8210 Port recent dbusbind.c changes to 32-bit --with-wide-int.
8211 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8212 Remove unportable assumptions about print widths of types like
8213 dbus_uint32_t.
8214 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8215 intptr_t when converting between pointer and integer, to avoid GCC
8216 warnings about wrong width.
8217
666b903b 82182012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
8219
8220 * w32proc.c (new_child): Force Windows to reserve only 64KB of
8221 stack for each reader_thread, instead of defaulting to 8MB
8222 determined by the linker. This avoids failures in creating
8223 subprocesses on Windows 7, see the discussion in this thread:
8224 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8225
b120cc17
JC
82262012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
8227
8228 Fix up display of the *Minibuf-0* buffer in the mini window.
8229 * keyboard.c (read_char): Don't clear the echo area if there's no
8230 message to clear.
8231 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 8232 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 8233
9a4b36f8
MA
82342012-05-07 Michael Albinus <michael.albinus@gmx.de>
8235
8236 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8237 batch mode.
8238
e5f9458f
CY
82392012-05-06 Chong Yidong <cyd@gnu.org>
8240
8241 * lisp.mk (lisp): Update.
8242
eceeb5fc 82432012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
8244
8245 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8246
71873e2b
SM
82472012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
8248
8249 * data.c (PUT_ERROR): New macro.
8250 (syms_of_data): Use it. Add new error type `user-error'.
8251 * undo.c (user_error): New function.
8252 (Fprimitive_undo): Use it.
8253 * print.c (print_error_message): Adjust print style for `user-error'.
8254 * keyboard.c (user_error): New function.
8255 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8256
ab0fa4e4
PE
82572012-05-03 Paul Eggert <eggert@cs.ucla.edu>
8258
8259 Do not limit current-time-string to years 1000..9999.
8260 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8261 (Fcurrent_time_string): Support any year that is supported by the
8262 underlying localtime representation. Don't use asctime, as it
8263 has undefined behavior for years outside the range -999..9999.
8264
7ed806a7
PE
82652012-05-02 Paul Eggert <eggert@cs.ucla.edu>
8266
8267 Fix race conditions involving setenv, gmtime, localtime, asctime.
8268 Without this fix, interrupts could mess up code that uses these
8269 nonreentrant functions, since setting TZ invalidates existing
8270 tm_zone or tzname values, and since most of these functions return
8271 pointers to static storage.
8272 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8273 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8274 Grow the critical sections to include not just invoking
8275 localtime/gmtime, but also accessing these functions' results
8276 including their tm_zone values if any, and any related TZ setting.
8277 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
8278 so that the struct tm is saved in the critical section.
8279 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
8280 motivated by the fact that memory allocation needs to be outside
8281 the critical section.
8282
0c16dfed
DA
82832012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
8284
8285 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8286 with RESET_INTERVAL.
8287
8288 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8289 Remove duplicated buffer name initialization.
8290
3f83ace8
JM
82912012-05-02 Jim Meyering <jim@meyering.net>
8292
8293 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8294
c7b8541e
JM
8295 * xfns.c (x_window): Use xstrdup (Bug#11375).
8296
90207a15 82972012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
8298
8299 * xdisp.c (pos_visible_p): If already at a newline from the
8300 display string before the 'while' loop, don't walk back the glyphs
8301 from it3.glyph_row. Solves assertion violation when the display
8302 string begins with a newline (egg.el). (Bug#11367)
8303
b593d6a9
AH
83042012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
8305
8306 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
8307 Move to simple.el.
8308
4737362e
GM
83092012-05-01 Glenn Morris <rgm@gnu.org>
8310
99cf43f9
GM
8311 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
8312 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
8313 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
8314 All were removed before 23.1.
8315
9311dcff
GM
8316 * dispnew.c: Remove HAVE_LIBNCURSES test;
8317 it is always true on relevant platforms.
8318
4d5c6349
GM
8319 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
8320 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
8321
4737362e
GM
8322 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
8323
74dd3a6b
AS
83242012-04-30 Andreas Schwab <schwab@linux-m68k.org>
8325
8326 * .gdbinit (xpr): Remove checks for no longer existing misc types.
8327 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8328 Remove.
8329
13c379ee
PE
83302012-04-28 Paul Eggert <eggert@cs.ucla.edu>
8331
8332 Do not avoid creating empty evaporating overlays (Bug#9642).
8333 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8334 That is, do not delete an evaporating overlay if it becomes
8335 empty after its bounds are adjusted to fit within its buffer.
8336 This fix caused other problems, and I'm reverting it until we get
8337 to the bottom of them.
8338
a8e7d6d7 83392012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
8340
8341 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8342
a8e7d6d7 83432012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
8344
8345 * xdisp.c (pos_visible_p): If the window start position is beyond
8346 ZV, start the display from buffer beginning. Prevents assertion
8347 violation in init_iterator when the minibuffer window is scrolled
8348 via the scroll bar.
8349
8350 * window.c (window_scroll_pixel_based): Likewise.
8351
a8e7d6d7 83522012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
8353
8354 * keymap.c (where_is_internal): Doc fix (Bug#10872).
8355
a8e7d6d7 83562012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
8357
8358 * fileio.c (Fcopy_file, Fset_file_selinux_context):
8359 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
8360
a8e7d6d7 83612012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 8362
b593d6a9
AH
8363 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8364 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 8365
1c6900d9
EZ
83662012-04-26 Eli Zaretskii <eliz@gnu.org>
8367
4c3fa1d9
EZ
8368 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8369 display element, check also the underlying string or buffer
8370 character. (Bug#11341)
8371
1c6900d9
EZ
8372 * w32menu.c: Include w32heap.h.
8373 (add_menu_item): If the call to AppendMenuW (via
8374 unicode_append_menu) fails, disable Unicode menus only if we are
8375 running on Windows 9X/Me.
8376
42bf8205
AS
83772012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8378
8379 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8380 (xgetint): Add missing shift for LSB tags.
8381
b1bac16e
MR
83822012-04-24 Martin Rudalics <rudalics@gmx.at>
8383
8384 * keyboard.c (read_char): Don't wipe echo area for select window
8385 events: These might get delayed via `mouse-autoselect-window'
8386 (Bug#11304).
8387
d69621cc
JB
83882012-04-24 Juanma Barranquero <lekktu@gmail.com>
8389
8390 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8391 manipulation of :loaded-from data.
8392
02fd101b
JB
83932012-04-23 Juanma Barranquero <lekktu@gmail.com>
8394
8395 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8396 now a cons (bug#11311).
8397
888bec30
PE
83982012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8399
89a438bd
PE
8400 Do not create empty overlays with the evaporate property (Bug#9642).
8401 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8402 if it becomes empty after its bounds are adjusted to fit within
8403 its buffer. Without this fix, in a nonempty buffer (let ((o
8404 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8405 yields an empty overlay that has the evaporate property, which is
8406 not supposed to happen.
8407
1068fe4d
PE
8408 Fix minor GTK3 problems found by static checking.
8409 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8410 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8411 (struct _EmacsFixedClass, emacs_fixed_get_type):
8412 Move decls here from emacsgtkfixed.h, since they needn't be public.
8413 (emacs_fixed_get_type): Now static.
8414 (emacs_fixed_class_init): Omit unused local.
8415 (emacs_fixed_child_type): Remove; unused.
8416 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8417 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8418 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8419 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8420 (EMACS_FIXED_GET_CLASS): Remove; unused.
8421 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8422
888bec30
PE
8423 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8424 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8425
de85e130
PE
84262012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8427
d0baac98 8428 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 8429 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
8430 (__malloc_size_t, __malloc_ptrdiff_t):
8431 Remove. All uses removed, replaced by the definiens if needed,
8432 since we can assume C89 or better now.
8433 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8434 (protect_malloc_state, align, get_contiguous_space)
8435 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8436 (malloc_atfork_handler_child, malloc_enable_thread)
8437 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8438 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8439 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8440 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8441 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8442 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8443 Define using prototypes, not old style.
8444 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8445 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8446 (align): Don't assume that signed integer overflow wraps around.
8447 Omit unused local var.
8448 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8449 (_free_internal_nolock, memalign, mallochook, reallochook):
8450 Omit no-longer-needed casts.
8451 (valloc): Use getpagesize, not __getpagesize.
8452 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8453 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8454
de85e130
PE
8455 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8456
dcbf5805
MA
84572012-04-22 Michael Albinus <michael.albinus@gmx.de>
8458
8459 Move functions from C to Lisp. Make non-blocking method calls
8460 the default. Implement further D-Bus standard interfaces.
8461
8462 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8463 (QCdbus_request_name_allow_replacement)
8464 (QCdbus_request_name_replace_existing)
8465 (QCdbus_request_name_do_not_queue)
8466 (QCdbus_request_name_reply_primary_owner)
8467 (QCdbus_request_name_reply_in_queue)
8468 (QCdbus_request_name_reply_exists)
8469 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8470 (QCdbus_registered_serial, QCdbus_registered_method)
8471 (QCdbus_registered_signal): New Lisp objects.
8472 (XD_DEBUG_MESSAGE): Use sizeof.
8473 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8474 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8475 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8476 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8477 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8478 (xd_signature, xd_append_arg): Allow float for integer types.
8479 (xd_get_connection_references): New function.
b593d6a9
AH
8480 (xd_get_connection_address): Rename from xd_initialize.
8481 Return cached address.
dcbf5805
MA
8482 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8483 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8484 level.
8485 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 8486 Return number of refcounts.
dcbf5805
MA
8487 (Fdbus_get_unique_name): Make stronger parameter check.
8488 (Fdbus_message_internal): New defun.
8489 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8490 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8491 (Fdbus_send_signal, Fdbus_register_service)
8492 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8493 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8494 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8495 (Vdbus_compiled_version, Vdbus_runtime_version)
8496 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8497 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8498 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
8499 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8500 Adapt docstring.
dcbf5805 8501
52828e02
PE
85022012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8503
da05bc4c
PE
8504 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8505 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8506 Do not assume ptrdiff_t is the same width as 'int'.
8507
52828e02
PE
8508 * alloc.c: Handle unusual debugging option combinations.
8509 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8510 since the two debugging options are incompatible.
8511 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8512 is defined.
8513 (mem_init, mem_insert, mem_insert_fixup):
8514 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8515 (NEED_MEM_INSERT): Remove; no longer needed.
8516
f01769f9
LL
85172012-04-22 Leo Liu <sdl.web@gmail.com>
8518
8519 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8520
5790543d
PE
85212012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8522
8523 * sysdep.c [__FreeBSD__]: Minor cleanups.
8524 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8525 Use Emacs indenting style more consistently. Avoid some casts.
8526 Use 'double' consistently rather than mixing 'float' and 'double'.
8527
b91b7e4d
EW
85282012-04-21 Eduard Wiebe <usenet@pusto.de>
8529
b593d6a9
AH
8530 * sysdep.c (list_system_processes, system_process_attributes):
8531 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 8532
6114eb15
AS
85332012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8534
8535 * lisp.mk (lisp): Update.
8536
2f38dff7
PE
85372012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8538
8539 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8540 It is never used otherwise.
8541
4ae29f89
SM
85422012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8543
8544 * print.c (print_preprocess): Only check print_depth if print-circle
8545 is nil.
8546 (print_object): Check for cycles even when print-circle is nil and
8547 print-gensym is t, but only check print_depth if print-circle is nil.
8548
f30d612a
CY
85492012-04-20 Chong Yidong <cyd@gnu.org>
8550
8551 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8552 set the status to "failed" and ensure that sentinel is run.
8553
c07a4c0b 85542012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
8555
8556 * process.c (Fset_process_inherit_coding_system_flag)
8557 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 8558 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 8559
c07a4c0b 85602012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
8561
8562 * xdisp.c (string_buffer_position_lim): Limit starting position to
8563 BEGV.
8564 (set_cursor_from_row): If called for a mode-line or header-line
8565 row, return zero immediately.
8566 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
8567 farther than the first row after the header line, if any.
8568 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
8569 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8570
c07a4c0b 85712012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8572
4ae29f89
SM
8573 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8574 (bug#11238).
ad3a2b41 8575
c07a4c0b 85762012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 85772012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
8578
8579 configure: new option --enable-gcc-warnings (Bug#11207)
8580 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8581 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8582 (ALL_CFLAGS): Use new macros rather than old.
8583 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8584 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8585 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8586 -Wunused-result, -Wunused-variable. This should go away once
8587 the Emacs and Gnulib regex code is merged.
8588 (xmalloc, xrealloc): Now static.
8589
aba027e8
PE
85902012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8591
8592 * dired.c (Fsystem_groups): Remove unused local.
8593
e5a36063
GM
85942012-04-17 Glenn Morris <rgm@gnu.org>
8595
8596 * dired.c (Fsystem_users): Doc fix.
8597
316411f0
DA
85982012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8599
8600 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8601 (syms_of_dired): Add them.
8602
9426aba4
PE
86032012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8604
b62a57be
PE
8605 Fix minor alloc.c problems found by static checking.
8606 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8607 New extern decls, to avoid calling undeclared functions.
8608 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8609 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8610 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8611 (NEED_MEM_INSERT): New macro.
8612 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 8613 Remove one incorrect comment and fix another.
b62a57be 8614
3539f31f
PE
8615 Fix minor ralloc.c problems found by static checking.
8616 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8617 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8618 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8619 (r_alloc_sbrk): Now static.
8620
a041960a
PE
8621 Improve ralloc.c interface checking.
8622 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8623 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8624 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8625 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8626 [REL_ALLOC]: ... to here, to check interface.
8627 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8628 Remove decls. This fixes an "It stinks!".
8629
9426aba4
PE
8630 * alloc.c (which_symbols): Fix alignment issue / type clash.
8631
d55c12ed
AS
86322012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8633
8634 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8635 (struct Lisp_Misc_Any): Likewise.
8636 (struct Lisp_Free): Likewise.
8637 * alloc.c (union aligned_Lisp_Symbol): Define.
8638 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8639 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8640 (union aligned_Lisp_Misc): Define.
8641 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8642 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 8643 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 8644
b948ce8b
PE
86452012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8646
8647 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8648 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8649 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8650 * s/netbsd.h, s/sol2-6.h:
8651 Remove definition of GC_MARK_STACK, since the default now works.
8652 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8653 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8654 no longer the default.
8655 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8656
35dc09a1 86572012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8658
35dc09a1
GM
8659 * lread.c (lisp_file_lexically_bound_p):
8660 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 8661
35dc09a1
GM
86622012-04-14 Eli Zaretskii <eliz@gnu.org>
8663
8664 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8665 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8666
86672012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8668
8669 * nsterm.m (constrainFrameRect): Always constrain when there is only
8670 one screen (Bug#10962).
8671
bcd86815
KB
86722012-04-13 Ken Brown <kbrown@cornell.edu>
8673
8674 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8675
c25df26e
RT
86762012-04-13 Reuben Thomas <rrt@sc3d.org>
8677
8678 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8679
0fc59f1e
DC
86802012-04-11 Daniel Colascione <dancol@dancol.org>
8681
8682 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8683 against is gone. It's better to use vfork now so that when Cygwin
8684 gains a new, working vfork, we use it automatically (bug#10398).
8685
de8c03dc
SM
86862012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8687
8688 * window.c (save_window_save): Obey window-point-insertion-type.
8689
2f097256
GM
86902012-04-11 Glenn Morris <rgm@gnu.org>
8691
8692 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8693
453b951e
SM
86942012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8695
8696 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8697
75f1671a 86982012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
8699
8700 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8701 (force_quit_count): New var.
8702 (handle_interrupt): Use it.
8703
2a8ce227
JB
87042012-04-10 Juanma Barranquero <lekktu@gmail.com>
8705
8706 * w32.c (w32_delayed_load): Record the full path of the library
8707 being loaded (bug#10424).
8708
935396c0
GM
87092012-04-09 Glenn Morris <rgm@gnu.org>
8710
05920a43
GM
8711 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8712 not just in the obarray, before snarfing them. (Bug#11036)
8713
935396c0
GM
8714 * Makefile.in ($(leimdir)/leim-list.el):
8715 Pass EMACS rather than BUILT_EMACS.
8716
a18ecafa
TZ
87172012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8718
8719 * process.c (make_process):
8720 * process.h: Add integer `gnutls_handshakes_tried' member to
8721 process struct.
8722
6bbef4e5
JC
8723 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8724 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
8725
8726 * gnutls.c (gnutls_log_function2i): Convenience log function.
8727 (emacs_gnutls_read): Use new log functions,
8728 `gnutls_handshakes_tried' process member, and
8729 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8730 attempts per process (connection).
8731
b4d3bc10
CY
87322012-04-09 Chong Yidong <cyd@gnu.org>
8733
8734 * eval.c (Fuser_variable_p, user_variable_p_eh)
8735 (lisp_indirect_variable): Functions deleted.
8736 (Fdefvar): Caller changed.
8737
8738 * callint.c (Finteractive, Fcall_interactively):
8739 * minibuf.c (Fread_variable): Callers changed.
8740
70f4d973
EZ
87412012-04-09 Eli Zaretskii <eliz@gnu.org>
8742
8743 * xdisp.c (set_cursor_from_row): If the display string appears in
8744 the buffer at position that is closer to point than the position
8745 after the display string, display the cursor on the first glyph of
8746 the display string. Fixes cursor display when a 'display' text
8747 property immediately follows invisible text. (Bug#11094)
8748
cb3c2e3e
PE
87492012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8750
8751 composite.c: use 'double' consistently
8752 * composite.c (get_composition_id): Use 'double' consistently
8753 instead of converting 'float' to 'double' and vice versa; this is
8754 easier to understand and avoids a GCC warning.
8755
fd06db5d
GM
87562012-04-09 Glenn Morris <rgm@gnu.org>
8757
50fe702a
GM
8758 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8759 preparation for dumping it with emacs. (Bug#4789)
8760 (leimdir): New variable.
8761 ($(leimdir)/leim-list.el): New rule.
8762 (emacs$(EXEEXT)): Depend on leim-list.el.
8763
fd06db5d
GM
8764 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8765 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8766 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8767
55c131ee
AS
87682012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8769
8770 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8771 proper alignment.
8772
9209588f
JB
87732012-04-07 Juanma Barranquero <lekktu@gmail.com>
8774
8775 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8776 Remove unused local variable.
8777
e3fb2efb
PE
87782012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8779
8780 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8781 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8782 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8783 objects, as mark_maybe_pointer will catch them otherwise.
8784 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8785 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8786
b5385551
PE
87872012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8788
8789 Fix typo that broke non-Windows builds.
8790 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8791
9078ead6
EZ
87922012-04-07 Eli Zaretskii <eliz@gnu.org>
8793
8794 Support building on MS-Windows with libxml2.
8795
8796 * makefile.w32-in (OBJ2): Add xml.$(O).
8797 (GLOBAL_SOURCES): Add xml.c.
8798 ($(BLD)/xml.$(O)): New dependency list.
8799
8800 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8801 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8802 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8803 [!WINDOWSNT]: New macros.
8804 (init_libxml2_functions, libxml2_loaded_p): New functions.
8805 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8806 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8807 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8808 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8809 linked in).
6bbef4e5
JC
8810 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8811 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
8812 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8813
8814 * emacs.c: Don't include libxml/parser.h.
8815 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8816 xmlCleanupParser directly.
8817
8818 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8819
3811fdf3
EZ
88202012-04-07 Eli Zaretskii <eliz@gnu.org>
8821
8822 * indent.c (Fvertical_motion): If there is a display string at
8823 point, use it.vpos to compute how many lines to backtrack after
8824 move_it_to point. (Bug#11133)
8825
2f8e16b2
EZ
88262012-04-06 Eli Zaretskii <eliz@gnu.org>
8827
8828 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8829 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8830 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8831 macros related to unification of CJK characters. For the details,
8832 see the discussion following the message here:
8833 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8834
3d439cd1
CY
88352012-04-04 Chong Yidong <cyd@gnu.org>
8836
8837 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8838
8bc53d00
EZ
88392012-04-01 Eli Zaretskii <eliz@gnu.org>
8840
8841 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8842 instead of alloca. (Bug#11138)
8843
3b0512a3
AS
88442012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8845
8846 * w32menu.c (is_simple_dialog): Properly check lisp types.
8847 (Bug#11141)
8848
8427ddd2
EZ
88492012-03-31 Eli Zaretskii <eliz@gnu.org>
8850
979022ef
EZ
8851 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8852 position we get to after a call to move_it_to fails the
8853 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8854 only if we wind up in a string from display property. (Bug#11063)
8855
a6b1c7cc
EZ
8856 * window.c (Fdelete_other_windows_internal): Invalidate the row
8857 and column information about mouse highlight, so that redisplay
8858 restores it after reallocating the glyph matrices. (Bug#7464)
8859
8427ddd2
EZ
8860 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8861 string comes from a `display' text property, use the buffer
8862 position of that property as if we actually saw that position in
8863 the row's glyphs.
697ba24b
EZ
8864 (move_it_by_lines): Remove the assertion that
8865 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8866 violated when there's a before-string at the beginning of a line.
8867 (Bug#11063)
8427ddd2 8868
65a0a738
EZ
88692012-03-30 Eli Zaretskii <eliz@gnu.org>
8870
8871 * xdisp.c (append_space_for_newline): If the default face was
8872 remapped, use the remapped face for the appended newline.
8873 (extend_face_to_end_of_line): Use the remapped default face for
8874 extending the face to the end of the line.
8875 (display_line): Call extend_face_to_end_of_line when the default
8876 face was remapped. (Bug#11068)
8877
581355cc
EZ
88782012-03-29 Eli Zaretskii <eliz@gnu.org>
8879
8880 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8881
e8fc049f
SM
88822012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8883
8884 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8885
4fb9a543
GM
88862012-03-27 Glenn Morris <rgm@gnu.org>
8887
8888 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8889 Doc fixes.
8890
679910f1
KH
88912012-03-26 Kenichi Handa <handa@m17n.org>
8892
8893 * dispextern.h (struct glyph): Fix previous change. Change the
8894 bit length of glyphless.ch to 25 (Bug#11082).
8895
90d49b7f
CY
88962012-03-26 Chong Yidong <cyd@gnu.org>
8897
8898 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8899 (command_loop_1): Use it; inhibit selection update for
8900 handle-select-window too (Bug#8996).
8901
f514f6f0
FP
89022012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8903
e8fc049f 8904 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 8905
bf43fa51
KH
89062012-03-25 Kenichi Handa <handa@m17n.org>
8907
8908 * dispextern.h (struct glyph): Change the bit length of
8909 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8910
8a0c01dd
EZ
89112012-03-24 Eli Zaretskii <eliz@gnu.org>
8912
8913 * s/ms-w32.h (tzname): Include time.h before redirecting to
8914 _tzname. Fixes the MSVC build. (Bug#9960)
8915
7d1c3a76
AS
89162012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8917
8ed79523
AS
8918 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8919 characters.
8920
7d1c3a76
AS
8921 * xterm.c (XTread_socket): Only modify handling_signal if
8922 !SYNC_INPUT. (Bug#11080)
8923
e99a9b8b
EZ
89242012-03-23 Eli Zaretskii <eliz@gnu.org>
8925
8926 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8927 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8928 when fetching a multibyte character consumes more bytes than
8929 CHAR_BYTES returns, due to unification of CJK characters in
8930 string_char. (Bug#11073)
8931
5063c0e1
TN
89322012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8933
8934 * process.c (wait_reading_process_output): Handle pty disconnect
8935 by refraining from sending oneself a SIGCHLD (bug#10933).
8936
9f851fbd
CY
89372012-03-22 Chong Yidong <cyd@gnu.org>
8938
8939 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8940
5063c0e1 8941 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
8942 Mark string as coming from a prefix property.
8943 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8944 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8945
fb5b8aca
CY
89462012-03-21 Chong Yidong <cyd@gnu.org>
8947
8948 * xfaces.c (Vface_remapping_alist): Doc fix.
8949
62356a1b
EZ
89502012-03-20 Eli Zaretskii <eliz@gnu.org>
8951
8952 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
8953 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8954 Doc fixes.
62356a1b 8955
025de85b
CY
89562012-03-20 Chong Yidong <cyd@gnu.org>
8957
8958 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8959 to reflect default non-nil value of redisplay-dont-pause.
8960
4827f94e
KH
89612012-03-19 Kenichi Handa <handa@m17n.org>
8962
8963 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8964 it fit in a valid range (Bug#11003).
8965
e50a24a2
EZ
89662012-03-18 Eli Zaretskii <eliz@gnu.org>
8967
8968 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8969 that is not from display property, accept the row as a "cursor
8970 row" if one of the string's character has a non-nil `cursor'
8971 property. Fixes cursor positioning when there are newlines in
8972 overlay strings, e.g. in icomplete.el. (Bug#11035)
8973
9af5ed87
PE
89742012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8975
8976 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8977
d1f55f16
CY
89782012-03-12 Chong Yidong <cyd@gnu.org>
8979
8980 * eval.c (inhibit_lisp_code): Rename from
8981 inhibit_window_configuration_change_hook; move from window.c.
8982
8983 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8984 * window.c (run_window_configuration_change_hook)
8985 (syms_of_window): Callers changed.
8986
66c5eebd
CY
89872012-03-11 Chong Yidong <cyd@gnu.org>
8988
413df973
CY
8989 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8990
66c5eebd
CY
8991 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8992
1de11f56
CY
89932012-03-10 Chong Yidong <cyd@gnu.org>
8994
8995 * frame.c (other_visible_frames): Don't assume the selected frame
8996 is visible (Bug#10955).
8997
cae07000
SM
89982012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8999
9000 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9001
89c94350
JD
90022012-03-08 Jan Djärv <jan.h.d@swipnet.se>
9003
9004 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9005 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
9006 zero (Bug#10954).
9007
999dd333
GM
90082012-03-03 Glenn Morris <rgm@gnu.org>
9009
01a6dcc8 9010 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 9011
de0100f2
EZ
90122012-03-02 Eli Zaretskii <eliz@gnu.org>
9013
9014 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
9015 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
9016 (redisplay_window, next_element_from_string): Fix typos in
9017 comments.
3e441275
EZ
9018 (redisplay_window): Pass to move_it_vertically the margin in
9019 pixels, not in screen lines.
de0100f2 9020
96a72ee9
GM
90212012-03-02 Glenn Morris <rgm@gnu.org>
9022
9023 * buffer.c (buffer-list-update-hook): Doc fix.
9024
312508d7
EZ
90252012-02-29 Eli Zaretskii <eliz@gnu.org>
9026
9027 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9028 push_it before setting up the iterator for the first overlay
9029 string, even if we have an empty string loaded.
9030 (next_overlay_string): If there's an empty string on the iterator
9031 stack, pop the stack. (Bug#10903)
9032
27f3c637
PE
90332012-02-25 Paul Eggert <eggert@cs.ucla.edu>
9034
9035 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9036 Suggested by Stefan Monnier in
9037 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9038 * alloc.c (widen_to_Lisp_Object): New static function.
9039 (mark_memory): Also mark Lisp_Objects by fetching pointer words
9040 and widening them to Lisp_Objects. This would work even if
9041 USE_LSB_TAG is defined and wide integers are used, which might
9042 happen in a future version of Emacs.
9043
3c9dfce6
CY
90442012-02-25 Chong Yidong <cyd@gnu.org>
9045
fa74b241
CY
9046 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9047 Doc fix.
9048
3c9dfce6
CY
9049 * xselect.c (Fx_selection_exists_p): Doc fix.
9050 (x_clipboard_manager_save_all): Print an informative message
9051 before saving to clipboard manager.
9052
9486df08
CY
90532012-02-24 Chong Yidong <cyd@gnu.org>
9054
9055 * keyboard.c (process_special_events): Handle all X selection
9056 requests in kbd_buffer, not just the next one (Bug#8869).
9057
f01d3321
CY
90582012-02-23 Chong Yidong <cyd@gnu.org>
9059
9060 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9061 call when setting menu-bar-lines and tool-bar-lines parameters.
9062 (unwind_create_frame_1): New helper function.
9063
9064 * window.c (inhibit_window_configuration_change_hook): New var.
9065 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 9066 (syms_of_window): Initialize it.
f01d3321 9067
86b847b6
CY
90682012-02-22 Chong Yidong <cyd@gnu.org>
9069
9070 * xterm.c (x_draw_image_relief): Add missing type check for
9071 Vtool_bar_button_margin (Bug#10743).
9072
a59225b1
CY
90732012-02-21 Chong Yidong <cyd@gnu.org>
9074
9075 * fileio.c (Vfile_name_handler_alist): Doc fix.
9076
9077 * buffer.c (Fget_file_buffer): Protect against invalid file
9078 handler return value.
9079
310f5bd4
PE
90802012-02-20 Paul Eggert <eggert@cs.ucla.edu>
9081
cb3a28cc
PE
9082 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9083 when computing $valmask.
9084
310f5bd4
PE
9085 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9086 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9087 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9088 It's useless in that case, and it can cause problems on hosts
9089 that allocate halves of EMACS_INT values separately.
9090 Reported by Dan Horák. Diagnosed by Andreas Schwab in
9091 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9092 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9093 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
9094 it avoids undefined behavior on hosts where shifting right by more
9095 than the word width has undefined behavior.
9096
2375c96a
CY
90972012-02-19 Chong Yidong <cyd@gnu.org>
9098
9099 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9100 (Funhandled_file_name_directory, Ffile_name_as_directory)
9101 (Fdirectory_file_name, Fexpand_file_name)
9102 (Fsubstitute_in_file_name): Protect against invalid file handler
9103 return values (Bug#10845).
9104
3eb49e71
EZ
91052012-02-18 Eli Zaretskii <eliz@gnu.org>
9106
9107 * .gdbinit (pitx): Fix incorrect references to fields of the
9108 iterator stack.
9109
7b926f3f
CY
91102012-02-17 Chong Yidong <cyd@gnu.org>
9111
9112 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9113
11273115
PE
91142012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9115
9116 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9117 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9118
c3a70e2b
CY
91192012-02-15 Chong Yidong <cyd@gnu.org>
9120
9121 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9122 marked as special. Also, starting docstrings with * is obsolete.
9123
0ca43699
AS
91242012-02-13 Andreas Schwab <schwab@linux-m68k.org>
9125
9126 * gnutls.c (emacs_gnutls_write): Fix last change.
9127
2e8f3c56
LI
91282012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
9129
9130 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9131 send_process.
9132
af70074f
SM
91332012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
9134
9135 * keymap.c (Fsingle_key_description): Handle char ranges.
9136
95986d52
CY
91372012-02-12 Chong Yidong <cyd@gnu.org>
9138
afd83bd1
CY
9139 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9140 as that creates a dangerous corner case.
9141
95986d52
CY
9142 * window.c (Fdelete_window_internal): Invalidate the mouse
9143 highlight (Bug#9904).
9144
bd7da63e
GM
91452012-02-12 Glenn Morris <rgm@gnu.org>
9146
9147 * xselect.c (Fx_own_selection_internal)
9148 (Fx_get_selection_internal, Fx_disown_selection_internal)
9149 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
9150 * nsselect.m (Fx_own_selection_internal)
9151 (Fx_disown_selection_internal, Fx_selection_exists_p)
9152 (Fx_selection_owner_p, Fx_get_selection_internal):
9153 Sync docs and argument specs with the xselect.c versions.
9154
77abcbc2
LI
91552012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
9156
9157 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
9158
90b671e2
EZ
91592012-02-11 Eli Zaretskii <eliz@gnu.org>
9160
1c0ca0b7
EZ
9161 * w32select.c (Fx_selection_exists_p): Sync doc string and
9162 argument list with xselect.c. (Bug#10783)
9163
9164 * w16select.c (Fx_selection_exists_p): Sync doc string and
9165 argument list with xselect.c. (Bug#10783)
90b671e2 9166
49241268
GM
91672012-02-10 Glenn Morris <rgm@gnu.org>
9168
9169 * fns.c (Fsecure_hash): Doc fix.
9170
f998bbe7 91712012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
9172
9173 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
9174
0992bd9c
CY
91752012-02-07 Chong Yidong <cyd@gnu.org>
9176
9177 * buffer.c (Fbuffer_local_variables)
9178 (buffer_lisp_local_variables): Handle unbound vars correctly;
9179 don't let Qunbound leak into Lisp.
9180
af008560
GM
91812012-02-07 Glenn Morris <rgm@gnu.org>
9182
dd605cc4
GM
9183 * image.c (Fimagemagick_types): Doc fix.
9184
af008560
GM
9185 * image.c (imagemagick-render-type): Change it from a lisp object
9186 to an integer. Move the doc here from the lisp manual.
9187 Treat all values not equal to 0 the same.
9188
1449fa1d
CY
91892012-02-06 Chong Yidong <cyd@gnu.org>
9190
9191 * doc.c (store_function_docstring): Avoid applying docstring of
9192 alias to base function (Bug#2603).
9193
3723ec07
AS
91942012-02-04 Andreas Schwab <schwab@linux-m68k.org>
9195
9196 * .gdbinit (pp1, pv1): Remove redundant defines.
9197 (pr): Use pp.
9198
79c1cc1e
CY
91992012-02-04 Chong Yidong <cyd@gnu.org>
9200
9201 * nsterm.m: Declare a global (Bug#10694).
9202
d7f29f8e
EZ
92032012-02-04 Eli Zaretskii <eliz@gnu.org>
9204
cae07000
SM
9205 * w32.c (get_emacs_configuration_options):
9206 Include --enable-checking, if specified, in the return value.
d7f29f8e 9207
3b95a6f9
MR
92082012-02-04 Martin Rudalics <rudalics@gmx.at>
9209
9210 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9211 after rounding frame sizes. (Bug#9723)
9212
d6fa96a6
EZ
92132012-02-04 Eli Zaretskii <eliz@gnu.org>
9214
9215 * keyboard.c (adjust_point_for_property): Don't position point
9216 before BEGV. (Bug#10696)
9217
df0b2940
PE
92182012-02-03 Paul Eggert <eggert@cs.ucla.edu>
9219
9220 Handle overflow when computing char display width (Bug#9496).
9221 * character.c (char_width): Return EMACS_INT, not int.
9222 (char_width, c_string_width): Check for overflow when
9223 computing the width; this is possible now that individual
9224 characters can have unbounded width. Problem introduced
9225 by merge from Emacs 23 on 2012-01-19.
9226
6bee44d6
MA
92272012-02-02 Michael Albinus <michael.albinus@gmx.de>
9228
9229 * dbusbind.c (Fdbus_register_method): Mention the return value
9230 :ignore in the docstring.
9231
44f92739
GM
92322012-02-02 Glenn Morris <rgm@gnu.org>
9233
1b9f60cc
GM
9234 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9235
44f92739
GM
9236 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9237 Unconditionally set to t. (Bug#10673)
9238 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9239 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9240 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9241
c5d3843c
KH
92422012-02-02 Kenichi Handa <handa@m17n.org>
9243
9244 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
9245 0, do not call append_composite_glyph.
9246
159462d4 92472012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
9248
9249 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9250 NULL (Bug#6988).
9251 (x_produce_glyphs): If the component of a composition is a null
9252 string, set it->pixel_width to 1 to avoid zero-width glyph.
9253
78cef877
EZ
92542012-02-01 Eli Zaretskii <eliz@gnu.org>
9255
9256 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9257 first 2 arguments are identical. This makes inserting large
9258 output from a subprocess an order of magnitude faster on
9259 MS-Windows, where all sbrk'ed memory is always contiguous.
9260
97897668
GM
92612012-01-31 Glenn Morris <rgm@gnu.org>
9262
9263 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 9264 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
9265 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9266
31fd3586
GM
92672012-01-29 Glenn Morris <rgm@gnu.org>
9268
9269 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9270
0e24a8b2
CY
92712012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
9272
9273 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9274
cc0adcb0
CY
92752012-01-28 Chong Yidong <cyd@gnu.org>
9276
9277 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9278
acc28cb9
CY
92792012-01-26 Chong Yidong <cyd@gnu.org>
9280
9c69cfb7
CY
9281 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9282
acc28cb9
CY
9283 * search.c (Fsearch_forward, Fsearch_backward): Document negative
9284 repeat counts (Bug#10507).
9285
48da7392
GM
92862012-01-26 Glenn Morris <rgm@gnu.org>
9287
9288 * lread.c (syms_of_lread): Doc fix.
9289
14af5f7f
CY
92902012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
9291
9292 * coding.c (encode_designation_at_bol): Change return value to
9293 EMACS_INT.
9294
0b21c100
CY
92952012-01-25 Chong Yidong <cyd@gnu.org>
9296
9297 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
9298
3c2907f7
CY
92992012-01-21 Chong Yidong <cyd@gnu.org>
9300
9301 * floatfns.c (Fcopysign): Make the second argument non-optional,
9302 since nil is not allowed anyway.
9303
959ad23f
AS
93042012-01-21 Andreas Schwab <schwab@linux-m68k.org>
9305
9306 * process.c (read_process_output): Use p instead of XPROCESS (proc).
9307 (send_process): Likewise.
9308
34a02f46
MR
93092012-01-19 Martin Rudalics <rudalics@gmx.at>
9310
9311 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
9312 (Vwindow_persistent_parameters): Do not use Qstate.
9313 Rewrite doc-strings.
34a02f46 9314
1259009a 93152012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
9316
9317 * character.c (char_width): New function.
70d4fdf6
GM
9318 (Fchar_width, c_string_width, lisp_string_width):
9319 Use char_width (Bug#9496).
25ed9e61 9320
6a6ee00d
MR
93212012-01-16 Martin Rudalics <rudalics@gmx.at>
9322
9323 * window.c (Vwindow_persistent_parameters): New variable.
9324 (Fset_window_configuration, save_window_save): Handle persistent
9325 window parameters.
9326
c85efaf7
EZ
93272012-01-14 Eli Zaretskii <eliz@gnu.org>
9328
9329 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9330 thrashing the stack of the thread. (Bug#9087)
9331
5944709e
PE
93322012-01-12 Paul Eggert <eggert@cs.ucla.edu>
9333
9334 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9335
e71f5d99
EZ
93362012-01-11 Eli Zaretskii <eliz@gnu.org>
9337
9338 * xdisp.c (rows_from_pos_range): Handle the case where the
9339 highlight ends on a newline. (Bug#10464)
9340 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9341 he end column for display of highlight that ends on a newline
9342 before a R2L line.
9343
ce316182
GM
93442012-01-11 Glenn Morris <rgm@gnu.org>
9345
9346 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9347 from load-path also when installation-directory is nil. (Bug#10208)
9348
5b43da69
GM
93492012-01-10 Glenn Morris <rgm@gnu.org>
9350
74cc8ff9
GM
9351 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9352
7d8d6e4e
GM
9353 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9354 Update template values to be closer to their typical values these days.
5b43da69 9355
a0db8d43
EZ
93562012-01-09 Eli Zaretskii <eliz@gnu.org>
9357
9358 * xdisp.c (rows_from_pos_range): Accept additional argument
9359 DISP_STRING, and accept any glyph in a row whose object is that
9360 string as eligible for mouse highlight. Fixes mouse highlight of
9361 display strings from overlays. (Bug#10464)
9362
9a0115ab 93632012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 9364
b9110d6a 9365 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
9366 * fileio.c (auto_saving_dir_umask): New static var.
9367 (Fmake_directory_internal): Use it.
9368 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9369 creating the directory. The old code temporarily assigns
9370 too-generous permissions to the directory.
9371 (do_auto_save_eh): Clear it.
b9110d6a 9372 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
9373 that the var is always cleared.
9374
6c1bd3f3
EZ
93752012-01-07 Eli Zaretskii <eliz@gnu.org>
9376
9377 * search.c (scan_buffer): Pass character positions to
9378 know_region_cache, not byte positions. (Bug#6540)
9379
069d2b50
L
93802012-01-07 LynX <_LynX@bk.ru> (tiny change)
9381
9382 * w32.c (sys_rename): Report EXDEV when rename of a directory
9383 fails because the target is on another logical disk. (Bug#10284)
9384
75bf0d33
DB
93852012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9386
9387 * xterm.c (x_embed_request_focus): New function.
9388
9389 * xterm.h: Add prototype.
9390
9391 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9392
1c6e5a32
GM
93932012-01-05 Glenn Morris <rgm@gnu.org>
9394
9395 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9396
651e947e
EZ
93972012-01-01 Eli Zaretskii <eliz@gnu.org>
9398
9399 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9400 Load gnutls_transport_set_lowat only if GnuTLS version is below
9401 2.11.1.
9402 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9403 GnuTLS versions below 2.11.1.
9404
3778cdd8
AL
94052011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9406
9407 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9408 to the doc string advising against its use for altering the way
9409 windows are scrolled.
9410
0e5317f7
KH
94112011-12-28 Kenichi Handa <handa@m17n.org>
9412
9413 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9414 coding-system ASCII compatible only when it does not produce BOM
9415 on encoding (Bug#10383).
9416
93d5ca1f
JD
94172011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9418
9419 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9420 can scroll.
9421 (create_and_show_popup_menu): Always use menu_position_func for
9422 Gtk3 (Bug#10361).
9423
ca22b785
AS
94242011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9425
9426 * callint.c (Fcall_interactively): Don't truncate prompt string.
9427
d048e1e6
EZ
94282011-12-23 Eli Zaretskii <eliz@gnu.org>
9429
9430 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9431 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 9432 resumed from there (after widening). (Bug#10360)
d048e1e6 9433
5ccaba1f
JD
94342011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9435
9436 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9437
204ee57f
JD
94382011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9439
b81d40f0
JB
9440 * nsterm.m (x_free_frame_resources):
9441 Release f->output_data.ns->miniimage.
204ee57f
JD
9442 (ns_index_color): Fix indentation. Do not retain
9443 color_table->colors[i].
9444
9445 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9446 before returning.
9447
9448 * nsfns.m (x_set_background_color): Assign return value from
9449 ns_index_color to face-background instead of NSColor*.
9450 (ns_implicitly_set_icon_type): Fix indentation.
9451 Change assignment in for loop to comparison.
9452
9453 * emacs.c (ns_pool): New variable.
9454 (main): Assign ns_pool.
9455 (Fkill_emacs): Call ns_release_autorelease_pool.
9456
9457 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9458 autorelease fdesc, release fdAttrs and tdict.
9459 (ns_get_covering_families): Release charset.
9460 (ns_findfonts): Release NSFontDescriptor created with new.
9461 (ns_uni_to_glyphs): Fix indentation.
9462 (setString): Release attrStr before assigning new value.
9463
c803b2b7
JD
94642011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9465
678f4426
JD
9466 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9467 and NS_IMPL_COCOA.
9468 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9469 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9470
cd394be1 94712011-12-18 David Reitter <reitter@cmu.edu>
678f4426 9472
5fecd5fc
JD
9473 * nsterm.m (ns_term_init): Subscribe for notifications
9474 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9475 to method trackingNotification in EmacsMenu.
9476
9477 * nsmenu.m (trackingMenu): New variable.
3771cb17 9478 (trackingNotification): New method (from Aquamacs).
5fecd5fc 9479 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 9480 from Aquamacs (Bug#7030).
678f4426
JD
9481
94822011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 9483
c803b2b7
JD
9484 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9485 (symbol_to_nsstring): Fix indentation.
9486 (ns_symbol_to_pb): New function.
cae07000
SM
9487 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9488 (Fns_rotate_cut_buffers_internal): Remove.
9489 (Fns_store_selection_internal): Rename from
c803b2b7
JD
9490 Fns_store_cut_buffer_internal.
9491 (ns_get_foreign_selection, Fx_own_selection_internal)
9492 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
9493 (Fns_get_selection_internal, Fns_store_selection_internal):
9494 Use ns_symbol_to_pb and check if return value is nil.
9495 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9496 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
9497 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9498 renamed to Sns_store_selection_internal.
9499 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9500 and remove this function.
9501 (ns_handle_selection_clear): Remove, never used.
9502 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9503 here.
9504
e1b01a3a
KB
95052011-12-17 Ken Brown <kbrown@cornell.edu>
9506
9507 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9508 GID is unknown (Bug#10257).
9509
2adb6e85
PE
95102011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9511
9512 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9513 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9514 which caused a build failure on GNU/Linux IA-64. This problem was
9515 introduced by my 2011-10-07 patch.
9516
d1d7b339
JL
95172011-12-15 Juri Linkov <juri@jurta.org>
9518
9519 * image.c (imagemagick_error): New function. (Bug#10112)
9520 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9521 Use `imagemagick_error' where ImageMagick functions return
9522 `MagickFalse'.
9523 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9524 proper order.
9525
100d5755
KH
95262011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9527
9528 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9529 fill background (Bug#8992).
9530
454592a6
MR
95312011-12-13 Martin Rudalics <rudalics@gmx.at>
9532
9533 * window.c (Vwindow_combination_resize)
9534 (Vwindow_combination_limit): Use t instead of non-nil in
9535 doc-strings.
61d4b438
MR
9536 (Vrecenter_redisplay): Add first sentence of doc-string on
9537 separate line.
53524d93 9538 (Frecenter): Fix doc-string typo.
454592a6 9539
3633e3aa
KH
95402011-12-11 Kenichi Handa <handa@m17n.org>
9541
9542 * coding.c (Funencodable_char_position): Pay attention to the
9543 buffer text relocation (Bug#9389).
9544
7b9d523a 95452011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 9546
7b9d523a
JD
9547 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9548 gtk_init (Bug#10100).
9549
b73189c6
EZ
95502011-12-10 Eli Zaretskii <eliz@gnu.org>
9551
9552 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9553 IT->string is nil. (Bug#10263)
9554
f7dfe5d6
JD
95552011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9556
83faebb4
JD
9557 * nsterm.h (x_free_frame_resources): Declare.
9558
f7dfe5d6
JD
9559 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9560 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9561
9562 * nsterm.h (ns_get_defaults_value): Declare.
9563
9564 * nsterm.m (ns_default): Call ns_get_defaults_value.
9565
7cd4e72c
EZ
95662011-12-09 Eli Zaretskii <eliz@gnu.org>
9567
9568 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9569 (Bug#10170)
9570
b34d7317
YM
95712011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9572
9573 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9574 that where the value of an _OBJC_* symbol points to is in the .bss
9575 section (Bug#10240).
9576
76470ad1
KH
95772011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9578
9579 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 9580 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 9581
745fff94
KH
95822011-12-08 Kenichi Handa <handa@m17n.org>
9583
9584 * ftfont.c (get_adstyle_property): Fix previous change
9585 (Bug#10233).
9586
6e44397c
JB
95872011-12-07 Juanma Barranquero <lekktu@gmail.com>
9588
9589 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9590 dirs from the default value of EMACSLOADPATH (bug#10208).
9591
7efa6272
GM
95922011-12-07 Glenn Morris <rgm@gnu.org>
9593
9594 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9595 installation and source directories as well. (Bug#10208)
9596
f6fc4d87
CY
95972011-12-06 Chong Yidong <cyd@gnu.org>
9598
9599 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9600
2bf26180
GM
96012011-12-06 Glenn Morris <rgm@gnu.org>
9602
9603 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9604 as an error, not just -1. (Bug#10217)
9605
3a6ad4f0
CY
96062011-12-05 Chong Yidong <cyd@gnu.org>
9607
9608 * keyboard.c (process_special_events): New function.
9609 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9610
75a3b399
PE
96112011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9612
9613 * coding.c (encode_designation_at_bol): Don't use uninitialized
9614 local variable (Bug#9318).
9615
c3c9e25e
KH
96162011-12-05 Kenichi Handa <handa@m17n.org>
9617
9618 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9619 return Qnil (Bug#8046, Bug#10193).
9620
5eb05ea3
KH
96212011-12-05 Kenichi Handa <handa@m17n.org>
9622
9623 * coding.c (encode_designation_at_bol): New args charbuf_end and
9624 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
9625 (coding_set_source): Return how many bytes coding->source was
9626 relocated.
9627 (coding_set_destination): Return how many bytes
9628 coding->destination was relocated.
9629 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 9630 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
9631
96322011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9633
9634 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9635 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9636 macro (Bug#9318).
9637
96382011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9639
9640 The following changes are to fix Bug#9318.
9641
a79703f5 9642 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
9643 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9644 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 9645 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 9646
7dbda6df
JB
96472011-12-05 Juanma Barranquero <lekktu@gmail.com>
9648
9649 * lisp.h (process_quit_flag): Fix external declaration.
9650
6d5eb5b0
SM
96512011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9652
9653 Don't macro-inline non-performance-critical code.
9654 * eval.c (process_quit_flag): New function.
9655 * lisp.h (QUIT): Use it.
9656
a0c3fad0
JD
96572011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9658
9659 * nsfns.m (get_geometry_from_preferences): New function.
9660 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9661
6c07aac2
AS
96622011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9663
9664 * emacs.c (Qkill_emacs): Define.
9665 (syms_of_emacs): Initialize it.
9666 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9667 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
9668 (quit_throw_to_read_char): Add parameter `from_signal'.
9669 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
9670 * lisp.h (QUIT): Call Fkill_emacs if requested.
9671
c052ead4
JD
96722011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9673
9674 * widget.c (update_wm_hints): Return if wmshell is null.
9675 (widget_update_wm_size_hints): New function.
9676
9677 * widget.h (widget_update_wm_size_hints): Declare.
9678
9679 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9680 widget_update_wm_size_hints (Bug#10104).
9681
9e49252b
EZ
96822011-12-03 Eli Zaretskii <eliz@gnu.org>
9683
9684 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9685 before a newline, prepare the bidi iterator for consuming the
9686 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 9687 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 9688
02b16839
JL
96892011-12-02 Juri Linkov <juri@jurta.org>
9690
9691 * search.c (Fword_search_regexp): New Lisp function created from
9692 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9693 (Fword_search_backward, Fword_search_forward)
9694 (Fword_search_backward_lax, Fword_search_forward_lax):
9695 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9696 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9697
0068070e
SM
96982011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9699
9700 * fileio.c (Finsert_file_contents): Move after-change-function call
9701 to before the "handled:" label, since all "goto handled" appear in
9702 cases where the *-change-functions have already been properly called
9703 (bug#10117).
9704
3360a3fc
AS
97052011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9706
9707 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9708 waiting for input. (Bug#10169)
9709
73d6c093
EZ
97102011-11-30 Eli Zaretskii <eliz@gnu.org>
9711
9712 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9713 verifies glyph row's hash code--we have just reallocated the
9714 glyphs, so their contents can be complete garbage. (Bug#10164)
9715
febe6bea
JB
97162011-11-30 Juanma Barranquero <lekktu@gmail.com>
9717
9718 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9719
801a4313
EZ
97202011-11-30 Eli Zaretskii <eliz@gnu.org>
9721
9722 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9723 attributes are tested _before_ calling verify_row_hash, to protect
9724 against GCC re-ordering of the tests. (Bug#10164)
9725
2b56b87e
JD
97262011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9727
9728 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9729
9730 * xterm.c (handle_one_xevent): Only set async_visible and friends
9731 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 9732 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
9733 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9734
dbf31225
PE
97352011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9736
9737 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9738 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9739 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9740 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9741 All uses changed to use GCPRO1 etc.
9742 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9743 Revert to old implementation (i.e., before 2011-03-11).
9744
1305621b
YM
97452011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9746
9747 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9748 of scroll runs so as to avoid assigning disabled bogus rows and
9749 unnecessary graphics copy operations.
9750
8c9afb46
EZ
97512011-11-27 Eli Zaretskii <eliz@gnu.org>
9752
9753 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9754 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9755 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9756 (malloc, free, realloc, calloc): Redirect to e_* only when
9757 compiling Emacs.
9758
9759 * lisp.h (GCTYPEBITS): Move before first use.
9760 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9761 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9762 this macro definition.
9763
9764 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9765 _MSC_VER.
9766
54e9e3bf
JD
97672011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9768
6d5eb5b0
SM
9769 * gtkutil.c (xg_create_frame_widgets):
9770 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
9771 present with Gtk+ 2.0.
9772
83aca1cb
PE
97732011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9774
9775 * fileio.c (Finsert_file_contents): Undo previous change; see
9776 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9777
5b76caa4
PE
97782011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9779
9780 Rename locals to avoid shadowing.
9781 * fileio.c (Finsert_file_contents):
9782 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9783 * process.c (wait_reading_process_output):
9784 Rename inner 'proc' to 'p' to avoid shadowing.
9785 Indent for consistency with usual Emacs style.
9786
8c535114
EZ
97872011-11-25 Eli Zaretskii <eliz@gnu.org>
9788
9789 * xdisp.c (redisplay_window): If cursor row is not fully visible
9790 after recentering, and scroll-conservatively is set to a large
9791 number, scroll window by a few more lines to make the cursor fully
9792 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
9793 (start_display): Don't move to the next line if the display should
9794 start at a newline that is part of a display vector or an overlay
9795 string. (Bug#10119)
8c535114 9796
fa4fdb5c
JL
97972011-11-24 Juri Linkov <juri@jurta.org>
9798
9799 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9800 after the `MagickPingImage' call. (Bug#10112)
9801
90ec88df
CY
98022011-11-23 Chong Yidong <cyd@gnu.org>
9803
9804 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9805
56e2e794
MR
98062011-11-23 Martin Rudalics <rudalics@gmx.at>
9807
9808 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9809 making another buffer current. (Bug#10114)
9810
b6e64c41
GM
98112011-11-23 Glenn Morris <rgm@gnu.org>
9812
9813 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9814
6b21de18
CY
98152011-11-23 Chong Yidong <cyd@gnu.org>
9816
9817 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9818 using it (Bug#5984).
9819
b12cd789
EZ
98202011-11-22 Eli Zaretskii <eliz@gnu.org>
9821
9822 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9823 and header-lines, as they don't have one computed for them.
9824 (Bug#10098)
9825
9826 * .gdbinit (prow): Make displayed values more self-explaining.
9827 Add row's hash code.
9828
261b6fd4
LMI
98292011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9830
9831 * process.c (wait_reading_process_output): Fix asynchrounous
9832 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 9833 (wait_reading_process_output): Add comment and URL.
261b6fd4 9834
e7cfd277
JD
98352011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9836
9837 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9838
a9b9b7f5
CY
98392011-11-21 Chong Yidong <cyd@gnu.org>
9840
9841 * window.c (Fnext_window, Fprevious_window): Doc fix.
9842
b0d15b4f
SM
98432011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9844
9845 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9846
fe7a3057
JB
98472011-11-20 Juanma Barranquero <lekktu@gmail.com>
9848
9849 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9850
d2999b1a
MR
98512011-11-20 Martin Rudalics <rudalics@gmx.at>
9852
9853 * window.c (Fset_window_combination_limit): Rename argument
9854 STATUS to LIMIT.
9855 (Vwindow_combination_limit): Remove "status" from doc-string.
9856
d5ff9cd0
AS
98572011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9858
9859 * m/ibms390.h: Remove.
9860 * m/ibms390x.h: Don't include "ibms390.h".
9861
a5bb9bd3
SM
98622011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9863
9864 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9865 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9866
cd1181db
JB
98672011-11-20 Juanma Barranquero <lekktu@gmail.com>
9868
9869 * casetab.c (Fset_case_table):
9870 * charset.c (Fcharset_after): Fix typos.
9871
615a3b8d 98722011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 9873
17e845af
PE
9874 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9875 Otherwise, valgrind does not work on some platforms.
9876 Problem reported by Andreas Schwab in
6a0bf43d
PE
9877 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9878 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9879 is set, removing the need for VIRT_ADDRESS_VARIES.
9880 (PURE_P): Use a more-efficient implementation that needs just one
9881 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9882 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9883 to 4 (xorl, subq, cmpq, setbe).
9884 * alloc.c (pure): Always extern now, since that's the
9885 VIRT_ADDR_VARIES behavior.
9886 (PURE_POINTER_P): Use a single comparison, not two, for
9887 consistency with the new puresize.h.
9888 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9889 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9890 Remove VIRT_ADDR_VARIES no longer needed.
9891
f8fe6f96
EZ
98922011-11-19 Eli Zaretskii <eliz@gnu.org>
9893
9894 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9895 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9896 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9897 behave as if the cursor position were at the window margin.
9898
9899 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9900 and the cursor position is out of bounds, behave as if the cursor
9901 position were at the window margin. (Bug#10075)
9902
df05a53c
CY
99032011-11-18 Chong Yidong <cyd@gnu.org>
9904
9905 * window.c (Fwindow_combination_limit): Make first argument
9906 non-optional, since it is meaningless for live windows like the
9907 selected window.
61ccba97 9908
2071918e
DA
99092011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9910
9911 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9912
b50a28de
SM
99132011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9914
9915 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9916 (graft_intervals_into_buffer): Simplify.
9917
015137db
EZ
99182011-11-18 Eli Zaretskii <eliz@gnu.org>
9919
9920 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9921 hash values of the two rows.
9922 (copy_row_except_pointers): Preserve the used[] arrays and the
9923 hash values of the two rows. (Bug#10035)
68c95424 9924 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
9925
9926 * xdisp.c (row_hash): New function, body extracted from
9927 compute_line_metrics.
9928 (compute_line_metrics): Call row_hash, instead of computing the
9929 hash code inline.
9930
9931 * dispnew.c (verify_row_hash): Call row_hash for computing the
9932 hash code of a row, instead of duplicating code from xdisp.c.
9933
9934 * dispextern.h (row_hash): Add prototype.
9935
a2addb04
TH
99362011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9937
9938 * frame.c (delete_frame): Don't delete the terminal when the last
9939 X frame is closed if emacs is built with GTK toolkit.
9940
df85d315
JB
99412011-11-17 Juanma Barranquero <lekktu@gmail.com>
9942
9943 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9944
a0c2d0ae
MR
99452011-11-17 Martin Rudalics <rudalics@gmx.at>
9946
9947 * window.c (Vwindow_splits): Rename to
9948 Vwindow_combination_resize. Suggested by Juri Linkov.
9949 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9950 of Vwindow_splits.
9951
58179cce
JB
99522011-11-16 Juanma Barranquero <lekktu@gmail.com>
9953
7877f373
JB
9954 * nsfns.m (Fns_font_name):
9955 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 9956
b6f67890
MR
99572011-11-16 Martin Rudalics <rudalics@gmx.at>
9958
9959 * window.h (window): Rename slot "nest" to "combination_limit".
9960 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9961 (Fset_window_nest): Rename to Fset_window_combination_limit.
9962 (Vwindow_nest): Rename to Vwindow_combination_limit.
9963 (recombine_windows, make_parent_window, make_window)
9964 (Fsplit_window_internal, saved_window)
9965 (Fset_window_configuration, save_window_save): Rename all
9966 occurrences of window_nest to window_combination_limit.
9967
c7015153
JB
99682011-11-15 Juanma Barranquero <lekktu@gmail.com>
9969
9970 * image.c (imagemagick_load_image): Fix typo.
9971
322ad6ec
EZ
99722011-11-14 Eli Zaretskii <eliz@gnu.org>
9973
9974 * xdisp.c (display_line): Move the call to
9975 highlight_trailing_whitespace before the call to
9976 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
9977 faces of all the glyphs to compute ROW's hash value.
9978 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 9979
f067b8ec
JB
99802011-11-14 Juanma Barranquero <lekktu@gmail.com>
9981
9982 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9983 just return (bug#10044).
9984
1e5b2111
EZ
99852011-11-12 Eli Zaretskii <eliz@gnu.org>
9986
7ef3cbd5
EZ
9987 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9988 with user-defined heap size. Bump the default size of the temacs
9989 heap to 27MB, to avoid memory warning when running temacs.
9990 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9991
1e5b2111
EZ
9992 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9993 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
9994 (verify_row_hash) [XASSERTS]: New function.
9995 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9996 that the hash value of glyph rows is correct.
1e5b2111 9997
89d61221
MR
99982011-11-12 Martin Rudalics <rudalics@gmx.at>
9999
10000 * window.h (window): Remove splits slot.
10001 * window.c (Fwindow_splits, Fset_window_splits): Remove.
10002 (Fdelete_other_windows_internal, make_parent_window)
10003 (make_window, Fsplit_window_internal, Fdelete_window_internal)
10004 (Fset_window_configuration, save_window_save): Don't deal with
10005 split status of windows.
10006 (saved_window): Remove splits slot.
10007 (Vwindow_splits): Rewrite doc-string.
10008
97f18cc8
JD
100092011-11-11 Jan Djärv <jan.h.d@swipnet.se>
10010
10011 * xfns.c (unwind_create_frame):
10012 * nsfns.m (unwind_create_frame):
10013 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
10014 Vframe_list (Bug#9999).
10015
22a648b4
DA
100162011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
10017
0b381c7e 10018 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 10019
659afede
KH
100202011-11-11 Kenichi Handa <handa@m17n.org>
10021
10022 * callproc.c (Fcall_process): Set the member dst_multibyte of
10023 process_coding.
10024
9ac0394b
KH
100252011-11-11 Johan Bockgård <bojohan@gnu.org>
10026
10027 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10028 avoid a crash (bug#9496).
10029
2fbdc249
CY
100302011-11-09 Chong Yidong <cyd@gnu.org>
10031
10032 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10033 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10034
ac6b1f81
PE
100352011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10036
10037 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10038
09db192c
PE
100392011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10040
10041 Avoid some portability problems by eschewing 'extern inline' functions.
10042 The trivial performance wins aren't worth the portability hassles; see
10043 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10044 et seq.
10045 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10046 (window_box_width, window_box_left, window_box_left_offset)
10047 (window_box_right, window_box_right_offset): Undo previous change,
10048 by removing the "extern"s.
10049 * intervals.c (adjust_intervals_for_insertion)
10050 (adjust_intervals_for_deletion): Undo previous change,
10051 making these static again.
10052 (offset_intervals, temp_set_point_both, temp_set_point)
10053 (copy_intervals_to_string): No longer inline.
10054 * xdisp.c (window_text_bottom_y, window_box_width)
10055 (window_box_height, window_box_left_offset)
10056 (window_box_right_offset, window_box_left, window_box_right)
10057 (window_box): No longer inline.
10058
105216ed
CY
100592011-11-08 Chong Yidong <cyd@gnu.org>
10060
10061 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
10062 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
10063 Signal an error if not a live window.
105216ed
CY
10064 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
10065 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
10066
ae9e237f
JB
100672011-11-07 Juanma Barranquero <lekktu@gmail.com>
10068
10069 * lisp.h (syms_of_abbrev): Remove declaration.
10070 Reported by CHENG Gao <chenggao@royau.me>.
10071
c7aa8333
EZ
100722011-11-07 Eli Zaretskii <eliz@gnu.org>
10073
10074 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10075 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
10076 of temacs in GUI mode.
10077
be7f5545
MR
100782011-11-07 Martin Rudalics <rudalics@gmx.at>
10079
10080 * window.h: Declare delete_all_child_windows instead of
10081 delete_all_subwindows.
10082 * window.c (Fwindow_nest, Fset_window_nest)
10083 (Fset_window_new_total, Fset_window_new_normal)
10084 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10085 (delete_all_subwindows): Rename to delete_all_child_windows.
10086 (Fdelete_other_windows_internal, Fset_window_configuration):
10087 Call delete_all_child_windows instead of delete_all_subwindows.
10088 * frame.c (delete_frame): Call delete_all_child_windows instead
10089 of delete_all_subwindows.
10090
ca78dc43
PE
100912011-11-07 Paul Eggert <eggert@cs.ucla.edu>
10092
10093 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10094 This is also needed for porting to any host where GC_MARK_STACK is
10095 not GC_MAKE_GCPROS_NOOPS.
10096 (which_symbols): Use it.
10097
a0241d01
KH
100982011-11-07 Kenichi Handa <handa@m17n.org>
10099
10100 * coding.c (coding_set_destination): Check coding->src_pos only
10101 when coding->src_object is a buffer (bug#9910).
10102
10103 * process.c (send_process): Set the member src_multibyte of coding
10104 to 0 (bug#9911) when sending a unibyte text.
10105
10106 * callproc.c (Fcall_process): Set the member src_multibyte of
10107 process_coding to 0 (bug#9912).
10108
a64bfdfa 101092011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
10110
10111 * xmenu.c (cleanup_widget_value_tree): New function.
10112 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10113 calling free_menubar_widget_value_tree directly (Bug#9830).
10114
cb41b32a
PE
101152011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10116
10117 Fix some portability problems with 'inline'.
10118 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10119 (window_box_width, window_box_left, window_box_left_offset)
10120 (window_box_right, window_box_right_offset): Declare extern.
10121 Otherwise, these inline functions do not conform to C99 and
10122 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
10123 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10124 * intervals.c (adjust_intervals_for_insertion)
10125 (adjust_intervals_for_deletion): Now extern, because otherwise the
10126 extern inline functions 'offset_intervals' couldn't refer to it.
10127 (static_offset_intervals): Remove.
10128 (offset_intervals): Rewrite using the old contents of
10129 static_offset_intervals. The old version didn't conform to C99
10130 because an extern inline function contained a reference to an
10131 identifier with static linkage.
10132
b7041366
AS
101332011-11-06 Andreas Schwab <schwab@linux-m68k.org>
10134
10135 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10136 GC.
10137
88a37c4d
EZ
101382011-11-06 Eli Zaretskii <eliz@gnu.org>
10139
10140 * xdisp.c (init_iterator, reseat_to_string): Don't set the
10141 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
10142 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10143 return Qleft_to_right.
10144
49745b39
CY
101452011-11-06 Chong Yidong <cyd@gnu.org>
10146
10147 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
10148 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
10149 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
10150 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
10151 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
10152 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
10153 (Fwindow_vscroll): Doc fix.
10154 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
10155 argument, since it makes no sense to pass a live window and for
10156 consistency with window-child.
10157
1f05cd82
CS
101582011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
10159
10160 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
10161 support MSVC.
10162
22610910
JR
101632011-11-05 Jason Rumney <jasonr@gnu.org>
10164
10165 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
10166 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
10167 fonts (Bug#6029).
10168 (add_font_entity_to_list): Fix logic errors in mixed boolean and
10169 bitwise arithmetic preventing use of unicode-sip and non-truetype
10170 opentype fonts.
10171
a06776b2
EZ
101722011-11-05 Eli Zaretskii <eliz@gnu.org>
10173
3ad924ba
EZ
10174 * s/ms-w32.h (fstat, stat, utime): Move redirections to
10175 "emacs"-only part.
10176
a06776b2
EZ
10177 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
10178 initialization code to keep similarity to xfns.c after changes
10179 from 2011-11-05.
10180
c9e7db78
JD
101812011-11-05 Jan Djärv <jan.h.d@swipnet.se>
10182
a97f8f3f
JD
10183 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
10184 (unwind_create_frame): New function (Bug#9943).
10185 (Fx_create_frame): Restructure code to be more similar to the one in
10186 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
10187 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
10188 Move terminal->reference_count++ just before making the frame official
10189 (Bug#9943).
10190
10191 * nsterm.m (x_free_frame_resources): New function.
10192 (x_destroy_window): Move code to x_free_frame_resources.
10193
c9e7db78 10194 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
10195 (Fx_create_frame, x_create_tip_frame):
10196 Move terminal->reference_count++ just before making the frame
75f1671a 10197 official. Move initialization of image_cache_refcount and
c9e7db78
JD
10198 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
10199
a6fc3b5c
EZ
102002011-11-05 Eli Zaretskii <eliz@gnu.org>
10201
10202 Support MSVC build with newer versions of Visual Studio.
10203 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
10204 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
10205 nt/gmake.defs.
10206
10207 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10208 which are not supported by MSVC.
10209 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10210 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10211 bitfields.
10212 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10213 types in bitfields.
10214 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10215
10216 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10217
58179cce 102182011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
10219
10220 Support MSVC build with newer versions of Visual Studio.
10221 * w32.c: Don't include w32api.h for MSVC.
10222 (init_environment) [_MSC_VER]: Call sys_access, not _access.
10223
10224 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10225 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10226 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10227 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10228 e_* cousins.
10229 (alloca) [_MSC_VER]: Define to _alloca.
10230
10231 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10232
10233 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10234
a58c13ed
EZ
102352011-11-04 Eli Zaretskii <eliz@gnu.org>
10236
10237 * xdisp.c (note_mouse_highlight): If either of
10238 previous/next-single-property-change returns nil, treat that as
10239 the beginning or the end of the buffer. (Bug#9955)
10240
fe0b6370
JD
102412011-11-04 Jan Djärv <jan.h.d@swipnet.se>
10242
a58c13ed 10243 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
10244 label is not null (Bug#9951).
10245 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10246 may be NULL.
10247
89bd5ee1
EZ
102482011-11-04 Eli Zaretskii <eliz@gnu.org>
10249
10250 * window.c (Fwindow_body_size): Mention in the doc string that the
10251 return value is in frame's canonical units. (Bug#9949)
10252
84c3edb9
EZ
102532011-11-03 Eli Zaretskii <eliz@gnu.org>
10254
4e2fb5c7
EZ
10255 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
10256
84c3edb9 10257 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 10258 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 10259 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 10260
bc17a887
EZ
102612011-11-01 Eli Zaretskii <eliz@gnu.org>
10262
10263 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10264 Don't stop backward scan on the continuation glyph, even though
10265 its CHARPOS is positive.
6d5eb5b0
SM
10266 (mouse_face_from_buffer_pos, note_mouse_highlight):
10267 Rename cover_string to disp_string.
bc17a887 10268
4ee88440
MR
102692011-11-01 Martin Rudalics <rudalics@gmx.at>
10270
10271 * window.c (temp_output_buffer_show): Don't use
10272 Vtemp_buffer_show_specifiers.
10273 (Vtemp_buffer_show_specifiers): Remove unused variable.
10274
c2ff3c02
EZ
102752011-10-30 Eli Zaretskii <eliz@gnu.org>
10276
10277 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10278 past the beginning of the current glyph matrix.
10279
58179cce 102802011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
10281
10282 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10283 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10284 HAVE_GTK3 (Bug#9869).
b77a6a7f 10285
3b574623
JD
10286 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10287 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10288
b77a6a7f
JD
10289 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10290
10291 * xterm.c: Declare x_handle_net_wm_state to return int.
10292 (handle_one_xevent): Check if we are iconified but don't have
10293 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
10294 (get_current_wm_state): Return non-zero if not hidden,
10295 check for _NET_WM_STATE_HIDDEN (Bug#9893).
10296 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
10297 (x_handle_net_wm_state): Return what get_current_wm_state returns.
10298 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
10299
196e41e4
PE
103002011-10-29 Paul Eggert <eggert@cs.ucla.edu>
10301
10302 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
10303 so that this new function doesn't get optimized away by a
10304 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
10305
021f2e1a
AS
103062011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10307
10308 * frame.h (MOUSE_HL_INFO): Remove excess parens.
10309
8b058d44
EZ
103102011-10-29 Eli Zaretskii <eliz@gnu.org>
10311
10312 Fix the `xbytecode' command.
10313 * .gdbinit (xprintbytestr): New command.
b50a28de 10314 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
10315 (xbytecode): Print the byte-code string as well.
10316
4452fb80
EZ
103172011-10-29 Kim Storm <storm@cua.dk>
10318
8b058d44
EZ
10319 * alloc.c (which_symbols): New function.
10320
21b72067
AS
103212011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10322
10323 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
10324 line. (Bug#9903)
10325
83ed7b5c
GM
103262011-10-29 Glenn Morris <rgm@gnu.org>
10327
10328 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10329 Not clear what it was for, and it causes various bugs. (Bug#9839)
10330
5a7a728b
EZ
103312011-10-28 Eli Zaretskii <eliz@gnu.org>
10332
10333 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10334 possible random value that matches one of those tested as
10335 condition to clear the mouse face.
10336
d3d0842f
CY
103372011-10-28 Chong Yidong <cyd@gnu.org>
10338
10339 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10340
31b39d13
DN
103412011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
10342
10343 * window.c (make_window): Initialize phys_cursor_on_p.
10344
9aba6043
SM
103452011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
10346
10347 * lisp.h (struct Lisp_Symbol): Update comments.
10348
c20992f4
JB
103492011-10-28 Juanma Barranquero <lekktu@gmail.com>
10350
10351 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10352
db4f02f2
EZ
103532011-10-28 Eli Zaretskii <eliz@gnu.org>
10354
10355 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
10356 <oslsachem@gmail.com> for helping to debug this.
10357
10358 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10359 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10360 (g_b_init_get_glyph_outline_w): New static variables.
10361 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10362 (GetGlyphOutlineW_Proc): New typedefs.
10363 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
10364 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10365 New functions.
10366 (w32font_open_internal, compute_metrics):
10367 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
10368 instead of calling the "wide" APIs directly.
10369
10370 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10371
10372 * w32.h (syms_of_w32font): Add prototype.
10373
87e68db4
JB
103742011-10-27 Juanma Barranquero <lekktu@gmail.com>
10375
10376 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10377 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10378 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10379 (Fmove_to_window_line): Doc fix.
10380
435c1d67
CY
103812011-10-27 Chong Yidong <cyd@gnu.org>
10382
10383 * process.c (make_process): Set gnutls_state to NULL.
10384
10385 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10386 non-NULL, regardless of GNUTLS_INITSTAGE.
10387 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10388 an error. Set process slots as soon as we allocate them.
10389
10390 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10391
9c6c6f49
CY
103922011-10-27 Chong Yidong <cyd@gnu.org>
10393
9aba6043
SM
10394 * gnutls.c (emacs_gnutls_deinit): New function.
10395 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
10396 (Fgnutls_deinit, Fgnutls_boot): Use it.
10397
10398 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10399 (deactivate_process): Call emacs_gnutls_deinit.
10400
657d08d3
JB
104012011-10-27 Juanma Barranquero <lekktu@gmail.com>
10402
10403 * image.c (x_create_x_image_and_pixmap):
10404 * w32.c (sys_rename, w32_delayed_load):
10405 * w32font.c (fill_in_logfont):
10406 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10407
5430d399
JB
104082011-10-26 Juanma Barranquero <lekktu@gmail.com>
10409
10410 * w32fns.c (w32_default_color_map): New function,
10411 extracted from Fw32_default_color_map.
a7ef684b 10412 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 10413
fe0055fa
PE
104142011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10415
10416 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10417
e6346438
SM
104182011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10419
10420 * keyboard.c (test_undefined): New function (bug#9751).
10421 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10422
e112cc37
ET
104232011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10424
10425 * sysdep.c (init_sys_modes): Fix the check for the controlling
10426 terminal (Bug#6649).
10427
7b5d6677
EZ
104282011-10-20 Eli Zaretskii <eliz@gnu.org>
10429
10430 * dispextern.h (struct bidi_it): New member next_en_type.
10431
10432 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10433 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10434 current character, check also for next_en_type being WEAK_EN.
10435 (bidi_resolve_weak): Don't enter the expensive loop if the current
10436 position is before next_en_pos. Record the bidi type of the first
10437 non-ET, non-BN character we find, in addition to its position.
10438 (bidi_level_of_next_char): Invalidate next_en_type when
10439 next_en_pos is over-stepped.
10440
7da0b018
PE
104412011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10442
10443 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10444 * editfns.c: Rewrite current-time-zone so that it invokes
10445 the equivalent of (format-time-string "%Z") to get the time zone name.
10446 This fixes a bug when the time zone name contains characters that
10447 need converting from the system time locale to Emacs internal format.
10448 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10449 that patch fixed format-time-string to do the conversion, but
10450 I forgot to fix current-time-zone.
10451 (format_time_string): New function, containing most of
10452 what Fformat_time_string used to contain.
10453 (Fformat_time_string): Rewrite in terms of format_time_string.
10454 This doesn't change this function's behavior.
10455 (current-time-zone): Rewrite to use format_time_string.
10456 This fixes the bug reported by Michael Schierl in
10457 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10458 Jason Rumney's 2007-06-07 change worked around this bug, but
10459 didn't fix it.
10460 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10461
8547b010
EZ
104622011-10-19 Eli Zaretskii <eliz@gnu.org>
10463
10464 * xdisp.c (start_display): If the character at POS is displayed
10465 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
10466 (try_window_reusing_current_matrix): If a line ends in a display
10467 vector or the next line starts in a display vector, continue
10468 redrawing the window even though the character position of
10469 start_row was reached.
8547b010
EZ
10470 (Bug#9771, part 2)
10471
4e948d15
CY
104722011-10-18 Chong Yidong <cyd@gnu.org>
10473
10474 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10475 with nobreak-char-display too.
10476
4787455f
EZ
104772011-10-18 Eli Zaretskii <eliz@gnu.org>
10478
10479 Fix part 3 of bug#9771.
10480 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10481 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10482 non-neutral characters if the current character is a paragraph
10483 separator (a.k.a. Newline). This avoids running the same
10484 expensive loop twice, once when we consume the preceding newline
10485 and the other time when the line actually needs to be displayed.
10486 Avoid the loop when we see neutrals on the base embedding level
10487 following a character whose directionality is the same as the
10488 paragraph's. This avoids running the expensive loop when a line
10489 ends in a long sequence of neutrals, like control characters.
10490 Add assertion against STRONG_AL type. Slightly rearrange code
10491 that determines the type of a neutral given the first non-neutral
10492 that follows it.
10493 (bidi_level_of_next_char): Set next_en_pos to zero when
10494 invalidating its info.
10495
2c91f553
EZ
104962011-10-17 Eli Zaretskii <eliz@gnu.org>
10497
10498 * xdisp.c (push_display_prop): Determine whether to record string
10499 or buffer position by IT->string, not by IT->method. Allow
10500 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
10501 (move_it_vertically_backward): Don't look for character position
10502 immediately after the newline when in a continuation line.
10503 (Bug#9771, part 1)
2c91f553 10504
c7b08b0d
MR
105052011-10-15 Martin Rudalics <rudalics@gmx.at>
10506
10507 * window.c (coordinates_in_window): Rewrite and delabelize
10508 vertical border check. (Bug#5357) (Bug#9618)
10509
6b02f655
SM
105102011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10511
10512 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10513 errors in XSetWindowBorder (bug#9310).
10514
81d40c92
DA
105152011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10516
10517 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10518 avoid crash when xmalloc overrun checking is enabled.
10519
d4172c3b
EZ
105202011-10-13 Eli Zaretskii <eliz@gnu.org>
10521
10522 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10523 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10524 cursor motion with <left> and <right> arrow keys.
10525
10526 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10527 some callers set that themselves.
10528
b00eea75
EZ
105292011-10-12 Eli Zaretskii <eliz@gnu.org>
10530
10531 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10532 display string and the previous row comes from the same string and
10533 is empty. (Bug#9739) (Bug#9738)
10534
8fe012c4
SM
105352011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10536
10537 * doc.c (get_doc_string): Encode file name (bug#9735).
10538
0074aef2
EZ
105392011-10-12 Eli Zaretskii <eliz@gnu.org>
10540
79beb178
EZ
10541 * bidi.c (bidi_level_of_next_char):
10542 * xdisp.c (get_visually_first_element): Remove old incorrect
10543 comments regarding the Unicode Line Separator character.
10544
0074aef2
EZ
10545 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10546
6e4b3fbe
DA
105472011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10548
10549 * alloc.c (Fgc_status): Do not access beyond zombies array
10550 boundary if nzombies > MAX_ZOMBIES.
10551 * alloc.c (dump_zombies): Add missing format specifier.
10552
0324f3af
PE
105532011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10554
b5525cac
PE
10555 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10556 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10557
0324f3af
PE
10558 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10559 Some packages use them to denote characters with modifiers.
10560
e9b5f888
AS
105612011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10562
10563 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10564 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10565 matching a pp-number. Rename parameter var to var1.
10566
127827c0
SM
105672011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10568
10569 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10570
c8fd3bd0
GM
105712011-10-08 Glenn Morris <rgm@gnu.org>
10572
10573 * callint.c (Fcall_interactively): Give a more explicit error for the
10574 'c' case with a non-character input. (Bug#8479)
10575
352ec8ff
EZ
105762011-10-08 Eli Zaretskii <eliz@gnu.org>
10577
03669ccb
EZ
10578 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10579 lines.
7061c986
EZ
10580 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10581 lines that are hscrolled on the left.
03669ccb 10582
352ec8ff
EZ
10583 * dispnew.c (buffer_posn_from_coords): Account for a possible
10584 presence of header-line. (Bug#4426)
10585
a66cfb1c
SM
105862011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10587
6b02f655
SM
10588 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10589 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 10590
7c5ee88e
PE
105912011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10592
10593 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10594 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10595 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10596 this makes Emacs dump core during garbage collection on rare
10597 occasions. sizeof is obviously inferior to offsetof here, so
10598 stick with offsetof.
10599 (GC_POINTER_ALIGNMENT): New macro.
10600 (mark_memory): Omit 3rd (offset) arg; caller changed.
10601 Don't assume EMACS_INT alignment is the same as pointer alignment.
10602
df1bbe5b
SM
106032011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10604
10605 * keyboard.c (read_key_sequence_remapped): New var.
10606 (read_key_sequence): Compute remapping in the right buffer.
10607 (command_loop_1): Use read_key_sequence's remapping directly.
10608
51553db6
SM
106092011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10610
32c1fffd
SM
10611 * dired.c (file_name_completion): Don't expand file name.
10612 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10613 before checking file name handler.
10614
51553db6
SM
10615 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10616 they've been requested explicitly (bug#9591).
10617
b6bd1599 106182011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
10619
10620 * keymap.c (Fsingle_key_description): Use make_specified_string
10621 instead of build_string to build string from push_key_description.
10622 (Bug#5193)
10623
f701dc2a
PE
106242011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10625
4222c55d
PE
10626 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10627 This fixes a Y2038 bug on 64-bit hosts.
10628 * buffer.c (reset_buffer):
10629 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10630 (Fclear_buffer_auto_save_failure):
10631 Use 0, not -1, to represent an unset failure time, since time_t
10632 might not be signed.
10633
f701dc2a
PE
10634 Remove dependency on glibc malloc internals.
10635 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10636 Move back here from lisp.h, but with their new implementations.
10637 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10638 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10639 * charset.c (charset_table_init): New static var.
10640 (syms_of_charset): Use it instead of xmalloc. This removes a
10641 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10642 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10643 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10644 Move back to alloc.c.
10645 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10646 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10647
9ceebf39
JD
106482011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10649
10650 * nsterm.m (windowDidResize): Call x_set_window_size only when
10651 ns_in_resize is true. Otherwise set pixelwidth/height and
10652 call change_frame_size (Bug#9628).
10653
cb993c58
PE
106542011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10655
3930c88b
PE
10656 Port --enable-checking=all to Fedora 14 x86-64.
10657 * charset.c (syms_of_charset): Also account for glibc malloc's
10658 internal overhead when calculating the initial malloc maximum.
10659
cb993c58
PE
10660 Port --enable-checking=all to Fedora 14 x86.
10661 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10662 Move to lisp.h.
10663 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10664 (overrun_check_realloc, overrun_check_free):
10665 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10666 That way, xmalloc returns a properly-aligned pointer even if
10667 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10668 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10669 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10670 into account when calculating the initial malloc maximum.
10671 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10672 Move here from alloc.c, so that charset.c can use it too.
10673 Properly align; the old code wasn't right for common 32-bit hosts
10674 when configured with --enable-checking=all.
10675 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10676 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10677
31bed486
EZ
106782011-09-29 Eli Zaretskii <eliz@gnu.org>
10679
04c70788 10680 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
10681 use EDOM.
10682
fbcaa2f3
EZ
106832011-09-28 Eli Zaretskii <eliz@gnu.org>
10684
10685 * xdisp.c (compute_display_string_end): If there's no display
10686 string at CHARPOS, return -1.
10687
10688 * bidi.c (bidi_fetch_char): When compute_display_string_end
10689 returns a negative value, treat the character as a normal
10690 character not covered by a display string. (Bug#9624)
10691
a239d4e9
JB
106922011-09-28 Juanma Barranquero <lekktu@gmail.com>
10693
10694 * lread.c (Fread_from_string): Fix typo in docstring.
10695
88652fd5
EZ
106962011-09-27 Eli Zaretskii <eliz@gnu.org>
10697
10698 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10699 newline, reseat the iterator instead of bidi-iterating there one
10700 character at a time. (Bug#9610)
32c1fffd
SM
10701 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10702 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 10703
ed497dd4
AS
107042011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10705
10706 * lread.c (readevalloop): Use correct code for NBSP.
10707 (read1): Likewise. (Bug#9608)
10708
b2bf61aa
MA
107092011-09-25 Michael Albinus <michael.albinus@gmx.de>
10710
10711 * dbusbind.c (Fdbus_register_signal): When service is not
10712 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10713
32bbb17c
GM
107142011-09-25 Glenn Morris <rgm@gnu.org>
10715
10716 * buffer.c (truncate-lines): Doc fix.
10717
94e0933e
CY
107182011-09-24 Chong Yidong <cyd@stupidchicken.com>
10719
10720 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10721 (Fset_window_next_buffers): Doc fix.
10722
cddde921
GM
107232011-09-24 Glenn Morris <rgm@gnu.org>
10724
10725 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10726
1260aef1
PE
107272011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10728
25b4bfa0
PE
10729 Fix minor problems found by static checking.
10730 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
10731 * indent.c (Fvertical_motion): Fix == vs = typo.
10732
e3cbd34b
EZ
107332011-09-24 Eli Zaretskii <eliz@gnu.org>
10734
a66cfb1c
SM
10735 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10736 Default value is now t. Doc fix.
6bf7006f 10737
e3cbd34b 10738 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 10739 logic when moving up, not only when moving down. Fix the
e3cbd34b 10740 confusing name and values of the it_overshoot_expected variable;
32c1fffd 10741 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
10742
10743 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10744 CHARPOS is covered by a display string which includes newlines.
10745 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10746 is covered by a display string with embedded newlines.
10747
a3de0cbd
MA
107482011-09-24 Michael Albinus <michael.albinus@gmx.de>
10749
10750 * dbusbind.c (Fdbus_register_signal): Add match rule to
10751 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
10752 (Fdbus_register_method, Vdbus_registered_objects_table):
10753 Fix docstring.
a3de0cbd 10754
b260039d
JM
107552011-09-24 Jim Meyering <meyering@redhat.com>
10756
32c1fffd 10757 do not ignore write error for any output size
b260039d
JM
10758 The previous change was incomplete.
10759 While it makes emacs --batch detect the vast majority of stdout
10760 write failures, errors were still ignored whenever the output size is
10761 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10762 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10763 && echo FAIL: ignored write error
10764 FAIL: ignored write error
10765 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10766 && echo FAIL: ignored write error
10767 FAIL: ignored write error
10768 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10769
8eca8a7c
AS
107702011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10771
10772 * emacs.c (Fkill_emacs): In noninteractive mode exit
10773 non-successfully if a write error occurred on stdout. (Bug#9574)
10774
3341db62
EZ
107752011-09-21 Eli Zaretskii <eliz@gnu.org>
10776
10777 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10778 the xassert test.
10779
10780 * dispextern.h (struct it): Update the comment documenting what
10781 can it->OBJECT be.
10782
8c203dbf
EZ
107832011-09-20 Eli Zaretskii <eliz@gnu.org>
10784
10785 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10786 a display string, extend search for cursor position to end of row.
10787 (find_row_edges): If the row ends in a newline from a display
10788 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10789 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
10790 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10791 non-empty line. Fixes confusing cursor motion with arrow keys at
10792 the beginning of a line that starts with whitespace.
8c203dbf 10793
a4824228
LMI
107942011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10795
10796 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10797 (bug#9493).
10798
33ed493b
CY
107992011-09-18 Chong Yidong <cyd@stupidchicken.com>
10800
10801 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10802 boolean (Bug#9154).
10803
56cd55c8
EZ
108042011-09-18 Eli Zaretskii <eliz@gnu.org>
10805
10806 * xdisp.c (display_line): Record maximum and minimum buffer
10807 positions even if no glyphs were produced (e.g., by a zero-width
10808 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10809 buffer positions that will be removed from the glyph row because
10810 they don't fit.
c02dcedf
EZ
10811 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10812 column is beyond frame width: don't subtract 1 "pixel" when
10813 computing width of the stretch.
3e62b7e0
EZ
10814 (reseat_at_next_visible_line_start): Undo the change made on
10815 2011-09-17 that saved paragraph information and restored it after
10816 the call to `reseat'. (Bug#9545)
56cd55c8 10817
5ed99d36 108182011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
10819
10820 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10821 and turn window cursor on if cleared (Bug#9415).
10822
5ed99d36 108232011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
10824
10825 * search.c (boyer_moore): Take unibyte characters from pattern
10826 literally. (Bug#9458)
10827
9bade7b2
EZ
108282011-09-18 Eli Zaretskii <eliz@gnu.org>
10829
10830 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10831
e5e9d610
PE
108322011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10833
87e4427a
PE
10834 Fix minor problem found by static checking.
10835 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10836 initialized, to pacify gcc -Wuninitialized.
10837
e5e9d610
PE
10838 * fileio.c: Report proper errno when syscall falls.
10839 (Finsert_file_contents): Save and restore errno,
10840 so that report_file_error outputs the correct diagnostic.
10841 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10842
a1674f0b
EZ
108432011-09-18 Eli Zaretskii <eliz@gnu.org>
10844
10845 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10846
fbfb6dd4
EZ
108472011-09-17 Eli Zaretskii <eliz@gnu.org>
10848
10849 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10850 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10851
bb187662
EZ
108522011-09-17 Eli Zaretskii <eliz@gnu.org>
10853
1137e8b8 10854 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 10855 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
10856
10857 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10858 (bidi_find_paragraph_start): Search back for paragraph beginning
10859 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10860 (bidi_move_to_visually_next): Only trigger paragraph-related
10861 computations when the last character is a newline or at EOB, not
10862 just any NEUTRAL_B. (Bug#9470)
10863
bb187662
EZ
10864 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10865 truncated lines if point is covered by a display string. (Bug#9524)
10866
2e621251
PE
108672011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10868
10869 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10870 (cons_to_x_long): New function.
10871 (lisp_data_to_selection_data): Use it. Correct the test for
10872 short-versus-long data; it was negated. Break out of vector
10873 loop, for efficiency, when a long datum is discovered.
10874
91a15bc6
SM
108752011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10876
10877 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10878
b41c3a35
EZ
108792011-09-16 Eli Zaretskii <eliz@gnu.org>
10880
10881 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10882 GCC PR/17406) by declaring this function with external scope.
10883
7812ba2d
PE
108842011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10885
10886 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10887 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10888
cf7edc2a
AS
108892011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10890
10891 * editfns.c (Fformat): Correctly handle text properties on "%%".
10892
bd01620e
EZ
108932011-09-15 Eli Zaretskii <eliz@gnu.org>
10894
10895 * xterm.c (x_draw_composite_glyph_string_foreground):
10896 * w32term.c (x_draw_composite_glyph_string_foreground):
10897 * term.c (encode_terminal_code):
10898 * composite.c (composition_update_it, get_composition_id):
10899 * xdisp.c (get_next_display_element)
10900 (fill_composite_glyph_string): Add comments about special meaning
10901 of TAB characters in a composition.
10902
a02719a3
PE
109032011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10904
10905 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
10906 This occurs when processing a multibyte format.
10907 Problem reported by Wolfgang Jenker.
a02719a3 10908
72589a3c
JB
109092011-09-15 Johan Bockgård <bojohan@gnu.org>
10910
10911 * xdisp.c (try_cursor_movement): Only check for exact match if
10912 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10913
1c14176c
PE
109142011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10915
10916 Remove unused external symbols.
10917 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10918 * xdisp.c (calc_pixel_width_or_height): Now static.
10919 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10920 * indent.c (check_display_width):
10921 * w32term.c: Fix comment to match code.
10922 * xterm.c, xterm.h (x_catching_errors): Remove.
10923
d2eea5b5
PE
109242011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10925
10926 * xselect.c: Use signed conversions more consistently (Bug#9498).
10927 (selection_data_to_lisp_data): Assume incoming selection data are
10928 signed integers, not unsigned. This is to be consistent with
10929 outgoing selection data, which was modified to use signed integers
10930 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10931 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10932 expects long, not unsigned long.
10933
46888499
EZ
109342011-09-14 Eli Zaretskii <eliz@gnu.org>
10935
10936 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10937 computation of loop end. Reported by Johan Bockgård
10938 <bojohan@gnu.org>.
10939
ef8ef9fb
CY
109402011-09-13 Chong Yidong <cyd@stupidchicken.com>
10941
10942 * frame.c (Fother_visible_frames_p): Function deleted.
10943
fa819fed
EZ
109442011-09-12 Eli Zaretskii <eliz@gnu.org>
10945
10946 * indent.c (compute_motion): Process display vector front to back
10947 rather than the other way around. (Bug#2496)
10948
2ba8e008
SM
109492011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10950
10951 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10952
20f53c69
CY
109532011-09-11 Chong Yidong <cyd@stupidchicken.com>
10954
10955 * minibuf.c (Fread_from_minibuffer): Doc fix.
10956
d562d7a4
EZ
109572011-09-11 Eli Zaretskii <eliz@gnu.org>
10958
10959 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10960 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10961
1c4d7f3d
LMI
109622011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10963
10964 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10965 value for non-existent files.
10966
b885bf36
EZ
109672011-09-11 Eli Zaretskii <eliz@gnu.org>
10968
10969 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10970 set its "size" to -1. This will set the modtime_size field of
10971 the corresponding buffer to -1, which is what
10972 verify-visited-file-modtime expects for files that do not exist.
10973 (Bug#9139)
10974
6612f0bf
PE
109752011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10976
10977 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10978 here ...
10979 * lisp.h: ... from here. push_key_description is no longer
10980 defined in keyboard.c, so its declaration should not be in
10981 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10982 logically belongs with push_key_description.
10983
dfb3f755
PE
109842011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10985
10986 * buffer.h: Include <sys/types.h> instead of <time.h>.
10987 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10988 Problem reported by Herbert J. Skuhra.
10989
3134906c
LMI
109902011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10991
10992 * xml.c (parse_region): Make the parsing work for
10993 non-comment-starting XML files again (bug#9144).
10994
8d903f4e
AS
109952011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10996
10997 * image.c (gif_load): Fix calculation of bottom and right corner.
10998 (Bug#9468)
10999
80ad64f4
EZ
110002011-09-10 Eli Zaretskii <eliz@gnu.org>
11001
11002 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
11003 redisplay in small windows.
11004
208a048d
EZ
110052011-09-09 Eli Zaretskii <eliz@gnu.org>
11006
11007 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
11008
9b1c252e
MR
110092011-09-08 Martin Rudalics <rudalics@gmx.at>
11010
11011 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
11012 Operate on live windows only.
11013
2949f33b
JB
110142011-09-08 Juanma Barranquero <lekktu@gmail.com>
11015
11016 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
11017
e08dcafd
EZ
110182011-09-07 Eli Zaretskii <eliz@gnu.org>
11019
11020 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
11021 only under bidi iteration.
11022
115b96bd
JD
110232011-09-07 Jan Djärv <jan.h.d@swipnet.se>
11024
11025 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11026
c8199d0f
PE
110272011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11028
11029 isnan: Fix porting problem to Solaris 10 with bundled gcc.
11030 Without this fix, the command to link temacs failed due to an
11031 undefined symbol __builtin_isnan. This is because
11032 /usr/include/iso/math_c99.h #defines isnan(x) to
11033 __builtin_isnan(x), but the bundled gcc, which identifies itself
11034 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11035 a __builtin_isnan.
11036 * floatfns.c (isnan): #undef, and then #define to a clone of
11037 what's in data.c.
11038 (Fisnan): Always define, since it's always available now.
11039 (syms_of_floatfns): Always define isnan at the Lisp level.
11040
e39b275c 110412011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
11042
11043 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11044
b2db44d9 110452011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 11046
f4af5137 11047 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
11048 The previous code assumed that file offsets (off_t values) fit in
11049 EMACS_INT variables, which is not true on typical 32-bit hosts.
11050 The code messed up by falsely reporting buffer overflow in cases
11051 such as (insert-file-contents "big" nil 1 2) into an empty buffer
11052 when "big" contains more than 2**29 bytes, even though this
11053 inserts just one byte and does not overflow the buffer.
11054 (Finsert_file_contents): Store file offsets as off_t
11055 values, not as EMACS_INT values. Check for overflow when
11056 converting between EMACS_INT and off_t. When checking for
11057 buffer overflow or for overlap, take the offsets into account.
11058 Don't use EMACS_INT for small values where int suffices.
11059 When checking for overlap, fix a typo: ZV was used where
11060 ZV_BYTE was intended.
11061 (Fwrite_region): Don't assume off_t fits into 'long'.
11062 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
11063
ecfc0a49
MA
110642011-09-05 Michael Albinus <michael.albinus@gmx.de>
11065
11066 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
11067
6511acf2 110682011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 11069
0999621a 11070 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
11071
11072 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 11073 (esprintf, exprintf, evxprintf): New functions.
62f19c19 11074 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 11075 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
11076 (modify_event_symbol): Do not assume that the length of
11077 name_alist_or_stem is safe to alloca and fits in int.
11078 (Fexecute_extended_command): Likewise for function name and binding.
11079 (Frecursion_depth): Wrap around reliably on integer overflow.
11080 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11081 since some callers pass EMACS_INT values.
11082 (Fsingle_key_description): Don't crash if symbol name contains more
11083 than MAX_ALLOCA bytes.
11084 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11085 (get_minibuffer): Arg is now EMACS_INT, not int.
11086 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 11087 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
11088 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11089
2be7d702
PE
11090 * dbusbind.c (signature_cat): New function.
11091 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
11092 Do not overrun buffer; instead, report string overflow.
11093
9d1df220
PE
11094 * dispnew.c (add_window_display_history): Don't overrun buffer.
11095 Truncate instead; this is OK since it's just a log.
11096
33ef5c64
PE
11097 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11098 even if the time zone offset is outlandishly large.
11099 Don't mishandle offset == INT_MIN.
11100
66c6fdd5
PE
11101 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11102 when creating daemon; the previous buffer-overflow check was incorrect.
11103
d749b01b
PE
11104 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11105 which has the guts of the old verror function.
11106
b5cd1905
PE
11107 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11108 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11109
6e1a67fb
PE
11110 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11111 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 11112 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 11113 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
11114 length of string rather than counting it via multiple sprintfs;
11115 that's simpler and more reliable.
c21721cc
PE
11116 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11117 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11118 sprintf, in case result does not fit in int.
11119
c57b67fc
PE
11120 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11121 (fontset_from_font): Print it.
11122
8a401434
PE
11123 * frame.c (tty_frame_count): Now printmax_t, not int.
11124 (make_terminal_frame, set_term_frame_name): Print it.
11125 (x_report_frame_params): In X, window IDs are unsigned long,
11126 not signed long, so print them as unsigned.
11127 (validate_x_resource_name): Check for implausibly long names,
11128 and don't assume name length fits in 'int'.
11129 (x_get_resource_string): Don't blindly alloca invocation name;
11130 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
11131 not fit in int.
11132
6e1a67fb
PE
11133 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11134 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
11135 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11136
0df02bf3
PE
11137 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11138 Use esprintf, not sprintf, in case result does not fit in int.
11139
48e30793
PE
11140 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11141 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11142 it as a large positive number.
11143 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
11144 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11145
a66ff6d8
PE
11146 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
11147 in case result does not fit in int.
11148
aca216ff
PE
11149 * print.c (float_to_string): Detect width overflow more reliably.
11150 (print_object): Make sprintf buffer a bit bigger, to avoid potential
11151 buffer overrun. Don't assume list length fits in 'int'. Treat
11152 print length of 0 as 0, not as infinity; to be consistent with other
11153 uses of print length in this function. Don't overflow print length
11154 index. Don't assume hash table size fits in 'long', or that
11155 vectorlike size fits in 'unsigned long'.
11156
31c286f7
PE
11157 * process.c (make_process): Use printmax_t, not int, to format
11158 process-name gensyms.
11159
55e5faa1
PE
11160 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
11161
80f2e268
PE
11162 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
11163 to avoid potential buffer overrun.
11164
670741ab
PE
11165 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
11166 if X resource line is longer than 512 bytes.
11167
b7163a50
PE
11168 * xfns.c (x_window): Make sprintf buffer a bit bigger
11169 to avoid potential buffer overrun.
11170
ae58ff1f
PE
11171 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
11172
c43c8a6a
PE
11173 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
11174
3f8236f4
PE
111752011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11176
53e9fe90 11177 Integer overflow fixes for scrolling, etc.
6511acf2
PE
11178 Without these, Emacs silently mishandles large integers sometimes.
11179 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
11180 it were "C-u 1 M-x recenter" on a typical 64-bit host.
11181
6511acf2
PE
11182 * xdisp.c (try_window_id): Check Emacs fixnum range before
11183 converting to 'int'.
806add1d 11184
6511acf2 11185 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
11186 Check that an Emacs fixnum is in range before assigning it to 'int'.
11187 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
11188 values converted from Emacs fixnums.
11189 (Frecenter): Don't wrap around a line count if it is out of 'int'
11190 range; instead, treat it as an extreme value.
11191 (Fset_window_configuration, compare_window_configurations):
11192 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
11193
6511acf2
PE
11194 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
11195 that can exceed INT_MAX. Check that EMACS_INT value is in range
11196 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
11197 (match_limit): Don't assume that a fixnum can fit in 'int'.
11198
6511acf2 11199 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
11200 exceed INT_MAX.
11201
6511acf2 11202 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
11203 (Fvertical_motion): Don't wrap around LINES values that don't fit
11204 in 'int'. Instead, treat them as extreme values. This is good
11205 enough for windows, which can't have more than INT_MAX lines anyway.
11206
fcb901a7
LMI
112072011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11208
0f2f6b6d
LMI
11209 * Require libxml/parser.h to avoid compilation warning.
11210
fcb901a7
LMI
11211 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11212
11213 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11214 since this reportedly can destroy thread storage.
11215
6e20a0d4
CY
112162011-08-30 Chong Yidong <cyd@stupidchicken.com>
11217
11218 * syntax.c (find_defun_start): Update all cache variables if
11219 exiting early (Bug#9401).
11220
148ae00e
EZ
112212011-08-30 Eli Zaretskii <eliz@gnu.org>
11222
f6cfbd8f
EZ
11223 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11224
148ae00e
EZ
11225 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11226 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
11227 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
11228
11229 * term.c (tty_append_glyph): New function.
11230 (produce_stretch_glyph): Static function and its prototype deleted.
11231
a66cfb1c
SM
11232 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11233 Add prototypes.
148ae00e 11234
c4a07a4c
PE
112352011-08-29 Paul Eggert <eggert@cs.ucla.edu>
11236
11237 * image.c (parse_image_spec): Check for nonnegative, not for positive,
11238 when checking :margin (Bug#9390).
11239 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 11240 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
11241 so that the name doesn't mislead. All uses changed.
11242
6bc8cd65
JB
112432011-08-28 Johan Bockgård <bojohan@gnu.org>
11244
11245 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11246 set_tty_hooks.
11247
dca4927e
EZ
112482011-08-27 Eli Zaretskii <eliz@gnu.org>
11249
11250 * xdisp.c (move_it_to): Don't bail out early when reaching
11251 position beyond to_charpos, if we are scanning backwards.
11252 (move_it_vertically_backward): When DY == 0, make sure we get to
11253 the first character in the line after the newline.
11254
f2cad773
PE
112552011-08-27 Paul Eggert <eggert@cs.ucla.edu>
11256
11257 * ccl.c: Improve and simplify overflow checking (Bug#9196).
11258 (ccl_driver): Do not generate an out-of-range pointer.
11259 (Fccl_execute_on_string): Remove unnecessary check for
11260 integer overflow, noted by Stefan Monnier in
11261 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11262 Remove a FIXME that didn't need fixing.
11263 Simplify the newly-introduced buffer reallocation code.
11264
0cae2cdb
JB
112652011-08-27 Juanma Barranquero <lekktu@gmail.com>
11266
11267 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11268
5fc295a4 112692011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 11270
70c60eb2 11271 Integer and memory overflow issues (Bug#9196).
726e0ab1 11272
d31850da
PE
11273 * doc.c (get_doc_string): Rework so that
11274 get_doc_string_buffer_size is the actual buffer size, rather than
11275 being 1 less than the actual buffer size; this makes xpalloc more
11276 convenient.
11277
a69fbedb
PE
11278 * image.c (x_allocate_bitmap_record, cache_image):
11279 * xselect.c (Fx_register_dnd_atom):
11280 Simplify previous changes by using xpalloc.
11281
fe5c5d37
PE
11282 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11283 since either will do and ptrdiff_t is convenient with xpalloc.
11284
0065d054
PE
11285 * charset.c (charset_table_size)
11286 (struct charset_sort_data.priority): Now ptrdiff_t.
11287 (charset_compare): Don't overflow if priorities differ greatly.
11288 (Fsort_charsets): Don't assume list length fits in int.
11289 Check for size-calculation overflow when allocating sort data.
11290 (syms_of_charset): Allocate an initial charset table that is
11291 just under 64 KiB, to avoid problems with glibc malloc and mmap.
11292
11293 * cmds.c (internal_self_insert): Check for size-calculation overflow.
11294
11295 * composite.h (struct composition.glyph_len): Now int, not unsigned.
11296 The actual value is always <= INT_MAX, and leaving it unsigned made
11297 overflow checking harder.
11298
11299 * dispextern.h (struct glyph_matrix.rows_allocated)
11300 (struct face_cache.size): Now ptrdiff_t, for convenience in use
11301 with xpalloc. The values are still always <= INT_MAX.
11302
11303 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
11304
11305 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
11306 (SAFE_NALLOCA): New macro.
11307
11308 * region-cache.c (struct boundary.pos, find_cache_boundary)
11309 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
11310 (set_cache_region, invalidate_region_cache)
11311 (revalidate_region_cache, know_region_cache, region_cache_forward)
11312 (region_cache_backward, pp_cache):
11313 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
11314 so that ptrdiff_t * can be passed to xpalloc.
11315 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
11316 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
11317 (pp_cache): Don't assume cache_len fits in int.
11318 * region-cache.h: Adjust extern decls to match.
11319
11320 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
11321 EMACS_INT, since either will do, for xpalloc.
11322
11323 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
11324 (xnmalloc, xnrealloc, xpalloc): New functions.
11325
726e0ab1
PE
11326 * bidi.c (bidi_shelve_header_size): New constant.
11327 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11328 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11329
51f30bc5 11330 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
11331 * buffer.c (overlays_at, overlays_in, record_overlay_string)
11332 (overlay_strings):
11333 Don't update size of array until after memory allocation succeeds,
11334 because xmalloc/xrealloc may not return.
0065d054
PE
11335 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11336 now that we have proper integer overflow checking.
11337 (record_overlay_string, overlay_strings): Catch overflows when
11338 calculating size of overlay_str_buf.
726e0ab1 11339
0065d054
PE
11340 * callproc.c (Fcall_process): Check for size overflow when
11341 calculating size of args2.
11342 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11343 Normally we prefer signed values, but sticking with ptrdiff_t would
11344 require adding more-complicated checks.
726e0ab1
PE
11345
11346 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11347 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11348 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 11349 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
11350
11351 * character.c (Fstring): Check for size-calculation overflow.
11352
11353 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11354 unnecessary integer overflow. Check for size overflow.
11355 (encode_coding_object): Don't update size until xmalloc succeeds.
11356
11357 * composite.c (get_composition_id): Check for overflow in glyph
11358 length calculations.
11359
11360 Integer and memory overflow fixes for display code.
11361 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11362 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11363 (scrolling_window): Check for overflow in size calculations.
11364 (line_draw_cost, realloc_glyph_pool, add_row_entry):
11365 Don't assume glyph table len fits in int.
11366 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11367 (row_table_size): Now ptrdiff_t, not int.
11368 (scrolling_window): Avoid overflow in size calculations.
11369 Don't update size until allocation succeeds.
11370 * fns.c (concat): Check for overflow in size calculations.
11371 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11372 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11373 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11374
11375 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11376 (get_doc_string): Check for size calculation overflow.
11377 Don't update size until allocation succeeds.
11378 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11379 EMACS_INT, where ptrdiff_t will do.
11380 (Fsubstitute_command_keys): Check for string overflow.
11381
11382 * editfns.c (set_time_zone_rule): Don't assume environment length
11383 fits in int.
11384 (message_length): Now ptrdiff_t, not int.
11385 (Fmessage_box): Don't update size until allocation succeeds.
11386 Don't assume message length fits in int.
11387 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11388
0065d054
PE
11389 * emacs.c (main): Do not reallocate argv, since there is a null at
11390 the end that can be overwritten, and this way there's no need to
11391 worry about size-calculation overflow.
11392 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
11393
11394 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11395 alloc succeeds.
11396 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11397
11398 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11399 (x_set_scroll_bar_width, x_figure_window_size):
11400 Check for integer overflow.
11401 (x_set_alpha): Do not assume XINT fits in int.
11402
11403 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11404 This is for the members text_lines, text_cols, total_lines, total_cols,
11405 where the system imposes an 'int' limit.
11406
11407 * fringe.c (Fdefine_fringe_bitmap):
11408 Don't update size until alloc works.
11409
11410 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11411 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11412
11413 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11414 Check for size-calculation overflow.
11415 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11416 do, as we prefer signed integers.
11417 (id_to_widget.max_size, id_to_widget.used)
11418 (xg_store_widget_in_map, xg_remove_widget_from_map)
11419 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11420 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11421 Use and return ptrdiff_t, not int.
11422 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11423 * gtkutil.h: Change prototypes to match the above.
11424
11425 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11426 are duplicate now that they've been promoted to lisp.h.
11427 (x_allocate_bitmap_record, x_alloc_image_color)
11428 (make_image_cache, cache_image, xpm_load):
11429 Don't update size until alloc is done.
11430 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11431 (x_detect_edges):
3256efce 11432 Check for size calculation overflow.
726e0ab1
PE
11433 (ct_colors_allocated_max): New constant.
11434 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11435 overflow.
3256efce 11436
726e0ab1
PE
11437 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11438 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11439 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11440 Use ptrdiff_t, not int, to count maps.
11441 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
11442 calculations. Don't update size until allocation succeeds.
11443 Redo calculations to avoid overflow.
726e0ab1
PE
11444 * keyboard.h: Change prototypes to match the above.
11445
11446 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11447 to count maps.
11448 (current_minor_maps): Check for size calculation overflow.
11449 * keymap.h: Change prototypes to match the above.
11450
11451 * lread.c (read1, init_obarray): Don't update size until alloc done.
11452
11453 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11454 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11455
726e0ab1
PE
11456 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11457 Now ptrdiff_t, not int.
11458 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11459 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11460
11461 * process.c (Fnetwork_interface_list): Check for overflow
11462 in size calculation.
11463
11464 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11465
11466 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11467 overflow. Don't bother calling xmalloc when xrealloc will do.
11468
11469 * search.c (Freplace_match): Check for size calculation overflow.
11470 (Fset_match_data): Don't assume list lengths fit in 'int'.
11471
11472 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11473 for command line length. Do not attempt to address one before the
11474 beginning of an array, as that's not portable.
11475
11476 * term.c (max_frame_lines): Remove; unused.
11477 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11478 not int.
11479 (encode_terminal_code, calculate_costs): Check for size
11480 calculation overflow.
11481 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11482 table lengths and related sizes. Don't update size until alloc
11483 done. Redo calculations to avoid overflow.
11484 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11485
11486 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11487 subtracting pointers.
11488 (gobble_line): Check for overflow more carefully. Don't update size
11489 until alloc done.
11490
11491 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11492 Don't update size until alloc done.
11493 Redo size calculations to avoid overflow.
11494 Check for size calculation overflow.
0065d054 11495 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
11496
11497 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11498 Use ptrdiff_t, not int, for sizes.
11499 (store_mode_line_noprop_char): Don't update size until alloc done.
11500
0065d054
PE
11501 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11502 Use ptrdiff_t, not int, for sizes.
11503 (Finternal_make_lisp_face, cache_face):
11504 Check for size calculation overflow.
11505 (cache_face): Treat size calculation overflows as if they were
11506 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
11507
11508 * xfns.c (x_encode_text, x_set_name_internal)
11509 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11510 sizes, since they can exceed INT_MAX in size. Check for size
11511 calculation overflow.
11512
0065d054
PE
11513 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11514 (xg_select): Check for size calculation overflow.
726e0ab1
PE
11515 Don't update size until alloc done.
11516
0065d054 11517 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 11518 as sprintf is limited to int lengths.
1d526e2f 11519
252c5ee1
PE
11520 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11521 (X_LONG_MIN): New macros.
864d7ce7
PE
11522 Use them to make the following changes clearer.
11523 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11524 This change doesn't affect the value now, but it may help remind
11525 future maintainers not to raise the value too much later.
11526 (SELECTION_QUANTUM): Remove, replacing with ...
11527 (selection_quantum): ... new function, which avoids overflow.
11528 All uses changed.
11529 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11530 assumption that selection length fits in 'int'.
11531 (x_reply_selection_request, x_handle_selection_request)
11532 (x_get_window_property, receive_incremental_selection)
11533 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11534 (lisp_data_to_selection_data, clean_local_selection_data):
11535 Use ptrdiff_t, not int, to record length of selection.
11536 (x_reply_selection_request, x_get_window_property)
11537 (receive_incremental_selection, x_property_data_to_lisp):
11538 Redo calculations to avoid overflow.
11539 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 11540 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
11541 something.
11542 (x_get_window_property, receive_incremental_selection)
11543 (lisp_data_to_selection_data, x_property_data_to_lisp):
11544 Check for size-calculation overflow.
11545 (x_get_window_property, receive_incremental_selection)
11546 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11547 Don't store size until memory allocation succeeds.
11548 (x_get_window_property): Plug memory leak on memory exhaustion.
11549 Don't double-block input; malloc is safe here. Don't assume 2**34
11550 - 4 fits in unsigned long. Add an xassert to check
11551 XGetWindowProperty overflow. Be more careful about overflow
11552 calculations, and distinguish size from memory overflow better.
11553 (receive_incremental_selection): When tracing, don't assume
11554 unsigned int is less than INT_MAX.
11555 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11556 harmful) conversions of unsigned short to int.
11557 (lisp_data_to_selection_data): Don't assume that integers
11558 in the range -65535 through -1 fit in an X unsigned short.
11559 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11560 result parameters unless successful. Rely on cons_to_unsigned
11561 to report problems with elements; the old code wasn't right anyway.
11562 (x_check_property_data): Check for int overflow; we cannot use
11563 a wider type due to X limits.
11564 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11565
726e0ab1 11566 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 11567
0065d054
PE
11568 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11569 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
11570 (x_color_cells): Don't store size until memory allocation succeeds.
11571 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 11572 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
11573 (x_term_init): Don't assume length fits in int (sprintf is limited
11574 to int size).
bc18e09d 11575
ebfa62c0
PE
11576 Use ptrdiff_t for composition IDs.
11577 * character.c (lisp_string_width):
11578 * composite.c (composition_table_size, n_compositions)
11579 (get_composition_id, composition_gstring_from_id):
11580 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11581 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11582 * window.c (Frecenter):
11583 Use ptrdiff_t, not int, for composition IDs.
11584 * composite.c (get_composition_id): Check for integer overflow.
11585 * composite.h: Adjust prototypes to match the above changes.
11586
d3411f89
PE
11587 Use ptrdiff_t for hash table indexes.
11588 * category.c (hash_get_category_set):
11589 * ccl.c (ccl_driver):
11590 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11591 * coding.c (coding_system_charset_list, detect_coding_system):
11592 * coding.h (struct coding_system.id):
11593 * composite.c (get_composition_id, gstring_lookup_cache):
11594 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11595 * image.c (xpm_get_color_table_h):
11596 * lisp.h (hash_lookup, hash_put):
11597 * minibuf.c (Ftest_completion):
11598 Use ptrdiff_t for hash table indexes, not int (which is too
11599 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11600 32-bit --with-wide-int hosts).
11601
e097a6fa
PE
11602 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11603 Add a FIXME comment about memory leaks.
11604 (syms_of_charset): Don't assume xmalloc returns.
11605
5637687f
PE
11606 Don't assume that stated character widths fit in int.
11607 * character.c (Fchar_width, c_string_width, lisp_string_width):
11608 * character.h (CHAR_WIDTH):
11609 * indent.c (MULTIBYTE_BYTES_WIDTH):
11610 Use sanitize_char_width to avoid undefined and/or bad behavior
11611 with outlandish widths.
a66cfb1c 11612 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
11613 now that we have two such functions. All uses changed.
11614 (sanitize_char_width): New inline function.
11615
a2271ba2
PE
11616 Don't assume that tab-width fits in int.
11617 * character.h (sanitize_width): New inline function.
11618 (SANE_TAB_WIDTH): New macro.
11619 (ASCII_CHAR_WIDTH): Use it.
11620 * indent.c (sane_tab_width): Remove. All uses replaced by
11621 SANE_TAB_WIDTH (current_buffer).
11622 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11623
18c52557
PE
11624 * fileio.c: Integer overflow issues with file modes.
11625 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11626
caeeedc1
PE
11627 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11628 Remove unreachable code.
11629 (read_hex, load_charset_map_from_file): Check for integer overflow.
11630
6df6ae42 11631 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
11632 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11633 (x_send_scroll_bar_event): Likewise. Check that the size does not
11634 exceed limits imposed by XClientMessageEvent, as well as the usual
11635 ptrdiff_t and size_t limits.
11636
b13995db
PE
11637 * keyboard.c: Overflow, signedness and related fixes.
11638 (make_lispy_movement): Use same integer type in forward decl
11639 that is used in the definition.
11640 (read_key_sequence, keyremap_step):
11641 Change bufsize argument back to int, undoing my 2011-03-30 change.
11642 We prefer signed types, and int is wide enough here.
11643 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11644 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11645 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11646 length, not size_t. Use ptrdiff_t for index, not int.
11647 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11648 possibility of integer overflow.
11649
13464394
PE
11650 Overflow, signedness and related fixes for images.
11651
11652 * dispextern.h (struct it.stack[0].u.image.image_id)
11653 (struct_it.image_id, struct image.id, struct image_cache.size)
11654 (struct image_cache.used, struct image_cache.ref_count):
11655 * gtkutil.c (update_frame_tool_bar):
11656 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11657 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11658 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11659 * nsmenu.m (update_frame_tool_bar):
11660 * xdisp.c (calc_pixel_width_or_height):
11661 * xfns.c (image_cache_refcount):
11662 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11663 on typical 64-bit hosts.
11664
11665 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11666 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11667 Omit unnecessary casts to int.
11668 (parse_image_spec): Check that integers fall into 'int' range
11669 when the callers expect that.
11670 (image_ascent): Redo ascent calculation to avoid int overflow.
11671 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11672 (lookup_image): Remove unnecessary tests.
11673 (xbm_image_p): Locals are now of int, not EMACS_INT,
11674 since parse_image_check makes sure they fit into int.
11675 (png_load, gif_load, svg_load_image):
11676 Prefer int to unsigned where either will do.
11677 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
11678 old tiff_error_handler and tiff_warning_handler.
11679 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
11680 stack buffer overflows. It uses only the features of vsnprintf
11681 that are common to both POSIX and native Microsoft.
11682 (tiff_error_handler, tiff_warning_handler): Use it.
11683 (tiff_load, gif_load, imagemagick_load_image):
11684 Don't assume :index value fits in 'int'.
11685 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11686 (imagemagick_load_image): Check that crop parameters fit into
11687 the integer types that MagickCropImage accepts. Don't assume
11688 Vimagemagick_render_type has a nonnegative value. Don't assume
11689 size_t fits in 'long'.
11690 (gs_load): Use printmax_t to print the widest integers possible.
11691 Check for integer overflow when computing image height and width.
11692
c11821d4
EZ
116932011-08-26 Eli Zaretskii <eliz@gnu.org>
11694
11695 * xdisp.c (redisplay_window): Don't force window start if point
11696 will be invisible in the resulting window. (Bug#9324)
11697
0c95fcf7
EZ
116982011-08-25 Eli Zaretskii <eliz@gnu.org>
11699
11700 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11701 the display spec is of the form `(space ...)'.
11702 (handle_display_spec): Return the value returned by
11703 handle_single_display_spec, not just 1 or zero.
11704 (handle_single_display_spec): If the display spec is of the form
11705 `(space ...)', and specifies display in the text area, return 2
11706 rather than 1.
fee65a97 11707 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
11708 accurately, and prefer exact match for point under bidi.
11709 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
11710
11711 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11712 into disp_prop; all users changed.
11713
11714 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11715 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11716 for the text covered by the display property.
11717
e4ed06f1
CY
117182011-08-25 Chong Yidong <cyd@stupidchicken.com>
11719
11720 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11721 Change return value to nil.
11722 (Frecord_buffer): Delete unused function.
11723
f67cdd7f
EZ
117242011-08-24 Eli Zaretskii <eliz@gnu.org>
11725
5980d4c6
EZ
11726 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11727 buffers, return left-to-right.
8610fe8b
EZ
11728 (set_cursor_from_row): Consider candidate row a win if its glyph
11729 represents a newline and point is on that newline. Fixes cursor
11730 positioning on the newline at EOL of R2L text within L2R
11731 paragraph, and vice versa.
11732 (try_cursor_movement): Check continued rows, in addition to
11733 continuation rows. Fixes unwarranted scroll when point enters a
11734 continued line of R2L text within an L2R paragraph, or vice versa.
11735 (cursor_row_p): Consider the case of point being equal to
11736 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11737 from the end of a short line to the beginning of a continued line
11738 of R2L text within L2R paragraph.
11739 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11740 composed characters.
5980d4c6 11741
f67cdd7f
EZ
11742 * bidi.c (bidi_check_type): Use xassert.
11743 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11744 members.
11745
bca633fb
EZ
117462011-08-23 Eli Zaretskii <eliz@gnu.org>
11747
11748 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11749 a character.
11750
4a5885a7
CY
117512011-08-23 Chong Yidong <cyd@stupidchicken.com>
11752
11753 * nsfont.m (ns_otf_to_script): Fix typo.
11754
0902a04e
KH
117552011-08-22 Kenichi Handa <handa@m17n.org>
11756
11757 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11758 extra slot even if the purpose is char-code-property-table.
11759
1a2e6670
EZ
117602011-08-23 Eli Zaretskii <eliz@gnu.org>
11761
8ddde651
EZ
11762 * xdisp.c (redisplay_window): When computing centering_position,
11763 account for the height of the header line. (Bug#8874)
11764
425cc014
EZ
11765 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11766 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11767 candidate is selected by the mouse, and that candidate has a
11768 composed character under the mouse.
11769
1a2e6670
EZ
11770 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11771 coordinates reported by pos-visible-in-window-p for a composed
11772 character in column zero.
11773
8b76d6f8
SM
117742011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11775
11776 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11777
dac347dd
EZ
117782011-08-22 Eli Zaretskii <eliz@gnu.org>
11779
11780 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11781 consider it a hit if to_charpos is anywhere in the range of the
11782 composed buffer positions.
11783
e013fb34
CY
117842011-08-22 Chong Yidong <cyd@stupidchicken.com>
11785
11786 * image.c (gif_load): Don't assume that each subimage has the same
11787 dimensions as the base image. Handle disposal method that is
11788 "undefined" by the gif spec (Bug#9335).
11789
bd1ba3e8
CY
117902011-08-20 Chong Yidong <cyd@stupidchicken.com>
11791
11792 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 11793 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 11794
54a1215b
EZ
117952011-08-19 Eli Zaretskii <eliz@gnu.org>
11796
823564e5
EZ
11797 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11798 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11799 from an Org mode buffer to a Speedbar frame.
11800
54a1215b
EZ
11801 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11802 a composition, take its buffer position from IT->cmp_it.charpos.
11803 Fixes cursor positioning at the beginning of a line that begins
11804 with a composed character.
11805
9778ebcc
EZ
118062011-08-18 Eli Zaretskii <eliz@gnu.org>
11807
0be6ee06
EZ
11808 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11809 character bidirectional type, use STRONG_L instead. Fixes crashes
11810 in a buffer produced by `describe-categories'.
11811
9778ebcc
EZ
11812 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11813 members before the level stack, so they would be saved and
11814 restored when copying iterator state. Fixes incorrect reordering
11815 around TABs covered by display properties.
11816
156bffbe
AS
118172011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11818
6b02f655 11819 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 11820
72ad093b
CY
118212011-08-17 Chong Yidong <cyd@stupidchicken.com>
11822
11823 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
11824 (internal_condition_case_2, internal_condition_case_n):
11825 Remove unnecessary aborts (Bug#9081).
72ad093b 11826
35774242
EZ
118272011-08-17 Eli Zaretskii <eliz@gnu.org>
11828
11829 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11830 has no `load' handler, try opening the file locally. (Bug#9311)
11831
db76dd85
KB
118322011-08-16 Ken Brown <kbrown@cornell.edu>
11833
11834 * gmalloc.c: Expand comment.
11835
b215eee5
EZ
118362011-08-16 Eli Zaretskii <eliz@gnu.org>
11837
11838 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11839 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11840
a4579d33
KB
118412011-08-16 Ken Brown <kbrown@cornell.edu>
11842
11843 Fix memory allocation problems in Cygwin build (Bug#9273).
11844
11845 * unexcw.c ( __malloc_initialized): Declare external variable.
11846 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11847
8b76d6f8
SM
11848 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11849 New variables.
a4579d33
KB
11850 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11851 dumped emacs.
11852 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11853 in the static heap.
11854 [CYGWIN] (special_realloc): New function.
11855 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11856 requests to realloc storage in the static heap.
11857
3ebec551
PE
118582011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11859
11860 * bidi.c (bidi_initialize): Remove unused local.
11861
9fd8be00
EZ
118622011-08-15 Eli Zaretskii <eliz@gnu.org>
11863
6b02f655
SM
11864 * bidimirror.h:
11865 * biditype.h: Remove file.
11866 * makefile.w32-in ($(BLD)/bidi.$(O)):
11867 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
11868
11869 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11870
11871 * chartab.c: Improve commentary for the uniprop_table API.
11872
32413314
EZ
11873 * bidi.c (bidi_paragraph_init): Support zero value of
11874 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
11875 (bidi_initialize): Use uniprop_table instead of including
11876 biditype.h and bidimirror.h.
32413314 11877
9fd8be00
EZ
11878 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11879 coordinates of the iterator when restoring from ppos_it.
11880 (Bug#9296)
11881
5cf2b69b
KH
118822011-08-14 Kenichi Handa <handa@m17n.org>
11883
11884 * process.c (create_process): Call setup_process_coding_systems
72ad093b 11885 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 11886
daf17d00
EZ
118872011-08-14 Eli Zaretskii <eliz@gnu.org>
11888
11889 * xdisp.c (move_it_in_display_line_to): Don't invoke
11890 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11891 ppos_it. Fixes vertical cursor motion when line beginning is
11892 covered by an image. (Bug#9296)
11893
08e3161a
JD
118942011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11895
11896 * nsterm.h (ns_run_ascript): Declare.
11897 (NSAPP_DATA2_RUNASSCRIPT): Define.
11898
11899 * nsfns.m (as_script, as_result, as_status): New static variables.
11900 (ns_run_ascript): New function.
5e617bc2 11901 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
11902 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11903 the event loop. Get status from as_status (Bug#7276).
11904
11905 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11906 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11907 the event loop (Bug#7276).
11908
a3720aa2
AS
119092011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11910
11911 * gnutls.c (QCgnutls_bootprop_priority)
11912 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11913 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11914 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11915 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11916 (QCgnutls_bootprop_verify_hostname_error)
11917 (QCgnutls_bootprop_callbacks_verify): Rename from
11918 Qgnutls_bootprop_..., all uses changed.
11919
11920 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11921 uses changed.
11922
0a0d27fb
PE
119232011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11924
19d5c50c
PE
11925 * xfaces.c (Qframe_set_background_mode): Now static.
11926 * dispextern.h (Qframe_set_background_mode): Remove decl.
11927
0a0d27fb
PE
11928 * process.c (Fnetwork_interface_info): Declare local only if needed.
11929
377538cb
JD
119302011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11931
11932 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11933 (Fnetwork_interface_list): Allocate in increments of bytes instead
11934 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11935 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11936 sockaddr.
11937 (struct ifflag_def): notrailers is smart on OSX.
11938 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11939 Get hardware address with getifaddrs if available.
11940
08fff70c
EZ
119412011-08-12 Eli Zaretskii <eliz@gnu.org>
11942
11943 * xdisp.c (iterate_out_of_display_property): xassert that
11944 IT->position is set to within IT->object's boundaries. Break from
11945 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
11946 when IT->position is set up wrongly due to some bug.
11947 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
11948 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11949 entry. Force push_it to save on the stack the current
11950 buffer/string position, to be restored by pop_it. Fix flags in
11951 the iterator structure wrt the object coming from a display
11952 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11953 properties. (Bug#9284)
11954
7be1c708 119552011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 11956
7be1c708
CY
11957 * fontset.c (fontset_get_font_group): Add proper type checks.
11958 (Bug#9172)
aac0c6e3 11959
7be1c708 119602011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 11961
7be1c708
CY
11962 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11963 and LC_VERSION_MIN_MACOSX.
11964 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11965 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 11966
97bb72a6
EZ
119672011-08-08 Eli Zaretskii <eliz@gnu.org>
11968
11969 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
11970 no-display-properties-and-no-overlays under bidi display.
11971 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 11972 properties and overlays.
97bb72a6 11973
d5617611
CY
119742011-08-08 Chong Yidong <cyd@stupidchicken.com>
11975
37e11a63
CY
11976 * editfns.c (Fset_time_zone_rule): Document relationship with the
11977 setenv function.
11978
d5617611
CY
11979 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11980 the font entity extracted from the cache (Bug#8109).
11981
58872834
CY
119822011-08-07 Chong Yidong <cyd@stupidchicken.com>
11983
11984 * composite.c (autocmp_chars): Don't reset point. That is done by
11985 restore_point_unwind (Bug#5984).
11986
75bfc667
JL
119872011-08-07 Juri Linkov <juri@jurta.org>
11988
11989 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11990 to show the arg `TIME' instead of `TIMEVAL'.
11991
d1410150
EZ
119922011-08-06 Eli Zaretskii <eliz@gnu.org>
11993
11994 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11995 display property strides EOL and includes a newline, as in
11996 longlines-mode. (Bug#9254)
75b771e4
EZ
11997 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11998 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
11999
12000 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12001 is non-zero, even if the data buffer is NULL. Fixes a crash in
12002 vertical-motion with longlines-mode. (Bug#9254)
12003
35928349
EZ
120042011-08-05 Eli Zaretskii <eliz@gnu.org>
12005
ec7cc85b
EZ
12006 * bidi.c <bidi_cache_total_alloc>: Now static.
12007 (bidi_initialize): Initialize bidi_cache_total_alloc.
12008
8b76d6f8 12009 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
12010 cache. (Bug#9221)
12011
12012 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
12013 amount allocated this far in `bidi_cache_total_alloc'.
12014 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
12015 non-zero, only free the data buffer without restoring the cache
12016 contents. All callers changed.
12017
12018 * dispextern.h (bidi_unshelve_cache): Update prototype.
12019
12020 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
12021 (move_it_in_display_line, move_it_to)
12022 (move_it_vertically_backward, move_it_by_lines): Replace the call
12023 to xfree to an equivalent call to bidi_unshelve_cache.
12024 (move_it_in_display_line_to): Fix logic of returning
412b6358 12025 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 12026
e2e2423b
EZ
120272011-08-05 Eli Zaretskii <eliz@gnu.org>
12028
12029 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12030 came from a string character with a `cursor' property. (Bug#9229)
12031
ae9e757a
JD
120322011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12033
12034 * Makefile.in (LIB_PTHREAD): New variable.
12035 (LIBES): Add LIB_PTHREAD (Bug#9216).
12036
12037 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12038 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12039
213bd7f2
AS
120402011-08-04 Andreas Schwab <schwab@linux-m68k.org>
12041
6b02f655 12042 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 12043
99aaf75f
JD
120442011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12045
12046 * xterm.c (x_find_topmost_parent): New function.
12047 (x_set_frame_alpha): Find topmost parent window with
12048 x_find_topmost_parent and set the property there also (bug#9181).
12049 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12050
c74e9d86
PE
120512011-08-04 Paul Eggert <eggert@cs.ucla.edu>
12052
12053 * callproc.c (Fcall_process): Avoid vfork clobbering
12054 the local vars buffer, coding_systems, current_dir.
12055
640c8776
SM
120562011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
12057
12058 * keymap.c (Fmake_composed_keymap): Move to subr.el.
12059
f26d0e4c
PE
120602011-08-03 Paul Eggert <eggert@cs.ucla.edu>
12061
8a10d76c
PE
12062 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
12063 so that it is not optimized away.
12064
f26d0e4c
PE
12065 * xdisp.c (compute_display_string_pos): Remove unused local.
12066
55439c61
EZ
120672011-08-02 Eli Zaretskii <eliz@gnu.org>
12068
12069 Fix slow cursor motion and scrolling in large buffers with
12070 selective display, like Org Mode buffers. (Bug#9218)
12071
12072 * dispextern.h (struct bidi_it): New member disp_prop_p.
12073
12074 * xdisp.c: Remove one-slot cache of display string positions.
12075 (compute_display_string_pos): Accept an additional argument
5e617bc2 12076 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
12077 for a display string or property. If found, set DISP_PROP_P
12078 non-zero.
12079
12080 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
12081 DISP_PROP_P, and pass it to compute_display_string_pos.
12082 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
12083 non-zero. All callers of bidi_fetch_char changed.
12084
fb33fa43
SM
120852011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
12086
12087 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12088
b099e063
DM
120892010-12-03 Don March <don@ohspite.net>
12090
12091 * keymap.c (Fdefine_key): Fix non-prefix key error message when
12092 last character M-[char] is translated to ESC [char] (bug#7541).
12093
5cc7f7af
KH
120942011-08-02 Kenichi Handa <handa@m17n.org>
12095
d0fffa3f 12096 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
12097
12098 * chartab.c (uniprop_table): Make it non-static.
12099
525d5e6e
EZ
121002011-08-01 Eli Zaretskii <eliz@gnu.org>
12101
12102 * xdisp.c (forward_to_next_line_start): Accept additional argument
12103 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12104 on the newline.
12105 (reseat_at_next_visible_line_start): Use the bidi iterator state
12106 returned by forward_to_next_line_start to restore the state of
12107 it->bidi_it after backing up to previous newline. (Bug#9212)
12108
31011111
AS
121092011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12110
12111 * regex.c (re_comp): Protoize.
12112 (re_exec): Fix return type.
12113 (regexec): Fix type of `ret'. (Bug#9203)
12114
476371c4
PE
121152011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12116
e5d76069
PE
12117 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12118 This is needed if max-image-size is a floating-point number.
12119
9a79b20c
AS
121202011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12121
12122 * print.c (print_object): Print empty symbol as ##.
12123
12124 * lread.c (read1): Read ## as empty symbol.
12125
d8c2fa78
AA
121262011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12127
12128 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12129 setting frame foreground color (Bug#9175).
12130 (x_set_background_color): Likewise.
12131
ffe57a7a
AA
12132 * nsmenu.m (-setText): Size tooltip dimensions precisely to
12133 contents (Bug#9176).
12134 (EmacsTooltip -init): Remove bezels and add shadows to
12135 tooltip windows.
12136
bf3492a5
AA
12137 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12138 or scroll bar (Bug#8470).
12139
d55e9c53
AA
12140 * nsfont.m (nsfont_open): Remove assignment to voffset and
12141 unnecessary vars hshink, expand, hd, full_height, min_height.
12142 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12143
12144 * nsterm.h (nsfont_info): Remove voffset field.
12145
d8c2fa78 121462011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
12147
12148 Implement strike-through and overline on NextStep (Bug#8863).
12149
12150 * nsfont.m (nsfont_open): Use underline position provided by font,
12151 instead of hard-coded value of 2.
12152 (nsfont_draw): Call ns_draw_text_decoration instead.
12153
12154 * nsterm.h: Add declaration for ns_draw_text_decoration.
12155
12156 * nsterm.m (ns_draw_text_decoration): New function for drawing
12157 underline, overline, and strike-through.
12158 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
12159 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 12160 accommodate underlining, etc.
4843aac3 12161
4cc60b9b
EZ
121622011-07-28 Eli Zaretskii <eliz@gnu.org>
12163
bc7ece87
EZ
12164 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
12165 default.
4cc60b9b 12166
476371c4
PE
121672011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12168
66606eea
PE
12169 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
12170 Without this fix, if a signal arrives just after memory fills up,
12171 'malloc' might be invoked reentrantly.
12172
476371c4
PE
12173 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
12174 In other words, assume that every image size is allowed, on non-X
12175 hosts. This assumption is probably wrong, but it lets Emacs compile.
12176
f3fcc40d
AS
121772011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12178
12179 * regex.c (re_iswctype): Convert return values to boolean.
12180
350c992f
EZ
121812011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
12182
12183 * xdisp.c (compute_display_string_pos): Don't use cached display
12184 string position if the buffer had its restriction changed.
12185 (Bug#9184)
12186
5266b4bb
PE
121872011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12188
12189 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12190
2573a837 121912011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 12192
41f55ccd 12193 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 12194
39e378da
PE
12195 * bidi.c: Integer size and overflow fixes.
12196 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
12197 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
12198 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12199 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
12200 (bidi_find_other_level_edge):
12201 Use ptrdiff_t instead of EMACS_INT where either will do.
12202 This works better on 32-bit hosts configured --with-wide-int.
12203 (bidi_cache_ensure_space): Check for size-calculation overflow.
12204 Use % rather than repeated addition, for better worst-case speed.
12205 Don't set bidi_cache_size until after xrealloc returns, because it
12206 might not return.
12207 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
12208 (bidi_cache_ensure_space): Also check that the bidi cache size
12209 does not exceed that of the largest Lisp string or buffer. See Eli
12210 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 12211
5e927815
PE
12212 * alloc.c (__malloc_size_t): Remove.
12213 All uses replaced by size_t. See Andreas Schwab's note
12214 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12215
ca4aa935
PE
12216 * image.c: Improve checking for integer overflow.
12217 (check_image_size): Assume that f is nonnull, since
12218 it is always nonnull in practice. This is one less thing to
12219 worry about when checking for integer overflow later.
12220 (x_check_image_size): New function, which checks for integer
12221 overflow issues inside X.
12222 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12223 This removes the need for a memory_full check.
12224 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12225 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12226 (xbm_read_bitmap_data): Change locals back to 'int', since
12227 their values must fit in 'int'.
12228 (xpm_load_image, png_load, tiff_load):
12229 Invoke x_create_x_image_and_pixmap earlier,
12230 to avoid much needless work if the image is too large.
12231 (tiff_load): Treat overly large images as if
12232 x_create_x_image_and_pixmap failed, not as malloc failures.
12233 (gs_load): Use x_check_image_size.
12234
5f8f9cc2
PE
12235 * gtkutil.c: Omit integer casts.
12236 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12237 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12238
5adf60bc
PE
12239 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12240
c8907a93
PE
12241 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12242 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12243 would wrongly return t on a 64-bit host.
12244
e3c25c68
PE
12245 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12246 The plain *_OVERFLOW macros run afoul of GCC bug 49705
12247 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12248 and therefore cause GCC to emit a bogus diagnostic in some cases.
12249
3f791afe
PE
12250 * image.c: Integer signedness and overflow and related fixes.
12251 This is not an exhaustive set of fixes, but it's time to
12252 record what I've got.
12253 (lookup_pixel_color, check_image_size): Remove redundant decls.
12254 (check_image_size): Don't assume that arbitrary EMACS_INT values
12255 fit in 'int', or that arbitrary 'double' values fit in 'int'.
12256 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12257 (tiff_load, imagemagick_load_image):
12258 Check for overflow in size calculations.
12259 (x_create_x_image_and_pixmap): Remove unnecessary test for
12260 xmalloc returning NULL; that can't happen.
12261 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12262 (xpm_color_bucket): Use better integer hashing function.
12263 (xpm_cache_color): Don't possibly over-allocate memory.
12264 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12265 (gif_memory_source):
12266 Use ptrdiff_t, not int or size_t, to record sizes.
12267 (png_load): Don't assume values greater than 2**31 fit in 'int'.
12268 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12269 either works, as we prefer signed integers.
12270 (tiff_read_from_memory, tiff_write_from_memory):
12271 Return tsize_t, not size_t, since that's what the TIFF API wants.
12272 (tiff_read_from_memory): Don't fail simply because the read would
12273 go past EOF; instead, return a short read.
12274 (tiff_load): Omit no-longer-needed casts.
12275 (Fimagemagick_types): Don't assume size fits into 'int'.
12276
3cc5a532
PE
12277 Improve hashing quality when configured --with-wide-int.
12278 * fns.c (hash_string): New function, taken from sxhash_string.
12279 Do not discard information about ASCII character case; this
12280 discarding is no longer needed.
12281 (sxhash-string): Use it. Change sig to match it. Caller changed.
12282 * lisp.h: Declare it.
12283 * lread.c (hash_string): Remove, since we now use fns.c's version.
12284 The fns.c version returns a wider integer if --with-wide-int is
12285 specified, so this should help the quality of the hashing a bit.
12286
b312a492
PE
12287 * emacs.c: Integer overflow minor fix.
12288 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
12289 Define only if GNU_LINUX.
12290 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12291
dfd153ae
PE
12292 * dispnew.c: Integer signedness and overflow fixes.
12293 Remove unnecessary forward decls, that were a maintenance hassle.
12294 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12295 All uses changed.
12296 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
12297 (scrolling_window): Use ptrdiff_t, not int, for byte count.
12298 (prepare_desired_row, line_draw_cost):
12299 Use int, not unsigned, where either works.
12300 (save_current_matrix, restore_current_matrix):
12301 Use ptrdiff_t, not size_t, where either works.
12302 (init_display): Check for overflow more accurately, and without
12303 relying on undefined behavior.
12304
a81d11a3
PE
12305 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
12306 Remove, replacing with the new symbols in lisp.h. All uses changed.
12307 * fileio.c (make_temp_name):
12308 * filelock.c (lock_file_1, lock_file):
12309 * xdisp.c (message_dolog):
12310 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
12311 Use pMd etc. instead.
12312 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
12313 replacing the pWIDE etc. symbols removed from editfns.c.
12314
3300e6fd
PE
12315 * keyboard.h (num_input_events): Now uintmax_t.
12316 This is (very slightly) less likely to mess up due to wraparound.
12317 All uses changed.
12318
fd05c7e9
PE
12319 * buffer.c: Integer signedness fixes.
12320 (alloc_buffer_text, enlarge_buffer_text):
12321 Use ptrdiff_t rather than size_t when either will do, as we prefer
12322 signed integers.
12323
903fe15d
PE
12324 * alloc.c: Integer signedness and overflow fixes.
12325 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
12326 (__malloc_size_t): Default to size_t, not to int.
12327 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12328 (Fgarbage_collect, mark_object_loop_halt, mark_object):
12329 Prefer ptrdiff_t to size_t when either would do, as we prefer
12330 signed integers.
12331 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12332 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12333 Now const. Initialize with values that are in range even if char
12334 is signed.
12335 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12336 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
12337 These functions do the right thing with sizes > 2**32.
12338 (check_depth): Now ptrdiff_t, not int.
12339 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12340 Adjust to new way of storing sizes. Check for size overflow bugs
12341 in rest of code.
12342 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
12343 slightly wrong anyway, as it missed one instance of
12344 XMALLOC_OVERRUN_CHECK_OVERHEAD.
12345 (refill_memory_reserve): Omit needless cast to size_t.
12346 (mark_object_loop_halt): Mark as externally visible.
12347
ac82cc6a
PE
12348 * xselect.c: Integer signedness and overflow fixes.
12349 (Fx_register_dnd_atom, x_handle_dnd_message):
12350 Use ptrdiff_t, not size_t, since we prefer signed.
12351 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12352 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12353 x_dnd_atoms_size and x_dnd_atoms_length.
12354
c2d1e36d
PE
12355 * doprnt.c: Prefer signed to unsigned when either works.
12356 * eval.c (verror):
12357 * doprnt.c (doprnt):
12358 * lisp.h (doprnt):
12359 * xdisp.c (vmessage):
12360 Use ptrdiff_t, not size_t, when using or implementing doprnt,
12361 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12362 prefer signed arithmetic to avoid comparison confusion.
12363 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12364 but is a bit tricky.
12365
0e926e56
PE
12366 Assume freestanding C89 headers, string.h, stdlib.h.
12367 * data.c, doprnt.c, floatfns.c, print.c:
12368 Include float.h unconditionally.
12369 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12370 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12371 * regex.c: Likewise for stddef.h, string.h.
12372 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12373 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12374 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12375 (STDC_HEADERS): Remove obsolete defines.
12376 * sysdep.c: Include limits.h unconditionally.
12377
9cfdb3ec
PE
12378 Assume support for memcmp, memcpy, memmove, memset.
12379 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12380 * regex.c (memcmp, memcpy):
12381 Remove; we assume C89 now.
12382
12383 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12384 (__malloc_safe_bcopy): Remove; no longer needed.
12385
cf950e6b 12386 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
12387 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12388 well either way, and we prefer signed to unsigned.
12389
dbf38e02
LMI
123902011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12391
12392 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12393 closes the connection while we're reading (bug#9182).
12394
d6f0886c 123952011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 12396
d6f0886c
JD
12397 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12398 are specified (Bug#9168).
24e0f6b1 12399
2eb1f9e6
PE
124002011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12401
12402 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12403 Found by GCC static checking and --with-wide-int on a 32-bit host.
12404
22381272 124052011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
12406
12407 * xdisp.c (compute_display_string_pos): Fix logic of caching
12408 previous display string position. Initialize cached_prev_pos to
12409 -1. Fixes slow-down at the beginning of a buffer.
12410
f25e39b4
EZ
124112011-07-24 Eli Zaretskii <eliz@gnu.org>
12412
12413 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12414 for attrs[LFACE_FONTSET_INDEX].
12415
04c4b52e
PE
124162011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12417
12418 * xml.c (parse_region): Remove unused local
12419 that was recently introduced.
12420
c1734fbd
EZ
124212011-07-23 Eli Zaretskii <eliz@gnu.org>
12422
be18c5a5
EZ
12423 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12424 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12425
c1734fbd
EZ
12426 * xdisp.c (move_it_in_display_line_to): Record the best matching
12427 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
12428 exit if none of the characters scanned was an exact match.
12429 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
12430 when exact match is impossible due to invisible text, and the
12431 lines are truncated.
12432
a258d627
JD
124332011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12434
12435 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12436 for OSX >= 10.7.
12437
b6d5a689
EZ
124382011-07-22 Eli Zaretskii <eliz@gnu.org>
12439
0f74f785
EZ
12440 Fix a significant slow-down of cursor motion with C-n, C-p,
12441 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12442 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 12443 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
12444 (next_element_from_buffer): Call compute_stop_pos_backwards to
12445 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
12446 base_level_stop.
12447 (reseat): Don't look for prev_stop, as that could mean a very long
12448 run.
12449 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12450 <cached_disp_overlay_modiff>: Cache for last found display string
12451 position.
551918c1 12452 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
12453 about the same buffer in the same area of character positions, and
12454 the buffer wasn't changed since the time the display string
12455 position was cached.
551918c1 12456
b2d0c91a
EZ
124572011-07-22 Eli Zaretskii <eliz@gnu.org>
12458
12459 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12460 is an integer, which is important for empty lines. (Bug#9149)
12461
043604ee
CY
124622011-07-22 Chong Yidong <cyd@stupidchicken.com>
12463
12464 * frame.c (Fmodify_frame_parameters): In tty case, update the
12465 default face if necessary (Bug#4238).
12466
da4adb04
CY
124672011-07-21 Chong Yidong <cyd@stupidchicken.com>
12468
12469 * editfns.c (Fstring_to_char): No need to explain what a character
12470 is in the docstring (Bug#6576).
12471
9abd0532
LMI
124722011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12473
12474 * xml.c (parse_region): Make sure we always return a tree.
12475
36881d16
HK
124762011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12477
12478 * xml.c (parse_region): If a document contains only comments,
12479 return that, too.
12480
1e98674d
LMI
124812011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12482
12483 * xml.c (make_dom): Return comments, too.
12484
590bd467
PE
124852011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12486
12487 Port to OpenBSD.
12488 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12489 and the surrounding thread.
12490 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12491 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12492 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12493 timer goes off.
12494 * s/openbsd.h (BROKEN_SIGIO): Define.
12495 * unexelf.c (unexec) [__OpenBSD__]:
12496 Don't update the .mdebug section of the Alpha COFF symbol table.
12497
f41628b2
LMI
124982011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12499
12500 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12501 (bug#8460).
12502
b59b67c5
PE
125032011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12504
15e3a074
PE
12505 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12506 This fixes some race conditions on the permissions of any newly
12507 created file.
12508
41bed37d
PE
12509 * alloc.c (valid_pointer_p): Use pipe, not open.
12510 This fixes some permissions issues when debugging.
12511
b59b67c5
PE
12512 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12513 If fchown fails to set both uid and gid, try to set just gid,
12514 as that is sometimes allowed. Adjust the file's mode to eliminate
12515 setuid or setgid bits that are inappropriate if fchown fails.
12516
925a6be7
SM
125172011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12518
12519 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12520 to compare Lisp_Objects.
12521 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12522 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12523 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12524
52968808
AS
125252011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12526
0a6a104b
AS
12527 * lread.c (read_integer): Unread even EOF character.
12528 (read1): Likewise. Properly record start position of symbol.
12529
52968808
AS
12530 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12531 symbol character follows.
12532
9e381cdd
PE
125332011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12534
12535 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12536 This works around a problem with the previous change to Fcopy_file.
12537 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12538 and without this change, GCC might complain about discarding
12539 fchown's return value.
12540
b5641435
JB
125412011-07-16 Juanma Barranquero <lekktu@gmail.com>
12542
12543 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12544
a8031457
PE
125452011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12546
12547 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12548
dd889327
LMI
125492011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12550
750c33f7
LMI
12551 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12552 it's used from the C level.
12553
dd889327
LMI
12554 * process.c: Use the same condition for POLL_FOR_INPUT in both
12555 keyboard.c and process.c (bug#1858).
12556
87e86684
LM
125572011-07-09 Lawrence Mitchell <wence@gmx.li>
12558
12559 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12560 (Fgnutls_boot): Use it.
12561
64348f40
AS
125622011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12563
12564 * doc.c (Fsubstitute_command_keys): Revert last change.
12565
1d698799
LMI
125662011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12567
f863868c
LMI
12568 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12569 quotes the next character, and doesn't affect other longer
12570 sequences (bug#8935).
12571
1d698799
LMI
12572 * lread.c (syms_of_lread): Clarify that is isn't only
12573 `eval-buffer' and `eval-defun' that's affected by
12574 `lexical-binding' (bug#8460).
12575
aa4b6df6
EZ
125762011-07-15 Eli Zaretskii <eliz@gnu.org>
12577
12578 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 12579 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 12580
5d856da6
PE
125812011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12582
ad6042bb
PE
12583 Fix minor problems found by static checking.
12584 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12585 (elsz): Now a signed constant, not a size_t var. We prefer signed
12586 types to unsigned, to avoid integer comparison confusion. Without
12587 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12588 "cannot optimize loop, the loop counter may overflow", a symptom
12589 of the confusion.
f00bbb22 12590 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
12591 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12592
6468f31c
LMI
125932011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12594
49080b10
LMI
12595 * search.c (Fre_search_backward): Mention `case-fold-search' in
12596 all the re_search_* functions (bug#8138).
12597
6468f31c
LMI
12598 * keyboard.c (Fopen_dribble_file): Document when the file is
12599 closed (bug#8056).
12600
c965adc5
EZ
126012011-07-14 Eli Zaretskii <eliz@gnu.org>
12602
df9733bf
EZ
12603 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12604 bidi_cache_idx.
12605
0bb23927
EZ
12606 Support bidi reordering of display and overlay strings.
12607 * xdisp.c (compute_display_string_pos)
12608 (compute_display_string_end): Accept additional argument STRING.
12609 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12610 (reseat_to_string): Initialize bidi_it->string.s and
12611 bidi_it->string.schars.
12612 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
12613 NULL (avoids a crash in bidi_paragraph_init).
12614 Initialize itb.string.lstring.
0bb23927
EZ
12615 (init_iterator): Call bidi_init_it only of a valid
12616 buffer position was specified. Initialize paragraph_embedding to
12617 L2R.
12618 (reseat_to_string): Initialize the bidi iterator.
12619 (display_string): If we need to ignore text properties of
12620 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12621 original value of -1 will not work with bidi.)
12622 (compute_display_string_pos): First arg is now struct
12623 `text_pos *'; all callers changed. Support display properties on
12624 Lisp strings.
12625 (compute_display_string_end): Support display properties on Lisp
12626 strings.
12627 (init_iterator, reseat_1, reseat_to_string): Initialize the
12628 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12629 when iterating on a string not from display properties).
640c8776
SM
12630 (compute_display_string_pos, compute_display_string_end):
12631 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
12632 arrow keys.
12633 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
12634 base_level_stop; instead, set base_level_stop to BEGV.
12635 Fixes crashes in vertical-motion.
0bb23927
EZ
12636 (next_element_from_buffer): Improve commentary for when
12637 the iterator is before prev_stop.
12638 (init_iterator): Initialize bidi_p from the default value of
12639 bidi-display-reordering, not from buffer-local value. Use the
12640 buffer-local value only if initializing for buffer iteration.
12641 (handle_invisible_prop): Support invisible properties on strings
12642 that are being bidi-reordered.
12643 (set_iterator_to_next): Support bidi reordering of C strings and
12644 Lisp strings.
12645 (next_element_from_string): Support bidi reordering of Lisp
12646 strings.
12647 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
12648 (display_string): Support display of R2L glyph rows.
12649 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
12650 (init_iterator): Don't initialize it->bidi_p for strings
12651 here.
12652 (reseat_to_string): Initialize it->bidi_p for strings here.
12653 (next_element_from_string, next_element_from_c_string)
12654 (next_element_from_buffer): Add xassert's for correspondence
12655 between IT's object being iterated and it->bidi_it.string
12656 structure.
12657 (face_before_or_after_it_pos): Support bidi iteration.
12658 (next_element_from_c_string): Handle the case of the first string
12659 character that is not the first one in the visual order.
12660 (get_visually_first_element): New function, refactored from common
12661 parts of next_element_from_buffer, next_element_from_string, and
12662 next_element_from_c_string.
12663 (tool_bar_lines_needed, redisplay_tool_bar)
12664 (display_menu_bar): Force left-to-right direction. Add a FIXME
12665 comment for making that be controlled by a user option.
12666 (push_it, pop_it): Save and restore the state of the
12667 bidi iterator. Save and restore the bidi_p flag.
12668 (pop_it): Iterate out of display property for string iteration as
12669 well.
12670 (iterate_out_of_display_property): Support iteration over strings.
12671 (handle_single_display_spec): Set up it->bidi_it for iteration
12672 over a display string, and call bidi_init_it.
12673 (handle_single_display_spec, next_overlay_string)
12674 (get_overlay_strings_1, push_display_prop): Set up the bidi
12675 iterator for displaying display or overlay strings.
12676 (forward_to_next_line_start): Don't use the shortcut if
12677 bidi-iterating.
12678 (back_to_previous_visible_line_start): If handle_display_prop
12679 pushed the iterator stack, restore the internal state of the bidi
12680 iterator by calling bidi_pop_it same number of times.
12681 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12682 and we are bidi-iterating, don't decrement the iterator position;
12683 instead, set the first_elt flag in the bidi iterator, to produce
12684 the same effect.
12685 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12686 (push_display_prop): xassert that we are iterating a buffer.
12687 (push_it, pop_it): Save and restore paragraph_embedding member.
12688 (handle_single_display_spec, next_overlay_string)
12689 (get_overlay_strings_1, reseat_1, reseat_to_string)
12690 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12691 correctly. Don't assume unibyte strings are not bidi-reordered.
12692 (compute_display_string_pos)
12693 (compute_display_string_end): Fix handling the case of C string.
12694 (push_it, pop_it): Save and restore from_disp_prop_p.
12695 (handle_single_display_spec, push_display_prop): Set the
12696 from_disp_prop_p flag.
12697 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12698 (pop_it): Call iterate_out_of_display_property only if we are
12699 popping after iteration over a string that came from a display
12700 property. Fix a typo in popping stretch info. Add an assertion
12701 for verifying that the iterator position is in sync with the bidi
12702 iterator.
12703 (handle_single_display_spec, get_overlay_strings_1)
12704 (push_display_prop): Fix initialization of paragraph direction for
12705 string when that of the parent object is not yet determined.
12706 (reseat_1): Call bidi_init_it to resync the bidi
12707 iterator with IT's position. (Bug#7616)
12708 (find_row_edges): If ROW->start.pos gives position
12709 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12710 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12711 Reset the from_disp_prop_p flag.
12712 (SAVE_IT, RESTORE_IT): New macros.
12713 (pos_visible_p, face_before_or_after_it_pos)
12714 (back_to_previous_visible_line_start)
12715 (move_it_in_display_line_to, move_it_in_display_line)
12716 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12717 (try_scrolling, redisplay_window, display_line): Use them when
12718 saving a temporary copy of the iterator and restoring it back.
12719 (back_to_previous_visible_line_start, reseat_1)
12720 (init_iterator): Empty the bidi cache "stack".
12721 (move_it_in_display_line_to): If iterator ended up at
12722 EOL, but we never saw any buffer positions smaller than
12723 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12724 motion in bidi-reordered lines.
12725 (move_it_in_display_line_to): Record prev_method and prev_pos
12726 immediately before the call to set_iterator_to_next. Fixes cursor
12727 motion in bidi-reordered lines with stretch glyphs and strings
12728 displayed in margins. (Bug#8133) (Bug#8867)
12729 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12730 TO_CHARPOS.
640c8776
SM
12731 (pos_visible_p): Support positions in bidi-reordered lines.
12732 Save and restore bidi cache.
0bb23927
EZ
12733
12734 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12735 (bidi_paragraph_info): Delete unused struct.
12736 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12737 (bidi_cache_start): New variable.
12738 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12739 to zero.
12740 (bidi_cache_fetch_state, bidi_cache_search)
12741 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12742 (bidi_cache_find, bidi_peek_at_next_level)
12743 (bidi_level_of_next_char, bidi_find_other_level_edge)
12744 (bidi_move_to_visually_next): Compare cache index with
12745 bidi_cache_start rather than with zero.
12746 (bidi_fetch_char): Accept new argument STRING; all callers
12747 changed. Support iteration over a string. Support strings with
12748 display properties. Support unibyte strings. Fix the type of
12749 `len' according to what STRING_CHAR_AND_LENGTH expects.
12750 (bidi_paragraph_init, bidi_resolve_explicit_1)
12751 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
12752 (bidi_level_of_next_char, bidi_move_to_visually_next):
12753 Support iteration over a string.
0bb23927
EZ
12754 (bidi_set_sor_type, bidi_resolve_explicit_1)
12755 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12756 can now be zero (for strings); special values 0 and -1 were
12757 changed to -1 and -2, respectively.
12758 (bidi_char_at_pos): New function.
12759 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12760 Call it instead of FETCH_MULTIBYTE_CHAR.
12761 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12762 initialized to valid values.
12763 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12764 values.
12765 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12766 the test for valid cached positions. Fix the logic for looking up
12767 the sentinel state in the cache. GCPRO the Lisp string we are
12768 iterating.
12769 (bidi_push_it, bidi_pop_it): New functions.
12770 (bidi_initialize): Initialize the bidi cache start stack pointer.
12771 (bidi_cache_ensure_space): New function, refactored from part of
12772 bidi_cache_iterator_state. Don't assume the required size is just
12773 one BIDI_CACHE_CHUNK away.
12774 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12775 (bidi_count_bytes, bidi_char_at_pos): New functions.
12776 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12777 always valid if bidi_cache_idx is valid.
12778 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12779 is valid if it's going to be used.
12780 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12781 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
12782 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12783 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
12784 (bidi_find_other_level_edge, bidi_cache_start_stack):
12785 All variables related to cache indices are now EMACS_INT.
c965adc5 12786
0bb23927
EZ
12787 * dispextern.h (struct bidi_string_data): New structure.
12788 (struct bidi_it): New member `string'. Make flag members be 1-bit
12789 fields, and put them last in the struct.
640c8776
SM
12790 (compute_display_string_pos, compute_display_string_end):
12791 Update prototypes.
0bb23927
EZ
12792 (bidi_push_it, bidi_pop_it): Add prototypes.
12793 (struct iterator_stack_entry): New members bidi_p,
12794 paragraph_embedding, and from_disp_prop_p.
12795 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
12796 (bidi_shelve_cache, bidi_unshelve_cache):
12797 Declare prototypes.
0bb23927
EZ
12798
12799 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12800 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12801 and vector-like objects.
12802
12803 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12804 cache around display iteration.
12805
12806 * window.c (Fwindow_end, window_scroll_pixel_based)
12807 (displayed_window_lines, Frecenter): Save and restore the bidi
12808 cache around display iteration.
12809
3bbd2265
LMI
128102011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12811
12812 * editfns.c (Fdelete_region): Clarify the use of the named
12813 parameters (bug#6788).
12814
adc47434
MR
128152011-07-14 Martin Rudalics <rudalics@gmx.at>
12816
12817 * indent.c (Fvertical_motion): Set and restore w->pointm when
12818 saving and restoring the window's buffer (Bug#9006).
12819
837c31f8
LMI
128202011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12821
12822 * editfns.c (Fstring_to_char): Clarify just what is returned
12823 (bug#6576). Text by Eli Zaretskii.
12824
ac389d0c
JB
128252011-07-13 Juanma Barranquero <lekktu@gmail.com>
12826
12827 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12828
0be0ce47
EZ
128292011-07-13 Eli Zaretskii <eliz@gnu.org>
12830
12831 * buffer.c (mmap_find): Fix a typo.
12832
cd18e7e3
JB
128332011-07-13 Johan Bockgård <bojohan@gnu.org>
12834
12835 Fix execution of x selection hooks.
12836 * xselect.c (Qx_lost_selection_functions)
12837 (Qx_sent_selection_functions): New vars.
12838 (syms_of_xselect): DEFSYM them.
12839 (x_handle_selection_request): Pass Qx_sent_selection_functions
12840 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12841 (x_handle_selection_clear,x_clear_frame_selections):
12842 Pass Qx_lost_selection_functions rather than
12843 Vx_lost_selection_functions to Frun_hook_with_args.
12844
47ea7f44
PE
128452011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12846
ac389d0c 12847 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
12848 The old code sometimes used this field without initializing it.
12849
47ea7f44
PE
12850 * alloc.c (gc_sweep): Don't read past end of array.
12851 In theory, the old code could also have corrupted Emacs internals,
12852 though it'd be very unlikely.
12853
bc985c87
AS
128542011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12855
12856 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 12857 argument. (Bug#4026)
bc985c87 12858
0cf34688
LMI
128592011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12860
b3dadd76
LMI
12861 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12862 key" (bug#4257).
12863
0cf34688
LMI
12864 * window.c (Fset_window_start): Doc fix (bug#4199).
12865 (Fset_window_hscroll): Ditto.
12866
270768cd
PE
128672011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12868
077e3dda 12869 Fix minor new problems caught by GCC 4.6.1.
270768cd 12870 * term.c (init_tty): Remove unused local.
490011a6 12871 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 12872 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 12873 not used otherwise.
270768cd 12874
b1f58454
CY
128752011-07-12 Chong Yidong <cyd@stupidchicken.com>
12876
12877 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12878
22b9578d
LMI
128792011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12880
6e70ab07
LMI
12881 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12882 are the mini-buffer and the echo area (bug#3320).
12883
22b9578d
LMI
12884 * term.c (init_tty): Remove support for supdup, c10 and perq
12885 terminals, which are no longer supported (bug#1482).
12886
8974cc9f
JB
128872011-07-10 Johan Bockgård <bojohan@gnu.org>
12888
12889 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12890
a560d974
JD
128912011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12892
12893 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12894 for non-popups (Bug#3642).
12895
1dae0f0a
AS
128962011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12897
268c2c36 12898 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 12899 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
12900 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12901 * cm.c (losecursor): Likewise.
1dae0f0a
AS
12902 * data.c (fmod): Likewise.
12903 * dispnew.c (swap_glyphs_in_rows): Likewise.
12904 * emacs.c (memory_warning_signal): Likewise.
12905 * floatfns.c (float_error): Likewise.
12906 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12907 (otf_open, font_otf_capability, generate_otf_features)
12908 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12909 Likewise.
12910 * image.c (pbm_read_file): Likewise.
12911 * indent.c (string_display_width): Likewise.
12912 * intervals.c (check_for_interval, search_for_interval)
12913 (inc_interval_count, count_intervals, root_interval)
12914 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12915 * lread.c (defalias): Likewise.
268c2c36 12916 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
12917 * regex.c (set_image_of_range_1, set_image_of_range)
12918 (regex_grow_registers): Likewise.
12919 * sysdep.c (strerror): Likewise.
12920 * termcap.c (valid_filename_p, tprint, main): Likewise.
12921 * tparam.c (main): Likewise.
12922 * unexhp9k800.c (run_time_remap, save_data_space)
12923 (update_file_ptrs, read_header, write_header, calculate_checksum)
12924 (copy_file, copy_rest, display_header): Likewise.
12925 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12926 Likewise.
12927 * xdisp.c (check_it): Likewise.
12928 * xfaces.c (register_color, unregister_color, unregister_colors):
12929 Likewise.
12930 * xfns.c (print_fontset_result): Likewise.
12931 * xrdb.c (member, fatal, main): Likewise.
12932
99033785
PE
129332011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12934
12935 Fix minor problems found by static checking (Bug#9031).
12936 * chartab.c (char_table_set_range, map_sub_char_table):
12937 Remove unused locals.
12938 (uniprop_table): Now static.
12939 * composite.c (_work_char): Remove unused static var.
12940
9cb2ac56
JB
129412011-07-09 Juanma Barranquero <lekktu@gmail.com>
12942
12943 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12944
f25661f0
JD
129452011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12946
12947 * gtkutil.c (qttip_cb): Remove code without function.
12948
8278c4fe
EZ
129492011-07-09 Eli Zaretskii <eliz@gnu.org>
12950
12951 * w32.c (pthread_sigmask): New stub.
12952
1692ae2d 129532011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 12954
8a6ebd58 12955 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
12956 sigprocmask is portable only for single-threaded applications, and
12957 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
12958 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12959 (LIBES): Use it.
12960 * callproc.c (Fcall_process):
12961 * process.c (create_process):
12962 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12963 Use pthread_sigmask, not sigprocmask.
123403e4 12964
1b854618
JD
129652011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12966
12967 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12968 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12969 wrong (Bug#8591).
12970
3fe4b549
JD
129712011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12972
0ce7e563
JD
12973 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12974 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12975 (xg_hide_tooltip): Fix comment.
12976
3fe4b549
JD
12977 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12978 in registerServicesMenuSendTypes.
12979 (validRequestorForSendType): Don't check ns_return_types.
12980
12981 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12982 ns_return_type.
12983
5df75e47
JR
129842011-07-08 Jason Rumney <jasonr@gnu.org>
12985
22610910
JR
12986 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12987 SH_SHOW for hidden windows (Bug#5482).
12988
5df75e47
JR
12989 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12990 frame struct members of non-existent frames (Bug#6284).
12991
699c10bd
JD
129922011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12993
4393663b
JD
12994 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12995 variable firstTime not needed on OSX >= 10.6.
12996 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12997 >= 10.5. Use setKnobProportion, setDoubleValue.
12998
12999 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13000 (MAC_OS_X_VERSION_10_5): Define if not defined.
13001 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13002 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13003 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13004
13005 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 13006 cString and lossyCString on OSX >= 10.4.
4393663b 13007
58179cce 13008 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
13009 sizeToFit on OSX >= 10.2.
13010
13011 * nsimage.m (allocInitFromFile): Don't use deprecated method
13012 bestRepresentationForDevice on OSX >= 10.6.
13013
13014 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
13015 to avoid warning.
13016
13017 * emacs.c: Declare unexec_init_emacs_zone.
13018
a63e0781
JD
13019 * nsgui.h: Fix compiler warning about gnulib redefining verify.
13020
699c10bd
JD
13021 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
13022
13023 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13024 on svcsMenu (Bug#8842).
13025
13026 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13027 ns_return_types.
13028 (Fns_list_services): Just return Qnil on 10.6, code not working there.
13029
13030 * nsterm.m (QUTF8_STRING): Declare.
13031 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13032 (validRequestorForSendType): Return type is (id).
13033 Change indexOfObjectIdenticalTo to indexOfObject.
13034 Check if we have local selection before returning self (Bug#8842).
13035 (writeSelectionToPasteboard): Put local selection into paste board
13036 if we have a local selection (Bug#8842).
13037 (syms_of_nsterm): DEFSYM QUTF8_STRING.
13038
13039 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13040 (ns_get_local_selection): Declare.
13041
54e10184
LMI
130422011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
13043
9888ff71
LMI
13044 * keymap.c (describe_map_tree): Don't insert a double newline at
13045 the end of the buffer (bug#1169) and return whether we inserted
13046 something.
13047
54e10184
LMI
13048 * callint.c (Fcall_interactively): Change "reading args" to
13049 "providing args" to try to clarify what it does (bug#1010).
13050
15fa4783
KH
130512011-07-07 Kenichi Handa <handa@m17n.org>
13052
13053 * composite.c (composition_compute_stop_pos): Ignore a static
13054 composition starting before CHARPOS (Bug#8915).
13055
13056 * xdisp.c (handle_composition_prop): Likewise.
13057
a8815b00
EZ
130582011-07-07 Eli Zaretskii <eliz@gnu.org>
13059
13060 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13061 (Bug#9015)
13062
ef7b981d 130632011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
13064
13065 * character.h (unicode_category_t): New enum type.
13066
13067 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13068 (Qchar_code_property_table): New variable.
13069 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13070 (UNIPROP_COMPRESSED_FORM_P): New macros.
13071 (char_table_ascii): Uncompress the compressed values.
13072 (sub_char_table_ref): New arg is_uniprop. Callers changed.
13073 Uncompress the compressed values.
ac389d0c 13074 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
13075 (char_table_ref_and_range): Uncompress the compressed values.
13076 (sub_char_table_set): New arg is_uniprop. Callers changed.
13077 Uncompress the compressed values.
13078 (sub_char_table_set_range): Args changed. Callers changed.
13079 (char_table_set_range): Adjuted for the above change.
13080 (map_sub_char_table): Delete args default_val and parent. Add arg
13081 top. Give decoded values to a Lisp function.
640c8776 13082 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
13083 values to a Lisp function. Gcpro more variables.
13084 (uniprop_table_uncompress)
13085 (uniprop_decode_value_run_length): New functions.
13086 (uniprop_decoder, uniprop_decoder_count): New variables.
13087 (uniprop_get_decoder, uniprop_encode_value_character)
13088 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13089 New functions.
13090 (uniprop_encoder, uniprop_encoder_count): New variables.
13091 (uniprop_get_encoder, uniprop_table)
13092 (Funicode_property_table_internal, Fget_unicode_property_internal)
13093 (Fput_unicode_property_internal): New functions.
13094 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13095 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 13096 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
13097 char-code-property-alist.
13098
640c8776 13099 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
13100 Vunicode_category_table.
13101
640c8776 13102 * font.c (font_range): Adjust for the change of
c805dec0
KH
13103 Vunicode_category_table.
13104
76b397fb
DN
131052011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13106
13107 * m/iris4d.h: Remove file, move contents ...
13108 * s/irix6-5.h: ... here.
13109
22b4128e
PE
131102011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13111
13112 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
13113 * alloc.c (mark_buffer):
13114 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13115 (clone_per_buffer_values): Don't assume that
22b4128e
PE
13116 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13117 This isn't true in general, and it's particularly not true
13118 if Emacs is configured with --with-wide-int.
13119 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13120 New macros, used in the buffer.c change.
13121
869795d6
JD
131222011-07-05 Jan Djärv <jan.h.d@swipnet.se>
13123
13124 * xsettings.c: Use both GConf and GSettings if both are available.
13125 (store_config_changed_event): Add comment.
13126 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13127 (store_tool_bar_style_changed): New functions.
5e617bc2 13128 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
13129 (struct xsettings): Move font inside HAVE_XFT.
13130 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 13131 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 13132 Move inside HAVE_XFT.
640c8776 13133 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
13134 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13135 also.
13136 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 13137 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 13138 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
13139 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13140 (parse_settings): Move check for font inside HAVE_XFT.
13141 (read_settings, apply_xft_settings): Add comment.
13142 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
13143 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
13144 call store_font_name_changed.
13145 (xft_settings_event): Add comment.
13146 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
13147 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
13148 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
13149 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
13150 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
13151 (xsettings_get_system_font, xsettings_get_system_normal_font):
13152 Add comment.
869795d6 13153
d8ed26bd
PE
131542011-07-05 Paul Eggert <eggert@cs.ucla.edu>
13155
13156 Random fixes. E.g., (random) never returned negative values.
13157 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
13158 subseconds part to the entropy, as that's a bit more random.
13159 Prefer signed to unsigned, since the signedness doesn't matter and
13160 in general we prefer signed. When given a limit, use a
13161 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
13162 latter isn't right if USE_2_TAGS_FOR_INTS.
13163 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
13164 not 0..VALMASK. Don't discard "excess" bits that random () returns.
13165
cabf1cac
SM
131662011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
13167
13168 * textprop.c (text_property_stickiness):
13169 Obey Vtext_property_default_nonsticky.
13170 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
13171 * w32fns.c (syms_of_w32fns):
13172 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
13173
6e9b2be9
PE
131742011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13175
13176 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
13177 This is more efficient than Ffile_directory_p and avoids a minor race.
13178
90186c68
LMI
131792011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
13180
7c301272
LMI
13181 * buffer.c (Foverlay_put): Say what the return value is
13182 (bug#7835).
13183
c4f2d8d4
LMI
13184 * fileio.c (barf_or_query_if_file_exists): Check first if the file
13185 is a directory before asking whether to use the file name
13186 (bug#7564).
ad637907
LMI
13187 (barf_or_query_if_file_exists): Make the "File is a directory"
13188 error be more correct.
c4f2d8d4 13189
90186c68
LMI
13190 * fns.c (Frequire): Remove the mention of the .gz files, since
13191 that's installation-specific, but keep the mention of
13192 `get-load-suffixes'.
13193
da64016e
PE
131942011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13195
13196 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
13197 Report string overflow if the output is too long.
13198
7d47b580
JB
131992011-07-04 Juanma Barranquero <lekktu@gmail.com>
13200
a555cb87
JB
13201 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
13202 (syms_of_gnutls): Remove duplicate DEFSYM for
13203 Qgnutls_bootprop_verify_hostname_error, an error for
13204 Qgnutls_bootprop_verify_error (which is no longer used).
13205
7d47b580
JB
13206 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13207 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
13208 Also (re)move comments that are misplaced or no longer relevant.
13209
1e49bfab
LMI
132102011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13211
13212 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13213
1485f4c0
CY
132142011-07-03 Chong Yidong <cyd@stupidchicken.com>
13215
13216 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13217 and background color parameters if they have been changed.
13218
a9ab721e
LMI
132192011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13220
13221 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13222
cf7cff57
PE
132232011-07-03 Paul Eggert <eggert@cs.ucla.edu>
13224
2e13213d
PE
13225 * xsettings.c (SYSTEM_FONT): Define only when used.
13226 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13227
cf7cff57
PE
13228 * keymap.c (access_keymap_1): Now static.
13229
7a8e04f7
CY
132302011-07-02 Chong Yidong <cyd@stupidchicken.com>
13231
13232 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13233 leave any prefix arg for the up event (Bug#1586).
13234
61352f62
LMI
132352011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
13236
69bb1ef7
LMI
13237 * lread.c (syms_of_lread): Mention single symbols defined by
13238 `defvar' or `defconst' (bug#7154).
13239
61352f62 13240 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 13241 (Frequire): Mention get-load-suffixes.
61352f62 13242
28545e04
MR
132432011-07-02 Martin Rudalics <rudalics@gmx.at>
13244
13245 * window.h (window): Remove clone_number slot.
13246 * window.c (Fwindow_clone_number, Fset_window_clone_number):
13247 Remove.
13248 (make_parent_window, make_window, saved_window)
13249 (Fset_window_configuration, save_window_save): Don't deal with
13250 clone numbers.
13251 * buffer.c (Qclone_number): Remove declaration.
13252 (sort_overlays, overlay_strings): Don't deal with clone numbers.
13253
3349e122
SM
132542011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
13255
13256 Add multiple inheritance to keymaps.
13257 * keymap.c (Fmake_composed_keymap): New function.
13258 (Fset_keymap_parent): Simplify.
13259 (fix_submap_inheritance): Remove.
13260 (access_keymap_1): New function extracted from access_keymap to handle
13261 embedded parents and handle lists of maps.
13262 (access_keymap): Use it.
13263 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13264 (Fcopy_keymap): Handle embedded parents.
13265 (Fcommand_remapping, define_as_prefix): Simplify.
13266 (Fkey_binding): Simplify.
13267 (syms_of_keymap): Move minibuffer-local-completion-map,
13268 minibuffer-local-filename-completion-map,
13269 minibuffer-local-must-match-map, and
13270 minibuffer-local-filename-must-match-map to Elisp.
13271 (syms_of_keymap): Defsubr make-composed-keymap.
13272 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13273 (parse_menu_item): Trivial simplification.
13274
3279eb87
GM
132752011-07-01 Glenn Morris <rgm@gnu.org>
13276
13277 * Makefile.in (SETTINGS_LIBS): Fix typo.
13278
39cb9e56 132792011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
13280
13281 * coding.c (Fencode_coding_string): Record the last coding system
13282 used, as the function doc string says (bug#8738).
13283
0949d2b6
JD
132842011-07-01 Jan Djärv <jan.h.d@swipnet.se>
13285
13286 * xsettings.c (store_monospaced_changed): Take new font as arg and
13287 check for change against current_mono_font.
13288 (EMACS_TYPE_SETTINGS): Remove this and related defines.
13289 (emacs_settings_constructor, emacs_settings_get_property)
13290 (emacs_settings_set_property, emacs_settings_class_init)
13291 (emacs_settings_init, gsettings_obj): Remove.
13292 (something_changedCB): New function for HAVE_GSETTINGS.
13293 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13294 with value as argument.
13295 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
13296 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 13297 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
13298 "changed".
13299
13300 * xgselect.c: Add defined (HAVE_GSETTINGS).
13301 (xgselect_initialize): Ditto.
13302
13303 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
13304 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
13305 xg_select.
13306
bbc6b304
PE
133072011-07-01 Paul Eggert <eggert@cs.ucla.edu>
13308
13309 * eval.c (struct backtrace): Simplify and port the data structure.
13310 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
13311 signed bit field, as this assumption is not portable and it makes
13312 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
13313 "char debug_on_exit : 1" as this is not portable either; instead,
13314 use the portable "unsigned int debug_on_exit : 1". Remove unused
13315 member evalargs. Remove obsolete comments about cc bombing out.
13316
9851bfc5
JD
133172011-06-30 Jan Djärv <jan.h.d@swipnet.se>
13318
51bb811f 13319 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
13320 Let HAVE_GSETTINGS override HAVE_GCONF.
13321 (store_monospaced_changed): New function.
13322 (EMACS_SETTINGS): A new type derived from GObject to handle
13323 GSettings notifications.
13324 (emacs_settings_constructor, emacs_settings_get_property)
13325 (emacs_settings_set_property, emacs_settings_class_init):
13326 New functions.
13327 (gsettings_client, gsettings_obj): New variables.
13328 (GSETTINGS_SCHEMA): New define.
13329 (something_changedCB): Call store_monospaced_changed.
13330 (init_gsettings): New function.
13331 (xsettings_initialize): Call init_gsettings.
13332 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13333 to NULL.
13334
640c8776 13335 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
13336 GCONF_CFLAGS/LIBS.
13337
5386012d
MR
133382011-06-29 Martin Rudalics <rudalics@gmx.at>
13339
13340 * window.c (resize_root_window, grow_mini_window)
13341 (shrink_mini_window): Rename Qresize_root_window to
13342 Qwindow_resize_root_window and Qresize_root_window_vertically to
13343 Qwindow_resize_root_window_vertically.
13344
f13e0b08
PE
133452011-06-28 Paul Eggert <eggert@cs.ucla.edu>
13346
13347 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13348
94515237
JB
133492011-06-27 Juanma Barranquero <lekktu@gmail.com>
13350
13351 * makefile.w32-in: Redesign dependencies so they reflect more
13352 clearly which files are directly included by each source file,
13353 and not through other includes.
13354
e43b6e43
MR
133552011-06-27 Martin Rudalics <rudalics@gmx.at>
13356
13357 * buffer.c (Qclone_number): Declare static and DEFSYM it.
13358 (sort_overlays, overlay_strings): When an overlay's clone number
13359 matches the window's clone number process the overlay even if
13360 the overlay's window property doesn't match the current window.
13361
d68443dc
MR
13362 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13363 (Fwindow_hchild): Rename to Fwindow_left_child.
13364 (Fwindow_next): Rename to Fwindow_next_sibling.
13365 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
13366 (resize_window_check): Rename to window_resize_check.
13367 (resize_window_apply): Rename to window_resize_apply.
13368 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13369 (Fdelete_other_windows_internal, resize_frame_windows)
13370 (Fsplit_window_internal, Fdelete_window_internal)
13371 (grow_mini_window, shrink_mini_window)
13372 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 13373
c7e73be5
JD
133742011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13375
13376 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13377 (emacs_fixed_set_min_size): Remove.
13378 (emacs_fixed_new): Take frame as argument.
13379
13380 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13381 (_EmacsFixedPrivate): Remove minwidth/height.
13382 Add struct frame *f.
13383 (emacs_fixed_init): Initialize priv->f.
13384 (get_parent_class, emacs_fixed_set_min_size): Remove.
13385 (emacs_fixed_new): Set priv->f to argument.
13386 (emacs_fixed_get_preferred_width)
13387 (emacs_fixed_get_preferred_height): Use min_width/height from
13388 frames size_hint to set minimum and natural (Bug#8919).
13389 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13390 and use min_width/height from frames size_hint to set
13391 min_width/height (Bug#8919).
13392
13393 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
13394 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13395 Fix indentation.
c7e73be5 13396
cf99dcf8
EZ
133972011-06-26 Eli Zaretskii <eliz@gnu.org>
13398
13399 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13400 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13401 called at ZV.
13402
029529ac
CY
134032011-06-26 Chong Yidong <cyd@stupidchicken.com>
13404
13405 * process.c (wait_reading_process_output): Bypass select if
13406 waiting for a cell while ignoring keyboard input, and input is
13407 pending. Suggested by Jan Djärv (Bug#8869).
13408
7a7ef429
PE
134092011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13410
13411 Use gnulib's dup2 module instead of rolling our own.
13412 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13413
11fdef7d 134142011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
13415
13416 * dispnew.c (scrolling_window): Before scrolling, turn off a
13417 mouse-highlight in the window being scrolled.
13418
cd3520a4
JB
134192011-06-24 Juanma Barranquero <lekktu@gmail.com>
13420
13421 Move DEFSYM to lisp.h and use everywhere.
13422
13423 * character.h (DEFSYM): Move declaration...
13424 * lisp.h (DEFSYM): ...here.
13425
13426 * gnutls.c:
13427 * minibuf.c:
13428 * w32menu.c:
13429 * w32proc.c:
13430 * w32select.c: Don't include character.h.
13431
13432 * alloc.c (syms_of_alloc):
13433 * buffer.c (syms_of_buffer):
13434 * bytecode.c (syms_of_bytecode):
13435 * callint.c (syms_of_callint):
13436 * casefiddle.c (syms_of_casefiddle):
13437 * casetab.c (init_casetab_once):
13438 * category.c (init_category_once, syms_of_category):
13439 * ccl.c (syms_of_ccl):
13440 * cmds.c (syms_of_cmds):
13441 * composite.c (syms_of_composite):
13442 * dbusbind.c (syms_of_dbusbind):
13443 * dired.c (syms_of_dired):
13444 * dispnew.c (syms_of_display):
13445 * doc.c (syms_of_doc):
13446 * editfns.c (syms_of_editfns):
13447 * emacs.c (syms_of_emacs):
13448 * eval.c (syms_of_eval):
13449 * fileio.c (syms_of_fileio):
13450 * fns.c (syms_of_fns):
13451 * frame.c (syms_of_frame):
13452 * fringe.c (syms_of_fringe):
13453 * insdel.c (syms_of_insdel):
13454 * keymap.c (syms_of_keymap):
13455 * lread.c (init_obarray, syms_of_lread):
13456 * macros.c (syms_of_macros):
13457 * msdos.c (syms_of_msdos):
13458 * print.c (syms_of_print):
13459 * process.c (syms_of_process):
13460 * search.c (syms_of_search):
13461 * sound.c (syms_of_sound):
13462 * syntax.c (init_syntax_once, syms_of_syntax):
13463 * terminal.c (syms_of_terminal):
13464 * textprop.c (syms_of_textprop):
13465 * undo.c (syms_of_undo):
13466 * w32.c (globals_of_w32):
13467 * window.c (syms_of_window):
13468 * xdisp.c (syms_of_xdisp):
13469 * xfaces.c (syms_of_xfaces):
13470 * xfns.c (syms_of_xfns):
13471 * xmenu.c (syms_of_xmenu):
13472 * xsettings.c (syms_of_xsettings):
13473 * xterm.c (syms_of_xterm): Use DEFSYM.
13474
4228cf16
TZ
134752011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13476
cd3520a4 13477 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 13478
7fcccf1e
PE
134792011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13480
7efb4e0e
PE
13481 Integer and buffer overflow fixes (Bug#8873).
13482
ff5844ad
PE
13483 * print.c (printchar, strout): Check for string overflow.
13484 (PRINTPREPARE, printchar, strout):
13485 Don't set size unless allocation succeeds.
13486
90532f02
PE
13487 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13488 for sizes. Check for string overflow more accurately.
13489 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13490
6d84508d
PE
13491 * macros.c: Integer and buffer overflow fixes.
13492 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13493 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13494 Use ptrdiff_t, not int, for sizes.
13495 Don't increment bufsize until after realloc succeeds.
13496 Check for size-calculation overflow.
13497 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13498
437b2cb4
PE
13499 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13500
8b9ac8b4
PE
13501 * lread.c: Integer overflow fixes.
13502 (read_integer): Radix is now EMACS_INT, not int,
13503 to improve quality of diagnostics for out-of-range radices.
13504 Calculate buffer size correctly for out-of-range radices.
13505 (read1): Check for integer overflow in radices, and in
13506 read-circle numbers.
82cb60d3
PE
13507 (read_escape): Avoid int overflow.
13508 (Fload, openp, read_buffer_size, read1)
13509 (substitute_object_recurse, read_vector, read_list, map_obarray):
13510 Use ptrdiff_t, not int, for sizes.
13511 (read1): Use EMACS_INT, not int, for sizes.
20270765 13512 Check for size overflow.
8b9ac8b4 13513
7fcccf1e
PE
13514 * image.c (cache_image): Check for size arithmetic overflow.
13515
bfbbd7e7
PE
13516 * lread.c: Integer overflow issues.
13517 (saved_doc_string_size, saved_doc_string_length)
13518 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13519 Now ptrdiff_t, not int.
13520 (read1): Don't assume doc string length fits in int. Check for
13521 out-of-range doc string lengths.
13522 (read_list): Don't assume file position fits in int.
39019e54 13523 (read_escape): Check for hex character overflow.
bfbbd7e7 13524
4e323265
LL
135252011-06-22 Leo Liu <sdl.web@gmail.com>
13526
13527 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13528 Move to minibuffer.el.
13529
85fece3e
PE
135302011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13531
20b84ce9 13532 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
13533 The following patches are for when GLYPH_DEBUG && !XASSERT.
13534 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13535 * dispnew.c (flush_stdout):
13536 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13537 Mark as externally visible.
13538 * dispnew.c (check_window_matrix_pointers): Now static.
13539 * dispnew.c (window_to_frame_vpos):
13540 * xfns.c (unwind_create_frame):
13541 * xterm.c (x_check_font): Remove unused local.
13542 * scroll.c (CHECK_BOUNDS):
13543 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13544 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13545 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13546 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13547 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13548 Now static.
13549 (debug_method_add): Use va_list and vsprintf rather than relying
13550 on undefined behavior with wrong number of arguments.
13551 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13552 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13553 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13554 since we're not interested in debugging glyphs with old libraries.
13555 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13556 GCC 4.6.0's static checking.
13557
0766b489
PE
135582011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13559
31fd4b32
PE
13560 Integer overflow and signedness fixes (Bug#8873).
13561 A few related buffer overrun fixes, too.
13562
b79e8648
PE
13563 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13564
0766b489
PE
13565 * dispextern.h (struct face.stipple):
13566 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13567 (x_bitmap_mask, x_allocate_bitmap_record)
13568 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13569 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13570 (x_create_bitmap_from_xpm_data):
13571 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13572 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13573 (.bitmaps_last):
13574 * xfaces.c (load_pixmap):
13575 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13576 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13577 (.bitmaps_last, struct x_output.icon_bitmap):
13578 Use ptrdiff_t, not int, for bitmap indexes.
13579 (x_allocate_bitmap_record): Check for size overflow.
13580 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13581
b081724f
PE
13582 Use ptrdiff_t, not int, for overlay counts.
13583 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13584 * editfns.c (overlays_around, get_pos_property):
13585 * textprop.c (get_char_property_and_overlay):
13586 * xdisp.c (next_overlay_change, note_mouse_highlight):
13587 * xfaces.c (face_at_buffer_position):
21514da7
PE
13588 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13589 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13590 (Fnext_overlay_change, Fprevious_overlay_change)
13591 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 13592 Use ptrdiff_t, not int, for sizes.
21514da7 13593 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 13594
3de73e5e
PE
13595 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13596
2606c57b
PE
13597 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13598 (x_session_initialize): Do not assume string length fits in int.
13599
aaafe47a
PE
13600 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13601 This is unlikely, but can occur if DPI is outlandish.
13602
2674ddc8 13603 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
13604 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13605
28154962
PE
13606 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13607 * xrdb.c (magic_file_p, search_magic_path):
13608 Omit last arg SUFFIX; it was always 0. All callers changed.
13609 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13610
7de51af5
PE
13611 * xfont.c (xfont_match): Avoid need for strlen.
13612
25ed6cc3
PE
13613 * xfns.c: Don't assume strlen fits in int.
13614 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13615
4eab31dd
PE
13616 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13617 not unsigned long, as we prefer signed integers. All callers changed.
13618 Detect integer overflow in repeat count.
13619 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 13620 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 13621
171e2a58
PE
13622 * termcap.c: Don't assume sizes fit in int and never overflow.
13623 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13624 (gobble_line): Check for size-calculation overflow.
13625
ad39faca 13626 * minibuf.c (Fread_buffer):
6e5bb2dc 13627 * lread.c (intern, intern_c_string):
74ca2eb3
PE
13628 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13629 Don't assume string length fits in int.
13630
52c61c22 13631 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
13632 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13633
b5b8c9e5
PE
13634 * font.c: Don't assume string length fits in int.
13635 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13636 Use ptrdiff_t, not int.
ccd6111c
PE
13637 (font_intern_prop): Don't assume string length fits in int.
13638 Don't assume integer property fits in fixnum.
13639 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 13640
882f0d81 13641 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 13642 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
13643 Reformulate so as not to need the command string.
13644 Invoke gzip -cd rather than gunzip, as it's more portable.
13645 (lock_info_type, lock_file_1, lock_file):
13646 Don't assume pid_t and time_t fit in unsigned long.
13647 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13648 (current_lock_owner): Prefer signed type for sizes.
13649 Use memcpy, not strncpy, where memcpy is what is really wanted.
13650 Don't assume (via atoi) that time_t and pid_t fit in int.
13651 Check for time_t and/or pid_t out of range, e.g., via a network share.
13652 Don't alloca where an auto var works fine.
13653
93f4cf88
PE
13654 * fileio.c: Fix some integer overflow issues.
13655 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13656 Don't assume string length fits in int.
13657 (directory_file_name): Don't assume string length fits in long.
13658 (make_temp_name): Don't assume pid fits in int, or that its print
13659 length is less than 20.
13660
f3e92b69
PE
13661 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13662
1bfdaf10
PE
13663 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13664
35016e9a
PE
13665 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13666
3d1e65a1
PE
13667 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13668 We prefer signed integers, even for size calculations.
13669
0b963a93
PE
13670 * emacs.c: Don't assume string length fits in 'int'.
13671 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13672 (main): Don't invoke strlen when not needed.
13673
573f4b54
PE
13674 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13675 (XD_DEBUG_MESSAGE): Don't waste a byte.
13676
989f33ba
PE
13677 * callproc.c (getenv_internal_1, getenv_internal)
13678 (Fgetenv_internal):
965d34eb
PE
13679 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13680
e4d29b33
PE
13681 * lread.c (invalid_syntax): Omit length argument.
13682 All uses changed. This doesn't fix a bug, but it simplifies the
13683 code away from its former Hollerith-constant appearance, and it's
13684 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 13685 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 13686
eb49b136
PE
13687 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13688 This didn't break anything, but it didn't help either.
13689 It's confusing to put a bogus integer in a place where the actual
13690 value does not matter.
9f62aeb1 13691 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 13692 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 13693
15375a22
PE
13694 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13695 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13696 implementation.
b61cc01c
PE
13697 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13698 We prefer signed types, and the value cannot exceed the EMACS_INT
13699 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
13700 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13701 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13702 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 13703
53b2623d
PE
13704 * indent.c (sane_tab_width): New function.
13705 (current_column, scan_for_column, Findent_to, position_indentation)
13706 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 13707 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 13708
51cab52b 13709 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 13710
f2ed8a70
PE
13711 * lisp.h (lint_assume): New macro.
13712 * composite.c (composition_gstring_put_cache):
13713 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13714
abe80cc6
PE
13715 * editfns.c, insdel.c:
13716 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 13717
b02c740e
PE
13718 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13719
ebc96716
PE
13720 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13721
b4e50fa0 13722 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 13723 Use much-faster test for byte-length change.
311d5d7c 13724 Don't assume string byte-length fits in 'int'.
a4cf38e4 13725 Check that character arg fits in 'int'.
85461888 13726 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 13727
c0c1ee9f
PE
13728 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13729
a498d7f4
PE
13730 * fns.c (concat): Catch string overflow earlier.
13731 Do not rely on integer wraparound.
13732
51cab52b
PE
13733 * dispextern.h (struct it.overlay_strings_charpos)
13734 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
13735 * xdisp.c (forward_to_next_line_start)
13736 (back_to_previous_visible_line_start)
13737 (reseat_at_next_visible_line_start, next_element_from_buffer):
13738 Don't arbitrarily truncate the value of 'selective' to int.
13739
76031fad
PE
13740 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13741
5eb55db9
PE
13742 * composite.c: Don't truncate sizes to 'int'.
13743 (composition_gstring_p, composition_reseat_it)
13744 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
13745 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13746 not EMACS_UINT, for indexes.
5eb55db9 13747
0703a717
PE
13748 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13749
d6202519
PE
13750 * buffer.c: Include <verify.h>.
13751 (struct sortvec.priority, struct sortstr.priority):
8961a454 13752 Now EMACS_INT, not int.
c20998a7 13753 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
13754 (struct sortstr.size, record_overlay_string)
13755 (struct sortstrlist.size, struct sortlist.used):
13756 Don't truncate size to int.
13757 (record_overlay_string): Check for size-calculation overflow.
d6202519 13758 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 13759
d5a19415
JM
137602011-06-22 Jim Meyering <meyering@redhat.com>
13761
029529ac 13762 Don't leak an XBM-image-sized buffer
d5a19415
JM
13763 * image.c (xbm_load): Free the image buffer after using it.
13764
a9041e6c
PE
137652011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13766
13767 Port to Sun C.
13768 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13769 that Sun C diagnosed.
13770 * fns.c (secure_hash): Fix pointer signedness issue.
13771 * intervals.c (static_offset_intervals): New function.
13772 (offset_intervals): Use it.
13773
7f3f739f
LL
137742011-06-21 Leo Liu <sdl.web@gmail.com>
13775
13776 * deps.mk (fns.o):
13777 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13778 sha512.h.
13779
13780 * fns.c (secure_hash): Rename from crypto_hash_function and change
13781 the first arg to accept symbols.
5b66d427 13782 (Fsecure_hash): New primitive.
7f3f739f
LL
13783 (syms_of_fns): New symbols.
13784
76147d94
DD
137852011-06-20 Deniz Dogan <deniz@dogan.se>
13786
13787 * process.c (Fset_process_buffer): Clarify return value in
13788 docstring.
13789
7d7d0045
CY
137902011-06-18 Chong Yidong <cyd@stupidchicken.com>
13791
13792 * dispnew.c (add_window_display_history): Use BVAR.
13793
13794 * xdisp.c (debug_method_add): Use BVAR.
13795 (check_window_end, dump_glyph_matrix, dump_glyph)
13796 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13797
13798 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13799 Likewise.
13800
13801 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13802 check till after the cache is created in init_frame_faces.
13803
ff2bc410
SM
138042011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13805
13806 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13807
28177add
PE
138082011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13809
dd3482fe
PE
13810 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13811 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13812 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13813
393d71f3 13814 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
13815 * fileio.c (Finsert_file_contents):
13816 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13817 Remove the old (too-loose) buffer overflow checks.
13818 They weren't needed, since make_gap checks for buffer overflow.
13819 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13820 The old code merely checked for Emacs fixnum overflow, and relied
13821 on undefined (wraparound) behavior. The new code avoids undefined
13822 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13823
2e6813b0 13824 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
13825 Tune. Don't use wider integers than needed. Don't use alloca.
13826 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 13827
599a9e4f
PE
13828 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13829
99561444
PE
13830 * insdel.c, lisp.h (buffer_overflow): New function.
13831 (insert_from_buffer_1, replace_range, replace_range_2):
13832 * insdel.c (make_gap_larger):
13833 * editfns.c (Finsert_char):
13834 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13835
28177add
PE
13836 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13837
e69dafad
PE
138382011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13839
4baa020d 13840 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 13841
b1c46f02
PE
13842 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13843 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13844
e69dafad
PE
13845 * fileio.c: Don't assume EMACS_INT fits in off_t.
13846 (emacs_lseek): New static function.
13847 (Finsert_file_contents, Fwrite_region): Use it.
13848 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13849
566684ea
PE
13850 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13851
e6966cd6
PE
13852 * fns.c: Don't overflow int when computing a list length.
13853 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13854 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13855 truncation on 64-bit hosts. Check for QUIT every
13856 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13857 faster and is responsive enough.
13858 (Flength): Report an error instead of overflowing an integer.
13859 (Fsafe_length): Return a float if the value is not representable
13860 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 13861 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 13862 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 13863
dd0b0efb
PE
13864 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13865 (header_size, word_size): New constants.
13866 (allocate_vectorlike): Don't check size overflow here.
13867 (allocate_vector): Check it here instead, since this is the only
13868 caller of allocate_vectorlike that could cause overflow.
13869 Check that the new vector's length is representable as a fixnum.
13870
86fe5cfe
PE
13871 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13872 The previous code was bogus. For example, next_almost_prime (32)
13873 returned 39, which is undesirable as it is a multiple of 3; and
13874 next_almost_prime (24) returned 25, which is a multiple of 5 so
13875 why was the code bothering to check for multiples of 7?
13876
80e88859
PE
13877 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13878
4a2f0ad6
PE
13879 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13880
f66c7cf8
PE
13881 Variadic C functions now count arguments with ptrdiff_t.
13882 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13883 Back then I didn't know that the Emacs coding style prefers signed int.
13884 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
13885 were being counted with int, which may truncate counts on 64-bit
13886 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
13887 * lisp.h (struct Lisp_Subr.function.aMANY)
13888 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13889 Arg counts are now ptrdiff_t, not size_t.
13890 All variadic functions and their callers changed accordingly.
13891 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13892 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13893 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13894 * callint.c (Fcall_interactively): Check arg count for overflow,
13895 to avoid potential buffer overrun. Use signed char, not 'int',
13896 for 'varies' array, so that we needn't bother to check its size
13897 calculation for overflow.
13898 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13899 * eval.c (apply_lambda):
13900 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13901 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13902 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13903
a1759b76
PE
13904 * callint.c (Fcall_interactively): Don't use index var as event count.
13905
d96be9fc
PE
13906 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13907 * mem-limits.h (SIZE): Remove; no longer used.
13908
a690a978 13909 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 13910
578c21e6
PE
13911 Remove unnecessary casts.
13912 * xterm.c (x_term_init):
13913 * xfns.c (x_set_border_pixel):
13914 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13915 These aren't needed now that we assume ANSI C.
13916
96f53c6c
PE
13917 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13918 It's more likely to cause problems (due to unsigned overflow)
13919 than to cure them.
13920
83c77d31
PE
13921 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13922
ee2079f1
PE
13923 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13924
6da65536
PE
13925 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13926
7147c4a4
PE
13927 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13928
193e32d9
PE
13929 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13930
e5533da6
PE
13931 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13932
9910e595
PE
13933 GLYPH_CODE_FACE returns EMACS_INT, not int.
13934 * dispextern.h (merge_faces):
13935 * xfaces.c (merge_faces):
01103c44
PE
13936 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13937 Don't assume EMACS_INT fits in int.
9910e595 13938
2638320e
PE
13939 * character.h (CHAR_VALID_P): Remove unused parameter.
13940 * fontset.c, lisp.h, xdisp.c: All uses changed.
13941
045eb8d9
PE
13942 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13943
c1f134b5
PE
13944 * fns.c (concat): Minor tuning based on overflow analysis.
13945 This doesn't fix any bugs. Use int to hold character, instead
13946 of constantly refetching from Emacs object. Use XFASTINT, not
13947 XINT, for value known to be a character. Don't bother comparing
13948 a single byte to 0400, as it's always less.
13949
395fcb93 13950 * floatfns.c (Fexpt):
327eeec8
PE
13951 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13952
abbd3d23
PE
13953 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13954 for characters.
13955
684a03ef
PE
13956 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13957
0fed43f3
PE
13958 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13959 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13960 incorrectly succeed when S was a string, because 4294967386 was
13961 truncated before it was used.
13962
8fd02eb7
PE
13963 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13964 Otherwise, an out-of-range integer could cause undefined behavior
13965 on a 64-bit host.
13966
f8c86b69
PE
13967 * composite.c: Use int, not EMACS_INT, for characters.
13968 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13969 EMACS_INT, for values that are known to be in character range.
13970 This doesn't fix any bugs but is the usual style inside Emacs and
13971 may generate better code on 32-bit machines.
13972
34206dd2
PE
13973 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13974 This is for reasons similar to the recent CHAR_STRING fix.
13975 * charset.c (Fencode_char): Check that character arg is actually
13976 a character. Pass an int to ENCODE_CHAR.
13977 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13978 wider than 'int', as a compile-time check to prevent future regressions
13979 in this area.
13980
c5958d4c 13981 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
13982
13983 Make sure a 64-bit char is never passed to CHAR_STRING.
13984 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13985 by silently ignoring the top 32 bits, allowing some values
13986 that were far too large to be valid characters.
13987 * character.h: Include <verify.h>.
13988 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13989 arguments are no wider than unsigned, as a compile-time check
13990 to prevent future regressions in this area.
13991 * data.c (Faset):
01103c44 13992 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
13993 (Fsubst_char_in_region):
13994 * fns.c (concat):
13995 * xdisp.c (decode_mode_spec_coding):
13996 Adjust to CHAR_STRING's new requirement.
13997 * editfns.c (Finsert_char, Fsubst_char_in_region):
13998 * fns.c (concat): Check that character args are actually
13999 characters. Without this test, these functions did the wrong
14000 thing with wildly out-of-range values on 64-bit hosts.
14001
d37ca623
PE
14002 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14003 These casts should not be needed on 32-bit hosts, either.
14004 * keyboard.c (read_char):
14005 * lread.c (Fload): Remove casts to unsigned.
14006
ea204efb
PE
14007 * lisp.h (UNSIGNED_CMP): New macro.
14008 This fixes comparison bugs on 64-bit hosts.
14009 (ASCII_CHAR_P): Use it.
14010 * casefiddle.c (casify_object):
01103c44 14011 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
14012 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
14013 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
14014 * dispextern.h (FACE_FROM_ID):
14015 * keyboard.c (read_char): Use UNSIGNED_CMP.
14016
41cb286c
PE
14017 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
14018 not to EMACS_INT, to avoid GCC warning.
14019
4a1b9832
PE
14020 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
14021
55daad71
PE
14022 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
14023 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14024 isn't needed on 32-bit machines.
8f95c75c 14025
01103c44
PE
14026 * buffer.c (Fgenerate_new_buffer_name):
14027 Use EMACS_INT for count, not int.
0ceccced 14028 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
14029
14030 * data.c (Qcompiled_function): Now static.
14031
c6f072e7
PE
14032 * window.c (window_body_lines): Now static.
14033
20ce5912
PE
14034 * image.c (gif_load): Rename local to avoid shadowing.
14035
9c4c5f81
PE
14036 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14037 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14038 * alloc.c (make_save_value): Integer argument is now of type
14039 ptrdiff_t, not int.
14040 (mark_object): Use ptrdiff_t, not int.
14041 * lisp.h (pD): New macro.
14042 * print.c (print_object): Use it.
14043
c0c5c8ae
PE
14044 * alloc.c: Use EMACS_INT, not int, to count objects.
14045 (total_conses, total_markers, total_symbols, total_vector_size)
14046 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
14047 (total_free_floats, total_floats, total_free_intervals)
14048 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
14049 Now EMACS_INT, not int. All uses changed.
14050 (Fgarbage_collect): Compute overall total using a double, so that
14051 integer overflow is less likely to be a problem. Check for overflow
14052 when converting back to an integer.
5a25e253
PE
14053 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14054 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14055 These were 'int' variables that could overflow on 64-bit hosts;
14056 they were never used, so remove them instead of repairing them.
211a0b2a 14057 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
14058 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14059 Previously, this ceilinged at INT_MAX, but that doesn't work on
14060 64-bit machines.
e46bb31a 14061 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 14062
c78baabf 14063 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 14064 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
14065 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
14066 when a (possibly-narrower) signed value would do just as well.
14067 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 14068
c9d624c6
PE
14069 * alloc.c: Catch some string size overflows that we were missing.
14070 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14071 for convenience in STRING_BYTES_MAX.
14072 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14073 The definition here is exact; the one in lisp.h was approximate.
14074 (allocate_string_data): Check for string overflow. This catches
14075 some instances we weren't catching before. Also, it catches
14076 size_t overflow on (unusual) hosts where SIZE_MAX <= min
14077 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14078 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 14079
c9d624c6
PE
14080 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14081 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 14082 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 14083
353032ce
PE
14084 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14085
2bccce07
PE
14086 * alloc.c (Fmake_string): Check for out-of-range init.
14087
0ac30604
SM
140882011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14089
14090 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14091
c195f2de
JD
140922011-06-14 Jan Djärv <jan.h.d@swipnet.se>
14093
14094 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14095 xg_get_default_scrollbar_width.
14096
14097 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14098 (int_gtk_range_get_value): Move to the scroll bar part of the file.
14099 (style_changed_cb): Call update_theme_scrollbar_width and call
14100 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14101 all frames (Bug#8505).
14102 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14103 Call gtk_window_set_resizable if HAVE_GTK3.
14104 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14105 and height if HAVE_GTK3 (Bug#8505).
14106 (scroll_bar_width_for_theme): New variable.
14107 (update_theme_scrollbar_width): New function.
14108 (xg_get_default_scrollbar_width): Move code to
14109 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14110 (xg_initialize): Call update_theme_scrollbar_width.
14111
14112 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14113
14114 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14115
e10ac9f1
MR
141162011-06-12 Martin Rudalics <rudalics@gmx.at>
14117
14118 * frame.c (make_frame): Call other_buffer_safely instead of
14119 other_buffer.
14120
14121 * window.c (temp_output_buffer_show): Call display_buffer with
14122 second argument Vtemp_buffer_show_specifiers and reset latter
14123 immediately after the call.
14124 (Vtemp_buffer_show_specifiers): New variable.
14125 (auto_window_vscroll_p, next_screen_context_lines)
14126 (Vscroll_preserve_screen_position): Remove leading asterisks from
14127 doc-strings.
14128
2d3c217e 141292011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 14130
7b7f97e8 14131 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
14132 * buffer.c (Qclone_number): Remove for now, as it's unused.
14133 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14134 (record_buffer): Remove unused local.
14135 * frame.c (other_visible_frames, frame_buffer_list): Now static.
14136 (set_frame_buffer_list): Remove; unused.
14137 * frame.h (other_visible_frames): Remove decl.
14138 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14139 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14140 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14141 if HAVE_GPM.
14142 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14143 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
14144 Define only if HAVE_GPM.
14145 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
14146 (update_hints_inhibit): Remove; never set. All uses removed.
14147 * widgetprv.h (emacsFrameClassRec): Remove decl.
14148 * window.c (delete_deletable_window): Now returns void, since it
14149 wasn't returning anything.
14150 (compare_window_configurations): Remove unused locals.
14151 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
14152 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
14153 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
14154 the same widths as pointers. This follows up on the 2011-05-06 patch.
14155 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
14156 * xterm.h: Likewise.
14157 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
14158
1384b89e
JB
141592011-06-12 Juanma Barranquero <lekktu@gmail.com>
14160
14161 * makefile.w32-in: Update dependencies.
14162 (LISP_H): Add lib/intprops.h.
14163
1100a63c
CY
141642011-06-11 Chong Yidong <cyd@stupidchicken.com>
14165
14166 * image.c (gif_load): Add animation frame delay to the metadata.
14167 (syms_of_image): Use DEFSYM. New symbol `delay'.
14168
6198ccd0
MR
141692011-06-11 Martin Rudalics <rudalics@gmx.at>
14170
14171 * window.c (delete_deletable_window): Re-add.
14172 (Fset_window_configuration): Rewrite to handle dead buffers and
14173 consequently deletable windows.
14174 (window_tree, Fwindow_tree): Remove. Supply functionality in
14175 window.el.
14176 (compare_window_configurations): Simplify code.
14177
b6e3633c
AS
141782011-06-11 Andreas Schwab <schwab@linux-m68k.org>
14179
1ab0dee5
AS
14180 * image.c (imagemagick_load_image): Fix type mismatch.
14181 (Fimagemagick_types): Likewise.
14182
b6e3633c
AS
14183 * window.h (replace_buffer_in_windows): Declare.
14184
9397e56f
MR
141852011-06-11 Martin Rudalics <rudalics@gmx.at>
14186
14187 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
14188 Qclone_number. Remove external declaration of Qdelete_window.
14189 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
14190 code.
640c8776
SM
14191 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
14192 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
14193 (Fother_buffer): Rewrite doc-string. Major rewrite for new
14194 buffer list implementation.
14195 (other_buffer_safely): New function.
14196 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
14197 calls to replace_buffer_in_windows and
14198 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
14199 if allowed.
14200 (record_buffer): Inhibit quitting and rewrite using quittable
14201 functions. Run Qbuffer_list_update_hook if allowed.
14202 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
14203 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
14204 Move switch-to-buffer to window.el.
9397e56f
MR
14205 (bury-buffer): Move to window.el.
14206 (Vbuffer_list_update_hook): New variable.
14207
14208 * lisp.h (other_buffer_safely): Add prototype in buffer.c
14209 section.
14210
14211 * window.h (resize_frame_windows): Move up in code.
14212 (Fwindow_frame): Remove EXFUN.
14213 (replace_buffer_in_all_windows): Remove prototype.
14214 (replace_buffer_in_windows_safely): Add prototype.
14215
14216 * window.c: Declare Qdelete_window static again. Move down
14217 declaration of select_count.
14218 (Fnext_window, Fprevious_window): Rewrite doc-strings.
14219 (Fother_window): Move to window.el.
14220 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14221 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14222 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14223 window.el.
14224 (replace_buffer_in_windows): Implement by calling
14225 Qreplace_buffer_in_windows.
14226 (replace_buffer_in_all_windows): Remove with some functionality
14227 moved into replace_buffer_in_windows_safely.
14228 (replace_buffer_in_windows_safely): New function.
14229 (select_window_norecord, select_frame_norecord): Move in front
14230 of run_window_configuration_change_hook. Remove now obsolete
14231 declarations.
640c8776
SM
14232 (Fset_window_buffer): Rewrite doc-string.
14233 Call Qrecord_window_buffer.
9397e56f
MR
14234 (keys_of_window): Move binding for other-window to window.el.
14235
b50691aa
CY
142362011-06-11 Chong Yidong <cyd@stupidchicken.com>
14237
14238 * dispextern.h (struct image): Replace data member, whose int_val
14239 and ptr_val fields were not used by anything, with a single
14240 lisp_val object.
14241
14242 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14243 (gif_clear_image, gif_load, imagemagick_load_image)
14244 (gs_clear_image, gs_load): Callers changed.
14245
3f754b86
PE
142462011-06-10 Paul Eggert <eggert@cs.ucla.edu>
14247
cca69397
PE
14248 * buffer.h: Include <time.h>, for time_t.
14249 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
14250
109e28d0
PE
14251 Fix minor problems found by static checking.
14252
60737f02
PE
14253 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14254
4b66faf3
PE
14255 Make identifiers static if they are not used in other modules.
14256 * data.c (Qcompiled_function, Qframe, Qvector):
14257 * image.c (QimageMagick, Qsvg):
14258 * minibuf.c (Qmetadata):
14259 * window.c (resize_window_check, resize_root_window): Now static.
14260 * window.h (resize_window_check, resize_root_window): Remove decls.
14261
109e28d0
PE
14262 * window.c (window_deletion_count, delete_deletable_window):
14263 Remove; unused.
46a4ce9e
PE
14264 (window_body_lines): Now static.
14265 (Fdelete_other_windows_internal): Mark vars as initialized.
14266 Make sure 'resize_failed' is initialized.
14267 (run_window_configuration_change_hook): Rename local to avoid shadowing.
14268 (resize_window_apply): Remove unused local.
14269 * window.h (delete_deletable_window): Remove decl.
14270
109e28d0 14271 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
14272 (imagemagick_load_image): Fix pointer signedness problem by changing
14273 last arg from unsigned char * to char *. All uses changed.
14274 Also, fix a local for similar reasons.
14275 Remove unused locals. Remove locals to avoid shadowing.
14276 (fn_rsvg_handle_free): Remove; unused.
14277 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 14278 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 14279
3f754b86
PE
14280 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14281
2547adb1
CY
142822011-06-10 Chong Yidong <cyd@stupidchicken.com>
14283
14284 * image.c (gif_load): Fix omitted cast error introduced by
14285 2011-06-06 change.
14286
2c8e37d4
MR
142872011-06-10 Martin Rudalics <rudalics@gmx.at>
14288
14289 * window.h (resize_proportionally, orig_total_lines)
14290 (orig_top_line): Remove from window structure.
14291 (set_window_height, set_window_width, change_window_heights)
14292 (Fdelete_window): Remove prototypes.
14293 (resize_frame_windows): Remove duplicate declaration.
14294
440a42e3
EZ
142952011-06-10 Eli Zaretskii <eliz@gnu.org>
14296
14297 * window.h (resize_frame_windows, resize_window_check)
14298 (delete_deletable_window, resize_root_window)
14299 (resize_frame_windows): Declare prototypes.
14300
14301 * window.c (resize_window_apply): Make definition be "static" to
14302 match the prototype.
14303
562dd5e9
MR
143042011-06-10 Martin Rudalics <rudalics@gmx.at>
14305
14306 * window.c: Remove declarations of Qwindow_size_fixed,
14307 window_min_size_1, window_min_size_2, window_min_size,
14308 size_window, window_fixed_size_p, enlarge_window, delete_window.
14309 Remove static from declaration of Qdelete_window, it's
14310 temporarily needed by Fbury_buffer.
14311 (replace_window): Don't assign orig_top_line and
14312 orig_total_lines.
14313 (Fdelete_window, delete_window): Remove. Window deletion is
14314 handled by window.el.
640c8776
SM
14315 (window_loop): Remove DELETE_OTHER_WINDOWS case.
14316 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
14317 (Fdelete_other_windows): Remove. Deleting other windows is
14318 handled by window.el.
14319 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
14320 handled in window.el.
14321 (window_min_size_2, window_min_size_1, window_min_size): Remove.
14322 Window minimum sizes are handled in window.el.
14323 (shrink_windows, size_window, set_window_height)
14324 (set_window_width, change_window_heights, window_height)
14325 (window_width, CURBEG, CURSIZE, enlarge_window)
14326 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
14327 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
14328 handled in window.el.
14329 (make_dummy_parent): Rename to make_parent_window and give it a
14330 second argument horflag.
14331 (make_window): Don't set resize_proportionally any more.
14332 (Fsplit_window): Remove. Windows are split in window.el.
14333 (save_restore_action, save_restore_orig_size)
14334 (shrink_window_lowest_first, save_restore_orig_size): Remove.
14335 Resize mini windows in window.el.
14336 (grow_mini_window, shrink_mini_window): Implement by calling
14337 Qresize_root_window_vertically, resize_window_check and
14338 resize_window_apply.
640c8776
SM
14339 (saved_window, Fset_window_configuration, save_window_save):
14340 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
14341 resize_proportionally.
14342 (window_min_height, window_min_width): Move to window.el.
14343 (keys_of_window): Move bindings for delete-other-windows,
14344 split-window, delete-window and enlarge-window to window.el.
14345
14346 * buffer.c: Temporarily extern Qdelete_window.
14347 (Fbury_buffer): Temporarily call Qdelete_window instead of
14348 Fdelete_window (Fbury_buffer will move to window.el soon).
14349
14350 * frame.c (set_menu_bar_lines_1): Remove code handling
14351 orig_top_line and orig_total_lines.
14352
14353 * dispnew.c (adjust_frame_glyphs_initially): Don't use
14354 set_window_height but set heights directly.
14355 (change_frame_size_1): Use resize_frame_windows.
14356
14357 * xdisp.c (init_xdisp): Don't use set_window_height but set
14358 heights directly.
14359
640c8776
SM
14360 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14361 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
14362 run_window_configuration_change_hook.
14363
14364 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14365 instead of change_window_heights and run
14366 run_window_configuration_change_hook.
14367
1a13852e
MR
143682011-06-09 Martin Rudalics <rudalics@gmx.at>
14369
14370 * window.c (replace_window): Rename second argument REPLACEMENT to
14371 NEW. New third argument SETFLAG. Rewrite.
14372 (delete_window, make_dummy_parent): Call replace_window with
14373 third argument 1.
14374 (window_list_1): Move down in code.
14375 (run_window_configuration_change_hook): Move set_buffer part
14376 before select_frame_norecord part in order to unwind correctly.
14377 Rename count1 to count.
14378 (recombine_windows, delete_deletable_window, resize_root_window)
14379 (Fdelete_other_windows_internal)
14380 (Frun_window_configuration_change_hook, make_parent_window)
14381 (resize_window_check, resize_window_apply, Fresize_window_apply)
14382 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
14383 (Fdelete_window_internal, Fresize_mini_window_internal):
14384 New functions.
1a13852e
MR
14385 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14386
f3d1777e
MR
143872011-06-08 Martin Rudalics <rudalics@gmx.at>
14388
496e208e
MR
14389 * window.h (window): Add some new members to window structure -
14390 normal_lines, normal_cols, new_total, new_normal, clone_number,
14391 splits, nest, prev_buffers, next_buffers.
14392 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 14393 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 14394
f3d1777e
MR
14395 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14396 Remove.
496e208e
MR
14397 (make_dummy_parent): Set new members of windows structure.
14398 (make_window): Move down in code. Handle new members of window
14399 structure.
14400 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14401 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14402 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14403 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
14404 (Fset_window_next_buffers, Fset_window_clone_number):
14405 New functions.
496e208e
MR
14406 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14407 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14408 Doc-string fixes.
14409 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14410 Argument WINDOW can be now internal window too.
14411 (Fwindow_use_time): Move up in code.
14412 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14413 Rewrite doc-string.
14414 (Fset_window_configuration, saved_window)
14415 (Fcurrent_window_configuration, save_window_save): Handle new
14416 members of window structure.
b9e809c2
MR
14417 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14418 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14419 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14420 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14421 Qget_mru_window, Qresize_root_window,
14422 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14423 Qauto_buffer_name; staticpro them.
f3d1777e 14424
abde8f8c
MR
144252011-06-07 Martin Rudalics <rudalics@gmx.at>
14426
14427 * window.c (Fwindow_total_size, Fwindow_left_column)
14428 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14429 (Fwindow_list_1): New functions.
14430 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
14431 (Fwindow_width, Fscroll_left, Fscroll_right):
14432 Use window_body_cols instead of window_box_text_cols.
14433 (delete_window, Fset_window_configuration):
14434 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
14435 (delete_all_subwindows): Take a window as argument and not a
14436 structure. Rewrite.
190b47e6
MR
14437 (window_loop): Remove handling of GET_LRU_WINDOW and
14438 GET_LARGEST_WINDOW.
14439 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
14440
14441 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
14442 window_box_text_cols. delete_all_subwindows now takes a
14443 Lisp_Object as argument.
abde8f8c 14444
640c8776
SM
14445 * indent.c (compute_motion, Fcompute_motion):
14446 Use window_body_cols instead of window_box_text_cols.
abde8f8c 14447
fa8a67e6
MR
14448 * frame.c (delete_frame): Call delete_all_subwindows with root
14449 window as argument.
14450
a54e3482
DC
144512011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14452
14453 * fns.c (Fputhash): Document return value.
14454
60002bf5
CY
144552011-06-06 Chong Yidong <cyd@stupidchicken.com>
14456
14457 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14458
0c671da6 144592011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 14460
b862a52a 14461 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 14462
be44ca6c
PE
14463 Check for overflow when converting integer to cons and back.
14464 * charset.c (Fdefine_charset_internal, Fdecode_char):
14465 Use cons_to_unsigned to catch overflow.
14466 (Fencode_char): Use INTEGER_TO_CONS.
14467 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14468 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14469 * data.c (long_to_cons, cons_to_long): Remove.
14470 (cons_to_unsigned, cons_to_signed): New functions.
14471 These signal an error for invalid or out-of-range values.
14472 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14473 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14474 * font.c (Ffont_variation_glyphs):
14475 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14476 * lisp.h: Include <intprops.h>.
14477 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14478 (cons_to_signed, cons_to_unsigned): New decls.
14479 (long_to_cons, cons_to_long): Remove decls.
14480 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14481 (Fprimitive_undo): Use CONS_TO_INTEGER.
14482 * xfns.c (Fx_window_property): Likewise.
14483 * xselect.c: Include <limits.h>.
14484 (x_own_selection, selection_data_to_lisp_data):
14485 Use INTEGER_TO_CONS.
14486 (x_handle_selection_request, x_handle_selection_clear)
14487 (x_get_foreign_selection, Fx_disown_selection_internal)
14488 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14489 (lisp_data_to_selection_data): Use cons_to_unsigned.
14490 (x_fill_property_data): Use cons_to_signed.
14491 Report values out of range.
14492
d1f3d2af
PE
14493 Check for buffer and string overflow more precisely.
14494 * buffer.h (BUF_BYTES_MAX): New macro.
14495 * lisp.h (STRING_BYTES_MAX): New macro.
14496 * alloc.c (Fmake_string):
14497 * character.c (string_escape_byte8):
14498 * coding.c (coding_alloc_by_realloc):
14499 * doprnt.c (doprnt):
14500 * editfns.c (Fformat):
14501 * eval.c (verror):
14502 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14503 since they may not be the same number.
14504 * editfns.c (Finsert_char):
14505 * fileio.c (Finsert_file_contents):
14506 Likewise for BUF_BYTES_MAX.
14507
dd52fcea
PE
14508 * image.c: Use ptrdiff_t, not int, for sizes.
14509 (slurp_file): Switch from int to ptrdiff_t.
14510 All uses changed.
14511 (slurp_file): Check that file size fits in both size_t (for
14512 malloc) and ptrdiff_t (for sanity and safety).
14513
7f9bbdbb
PE
14514 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14515 if b->modtime has its maximal value.
14516
dfe18f82
PE
14517 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14518
84acfcf0
PE
14519 Don't assume time_t can fit into int.
14520 * buffer.h (struct buffer.modtime): Now time_t, not int.
14521 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14522 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14523
ccd9a01a
PE
14524 Minor fixes for signed vs unsigned integers.
14525 * character.h (MAYBE_UNIFY_CHAR):
14526 * charset.c (maybe_unify_char):
14527 * keyboard.c (read_char, reorder_modifiers):
14528 XINT -> XFASTINT, since the integer must be nonnegative.
14529 * ftfont.c (ftfont_spec_pattern):
14530 * keymap.c (access_keymap, silly_event_symbol_error):
14531 XUINT -> XFASTINT, since the integer must be nonnegative.
14532 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14533 since it makes no difference and we prefer signed.
14534 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14535 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14536 nonnegative.
14537
d6d100dd
SM
145382011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14539
14540 * window.h (Fwindow_frame): Declare.
14541
2b6148e4
PE
145422011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14543
14544 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14545 (SPARE_MEMORY): Always define.
14546 (LARGE_REQUEST): Remove.
14547 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14548
f230ecc9
MR
145492011-06-06 Martin Rudalics <rudalics@gmx.at>
14550
727e958e
MR
14551 * lisp.h: Move EXFUNS for Fframe_root_window,
14552 Fframe_first_window and Fset_frame_selected_window to window.h.
14553
14554 * window.h: Move EXFUNS for Fframe_root_window,
14555 Fframe_first_window and Fset_frame_selected_window here from
14556 lisp.h.
14557
14558 * frame.c (Fwindow_frame, Fframe_first_window)
14559 (Fframe_root_window, Fframe_selected_window)
14560 (Fset_frame_selected_window): Move to window.c.
14561 (Factive_minibuffer_window): Move to minibuf.c.
14562 (Fother_visible_frames_p): New function.
14563
14564 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14565
f230ecc9
MR
14566 * window.c (decode_window, decode_any_window): Move up in code.
14567 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14568 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
14569 (Fwindow_buffer): Move up and rewrite doc-string.
14570 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14571 (Fwindow_prev): New functions.
727e958e
MR
14572 (Fwindow_frame): Move here from frame.c. Accept any window as
14573 argument.
14574 (Fframe_root_window, Fframe_first_window)
14575 (Fframe_selected_window): Move here from frame.c. Accept frame
14576 or arbitrary window as argument. Update doc-strings.
14577 (Fminibuffer_window): Move up in code.
14578 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
14579 (Fset_frame_selected_window): Move here from frame.c.
14580 Marginal rewrite.
727e958e
MR
14581 (Fselected_window, select_window, Fselect_window): Move up in
14582 code. Minor doc-string fixes.
f230ecc9 14583
4d09bcf6
PE
145842011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14585
14586 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14587 Do not assume that spare memory exists; that assumption is valid
14588 only if SYSTEM_MALLOC.
14589 (LARGE_REQUEST): New macro, so that the issue of large requests
14590 is separated from the issue of spare memory.
14591
810928a2
AS
145922011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14593
172418ad
AS
14594 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14595 format. (Bug#8806)
14596
43f862f7
AS
14597 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14598
810928a2
AS
14599 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14600 before statements.
14601
a059fe24
JD
146022011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14603
14604 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14605
14606 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14607
14608 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14609 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14610
989bf368
JB
146112011-06-05 Juanma Barranquero <lekktu@gmail.com>
14612
14613 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14614
4b80f674
CY
146152011-06-04 Chong Yidong <cyd@stupidchicken.com>
14616
14617 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14618 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
14619 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14620 New error handlers.
4b80f674
CY
14621 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14622 Obey Vx_select_enable_clipboard_manager. Catch errors in
14623 x_clipboard_manager_save (Bug#8779).
14624 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 14625 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 14626
99a33b77 146272011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
14628
14629 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14630
99a33b77 146312011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
14632
14633 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14634 in the current matrix if keep_current_p is non-zero.
14635
8264569d
EZ
146362011-06-04 Eli Zaretskii <eliz@gnu.org>
14637
14638 * bidi.c (bidi_level_of_next_char): Fix last change.
14639
57f97249
EZ
146402011-06-03 Eli Zaretskii <eliz@gnu.org>
14641
fec2107c 14642 Support bidi reordering of text covered by display properties.
57f97249 14643
fec2107c
EZ
14644 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14645 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14646 (bidi_cache_search, bidi_cache_iterator_state)
14647 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
14648 (bidi_level_of_next_char, bidi_move_to_visually_next):
14649 Support character positions inside a run of characters covered by a
fec2107c
EZ
14650 display string.
14651 (bidi_paragraph_init, bidi_resolve_explicit_1)
14652 (bidi_level_of_next_char): Call bidi_fetch_char and
14653 bidi_fetch_char_advance instead of FETCH_CHAR and
14654 FETCH_CHAR_ADVANCE.
14655 (bidi_init_it): Initialize new members.
14656 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14657 definitions.
14658 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14659 instead of using explicit *_CHAR codes.
d6d100dd
SM
14660 (bidi_resolve_explicit, bidi_resolve_weak):
14661 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
14662 bidirectional text is supported only in multibyte buffers.
14663 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14664 it to initialize the frame_window_p member of struct bidi_it.
14665 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14666 (bidi_resolve_explicit, bidi_resolve_weak)
14667 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14668 bidi_it->nchars is non-positive.
14669 (bidi_level_of_next_char): Don't try to lookup the cache for the
14670 next/previous character if nothing is cached there yet, or if we
14671 were just reseat()'ed to a new position.
c40e2fb2 14672
0e14fe90
EZ
14673 * xdisp.c (set_cursor_from_row): Set start and stop points
14674 according to the row's direction when priming the loop that looks
14675 for the glyph on which to display cursor.
14676 (single_display_spec_intangible_p): Function deleted.
14677 (display_prop_intangible_p): Reimplement to call
14678 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
14679 Accept 3 additional arguments needed by handle_display_spec.
14680 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
14681 values: lists, `(when COND...)' forms, etc.
14682 (single_display_spec_string_p): Support property values that are
14683 lists with the argument STRING its top-level element.
14684 (display_prop_string_p): Fix the condition for processing a
14685 property that is a list to be consistent with handle_display_spec.
fec2107c 14686 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
14687 last portion of handle_display_prop.
14688 (compute_display_string_pos): Accept additional argument
14689 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14690 value of a `display' property is a "replacing spec".
14691 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14692 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14693 the display property, but just return a value indicating whether
14694 the display property will replace the characters it covers.
14695 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14696 frame_window_p members of struct bidi_it.
d6d100dd
SM
14697 (compute_display_string_pos, compute_display_string_end):
14698 New functions.
fec2107c
EZ
14699 (push_it): Accept second argument POSITION, where pop_it should
14700 jump to continue iteration.
14701 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 14702
fec2107c
EZ
14703 * keyboard.c (adjust_point_for_property): Adjust the call to
14704 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
14705
14706 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
14707 (bidi_init_it): Update prototypes.
14708 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
14709 (compute_display_string_pos, compute_display_string_end):
14710 Declare prototypes.
fec2107c
EZ
14711 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14712 EMACS_INT.
fc6f18ce 14713
40087514 147142011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 14715
57f53182
PE
14716 Malloc failure behavior now depends on size of allocation.
14717 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14718 * lisp.h: Change signatures accordingly.
14719 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14720 All callers changed. (Bug#8762)
14721
14722 * gnutls.c: Use Emacs's memory allocators.
14723 Without this change, the gnutls library would invoke malloc etc.
14724 directly, which causes problems on non-SYNC_INPUT hosts, and which
14725 runs afoul of improving memory_full behavior. (Bug#8761)
14726 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14727 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14728 xfree instead of the default malloc, realloc, free.
14729 (Fgnutls_boot): No need to check for memory allocation failure,
14730 since xmalloc does that for us.
14731
ac32cd99 14732 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
14733 * category.c (hash_get_category_set):
14734 * ccl.c (ccl_driver):
14735 * charset.c (Fdefine_charset_internal):
14736 * charset.h (struct charset.hash_index):
14737 * composite.c (get_composition_id, gstring_lookup_cache)
14738 (composition_gstring_put_cache):
14739 * composite.h (struct composition.hash_index):
14740 * dispextern.h (struct image.hash):
14741 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14742 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14743 (hashfn_equal, hashfn_user_defined, make_hash_table)
14744 (maybe_resize_hash_table, hash_lookup, hash_put)
14745 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14746 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14747 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14748 * image.c (make_image, search_image_cache, lookup_image)
14749 (xpm_put_color_table_h):
14750 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 14751 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 14752 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 14753 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
14754 * alloc.c (allocate_vectorlike):
14755 Check for overflow in vector size calculations.
14756 * ccl.c (ccl_driver):
14757 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
14758 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14759 need to be updated by these changes.
40087514
PE
14760 * fns.c (make_hash_table, maybe_resize_hash_table):
14761 Check for integer overflow with large hash tables.
0de4bb68
PE
14762 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14763 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14764 (SXHASH_REDUCE): New macro.
14765 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14766 Use it instead of discarding useful hash info with large hash values.
14767 (sxhash_float): New function.
14768 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14769 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
14770 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14771 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
14772 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14773 Adjust signatures to match updated version of code.
14774 (consing_since_gc): Now EMACS_INT, since a single hash table can
14775 use more than INT_MAX bytes.
14776
698d32e2
DN
147772011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14778
14779 Make it possible to build with GCC-4.6+ -O2 -flto.
14780
14781 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14782
fd6fa53f
SM
147832011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14784
14785 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14786 Call minibuffer-inactive-mode.
14787
864db017
JB
147882011-05-31 Juanma Barranquero <lekktu@gmail.com>
14789
14790 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14791 Update dependencies.
14792
2ad0baf4
DN
147932011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14794
14795 * data.c (init_data): Remove code for UTS, this system is not
14796 supported anymore.
14797
4fcc2638
DN
147982011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14799
14800 Don't force ./temacs to start in terminal mode.
14801
14802 * frame.c (make_initial_frame): Initialize faces in all cases, not
14803 only when CANNOT_DUMP is defined.
14804 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14805
c56e0fd5
DN
148062011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14807
14808 * dispnew.c (add_window_display_history): Use const for the string
14809 pointer. Remove declaration, not needed.
14810
333d54da 148112011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 14812
55d4c1b2 14813 Use 'inline', not 'INLINE'.
333d54da 14814 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
14815 * alloc.c, fontset.c (INLINE): Remove.
14816 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14817 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14818 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14819 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14820 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14821
738db178
DN
148222011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14823
14824 Make it possible to run ./temacs.
14825
14826 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14827 syms_of_callproc does the same thing. Remove test for
14828 "initialized", do it in the caller.
14829 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14830
620c53a6
SM
148312011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14832
14833 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14834 (read_minibuf): Use get_minibuffer.
14835 (syms_of_minibuf): Use DEFSYM.
14836 (Qmetadata): New var.
14837 * data.c (Qbuffer): Don't make it static.
14838 (syms_of_data): Use DEFSYM.
14839
e003a292
PE
148402011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14841
14842 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14843 (CCL_CODE_MIN): New macro.
14844
ed008a6d
PE
148452011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14846
3687c2ef
PE
14847 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14848
ed008a6d
PE
14849 * eval.c (Qdebug): Now static.
14850 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14851 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14852 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14853
d66c4c7c
CY
148542011-05-29 Chong Yidong <cyd@stupidchicken.com>
14855
14856 * image.c: Various fixes to ImageMagick code comments.
14857 (Fimagemagick_types): Doc fix.
14858
5fbc2025
PE
148592011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14860
0196f88a
PE
14861 Minor fixes prompted by GCC 4.6.0 warnings.
14862
14863 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14864
5fbc2025
PE
14865 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14866 (x_clipboard_manager_save_all): Move extern decl to ...
14867 * xterm.h: ... here, so that it can be checked for consistency.
14868
1dd3c2d9
CY
148692011-05-29 Chong Yidong <cyd@stupidchicken.com>
14870
14871 * xselect.c (x_clipboard_manager_save_frame)
14872 (x_clipboard_manager_save_all): New functions.
14873 (Fx_clipboard_manager_save): Lisp function deleted.
14874
14875 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14876 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14877
14878 * xterm.h: Update prototype.
14879
5ba6571d
WX
148802011-05-28 William Xu <william.xwl@gmail.com>
14881
14882 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14883 exiting (Bug#8239).
14884
3eaff834
JM
148852011-05-28 Jim Meyering <meyering@redhat.com>
14886
e1900994 14887 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
14888 * fns.c (to_uchar): Define.
14889 (crypto_hash_function): Use it to convert some newly-signed
14890 variables to unsigned, to avoid sign-extension bugs. For example,
14891 without this change, (md5 "truc") would evaluate to
14892 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14893 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 14894 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 14895
0f6990a7
PE
148962011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14897
14898 Integer overflow fixes.
c8a9ca5a 14899
08686060
PE
14900 * dbusbind.c: Serial number integer overflow fixes.
14901 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
14902 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14903 to hold a serial number that is too large for a fixnum.
14904 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14905 Check for serial numbers out of range. Decode any serial number
59568bf0 14906 that was so large that it became a float. (Bug#8722)
08686060 14907
2d1fc3c7
PE
14908 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14909 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14910 Use XFASTINT rather than XUINT when numbers are nonnegative.
14911 (xd_append_arg, Fdbus_method_return_internal):
14912 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14913 arguments, check that Lisp number is nonnegative, rather than
59568bf0 14914 silently wrapping negative numbers around. (Bug#8722)
30217ff0 14915 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 14916 (Bug#8722)
2d1fc3c7 14917
c8a9ca5a
PE
14918 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14919
519e1d69
PE
14920 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14921
6df6ae42 14922 ccl: Add integer overflow checks.
30569699
PE
14923 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14924 (IN_INT_RANGE): New macros.
14925 (ccl_driver): Use them to check for integer overflow when
14926 decoding a CCL program. Many of the new checks are whether XINT (x)
14927 fits in int; it doesn't always, on 64-bit hosts. The new version
14928 doesn't catch all possible integer overflows, but it's an
847044ea 14929 improvement. (Bug#8719)
30569699 14930
c11285dc
PE
14931 * alloc.c (make_event_array): Use XINT, not XUINT.
14932 There's no need for unsigned here.
14933
fdccd48e
PE
14934 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14935 This follows up to the 2011-05-06 change that substituted uintptr_t
14936 for EMACS_INT. This case wasn't caught back then.
14937
37910ab2
PE
14938 Rework Fformat to avoid integer overflow issues.
14939 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14940 now (part of C89). Include <verify.h>.
14941 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14942 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14943 (Fformat): Avoid the prepass trying to compute sizes; it was only
14944 approximate and thus did not catch overflow reliably. Instead, walk
14945 through the format just once, formatting and computing sizes as we go,
14946 checking for integer overflow at every step, and allocating a larger
14947 buffer as needed. Keep track separately whether the format is
14948 multibyte. Keep only the most-recently calculated precision, rather
14949 than them all. Record whether each argument has been converted to
14950 string. Use EMACS_INT, not int, for byte and char and arg counts.
14951 Support field widths and precisions larger than INT_MAX. Avoid
14952 sprintf's undefined behavior with conversion specifications such as %#d
14953 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14954 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14955 formatting out-of-range floating point numbers with int
9173deec 14956 formats. (Bug#8668)
37910ab2 14957
2e6578fb
PE
14958 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14959
0ae6bdee
PE
14960 * data.c: Avoid integer truncation in expressions involving floats.
14961 * data.c: Include <intprops.h>.
14962 (arith_driver): When there's an integer overflow in an expression
14963 involving floating point, convert the integers to floating point
14964 so that the resulting value does not suffer from catastrophic
14965 integer truncation. For example, on a 64-bit host (* 4
14966 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14967 Do not rely on undefined behavior after integer overflow.
14968
de883a70
PE
14969 merge count_size_as_multibyte, parse_str_to_multibyte
14970 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 14971 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
14972 Check for integer overflow.
14973 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14974 since it's now a duplicate of the other. This is more of
14975 a character than a buffer op, so better that it's in character.c.
14976 * fns.c, print.c: Adjust to above changes.
14977
2ff916cb
PE
149782011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14979
14980 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14981
f1b54466
PE
149822011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14983
fb1ac845
PE
14984 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14985 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14986 (x_clipboard_manager_save): Now static.
14987 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14988
f1b54466
PE
14989 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14990 (crypto_hash_function): Now static.
14991 Fix pointer signedness problems. Avoid unnecessary initializations.
14992
a9f737ee
CY
149932011-05-27 Chong Yidong <cyd@stupidchicken.com>
14994
14995 * termhooks.h (Vselection_alist): Make it terminal-local.
14996
14997 * terminal.c (create_terminal): Initialize it.
14998
14999 * xselect.c: Support for clipboard managers.
15000 (Vselection_alist): Move to termhooks.h as terminal-local var.
15001 (LOCAL_SELECTION): New macro.
15002 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15003 (symbol_to_x_atom): Remove gratuitous arg.
15004 (x_handle_selection_request, lisp_data_to_selection_data)
15005 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
15006 (x_own_selection, x_get_local_selection, x_convert_selection):
15007 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
15008 (some_frame_on_display): Delete unused function.
15009 (Fx_own_selection_internal, Fx_get_selection_internal)
15010 (Fx_disown_selection_internal, Fx_selection_owner_p)
15011 (Fx_selection_exists_p): New optional frame arg.
15012 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
15013 (x_handle_selection_clear): Don't treat other terminals with the
15014 same keyboard specially. Use the terminal-local Vselection_alist.
15015 (x_clear_frame_selections): Use Frun_hook_with_args.
15016
15017 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
15018
15019 * xterm.h: Add support for those atoms.
15020
e067f0c1
CY
150212011-05-26 Chong Yidong <cyd@stupidchicken.com>
15022
15023 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15024 (converted_selections, conversion_fail_tag): New global variables.
15025 (x_selection_request_lisp_error): Free the above.
15026 (x_get_local_selection): Remove unnecessary code.
15027 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
15028 of converted selections stored in converted_selections.
15029 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
15030 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15031 (x_convert_selection): New function.
15032 (x_handle_selection_event): Simplify.
15033 (x_get_foreign_selection): Don't ignore incoming requests while
15034 waiting for an answer; this will fail when we implement
15035 SAVE_TARGETS, and seems unnecessary anyway.
15036 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15037 (Vx_sent_selection_functions): Doc fix.
15038
0f4aebc0
LL
150392011-05-26 Leo Liu <sdl.web@gmail.com>
15040
15041 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
15042
e61124cd
YM
150432011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15044
15045 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15046
15047 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15048 for fringe update if it has periodic bitmap.
ac389d0c 15049 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
15050 and fringe_bitmap_periodic_p.
15051
15052 * fringe.c (get_fringe_bitmap_data): New function.
15053 (draw_fringe_bitmap_1, update_window_fringes): Use it.
15054 (update_window_fringes): Record periodicity of fringe bitmap in glyph
15055 row. Mark glyph row for fringe update if periodicity changed.
15056
15057 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15058 for fringe update unless it has periodic bitmap.
15059
f16d9837
KH
150602011-05-25 Kenichi Handa <handa@m17n.org>
15061
15062 * xdisp.c (get_next_display_element): Set correct it->face_id for
15063 a static composition.
15064
e1b90ef6
LL
150652011-05-24 Leo Liu <sdl.web@gmail.com>
15066
15067 * deps.mk (fns.o):
15068 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15069
15070 * fns.c (crypto_hash_function, Fsha1): New function.
15071 (Fmd5): Use crypto_hash_function.
15072 (syms_of_fns): Add Ssha1.
15073
7400048f
PE
150742011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15075
15076 * gnutls.c: Remove unused macros.
15077 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15078 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15079 Remove macros that are defined and never used.
15080 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15081
abb71cf4
CY
150822011-05-22 Chong Yidong <cyd@stupidchicken.com>
15083
15084 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15085 (Fx_get_selection_internal): Minor cleanup.
15086 (Fx_own_selection_internal): Rename arguments for consistency with
15087 select.el.
15088
6307db39
PE
150892011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15090
15091 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15092
f3d4e0a4
CY
150932011-05-22 Chong Yidong <cyd@stupidchicken.com>
15094
15095 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15096
4d8ade89
YM
150972011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15098
15099 * dispnew.c (scrolling_window): Don't exclude the case that the
15100 last enabled row in the desired matrix touches the bottom boundary.
15101
32078c8d
GM
151022011-05-21 Glenn Morris <rgm@gnu.org>
15103
15104 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
15105 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15106 and add some more files.
32078c8d 15107
7285dc67
EZ
151082011-05-20 Eli Zaretskii <eliz@gnu.org>
15109
15110 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15111 report_file_error introduced by the change from 2011-05-07.
15112
89d1bd22
PE
151132011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15114
15115 * systime.h (Time): Define only if emacs is defined.
15116 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15117 where the include path doesn't have X11/X.h by default. See
15118 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15119
cd394be1 151202011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
15121
15122 * composite.c (find_automatic_composition): Fix previous change.
15123
b9704ad9
GM
151242011-05-20 Glenn Morris <rgm@gnu.org>
15125
15126 * lisp.mk: New file, split from Makefile.in.
15127 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15128 (shortlisp): Remove.
15129 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15130
4a720484
GM
151312011-05-19 Glenn Morris <rgm@gnu.org>
15132
15133 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15134 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15135 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15136 (lisp): Set the order to that of loadup.el.
15137 (shortlisp): Make it a copy of $lisp.
15138 (SOME_MACHINE_LISP): Remove.
15139 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15140 Use just $shortlisp, not $SOME_MACHINE_LISP too.
15141
a28d4396
KH
151422011-05-18 Kenichi Handa <handa@m17n.org>
15143
15144 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
15145 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
15146 (find_automatic_composition): Mostly rewrite for efficiency.
15147
a2b1fa8e
JB
151482011-05-18 Juanma Barranquero <lekktu@gmail.com>
15149
15150 * makefile.w32-in: Update dependencies.
15151
8e1f5610
CS
151522011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
15153
15154 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 15155 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 15156
7025ee00 151572011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 15158
cdfa6eab
PE
15159 Fix some integer overflow issues, such as string length overflow.
15160
06d6db33
PE
15161 * insdel.c (count_size_as_multibyte): Check for string overflow.
15162
2b4560a8
PE
15163 * character.c (lisp_string_width): Check for string overflow.
15164 Use EMACS_INT, not int, for string indexes and lengths; in
15165 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
15166 the resulting string length overflows an EMACS_INT; instead,
15167 report a string overflow if no precision given. When checking for
15168 precision exhaustion, use a check that cannot possibly have
15169 integer overflow. (Bug#8675)
15170 * character.h (lisp_string_width): Adjust to new signature.
15171
cb93f9be
PE
15172 * alloc.c (string_overflow): New function.
15173 (Fmake_string): Use it. This doesn't change behavior, but saves
15174 a few bytes and will simplify future changes.
15175 * character.c (string_escape_byte8): Likewise.
15176 * lisp.h (string_overflow): New decl.
15177
1a1f3366
PE
15178 Fixups, following up to the user-interface timestamp change.
15179 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
15180 for UI timestamps, instead of unsigned long.
9fbd6841
PE
15181 * msdos.c (mouse_get_pos): Likewise.
15182 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
15183 * w32gui.h (Time): Define by including "systime.h" rather than by
15184 declaring it ourselves. (Bug#8664)
15185
d4e3e4d3
PE
15186 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
15187 * image.c (clear_image_cache): Likewise.
15188
f6a24d19
PE
15189 * term.c (term_mouse_position): Don't assume time_t wraparound.
15190
08dc5ae6
PE
15191 Be more systematic about user-interface timestamps.
15192 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
15193 and sometimes 'EMACS_UINT', to represent these timestamps.
15194 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
15195 This makes the code easier to follow, and makes it easier to catch
15196 integer overflow bugs such as Bug#8664.
15197 * frame.c (Fmouse_position, Fmouse_pixel_position):
15198 Use Time, not unsigned long, for user-interface timestamps.
15199 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
15200 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
15201 * keyboard.h (last_event_timestamp): Likewise.
15202 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15203 * menu.h (xmenu_show): Likewise.
15204 * term.c (term_mouse_position): Likewise.
15205 * termhooks.h (struct input_event.timestamp): Likewise.
15206 (struct terminal.mouse_position_hook): Likewise.
15207 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15208 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15209 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
15210 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15211 what it was before.
15212 * menu.h, termhooks.h: Include "systime.h", for Time.
15213
8e55734a
PE
15214 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15215 Don't assume that the difference between two unsigned long values
15216 can fit into an integer. At this point, we know button_down_time
15217 <= event->timestamp, so the difference must be nonnegative, so
15218 there's no need to cast the result if double-click-time is
15219 nonnegative, as it should be; check that it's nonnegative, just in
15220 case. This bug is triggered when events are more than 2**31 ms
86db42d2 15221 apart (about 25 days). (Bug#8664)
8e55734a 15222
841f1b75 15223 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 15224 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 15225
3e26f69c
PE
15226 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15227 that always fit in int. Use a sentinel instead of a counter, to
15228 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
15229 * frame.h (struct frame): Use int for menu_bar_items_used
15230 instead of EMACS_INT, since it always fits in int.
3e26f69c 15231
5cc152c0
PE
15232 * menu.c (grow_menu_items): Check for int overflow.
15233
d89eb65e
PE
15234 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15235
5235bd3e
PE
15236 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15237 Before, the code was not consistent. These values cannot exceed
15238 2**31 - 1 so there's no need to make them unsigned.
15239 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15240 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15241 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15242 as modifiers.
15243 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15244
bc827e23
PE
15245 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15246 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15247 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15248 presumably because the widths might not match.
15249
78eb494e
PE
15250 * window.c (size_window): Avoid needless test at loop start.
15251
04f2d78b
CB
152522011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
15253
15254 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15255
d2fc7e3d 152562011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
15257
15258 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15259
d2fc7e3d 152602011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
15261
15262 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15263 `width' to `bar_area_x' and `bar_area_width', respectively.
15264 (x_scroll_run): Take account of fringe background extension.
15265
04f2d78b
CB
15266 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15267 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
15268 `bar_area_width', respectively.
15269 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15270 background extension.
15271
79b70037
GM
152722011-05-10 Jim Meyering <meyering@redhat.com>
15273
15274 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15275
2f142cc5
JB
152762011-05-10 Juanma Barranquero <lekktu@gmail.com>
15277
15278 * image.c (Finit_image_library): Return t for built-in image types,
15279 like pbm and xbm. (Bug#8640)
15280
57679c86
AS
152812011-05-09 Andreas Schwab <schwab@linux-m68k.org>
15282
15283 * w32menu.c (set_frame_menubar): Fix submenu allocation.
15284
888c9e86
EZ
152852011-05-07 Eli Zaretskii <eliz@gnu.org>
15286
b0512a1d
EZ
15287 * w32console.c (Fset_screen_color): Doc fix.
15288 (Fget_screen_color): New function.
15289 (syms_of_ntterm): Defsubr it.
15290
7285dc67
EZ
15291 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15292 unlink the temporary file if Fcall_process didn't create it in the
15293 first place.
15294 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15295 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
15296 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
15297 cue to call_process_cleanup not to close that handle.
15298
4d3fcc8e
BK
152992011-05-07 Ben Key <bkey76@gmail.com>
15300
15301 * makefile.w32-in: The bootstrap-temacs rule now makes use of
15302 one of two shell specific rules, either bootstrap-temacs-CMD or
15303 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
15304 to the previous implementation of the bootstrap-temacs rule.
15305 The bootstrap-temacs-CMD rule is similar to the previous
15306 implementation of the bootstrap-temacs rule except that it
15307 makes use of the ESC_CFLAGS variable instead of the CFLAGS
15308 variable.
15309
15310 These changes, along with some changes to nt/configure.bat,
15311 nt/gmake.defs, and nt/nmake.defs, are required to extend my
15312 earlier fix to add support for --cflags and --ldflags options
15313 that include quotes so that it works whether make uses cmd or
15314 sh as the shell.
15315
b4289b64
MA
153162011-05-06 Michael Albinus <michael.albinus@gmx.de>
15317
15318 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
15319 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
15320 is a constant.
15321 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
15322 a string. Handle both cases.
15323 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
15324 (Fdbus_register_method): Use Qinvalid_function.
15325
af4c0e28
JB
153262011-05-06 Juanma Barranquero <lekktu@gmail.com>
15327
15328 * makefile.w32-in: Update dependencies.
15329 (LISP_H): Add inttypes.h and stdin.h.
15330 (PROCESS_H): Add unistd.h.
15331
c51453d9
EZ
153322011-05-06 Eli Zaretskii <eliz@gnu.org>
15333
15334 * lread.c: Include limits.h (fixes the MS-Windows build broken by
15335 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15336
8ff0ac3c 153372011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 15338
4c4b566b
PE
15339 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15340
aab2b9b5
PE
15341 * term.c (vfatal): Remove stray call to va_end.
15342 It's not needed and the C Standard doesn't allow it here anyway.
15343
c378da0b
PE
15344 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15345 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
15346
288b08c7
PE
15347 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15348 bytes.
15349
e3601888
PE
15350 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15351
db6c0e74
PE
15352 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15353
dd5963ea
PE
15354 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15355
88c9450f
PE
15356 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15357
2f9442b8
PE
15358 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15359
c032b5f8
PE
15360 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15361 * charset.c (Fdefine_charset_internal): Don't initialize
15362 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 15363 32-bit int (Bug#8600).
a108c10b
PE
15364
15365 * lread.c (read_integer): Be more consistent with string-to-number.
15366 Use string_to_number to do the actual conversion; this avoids
15367 rounding errors and fixes some other screwups. Without this fix,
15368 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15369 (digit_to_number): Move earlier, for benefit of read_integer.
15370 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 15371 not a digit in any supported base. (Bug#8602)
a108c10b 15372
ad5f9eea
PE
15373 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15374
aec1708a
PE
15375 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15376 to match comment at start of function. This also removes a
15377 GCC warning about overflow in a 32+64-bit port.
15378
47be4ab5
PE
15379 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15380
371cac43
PE
15381 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15382 Reported by Stefan Monnier in
15383 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
15384 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15385 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 15386
d01a7826
PE
15387 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15388 (EMACS_UINTPTR): Likewise, with uintptr_t.
15389
7fd47d5c
PE
15390 * lisp.h: Prefer 64-bit EMACS_INT if available.
15391 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15392 on 32-bit hosts that have 64-bit int, so that they can access
15393 large files.
122b0c86
PE
15394 However, temporarily disable this change unless the temporary
15395 symbol WIDE_EMACS_INT is defined.
7fd47d5c 15396
8727937b
PE
15397 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15398
8ac068ac
PE
15399 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15400 This removes an assumption that EMACS_INT and long are the same
15401 width as pointers. The assumption is true for Emacs porting targets
15402 now, but we want to make other targets possible.
15403 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15404 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15405 In the rest of the code, change types of integers that hold casted
15406 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15407 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15408 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15409 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15410 No need to cast type when ORing.
15411 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15412 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15413 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15414 assume EMACS_INT is the same width as char *.
15415 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15416 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15417 Remove no-longer-needed casts.
15418 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15419 (xg_tool_bar_help_callback, xg_make_tool_item):
15420 Use EMACS_INTPTR to hold an integer
15421 that will be cast to void *; this can avoid a GCC warning
15422 if EMACS_INT is not the same width as void *.
15423 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15424 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15425 (current_message_1, set_message_1):
15426 Use a local to convert to proper width without a cast.
15427 * xmenu.c (dialog_selection_callback): Likewise.
15428
ede49d71
PE
15429 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15430 Also, don't assume VALBITS / RAND_BITS is less than 5,
15431 and don't rely on undefined behavior when shifting a 1 left into
15432 the sign bit.
15433 * lisp.h (get_random): Change signature to match.
15434
2f30ecd0
PE
15435 * lread.c (hash_string): Use size_t, not int, for hash computation.
15436 Normally we prefer signed values; but hashing is special, because
15437 it's better to use unsigned division on hash table sizes so that
15438 the remainder is nonnegative. Also, size_t is the natural width
15439 for hashing into memory. The previous code used 'int', which doesn't
15440 retain enough info to hash well into very large tables.
15441 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15442
2a866e7b
PE
15443 * dbusbind.c: Don't possibly lose pointer info when converting.
15444 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15445 Use XPNTR rather than XHASH, so that the high-order bits of
15446 the pointer aren't lost when converting through void *.
15447
51639eac
PE
15448 * eval.c (Fautoload): Don't double-shift a pointer.
15449
92394119
PE
15450 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15451
dbdb9a7c
JB
154522011-05-06 Juanma Barranquero <lekktu@gmail.com>
15453
15454 * gnutls.c (DEF_GNUTLS_FN):
15455 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15456
db7a0b4f
AS
154572011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15458
15459 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15460 marker. (Bug#8610)
15461
cd394be1 154622011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
15463
15464 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15465 New version that can reserve upto 2GB of heap space.
15466
f7ff1b0f 154672011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
15468
15469 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15470
639c109b
TZ
154712011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15472
15473 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15474 `gnutls_certificate_set_x509_key_file'.
15475
d2127135
JB
154762011-05-05 Juanma Barranquero <lekktu@gmail.com>
15477
15478 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15479 Update dependencies.
15480
e968f4f3
JB
154812011-05-04 Juanma Barranquero <lekktu@gmail.com>
15482
15483 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15484 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15485 Remove unused parameter `fildes'.
15486 * process.c (read_process_output, send_process): Don't pass it.
15487
84d358f0
JB
154882011-05-04 Juanma Barranquero <lekktu@gmail.com>
15489
15490 Fix previous change: the library cache is defined in w32.c.
15491 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15492 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15493
0898ca10
JB
154942011-05-04 Juanma Barranquero <lekktu@gmail.com>
15495
15496 Implement dynamic loading of GnuTLS on Windows.
15497
15498 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15499 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15500 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15501 Declare.
15502
15503 * gnutls.c (Qgnutls_dll): Define.
15504 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15505 (gnutls_*): Declare function pointers.
15506 (init_gnutls_functions): New function to initialize function pointers.
15507 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15508 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15509 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15510 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15511 (emacs_gnutls_write, emacs_gnutls_read)
15512 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15513 (Fgnutls_available_p): New function.
15514 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15515 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15516 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15517
15518 * image.c: Include w32.h.
15519 (Vimage_type_cache): Delete.
15520 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15521 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15522 (w32_delayed_load): Move to w32.c.
15523
15524 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15525
15526 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15527 (w32_delayed_load): Move from image.c. When loading a library, record
15528 its filename in the :loaded-from property of the library id.
15529 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15530 Initialize and staticpro them.
15531 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15532
15533 * process.c: Include lisp.h before w32.h, not after.
15534 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15535 instead of gnutls_record_check_pending.
15536
15537 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15538
ff4de4aa
TZ
155392011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15540
15541 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15542 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15543 as passed in.
15544
abe95abb
JD
155452011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15546
15547 * xterm.c (x_set_frame_alpha): Do not set property on anything
15548 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15549
e16e55d4
JB
155502011-05-02 Juanma Barranquero <lekktu@gmail.com>
15551
15552 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15553
bafcf6a5
JB
155542011-05-02 Juanma Barranquero <lekktu@gmail.com>
15555
15556 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15557 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15558 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15559 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15560 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15561 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15562 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15563 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15564 (Qgnutls_bootprop_callbacks_verify): Make static.
15565
e7a6747f
AS
155662011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15567
19ed11ba
AS
15568 * callproc.c: Indentation fixup.
15569
e7a6747f 15570 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
15571 (wait_for_termination, interruptible_wait_for_termination):
15572 Move after wait_for_termination_1.
e7a6747f 15573
1ef14cb4
LMI
155742011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15575
15576 * sysdep.c (interruptible_wait_for_termination): New function
15577 which is like wait_for_termination, but allows keyboard
15578 interruptions.
15579
15580 * callproc.c (Fcall_process): Add (:file "file") as an option for
15581 the STDOUT buffer.
15582 (Fcall_process_region): Ditto.
15583
330d880c
EZ
155842011-04-30 Eli Zaretskii <eliz@gnu.org>
15585
8db90b73
EZ
15586 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15587 rather than `XVECTOR (FOO)->size'.
15588
330d880c
EZ
15589 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15590 inttypes.h, as a gnulib replacement is used if it not available in
15591 system headers.
15592
15cbd324
EZ
155932011-04-21 Eli Zaretskii <eliz@gnu.org>
15594
15595 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15596 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15597 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15598
15599 * coding.c (coding_alloc_by_realloc): Error out if destination
15600 will grow beyond MOST_POSITIVE_FIXNUM.
15601 (decode_coding_emacs_mule): Abort if there isn't enough place in
15602 charbuf for the composition carryover bytes. Reserve an extra
15603 space for up to 2 characters produced in a loop.
15604 (decode_coding_iso_2022): Abort if there isn't enough place in
15605 charbuf for the composition carryover bytes.
15606
156072011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 15608
ae940cca
EZ
15609 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15610 aborting when %lld or %lll format is passed.
15611 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15612 %llo or %llx format is passed. (Bug#8545)
15613
03ab8921
EZ
15614 * window.c (window_scroll_line_based): Use a marker instead of
15615 simple variables to record original value of point. (Bug#7952)
15616
afda1437
EZ
15617 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15618 produced by %s or %c overflows available buffer space. (Bug#8545)
15619
f76dee0c
PE
156202011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15621
15622 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 15623 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 15624
fdc5744d
JB
156252011-04-28 Juanma Barranquero <lekktu@gmail.com>
15626
15627 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15628
638f053a
JB
156292011-04-28 Juanma Barranquero <lekktu@gmail.com>
15630
15631 * keyboard.c (Qdelayed_warnings_hook): Define.
15632 (command_loop_1): Run `delayed-warnings-hook'
15633 if Vdelayed_warnings_list is non-nil.
15634 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15635 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15636
d178f871
EZ
156372011-04-28 Eli Zaretskii <eliz@gnu.org>
15638
15639 * doprnt.c (doprnt): Don't return value smaller than the buffer
15640 size if the message was truncated. (Bug#8545).
15641
b124fd93
JB
156422011-04-28 Juanma Barranquero <lekktu@gmail.com>
15643
15644 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15645 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15646
e810457d
PE
156472011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15648
15649 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15650
ea51cceb
JB
156512011-04-27 Juanma Barranquero <lekktu@gmail.com>
15652
15653 * makefile.w32-in: Update dependencies.
15654
94dcfacf
EZ
156552011-04-27 Eli Zaretskii <eliz@gnu.org>
15656
15657 Improve `doprnt' and its usage. (Bug#8545)
15658 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15659 `format_end'. Remove support for %l as a conversion specifier.
15660 Don't use xrealloc. Improve diagnostics when the %l size modifier
15661 is used. Update the commentary.
15662
15663 * eval.c (verror): Simplify calculation of size_t.
15664
15665 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15666 messages.
15667
f61f41d7
PE
156682011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15669
15670 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15671 change.
15672
96fb4434
PE
156732011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15674
15675 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15676 This makes this file independent of the recent pseudovector change.
15677
671875da 156782011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 15679
69e9b5a3
PE
15680 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15681
b5f869a7 15682 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 15683 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 15684 Remove unused local.
c8926152 15685 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 15686
841a1577 15687 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
15688 GCC 4.6.0 optimizes based on type-based alias analysis.
15689 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
15690 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15691 != &v->size, and therefore "v->size = 1; b->size = 2; return
15692 v->size;" must therefore return 1. This assumption is incorrect
15693 for Emacs, since it type-puns struct Lisp_Vector * with many other
15694 types. To fix this problem, this patch adds a new type struct
f904488f 15695 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
15696 and pseudovectors, and helps optimizing compilers not get fooled
15697 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15698 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
15699 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15700 the size member.
eab3844f
PE
15701 (XSETPVECTYPE): Rewrite in terms of new macro.
15702 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15703 This is a bit clearer, and further avoids the possibility of
15704 undesirable aliasing.
15705 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 15706 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
15707 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15708 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
15709 (ASIZE): Now uses header.size rather than size.
15710 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
15711 to avoid the hassle of writing XVECTOR (foo)->header.size.
15712 (struct vectorlike_header): New type.
eab3844f
PE
15713 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15714 object, to help avoid aliasing.
15715 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15716 (SUBRP): Likewise, since Lisp_Subr is a special case.
15717 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15718 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15719 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 15720 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
15721 changed to be "header.size" and "header.next".
15722 * buffer.h (struct buffer): Likewise.
15723 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15724 * frame.h (struct frame): Likewise.
15725 * process.h (struct Lisp_Process): Likewise.
15726 * termhooks.h (struct terminal): Likewise.
15727 * window.c (struct save_window_data, struct saved_window): Likewise.
15728 * window.h (struct window): Likewise.
15729 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15730 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15731 * buffer.c (init_buffer_once): Likewise.
15732 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15733 special case.
15734 * process.c (Fformat_network_address): Use local var for size,
15735 for brevity.
15736
0df1eac5
PE
15737 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15738
847ab9d1 15739 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
15740 * data.c (atof): Remove decl; no longer used or needed.
15741 (digit_to_number): Move to lread.c.
15742 (Fstring_to_number): Use new string_to_number function, to be
15743 consistent with how the Lisp reader treats infinities and NaNs.
15744 Do not assume that floating-point numbers represent EMACS_INT
15745 without losing information; this is not true on most 64-bit hosts.
15746 Avoid double-rounding errors, by insisting on integers when
15747 parsing non-base-10 numbers, as the documentation specifies.
15748 * lisp.h (string_to_number): New decl, replacing ...
15749 (isfloat_string): Remove.
bc0a5c13 15750 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 15751 (read1): Do not accept +. and -. as integers; this
452f4150
PE
15752 appears to have been a coding error. Similarly, do not accept
15753 strings like +-1e0 as floating point numbers. Do not report
15754 overflow for integer overflows unless the base is not 10 which
15755 means we have no simple and reliable way to continue.
15756 Break out the floating-point parsing into a new
15757 function string_to_number, so that Fstring_to_number parses
15758 floating point numbers consistently with the Lisp reader.
04f2d78b 15759 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
15760 (E_CHAR, EXP_INT): Remove, replacing with ...
15761 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15762 (string_to_number): New function, replacing isfloat_string.
15763 This function checks for valid syntax and produces the resulting
15764 Lisp float number too. Rework it so that string-to-number
bc0a5c13 15765 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
15766 so that overflow for non-base-10 numbers is reported only when
15767 there's no portable and simple way to convert to floating point.
452f4150 15768
67769ffc
PE
15769 * textprop.c (set_text_properties_1): Rewrite for clarity,
15770 and to avoid GCC warning about integer overflow.
15771
c20db43f
PE
15772 * intervals.h (struct interval): Use EMACS_INT for members
15773 where EMACS_UINT might cause problems. See
15774 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15775 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15776 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15777 All uses changed.
37aa2f85
PE
15778 (offset_intervals): Tell GCC not to worry about length overflow
15779 when negating a negative length.
c20db43f 15780
2538aa2f
PE
15781 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15782 (overrun_check_free): Likewise.
15783
f2d3008d
PE
15784 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15785 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15786 word size.
15787
ec8df744
PE
15788 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15789 (gnutls_make_error): Rename local to avoid shadowing.
15790 (gnutls_emacs_global_deinit): ifdef out; not used.
15791 (Fgnutls_boot): Use const for pointer to readonly storage.
15792 Comment out unused local. Fix pointer signedness problems.
15793
640ee02d
PE
15794 * lread.c (openp): Don't stuff size_t into an 'int'.
15795 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15796 about possible signed overflow.
15797
6048fb2a
PE
15798 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15799 (GDK_KEY_g): Don't define if already defined.
15800 (xg_prepare_tooltip): Avoid pointer signedness problem.
15801 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15802
fa3c87e1
PE
15803 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15804 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15805
2172544b
PE
15806 * xfns.c (Fx_window_property): Simplify a bit,
15807 to make a bit faster and to avoid GCC 4.6.0 warning.
15808 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15809
9b821a21
PE
15810 * fns.c (internal_equal): Don't assume size_t fits in int.
15811
3c616cfa
PE
15812 * alloc.c (compact_small_strings): Tighten assertion a little.
15813
c2982e87
PE
15814 Replace pEd with more-general pI, and fix some printf arg casts.
15815 * lisp.h (pI): New macro, generalizing old pEd macro to other
15816 conversion specifiers. For example, use "...%"pI"d..." rather
15817 than "...%"pEd"...".
15818 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 15819 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
15820 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15821 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15822 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15823 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15824 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15825 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15826 64-bit hosts.
15827 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15828 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15829 * print.c (safe_debug_print, print_object): Likewise.
15830 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15831 to int.
6f04d126
PE
15832 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15833 avoiding the 0 flag, which is not portable.
c2982e87
PE
15834 * process.c (Fmake_network_process): Use pI to avoid cast.
15835 * region-cache.c (pp_cache): Likewise.
15836 * xdisp.c (decode_mode_spec): Likewise.
15837 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15838 behavior on 64-bit hosts with printf arg.
6f04d126 15839 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
15840 (x_stop_queuing_selection_requests): Likewise.
15841 (x_get_window_property): Don't truncate byte count to an 'int'
15842 when tracing.
0b432f21 15843
5e073ec7
PE
15844 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15845 here, since it parses constructs like leading '-' and spaces,
15846 which are not wanted; and it overflows with large numbers.
15847 Instead, simply match F[0-9]+, which is what is wanted anyway.
15848
36372bf9
PE
15849 * alloc.c: Remove unportable assumptions about struct layout.
15850 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15851 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15852 (allocate_vectorlike, make_pure_vector): Use the new macros,
15853 plus offsetof, to remove unportable assumptions about struct layout.
15854 These assumptions hold on all porting targets that I know of, but
15855 they are not guaranteed, they're easy to remove, and removing them
15856 makes further changes easier.
15857
0b432f21
PE
15858 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15859 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
15860 (string_overrun_cookie): Now const. Use initializers that
15861 don't formally overflow signed char, to avoid warnings.
000098c1
PE
15862 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15863 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
15864 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15865 multiple of sizeof (EMACS_INT); it need not be, if
15866 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 15867 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 15868
895009e1
JB
158692011-04-26 Juanma Barranquero <lekktu@gmail.com>
15870
15871 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15872
6a7a1b0b
TZ
158732011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15874
15875 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 15876 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
15877 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15878
841a1577 158792011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
15880
15881 * lisp.h (Qdebug): List symbol.
895009e1 15882 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
15883 * keyboard.c (debug-on-event): New variable.
15884 (handle_user_signal): Break into debugger when debug-on-event
15885 matches the current signal symbol.
15886
f2d3ba6f
DN
158872011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15888
15889 * alloc.c (check_sblock, check_string_bytes)
15890 (check_string_free_list): Convert to standard C.
15891
42ce4c63
TZ
158922011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15893
15894 * w32.c (emacs_gnutls_push): Fix typo.
15895
825cd63c
EZ
158962011-04-25 Eli Zaretskii <eliz@gnu.org>
15897
fb11d64d
EZ
15898 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15899 "cast to pointer from integer of different size".
15900
825cd63c
EZ
15901 Improve doprnt and its use in verror. (Bug#8545)
15902 * doprnt.c (doprnt): Document the set of format control sequences
15903 supported by the function. Use SAFE_ALLOCA instead of always
15904 using `alloca'.
15905
15906 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15907 is one byte too soon. Don't use xrealloc; instead xfree and
15908 xmalloc anew.
15909
e061a11b
TZ
159102011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15911
15912 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15913 callbacks stage.
15914
15915 * gnutls.c: Renamed global_initialized to
15916 gnutls_global_initialized. Added internals for the
15917 :verify-hostname-error, :verify-error, and :verify-flags
15918 parameters of `gnutls-boot' and documented those parameters in the
15919 docstring. Start callback support.
9173deec
JB
15920 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15921 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15922 on error. Return error code.
e061a11b
TZ
15923 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15924 (emacs_gnutls_read): Likewise.
15925 (Fgnutls_boot): Return handshake error code.
15926 (emacs_gnutls_handle_error): New function.
15927 (wsaerror_to_errno): Likewise.
15928
15929 * w32.h (emacs_gnutls_pull): Add prototype.
15930 (emacs_gnutls_push): Likewise.
15931
15932 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15933 (emacs_gnutls_push): Likewise.
15934
159352011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15936
15937 * process.c (wait_reading_process_output): Check if GnuTLS
15938 buffered some data internally if no FDs are set for TLS
15939 connections.
15940
15941 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15942 (LIBS): Link to USER_LIBS.
15943 ($(BLD)/gnutls.$(0)): New target.
15944
fa6996bc
EZ
159452011-04-24 Eli Zaretskii <eliz@gnu.org>
15946
eb35682e
EZ
15947 * xdisp.c (handle_single_display_spec): Rename the
15948 display_replaced_before_p argument into display_replaced_p, to
15949 make it consistent with the commentary. Fix typos in the
15950 commentary.
15951
e2ad650c
EZ
15952 * textprop.c (syms_of_textprop): Remove dead code.
15953 (copy_text_properties): Delete obsolete commentary about an
15954 interface that was deleted long ago. Fix typos in the description
15955 of arguments.
15956
1b2de274
EZ
15957 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15958 to changes in oldXMenu/XMenu.h from 2011-04-16.
15959 <menu_help_message, prev_menu_help_message>: Constify.
15960 (IT_menu_make_room): menu->help_text is now `const char **';
15961 adjust.
15962
15963 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15964 to changes in oldXMenu/XMenu.h from 2011-04-16.
15965 (struct XMenu): Declare `help_text' `const char **'.
15966
15967 * xfaces.c <Qunspecified>: Make extern again.
15968
15969 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 15970 required by POSIX.
1b2de274 15971
762b15be
EZ
15972 * doc.c (get_doc_string): Improve the format passed to `error'.
15973
15974 * doprnt.c (doprnt): Improve commentary.
15975
15976 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15977
15978 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15979 them with etags.
15980
f1052e5d
EZ
15981 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15982 changes in globals.h immediately force recompilation.
762b15be
EZ
15983 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15984 $(CURDIR)/s/ms-w32.h.
15985 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 15986
fa6996bc
EZ
15987 * character.c (Fchar_direction): Function deleted.
15988 (syms_of_character): Don't defsubr it.
15989 <char-direction-table>: Deleted.
15990
e6c3da20
EZ
159912011-04-23 Eli Zaretskii <eliz@gnu.org>
15992
15993 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15994 * doprnt.c: Include limits.h.
15995 (SIZE_MAX): New macro.
04f2d78b
CB
15996 (doprnt): Return a size_t value. 2nd arg is now size_t.
15997 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
15998 Improve overflow protection. Support `l' modifier for integer
15999 conversions. Support %l conversion. Don't assume an EMACS_INT
16000 argument for integer conversions and for %c.
16001
16002 * lisp.h (doprnt): Restore prototype.
16003
16004 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16005 $(SRC)/character.h.
16006
16007 * Makefile.in (base_obj): Add back doprnt.o.
16008
16009 * deps.mk (doprnt.o): Add back prerequisites.
16010 (callint.o): Depend on character.h.
16011
16012 * eval.c (internal_lisp_condition_case): Include the handler
16013 representation in the error message.
16014 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
16015 when breaking from the loop.
16016
16017 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
16018
16019 * callint.c (Fcall_interactively): When displaying error message
16020 about invalid control letter, pass the character's codepoint, not
16021 a pointer to its multibyte form. Improve display of the character
16022 in octal and display also its hex code.
16023
16024 * character.c (char_string): Use %x to display the (unsigned)
16025 codepoint of an invalid character, to avoid displaying a bogus
16026 negative value.
16027
16028 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16029 `error', not SYMBOL_NAME itself.
16030
16031 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16032 character arguments to `error'.
16033
16034 * charset.c (check_iso_charset_parameter): Fix incorrect argument
16035 to `error' in error message about FINAL_CHAR argument. Make sure
16036 FINAL_CHAR is a character, and use %c when it is passed as
16037 argument to `error'.
16038
4ffd0d6b 160392011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
16040
16041 * s/ms-w32.h (localtime): Redirect to sys_localtime.
16042
16043 * w32.c: Include <time.h>.
16044 (sys_localtime): New function.
16045
4ffd0d6b 160462011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
16047
16048 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16049
4ffd0d6b 16050 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 16051
4ffd0d6b 160522011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 16053
4ffd0d6b
GM
16054 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16055 zombies (Bug#8467).
aac0c6e3 16056
04c56954
EZ
160572011-04-19 Eli Zaretskii <eliz@gnu.org>
16058
16059 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16060 gl_state.e_property when gl_state.object is Qt.
16061
16062 * insdel.c (make_gap_larger): Remove limitation of buffer size
16063 to <= INT_MAX.
16064
16a43933
CY
160652011-04-18 Chong Yidong <cyd@stupidchicken.com>
16066
16067 * xdisp.c (lookup_glyphless_char_display)
16068 (produce_glyphless_glyph): Handle cons cell entry in
16069 glyphless-char-display.
16070 (Vglyphless_char_display): Document it.
16071
16072 * term.c (produce_glyphless_glyph): Handle cons cell entry in
16073 glyphless-char-display.
16074
4581706e
CY
160752011-04-17 Chong Yidong <cyd@stupidchicken.com>
16076
16077 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16078
16079 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16080
16081 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16082 definition for no-X builds.
16083
4887c6e2 160842011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 16085
fd35b6f9
PE
16086 Static checks with GCC 4.6.0 and non-default toolkits.
16087
5c1ccb01
PE
16088 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16089
006c5daa
PE
16090 * process.c (keyboard_bit_set): Define only if SIGIO.
16091 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16092 (send_process): Repair possible setjmp clobbering.
16093
efc736d3
PE
16094 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16095
4e2fe2e6
PE
16096 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16097
f97334a2
PE
16098 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16099
4e75f29d
PE
16100 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16101 Define only if needed.
16102
90efadd1
PE
16103 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16104 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 16105 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 16106
3c647824
PE
16107 * dispextern.h (struct redisplay_interface): Rename param
16108 to avoid shadowing.
e264f262 16109 * termhooks.h (struct terminal): Likewise.
761383f4 16110 * xterm.c (xembed_send_message): Likewise.
3c647824 16111
b58c5c4a
PE
16112 * insdel.c (make_gap_smaller): Define only if
16113 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16114
cad59032
PE
16115 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16116 it.
16117
c339dc2e
PE
16118 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16119 so that we aren't warned about unused symbols.
16120
91a3e27b
PE
16121 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16122
399c71d3 16123 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 16124
8ffc96f5
PE
16125 * xfns.c (x_real_positions): Mark locals as initialized.
16126
eef9bc79
PE
16127 * xmenu.c (xmenu_show): Don't use uninitialized vars.
16128
098db9dd
PE
16129 * xterm.c: Fix problems found by static analysis with other toolkits.
16130 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
16131 (x_dispatch_event): Declare static if USE_GTK, and
16132 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 16133 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 16134 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
16135 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16136 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 16137
eb18f6cc
PE
16138 * xmenu.c (menu_help_callback): Pointer type fixes.
16139 Use const pointers when pointing at readonly data. Avoid pointer
16140 signedness clashes.
16141 (FALSE): Remove unused macro.
16142 (update_frame_menubar): Remove unused decl.
16143
1fe72bf8
PE
16144 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
16145
60d9e1db
PE
16146 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
16147 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
16148 (single_menu_item): Rename local to avoid shadowing.
16149
39261c26
PE
16150 * keyboard.c (make_lispy_event): Remove unused local var.
16151
018c5e19
PE
16152 * frame.c, frame.h (x_get_resource_string): Bring this back, but
16153 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
16154
63d2b86e
PE
16155 * bitmaps: Change bitmaps from unsigned char back to the X11
16156 compatible char. Avoid the old compiler warnings about
16157 out-of-range initializers by using, for example, '\xab' rather
16158 than 0xab.
16159
aefd87e1
PE
16160 * xgselect.c (xgselect_initialize): Check vs interface
16161 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
16162
bf501fb9
PE
16163 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
16164
e9829fdf
PE
16165 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
16166 to read-only memory.
16167
1086c095
PE
16168 * fns.c (vector): Remove; this old hack is no longer needed.
16169
2baccd04 16170 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 16171 Remove unused var.
dde42981 16172 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 16173
72391843 16174 * xrdb.c (x_load_resources): Omit unused local.
3565b346 16175
436c16df 16176 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 16177 (x_window): Rename locals to avoid shadowing.
dc5ddd85 16178 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 16179
92bb796d 16180 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 16181 (x_term_init): Remove local to avoid shadowing.
92bb796d 16182
764430a3 16183 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
16184
16185 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
16186 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
16187
d1dfb56c
EZ
161882011-04-16 Eli Zaretskii <eliz@gnu.org>
16189
c4354cb4
EZ
16190 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
16191
d1dfb56c
EZ
16192 Fix regex.c, syntax.c and friends for buffers > 2GB.
16193 * syntax.h (struct gl_state_s): Declare character position members
16194 EMACS_INT.
16195
16196 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
16197
04f2d78b
CB
16198 * textprop.c (verify_interval_modification, interval_of):
16199 Declare arguments EMACS_INT.
d1dfb56c
EZ
16200
16201 * intervals.c (adjust_intervals_for_insertion): Declare arguments
16202 EMACS_INT.
16203
16204 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
16205
16206 * indent.c (Fvertical_motion): Local variable it_start is now
16207 EMACS_INT.
16208
16209 * regex.c (re_match, re_match_2, re_match_2_internal)
16210 (bcmp_translate, regcomp, regexec, print_double_string)
16211 (group_in_compile_stack, re_search, re_search_2, regex_compile)
16212 (re_compile_pattern, re_exec): Declare arguments and local
16213 variables `size_t' and `ssize_t' and return values `regoff_t', as
16214 appropriate.
16215 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16216 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16217 <compile_stack_type>: `size' and `avail' are now `size_t'.
16218
16219 * regex.h <regoff_t>: Use ssize_t, not int.
16220 (re_search, re_search_2, re_match, re_match_2): Arguments that
16221 specify buffer/string position and length are now ssize_t and
16222 size_t. Return type is regoff_t.
16223
613052cd
BK
162242011-04-16 Ben Key <bkey76@gmail.com>
16225
16226 * nsfont.m: Fixed bugs in ns_get_family and
16227 ns_descriptor_to_entity that were caused by using free to
16228 deallocate memory blocks that were allocated by xmalloc (via
16229 xstrdup). This caused Emacs to crash when compiled with
16230 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16231 --enable-checking=xmallocoverrun). xfree is now used to
16232 deallocate these memory blocks.
16233
4170f62f 162342011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 16235
71b41406
PE
16236 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16237
9587a89d
PE
16238 emacs_write: Accept and return EMACS_INT for sizes.
16239 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16240 et seq.
16241 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16242 Accept and return EMACS_INT.
16243 (emacs_gnutls_write): Return the number of bytes written on
16244 partial writes.
16245 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
16246 (emacs_read, emacs_write): Remove check for negative size, as the
16247 Emacs source code has been audited now.
9587a89d
PE
16248 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16249 (emacs_read, emacs_write): Use it.
273a5f82
PE
16250 * process.c (send_process): Adjust to the new signatures of
16251 emacs_write and emacs_gnutls_write. Do not attempt to store
16252 a byte offset into an 'int'; it might overflow.
9587a89d 16253 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 16254
3e047f51
PE
16255 * sound.c: Don't assume sizes fit in 'int'.
16256 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 16257 Return EMACS_INT, not int.
3e047f51 16258 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
16259 Accept EMACS_INT, not int.
16260 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
16261 record read return values.
16262
cc39a9db
BK
162632011-04-15 Ben Key <bkey76@gmail.com>
16264
c9d0ec6d
JB
16265 * keyboard.c (Qundefined): Don't declare static since it is used
16266 in nsfns.m.
16267 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16268 static since they are used in nsfont.m.
cc39a9db 16269
6c60eb9f
SM
162702011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
16271
16272 * process.c (Qprocessp): Don't declare static.
16273 * lisp.h (Qprocessp): Declare again.
16274
7990b61a
JB
162752011-04-15 Juanma Barranquero <lekktu@gmail.com>
16276
16277 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16278
5d4cb038
PE
162792011-04-14 Paul Eggert <eggert@cs.ucla.edu>
16280
8bd7b830 16281 Improve C-level modularity by making more things 'static'.
cd64ea1d 16282
e3b27b31
PE
16283 Don't publish debugger-only interfaces to other modules.
16284 * lisp.h (safe_debug_print, debug_output_compilation_hack):
16285 (verify_bytepos, count_markers): Move decls to the only modules
16286 that need them.
16287 * region-cache.h (pp_cache): Likewise.
16288 * window.h (check_all_windows): Likewise.
16289 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16290
5d4cb038
PE
16291 * sysdep.c (croak): Now static, if
16292 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16293 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
16294
16295 * alloc.c (refill_memory_reserve): Now static if
16296 !defined REL_ALLOC || defined SYSTEM_MALLOC.
16297 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 16298
e87b6180
PE
16299 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
16300 Define only if USE_LUCID.
16301
ac64929e
PE
16302 * xrdb.c (x_customization_string, x_rm_string): Now static.
16303
6f37259d
PE
16304 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
16305 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
16306
1683e3ab
PE
16307 * xdisp.c (draw_row_with_mouse_face): Now static.
16308 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
16309
de9c2632
PE
16310 * window.h (check_all_windows): Mark externally visible.
16311
2b96acb7
PE
16312 * window.c (window_deletion_count): Now static.
16313
16314 * undo.c: Make symbols static if they're not exported.
16315 (last_undo_buffer, last_boundary_position, pending_boundary):
16316 Now static.
16317
50436f33
PE
16318 * textprop.c (interval_insert_behind_hooks): Now static.
16319 (interval_insert_in_front_hooks): Likewise.
16320
64520e5c
PE
16321 * term.c: Make symbols static if they're not exported.
16322 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
16323 (max_frame_lines, tty_set_terminal_modes):
16324 (tty_reset_terminal_modes, tty_turn_off_highlight):
16325 (get_tty_terminal): Now static.
16326 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
16327 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 16328 HAVE_WINDOW_SYSTEM.
64520e5c
PE
16329 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16330 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16331
1fa53021
PE
16332 * sysdep.c: Make symbols static if they're not exported.
16333 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16334 Now static.
16335 (sigprocmask_set, full_mask): Remove; unused.
16336 (wait_debugging): Mark as visible.
16337 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16338 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16339
d4b43b22
PE
16340 * syntax.c (syntax_temp): Define only if !__GNUC__.
16341
b7c513d0
PE
16342 * sound.c (current_sound_device, current_sound): Now static.
16343
989b29ad
PE
16344 * search.c (searchbufs, searchbuf_head): Now static.
16345
13a55a78
PE
16346 * scroll.c (scroll_cost): Remove; unused.
16347 * dispextern.h (scroll_cost): Remove decl.
16348
de68a1fc
PE
16349 * region-cache.h (pp_cache): Mark as externally visible.
16350
40ccffa6
PE
16351 * process.c: Make symbols static if they're not exported.
16352 (process_tick, update_tick, create_process, chan_process):
16353 (Vprocess_alist, proc_buffered_char, datagram_access):
16354 (fd_callback_data, send_process_frame, process_sent_to): Now static.
16355 (deactivate_process): Mark defn as static, as well as decl.
16356 * lisp.h (create_process): Remove decl.
16357 * process.h (chan_process, Vprocess_alist): Remove decls.
16358
ad64fc97
PE
16359 * print.c: Make symbols static if they're not exported.
16360 (print_depth, new_backquote_output, being_printed, print_buffer):
16361 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16362 (print_interval, print_number_index, initial_stderr_stream):
16363 Now static.
16364 * lisp.h (Fprinc): Remove decl.
16365 (debug_output_compilation_hack): Mark as externally visible.
16366
adddb265
PE
16367 * sysdep.c (croak): Move decl from here to syssignal.h.
16368 * syssignal.h (croak): Put it here, so the API can be checked when
16369 'croak' is called from dissociate_if_controlling_tty.
16370
1717ede2
PE
16371 * minibuf.c: Make symbols static if they're not exported.
16372 (minibuf_save_list, choose_minibuf_frame): Now static.
16373 * lisp.h (choose_minibuf_frame): Remove decl.
16374
fa5fb2bc
PE
16375 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16376
1e3890d1
PE
16377 * lread.c: Make symbols static if they're not exported.
16378 (read_objects, initial_obarray, oblookup_last_bucket_number):
16379 Now static.
16380 (make_symbol): Remove; unused.
16381 * lisp.h (initial_obarray, make_symbol): Remove decls.
16382
8a1414fa
PE
16383 * keyboard.c: Make symbols static if they're not exported.
16384 (single_kboard, recent_keys_index, total_keys, recent_keys):
16385 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16386 (this_single_command_key_start, echoing, last_auto_save):
16387 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16388 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16389 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16390 (Vlispy_mouse_stem, double_click_count):
16391 Now static.
16392 (force_auto_save_soon): Define only if SIGDANGER.
16393 (ignore_mouse_drag_p): Now static if
16394 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16395 (print_help): Remove; unused.
16396 (stop_character, last_timer_event): Mark as externally visible.
16397 * keyboard.h (ignore_mouse_drag_p): Declare only if
16398 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16399 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16400 * lisp.h (echoing): Remove decl.
16401 (force_auto_save_soon): Declare only if SIGDANGER.
16402 * xdisp.c (redisplay_window): Simplify code, to make it more
16403 obvious that ignore_mouse_drag_p is not accessed if !defined
16404 USE_GTK && !defined HAVE_NS.
16405
93ea6e8f
PE
16406 * intervals.c: Make symbols static if they're not exported.
16407 (merge_properties_sticky, merge_interval_right, delete_interval):
16408 Now static.
16409 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16410
77382fcc
PE
16411 * insdel.c: Make symbols static if they're not exported.
16412 However, leave prepare_to_modify_buffer alone. It's never
16413 called from outside this function, but that appears to be a bug.
16414 (combine_after_change_list, combine_after_change_buffer):
4889fc82 16415 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
16416 (adjust_after_replace_noundo): Remove; unused.
16417 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 16418 (signal_before_change): Remove decls.
77382fcc 16419
9306c32e
PE
16420 * indent.c (val_compute_motion, val_vmotion): Now static.
16421
cd44d2eb
PE
16422 * image.c: Make symbols static if they're not exported.
16423 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16424 if USE_GTK.
16425 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16426 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16427
ad9a7a06
PE
16428 * fringe.c (standard_bitmaps): Now static.
16429 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16430
81626931
PE
16431 * frame.c: Make symbols static if they're not exported.
16432 (x_report_frame_params, make_terminal_frame): Now static.
16433 (get_frame_param): Now static, unless HAVE_NS.
16434 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16435 (x_get_resource_string): Remove; not used.
16436 * frame.h (make_terminal_frame, x_report_frame_params):
16437 (x_get_resource_string); Remove decls.
16438 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16439 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16440
239f9db9
PE
16441 * font.c, fontset.c: Make symbols static if they're not exported.
16442 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16443 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16444 * font.c (font_close_object): Now static.
16445 * font.h (font_close_object): Remove.
16446 * fontset.c (FONTSET_OBJLIST): Remove.
16447 (free_realized_fontset) #if-0 the body, which does nothing.
16448 (face_suitable_for_char_p): #if-0, as it's never called.
16449 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
16450 * xfaces.c (face_at_string_position):
16451 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
16452 since 0 is always ASCII.
16453
dfcf3579
PE
16454 * fns.c (weak_hash_tables): Now static.
16455
5045092b
PE
16456 * fileio.c: Make symbols static if they're not exported.
16457 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16458 (Vwrite_region_annotation_buffers): Now static.
16459
57a96f5c
PE
16460 * eval.c: Make symbols static if they're not exported.
16461 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16462 * lisp.h (backtrace_list): Remove decl.
16463
35f08c38
PE
16464 * emacs.c: Make symbols static if they're not exported.
16465 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16466 (fatal_error_code, fatal_error_signal_hook, standard_args):
16467 Now static.
16468 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16469 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16470 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16471 * lisp.h (fatal_error_signal_hook): Remove decl.
16472 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16473
f44bd759
PE
16474 * editfns.c: Move a (normally-unused) function to its only use.
16475 * editfns.c, lisp.h (get_operating_system_release): Remove.
16476 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16477 worth the hassle of breaking this out.
16478
b532497d
PE
16479 * xterm.c: Make symbols static if they're not exported.
16480 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16481 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16482 (x_destroy_window, x_delete_display):
16483 Now static.
16484 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16485 (x_mouse_leave): Remove; unused.
16486 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16487 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16488 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16489 Remove decls.
16490 (x_mouse_leave): Declare only if WINDOWSNT.
16491 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16492 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16493 USE_X_TOOLKIT.
16494
1675728f
PE
16495 * ftxfont.c: Make symbols static if they're not exported.
16496 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16497 HAVE_FREETYPE.
16498 * font.h (ftxfont_driver): Likewise.
16499
e4cebfca
PE
16500 * xfns.c: Make symbols static if they're not exported.
16501 (x_last_font_name, x_display_info_for_name):
16502 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16503 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16504 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16505 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16506 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16507 (last_show_tip_args): Now static.
16508 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16509 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16510 (x_screen_planes): Remove; unused.
16511 * dispextern.h (x_screen_planes): Remove decl.
16512
5bf46f05
PE
16513 * dispnew.c: Make symbols static if they're not exported.
16514 * dispextern.h (redraw_garbaged_frames, scrolling):
16515 (increment_row_positions): Remove.
16516 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16517 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16518 Now static.
16519 (redraw_garbaged_frames): Remove; unused.
16520
435f4c28
PE
16521 * xfaces.c: Make symbols static if they're not exported.
16522 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16523 Remove decls.
16524 * xterm.h (defined_color): Remove decls.
16525 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16526 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16527 (menu_face_changed_default, defined_color, free_realized_face):
16528 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16529 (ascii_face_of_lisp_face): Remove; unused.
16530
8524aef3
PE
16531 * xdisp.c: Make symbols static if they're not exported.
16532 * dispextern.h (scratch_glyph_row, window_box_edges):
16533 (glyph_to_pixel_coords, set_cursor_from_row):
16534 (get_next_display_element, set_iterator_to_next):
16535 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16536 (show_mouse_face): Remove decls
16537 * frame.h (message_buf_print): Likewise.
16538 * lisp.h (pop_message, set_message, check_point_in_composition):
16539 Likewise.
16540 * xterm.h (set_vertical_scroll_bar): Likewise.
16541 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16542 (message_buf_print, scratch_glyph_row, displayed_buffer):
16543 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16544 (get_next_display_element, show_mouse_face, window_box_edges):
16545 (frame_to_window_pixel_xy, check_point_in_composition):
16546 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16547 (glyph_to_pixel_coords): Remove; unused.
16548
16390cd2
PE
16549 * dired.c (file_name_completion): Now static.
16550
16551 * dbusbind.c (xd_in_read_queued_messages): Now static.
16552
a25f4dfa
PE
16553 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16554 * data.c (circular_list_error): Remove.
16555
14a9c8df
PE
16556 * commands.h (last_point_position, last_point_position_buffer):
16557 (last_point_position_window): Remove decls.
16558 * keyboard.c: Make these variables static.
16559
04f2d78b
CB
16560 * coding.h (coding, code_convert_region, encode_coding_gap):
16561 Remove decls.
74ab6df5
PE
16562 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16563 (iso_code_class, detect_coding, code_convert_region): Now static.
16564 (encode_coding_gap): Remove; unused.
16565
38dfbee1
PE
16566 * chartab.c (chartab_chars, chartab_bits): Now static.
16567
a2cb4e63
PE
16568 * charset.h (charset_iso_8859_1): Remove decl.
16569 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16570 Now static.
16571
127198fd
PE
16572 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16573 * ccl.c (Vccl_program_table): Now static.
16574 (check_ccl_update): Remove; unused.
16575
d85b608f
PE
16576 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16577 * category.h: ... from here.
16578 * category.c (check_category_table, set_category_set): Now static.
16579
31cd66f3
PE
16580 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16581 * lisp.h: Remove these decls.
16582
c358e587
PE
16583 * buffer.c (buffer_count): Remove unused var.
16584
e78aecca
PE
16585 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16586 so that it's not optimized away.
16587 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16588 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16589 exported only to the debugger.
16590
e192d7d3 16591 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 16592 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 16593
92470028
PE
16594 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16595 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16596 was inaccessible from Lisp.
16597 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16598 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16599
244ed907
PE
16600 alloc.c: Import and export fewer symbols, and remove unused items.
16601 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16602 is defined.
16603 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16604 it's not optimized away by whole-program optimization.
16605 (message_enable_multibyte, free_misc): Remove.
16606 (catchlist, handlerlist, mark_backtrace):
16607 Declare only if BYTE_MARK_STACK.
16608 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16609 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16610 (message_enable_multibyte): Remove decl.
16611 (free_misc, interval_free_list, float_block, float_block_index):
16612 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16613 (cons_free_list, last_marked_index):
16614 Now static.
16615 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16616 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16617 (mark_backtrace): Define only if BYTE_MARK_STACK.
16618 * xdisp.c (message_enable_multibyte): Now static.
16619
61c2b50e 16620 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
16621 This makes it easier for human readers (and static analyzers)
16622 to see whether these variables are used from other modules.
16623 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16624 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16625 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16626 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16627 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16628 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16629 * xmenu.c, xselect.c:
16630 Declare Q* vars static if they are not used in other modules.
16631 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16632 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16633 Remove decls of unexported vars.
16634 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16635
95c82688
PE
16636 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16637
16a97296
PE
16638 Make Emacs functions such as Fatom 'static' by default.
16639 This makes it easier for human readers (and static analyzers)
16640 to see whether these functions can be called from other modules.
16641 DEFUN now defines a static function. To make the function external
16642 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
16643 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16644 (Finit_image_library):
16a97296
PE
16645 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16646 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16647 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16648 Remove decls, since these functions are now static.
16649 (Funintern, Fget_internal_run_time): New decls, since these functions
16650 were already external.
95c82688 16651
16a97296
PE
16652 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16653 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16654 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16655 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16656 * keyboard.c, keymap.c, lread.c:
16657 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16658 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16659 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16660 Mark functions with DEFUE instead of DEFUN,
16661 if they are used in other modules.
16662 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16663 decls for now-static functions.
16664 * buffer.h (Fdelete_overlay): Remove decl.
16665 * callproc.c (Fgetenv_internal): Mark as internal.
16666 * composite.c (Fremove_list_of_text_properties): Remove decl.
16667 (Fcomposition_get_gstring): New forward static decl.
16668 * composite.h (Fcomposite_get_gstring): Remove decl.
16669 * dired.c (Ffile_attributes): New forward static decl.
16670 * doc.c (Fdocumntation_property): New forward static decl.
16671 * eval.c (Ffetch_bytecode): New forward static decl.
16672 (Funintern): Remove extern decl; now in .h file where it belongs.
16673 * fileio.c (Fmake_symbolic_link): New forward static decl.
16674 * image.c (Finit_image_library): New forward static decl.
16675 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16676 * intervals.h (Fprevious_property_change):
16677 (Fremove_list_of_text_properties): Remove decls.
16678 * keyboard.c (Fthis_command_keys): Remove decl.
16679 (Fcommand_execute): New forward static decl.
16680 * keymap.c (Flookup_key): New forward static decl.
16681 (Fcopy_keymap): Now static.
16682 * keymap.h (Flookup_key): Remove decl.
16683 * process.c (Fget_process): New forward static decl.
16684 (Fprocess_datagram_address): Mark as internal.
16685 * syntax.c (Fsyntax_table_p): New forward static decl.
16686 (skip_chars): Remove duplicate decl.
16687 * textprop.c (Fprevious_property_change): New forward static decl.
16688 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16689 Now internal.
16690 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16691 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16692
785bbd42
PE
16693 * editfns.c (Fformat): Remove unreachable code.
16694
8b913b57
AS
166952011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16696
16697 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16698 change. (Bug#8496)
16699
a6744a35
EZ
167002011-04-13 Eli Zaretskii <eliz@gnu.org>
16701
16702 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16703 when at ZV. (Bug#8487)
16704
e7974947
AS
167052011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16706
baad03f0
AS
16707 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16708 (Bug#8437)
16709 * keyboard.c (parse_tool_bar_item): Likewise.
16710 * sound.c (sound_cleanup, alsa_close): Likewise.
16711 * termcap.c (tgetent): Likewise.
16712 * xfns.c (x_default_font_parameter): Likewise.
16713 * xsettings.c (read_and_apply_settings): Likewise.
16714
e7974947
AS
16715 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16716 (overrun_check_free): Protoize.
16717
28272684
PE
167182011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16719
16720 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16721 since callers should never pass a negative size.
16722 Change the signature to match that of plain 'read' and 'write'; see
16723 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16724 * lisp.h: Update prototypes of emacs_write and emacs_read.
16725
11997c76
EZ
167262011-04-11 Eli Zaretskii <eliz@gnu.org>
16727
16728 * xdisp.c (redisplay_window): Don't try to determine the character
16729 position of the scroll margin if the window start point w->startp
e896f03c 16730 is outside the buffer's accessible region. (Bug#8468)
11997c76 16731
8a2cbd72
EZ
167322011-04-10 Eli Zaretskii <eliz@gnu.org>
16733
16734 Fix write-region and its subroutines for buffers > 2GB.
16735 * fileio.c (a_write, e_write): Modify declaration of arguments and
16736 local variables to support buffers larger than 2GB.
16737 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16738
16739 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16740 argument, local variables, and return value.
16741
16742 * lisp.h: Update prototypes of emacs_write and emacs_read.
16743
16744 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16745
4073e537 167462011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 16747
1ebfdcb6
PE
16748 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16749
b2ded58d
PE
16750 Fix more problems found by GCC 4.6.0's static checks.
16751
7d66342c
PE
16752 * xdisp.c (vmessage): Use a better test for character truncation.
16753
bbf47d44
PE
16754 * charset.c (load_charset_map): <, not <=, for optimization,
16755 and to avoid potential problems with integer overflow.
9248994d 16756 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 16757 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 16758 * editfns.c (Fformat): Likewise.
1e69125e 16759 * syntax.c (skip_chars): Likewise.
3befa583 16760
e3019616
PE
16761 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16762 This also lets GCC 4.6.0 generate slightly better loop code.
16763
becfa255
PE
16764 * callint.c (Fcall_interactively): <, not <=, for optimization.
16765 (Fcall_interactively): Count the number of arguments produced,
16766 not the number of arguments given. This is simpler and lets GCC
16767 4.6.0 generate slightly better code.
16768
dae0cd48
PE
16769 * ftfont.c: Distingish more carefully between FcChar8 and char.
16770 The previous code passed unsigned char * to a functions like
16771 strlen and xstrcasecmp that expect char *, which does not
16772 conform to the C standard.
16773 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16774 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16775 char * when the C standard requires it.
16776
76032d70
PE
16777 * keyboard.c (read_char): Remove unused var.
16778
eb3f1cc8
PE
16779 * eval.c: Port to Windows vsnprintf (Bug#8435).
16780 Include <limits.h>.
16781 (SIZE_MAX): Define if the headers do not.
16782 (verror): Do not give up if vsnprintf returns a negative count.
16783 Instead, grow the buffer. This ports to Windows vsnprintf, which
16784 does not conform to C99. Problem reported by Eli Zaretskii.
16785 Also, simplify the allocation scheme, by avoiding the need for
16786 calling realloc, and removing the ALLOCATED variable.
16787
70476b54
PE
16788 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16789
12020a9e
PE
16790 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16791 But keep the doprint source code for now, as we might revamp it
16792 and use it again (Bug#8435).
ea6c7ae6
PE
16793 * lisp.h (doprnt): Remove.
16794 * Makefile.in (base_obj): Remove doprnt.o.
16795 * deps.mk (doprnt.o): Remove.
16796
5fdb398c
PE
16797 error: Print 32- and 64-bit integers portably (Bug#8435).
16798 Without this change, on typical 64-bit hosts error ("...%d...", N)
16799 was used to print both 32- and 64-bit integers N, which relied on
16800 undefined behavior.
61bdb816 16801 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
16802 * lisp.h (error, verror): Mark as printf-like functions.
16803 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16804 Report overflow in size calculations when allocating printf buffer.
16805 Do not truncate output string at its first null byte.
16806 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16807 Truncate the output at a character boundary, since vsnprintf does not
16808 do that.
16809 * charset.c (check_iso_charset_parameter): Convert internal
16810 character to string before calling 'error', since %c now has the
16811 printf meaning.
16812 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16813 overflow when computing char to be passed to 'error'. Do not
16814 pass Lisp_Object to 'error'; pass the integer instead.
16815 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16816 formatted with plain %d.
16817
b189fa66
PE
16818 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16819
bff87ef0
PE
16820 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16821
7e2cac20
PE
16822 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16823
ce4d90b5
PE
16824 * xterm.c (x_catch_errors): Remove duplicate declaration.
16825
266c9547
PE
16826 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16827
79c49ad2
PE
16828 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16829
368f4090
JM
168302011-04-10 Jim Meyering <meyering@redhat.com>
16831
16832 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16833 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16834 return ssize_t not "int", and use size_t as the buffer length.
16835 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16836 * gnutls.h: Update declarations.
16837 * process.c (read_process_output): Use ssize_t, to match.
16838 (send_process): Likewise.
16839
a32d4040
CY
168402011-04-09 Chong Yidong <cyd@stupidchicken.com>
16841
16842 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16843
8546720e 168442011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 16845
04f2d78b
CB
16846 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16847 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 16848
8546720e
GM
16849 * xterm.c (handle_one_xevent):
16850 * xmenu.c (create_and_show_popup_menu):
16851 * xselect.c (x_decline_selection_request)
16852 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 16853
0a2f5c1a 168542011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
16855
16856 Fix some uses of `int' instead of EMACS_INT.
16857 * search.c (string_match_1, fast_string_match)
16858 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16859 (scan_buffer, find_next_newline_no_quit)
16860 (find_before_next_newline, search_command, Freplace_match)
16861 (Fmatch_data): Make some `int' variables be EMACS_INT.
16862
16863 * xdisp.c (display_count_lines): 3rd argument and return value now
16864 EMACS_INT. All callers changed.
16865 (pint2hrstr): Last argument is now EMACS_INT.
16866
16867 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16868 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16869 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16870 (decode_coding_utf_16, decode_coding_emacs_mule)
16871 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16872 (decode_coding_ccl, decode_coding_charset)
16873 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16874 (decode_coding_iso_2022, decode_coding_emacs_mule)
16875 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16876 <char_offset, last_offset>: Declare EMACS_INT.
16877 (encode_coding_utf_8, encode_coding_utf_16)
16878 (encode_coding_emacs_mule, encode_invocation_designation)
16879 (encode_designation_at_bol, encode_coding_iso_2022)
16880 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16881 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16882 Declare EMACS_INT.
16883 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16884 (encode_invocation_designation): Last argument P_NCHARS is now
16885 EMACS_INT.
16886 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16887 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16888
16889 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16890 All users changed.
16891
16892 * ccl.c (Fccl_execute_on_string): Declare some variables
16893 EMACS_INT.
16894
8546720e 168952011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
16896
16897 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16898
4e19a977
CS
168992011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16900
16901 * process.c (Fformat_network_address): Doc fix.
16902
87302331
R
169032011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16904
ee7683eb 16905 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 16906
cbb59342
CY
169072011-04-08 Chong Yidong <cyd@stupidchicken.com>
16908
16909 * keyboard.c (read_char): Call Lisp function help-form-show,
16910 instead of using internal_with_output_to_temp_buffer.
16911 (Qhelp_form_show): New var.
e0d38eeb 16912 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
16913
16914 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16915
16916 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16917
e67a13ab
CY
169182011-04-06 Chong Yidong <cyd@stupidchicken.com>
16919
04f2d78b
CB
16920 * process.c (Flist_processes): Remove to Lisp.
16921 (list_processes_1): Delete.
e67a13ab 16922
973f782d
EZ
169232011-04-06 Eli Zaretskii <eliz@gnu.org>
16924
7c106b1e
EZ
16925 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16926
973f782d
EZ
16927 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16928
41cf7d1a 169292011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 16930
ca23cc88
PE
16931 Fix more problems found by GCC 4.6.0's static checks.
16932
f390e2d5
PE
16933 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16934
42eea0d0
PE
16935 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16936
b69769da 16937 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 16938
f9541e84
PE
16939 * xdisp.c (vmessage): Mark as a printf-like function.
16940
13841b55
PE
16941 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16942
c136c10f
PE
16943 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16944
5e2d4a30
PE
16945 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16946 printf-like functions.
16947 (tiff_load): Add casts to remove these marks before passing them
16948 to system-supplied API.
16949
583f48b9
PE
16950 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16951
b25d760e
PE
16952 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16953 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
16954 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16955 directly, rather than having caller test rule sign. This avoids
16956 some unnecessary tests.
16957 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16958 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16959 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 16960
bc7b6697 16961 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 16962 (xfont_open): Avoid unnecessary tests.
bc7b6697 16963
27ccc379
PE
16964 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16965
dcd5c89a
PE
16966 * composite.h, composite.c (composition_gstring_put_cache):
16967 Use EMACS_INT, not int, for length.
16968
b13a45c6
PE
16969 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16970 breaking out part of COMPOSITION_DECODE_RULE.
16971 (COMPOSITION_DECODE_RULE): Use it.
16972 * composite.c (get_composition_id): Remove unused local vars,
16973 by using the new macro.
16974
1e792e4d
PE
16975 * textprop.c (set_text_properties_1): Change while to do-while,
16976 since the condition is always true at first.
16977
dc6c6455 16978 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
16979 (interval_deletion_adjustment): Return unsigned value.
16980 All uses changed.
dc6c6455 16981
aba7731a
PE
16982 * process.c (list_processes_1, create_pty, read_process_output):
16983 (exec_sentinel): Remove vars that were set but not used.
afd4052b 16984 (create_pty): Remove unnecessary "volatile"s.
bc57d757 16985 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 16986 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 16987 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 16988
fdfc4bf3
PE
16989 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16990
fca8fe46 16991 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 16992 (update_syntax_table): Use unsigned instead of int.
fca8fe46 16993
06a0259a 16994 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 16995 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 16996 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 16997
e7b9e80f
PE
16998 * print.c (print_error_message): Avoid int overflow.
16999
56201685
PE
17000 * font.c (font_list_entities): Redo for clarity,
17001 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17002
78834453 17003 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 17004 (font_score): Avoid potential overflow in diff calculation.
78834453 17005
0bc0b309 17006 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 17007 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 17008
e610eaca
PE
17009 * eval.c (funcall_lambda): Rename local to avoid shadowing.
17010
b895abce
PE
17011 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
17012 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
17013 can always succeed if overflow has undefined behavior.
17014
1f1d9321 17015 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 17016 (wordify): Omit three unnecessary tests.
1f1d9321 17017
c59478bc
PE
17018 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
17019 All callers changed. This avoids the need for an unused var.
17020
79b73827
PE
17021 * casefiddle.c (casify_region): Remove var that is set but not used.
17022
a4db5dfe
PE
17023 * dired.c (file_name_completion): Remove var that is set but not used.
17024
43aae36e
PE
17025 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17026
2a47c44d 17027 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 17028 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 17029
a37c69bf
PE
17030 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17031 Check for integer overflow on size calculations.
17032
328ab8e7
PE
17033 * buffer.c (Fprevious_overlay_change): Remove var that is set
17034 but not used.
17035
e5a2a5cb
PE
17036 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17037 Remove vars that are set but not used.
8d84a6eb 17038 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 17039 (timer_check_2): Mark vars as initialized.
e5a2a5cb 17040
a60e5f68
PE
17041 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17042
f661cb61 17043 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 17044 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 17045
f0397f5a
PE
17046 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17047 that are set but not used.
17048
8664db06 17049 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 17050 if XCreateBitmapFromData fails (Bug#8410).
8664db06 17051
6abdaa4a
PE
17052 * xselect.c (x_get_local_selection, x_handle_property_notify):
17053 Remove vars that are set but not used.
17054
0ce7538d 17055 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 17056 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 17057
9ae848fc
PE
17058 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17059 Remove var that is set but not used.
0b918413
PE
17060 (scroll_bar_windows_size): Now size_t, not int.
17061 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
17062 Check for overflow.
9ae848fc 17063
a5a62657
PE
17064 * xfaces.c (realize_named_face): Remove vars that are set but not used.
17065 (map_tty_color) [!defined MSDOS]: Likewise.
17066
5c5cdd39
PE
17067 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17068
66ebf983
PE
17069 * coding.c: Remove vars that are set but not used.
17070 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17071 All callers changed.
17072 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17073 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17074 (decode_coding_charset): Remove vars that are set but not used.
17075
1be4d761
PE
17076 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17077 that is set but not used.
17078
47553fa8
PE
17079 * print.c (print_object): Remove var that is set but not used.
17080
1f7196bf 17081 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
17082 The gnulib version avoids calling malloc in the usual case,
17083 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17084 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17085 * filelock.c (current_lock_owner): Likewise.
17086 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17087 * sysdep.c: Include allocator.h, careadlinkat.h.
17088 (emacs_no_realloc_allocator): New static constant.
17089 (emacs_readlink): New function.
fdb61804
PE
17090 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17091 ../lib/careadlinkat.h.
d1fdcab7 17092
f84c17c7
SM
170932011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
17094
17095 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17096 first non-nil return value).
17097
ef3862ad
JD
170982011-04-03 Jan Djärv <jan.h.d@swipnet.se>
17099
17100 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17101 if not defined (Bug#8403).
17102
376a7006
JB
171032011-04-02 Juanma Barranquero <lekktu@gmail.com>
17104
17105 * xdisp.c (display_count_lines): Remove parameter `start',
17106 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17107 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17108 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17109 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17110 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17111 and thereabouts. All callers changed.
17112 (get_per_char_metric): Remove parameter `f', unused since
17113 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17114
6ca3801d
JM
171152011-04-02 Jim Meyering <meyering@redhat.com>
17116
17117 do not dereference NULL upon failed strdup
17118 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17119 (ns_get_family): Likewise.
17120
d8e2b5ba
JB
171212011-04-02 Juanma Barranquero <lekktu@gmail.com>
17122
17123 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17124
8c74fcbd
JD
171252011-04-02 Jan Djärv <jan.h.d@swipnet.se>
17126
17127 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17128 later (Bug#8403).
17129
7200d79c
SM
171302011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
17131
03408648 17132 Add lexical binding.
7200d79c 17133
03408648
SM
17134 * window.c (Ftemp_output_buffer_show): New fun.
17135 (Fsave_window_excursion):
17136 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17137
17138 * lread.c (lisp_file_lexically_bound_p): New function.
17139 (Fload): Bind Qlexical_binding.
17140 (readevalloop): Remove `evalfun' arg.
17141 Bind Qinternal_interpreter_environment.
17142 (Feval_buffer): Bind Qlexical_binding.
17143 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
17144 Mark as dynamic.
17145 (syms_of_lread): Declare `lexical-binding'.
17146
17147 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
17148
17149 * keyboard.c (eval_dyn): New fun.
17150 (menu_item_eval_property): Use it.
ca105506
SM
17151
17152 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 17153
03408648
SM
17154 * fns.c (concat, mapcar1): Accept byte-code-functions.
17155
17156 * eval.c (Fsetq): Handle lexical vars.
17157 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
17158 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
17159 (FletX, Flet): Obey lexical binding.
17160 (Fcommandp): Handle closures.
17161 (Feval): New `lexical' arg.
17162 (eval_sub): New function extracted from Feval. Use it almost
17163 everywhere where Feval was used. Look up vars in lexical env.
17164 Handle closures.
17165 (Ffunctionp): Move from subr.el.
17166 (Ffuncall): Handle closures.
17167 (apply_lambda): Remove `eval_flags'.
17168 (funcall_lambda): Handle closures and new byte-code-functions.
17169 (Fspecial_variable_p): New function.
17170 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
17171 but without exporting it to Lisp.
23aba0ea 17172
23aba0ea 17173 * doc.c (Fdocumentation, store_function_docstring):
03408648 17174 * data.c (Finteractive_form): Handle closures.
23aba0ea 17175
03408648
SM
17176 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
17177 interactive spec.
ba83908c 17178
04f2d78b
CB
17179 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
17180 New byte-codes.
03408648
SM
17181 (exec_byte_code): New function extracted from Fbyte_code to handle new
17182 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 17183
03408648 17184 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 17185
03408648 17186 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 17187
e2abce01
JB
171882011-03-31 Juanma Barranquero <lekktu@gmail.com>
17189
17190 * xdisp.c (redisplay_internal): Fix prototype.
17191
63696a73 171922011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 17193
63696a73 17194 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
17195 (try_scrolling): Use it when setting scroll_limit.
17196 Limit scrolling to 100 screen lines.
63696a73
EZ
17197 (redisplay_window): Even when falling back on "recentering",
17198 position point in the window according to scroll-conservatively,
17199 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
17200
17201 (try_scrolling): When point is above the window, allow searching
17202 as far as scroll_max, or one screenful, to compute vertical
17203 distance from PT to the scroll margin position. This prevents
17204 try_scrolling from unnecessarily failing when
17205 scroll-conservatively is set to a value slightly larger than the
17206 window height. Clean up the case of PT below the margin at bottom
17207 of window: scroll_max can no longer be INT_MAX. When aggressive
17208 scrolling is in use, don't let point enter the opposite scroll
17209 margin as result of the scroll.
17210 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
17211 threshold of 100 lines for never-recentering scrolling.
17212
e4cc2dfc
JB
172132011-03-31 Juanma Barranquero <lekktu@gmail.com>
17214
17215 * dispextern.h (move_it_by_lines):
17216 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17217 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
17218 (message_log_check_duplicate): Remove parameters `prev_bol' and
17219 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17220 (redisplay_internal): Remove parameter `preserve_echo_area',
17221 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
17222
17223 * indent.c (Fvertical_motion):
17224 * window.c (window_scroll_pixel_based, Frecenter):
17225 Don't pass `need_y_p' to `move_it_by_lines'.
17226
1c470562
SM
172272011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
17228
44f230aa
SM
17229 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17230 steal a few bits to be more compact.
17231 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17232 Remove unneeded casts.
17233
1c470562
SM
17234 * bytecode.c (Fbyte_code): CAR and CDR can GC.
17235
888adce9
ZK
172362011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
17237
17238 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17239 binding" message (bug#7967).
17240
f838ed7b
PE
172412011-03-30 Paul Eggert <eggert@cs.ucla.edu>
17242
77861b95
PE
17243 Fix more problems found by GCC 4.6.0's static checks.
17244
de6dbc14
PE
17245 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17246 Remove unused local var.
17247
f838ed7b
PE
17248 * editfns.c (Fmessage_box): Remove unused local var.
17249
792c7b2b
PE
17250 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17251 (note_mode_line_or_margin_highlight, note_mouse_highlight):
17252 Omit unused local vars.
c499e557 17253 * window.c (shrink_windows): Omit unused local var.
b01a1c29 17254 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
17255 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17256 Omit unused local var.
17257
ba0165e1
PE
17258 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17259 Don't assume string length fits in int.
32ad8845 17260 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 17261 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 17262
3c59b4c9
PE
17263 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17264 instead of alloca (Bug#8344).
17265
a3eed478 17266 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 17267 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 17268
eb4d412d
PE
17269 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17270
1658b401
PE
17271 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17272 concerns.
17273
17274 * term.c (produce_glyphless_glyph): Remove unnecessary test.
17275
17276 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 17277
9a2c6e05
PE
17278 * keyboard.c (syms_of_keyboard): Use the same style as later
17279 in this function when indexing through an array. This also
17280 works around GCC bug 48267.
17281
03d0a109
PE
17282 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17283
44f730c8
PE
17284 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17285
fe75f926
PE
17286 * chartab.c (sub_char_table_ref_and_range): Redo for slight
17287 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17288
ffa8c828
PE
17289 * keyboard.c, keyboard.h (num_input_events): Now size_t.
17290 This avoids undefined behavior on integer overflow, and is a bit
17291 more convenient anyway since it is compared to a size_t variable.
17292
c5101a77
PE
17293 Variadic C functions now count arguments with size_t, not int.
17294 This avoids an unnecessary limitation on 64-bit machines, which
17295 caused (substring ...) to crash on large vectors (Bug#8344).
17296 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
17297 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 17298 All variadic functions and their callers changed accordingly.
c5101a77
PE
17299 (struct gcpro.nvars): Now size_t, not int. All uses changed.
17300 * data.c (arith_driver, float_arith_driver): Likewise.
17301 * editfns.c (general_insert_function): Likewise.
17302 * eval.c (struct backtrace.nargs, interactive_p)
17303 (internal_condition_case_n, run_hook_with_args, apply_lambda)
17304 (funcall_lambda, mark_backtrace): Likewise.
17305 * fns.c (concat): Likewise.
17306 * frame.c (x_set_frame_parameters): Likewise.
17307 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
17308 0 if not found, not -1. All callers changed.
17309
dd3f25f7
PE
17310 * alloc.c (garbage_collect): Don't assume stack size fits in int.
17311 (stack_copy_size): Now size_t, not int.
17312 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
17313
461c2ab9
JB
173142011-03-28 Juanma Barranquero <lekktu@gmail.com>
17315
17316 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
17317 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17318 All callers changed.
17319
17320 * lisp.h (multibyte_char_to_unibyte):
17321 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
17322 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17323 * character.h (CHAR_TO_BYTE8):
17324 * cmds.c (internal_self_insert):
17325 * editfns.c (general_insert_function):
17326 * keymap.c (push_key_description):
17327 * search.c (Freplace_match):
17328 * xdisp.c (message_dolog, set_message_1): All callers changed.
17329
f6d62986
SM
173302011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
17331
17332 * keyboard.c (safe_run_hook_funcall): New function.
17333 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17334 don't set the hook to nil, but remove the offending function instead.
17335 (Qcommand_hook_internal): Remove, unused.
17336 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17337 Vcommand_hook_internal.
17338
17339 * eval.c (enum run_hooks_condition): Remove.
17340 (funcall_nil, funcall_not): New functions.
17341 (run_hook_with_args): Call each function through a `funcall' argument.
17342 Remove `cond' argument, now redundant.
17343 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17344 (Frun_hook_with_args_until_failure): Adjust accordingly.
17345 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17346
1db5b1ad
JB
173472011-03-28 Juanma Barranquero <lekktu@gmail.com>
17348
17349 * dispextern.h (string_buffer_position): Remove declaration.
17350
17351 * print.c (strout): Remove parameter `multibyte', unused since
17352 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
17353
17354 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17355 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17356 All callers changed.
17357
17358 * w32.c (_wsa_errlist): Use braces for struct initializers.
17359
17360 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17361 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17362 All callers changed.
17363 (string_buffer_position): Likewise. Also, make static (it's never
17364 used outside xdisp.c).
17365 (cursor_row_p): Remove parameter `w', unused since
17366 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
17367 (decode_mode_spec): Remove parameter `precision', introduced during
17368 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17369 All callers changed.
17370
5ffb62aa
JD
173712011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17372
17373 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17374
461c2ab9 173752011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
17376
17377 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17378 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17379 (ns_update_auto_hide_menu_bar): New functions.
17380 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17381 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17382 ns_constrain_all_frames.
17383 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17384 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17385
5c380ffb
JD
173862011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17387
17388 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17389
9af30bdf
GM
173902011-03-27 Glenn Morris <rgm@gnu.org>
17391
17392 * syssignal.h: Replace RETSIGTYPE with void.
17393 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17394 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17395 Replace SIGTYPE with void everywhere.
17396 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17397 * s/template.h (SIGTYPE): Remove commented out definition.
17398
e2abce01
JB
173992011-03-26 Eli Zaretskii <eliz@gnu.org>
17400
17401 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17402 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17403
f868cd8a
JB
174042011-03-26 Juanma Barranquero <lekktu@gmail.com>
17405
59eb0929
JB
17406 * w32.c (read_unc_volume): Use parameter `henum', instead of
17407 global variable `wget_enum_handle'.
17408
17409 * keymap.c (describe_vector): Remove parameters `indices' and
17410 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17411 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17412
f868cd8a
JB
17413 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17414
17415 * keyboard.c (timer_check): Remove parameter `do_it_now',
17416 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17417 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17418 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17419
17420 * keyboard.c (read_char):
17421 * w32menu.c (w32_menu_display_help):
17422 * xmenu.c (show_help_event, menu_help_callback):
17423 Adjust calls to `show_help_echo'.
17424
17425 * gtkutil.c (xg_maybe_add_timer):
17426 * keyboard.c (readable_events):
17427 * process.c (wait_reading_process_output):
17428 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17429
17430 * insdel.c (adjust_markers_gap_motion):
17431 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17432 (gap_left, gap_right): Don't call it.
17433
2ecf6fdb
CY
174342011-03-25 Chong Yidong <cyd@stupidchicken.com>
17435
17436 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17437 incurred during fontification.
17438
6b1f9ba4
JB
174392011-03-25 Juanma Barranquero <lekktu@gmail.com>
17440
17441 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17442 (DEFVAR_PER_BUFFER): Don't pass it.
17443
17444 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17445 (scrolling_window): Don't pass it.
17446
0f4a96b5
JB
174472011-03-25 Juanma Barranquero <lekktu@gmail.com>
17448
17449 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17450
17451 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17452 and `suffix'.
17453 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17454 of variables specific to SELinux and computation of `encoded_absname'.
17455
17456 * image.c (XPutPixel): Remove unused variable `height'.
17457
17458 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17459
17460 * unexw32.c (get_section_info): Remove unused variable `section'.
17461
17462 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17463 (system_process_attributes): Remove unused variable `sess'.
17464 (sys_read): Remove unused variable `err'.
17465
17466 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17467 (w32_wnd_proc): Remove unused variable `isdead'.
17468 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17469 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17470 (x_create_tip_frame): Remove unused variable `tem'.
17471
17472 * w32inevt.c (w32_console_read_socket):
17473 Remove unused variable `no_events'.
17474
17475 * w32term.c (x_draw_composite_glyph_string_foreground):
17476 Remove unused variable `width'.
17477
1149507c
JB
174782011-03-24 Juanma Barranquero <lekktu@gmail.com>
17479
17480 * w32term.c (x_set_glyph_string_clipping):
17481 Don't pass uninitialized region to CombineRgn.
17482
9c88f339
JB
174832011-03-23 Juanma Barranquero <lekktu@gmail.com>
17484
17485 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17486 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17487 (Fx_close_connection): Remove unused variable `i'.
17488
17489 * w32font.c (w32font_draw): Return number of glyphs.
17490 (w32font_open_internal): Remove unused variable `i'.
17491 (w32font_driver): Add missing initializer.
17492
17493 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17494 (fill_in_menu): Remove unused variable `items_added'.
17495
17496 * w32term.c (last_mouse_press_frame): Remove static global variable.
17497 (w32_clip_to_row): Remove unused variable `f'.
17498 (x_delete_terminal): Remove unused variable `i'.
17499
17500 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17501 (NOTHING): Remove unused static global variable.
17502 (uniscribe_check_otf): Remove unused variable `table'.
17503 (uniscribe_font_driver): Add missing initializers.
17504
dee091a3
JD
175052011-03-23 Julien Danjou <julien@danjou.info>
17506
17507 * term.c (Fsuspend_tty, Fresume_tty):
17508 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17509 * window.c (temp_output_buffer_show):
17510 * insdel.c (signal_before_change):
17511 * frame.c (Fhandle_switch_frame):
17512 * fileio.c (Fdo_auto_save):
17513 * emacs.c (Fkill_emacs):
17514 * editfns.c (save_excursion_restore):
17515 * cmds.c (internal_self_insert):
17516 * callint.c (Fcall_interactively):
17517 * buffer.c (Fkill_all_local_variables):
17518 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17519 Use Frun_hooks.
0f4a96b5 17520 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 17521 unconditionally since it does the check itself.
dee091a3 17522
2c520ab5 175232011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 17524
c9c49752
PE
17525 Fix more problems found by GCC 4.5.2's static checks.
17526
8abc3f12
PE
17527 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17528 the first time through the loop, since we know p0 < p1 then.
17529 This also avoids a gcc -Wstrict-overflow warning.
17530
a2d26660
PE
17531 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17532 leading to a memory leak, possible in functions like
17533 load_charset_map_from_file that can allocate an unbounded number
b12ef411 17534 of objects (Bug#8318).
a2d26660 17535
916c72e9
PE
17536 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17537 that could (at least in theory) be that large.
17538
19ab8a18
PE
17539 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17540 This is less likely to overflow, and avoids undefined behavior if
17541 overflow does occur. All callers changed. Use strtoul to scan
17542 for the unsigned long integer.
b7cbbd6f
PE
17543 (pint2hrstr): Simplify and tune code slightly.
17544 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 17545
f0641eff
PE
17546 * scroll.c (do_scrolling): Work around GCC bug 48228.
17547 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17548
7f650bb9
PE
17549 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17550 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
17551 (validate_x_resource_name): Simplify count usage.
17552 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 17553
37dd57d1
PE
17554 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17555 fail (Bug#8306).
81e56e61 17556
699979fc 17557 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 17558
401bf9b4
PE
17559 * process.c (Fmake_network_process): Use socklen_t, not int,
17560 where POSIX says socklen_t is required in portable programs.
17561 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 17562 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
17563 (Fmake_network_process, server_accept_connection):
17564 (wait_reading_process_output, read_process_output):
17565 Likewise.
17566
b93aacde
PE
17567 * process.c: Rename or move locals to avoid shadowing.
17568 (list_processes_1, Fmake_network_process):
17569 (read_process_output_error_handler, exec_sentinel_error_handler):
17570 Rename or move locals.
4dc343ee 17571 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 17572 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 17573 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 17574 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 17575 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 17576
af8a867c 17577 Make tparam.h and terminfo.c consistent.
44f230aa
SM
17578 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17579 Include tparam.h instead, since it declares them.
af8a867c
PE
17580 * cm.h (PC): Remove extern decl; tparam.h now does this.
17581 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17582 * terminfo.c: Include tparam.h, to check interfaces.
17583 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17584 (tparam): Adjust signature to match interface in tparam.h;
17585 this removes some undefined behavior. Check that outstring and len
17586 are zero, which they always are with Emacs.
17587 * tparam.h (PC, BC, UP): New extern decls.
17588
0248044d 17589 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 17590 (xftfont_open): Rename locals to avoid shadowing.
0248044d 17591
8ff096c1 17592 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
17593 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17594 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 17595 (ftfont_list): Remove unused local.
49eaafba
PE
17596 (get_adstyle_property, ftfont_pattern_entity):
17597 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17598 Rename locals to avoid shadowing.
8ff096c1 17599
e2be39f6
PE
17600 * xfont.c (xfont_list_family): Mark var as initialized.
17601
c9735e30
PE
17602 * xml.c (make_dom): Now static.
17603
8f5201ae
PE
17604 * composite.c (composition_compute_stop_pos): Rename local to
17605 avoid shadowing.
b246f932
PE
17606 (composition_reseat_it): Remove unused locals.
17607 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 17608 (composition_update_it): Mark var as initialized.
11b61122
PE
17609 (find_automatic_composition): Mark vars as initialized,
17610 with a FIXME (Bug#8290).
8f5201ae 17611
760fbc2c
PE
17612 character.h: Rename locals to avoid shadowing.
17613 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17614 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17615 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17616 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17617 to avoid shadowing.
17618
ff08eb85
PE
17619 * textprop.c (property_change_between_p): Remove; unused.
17620
fc7bf025
PE
17621 * intervals.c (interval_start_pos): Now static.
17622
235d7abc
PE
17623 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17624
44f230aa
SM
17625 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17626 Rename locals to avoid shadowing.
3e7d6594 17627
50060332
PE
17628 * sound.c (wav_play, au_play, Fplay_sound_internal):
17629 Fix pointer signedness.
d01f234b 17630 (alsa_choose_format): Remove unused local var.
c83b8872
PE
17631 (wav_play): Initialize a variable to 0, to prevent undefined
17632 behavior (Bug#8278).
50060332 17633
c4fc4e30
PE
17634 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17635
918436ed
PE
17636 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17637
c939f91b
PE
17638 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17639 clobbering (Bug#8298).
b9c7f648
PE
17640 * sysdep.c (sys_subshell): Likewise.
17641 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 17642
6bd8c144
PE
17643 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17644 This should get cleaned up, so that child_setup has the
17645 same signature on all platforms.
17646
7710357c 17647 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 17648 (relocate_fd): Rename locals to avoid shadowing.
7710357c 17649
c59da222
CY
176502011-03-22 Chong Yidong <cyd@stupidchicken.com>
17651
17652 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17653 not to be necessary, and produces flickering.
17654
66b87493
GM
176552011-03-20 Glenn Morris <rgm@gnu.org>
17656
17657 * config.in: Remove file.
17658
45b6f6d5
JB
176592011-03-20 Juanma Barranquero <lekktu@gmail.com>
17660
17661 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17662 are now in src/globals.h.
17663 (syms_of_minibuf): Remove spurious & from previous change.
17664
cd394be1 176652011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
17666
17667 * minibuf.c (completing-read-function): New variable.
17668 (completing-read-default): Rename from completing-read.
17669 (completing-read): Call completing-read-function.
17670
b14e3e21
CY
176712011-03-19 Juanma Barranquero <lekktu@gmail.com>
17672
17673 * xfaces.c (Fx_load_color_file):
17674 Read color file from absolute filename (bug#8250).
17675
f2b726e6
JB
176762011-03-19 Juanma Barranquero <lekktu@gmail.com>
17677
17678 * makefile.w32-in: Update dependencies.
17679
09f6ff02
EZ
176802011-03-17 Eli Zaretskii <eliz@gnu.org>
17681
17682 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17683
29a6015a
PE
176842011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17685
a3a6c54e
PE
17686 Fix more problems found by GCC 4.5.2's static checks.
17687
b766f867
PE
17688 * process.c (make_serial_process_unwind, send_process_trap):
17689 (sigchld_handler): Now static.
17690
be02381c
PE
17691 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17692 That way, the code declares only the vars that it needs.
17693 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17694 * s/cygwin.h (PTY_ITERATION): Likewise.
17695 * s/darwin.h (PTY_ITERATION): Likewise.
17696 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17697
57048744
PE
17698 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17699 * process.c (allocate_pty): Don't declare stb unless it's needed.
17700
7914961c 17701 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
17702 (CONSTANTLIM): Remove; unused.
17703 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17704 Define only if needed.
7914961c 17705
b3967b18
PE
17706 * unexelf.c (unexec): Name an expression,
17707 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
17708 Use a different way to cause a compilation error if anyone uses
17709 n rather than nn, a way that does not involve shadowing.
73366a00 17710 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 17711
29a6015a
PE
17712 * deps.mk (unexalpha.o): Remove; unused.
17713
43cfc33e 17714 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 17715 * unexec.h: New file.
ce701a33
PE
17716 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17717 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17718 Depend on unexec.h.
17719 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17720 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17721 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 17722 Change as necessary to match prototype in unexec.h.
ce701a33 17723
01f44d5a
PE
17724 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17725 shadowing.
4f63c6bb 17726 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 17727
a6670b0b
PE
17728 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17729 Rename locals to avoid shadowing.
17730
cef2010d 17731 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 17732 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 17733
d4d7173a
PE
17734 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17735
f08b802a
PE
17736 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17737 warning when compiling print.c.
17738
3ddb0639
PE
17739 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17740 instead of using an uninitialized var.
5ad03b97 17741 (font_sort_entities): Mark var as initialized.
3ddb0639 17742
170a2692
PE
17743 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17744
e663c700
PE
17745 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17746 pointers to constants.
89bc529a 17747 (font_parse_fcname): Remove unused vars.
7b81e2d0 17748 (font_delete_unmatched): Now static.
ea838e10 17749 (font_get_spec): Remove; unused.
13a547c6
PE
17750 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17751 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17752 Rename or move locals to avoid shadowing.
e663c700 17753
2a80c887 17754 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 17755 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 17756
1384fa33 17757 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 17758 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 17759
8b2c52e9
PE
17760 * alloc.c (mark_backtrace): Move decl from here ...
17761 * lisp.h: ... to here, so that it can be checked.
17762
475545b5 17763 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 17764 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
17765 (lisp_indirect_variable): Name an expression,
17766 to avoid gcc -Wbad-function-cast warning.
1faed8ae 17767 (Fdefvar): Rename locals to avoid shadowing.
475545b5 17768
b1349114 17769 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 17770 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 17771 Use const pointer when appropriate.
b1349114 17772
a2928364
PE
17773 * lisp.h (get_system_name, get_operating_system_release):
17774 Move decls here, to check interfaces.
17775 * process.c (get_operating_system_release): Move decl to lisp.h.
17776 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
17777 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17778 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17779 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
17780 (Fformat_time_string, Fencode_time, Finsert_char):
17781 (Ftranslate_region_internal, Fformat):
17782 Rename or remove local vars to avoid shadowing.
9710023e 17783 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 17784
a415e694
PE
17785 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17786 avoid shadowing.
17787
8ef4622d
PE
17788 * lisp.h (eassert): Check that the argument compiles, even if
17789 ENABLE_CHECKING is not defined.
17790
946f9a5b
PE
17791 * data.c (Findirect_variable): Name an expression, to avoid
17792 gcc -Wbad-function-cast warning.
112396d6 17793 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 17794 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
17795 (Fmake_variable_buffer_local, Fmake_local_variable):
17796 Mark variables as initialized.
52746918 17797 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 17798
e5aab7e7 17799 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
17800 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17801 Rename locals to avoid shadowing.
dff45157
PE
17802 (mark_stack): Move local variables into the #ifdef region where
17803 they're used.
7bc26fdb
PE
17804 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17805 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17806 needed otherwise.
17807 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17808 (GC_STRING_CHARS): Remove; not used.
d40d4be1 17809 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 17810
e5aab7e7
PE
17811 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17812 avoids undefined behavior in theory.
17813
4da60324
PE
17814 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17815
88043301
PE
17816 Use functions, not macros, for up- and down-casing (Bug#8254).
17817 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17818 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17819 to use the following functions instead of these macros.
17820 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17821 EMACS_INT, since callers assume the returned value fits in int.
17822 (upcase1): Likewise, for UPCASE_TABLE.
17823 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 17824 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 17825 the race-condition problem in the old DOWNCASE.
88043301 17826
19ed5445
PE
17827 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17828 Rename locals to avoid shadowing.
17829 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
17830 (regex_compile, re_search_2, re_match_2_internal):
17831 Remove unused local vars.
952db0d7
PE
17832 (FREE_VAR): Rewrite so as not to use empty "else",
17833 which gcc can warn about.
da053e48 17834 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
17835 (RETALLOC_IF): Define only if needed.
17836 (WORDCHAR_P): Likewise. This one is never needed, but is used
17837 only in a comment talking about a compiler bug, so put inside
17838 the #if 0 of that comment.
17839 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17840 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17841 Remove; unused.
19ed5445 17842
1f3561e4 17843 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
17844 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17845 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 17846
ded6f8f7
PE
17847 * search.c (simple_search): Remove unused var.
17848
dbd37a95
PE
17849 * dired.c (compile_pattern): Move decl from here ...
17850 * lisp.h: ... to here, so that it can be checked.
17851 (struct re_registers): New forward decl.
17852
7e47afad
PE
17853 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17854
85f24f61
PE
17855 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17856 All uses changed.
17857 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17858 Rename locals to avoid shadowing.
5671df8f 17859 (Fvertical_motion): Mark locals as initialized.
85f24f61 17860
181aa2be 17861 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 17862 (casify_region): Mark local as initialized.
181aa2be 17863
930d429c
PE
17864 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17865
7082eac6
PE
17866 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17867 New macros, so that the caller can use some names other than
17868 gcpro1, gcpro2, etc.
17869 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17870 of the new macros.
17871 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17872 argument, for consistency with GCPRO2_VAR, etc: it is now the
17873 prefix of the variable, not the variable itself. All uses
17874 changed.
38b2c076
PE
17875 * dired.c (directory_files_internal, file_name_completion):
17876 Rename locals to avoid shadowing.
17877
15206ed9
PE
17878 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17879 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17880 dired.c's scmp function, had undefined behavior.
17881 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17882 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17883 * buffer.h: ... to here, because these macros use current_buffer,
17884 and the new implementation with inline functions needs to have
17885 current_buffer in scope now, rather than later when the macros
17886 are used.
17887 (downcase, upcase1): New static inline functions.
17888 (DOWNCASE, UPCASE1): Reimplement using these functions.
17889 This avoids undefined behavior in expressions like
17890 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17891 from race conditions in accessing the global variables
17892 case_temp1 and case_temp2.
17893 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17894 * lisp.h (case_temp1, case_temp2): Remove their decls.
17895 * character.h (ASCII_CHAR_P): Move from here ...
17896 * lisp.h: ... to here, so that the inline functions mentioned
17897 above can use them.
17898
4a6bea26
PE
17899 * dired.c (directory_files_internal_unwind): Now static.
17900
f14b7e14
PE
17901 * fileio.c (file_name_as_directory, directory_file_name):
17902 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17903 Now static.
2893f146
PE
17904 (file_name_as_directory): Use const pointers when appropriate.
17905 (Fexpand_file_name): Likewise. In particular, newdir might
17906 point at constant storage, so make it a const pointer.
fd4ead52 17907 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
17908 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17909 signedness issues.
f839df0c
PE
17910 (Fset_file_times, Finsert_file_contents, auto_save_error):
17911 Rename locals to avoid shadowing.
f14b7e14 17912
5716756e 17913 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
17914 (Ftry_completion, Fall_completions): Rename or remove locals
17915 to avoid shadowing.
5716756e 17916
b4c3046a
PE
17917 * marker.c (bytepos_to_charpos): Remove; unused.
17918
b45db522
PE
17919 * lisp.h (verify_bytepos, count_markers): New decls,
17920 so that gcc does not warn that these functions aren't declared.
17921
85876d07
PE
17922 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17923 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 17924 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 17925 (copy_text): Remove unused local var.
85876d07 17926
03d78a21 17927 * filelock.c (within_one_second): Now static.
b3dd38ab 17928 (lock_file_1): Rename local to avoid shadowing.
03d78a21 17929
5df8f01b
PE
17930 * buffer.c (fix_overlays_before): Mark locals as initialized.
17931 (fix_start_end_in_overlays): Likewise. This function should be
17932 simplified by using pointers-to-pointers, but that's a different
17933 matter.
b1d876f1 17934 (switch_to_buffer_1): Now static.
8f54f30a
PE
17935 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17936 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 17937
a70072c9 17938 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 17939 Fix pointer signedness issue.
edced198
PE
17940 (sys_subshell): Mark local as volatile if checking for lint,
17941 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 17942 (MAXPATHLEN): Define only if needed.
a70072c9 17943
a0977c44
PE
17944 * process.c (serial_open, serial_configure): Move decls from here ...
17945 * systty.h: ... to here, so that they can be checked.
17946
a884fdcc
PE
17947 * fns.c (get_random, seed_random): Move extern decls from here ...
17948 * lisp.h: ... to here, so that they can be checked.
17949
604efe86 17950 * sysdep.c (reset_io): Now static.
b8950c94 17951 (wait_for_termination_signal): Remove; unused.
604efe86 17952
38fc62d9
PE
17953 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17954 (copy_keymap_item, append_key, push_text_char_description):
17955 Now static.
1004a21a 17956 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 17957 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
17958 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17959 (describe_map_tree):
17960 Rename locals to avoid shadowing.
38fc62d9 17961
2f2650da
PE
17962 * keyboard.c: Declare functions static if they are not used elsewhere.
17963 (echo_char, echo_dash, cmd_error, top_level_2):
17964 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
17965 (read_char, kbd_buffer_get_event, make_lispy_position):
17966 (make_lispy_event, make_lispy_movement, apply_modifiers):
17967 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17968 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17969 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 17970 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 17971 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 17972
a053e86c 17973 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
17974 (mark_kboards): Move decl here ...
17975 * alloc.c (mark_kboards): ... from here.
a053e86c 17976
4752793e
PE
17977 * lisp.h (force_auto_save_soon): New decl.
17978
74f10ca7 17979 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
17980 (DEFINE_DUMMY_FUNCTION): New macro.
17981 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17982 Use it.
c03cd23f
PE
17983 (main): Add casts to avoid warnings
17984 if GCC considers string literals to be constants.
74f10ca7 17985
022e70d4
PE
17986 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17987
59d6fe83
PE
17988 * dbusbind.c: Pointer signedness fixes.
17989 (xd_signature, xd_append_arg, xd_initialize):
17990 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17991 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17992 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17993 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17994
78320123
PE
17995 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17996 if GCC considers string literals to be constants.
49cebcca 17997 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 17998
35ac2a97
SM
179992011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
18000
fb103ca9
SM
18001 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18002 (print_preprocess, print_object): New macro to fix last change.
18003
35ac2a97
SM
18004 * print.c (print_preprocess): Don't forget font objects.
18005
62973b41
JB
180062011-03-16 Juanma Barranquero <lekktu@gmail.com>
18007
18008 * emacs.c (USAGE3): Doc fixes.
18009
0e48bb22
AS
180102011-03-15 Andreas Schwab <schwab@linux-m68k.org>
18011
18012 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
18013 structure.
18014
7684e57b
JB
180152011-03-14 Juanma Barranquero <lekktu@gmail.com>
18016
18017 * lisp.h (VWindow_system, Qfile_name_history):
18018 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
18019 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
18020 (w32_system_caret_x, w32_system_caret_y): Declare extern.
18021
18022 * w32select.c: Don't #include "keyboard.h".
c96bbc66 18023 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
18024
18025 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18026 * w32console.c (detect_input_pending, read_input_pending)
18027 (encode_terminal_code):
18028 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18029 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18030 (w32_system_caret_y, Qfile_name_history):
18031 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18032 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18033 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18034 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18035 * w32proc.c (Qlocal, report_file_error):
18036 * w32term.c (Vwindow_system, updating_frame):
18037 * w32uniscribe.c (initialized, uniscribe_font_driver):
18038 Remove unneeded extern declarations.
18039
2aa46d6c
CY
180402011-03-14 Chong Yidong <cyd@stupidchicken.com>
18041
c96bbc66 18042 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 18043
cffc6f3b
CY
180442011-03-13 Chong Yidong <cyd@stupidchicken.com>
18045
18046 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18047 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18048 These macros can no longer be used for assignment.
18049
44f230aa
SM
18050 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18051 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
18052 (record_buffer_markers, fetch_buffer_markers): New functions for
18053 recording and fetching special buffer markers.
18054 (set_buffer_internal_1, set_buffer_temp): Use them.
18055
18056 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18057
18058 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18059
18060 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18061 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
18062
18063 * xdisp.c (hscroll_window_tree):
18064 (reconsider_clip_changes): Use PT instead of BUF_PT.
18065
d251f04b
EZ
180662011-03-13 Eli Zaretskii <eliz@gnu.org>
18067
18068 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18069 $(EMACS_ROOT)/lib/intprops.h.
18070
f0c77cd1
PE
180712011-03-13 Paul Eggert <eggert@cs.ucla.edu>
18072
3eca4629
PE
18073 Fix more problems found by GCC 4.5.2's static checks.
18074
7c86ee98
PE
18075 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18076 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
18077 (xg_free_frame_widgets): Make it clear that a local variable is
18078 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
18079 (gdk_window_get_screen): Make it clear that this macro is needed
18080 only if USE_GTK_TOOLTIP.
1e5524e7
PE
18081 (int_gtk_range_get_value): New function, which avoids a diagnostic
18082 from gcc -Wbad-function-cast.
18083 (xg_set_toolkit_scroll_bar_thumb): Use it.
18084 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18085 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
18086 (get_utf8_string, xg_get_file_with_chooser):
18087 Rename locals to avoid shadowing.
18088 (create_dialog): Move locals to avoid shadowing.
7c86ee98 18089
41729b81
PE
18090 * xgselect.c (xg_select): Remove unused var.
18091
f0c77cd1
PE
18092 * image.c (four_corners_best): Mark locals as initialized.
18093 (gif_load): Initialize transparent_p to zero (Bug#8238).
18094 Mark another local as initialized.
ec6cf4c6 18095 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 18096
ce0ad53d 18097 * image.c (clear_image_cache): Now static.
d5d5a617 18098 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 18099 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
18100 (x_edge_detection): Remove unnecessary cast that
18101 gcc -Wbad-function-cast diagnoses.
2037898d 18102 (gif_load): Fix pointer signedness.
6ae141d6
PE
18103 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18104 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 18105
33383987 181062011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 18107
d32df629
PE
18108 Improve quality of tests for time stamp overflow.
18109 For example, without this patch (encode-time 0 0 0 1 1
18110 1152921504606846976) returns the obviously-bogus value (-948597
18111 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18112 reports time overflow. See
18113 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
18114 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18115 * editfns.c: Include limits.h and intprops.h.
18116 (TIME_T_MIN, TIME_T_MAX): New macros.
18117 (time_overflow): Move earlier, to before first use.
18118 (hi_time, lo_time): New functions, for an accurate test for
18119 out-of-range times.
18120 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18121 (Fget_internal_run_time): Don't assume time_t fits in int.
18122 (make_time): Use list2 instead of Fcons twice.
18123 (Fdecode_time): More accurate test for out-of-range times.
18124 (check_tm_member): New function.
18125 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
18126 (lisp_time_argument): Don't rely on undefined left-shift and
18127 right-shift behavior when checking for time stamp overflow.
8be6f318 18128
fe31d94c
PE
18129 * editfns.c (time_overflow): New function, refactoring common code.
18130 (Fformat_time_string, Fdecode_time, Fencode_time):
18131 (Fcurrent_time_string): Use it.
18132
8be6f318
PE
18133 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18134 * dired.c (make_time): Move to ...
18135 * editfns.c (make_time): ... here.
18136 * systime.h: Note the move.
18137
09d9db2c 181382011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 18139
126bc0dc
YM
18140 * fringe.c (update_window_fringes): Remove unused variables.
18141
c47cbdfd
YM
18142 * unexmacosx.c (copy_data_segment): Also copy __got section.
18143 (Bug#8223)
18144
7ac80be9
EZ
181452011-03-12 Eli Zaretskii <eliz@gnu.org>
18146
c96bbc66 18147 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
18148 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
18149 Constify `char *' arguments and their references according to
18150 prototypes in tparam.h.
18151
ecb0f94d 18152 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 18153
7ac80be9
EZ
18154 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
18155 Adapt all references accordingly.
18156
18157 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
18158
ef1fd07e
TT
181592011-03-11 Tom Tromey <tromey@redhat.com>
18160
18161 * buffer.c (syms_of_buffer): Remove obsolete comment.
18162
7ef4b50c
EZ
181632011-03-11 Eli Zaretskii <eliz@gnu.org>
18164
18165 * termhooks.h (encode_terminal_code): Declare prototype.
18166
18167 * msdos.c (encode_terminal_code): Don't declare prototype.
18168
18169 * term.c (encode_terminal_code): Now external again, used by
18170 w32console.c and msdos.c.
18171
44f230aa
SM
18172 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
18173 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 18174
4b1ec863 181752011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 18176
1714f52b 18177 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 18178
4b1ec863
PE
18179 * fringe.c (update_window_fringes): Mark locals as initialized
18180 (Bug#8227).
18181 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 18182
524c7aa6
PE
18183 * alloc.c (mark_fringe_data): Move decl from here ...
18184 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
18185 to check its interface.
18186 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
18187
a5c0af81 18188 * fontset.c (free_realized_fontset): Now static.
7519b8cd 18189 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 18190 (fontset_font): Mark local as initialized.
a9a06e0b 18191 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 18192
b4716021
PE
18193 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
18194
811e9bac 18195 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 18196 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
18197 (x_own_selection, Fx_disown_selection_internal): Rename locals
18198 to avoid shadowing.
18199 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 18200
7e3ab302
PE
18201 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
18202 so that the caller can use some name other than gcpro1.
18203 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
18204 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18205 (Fx_backspace_delete_keys_p):
18206 Use them to avoid shadowing, and rename vars to avoid shadowing.
18207 (x_decode_color, x_set_name, x_window): Now static.
6b437900 18208 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 18209 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
18210 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18211 Remove unused locals.
7e3ab302
PE
18212 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18213 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18214 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18215 macros.
f78faa98 18216
e2b13473
PE
18217 * xterm.h (x_mouse_leave): New decl.
18218
77f23912
PE
18219 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18220 Remove unused functions.
cdf4ba58
PE
18221 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18222 (x_calc_absolute_position): Now static.
7411c686 18223 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 18224 Don't declare local "event" unless it's used.
ed7bf3a5
PE
18225 (x_iconify_frame, x_free_frame_resources): Don't declare locals
18226 unless they are used.
38d0b34a
PE
18227 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18228 (x_fatal_error_signal): Remove; not used.
a6067996
PE
18229 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18230 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18231 (x_error_catcher, x_connection_closed, x_error_handler):
18232 (x_error_quitter, xembed_send_message, x_iconify_frame):
18233 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 18234 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 18235 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 18236
44f230aa
SM
18237 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18238 Rename or move locals to avoid shadowing.
6b463e58 18239 (tty_defined_color, merge_face_heights): Now static.
5967d051 18240 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
18241 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18242 does not deduce is never used uninitialized.
73719eba
PE
18243 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18244 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 18245
426994c3 18246 * terminal.c (store_terminal_param): Now static.
5489860b 18247
032f1620 18248 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 18249 (set_frame_menubar): Remove unused local.
d4323972 18250 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
18251 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18252 since they might point to immutable storage.
281585b0
PE
18253 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18254 since it's unused otherwise.
032f1620 18255
367c19e5 18256 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 18257 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
18258 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18259 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 18260 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
18261 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18262 does not deduce are never used uninitialized.
70739cbe 18263
07b48fa9
PE
18264 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18265
8868a238 18266 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
18267 * window.c (window_loop, size_window):
18268 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 18269
7e5cf297 18270 * window.c (display_buffer): Now static.
d6550a9f
PE
18271 (size_window): Mark variables that gcc -Wuninitialized
18272 does not deduce are never used uninitialized.
a586633d
PE
18273 * window.h (check_all_windows): New decl, to forestall
18274 gcc -Wmissing-prototypes diagnostic.
5b555da1 18275 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 18276
f6095868
PE
18277 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18278 shadowing.
18279 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
18280 Include <limits.h>.
18281 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18282 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
18283 (load_charset_map): Mark variables that gcc -Wuninitialized
18284 does not deduce are never used uninitialized.
53df7c11 18285 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 18286
f38b440c
PE
18287 * coding.c (coding_set_source, coding_set_destination):
18288 Use "else { /* comment */ }" rather than "else /* comment */;"
18289 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
18290 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18291 a block, when the outer 'i' will do.
18292 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18293 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18294 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18295 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
18296 (Fdecode_sjis_char, Fdefine_coding_system_internal):
18297 Rename locals to avoid shadowing.
18298 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
18299 * coding.c (emacs_mule_char, encode_invocation_designation):
18300 Now static, since they're not used elsewhere.
413bb2db 18301 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 18302 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
18303 (decode_coding_emacs_mule): Mark variables that gcc
18304 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
18305 (detect_coding_iso_2022): Initialize a local variable that might
18306 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 18307 this initialization is needed. (Bug#8211)
5f58e762
PE
18308 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
18309 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
18310 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
18311 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
18312 Remove unused macros.
f38b440c 18313
232b38b9 18314 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 18315 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 18316 * character.c (string_count_byte8): Likewise.
232b38b9 18317
fb90da1b
PE
18318 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
18319 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
18320
fb93dbc2
PE
18321 * chartab.c (copy_sub_char_table): Now static, since it's not used
18322 elsewhere.
5c156ace
PE
18323 (sub_char_table_ref_and_range, char_table_ref_and_range):
18324 Rename locals to avoid shadowing.
bbcd0949 18325 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 18326
7d3b3862 18327 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 18328 (BIDI_BOB): Remove unused macro.
7d3b3862 18329
6be7d3da
PE
18330 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18331 deduce are never used uninitialized.
c2ed9c8b 18332 * term.c (encode_terminal_code): Likewise.
6be7d3da 18333
75f8807f 18334 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 18335
50938595
PE
18336 * tparam.h: New file.
18337 * term.c, tparam.h: Include it.
18338 * deps.mk (term.o, tparam.o): Depend on tparam.h.
18339 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18340 Move these decls to tparam.h, and make them agree with what
18341 is actually in tparam.c. The previous trick of using incompatible
18342 decls in different modules does not conform to the C standard.
18343 All callers of tparam changed to use tparam's actual API.
18344 * tparam.c (tparam1, tparam, tgoto):
18345 Use const pointers where appropriate.
18346
fbceeba2
PE
18347 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18348 * cm.h (struct cm): Likewise.
18349 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18350 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18351 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18352 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18353 (turn_on_face, init_tty): Likewise.
18354 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 18355
7f3f1250
PE
18356 * term.c (term_mouse_position): Rename local to avoid shadowing.
18357
e6ca6543
PE
18358 * alloc.c (mark_ttys): Move decl from here ...
18359 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18360
c40f8d15
AS
183612011-03-11 Andreas Schwab <schwab@linux-m68k.org>
18362
18363 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18364
cfe0661d
JB
183652011-03-09 Juanma Barranquero <lekktu@gmail.com>
18366
18367 * search.c (compile_pattern_1): Remove argument regp, unused since
18368 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18369 (compile_pattern): Don't pass it.
18370
0afb4571
J
183712011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18372
18373 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18374 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18375 for ! HAVE_GTK3.
18376 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18377
18378 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18379
18380 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18381 gdk_window_get_screen, gdk_window_get_geometry,
18382 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18383 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18384 (xg_get_pixbuf_from_pixmap): New function.
18385 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18386 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18387 Call xg_get_pixbuf_from_pixmap instead of
18388 gdk_pixbuf_get_from_drawable.
18389 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18390 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18391 (xg_check_special_colors): Use GtkStyleContext and its functions
18392 for HAVE_GTK3.
18393 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18394 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18395 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
18396 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18397 Call gtk_widget_get_preferred_size.
0afb4571
J
18398 (xg_frame_resized): gdk_window_get_geometry only takes 5
18399 parameters.
44f230aa
SM
18400 (xg_win_to_widget, xg_event_is_for_menubar):
18401 Call gdk_x11_window_lookup_for_display.
0afb4571
J
18402 (xg_set_widget_bg): New function.
18403 (delete_cb): New function.
895009e1 18404 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 18405 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
18406 (xg_set_background_color): Call xg_set_widget_bg.
18407 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18408 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18409 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18410 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18411 if ! HAVE_GTK3.
18412 (update_frame_tool_bar): Call gtk_widget_hide.
18413 (xg_initialize): Use GDK_KEY_g.
18414
18415 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18416 if ! HAVE_GTK3
18417 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18418
18419 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18420 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18421 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18422
1c2cc4ef
JB
184232011-03-08 Juanma Barranquero <lekktu@gmail.com>
18424
18425 * w32xfns.c (select_palette): Check success of RealizePalette against
18426 GDI_ERROR, not zero.
18427
33383987 18428See ChangeLog.11 for earlier changes.
aac0c6e3
MR
18429
18430;; Local Variables:
18431;; coding: utf-8
aac0c6e3
MR
18432;; End:
18433
2f097256 18434 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
18435
18436 This file is part of GNU Emacs.
18437
18438 GNU Emacs is free software: you can redistribute it and/or modify
18439 it under the terms of the GNU General Public License as published by
18440 the Free Software Foundation, either version 3 of the License, or
18441 (at your option) any later version.
18442
18443 GNU Emacs is distributed in the hope that it will be useful,
18444 but WITHOUT ANY WARRANTY; without even the implied warranty of
18445 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18446 GNU General Public License for more details.
18447
18448 You should have received a copy of the GNU General Public License
18449 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.