* minibuf.texi (Basic Completion): Clarify list form of completion table.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
e8757f09 12012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
2
3 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
4
7604f298
EZ
52012-10-04 Eli Zaretskii <eliz@gnu.org>
6
7 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
8 see whether CreateFile failed.
9
88d69b7d
PE
102012-10-04 Paul Eggert <eggert@cs.ucla.edu>
11
12 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
13 to avoid similar races.
14 * keyboard.c (pending_signals): Now bool, not int.
15
7509f454
PE
16 Port timers to OpenBSD, plus check for timer failures.
17 OpenBSD problem reported by Han Boetes.
18 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
19 and/or setitimer.
20 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
21 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
22 like OpenBSD, which has timer_settime but does not declare it.
23 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
24 whether to use itimerspec-related primitives. All uses of
25 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
26
a3c5c0c5
PE
272012-10-02 Paul Eggert <eggert@cs.ucla.edu>
28
29 * profiler.c (handle_profiler_signal): Fix a malloc race
30 that caused Emacs to hang on Fedora 17 when profiling Lisp.
31
914e743b
JD
322012-10-02 Jan Djärv <jan.h.d@swipnet.se>
33
34 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
35
d8ab37a8
EZ
362012-10-02 Eli Zaretskii <eliz@gnu.org>
37
38 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
39 consistent with the change in return value of 'safe_strsignal'.
40
b3ecad33
PE
412012-10-02 Paul Eggert <eggert@cs.ucla.edu>
42
0a99eee1
PE
43 Prefer plain 'static' to 'static inline' (Bug#12541).
44 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
45 (bidi_set_sor_type, bidi_push_embedding_level)
46 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
47 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
48 (bidi_cache_search, bidi_cache_ensure_space)
49 (bidi_cache_iterator_state, bidi_cache_find)
50 (bidi_peek_at_next_level, bidi_set_paragraph_end)
51 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
52 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
53 Now 'static', not 'static inline'.
54
b3ecad33
PE
55 Count overruns when profiling; change units to ns.
56 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
57 Give extra weight to samples after overruns, to attempt to count
58 the time more accurately.
59 (setup_cpu_timer): Change sampling interval units from ms to ns, since
60 the underlying primitives nominally do ns.
61 (Fprofiler_cpu_start): Document the change. Mention that
62 the sampling intervals are only approximate.
63
090cf9db
SM
642012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
65
66 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
67
68 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
69 case for the special 0 coding-system.
70
71 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
72 (Fmake_overlay): Remove redundant tests.
64edc777 73 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 74
81550bf4
JB
752012-10-02 Juanma Barranquero <lekktu@gmail.com>
76
77 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
78 Update dependencies.
79
aa1ba90e
PE
802012-10-01 Paul Eggert <eggert@cs.ucla.edu>
81
82 Fix a malloc race condition involving strsignal.
83 A signal can arrive in the middle of a malloc, and Emacs's signal
84 handler can invoke strsignal, which can invoke malloc, which is
85 not portable. This race condition bug makes Emacs hang on GNU/Linux.
86 Fix it by altering the signal handler so that it does not invoke
87 strsignal.
88 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
89 * process.c (status_message): Use const pointer, in case strsignal
90 is #defined to safe_strsignal.
91 * sysdep.c (sys_siglist, init_signals): Always define and
92 initialize a substitute sys_siglist if the system does not define
93 one, even if HAVE_STRSIGNAL.
94 (safe_strsignal): Rename from strsignal. Always define,
95 using sys_siglist. Return a const pointer.
96 * syssignal.h (safe_strsignal): New decl.
97 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
98
ace917bd
EZ
992012-10-01 Eli Zaretskii <eliz@gnu.org>
100
101 * w32proc.c (timer_loop): Fix code that waits for timer
102 expiration, to avoid high CPU usage.
103
9eb71b9c
SM
1042012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
105
106 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
107 (sweep_weak_table): Remove redundant prototypes.
108
b3317662
FP
1092012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
110
111 * emacs.c: Move the inclusion of TERM_HEADER after including
112 windows.h on WINDOWSNT. This avoids compilation problems with
113 MSVC.
114
f0e5f225
EZ
1152012-10-01 Eli Zaretskii <eliz@gnu.org>
116
2d7d1608
EZ
117 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
118 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
119 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
120 as the previous version used 'void *'.
121
122 * ralloc.c (ROUNDUP): Fix last change.
123 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
124 'size_t'.
125
f0e5f225
EZ
126 * w32proc.c <disable_itimers>: New static flag.
127 (init_timers): Initialize it to zero, after creating the critical
128 sections used by the timer threads.
129 (term_timers): Set to 1 before deleting the critical sections.
130 (getitimer, setitimer): If disable_itimers is non-zero, return an
131 error indication without doing anything. Reported by Fabrice
132 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
133 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
134 return results.
135 [!HAVE_SETITIMER]: Behave as the previous version that didn't
136 support timers.
f0e5f225
EZ
137
138 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
139 term_ntproc after all the other bookkeeping, to get timers working
140 as long as possible.
141
82ef37c1
PE
1422012-10-01 Paul Eggert <eggert@cs.ucla.edu>
143
b3a4c387
PE
144 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
145 Suggested by Juri Linkov in
146 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
147
b0ab8123
PE
148 Prefer plain 'static' to 'static inline' (Bug#12541).
149 With static functions, modern compilers inline pretty well by
150 themselves; advice from programmers often hurts as much as it helps.
151 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
152 this change shrinks the text size of the Emacs executable by 1.1%
153 without affecting CPU significantly in my benchmark.
154 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
155 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
156 (mark_maybe_object, mark_maybe_pointer, bounded_number):
157 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
158 (bset_auto_fill_function, bset_auto_save_file_format)
159 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
160 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
161 (bset_cache_long_line_scans, bset_case_fold_search)
162 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
163 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
164 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
165 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
166 (bset_header_line_format, bset_indicate_buffer_boundaries)
167 (bset_indicate_empty_lines, bset_invisibility_spec)
168 (bset_left_fringe_width, bset_major_mode, bset_mark)
169 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
170 (bset_name, bset_overwrite_mode, bset_pt_marker)
171 (bset_right_fringe_width, bset_save_length)
172 (bset_scroll_bar_width, bset_scroll_down_aggressively)
173 (bset_scroll_up_aggressively, bset_selective_display)
174 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
175 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
176 (set_buffer_overlays_after):
177 * category.c (bset_category_table):
178 * charset.c (read_hex):
179 * coding.c (produce_composition, produce_charset)
180 (handle_composition_annotation, handle_charset_annotation)
181 (char_encodable_p):
182 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
183 (assign_row, set_frame_matrix_frame, make_current)
184 (add_row_entry):
185 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
186 * fns.c (maybe_resize_hash_table):
187 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
188 * gmalloc.c (register_heapinfo):
189 * image.c (lookup_image_type):
190 * intervals.c (set_interval_object, set_interval_left)
191 (set_interval_right, copy_interval_parent, rotate_right)
192 (rotate_left, balance_possible_root_interval):
193 * keyboard.c (kset_echo_string, kset_kbd_queue)
194 (kset_keyboard_translate_table, kset_last_prefix_arg)
195 (kset_last_repeatable_command, kset_local_function_key_map)
196 (kset_overriding_terminal_local_map, kset_real_last_command)
197 (kset_system_key_syms, clear_event, set_prop):
198 * lread.c (digit_to_number):
199 * marker.c (attach_marker, live_buffer, set_marker_internal):
200 * nsterm.m (ns_compute_glyph_string_overhangs):
201 * process.c (pset_buffer, pset_command)
202 (pset_decode_coding_system, pset_decoding_buf)
203 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
204 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
205 (pset_status, pset_tty_name, pset_type, pset_write_queue):
206 * syntax.c (bset_syntax_table, dec_bytepos):
207 * terminal.c (tset_param_alist):
208 * textprop.c (interval_has_some_properties)
209 (interval_has_some_properties_list):
210 * window.c (wset_combination_limit, wset_dedicated)
211 (wset_display_table, wset_hchild, wset_left_fringe_width)
212 (wset_left_margin_cols, wset_new_normal, wset_new_total)
213 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
214 (wset_right_fringe_width, wset_right_margin_cols)
215 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
216 (wset_vertical_scroll_bar_type, wset_window_parameters):
217 * xdisp.c (wset_base_line_number, wset_base_line_pos)
218 (wset_column_number_displayed, wset_region_showing)
219 (window_box_edges, run_window_scroll_functions)
220 (append_glyph_string_lists, prepend_glyph_string_lists)
221 (append_glyph_string, set_glyph_string_background_width)
222 (append_glyph, append_composite_glyph)
223 (take_vertical_position_into_account):
224 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
225 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
226 (lface_hash, lface_same_font_attributes_p, lookup_face):
227 * xml.c (libxml2_loaded_p):
228 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
229 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
230 Now 'static', not 'static inline'.
231
05584c31
PE
232 * bidi.c: Tune.
233 (bidi_copy_it): Do the whole copy with a single memcpy.
234 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
235
86ec63ba
PE
236 Revert the FOLLOW-SYMLINKS change for file-attributes.
237 Doing it right would require several changes to Tramp, and there's
238 not enough time to get that tested before the freeze today.
239 * dired.c (directory_files_internal, Ffile_attributes):
240 Undo last change.
241
82ef37c1
PE
242 * frame.c (x_report_frame_params): Port better to wider ints.
243 Do not assume that EMACS_UINT is the same width as uprintmax_t,
244 or that pointers can be printed in 15 decimal digits.
245 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
246
62aba0d4
FP
2472012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
248
249 Support x64 build on MS-Windows.
250 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
251 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
252 compatibility with x64.
5e4daaf3 253 (x_get_focus_frame): Add prototype.
62aba0d4
FP
254
255 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
256 defining an XRectangle structure.
257
258 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
259 arithmetics for compatibility with x64.
260
261 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
262 compatibility with x64.
263
264 * w32heap.h: Adjust prototypes and declarations.
265
266 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
267 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
268 DWORD, long, and unsigned long, for compatibility with x64.
269 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
270 (sbrk): Argument is now of type ptrdiff_t.
271
272 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
273 less than 0x0500.
274 (w32_msg_pump): Use WPARAM type for 'result'.
275
276 * w32.c (init_environment, get_emacs_configuration): Support AMD64
277 architecture.
278 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
279 compatibility with x64.
280
281 * vm-limit.c (lim_data): Now size_t.
282 (check_memory_limits): Adjust prototypes of real_morecore and
283 __morecore to receive argument of type ptrdiff_t. Use size_t for
284 five_percent and data_size.
285
286 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
287 variables, for compatibility with x64.
288 (rva_to_section, offset_to_section, relocate_offset)
289 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
290 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
291 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
292 for compatibility with x64.
293
294 * sysdep.c (STDERR_FILENO): Define if not already defined.
295
296 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
297 (__morecore): Argument type is now ptrdiff_t.
298 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
299 (relinquish): Use ptrdiff_t type for 'excess'.
300 (r_alloc_sbrk): Argument type is now ptrdiff_t.
301
302 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
303 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
304 instead of a literal number.
305
306 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
307 (min): Define only if not already defined.
308
309 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
310 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
311 hosts.
312
313 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
314 'bitmaps' is a pointer.
315
316 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
317
318 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
319
e7a2937b
PE
3202012-09-30 Paul Eggert <eggert@cs.ucla.edu>
321
322 file-attributes has a new optional arg FOLLOW-SYMLINKS.
323 * dired.c (directory_files_internal, Ffile_attributes):
324 New arg follow_symlinks. All uses changed.
325
b43d62ae
SM
3262012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
327
328 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
329
c06c382a
EZ
3302012-09-30 Eli Zaretskii <eliz@gnu.org>
331
332 Support atimers and CPU profiler via profile.c on MS-Windows.
333 * w32proc.c (sig_mask, crit_sig): New static variables.
334 (sys_signal): Support SIGALRM and SIGPROF.
335 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 336 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
337 sigfillset, and sigprocmask are no longer no-ops.
338 (sigismember): New function.
339 (struct itimer_data): New definition.
340 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
341 (crit_prof): New static variables.
342 (MAX_SINGLE_SLEEP): New definition.
343 (timer_loop, stop_timer_thread, term_timers, init_timers)
344 (start_timer_thread, getitimer, setitimer): New functions.
345 (alarm): No longer a no-op, calls setitimer.
346
347 * w32.c (term_ntproc): Call term_timers.
348 (init_ntproc): Make sure all signals are unblocked at startup, to
349 erase any traces of dumping. Call init_timers.
350
351 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
352 Windows-specific code to display the hourglass mouse pointer is no
353 longer used.
354 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
355 to hourglass timer expiration.
356 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
357 Remove, no longer used.
b43d62ae
SM
358 (w32_note_current_window, show_hourglass, hide_hourglass):
359 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
360 window systems.
361 (syms_of_w32fns): Don't initialize hourglass_timer.
362
363 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
364 WINDOWSNT as well.
365 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
366
367 * w32.h (init_timers, term_timers): Add prototypes.
368
95402d5f
KH
3692012-09-30 Kenichi Handa <handa@gnu.org>
370
371 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
372 to the buffer relocation which may be caused by ccl_driver.
373
dd946752
JD
3742012-09-30 Jan Djärv <jan.h.d@swipnet.se>
375
d7e642cc
JD
376 * xfns.c (Fx_file_dialog): Update comment.
377
378 * w32fns.c (Fx_file_dialog): Update comment.
379
380 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
381 Initialize panel name field if OSX >= 10.6.
382
383 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
384
dd946752
JD
385 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
386
387 * nsterm.m (NEW_STYLE_FS): New define.
388 (ns_fullscreen_hook, windowWillEnterFullScreen)
389 (windowDidEnterFullScreen, windowWillExitFullScreen)
390 (windowDidExitFullScreen, toggleFullScreen, handleFS)
391 (setFSValue): New functions.
392 (EmacsFSWindow): New implementation.
393 (canBecomeKeyWindow): New function for EmacsFSWindow.
394 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
395 (dealloc): Release nonfs_window if in fullscreen.
396 (updateFrameSize:): Call windowDidMove to update top/left.
397 (windowWillResize:toSize:): Check if frame is still maximized.
398 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
399 next_maximized, maximized_width, maximized_height and nonfs_window.
400 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
401 tbar_height.
402 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
403 fullscreen. Set maximized_width/height. Act on next_maximized.
404
405 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
406 (EmacsView): Add variables for fullscreen.
407 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
408 (EmacsFSWindow): New interface for fullscreen.
409
427730eb
JB
4102012-09-30 Juanma Barranquero <lekktu@gmail.com>
411
412 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
413
48de8b12
CY
4142012-09-30 Chong Yidong <cyd@gnu.org>
415
416 * fns.c (Frandom): Doc fix.
417
5938d519
MR
4182012-09-30 Martin Rudalics <rudalics@gmx.at>
419
420 * window.c (Vwindow_combination_limit): New default value.
421 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
422
cb5b0266
PE
4232012-09-30 Paul Eggert <eggert@cs.ucla.edu>
424
425 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
426 Suggested by Eli Zaretskii in
427 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
428
84f72efd
EZ
4292012-09-30 Eli Zaretskii <eliz@gnu.org>
430
431 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
432 HAVE_TIMER_SETTIME is defined.
433
9d4dcdc9
PE
4342012-09-30 Paul Eggert <eggert@cs.ucla.edu>
435
d89460ed
PE
436 Profiler improvements: more-accurate timers, overflow checks.
437 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
438 signal.h, setjmp.h. Include systime.h instead.
439 (saturated_add): New function.
440 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
441 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
442 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
443 New static vars.
84f72efd 444 (enum profiler_cpu_running): New enum.
d89460ed
PE
445 (profiler_cpu_running): Now of that enum type, not bool.
446 All uses changed to store the new value.
447 (handle_profiler_signal): Rename from sigprof_handler_1,
448 for consistency with other handlers. Do not check whether
449 cpu_log is a hash-table if garbage collecting, since it
450 doesn't matter in that case.
451 (deliver_profiler_signal): Rename from sigprof_handler,
452 for consistency with other handlers.
453 (setup_cpu_timer): New function, with much of what used to be in
454 Fprofiler_cpu_start. Check for out-of-range argument.
455 Prefer timer_settime if available, and prefer
456 thread cputime clocks, then process cputime clocks, then
457 monotonic clocks, to the old realtime clock. Use make_timeval
458 to round more-correctly when falling back to setitimer.
459 (Fprofiler_cpu_start): Use it.
460 (Fprofiler_cpu_stop): Prefer timer_settime if available.
461 Don't assume that passing NULL as the 2nd argument of setitimer
462 is the same as passing a pointer to all-zero storage.
463 Ignore SIGPROF afterwards.
464 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
465 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
466 non-fatal signal handlers. Ignore SIGPROF on startup.
467 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
468 in profiler.c, since sysdep.c now uses it.
469
9d4dcdc9
PE
470 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
471 Suggested by Eli Zaretskii in
472 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
473
8e5691a0
JB
4742012-09-29 Juanma Barranquero <lekktu@gmail.com>
475
476 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
477
e7c1b6ef
SM
4782012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
479
480 * lisp.h (struct backtrace): Remove indirection for `function' field.
481 * xdisp.c (redisplay_internal):
482 * profiler.c (record_backtrace, sigprof_handler_1):
483 * alloc.c (Fgarbage_collect):
484 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
485 (Fbacktrace_frame): Adjust accordingly.
486
e61d39cd 4872012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
488
489 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
490 (Frun_hook_with_args_until_failure): Doc fixes.
491
404043ea
EZ
4922012-09-28 Eli Zaretskii <eliz@gnu.org>
493
494 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
495 Qautomatic_redisplay and change the symbol name. All users changed.
496
704d3f45
TM
4972012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
498
499 * profiler.c (sigprof_handler): Fix race condition.
500
757140ff
GM
5012012-09-28 Glenn Morris <rgm@gnu.org>
502
503 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
504
a615a3ae
PE
5052012-09-27 Paul Eggert <eggert@cs.ucla.edu>
506
507 Check more robustly for timer_settime.
89d17fd0
PE
508 * Makefile.in (LIB_TIMER_TIME): New macro.
509 (LIBES): Add it.
a615a3ae
PE
510 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
511 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
512 call timer_settime.
513
3670daf7
TM
5142012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
515
516 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
517
6a586b7f
JB
5182012-09-26 Juanma Barranquero <lekktu@gmail.com>
519
520 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
521
41c8bfcf
PE
5222012-09-26 Paul Eggert <eggert@cs.ucla.edu>
523
524 * character.h (MAYBE_UNIFY_CHAR): Remove.
525 * charset.c, charset.h (maybe_unify_char): Now static.
526 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
527 Since this stuff is now private to charset.c, there's no need for
528 a public macro and no need to inline by hand.
529
3a880af4
SM
5302012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
531 Stefan Monnier <monnier@iro.umontreal.ca>
532 Juanma Barranquero <lekktu@gmail.com>
611b7507 533
3a880af4
SM
534 * profiler.c: New file.
535 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
536 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
537 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
538 * emacs.c (main): Call syms_of_profiler.
539 * alloc.c (Qautomatic_gc): New constant.
540 (MALLOC_PROBE): New macro.
541 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
542 (total_bytes_of_live_objects): New function.
543 (Fgarbage_collect): Use it. Record itself in backtrace_list.
544 Call malloc_probe for the memory profiler.
545 (syms_of_alloc): Define Qautomatic_gc.
546 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
547 race condition.
548 (struct backtrace): Move definition...
549 * lisp.h (struct backtrace): ..here.
550 (Qautomatic_gc, profiler_memory_running): Declare vars.
551 (malloc_probe, syms_of_profiler): Declare functions.
552 * xdisp.c (Qautomatic_redisplay): New constant.
553 (redisplay_internal): Record itself in backtrace_list.
554 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 555
5938d519 5562012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
5572012-09-25 Juanma Barranquero <lekktu@gmail.com>
558
559 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
560
e26fd2e4
PE
5612012-09-25 Paul Eggert <eggert@cs.ucla.edu>
562
563 Prefer POSIX timers if available.
564 They avoid a race if the timer is too close to the current time.
565 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
566 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 567 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 568
eedec3ee
EZ
5692012-09-25 Eli Zaretskii <eliz@gnu.org>
570
571 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
572 CHAR_STRING_ADVANCE.
573 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
574 STRING_CHAR_ADVANCE.
575
aa15c6bb
JB
5762012-09-25 Juanma Barranquero <lekktu@gmail.com>
577
578 Move Vlibrary_cache to emacs.c and reset before dumping.
579
580 * lisp.h (reset_image_types): Declare.
581 [WINDOWSNT] (Vlibrary_cache): Declare.
582
583 * image.c (reset_image_types): New function.
584
585 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
586 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
587 (Fdump_emacs): Reset Vlibrary_cache and image_types.
588
589 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
590 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
591
592 * w32.h (Vlibrary_cache): Do not declare.
593
54d629be
EZ
5942012-09-25 Eli Zaretskii <eliz@gnu.org>
595
16b22fef
EZ
596 * w32proc.c (sys_signal): Handle all signals defined by the
597 MS-Windows runtime, not just SIGCHLD. Actually install the signal
598 handlers for signals supported by Windows. Don't override
599 term_ntproc as the handler for SIGABRT.
600 (sigaction): Rewrite to call sys_signal instead of duplicating its
601 code.
602 (sys_kill): Improve commentary.
603
604 * w32.c (term_ntproc): Accept (and ignore) one argument, for
605 consistency with a signature of a signal handler. All callers
606 changed.
607 (init_ntproc): Accept an argument DUMPING. If dumping, don't
608 install term_ntproc as a signal handler for SIGABRT, as that
609 should be done by the dumped Emacs.
610
611 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
612
613 * w32select.c (term_w32select): Protect against repeated
614 invocation by setting clipboard_owner to NULL after calling
615 DestroyWindow.
616
617 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
618 and term_ntproc to their modified signatures.
619
54d629be
EZ
620 * character.c (char_string, string_char): Remove calls to
621 MAYBE_UNIFY_CHAR. See the discussion starting at
622 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
623 for the details.
624
59f7af81
CY
6252012-09-25 Chong Yidong <cyd@gnu.org>
626
627 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
628
22e8cf4a
SM
6292012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
630
631 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
632 when encountering an unknown bytecode.
633
578098f3
PE
6342012-09-24 Paul Eggert <eggert@cs.ucla.edu>
635
636 image.c, indent.c: Use bool for booleans.
637 * dispextern.h (struct image_type): Members valid_p, load, init
638 now return bool, not int. All uses changed.
639 * image.c: Omit unnecessary static decls.
640 (x_create_bitmap_mask, x_build_heuristic_mask):
641 Return void, not int, since callers don't care about the return value.
642 (x_create_bitmap_mask, define_image_type, valid_image_p)
643 (struct image_keyword, parse_image_spec, image_spec_value)
644 (check_image_size, image_background)
645 (image_background_transparent, x_clear_image_1)
646 (postprocess_image, lookup_image, x_check_image_size)
647 (x_create_x_image_and_pixmap, xbm_image_p)
648 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
649 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
650 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
651 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
652 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
653 (png_image_p, init_png_functions, png_load_body, png_load)
654 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
655 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
656 (init_gif_functions, gif_load, imagemagick_image_p)
657 (imagemagick_load_image, imagemagick_load, svg_image_p)
658 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
659 (gs_load):
660 * nsimage.m (ns_load_image):
661 * nsterm.m (ns_defined_color):
662 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
663 * xfns.c (x_defined_color):
664 * xterm.c (x_alloc_lighter_color_for_widget)
665 (x_alloc_nearest_color_1, x_alloc_nearest_color)
666 (x_alloc_lighter_color):
667 * indent.c (disptab_matches_widthtab, current_column)
668 (scan_for_column, string_display_width, indented_beyond_p)
669 (compute_motion, vmotion, Fvertical_motion):
670 Use bool for booleans.
671
a5f2b6ec
CY
6722012-09-24 Chong Yidong <cyd@gnu.org>
673
674 * chartab.c (Fset_char_table_default): Obsolete function removed.
675
18e27ea8
PE
6762012-09-23 Paul Eggert <eggert@cs.ucla.edu>
677
afea8a8a
PE
678 Move pid_t related decls out of lisp.h.
679 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
680 (interruptible_wait_for_termination):
681 Move these decls from lisp.h to syswait.h, since they use pid_t.
682 Needed on FreeBSD; see Herbert J. Skuhra in
683 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
684 * callproc.c: Include syswait.h.
685
18e27ea8
PE
686 gnutls.c, gtkutil.c: Use bool for boolean.
687 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
688 (emacs_gnutls_handle_error):
689 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
690 (xg_hide_tooltip, xg_create_frame_widgets)
691 (create_dialog, xg_uses_old_file_dialog)
692 (xg_get_file_with_chooser, xg_get_file_with_selection)
693 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
694 (xg_item_label_same_p, xg_update_menubar)
695 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
696 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
697 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
698 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
699 (update_frame_tool_bar, free_frame_tool_bar):
700 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
701 * nsmenu.m (ns_update_menubar):
702 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
703 * xfns.c (Fx_show_tip) [USE_GTK]:
704 Use bool for boolean.
705 * gtkutil.c (xg_update_frame_menubar):
706 * xmenu.c (update_frame_menubar):
707 Return void, not int, since caller ignores return value.
708 * gtkutil.c (xg_change_toolbar_position):
709 Return void, not 1.
710
af0e9f75
JB
7112012-09-23 Juanma Barranquero <lekktu@gmail.com>
712
713 * makefile.w32-in (BLOCKINPUT_H): Remove.
714 (SYSSIGNAL_H): New macro.
715 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
716 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
717 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
718 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
719 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
720 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
721 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
722 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
723 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
724 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
725 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
726 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
727 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
728 ($(BLD)/w32xfns.$(O)): Update dependencies.
729
5101529e
EZ
7302012-09-23 Eli Zaretskii <eliz@gnu.org>
731
732 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
733 fatal_error_backtrace.
734
735 * w32proc.c (sys_kill): Undo last change: don't do anything when
736 invoked to deliver SIGABRT to our own process. This is now
737 handled by emacs_raise.
738
2c3ee0ad
JB
7392012-09-23 Juanma Barranquero <lekktu@gmail.com>
740
741 * w32term.c (w32_read_socket): Remove leftover reference to
742 interrupt_input_pending.
743
62a1d661
PE
7442012-09-23 Paul Eggert <eggert@cs.ucla.edu>
745
746 Do not use SA_NODEFER.
747 Problem reported by Dani Moncayo in
748 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
749 * alloc.c (die):
750 * sysdep.c (emacs_abort): Do not reset signal handler.
751 * emacs.c (terminate_due_to_signal): Reset signal handler here.
752 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
753 wanted even on POSIXish hosts, and it doesn't work on Windows.
754
a0942b9a
JD
7552012-09-23 Jan Djärv <jan.h.d@swipnet.se>
756
757 * xterm.c (x_term_init): Call fixup_locale before and after calling
758 gtk_init (Bug#12392).
759
d07ff9db
CY
7602012-09-23 Chong Yidong <cyd@gnu.org>
761
762 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
763 Vdynamic_library_alist.
764
765 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
766 (Fgnutls_available_p): Caller changed.
767
768 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
769 (Flibxml_parse_xml_region): Likewise.
770
771 * dispextern.h (struct image_type): Remove arg from init function.
772
773 * image.c (Finit_image_library, lookup_image_type)
774 (define_image_type): Remove now-unneeded second arg.
775 (init_xpm_functions, init_png_functions, init_jpeg_functions)
776 (init_tiff_functions, init_gif_functions, init_svg_functions):
777 Arglist and w32_delayed_load calling convention changed.
778 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 779 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 780
4d7e6e51
PE
7812012-09-23 Paul Eggert <eggert@cs.ucla.edu>
782
783 Simplify and avoid signal-handling races (Bug#12471).
784 * alloc.c (die):
785 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
786 Avoid recursive loop if there's a fatal error in the function itself.
787 * atimer.c (pending_atimers):
788 * blockinput.h: Don't include "atimer.h"; no longer needed.
789 (interrupt_input_pending): Remove. All uses removed.
790 pending_signals now counts both atimers and ordinary interrupts.
791 This is less racy than having three separate pending-signal flags.
792 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
793 (input_blocked_p):
794 Rename from their upper-case counterparts BLOCK_INPUT,
795 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
796 INPUT_BLOCKED_P, and turn into functions. All uses changed.
797 This makes it easier to access volatile variables more accurately.
798 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
799 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
800 that's more reliable if the code is buggy and sets
801 interrupt_input_blocked to a negative value. All uses changed.
802 * atimer.c (deliver_alarm_signal):
803 Remove. No need to deliver this to the parent; any thread can
804 handle this signal now. All uses replaced by underlying handler.
805 * atimer.c (turn_on_atimers):
806 * dispnew.c (handle_window_change_signal):
807 * emacs.c (handle_danger_signal):
808 * keyboard.c (kbd_buffer_get_event):
809 Don't reestablish signal handler; not needed with sigaction.
810 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
811 (UNBLOCK_INPUT_TO):
812 Rework to avoid unnecessary accesses to volatile variables.
813 (UNBLOCK_INPUT_TO): Now a function.
814 (totally_unblock_input, unblock_input): New decls.
815 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
816 (init_data): Remove. Necessary stuff now done in init_signal.
817 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
818 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
819 (fatal_error_code): Remove; no longer needed.
820 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
821 it doesn't always backtrace. All uses changed. No need to reset
822 signal to default, since sigaction and/or die does that for us now.
823 Use emacs_raise (FOO), not kill (getpid (), FOO).
824 (main): Check more-accurately whether we're dumping.
825 Move fatal-error setup to sysdep.c
826 * floatfns.c: Do not include "syssignal.h"; no longer needed.
827 * gtkutil.c (xg_get_file_name, xg_get_font):
828 Remove no-longer-needed signal-mask manipulation.
829 * keyboard.c, process.c (POLL_FOR_INPUT):
830 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
831 * keyboard.c (read_avail_input): Remove.
832 All uses replaced by gobble_input.
833 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
834 (kbd_buffer_store_event_hold, gobble_input):
835 (record_asynch_buffer_change) [USABLE_SIGIO]:
836 (store_user_signal_events):
837 No need to mess with signal mask.
838 (gobble_input): If blocking input and there are terminals, simply
839 set pending_signals to 1 and return. All hooks changed to not
840 worry about whether input is blocked.
841 (process_pending_signals): Clear pending_signals before processing
842 them, in case a signal comes in while we're processing.
843 By convention callers now test pending_signals before calling us.
844 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
845 New functions, to support changes to blockinput.h.
846 (handle_input_available_signal): Now extern.
847 (reinvoke_input_signal): Remove. All uses replaced by
848 handle_async_input.
849 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
850 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
851 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
852 Clear sigmask reliably, even if Fsignal returns, which it can.
853 Omit unnecessary accesses to volatile var.
854 (quit_throw_to_read_char): No need to restore sigmask.
855 * keyboard.c (gobble_input, handle_user_signal):
856 * process.c (wait_reading_process_output):
857 Call signal-handling code rather than killing ourselves.
858 * lisp.h: Include <float.h>, for...
859 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
860 (pending_signals): Now volatile.
861 (syms_of_data): Now const if IEEE floating point.
862 (handle_input_available_signal) [USABLE_SIGIO]:
863 (terminate_due_to_signal, record_child_status_change): New decls.
864 * process.c (create_process): Avoid disaster if memory is exhausted
865 while we're processing a vfork, by tightening the critical section
866 around the vfork.
867 (send_process_frame, process_sent_to, handle_pipe_signal)
868 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
869 ignores SIGPIPE.
870 (send_process): No need for setjmp/longjmp any more, since the
871 SIGPIPE stuff is now gone. Instead, report an error if errno
872 is EPIPE.
873 (record_child_status_change): Now extern. PID and W are now args.
874 Return void, not bool. All callers changed.
875 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
876 Remove. All uses removed. This bug should be fixed now in a
877 different way.
878 (wait_for_termination_1): Use waitpid rather than sigsuspend,
879 and record the child status change directly. This avoids the
880 need to futz with the signal mask.
881 (process_fatal_action): Move here from emacs.c.
882 (emacs_sigaction_flags): New function, containing
883 much of what used to be in emacs_sigaction_init.
884 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
885 caught by emacs, to make races less likely.
886 (deliver_process_signal): Rename from handle_on_main_thread.
887 All uses changed.
888 (BACKTRACE_LIMIT_MAX): Now at top level.
889 (thread_backtrace_buffer, threadback_backtrace_pointers):
890 New static vars.
891 (deliver_thread_signal, deliver_fatal_thread_signal):
892 New functions, for more-accurate delivery of thread-specific signals.
893 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
894 (deliver_arith_signal): Handle in this thread, not
895 in the main thread, since it's triggered by this thread.
896 (maybe_fatal_sig): New function.
897 (init_signals): New arg DUMPING so that we can be more accurate
898 about whether we're dumping. Caller changed.
899 Treat thread-specific signals differently from process-general signals.
900 Block all signals while handling fatal error; that's safer.
901 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
902 on IEEE hosts.
903 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
904 Ignore SIGPIPE unless batch.
905 (emacs_backtrace): Output backtrace for the appropriate thread,
906 which is not necessarily the main thread.
907 * syssignal.h: Include <stdbool.h>.
908 (emacs_raise): New macro.
909 * xterm.c (x_connection_signal): Remove; no longer needed
910 now that we use sigaction.
911 (x_connection_closed): No need to mess with sigmask now.
912 (x_initialize): No need to reset SIGPIPE handler here, since
913 init_signals does this for us now.
914
8f4635e9
JD
9152012-09-23 Jan Djärv <jan.h.d@swipnet.se>
916
917 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 918 background rect may be larger (Bug#12245).
8f4635e9 919
3296976d
CY
9202012-09-23 Chong Yidong <cyd@gnu.org>
921
922 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
923
d41e491e
PE
9242012-09-22 Paul Eggert <eggert@cs.ucla.edu>
925
926 * .gdbinit: Just stop at fatal_error_backtrace.
927 See Stefan Monnier's request in
928 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
929 Remove no-longer-used query of system type.
930
c88b867f
CY
9312012-09-22 Chong Yidong <cyd@gnu.org>
932
933 * search.c (Freplace_match): Doc fix (Bug#12325).
934
935 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
936
937 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
938 (Fline_end_position): Doc fix.
939
940 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
941
bb4d86b4
CY
9422012-09-22 Chong Yidong <cyd@gnu.org>
943
944 * dispextern.h (struct image_type): Add new slot, storing a type
945 initialization function.
946
947 * image.c (define_image_type): Call the image initializer function
948 if it is defined. Arguments and return value changed.
949 (valid_image_p, make_image): Callers changed.
950 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
951 (gif_type, imagemagick_type, svg_type, gs_type):
952 Add initialization functions.
bb4d86b4
CY
953 (Finit_image_library): Call lookup_image_type.
954 (CHECK_LIB_AVAILABLE): Macro deleted.
955 (lookup_image_type): Call define_image_type here, rather than via
956 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
957 (syms_of_image): Move define_image_type calls for xbm_type and
958 pbm_type to lookup_image_type.
959
df9685f3
EZ
9602012-09-22 Eli Zaretskii <eliz@gnu.org>
961
962 * keyboard.c (timer_check_2): Move calculation of 'timers' and
963 'idle_timers' from here ...
964 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
965 lists, to avoid infloops when the timer does something stupid,
966 like reinvoke itself with the same or smaller time-out.
967 (Bug#12447)
968
8e17c9ba
MR
9692012-09-22 Martin Rudalics <rudalics@gmx.at>
970
971 * window.c (Fsplit_window_internal): Handle only Qt value of
972 Vwindow_combination_limit separately.
973 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
974 (Vwindow_combination_limit): New default value.
975 Rewrite doc-string.
8e17c9ba 976
589bd69b
EZ
9772012-09-22 Eli Zaretskii <eliz@gnu.org>
978
979 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
980 the new overlay string. (Bug#10159)
981
01108e3f
PE
9822012-09-22 Paul Eggert <eggert@cs.ucla.edu>
983
984 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
985 or that fprintf is async-signal-safe. POSIX doesn't require
986 either assumption.
987
82f8cd94
CY
9882012-09-22 Chong Yidong <cyd@gnu.org>
989
990 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
991 (Bug#8207).
992
3cccbd87
KH
9932012-09-22 Kenichi Handa <handa@gnu.org>
994
995 * composite.c (composition_reseat_it): Handle the case that a
996 grapheme cluster is not covered by a single font (Bug#12352).
997
09c01941
CY
9982012-09-21 Chong Yidong <cyd@gnu.org>
999
1000 * image.c (define_image_type): Avoid adding duplicate types to
1001 image_types (Bug#12463). Suggested by Jörg Walter.
1002
acfa068f 10032012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
1004
1005 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
1006 (print_load_command_name): Add case LC_DATA_IN_CODE.
1007 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
1008
acfa068f 10092012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
1010
1011 * eval.c (Frun_hook_with_args_until_success)
1012 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
1013
acfa068f 10142012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
1015
1016 * fileio.c (Ffile_selinux_context): Only call freecon when
1017 lgetfilecon succeeded.
1018 (Fset_file_selinux_context): Likewise. (Bug#12444)
1019
acfa068f 10202012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
1021
1022 * xdisp.c (try_window_reusing_current_matrix): Under bidi
1023 reordering, locate the cursor by calling set_cursor_from_row; if
1024 that fails, clear the desired glyph matrix before returning a
1025 failure indication to the caller. Fixes leaving garbled display
1026 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
1027 (compute_stop_pos_backwards): Fix a typo that caused crashes while
1028 scrolling through multibyte text.
aa36e4d2 1029
e99f70c8
SM
10302012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
1031
1032 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
1033 calling mark_vectorlike since that's the one that marks the window.
1034 (mark_discard_killed_buffers): Mark the final cdr.
1035 * window.h (struct window): Move prev/next_buffers to the
1036 non-standard fields.
1037 * window.c (make_window): Initialize prev/next_buffers manually.
1038
f75beb47
PE
10392012-09-20 Paul Eggert <eggert@cs.ucla.edu>
1040
1041 Omit unused arg EXPECTED from socket hooks.
1042 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1043 * nsterm.m (ns_term_init):
1044 * termhooks.h (struct terminal.read_socket_hook):
1045 * w32inevt.c (w32_console_read_socket):
1046 * w32term.c (w32_read_socket):
1047 * xterm.c (XTread_socket):
1048 Omit unused arg EXPECTED. All callers changed.
1049 (store_user_signal_events): Return void, not int, since callers no
1050 longer care about the return value. All uses changed.
1051
b019b76a
JB
10522012-09-20 Juanma Barranquero <lekktu@gmail.com>
1053
1054 * w32gui.h (XParseGeometry): Do not declare.
1055
05642592
PE
10562012-09-19 Paul Eggert <eggert@cs.ucla.edu>
1057
e4bce92a
PE
1058 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1059 Ignore 'expected'. See Eli Zaretskii in
1060 <http://bugs.gnu.org/12471#8> (last line).
1061
05642592
PE
1062 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
1063 (XParseGeometry): Now static. Substitute extremal values for
1064 values that are out of range.
1065
e543ae91
JD
10662012-09-19 Jan Djärv <jan.h.d@swipnet.se>
1067
1068 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1069
1070 * nsfns.m (XParseGeometry): Remove.
1071 (Fx_create_frame): Call x_set_offset to correctly interpret
1072 top_pos in geometry.
1073
3a880af4 1074 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
1075 (Fx_parse_geometry): If there is a space in string, call
1076 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1077
45ba16c7
EZ
10782012-09-17 Eli Zaretskii <eliz@gnu.org>
1079
c8b9f1bc
EZ
1080 * search.c (scan_buffer): Use character positions in calls to
1081 region_cache_forward and region_cache_backward, not byte
1082 positions. (Bug#12196)
1083
b4c932a2
EZ
1084 * w32term.c (w32_read_socket): Set pending_signals to 1, like
1085 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
1086
45ba16c7
EZ
1087 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1088 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1089 emacs_blocked_malloc, now deleted.
1090
eeceac93
PE
10912012-09-17 Paul Eggert <eggert@cs.ucla.edu>
1092
1093 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1094 The workaround was for improving performance on Solaris 2.4, but
1095 is getting in the way now. Emacs will still work if someone is
1096 still running Solaris 2.4 in a museum somewhere; Sun dropped
1097 support for Solaris 2.4 in 2003.
1098 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1099 * process.c (create_process) [HAVE_WORKING_VFORK]:
1100 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1101 since Emacs no longer uses vfork on that platform.
1102
78f83752
GM
11032012-09-17 Glenn Morris <rgm@gnu.org>
1104
1105 * emacs.c: Use COPYRIGHT.
1106
634b8cac
PE
11072012-09-16 Paul Eggert <eggert@cs.ucla.edu>
1108
0caaedb1
PE
1109 Remove configure's --without-sync-input option (Bug#12450).
1110 When auditing signal-handling in preparation for cleaning it up,
1111 I found that SYNC_INPUT has race conditions and would be a real
1112 pain to fix. Since it's an undocumented and deprecated
1113 configure-time option, now seems like a good time to remove it.
1114 Also see <http://bugs.gnu.org/11080#16>.
1115 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1116 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1117 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1118 (malloc_hysteresis):
1119 (check_depth) [XMALLOC_OVERRUN_CHECK]:
1120 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1121 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1122 (dont_register_blocks, bytes_used_when_reconsidered)
1123 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1124 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1125 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1126 Remove. All uses removed.
1127 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1128 implementation, one that depends on whether the new macro
1129 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1130 is defined.
1131 * atimer.c (run_timers, handle_alarm_signal):
1132 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1133 (handle_async_input, process_pending_signals)
1134 (handle_input_available_signal, init_keyboard):
1135 * nsterm.m (ns_read_socket):
1136 * process.c (wait_reading_process_output):
1137 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1138 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1139 (emacs_write):
1140 * xterm.c (XTread_socket):
1141 Assume SYNC_INPUT.
1142 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1143 * eval.c (handling_signal): Remove. All uses removed.
1144 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1145 All uses replaced with the SYNC_INPUT version.
1146 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1147 Remove decls.
1148 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1149 Now static.
1150
634b8cac
PE
1151 * font.c (Ffont_shape_gstring): Remove unused local.
1152
83da1b55
GM
11532012-09-16 Glenn Morris <rgm@gnu.org>
1154
518650a5
GM
1155 * Makefile.in (clean): No longer run nextstep's clean.
1156
83da1b55
GM
1157 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1158 (ns_frag): Remove.
1159 (ns-app): Move here from ns.mk, and simplify.
1160 (clean): Simplify nextstep entry.
1161 * ns.mk: Remove file.
1162
85a43e2e
KH
11632012-09-17 Kenichi Handa <handa@gnu.org>
1164
1165 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1166 not covert the last few charactes.
1167
ba13e616 11682012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
1169
1170 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1171 here, but just check the validity of glyphs in the glyph-string.
1172
a8c729af
MR
11732012-09-16 Martin Rudalics <rudalics@gmx.at>
1174
3a880af4
SM
1175 * window.c (Fwindow_parameter, Fset_window_parameter):
1176 Accept any window as argument (Bug#12452).
a8c729af 1177
c077c059
JD
11782012-09-16 Jan Djärv <jan.h.d@swipnet.se>
1179
1180 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1181 to ns_term_init to avoid memory leak.
1182
1183 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
1184 explicit retain/release.
1185 (ns_term_init): Only allow one display. Initialize outerpool and
1186 ns_*_types.
1187
39a57ad0
PE
11882012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1189
1190 Port _setjmp fix to POSIXish hosts as well as Microsoft.
1191 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
1192 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
1193 the Microsoft problem in a different way, by altering ../nt/config.nt.
1194
7105c8cb
EZ
11952012-09-15 Eli Zaretskii <eliz@gnu.org>
1196
1197 * w32xfns.c:
1198 * w32uniscribe.c:
1199 * w32term.c:
1200 * w32select.c:
1201 * w32reg.c:
1202 * w32proc.c:
1203 * w32menu.c:
1204 * w32inevt.c:
1205 * w32heap.c:
1206 * w32font.c:
1207 * w32fns.c:
1208 * w32console.c:
1209 * w32.c:
1210 * w16select.c: Remove inclusion of setjmp.h, as it is now included
1211 by lisp.h. This completes removal of setjmp.h inclusion
1212 erroneously announced in the previous commit. (Bug#12446)
1213
1214 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
1215 more accurate.
1216
1217 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
1218 not defined as a macro. The latter happens on MS-Windows.
1219 (Bug#12446)
1220
0328b6de
PE
12212012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1222
1223 Port better to POSIX hosts lacking _setjmp (Bug#12446).
1224 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 1225 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
1226 only reason for the instance was because "lisp.h" was included.
1227 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
1228 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
1229 and _longjmp with the new symbols. Emacs already uses _setjmp if
1230 available, so this change affects only POSIXish hosts that have
1231 sigsetjmp but not _setjmp, such as some versions of Solaris and
1232 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
1233 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
1234 (png_load_body) [HAVE_PNG]:
1235 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
1236 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
1237 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
1238 since PNG requires jmp_buf. This is the only exception to the
1239 general rule that we now use sys_setjmp and sys_longjmp.
1240 This exception is OK since this code does not change the signal
1241 mask or longjmp out of a signal handler.
1242
2af03429
PE
12432012-09-14 Paul Eggert <eggert@cs.ucla.edu>
1244
1245 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1246 Include "syssignal.h", for 'main_thread'.
1247
2f294edf
DA
12482012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
1249
1250 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
1251 * insdel.c (replace_range, replace_range_2):
1252 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
1253 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1254 Remove redundant check before calling offset_intervals.
1255
6b533e9c
MR
12562012-09-14 Martin Rudalics <rudalics@gmx.at>
1257
1258 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1259 current buffer (Bug#12387).
1260
2a7931e3
JB
12612012-09-14 Juanma Barranquero <lekktu@gmail.com>
1262
1263 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1264
c18e885b
PE
12652012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1266
1267 Use a more backwards-compatible timer format (Bug#12430).
1268 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1269 vector element, not from the 4th, since PSECS is now at the end.
1270 (Fcurrent_idle_time): Doc fix.
1271
d59a1afb
DA
12722012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
1273
1274 Function to mark objects and remove killed buffers at once.
1275 * alloc.c (discard_killed_buffers): Rename to ...
1276 (mark_discard_killed buffers) ... new name. Add marking
1277 of remaining objects. Fix comment. Adjust users.
1278 (mark_object): Do not touch frame buffer lists here.
1279 * frame.c (delete_frame): Reset frame buffer lists here.
1280
5f0cb45a
PE
12812012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1282
8ea47e3a
PE
1283 Better workaround for GNOME bug when --enable-gcc-warnings.
1284 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1285 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
1286 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1287
4a4bbad2
PE
1288 Simplify SIGIO usage (Bug#12408).
1289 The code that dealt with SIGIO was crufty and confusing, e.g., it
1290 played tricks like "#undef SIGIO" but these tricks were not used
1291 consistently. Simplify mostly by not #undeffing standard symbols,
1292 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1293 or not as we please) rather than "defined SIGIO" (standard symbol
1294 that we probably shouldn't #undef).
1295 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1296 Modules that need it can include it.
1297 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1298 * dispextern.h (ignore_sigio): New decl.
1299 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1300 unconditionally, since it's now a no-op if !USABLE_SIGIO.
1301 * emacs.c (shut_down_emacs):
1302 * keyboard.c (kbd_buffer_store_event_hold):
1303 Use ignore_sigio rather than invoking 'signal' directly.
1304 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1305 for FIONREAD.
1306 (FIONREAD, SIGIO): Do not #undef.
1307 (tty_read_avail_input): Use #error rather than a syntax error.
1308 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1309 for I_PIPE, used by SETUP_SLAVE_PTY.
1310 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1311 * sysdep.c (croak): Remove; no longer needed. This bit of
1312 temporary code, with Fred N. Fish's comment that it's temporary,
1313 has been in Emacs since at least 1992!
1314 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1315 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1316 * syssignal.h (croak): Remove decl.
1317 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1318 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1319 now that we're termios-only.
1320 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1321 * term.c (dissociate_if_controlling_tty): Use #error rather than
1322 a run-time error.
1323
5f0cb45a
PE
1324 Work around GCC and GNOME bugs when --enable-gcc-warnings.
1325 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1326 to work around GNOME bug 683906.
1327 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1328 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1329 This works around GCC bug 54561.
1330
40bce90b
PE
13312012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1332
1333 More fixes for 'volatile' and setjmp/longjmp.
1334 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1335 * image.c (struct png_load_context) [HAVE_PNG]: New type.
1336 (png_load_body) [HAVE_PNG]:
1337 (jpeg_load_body) [HAVE_JPEG]:
1338 New function, with most of the old parent function's body.
1339 (png_load) [HAVE_PNG]:
1340 (jpeg_load) [HAVE_JPEG]:
1341 Invoke the new function, to avoid longjmp munging our locals.
1342 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
1343 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
1344 longjmp is passed 2, as the C standard doesn't guarantee this.
1345 Instead, store the failure code into mgr->failure_code.
1346
bfeae2cf
SM
13472012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1348
1349 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
1350 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
1351 (syms_of_keyboard): Remove support for unread-command-char.
1352
8099e36b
EZ
13532012-09-12 Eli Zaretskii <eliz@gnu.org>
1354
1355 * w32proc.c (sys_kill): If PID is our process ID and the signal is
1356 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
1357 violation. (Bug#12426)
1358
92547ff9
PE
13592012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1360
1361 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
1362
45b82ad0
SM
13632012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1364
1365 * eval.c: Add `inhibit-debugger'.
1366 (Qinhibit_debugger): New symbol.
1367 (call_debugger): Bind it instead of Qdebug_on_error.
1368 (maybe_call_debugger): Test Vinhibit_debugger.
1369 (syms_of_eval): Define inhibit-debugger.
1370 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1371 (syms_of_xdisp): Remove inhibit-debug-on-message.
1372
5779a1dc
PE
13732012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1374
50f2e553
PE
1375 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1376 If a nonvolatile local variable is written before a _longjmp to
1377 the frame containing the variable, and is read after the _longjmp,
1378 the value read is indeterminate. Some local variables of type
1379 'struct handler' and 'struct catchtag' are used in this way, so
1380 mark each of their slots as volatile if the slot can be set before
1381 _longjmp and read afterwards.
1382 * lisp.h (struct handler): var and chosen_clause are now volatile.
1383 (struct catchtag): val, next, and pdlcount are now volatile.
1384
ae1d87e2
PE
1385 * bidi.c (bidi_push_it, bidi_pop_it):
1386 * fns.c (copy_hash_table):
1387 * image.c (define_image_type):
1388 * keyboard.c (kbd_buffer_store_event_hold):
1389 * process.c (Fprocess_send_eof):
1390 * xfaces.c (x_create_gc) [HAVE_NS]:
1391 * xgselect.c (xg_select):
1392 Prefer assignment to memcpy when either will do.
1393
5779a1dc
PE
1394 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1395 Use pointer-to-a-pointer to simplify and avoid a NILP check each
1396 time an item is removed. No need to mark this function 'inline';
1397 the compiler knows better than we do.
1398
c4c9756b
JD
13992012-09-11 Jan Djärv <jan.h.d@swipnet.se>
1400
1401 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1402 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1403 to change_frame_size (Bug#12388).
1404 (windowDidResize:): Pass YES to updateFrameSize.
1405
1406 * nsterm.h: Add delay parameter to updateFrameSize.
1407
d73e321c
DA
14082012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1409
1410 Discard killed buffers from deleted window and frame objects.
1411 This reduces an amount of references to killed buffers and
1412 helps GC to reclaim them faster.
1413 * alloc.c (discard_killed_buffers): New function.
1414 (mark_object): Use it for deleted windows and frames.
1415 (mark_object): If symbol's value is set up for a killed buffer
1416 or deleted frame, restore it's global binding.
1417 * data.c (swap_in_global_binding): Add GC notice.
1418 (swap_in_symval_forwarding): Use convenient set_blv_where.
1419 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1420 * window.h: ... to here.
1421
e578f381
DA
14222012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1423
1424 Convenient macro to check whether the buffer is live.
1425 * buffer.h (BUFFER_LIVE_P): New macro.
1426 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1427 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1428
3057e615
YM
14292012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1430
1431 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1432 composition cases (Bug#12364).
1433
1434 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1435 overhang of succeeding glyphs overlapping box cursor.
1436
1437 * w32term.c (x_draw_glyph_string): Likewise.
1438
6fda35f2
PE
14392012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1440
c990426a
PE
1441 Simplify, document, and port floating-point (Bug#12381).
1442 The porting part of this patch fixes bugs on non-IEEE platforms
1443 with frexp, ldexp, logb.
1444 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1445 Now static.
1446 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1447 support, by removing commented-out code and briefly listing the
1448 C89 functions excluded. The commented-out stuff was confusing
1449 maintenance, e.g., we thought we needed cbrt but it was commented out.
1450 (logb): Remove decl; no longer needed.
1451 (isfinite): New macro, if not already supplied.
1452 (isnan): Don't replace any existing macro.
1453 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1454 are present on all C89 platforms.
1455 (Ffrexp): Do not special-case zero, as frexp does the right thing
1456 for that case.
1457 (Flogb): Do not use logb, as it doesn't have the desired meaning
1458 on hosts that use non-base-2 floating point. Instead, stick with
1459 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1460 frexp, to avoid getting an unspecified result.
1461
6fda35f2
PE
1462 * xdisp.c (Qinhibit_debug_on_message): Now static.
1463
16130a58
JD
14642012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1465
1466 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1467 NSBezierPath (Bug#12131).
1468
d105a573
CY
14692012-09-10 Chong Yidong <cyd@gnu.org>
1470
1471 * fns.c (Fdelq, Fdelete): Doc fix.
1472
ff55dfe8
PE
14732012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1474
1475 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1476 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1477
e7032e7c
SM
14782012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1479
1480 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1481 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1482 Use it.
1483
e9957956
EZ
14842012-09-09 Eli Zaretskii <eliz@gnu.org>
1485
aba05ce9
EZ
1486 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1487 left fringe if the window has a left margin. This avoids leaving
1488 traces of the cursor because its leftmost pixel is not drawn over.
1489
e9957956
EZ
1490 * dispnew.c (update_window_line): When the left margin area of a
1491 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1492 that screen line. (Bug#12277)
1493
f6196b87
PE
14942012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1495
1496 Assume C89 or later for math functions (Bug#12381).
1497 This simplifies the code, and makes it a bit smaller and faster,
1498 and (most important) makes it easier to clean up signal handling
1499 since we can stop worring about floating-point exceptions in
1500 library code. That was a problem before C89, but the problem
1501 went away many years ago on all practical Emacs targets.
1502 * data.c, image.c, lread.c, print.c:
1503 Don't include <math.h>; no longer needed.
1504 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1505 might be autoconfigured, as that never happens.
1506 * data.c (fmod):
1507 * doprnt.c (DBL_MAX_10_EXP):
1508 * print.c (DBL_DIG):
1509 Remove. C89 or later always defines these.
1510 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1511 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1512 (arith_error, domain_error, domain_error2):
1513 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1514 no longer needed -- we simply return what C returns. All uses removed.
1515 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1516 the wrapped code.
1517 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1518 Remove. All uses expanded, as these macros are no longer used
1519 more than once and are now more trouble than they're worth.
1520 (Ftan): Use tan, not sin / cos.
1521 (Flogb): Assume C89 frexp.
1522 (fmod_float): Assume C89 fmod.
1523 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1524 (init_floatfns): Remove. All uses removed.
1525
9d7f1863
JD
15262012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1527
1528 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1529 compositeToPoint for OSX < 10.6 (Bug#12390).
1530
eabf0404
PE
15312012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1532
1533 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1534 This produces more-accurate results.
1535
0b3b1d23
JD
15362012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1537
1538 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1539 changes (Bug#12088).
1540
6dcef6ec
CY
15412012-09-08 Chong Yidong <cyd@gnu.org>
1542
1543 * syntax.c (Fstring_to_syntax): Doc fix.
1544
aa7d57c5
JD
15452012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1546
1547 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1548 in the internal border.
1549 (x_set_window_size): Remove static variables and their usage.
1550 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
1551 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1552 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
1553 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1554 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1555 (ns_fix_rect_ibw): Remove.
1556 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1557 (ns_dumpglyphs_box_or_relief): Ditto.
1558 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1559 adjustment.
1560 (ns_dumpglyphs_image): Ditto.
fc0c31f8 1561 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
1562 border adjustment.
1563 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1564 their usage. Add fringe_extended_p and its use as in other terms.
1565 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1566 scroll bar was removed.
1567 (updateFrameSize): New function.
1568 (windowDidResize): Move code to updateFrameSize and call it.
1569
1570 * nsterm.h (EmacsView): Add updateFrameSize.
1571
1a5432bc
CY
15722012-09-07 Chong Yidong <cyd@gnu.org>
1573
b4f5313e
CY
1574 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1575
1a5432bc
CY
1576 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1577
1a4f1e9b
PE
15782012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1579
1580 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
1581 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1582 Problem introduced when merging patches. Noted by Eli Zaretskii in
1583 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
1584 * floatfns.c: Comment fix.
1585 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1586 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1587 and anyway the declaration is harmless even if SIGDANGER is not defined.
1588 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1589 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1590 source files not surprisingly expected syssignal.h to define, or
1591 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1592 Include <sys/ioctl.h>, for FIONREAD.
1593 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1594 This eliminates a problem whereby other files mysteriously had
1595 to include "syssignal.h" before including "systty.h" if they
1596 wanted to use "#ifdef SIGIO".
1597
bc8000ff
EZ
15982012-09-07 Eli Zaretskii <eliz@gnu.org>
1599
3e6d6928
EZ
1600 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1601
1602 * w32.c (sigemptyset): Empty the set.
1603 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1604
bc8000ff
EZ
1605 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1606
b4fa72f2
DA
16072012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1608
1609 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1610 (mark_object): Likewise for frame objects.
1611
30730c93
PE
16122012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1613
1614 * syssignal.h (handle_on_main_thread): Always declare,
1615 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1616 This ports to platforms without HAVE_PTHREAD.
1617
2fe28299
PE
16182012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1619
1620 Signal-handler cleanup (Bug#12327).
1621 Emacs's signal handlers were written in the old 4.2BSD style with
1622 sigblock and sigmask and so forth, and this led to some
1623 inefficiencies and confusion. Rewrite these to use
1624 pthread_sigmask etc. without copying signal sets around. Also,
1625 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1626 'signal', and instead use functions that do not attempt to take
1627 over the system name space. This patch causes Emacs's text
1628 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1629 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1630 Do not include <signal.h> or "syssignal.h", as these
1631 modules do not use signals.
1632 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1633 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1634 Do not include <signal.h>, as "syssignal.h" does that for us now.
1635 * atimer.c (sigmask_atimers): New function.
1636 (block_atimers, unblock_atimers): New functions,
1637 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1638 All uses replaced.
1639 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1640 no longer needed here.
1641 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 1642 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
1643 * sysdep.c (struct save_signal): New member 'action', replacing
1644 old member 'handler'.
1645 (save_signal_handlers, restore_signal_handlers):
1646 Use sigaction instead of 'signal' to save and restore.
1647 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1648 New function. All users of 'signal' modified to use set_sighandler
1649 if they're writeonly, and to use sys_signal if they're read+write.
1650 (emacs_sigaction_init, forwarded_signal): New functions.
1651 (sys_signal): Remove. All uses replaced by calls to sigaction
1652 and emacs_sigaction_init, or by direct calls to 'signal'.
1653 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1654 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1655 all uses replaced by pthread_sigmask etc. calls.
1656 * syssignal.h: Include <signal.h>.
1657 (emacs_sigaction_init, forwarded_signal): New decls.
1658 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1659 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1660 (sigmask, sys_sigmask): Remove; no longer needed.
1661 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1662 (sigblock, sigunblock, sigfree):
1663 (sigsetmask) [!defined sigsetmask]:
1664 Remove. All uses replaced by pthread_sigmask.
1665 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1666 no longer need to be replaced, and its typical old uses
1667 are now done via emacs_sigaction_init and sigaction.
1668 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1669 (sys_sigdel): Remove; unused.
1670 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1671
0216c128
EZ
16722012-09-06 Eli Zaretskii <eliz@gnu.org>
1673
1674 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1675 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1676
c752cfa9
DA
16772012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1678
1679 Explicitly mark buffer_defaults and buffer_local_symbols.
1680 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1681 mark_local_symbols here.
1682 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1683 since special buffers aren't marked here any more.
1684 (allocate_buffer): Chain new buffer with all_buffers here...
1685 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1686 not here.
1687 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1688 (syms_of_buffer): Remove staticpro of the above.
1689 (init_buffer_once): Set names for buffer_defaults and
1690 buffer_local_symbols.
1691
a864ef14
PE
16922012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1693
1694 Use bool for booleans in font-related modules.
1695 * font.c (font_intern_prop, font_style_to_value)
1696 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1697 (generate_otf_features, font_check_otf_features, font_check_otf)
1698 (font_match_p, font_list_entities, font_at):
1699 * fontset.c (fontset_id_valid_p, reorder_font_vector
1700 (fontset_find_font, Fset_fontset_font)
1701 (face_suitable_for_char_p) [0]:
1702 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1703 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1704 (m17n_flt_initialized, ftfont_shape_by_flt):
1705 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1706 * nsfont.m (nsfont_draw):
1707 * w32font.c (w32font_draw):
1708 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1709 Use bool for booleans.
1710 * font.h: Adjust to above API changes.
1711 (struct font, struct font_driver, struct font_driver_list):
1712 Use bool for booleans.
1713 (struct font): Remove useless member encoding_type.
1714 All users removed.
1715 * fontset.c, xftfont.c: Omit unnecessary static decls.
1716
0699fc18
DA
17172012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1718
1719 * alloc.c (mark_object): Revert window marking code
1720 since it's unsafe for the Fset_window_configuration.
1721
20ef56db
PE
17222012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1723
2fe28299 1724 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
1725 Be more systematic about preserving errno whenever a signal
1726 handler returns, even if it's not in the main thread. Do this by
1727 renaming signal handlers to distinguish between signal delivery
1728 and signal handling. All uses changed.
1729 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1730 * data.c (deliver_arith_signal): Rename from arith_error.
1731 * dispnew.c (deliver_window_change_signal): Rename from
1732 window_change_signal.
1733 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1734 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1735 * keyboard.c (deliver_input_available_signal): Rename from
1736 input_available_signal.
1737 (deliver_user_signal): Rename from handle_user_signal.
1738 (deliver_interrupt_signal): Rename from interrupt_signal.
1739 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1740 (deliver_child_signal): Rename from sigchld_handler.
1741 * atimer.c (handle_alarm_signal):
1742 * data.c (handle_arith_signal):
1743 * dispnew.c (handle_window_change_signal):
1744 * emacs.c (handle_fatal_signal, handle_danger_signal):
1745 * keyboard.c (handle_input_available_signal):
1746 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1747 * process.c (handle_pipe_signal, handle_child_signal):
1748 New functions, with the actual signal-handling code taken from the
1749 original respective signal handlers, sans the sporadic attempts to
1750 preserve errno, since that's now done by handle_on_main_thread.
1751 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1752 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1753 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1754 Move to sysdep.c.
1755 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1756 Move initialization of main_thread to sysdep.c's init_signals.
1757 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1758 our usage, and simplifies the mainline code.
1759 (record_child_status_change): New static function, as a helper
1760 for handle_child_signal, and with most of the old child handler's
1761 contents.
1762 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1763 (handle_child_signal): Use the above.
1764 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1765 Moved here from emacs.c.
1766 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1767 code moved here from emacs.c's main function.
1768 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
1769 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
1770 This lets callers save and restore errno properly.
20ef56db 1771
e3ccf108
DA
17722012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1773
1774 Remove redundant or unused things here and there.
1775 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1776 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1777 * editfns.c (Fcompare_buffer_substrings): Likewise.
1778 * frame.h (struct terminal, struct font_driver_list):
1779 Remove redundant declarations.
1780 * window.h (Qleft, Qright): Likewise.
1781
697e1e39
DA
17822012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1783
1784 Do not mark objects from deleted buffers, windows and frames.
1785 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1786 (mark_object): Likewise for windows and frames.
1787
c1ca42ca
DA
17882012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1789
1790 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1791 buffer_defaults and buffer_local_symbols as valid objects.
1792 Return special value to denote them.
1793
014d93be
PE
17942012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1795
f75d7a91
PE
1796 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1797 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1798 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1799 (file_name_absolute_p, Fsubstitute_in_file_name):
1800 (check_executable, check_writable, Ffile_accessible_directory_p)
1801 (Fset_file_selinux_context, Fdefault_file_modes)
1802 (Finsert_file_contents, choose_write_coding_system)
1803 (Fwrite_region, build_annotations, a_write, e_write)
1804 (Fdo_auto_save):
1805 * filelock.c (boot_time_initialized, get_boot_time)
1806 (get_boot_time_1, lock_file_1, within_one_second):
1807 * floatfns.c (in_float):
1808 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1809 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1810 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1811 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1812 * window.c (compare_window_configurations):
1813 Use bool for booleans.
1814 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1815 (Fdefault_file_modes): Now mode_t, not int, for modes.
1816 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1817 (internal_delete_file): Now returns void, not a (boolean) int,
1818 since nobody was looking at the return value.
1819 * lisp.h, window.h: Adjust to above API changes.
1820
014d93be
PE
1821 * xdisp.c (set_message): Simplify and reindent last change.
1822
776f29e1
JB
18232012-09-05 Juanma Barranquero <lekktu@gmail.com>
1824
1825 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1826
7f7e0167
LI
18272012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1828
1829 * eval.c (call_debugger): Make the function non-static so that we
1830 can call it from set_message.
1831
1832 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1833 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1834
cf29dd84
PE
18352012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1836
1837 Give more-useful info on a fatal error (Bug#12328).
1838 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1839 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1840 of doing the work ourselves.
1841 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1842 do most of the work.
1843 (fatal_error_backtrace): New function, taken from the guts
1844 of the old fatal_error_signal, but with a new option to output
1845 a backtrace.
1846 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1847 info about the signal than just its number.
1848 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1849 * sysdep.c: Include <execinfo.h>
1850 (emacs_backtrace): New function, taken partly from the previous
1851 code of the 'die' function.
1852 (emacs_abort): Call fatal_error_backtrace rather than abort.
1853
972debf2
SM
18542012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1855
1856 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1857 eager (load-time) macro-expansion.
1858 * lisp.mk (lisp): Add macroexp.
1859
1088b922
PE
18602012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1861
1862 Simplify redefinition of 'abort' (Bug#12316).
1863 Do not try to redefine the 'abort' function. Instead, redo
1864 the code so that it calls 'emacs_abort' rather than 'abort'.
1865 This removes the need for the NO_ABORT configure-time macro
1866 and makes it easier to change the abort code to do a backtrace.
1867 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1868 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1869 Remove; sysdep.c's emacs_abort now takes its place.
1870 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1871 'abort' changed to use 'emacs_abort'.
1872 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1873 (abort) [!defined abort]: Rename to ...
1874 (emacs_abort): ... new name.
1875 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1876 the place of the old 'abort' in emacs.c.
1877 * w32.c, w32fns.c (abort): Do not #undef.
1878 * w32.c (emacs_abort): Rename from w32_abort.
1879
30934d33
EZ
18802012-09-04 Eli Zaretskii <eliz@gnu.org>
1881
1882 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1883 offsets[j].dv, since the y axis of the screen coordinates points
1884 down, while the y axis of the font definition coordinates points
1885 up. This fixes display of Arabic diacritics such as KASRA and
1886 KASRATAN. (Bug#11860)
1887
af26b72c
PE
18882012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1889
1890 Be more systematic about _setjmp vs setjmp.
1891 * alloc.c (test_setjmp, mark_stack):
1892 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1893 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1894 (png_load, my_error_exit, jpeg_load):
1895 * process.c (send_process_trap, send_process):
1896 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1897 The underscored versions are up to 30x faster on some hosts.
1898 Formerly, the code used setjmp+longjmp sometimes and
1899 _setjmp+_longjmp at other times, with no particular reason to
1900 prefer setjmp+longjmp.
1901
26d4541d
PE
19022012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1903
d42f4f0f 1904 Fix minor problem found by static checking.
26d4541d 1905 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 1906
c5e28e39
MR
19072012-09-03 Martin Rudalics <rudalics@gmx.at>
1908
1909 * buffer.c (Fdelete_all_overlays): New function.
1910
3eab3ca9
CY
19112012-09-03 Chong Yidong <cyd@gnu.org>
1912
1913 * gtkutil.c: Add extern decl for Qxft.
1914
c04889f8
PE
19152012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1916
1882aa38
PE
1917 * emacs.c, eval.c: Use bool for boolean.
1918 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1919 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1920 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1921 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1922 (main, decode_env_path, Fdaemon_initialized):
1923 * eval.c (call_debugger, Finteractive_p, interactive_p):
1924 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1925 (maybe_call_debugger, Fbacktrace):
1926 * process.c (read_process_output, exec_sentinel):
1927 Use bool for booleans.
1928 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1929 All callers changed.
1930 * eval.c (interactive_p): Omit always-true boolean argument
1931 EXCLUDE_SUBRS_P. All callers changed.
1932 * dispextern.h, lisp.h: Reflect above API changes.
1933 * firstfile.c (dummy): Use the address of 'main', whose signature
1934 won't change, instead of the address of 'initialize', whose
1935 signature just changed from int to bool.
1936 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1937 * msdos.c (fatal_error_in_progress): ... from here.
1938 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1939 of incrementing it.
1940 (redisplay_internal, unwind_redisplay): Simply clear
1941 REDISPLAYING_P when unwinding, instead of saving its previous,
1942 always-false value and then restoring it.
1943
a411ac43
PE
1944 Clean up some extern decls.
1945 Mostly, this hoists extern decls out of .c files and into .h files.
1946 That way, we're more likely to catch errors if the interfaces change.
1947 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1948 declare xg_mark_data.
1949 * dispextern.h (x_frame_parm_handlers):
1950 * font.h (Qxft):
1951 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1952 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1953 (Qultra_bold, Qoblique, Qitalic):
1954 Move extern decl here from .c file.
1955 * alloc.c (xg_mark_data) [USE_GTK]:
1956 * doc.c (Qclosure):
1957 * eval.c (Qlexical_binding):
1958 * fns.c (time) [!HAVE_UNISTD_H]:
1959 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1960 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1961 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1962 * lread.c (Qinternal_interpreter_environment):
1963 * minibuf.c (Qbuffer):
1964 * process.c (QCfamily, QCfilter):
1965 * widget.c (free_frame_faces):
1966 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1967 * xfont.c (x_clear_errors):
1968 * xterm.c (x_frame_parm_handlers):
1969 Remove now-redundant extern decls.
1970 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1971 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1972 Now static.
1973 * xfaces.c: Remove unnecessary static decls.
1974 * xterm.c (updating_frame): Remove decl of nonexistent object.
1975
c04889f8
PE
1976 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1977 when building globals.h, as the objects that are not built on
1978 this host are not needed to compile C files on this host.
1979
8b339673
JD
19802012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1981
1982 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1983
1984 * frame.h: Add missing prototype for x_wm_set_size_hint.
1985
a08d4ba7
PE
19862012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1987
1988 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1989 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1990 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1991 (Fsubstitute_command_keys):
1992 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1993 (save_excursion_save, save_excursion_restore)
1994 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1995 (format_time_string, general_insert_function)
1996 (make_buffer_string, make_buffer_string_both)
1997 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1998 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1999 (copy_text, insert_1, insert_1_both, insert_from_string)
2000 (insert_from_string_before_markers, insert_from_string_1)
2001 (insert_from_buffer, insert_from_buffer_1, replace_range)
2002 (replace_range_2, del_range_1, del_range_byte, del_range_both)
2003 (del_range_2, modify_region):
2004 * intervals.c (intervals_equal, balance_possible_root_interval)
2005 (adjust_intervals_for_insertion, merge_properties_sticky)
2006 (graft_intervals_into_buffer, lookup_char_property)
2007 (adjust_for_invis_intang, set_point_both)
2008 (get_property_and_range, compare_string_intervals)
2009 (set_intervals_multibyte_1, set_intervals_multibyte):
2010 * keyboard.c (decode_timer):
2011 Use bool for boolean.
2012 * intervals.h, lisp.h, systime.h: Reflect above API changes.
2013 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
2014
48c948de
CY
20152012-09-02 Chong Yidong <cyd@gnu.org>
2016
2017 * keymap.c (push_key_description): Print M-TAB as C-M-i
2018 (Bug#11758).
2019
6c49a40b
JB
20202012-09-02 Juanma Barranquero <lekktu@gmail.com>
2021
2022 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
2023 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
2024 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
2025 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
2026 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
2027 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
2028 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2029
4dfbd238
EZ
20302012-09-01 Eli Zaretskii <eliz@gnu.org>
2031
7e510e28
EZ
2032 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
2033 more than one grapheme cluster passed to the shaper: compute the
2034 offset adjustment values separately for each cluster. (Bug#11860)
2035
4dfbd238
EZ
2036 * image.c: Restore mistakenly removed inclusion of w32.h. Without
2037 it, GCC doesn't see prototypes of w32_delayed_load, and complains
2038 about implicit conversions from integer to pointer.
2039
86571ae0
DC
20402012-09-01 Daniel Colascione <dancol@dancol.org>
2041
2042 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2043 system used too early.
2044
0e23ef9d
PE
20452012-09-01 Paul Eggert <eggert@cs.ucla.edu>
2046
2047 Better seed support for (random).
2048 * emacs.c (main): Call init_random.
2049 * fns.c (Frandom): Set the seed from a string argument, if given.
2050 Remove long-obsolete Gentzel cruft.
2051 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
2052 (init_random): New function.
2053
17a2cbbd
DC
20542012-09-01 Daniel Colascione <dancol@dancol.org>
2055
2056 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
2057 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
2058 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
2059 x_wm_set_size_hint, x_query_colors, x_real_positions,
2060 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
2061 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
2062 all of which have been moved to common code.
2063
2064 * xfaces.c: Include TERM_HEADER instead of listing all possible
2065 window-system headers.
2066
2067 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2068 to match header.
2069
2070 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2071 directly accessing frame internals.
2072
f18cbb28 2073 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
2074 globals_of_w32font.
2075
2076 * process.c: Include TERM_HEADER instead of listing all possible
2077 window-system headers.
2078
3a880af4
SM
2079 * nsterm.h: Remove declarations now in frame.h.
2080 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
2081
2082 * menu.c: Include TERM_HEADER instead of listing all possible
2083 window-system headers.
2084
2085 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2086 window system.
2087
2088 * keyboard.c: Include TERM_HEADER instead of listing all possible
2089 window-system headers.
2090
2091 * image.c: Include TERM_HEADER instead of listing all possible
2092 window-system headers. Declare Vlibrary_cache when compiling for
2093 Windows.
2094
2095 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2096 window system declarations.
2097
2098 * frame.h: Move common functions here: set_frame_menubar,
2099 x_set_window_size, x_sync, x_get_focus_frame,
2100 x_set_mouse_position, x_set_mouse_pixel_position,
2101 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
2102 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
2103 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
2104 x_activate_menubar, x_real_positions, x_bitmap_icon,
2105 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
2106 and x_query_colors.
2107
2108 * frame.c: Include TERM_HEADER instead of listing all possible
2109 window-system headers.
2110
2111 * font.c: Include TERM_HEADER instead of listing all possible
2112 window-system headers.
2113
2114 * emacs.c: Include TERM_HEADER.
2115
f18cbb28
EZ
2116 * dispnew.c: Include TERM_HEADER instead of listing all possible
2117 window-system headers.
17a2cbbd 2118
f18cbb28 2119 * ccl.h: Include character.h.
17a2cbbd
DC
2120
2121 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2122 the current window system; include in list of objects to link into
2123 Emacs.
2124
c650a5de
DA
21252012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2126
2127 Remove mark_ttys function and fix tty_display_info initialization.
2128 * lisp.h (mark_ttys): Remove prototype.
2129 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2130 to mark_ttys because all possible values of 'top_frame' slot are
2131 the frames which are reachable from Vframe_list.
2132 * term.c (mark_ttys): Remove.
2133 (init_tty): Safely initialize 'top_frame' slot with Qnil.
2134
4e0f6479
DA
21352012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2136
2137 Change struct frame bitfields from unsigned char to unsigned.
2138 * frame.h (struct frame): Change type of 'display_preempted',
2139 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2140 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2141 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2142 bitfields from unsigned char to unsigned.
2143
8b96a52c
DA
21442012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2145
2146 Remove unused member of struct x_output and struct w32_output.
2147 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2148 * w32term.h (struct w32_output): Likewise.
2149
b4444c8a
JD
21502012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2151
2152 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2153 does not become zero (Bug#12234).
2154
b98521db
PE
21552012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2156
2157 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2158 for GCC 4.7.1 x86-64.
2159
31d02438
GM
21602012-08-30 Glenn Morris <rgm@gnu.org>
2161
2162 * lread.c (init_lread): For out-of-tree builds, only add the
2163 source directory's site-lisp dir to the load-path if it exists,
2164 consistent with in-tree builds. (Bug#12302)
2165
7f8941d8
JD
21662012-08-28 Jan Djärv <jan.h.d@swipnet.se>
2167
2168 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 2169 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
2170 (windowShouldClose:): Set window_closed.
2171 (dealloc): New member, free button_values.
fc0c31f8
JB
2172 (process_dialog:): Make member function. Remove window argument,
2173 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
2174 in button_values.
2175 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 2176 with tag. Remove return self, declare return value as void.
7f8941d8
JD
2177 (addString:row:): Remove return self, declare return value as void.
2178 (addSplit): Remove return self, declare return value as void.
2179 (clicked:): Remove return self, declare return value as void.
fc0c31f8 2180 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
2181 (initFromContents:isQuestion:): Adjust call to process_dialog.
2182 Code formatting change.
2183 (timeout_handler:): Set timer_fired to YES.
2184 (runDialogAt:): Set timer_fired to NO.
2185 Handle click on close button as quit.
2186
2187 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
2188 Add window_closed and button_values. Add void as return value for
2189 add(Button|String|Split). addButton takes int instead of Lisp_Object.
2190 Add process_dialog as new member.
2191
eada0861 21922012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 2193
eada0861
GM
2194 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
2195 is not one of the heaps we manage. (Bug#12242)
2196
21972012-08-28 Glenn Morris <rgm@gnu.org>
2198
2199 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
2200
457294dd
MR
22012012-08-28 Martin Rudalics <rudalics@gmx.at>
2202
2203 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
2204 auto-buffer-name window parameter. Install revision of reverted
2205 fix.
457294dd 2206
4f2daf31
DA
22072012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2208
2209 Do not allow to set major mode for a dead buffer.
2210 * buffer.c (Fset_buffer_major_mode): Signal an error
2211 if the buffer is dead.
2212 (Fother_buffer, other_buffer_safely): Remove redundant
2213 nested declaration.
2214
66322887
DA
22152012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2216
2217 Always use set_buffer_if_live to restore original buffer at unwind.
2218 * buffer.h (record_unwind_current_buffer): New function.
2219 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
2220 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
2221 * undo.c, window.c: Adjust users.
2222 * buffer.c (set_buffer_if_live): Fix comment.
2223
a3d794a1
DA
22242012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2225
2226 Fix usage of set_buffer_internal.
2227 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
2228 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
2229 * coding.c (decode_coding): Omit redundant test.
2230 * fileio.c (decide_coding_unwind): Likewise.
2231 * fns.c (secure_hash): Likewise.
2232 * insdel.c (modify_region): Likewise.
2233 * keyboard.c (command_loop_1): Likewise.
2234 * print.c (PRINTFINISH): Likewise.
2235 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
2236
59ea14cd
PE
22372012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2238
2239 * dispnew.c: Use bool for boolean.
2240 (frame_garbaged, display_completed, delayed_size_change)
2241 (fonts_changed_p, add_window_display_history)
2242 (add_frame_display_history, verify_row_hash)
2243 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
2244 (row_equal_p, realloc_glyph_pool)
2245 (allocate_matrices_for_frame_redisplay)
2246 (showing_window_margins_p)
2247 (adjust_frame_glyphs_for_frame_redisplay)
2248 (build_frame_matrix_from_leaf_window, make_current)
2249 (mirrored_line_dance, mirror_line_dance, update_frame)
2250 (update_window_tree, update_single_window)
2251 (check_current_matrix_flags, update_window, update_text_area)
2252 (update_window_line, set_window_update_flags, scrolling_window)
2253 (update_frame_1, scrolling, buffer_posn_from_coords)
2254 (do_pending_window_change, change_frame_size)
2255 (change_frame_size_1, sit_for):
2256 Use bool for boolean.
2257 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2258 and remove last int (actually boolean) argument, which was always 0.
2259 All callers changed.
2260 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2261 * dispextern.h (struct composition_it): Use bool for boolean.
2262 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2263 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2264 * dired.c (file_name_completion):
2265 Use bool for boolean. (This was missed in an earlier change.)
2266
95072a94
MR
22672012-08-27 Martin Rudalics <rudalics@gmx.at>
2268
2269 * window.c (Fset_window_configuration): Revert first part of
2270 last change.
2271
0f19feff
JD
22722012-08-27 Jan Djärv <jan.h.d@swipnet.se>
2273
2274 * nsterm.h (NSPanel): New class variable dialog_return.
2275
3a880af4
SM
2276 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2277 Initialize dialog_return.
0f19feff
JD
2278 (windowShouldClose:): Use stop instead of stopModalWithCode.
2279 (clicked:): Ditto, and also set dialog_return (Bug#12258).
2280 (timeout_handler:): Use stop instead of abortModal. Send a dummy
2281 event.
2282 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
2283 modal loop returns.
2284
f10fe38f
PE
22852012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2286
de1339b0
PE
2287 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2288 * composite.c (find_composition, composition_gstring_p)
2289 (composition_reseat_it, find_automatic_composition):
2290 * data.c (let_shadows_buffer_binding_p)
2291 (let_shadows_global_binding_p, set_internal, make_blv)
2292 (Fmake_variable_buffer_local, Fmake_local_variable)
2293 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2294 (cons_to_signed, arith_driver):
2295 * dbusbind.c (xd_in_read_queued_messages):
2296 * dired.c (directory_files_internal, file_name_completion):
2297 Use bool for booleans.
2298 * dired.c (file_name_completion):
2299 * process.h (fd_callback):
2300 Omit int (actually boolean) argument. It wasn't being used.
2301 All uses changed.
2302 * composite.h, lisp.h: Reflect above API changes.
2303
f10fe38f
PE
2304 * cmds.c, coding.c: Use bool for booleans.
2305 * cmds.c (move_point, Fself_insert_command):
2306 * coding.h (struct composition status, struct coding_system):
2307 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2308 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2309 (emacs_mule_char, decode_coding_emacs_mule)
2310 (encode_coding_emacs_mule, detect_coding_iso_2022)
2311 (decode_coding_iso_2022, encode_invocation_designation)
2312 (encode_designation_at_bol, encode_coding_iso_2022)
2313 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2314 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2315 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2316 (encode_coding_raw_text, detect_coding_charset)
2317 (decode_coding_charset, encode_coding_charset, detect_eol)
2318 (detect_coding, get_translation_table, produce_chars)
2319 (consume_chars, reused_workbuf_in_use)
2320 (make_conversion_work_buffer, code_conversion_save)
2321 (decode_coding_object, encode_coding_object)
2322 (detect_coding_system, char_encodable_p)
2323 (Funencodable_char_position, code_convert_region)
2324 (code_convert_string, code_convert_string_norecord)
2325 (Fset_coding_system_priority):
2326 * fileio.c (Finsert_file_contents):
2327 Use bool for booleans.
2328 * coding.h, lisp.h: Reflect above API changes.
2329 * coding.c: Remove unnecessary static function decls.
2330 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2331 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2332 not a boolean 'int', since callers never look at the return value.
2333 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2334 * coding.h (decoding_buffer_size, encoding_buffer_size)
2335 (emacs_mule_string_char): Remove unused extern decls.
2336 (struct iso_2022_spec, struct coding_system):
2337 Use 'unsigned int : 1' for boolean fields, since there's more than one.
2338 (struct emacs_mule_spec): Remove unused field 'full_support'.
2339 All initializations removed.
2340 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2341
5474c384
DA
23422012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2343
f10fe38f 2344 Fix spare memory change (Bug#12286).
5474c384
DA
2345 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
2346 (valid_lisp_object_p): Likewise.
2347
c4b6914d
MR
23482012-08-27 Martin Rudalics <rudalics@gmx.at>
2349
2350 * window.c (Fset_window_configuration): Record any window's old
2351 buffer if it's replaced (see Bug#8789). If the new current
2352 buffer doesn't appear in the selected window, go to its old
2353 point (Bug#12208).
2354
35aaa1ea
DA
23552012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2356
2357 Special MEM_TYPE_SPARE to denote reserved memory.
2358 * alloc.c (enum mem_type): New memory type.
2359 (refill_memory_reserve): Use new type for spare memory.
2360 This prevents live_cons_p and live_string_p from incorrect
2361 detection of uninitialized objects from spare memory as live.
2362
6af64513
PE
23632012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2364
8b2e00a3
PE
2365 Spelling fixes.
2366 * Makefile.in (.PHONY): versioclean -> versionclean.
2367
b52d6985
PE
2368 Remove unused external symbols.
2369 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2370 * window.c (Qwindow_valid_p, decode_valid_window):
2371 Now static, not extern.
2372 * data.c (Qinterval): Remove; unused.
2373 (syms_of_data): Do not define 'interval'.
2374 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2375 * window.h (decode_valid_window):
2376 Remove decls.
2377
d5172d4f
PE
2378 * character.c, charset.c, chartab.c: Use bool for booleans.
2379 * character.c (lisp_string_width, string_count_byte8)
2380 (string_escape_byte8):
2381 * charset.c (charset_map_loaded, load_charset_map, read_hex):
2382 (load_charset_map_from_file, map_charset_chars)
2383 (Fdefine_charset_internal, define_charset_internal)
2384 (Fdeclare_equiv_charset, find_charsets_in_text)
2385 (Ffind_charset_region, char_charset, Fiso_charset):
2386 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2387 (sub_char_table_set, sub_char_table_set_range)
2388 (char_table_set_range, optimize_sub_char_table)
2389 (map_sub_char_table):
2390 Use bool for boolean.
2391 * character.c (str_to_unibyte): Omit last boolean argument; it was
2392 always 0. All callers changed.
2393 * character.h, charset.h: Adjust to match previous changes.
2394 * character.h (char_printable_p): Remove decl of nonexistent function.
2395 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2396 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2397 are all boolean, so make them single-bit bitfields.
2398
6af64513
PE
2399 * lisp.h (ASET): Remove attempt to detect side effects.
2400 It was meant to be temporary and it often doesn't work,
2401 because when IDX has side effects the behavior of IDX==IDX
2402 is undefined. See Stefan Monnier in
2403 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2404
e1f29348
BR
24052012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2406
2407 * lisp.h (functionp): New function (extracted from Ffunctionp).
2408 (FUNCTIONP): Use it.
2409 * eval.c (Ffunctionp): Use it.
2410
17c05d74
PE
24112012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2412
0f46bc75
PE
2413 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2414 as that's faster and simpler than static storage. Don't bother
2415 with the g_main_context_query overhead if g_main_context_pending
2416 says no events are pending.
2417 (gfds, gfds_size): Remove these static vars.
2418 (xgselect_initialize): Remove; no longer needed.
2419 All uses and decls removed.
2420
ee4c0f69
PE
2421 * emacs.c (fatal_error_signal_hook): Remove.
2422 All uses removed. This leftover from old code was always 0.
2423
17c05d74
PE
2424 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2425 * casefiddle.c (casify_object, casify_region):
2426 * casetab.c (set_case_table):
2427 * category.c, category.h (word_boundary_p):
2428 * category.h (CHAR_HAS_CATEGORY):
2429 Use bool for booleans, instead of int.
2430
391ceac5
EZ
24312012-08-25 Eli Zaretskii <eliz@gnu.org>
2432
2433 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2434
2f221583
PE
24352012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2436
f4a681b0
PE
2437 On assertion failure, print backtrace if available.
2438 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2439 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2440 * Makefile.in (LIB_EXECINFO): New macro.
2441 (LIBES): Use it.
2442
2f221583
PE
2443 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2444 * bytecode.c (exec_byte_code):
2445 * callint.c (check_mark, Fcall_interactively):
2446 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2447 (getenv_internal, sync_process_alive, call_process_exited):
2448 * lisp.h (USE_SAFE_ALLOCA):
2449 Use bool for booleans, instead of int.
2450 * lisp.h, process.h: Adjust prototypes to match above changes.
2451 * callint.c (Fcall_interactively): Don't assume the mark's
2452 offset fits in 'int'.
2453
37ef52bb
PE
24542012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2455
2456 * buffer.c, buffer.h: Use bool for boolean.
2457 * buffer.c (reset_buffer_local_variables)
2458 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2459 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2460 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2461 (overlay_touches_p, overlay_strings, Foverlay_put)
2462 (report_overlay_modification, call_overlay_mod_hooks):
2463 (mmap_enlarge, mmap_set_vars):
2464 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2465 Use bool for booleans, instead of int.
2466 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2467 since the 1-or-0 return value is always ignored anyway.
2468 (mmap_initialized_p):
2469 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2470 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2471
2cc21167
PE
24722012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2473
2474 * bidi.c: Use bool for boolean.
2475 This is a bit more readable, and makes the text segment of bidi.o
2476 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2477 Presumably it's faster too.
2478 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2479 Now bool.
2480 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2481 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2482 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2483 (bidi_explicit_dir_char, bidi_level_of_next_char)
2484 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2485 Use bool for booleans, instead of int.
2486 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2487 (bidi_unshelve_cache): Adjust decls to match code.
2488
7db4ddf4
MR
24892012-08-23 Martin Rudalics <rudalics@gmx.at>
2490
2491 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2492 argument.
2493
b1bb8011
PE
24942012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2495
2496 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2497 * atimer.h: Include <stdbool.h>.
2498
ff687885
DN
24992012-08-22 Dan Nicolaescu <dann@gnu.org>
2500
2501 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2502 compile time tests instead of run time tests on systems that do
2503 not use them.
2504 (FRAME_MAC_P): Remove leftover from deleted code.
2505 * frame.c (syms_of_frame): Remove leftover from deleted code.
2506
4ce7a138
JD
25072012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2508
2509 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2510
d733ec6d
PE
25112012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2512
2513 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2514 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 2515 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
2516 (fontset_add): Return void, for FONTSET_ADD.
2517
d0d2d26f
PE
25182012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2519
fce31d69
PE
2520 * alloc.c: Use bool for booleans.
2521 (gc_in_progress, abort_on_gc)
2522 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2523 (dont_register_blocks) [GC_MALLOC_CHECK]:
2524 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2525 (check_string_bytes, make_specified_string, memory_full)
2526 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2527 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2528 (mark_stack, valid_pointer_p, make_pure_string)
2529 (Fgarbage_collect, survives_gc_p, gc_sweep):
2530 Use bool for booleans, instead of int.
2531 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2532 Remove unused local.
2533 * alloc.c (PURE_POINTER_P):
2534 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2535 * editfns.c (Fformat):
2536 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2537 (Fdo_auto_save):
2538 * fns.c (sweep_weak_table):
2539 * lisp.h (suppress_checking, push_message, survives_gc_p)
2540 (make_pure_string, gc_in_progress, abort_on_gc):
2541 * lread.c (readchar, read1):
2542 * print.c (Fprin1_to_string):
2543 * xdisp.c (push_message):
2544 Use bool for booleans affected directly or indirectly by
2545 alloc.c's changes.
2546
d0d2d26f
PE
2547 Make recently-introduced setters macros.
2548 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2549 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2550 (set_fontset_default, set_fontset_fallback): Rename from their
2551 upper-case counterparts, and make them functions rather than macros.
2552 This is more consistent with the other recently-introduced setters.
2553 These don't need to be inline, since they're local.
2554
d18e2bb6
JD
25552012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2556
2557 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2558 the loop (Bug#12247).
2559
1b9d9d16
PE
25602012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2561
2562 * lisp.h (vcopy): Use memcpy rather than our own loop.
2563 This fixes a performance regression introduced by the recent
2564 addition of vcopy. This means 'vcopy' will need to be modified
2565 for a copying collector, but that's OK. Also, tighten the
2566 checking in the assertion.
2567
b2f09701
EZ
25682012-08-21 Eli Zaretskii <eliz@gnu.org>
2569
2570 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2571 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2572 non-base glyph for the width of the base character, according to
e1f29348
BR
2573 what x_draw_composite_glyph_string_foreground expects.
2574 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
2575 expectations, to produce correct width of the composed character.
2576 Reverse the sign of the DU offset produced by ScriptPlace.
2577
9b994fed
PE
25782012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2579
2580 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2581
086ca913
DA
25822012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2583
2584 Avoid direct writes to contents member of struct Lisp_Vector.
2585 * lisp.h (vcopy): New function to copy data into vector.
2586 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2587 * fns.c (Ffillarray): Use ASET.
2588 * keyboard.c (timer_check_2): Use AREF and ASET.
2589 (append_tool_bar_item, Frecent_keys): Use vcopy.
2590 * lread.c (read_vector): Use ASET.
2591 * msdos.c (Frecent_doskeys): Use vcopy.
2592 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2593 (Finternal_merge_in_global_face): Use ASET and vcopy.
2594 * xfont.c (xfont_list_pattern): Likewise.
2595
5481664a
MR
25962012-08-21 Martin Rudalics <rudalics@gmx.at>
2597
2598 * window.c (Fwindow_point): For the selected window always return
2599 the position of its buffer's point.
2600 (Fset_window_point): For the selected window always go in its
2601 buffer to the specified position.
2602
6d470bdd
DA
26032012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2604
2605 Setter macros for fontsets.
2606 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2607 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2608 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2609 Adjust users.
2610
24564fe1
GM
26112012-08-20 Glenn Morris <rgm@gnu.org>
2612
2613 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2614 Don't assume that `ln -f' works.
2615
0a05a035
EZ
26162012-08-20 Eli Zaretskii <eliz@gnu.org>
2617
2618 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2619 and later about non-assignments with no effect. See discussion at
2620 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2621 details.
2622
e46f2325
DA
26232012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2624
2625 Inline setter functions for Lisp_Objects slots of struct specbinding.
2626 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2627 Adjust users.
2628
734fbd86
MR
26292012-08-20 Martin Rudalics <rudalics@gmx.at>
2630
2631 * window.c (select_window): Always make selected window's buffer
2632 current.
2633
f1a95992
DA
26342012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2635
2636 Use AREF and ASET for docstrings of category tables.
2637 * category.h (CATEGORY_DOCSTRING): Use AREF.
2638 (SET_CATEGORY_DOCSTRING): Use ASET.
2639 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2640
e83064be
DA
26412012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2642
2643 Inline setter functions for hash table members.
2644 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2645 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2646 (set_hash_key_and_value, set_hash_index, set_hash_next)
2647 (set_hash_hash): New functions.
2648 * charset.c, fns.c: Adjust users.
2649
4ce60d2e
DA
26502012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2651
2652 Inline getter and setter functions for per-buffer values.
2653 * buffer.h (per_buffer_default, set_per_buffer_default)
2654 (per_buffer_value, set_per_buffer_value): New functions.
2655 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2656 * buffer.c, data.c: Adjust users.
2657
c06c9690
JB
26582012-08-20 Juanma Barranquero <lekktu@gmail.com>
2659
2660 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2661
32bd4250
PE
26622012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2663
bad03192 2664 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
2665 as gnulib does this if the system doesn't.
2666 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
2667 Remove declaration. MS-Windows declares it on stdlib.h which is
2668 included by conf_post.h.
b69a6d22
PE
2669 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2670 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2671 * vm-limit.c: Include <unistd.h>, for 'environ'.
2672
22d7feb2
PE
2673 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2674 (start_of_data): Remove decl; mem-limits.h provides it.
2675
32bd4250
PE
2676 * xdisp.c (handle_invisible_prop): Make it a bit faster
2677 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2678
450809af
CY
26792012-08-19 Chong Yidong <cyd@gnu.org>
2680
2681 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2682 ends (Bug#3874).
2683
9e677988
AS
26842012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2685
6b1319ce
AS
2686 * .gdbinit: Use call instead of set when calling a function in the
2687 inferior.
2688
9e677988
AS
2689 * data.c (set_internal): Don't use set_blv_found.
2690 (Fkill_local_variable): Likewise.
2691
d7191076
AA
26922012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2693
2694 * nsfont.m (ns_ascii_average_width): Ensure the string
2695 ascii_printable is initialized with a null-terminated character
2696 array. Otherwise, it can contain undesired extra characters.
2697
e757f1c6
PE
26982012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2699
2700 port new setting code to Sun C 5.8 2005/10/13
2701 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2702 Return void, not Lisp_Object. Otherwise, the compiler
2703 complains about (A?B:C) where B is void and C is Lisp_Object
2704 when compiling CHAR_TABLE_SET, due to the recent change to
2705 the API of sub_char_table_set_contents.
2706
a999ce26
CY
27072012-08-18 Chong Yidong <cyd@gnu.org>
2708
2709 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2710 for the string case (Bug#3874).
2711
3f22b86f
PE
27122012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2713
39eb03f1
PE
2714 * buffer.h (BSET): Remove (Bug#12215).
2715 Replace all uses with calls to new setter functions.
2716 (bset_bidi_paragraph_direction, bset_case_canon_table)
2717 (bset_case_eqv_table, bset_directory, bset_display_count)
2718 (bset_display_time, bset_downcase_table)
2719 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2720 (bset_last_selected_window, bset_local_var_alist)
2721 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2722 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2723 (bset_width_table):
2724 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2725 (bset_auto_fill_function, bset_auto_save_file_format)
2726 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2727 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2728 (bset_cache_long_line_scans, bset_case_fold_search)
2729 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2730 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2731 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2732 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2733 (bset_header_line_format, bset_indicate_buffer_boundaries)
2734 (bset_indicate_empty_lines, bset_invisibility_spec)
2735 (bset_left_fringe_width, bset_major_mode, bset_mark)
2736 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2737 (bset_name, bset_overwrite_mode, bset_pt_marker)
2738 (bset_right_fringe_width, bset_save_length)
2739 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2740 (bset_scroll_up_aggressively, bset_selective_display)
2741 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2742 (bset_word_wrap, bset_zv_marker):
2743 * category.c (bset_category_table):
2744 * syntax.c (bset_syntax_table):
2745 New setter functions.
2746
6a09a33b
PE
2747 * process.h (PSET): Remove (Bug#12215).
2748 Replace all uses with calls to new setter functions.
2749 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2750 (PROCESS_INLINE): New macro.
2751 (pset_childp): New setter function.
2752 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2753 * process.c (PROCESS_INLINE):
2754 Define to EXTERN_INLINE, so that the corresponding functions
2755 are compiled into code.
2756 (pset_buffer, pset_command, pset_decode_coding_system)
2757 (pset_decoding_buf, pset_encode_coding_system)
2758 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2759 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2760 (pset_type, pset_write_queue): New setter functions.
2761
e8c17b81
PE
2762 * window.h (WSET): Remove (Bug#12215).
2763 Replace all uses with calls to new setter functions.
2764 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2765 (WINDOW_INLINE): New macro.
2766 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2767 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2768 (wset_total_lines, wset_vertical_scroll_bar)
2769 (wset_window_end_pos, wset_window_end_valid)
2770 (wset_window_end_vpos): New setter functions.
2771 * window.c (WINDOW_INLINE):
2772 Define to EXTERN_INLINE, so that the corresponding functions
2773 are compiled into code.
2774 (wset_combination_limit, wset_dedicated, wset_display_table)
2775 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2776 (wset_new_normal, wset_new_total, wset_next_buffers)
2777 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2778 (wset_prev_buffers, wset_right_fringe_width)
2779 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2780 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2781 (wset_window_parameters):
2782 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2783 (wset_column_number_displayed, wset_region_showing):
2784 New setter functions.
2785
3f22b86f
PE
2786 * termhooks.h (TSET): Remove (Bug#12215).
2787 Replace all uses with calls to new setter functions.
2788 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2789 (TERMHOOKS_INLINE): New macro.
2790 (tset_charset_list, tset_selection_alist): New setter functions.
2791 * terminal.c (TERMHOOKS_INLINE):
2792 Define to EXTERN_INLINE, so that the corresponding functions
2793 are compiled into code.
2794 (tset_param_alist): New setter function.
2795
742af32f
PE
27962012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2797
15dbb4d6
PE
2798 * keyboard.h (KSET): Remove (Bug#12215).
2799 Replace all uses with calls to new setter functions.
2800 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2801 (KEYBOARD_INLINE): New macro.
2802 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2803 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2804 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2805 New setter functions.
2806 * keyboard.c (KEYBOARD_INLINE):
2807 Define to EXTERN_INLINE, so that the corresponding functions
2808 are compiled into code.
2809 (kset_echo_string, kset_kbd_queue)
2810 (kset_keyboard_translate_table, kset_last_prefix_arg)
2811 (kset_last_repeatable_command, kset_local_function_key_map)
2812 (kset_overriding_terminal_local_map, kset_real_last_command)
2813 (kset_system_key_syms): New setter functions.
2814
f00af5b1
PE
2815 * frame.h (FSET): Remove (Bug#12215).
2816 Replace all uses with calls to new setter functions.
2817 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2818 (FRAME_INLINE): New macro.
2819 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2820 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2821 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2822 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2823 (fset_param_alist, fset_root_window, fset_scroll_bars)
2824 (fset_selected_window, fset_title, fset_tool_bar_items)
2825 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2826 * frame.c (FRAME_INLINE):
2827 Define to EXTERN_INLINE, so that the corresponding functions
2828 are compiled into code.
2829 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2830
0c94c8d6
PE
2831 A few more naming-convention fixes for getters and setters.
2832 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2833 and rename from buffer_overlays_set_before.
2834 (set_buffer_overlays_after): Move here from buffer.h, and rename
2835 from buffer_overlays_set_after.
2836 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2837 All uses changed.
2838 (set_buffer_intervals): Rename from buffer_set_intervals.
2839 * intervals.c (set_interval_object): Move here from intervals.h,
2840 and rename from interval_set_object.
2841 (set_interval_left): Move here from intervals.h, and rename from
2842 interval_set_left.
2843 (set_interval_right): Move here from intervals.h, and rename from
2844 interval_set_right.
2845 (copy_interval_parent): Move here from intervals.h, and rename from
2846 interval_copy_parent.
2847 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2848 (set_interval_plist): Rename from interval_set_plist.
2849 Return void, not Lisp_Object, since no caller uses the result.
2850 * lisp.h (string_intervals): Rename from string_get_intervals.
2851 (set_string_intervals): Rename from string_set_intervals.
2852
34dabdb7
PE
2853 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2854 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 2855 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
2856 All uses changed. See the end of
2857 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2858
742af32f
PE
2859 * lisp.h (CSET): Remove (Bug#12215).
2860 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2861 (set_char_table_purpose): New functions,
2862 replacing CSET. All uses changed. For example, replace
2863 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 2864 "set_char_table_parent (char_table, parent);".
742af32f
PE
2865 The old version was confusing because it used the same name
2866 'parent' for two different things.
2867
a04e2c62
DA
28682012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2869
2870 Functions to get and set Lisp_Object fields of buffer-local variables.
2871 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2872 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2873 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2874 * data.c, eval.c, frame.c: Adjust users.
2875
383dcbf9
CY
28762012-08-17 Chong Yidong <cyd@gnu.org>
2877
2878 * xfaces.c (merge_face_vectors): If the target font specfies a
2879 font spec, make the font's attributes take precedence over
2880 directly-specified attributes.
2881 (merge_face_ref): Recognize :font.
2882
44386687
DA
28832012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2884
2885 Do not use memcpy for copying intervals.
2886 * intervals.c (reproduce_interval): New function.
2887 (reproduce_tree, reproduce_tree_obj): Use it.
2888 (reproduce_tree_obj): Remove prototype.
2889
927c7216
PE
28902012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2891
2892 * lisp.h (duration_to_sec_usec): Remove unused decl.
2893
93044f7b
AA
28942012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2895
2896 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2897 to an allocated instance of NSString, not to the class itself.
2898
9851e4a5
JB
28992012-08-17 Juanma Barranquero <lekktu@gmail.com>
2900
2901 * makefile.w32-in (C_CTYPE_H): New macro.
2902 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2903 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2904 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2905
620f13b0
PE
29062012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2907
2908 Use ASCII tests for character types.
2909 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2910 * xfns.c, xterm.c:
2911 Don't include <ctype.h>; was not needed.
2912 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2913 * sysdep.c, xfaces.c:
2914 Include <c-ctype.h> instead of <ctype.h>.
2915 * nsterm.m: Include <c-ctype.h>.
2916 * charset.c (read_hex):
2917 * doc.c (Fsnarf_documentation):
2918 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2919 (DRIVE_LETTER) [DOS_NT]:
2920 (Ffile_name_directory, Fexpand_file_name)
2921 (Fsubstitute_in_file_name):
2922 * font.c (font_parse_xlfd, font_parse_fcname):
2923 * frame.c (x_set_font_backend):
2924 * gtkutil.c (xg_get_font):
2925 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2926 * nsimage.m (hexchar):
2927 * nsterm.m (ns_xlfd_to_fontname):
2928 * sysdep.c (system_process_attributes):
2929 * xfaces.c (hash_string_case_insensitive):
2930 Use C-locale tests instead of locale-specific tests for character
2931 types, since we want the ASCII interpretation here, not the
2932 interpretation suitable for whatever happens to be the current locale.
2933
52162052
MR
29342012-08-16 Martin Rudalics <rudalics@gmx.at>
2935
2936 Consistently check windows for validity/liveness
2937 (Bug#11984, Bug#12025, Bug#12026).
2938 * lisp.h (CHECK_VALID_WINDOW): New macro.
2939 * window.c (decode_window): Rename to decode_live_window.
2940 (decode_valid_window, Fwindow_valid_p): New functions.
2941 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2942 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2943 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2944 (Fwindow_prev_sibling, Fwindow_combination_limit)
2945 (Fset_window_combination_limit, Fwindow_use_time)
2946 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2947 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2948 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2949 (Fwindow_hscroll, Fset_window_hscroll)
2950 (Fwindow_redisplay_end_trigger)
2951 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2952 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2953 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2954 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2955 (Fwindow_end, Fset_window_point, Fset_window_start)
2956 (Fpos_visible_in_window_p, Fwindow_line_height)
2957 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2958 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2959 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2960 (Fset_window_parameter, Fwindow_display_table)
2961 (Fset_window_display_table, Fdelete_other_windows_internal)
2962 (Fset_window_buffer, Fset_window_new_total)
2963 (Fset_window_new_normal, Fdelete_window_internal)
2964 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2965 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2966 (Fwindow_scroll_bars): Check whether argument window is a valid or
2967 live window. Update doc-strings.
2968 (syms_of_window): New symbol Qwindow_valid_p.
2969 * keyboard.c (Fposn_at_x_y): Check whether argument
2970 frame_or_window denotes a valid window.
2971
2751c80f
DA
29722012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2973
2974 Fix previous char table change.
2975 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2976 * chartab.c (optimize_sub_char_table): Likewise.
2977
032a42c8
CY
29782012-08-16 Chong Yidong <cyd@gnu.org>
2979
a2d19368
CY
2980 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2981
032a42c8
CY
2982 * xfont.c (xfont_open):
2983 * xftfont.c (xftfont_open): Set the font's max_width field.
2984
2985 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2986 min_width to space_width and average_width to the average over
2987 printable ASCII characters.
2988 (ns_char_width): Code cleanup.
2989 (ns_ascii_average_width): New utility function.
2990
2991 * font.h (struct font): Update comments.
2992
a098c930
DA
29932012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2994
032a42c8 2995 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
2996 * lisp.h (CSET): New macro.
2997 (char_table_set_extras, char_table_set_contents)
2998 (sub_char_table_set_contents): New function.
2999 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
3000 * syntax.c: Adjust users.
3001
8be3a09c
SM
30022012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
3003
3004 * eval.c (eval_sub): Bind lexical-binding.
3005 * lread.c (Qlexical_binding): Make non-static.
3006
ac4845a6
JD
30072012-08-15 Jan Djärv <jan.h.d@swipnet.se>
3008
ddee6515
JD
3009 * nsmenu.m (popupSession): Remove.
3010 (pop_down_menu): Remove endModalSession.
3011 (timeout_handler:): New method.
3012 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
3013 Call runModalForWindow. Check timer_fired when it returns.
3014 If not set, cancel timer and break out of loop.
3015 Otherwise loop again, with a new timeout.
3016
3017 * nsterm.m: Include fcntl.h if present.
3018 (fd_entry, t_readfds, inNsSelect): Remove.
3019 (select_writefds, select_valid, select_timeout, selfds)
3020 (select_mutex, apploopnr): Add.
3021 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
3022 Otherwise call kbd_buffer_store_event.
3023 (ns_send_appdefined): Remove release of fd_entry.
3024 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
3025 Increment and decrement apploopnr.
3026 (ns_select): If no file descriptors, just do a NSTimer.
3027 Otherwise copy read/write masks and start select thread (fd_handler).
3028 Start main loop and wait for application defined event.
3029 Inform select thread to stop selecting after main loop is exited.
3030 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 3031 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
3032 (fd_handler:): Loop forever, wait for info from the main thread
3033 to either start or stop selecting. When select returns, send
3034 and appdefined event.
3035 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
3036 If not call kbd_buffer_store_event.
3037
3038 * nsterm.h (EmacsApp): fd_handler takes id argument.
3039 (EmacsDialogPanel): Add timer_fired and timeout_handler.
3040
ac4845a6
JD
3041 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3042
eb424fe3
EZ
30432012-08-15 Eli Zaretskii <eliz@gnu.org>
3044
3045 * region-cache.c (move_cache_gap): Update gap_len using the actual
3046 growth of the boundaries array. Do not change cache_len.
3047 (Bug#12196)
3048
4e6a86c6
DA
30492012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3050
3051 Generalize and cleanup font subsystem checks.
3052 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
3053 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
3054 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 3055
5bf192ca
DA
30562012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3057
3058 * gtkutil.c (xg_get_font): Use pango_units_to_double.
3059
f2045622
CY
30602012-08-15 Chong Yidong <cyd@gnu.org>
3061
8be3a09c
SM
3062 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
3063 When using the new font chooser, use gtk_font_chooser_get_font_desc to
3064 extract the font descriptor instead of just the font name.
3065 In that case, return a font spec instead of a string.
f2045622
CY
3066 (x_last_font_name): Move to this file from xfns.c.
3067
3068 * xfns.c (Fx_select_font): The return value can also be a font
3069 spec. Move x_last_font_name management to gtkutil.c.
3070
3071 * xfaces.c: Make font weight and style symbols non-static.
3072
7f6feb56
SM
30732012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
3074
3075 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3076 (bug#12117).
3077
fecbd8ff
SM
30782012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
3079
3080 * alloc.c (Fgarbage_collect): Use plural form consistently.
3081
9b8d5165
EZ
30822012-08-14 Eli Zaretskii <eliz@gnu.org>
3083
3084 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3085 iteration through the command loop. Fixes a problem whereby mouse
3086 movements are ignored until the first mouse click.
3087
f5d9e83a
PE
30882012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3089
3090 Use bool, not int, for Lisp booleans.
3091 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3092 makes Emacs a bit smaller and presumably a bit faster.
3093 * lisp.h: Include <stdbool.h>.
3094 (struct Lisp_Boolfwd, defvar_bool):
3095 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3096 * regex.c [!emacs]: Include <stdbool.h>.
3097 (false, true): Remove; <stdbool.h> does this for us now.
3098
55802e4a
CY
30992012-08-14 Chong Yidong <cyd@gnu.org>
3100
4abcdac8
CY
3101 * character.c (Fcharacterp): Doc fix (Bug#12076).
3102
3103 * data.c (Findirect_variable): Doc fix (Bug#11040).
3104
55802e4a
CY
3105 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
3106
3107 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 3108 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 3109
8e99d072
BR
31102012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3111
3112 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3113 (bug#12022).
3114
08908aca
MR
31152012-08-14 Martin Rudalics <rudalics@gmx.at>
3116
3117 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3118 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3119 * minibuf.c (choose_minibuf_frame, read_minibuf):
3120 * w32fns.c (x_create_tip_frame):
3121 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3122 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3123
56120d6f
PE
31242012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3125
3126 * intervals.c (offset_intervals): Remove obsolete comment.
3127
67b77c0b
AS
31282012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3129
3130 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3131
f48b82fd
GR
31322012-08-14 Gergely Risko <gergely@risko.hu>
3133
3134 * coding.c (decode_coding): Record buffer modification before
3135 disabling undo_list (Bug#11773).
3136
fd318b54
DA
31372012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3138
3139 Revert and cleanup some recent overlay changes.
3140 * buffer.h (enum overlay_type): Remove.
3141 (buffer_get_overlays, buffer_set_overlays): Likewise.
3142 (buffer_set_overlays_before, buffer_set_overlays_after):
3143 New function. Adjust users.
3144 (unchain_both): Add eassert.
3145
41a62dd9
DA
31462012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3147
3148 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3149
5884c324
PE
31502012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3151
3152 * gtkutil.c (xg_mark_data): Don't assume C99.
3153
ca06f160
JD
31542012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3155
3156 * gtkutil.c (xg_frame_tb_info): New struct.
3157 (TB_INFO_KEY): New define.
3158 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3159 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3160 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3161 if not present.
3162 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 3163 is up to date. Otherwise store new data.
ca06f160
JD
3164 (free_frame_tool_bar): Free xg_frame_tb_info if present.
3165
7864a3f7
DA
31662012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3167
3168 Use KSET for write access to Lisp_Object members of struct kboard.
3169 * keyboard.h (KSET): New macro.
3170 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3171 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3172 * xterm.c: Adjust users.
3173
4c31be61
DA
31742012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3175
3176 Use BSET for write access to Lisp_Object members of struct buffer.
3177 * buffer.h (BSET): New macro.
3178 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3179 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3180 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3181 * window.c, xdisp.c, xfns.c: Adjust users.
3182
14ae4239
BT
31832012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
3184
3185 * lread.c (syms_of_lread): Initialize Vlexical_binding.
3186
32bcadb4
JD
31872012-08-11 Jan Djärv <jan.h.d@swipnet.se>
3188
3d29b2ce 3189 * nsterm.m (not_in_argv): New function.
fc0c31f8 3190 (application:openFile, application:openTempFile:):
3d29b2ce
JD
3191 (application:openFileWithoutUI:, application:openFiles:): Open file
3192 if not_in_argv returns non-zero (bug#12171).
3193
32bcadb4 3194 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
3195 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
3196 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
3197 (xg_get_font_name): Use those functions/macros here.
3198 Reported by Frans Oilinki <moilinki@gmail.com>.
3199
9ff9402d 32002012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
3201
3202 * unexmacosx.c (copy_data_segment): Copy initialized data in
3203 statically linked libraries from input file rather than memory.
3204
db74a5fc
YM
3205 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
3206 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
3207 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
3208
25e65510
GM
32092012-08-10 Glenn Morris <rgm@gnu.org>
3210
3211 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
3212 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
3213
7961135c
DA
32142012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3215
3216 Fix last change to allow compilation with low optimization levels.
3217 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
3218 Reported by Jan Djärv <jan.h.d@swipnet.se>.
3219
42b3a444
DA
32202012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3221
3222 Use common inline syntax in intervals.h.
3223 * intervals.h (INTERVALS_INLINE): New macro.
3224 Change all users from LISP_INLINE.
3225
9fb0c957
DA
32262012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3227
3228 Define Qnone once for all platforms.
3229 * frame.c (Qnone): Define here.
3230 (syms_of_frame): DEFSYM it.
3231 * lisp.h (Qnone): New declaration.
3232 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
3233 * xfns.c: Remove duplication. Adjust users.
3234
65e8ee52
DA
32352012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3236
3237 Remove unused macros from intervals.h.
3238 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
3239 * intervals.c: Adjust comment.
3240
9b855fd6
EZ
32412012-08-10 Eli Zaretskii <eliz@gnu.org>
3242
3243 * w32fns.c <w32_unicode_gui>: New static variable.
3244 (globals_of_w32fns): Initialize it according to os_subtype.
3245 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3246 testing os_subtype.
3247
39cb9e56 32482012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
3249 Eli Zaretskii <eliz@gnu.org>
3250
3251 Fix bug #10299 with Unicode characters sent by customized
3252 keyboards created by MSKLC.
3253 * w32fns.c (INIT_WINDOW_CLASS): New macro.
3254 (w32_init_class): Use it to initialize the Emacs class with either
3255 ANSI or Unicode API calls.
3256 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3257 later.
3258 (w32_wnd_proc): If the character code sent by WM_CHAR or
3259 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3260 original message. Call DefWindowProcW on NT and later.
3261
9374581a
GM
32622012-08-10 Glenn Morris <rgm@gnu.org>
3263
4b94e8cf
GM
3264 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3265
9374581a
GM
3266 * lisp.h (DIRECTORY_SEP): Let configure set it.
3267
a2752828
DA
32682012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
3269
3270 Use TSET for write access to Lisp_Object slots of struct terminal.
3271 * termhooks.h (TSET): New macro.
3272 * coding.c, terminal.c, xselect.c: Adjust users.
3273
cc92c454
SM
32742012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
3275
3276 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
3277 the failing expression, include them in the error message.
3278 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3279 * lisp.h (internal_condition_case_n): Update declaration.
3280
4cb3e6b3
DA
32812012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3282
3283 Inline functions to examine and change buffer overlays.
3284 * buffer.c (unchain_both): New function.
3285 * buffer.h (buffer_get_overlays, buffer_set_overlays):
3286 (buffer_has_overlays): New function.
3287 (enum overlay_type): New enum.
3288 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3289 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3290
8707c1e5
DA
32912012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3292
3293 Inline functions to examine and change buffer intervals.
3294 * alloc.c (mark_interval_tree): Remove.
3295 (MARK_INTERVAL_TREE): Simplify.
3296 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
3297 * intervals.c (buffer_balance_intervals): New function.
3298 (graft_intervals_into_buffer): Adjust indentation.
3299 (set_intervals_multibyte): Simplify.
3300 * buffer.h (BUF_INTERVALS): Remove.
3301 (buffer_get_intervals, buffer_set_intervals): New function.
3302 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3303 * intervals.c, textprop.c: Adjust users.
3304
ad8c997f
DA
33052012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3306
3307 Inline functions to examine and change string intervals.
3308 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3309 (string_get_intervals, string_set_intervals): New function.
3310 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3311 * lread.c, print.c, textprop.c: Adjust users.
3312
32ac3a6b
GM
33132012-08-08 Glenn Morris <rgm@gnu.org>
3314
3315 * lisp.mk (lisp): Remove language/persian.elc.
3316
77c7bcb1
DA
33172012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3318
3319 Cleanup intervals.
3320 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3321 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
3322 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3323 Adjust comment. Move under #if 0.
77c7bcb1
DA
3324 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3325 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3326
9c08a8d4
DA
33272012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3328
3329 Check total length of intervals with eassert.
3330 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3331 * intervals.c: Change all users to eassert.
3332
26d16b35
EZ
33332012-08-07 Eli Zaretskii <eliz@gnu.org>
3334
14ae4239
BT
3335 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
3336 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
3337 INTERNAL_FIELD in Lisp_Cons.
3338
c644523b
DA
33392012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3340
3341 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
3342 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
3343 name since all xname users are fixed long time ago. Do not
3344 use INTERNAL_FIELD.
3345 (set_symbol_name, set_symbol_function, set_symbol_plist):
3346 (set_symbol_next, set_overlay_plist): New function.
3347 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
3348 (struct Lisp_Overlay): Likewise.
3349 (CVAR, MVAR, SVAR): Remove.
3350 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
3351 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
3352 * xterm.c: Adjust users.
3353 * .gdbinit: Change to use name field of struct Lisp_Symbol
3354 where appropriate.
3355
6a3d20cc
DA
33562012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3357
3358 Basic functions to set Lisp_Object and pointer slots of intervals.
3359 * intervals.h (interval_set_parent, interval_set_object):
3360 (interval_set_left, interval_set_right, interval_set_plist):
3361 (interval_copy_parent): New function.
3362 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
3363 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
3364 Adjust indentation.
6a3d20cc
DA
3365 (INTERVAL_SIZE): Remove. Adjust users.
3366 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3367
4d2b044c
DA
33682012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3369
3370 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3371 * process.h (PGET): Remove.
3372 (struct Lisp_Process): Do not use INTERNAL_FIELD.
3373 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3374
d3d50620
DA
33752012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3376
3377 Drop WGET and revert read access to Lisp_Objects slots of struct window.
3378 * window.h (WGET): Remove.
3379 (struct window): Do not use INTERNAL_FIELD.
3380 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3381 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3382 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3383 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3384 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3385 Adjust users.
3386
d10a51dc
CY
33872012-08-07 Chong Yidong <cyd@gnu.org>
3388
3389 * window.c (Fwindow_edges, Fwindow_pixel_edges)
3390 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3391 (Fdelete_window_internal): Signal an error if the window is not on
3392 a live frame (Bug#12025).
3393
e69b0960
DA
33942012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3395
3396 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3397 * frame.h (FGET): Remove.
3398 (struct frame): Do not use INTERNAL_FIELD.
3399 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3400 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3401 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3402 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3403
25a20a3a
JB
34042012-08-06 Juanma Barranquero <lekktu@gmail.com>
3405
3406 * w32.c: Silence compiler warnings.
3407 (map_w32_filename): Remove unused variable `is_fat'.
3408 (chase_symlinks): Add parentheses around expression.
3409
1c6f11f4
GM
34102012-08-06 Glenn Morris <rgm@gnu.org>
3411
1db4583a
GM
3412 * sysdep.c: Respect BROKEN_GETWD.
3413
1c6f11f4
GM
3414 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3415 Let configure handle it.
3416 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3417
2b90362b
DA
34182012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3419
3420 Use GCALIGNMENT where appropriate.
3421 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3422 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3423 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3424
5f50daf2
EZ
34252012-08-06 Eli Zaretskii <eliz@gnu.org>
3426
14ae4239
BT
3427 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3428 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 3429
cbcc7007
SM
34302012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3431
3432 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3433 that should be sufficient for everyone.
3434
4d365fa4
JD
34352012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3436
3437 * keyboard.c (timer_check_2): Add break so timer_check returns next
3438 timeout.
3439
dd86bd82
DA
34402012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3441
3442 Fix Windows build errors introduced after converting to WGET and WSET.
3443 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3444 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3445
054e1668
JD
34462012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3447
3448 * nsterm.m (ns_frame_rehighlight): Use FSET.
3449
3450 * nsmenu.m (ns_update_menubar): Use FSET.
3451
21238f11
DA
34522012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3453
3454 Separate read and write access to Lisp_Object slots of Lisp_Process.
3455 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3456 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3457
077288cf
DA
34582012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3459
3460 Separate read and write access to Lisp_Object slots of struct window.
3461 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3462 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3463 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3464 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3465 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3466 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3467 Adjust users.
3468
71688bd7
DA
34692012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3470
3471 Fix Windows build errors introduced after converting to FGET and FSET.
3472 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3473 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3474 (w32_judge_scroll_bars): Change to use FSET.
3475 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3476
f99bac93
DA
34772012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3478
3479 Fix replacement typo.
3480 * window.c (replace_window): Set root_window instead of
3481 selected_window. This fixes a total window subsystem
3482 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3483
8c2a0f2d
GM
34842012-08-06 Glenn Morris <rgm@gnu.org>
3485
3486 * lisp.mk (lisp): Add language/persian.elc.
3487
edd74c35
DA
34882012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3489
3490 Separate read and write access to Lisp_Object slots of struct frame.
3491 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3492 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3493 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3494 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3495 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3496
8671676c
AS
34972012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3498
3499 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3500
663e2b3f
DA
35012012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3502
3503 Generalize common compile-time constants.
3504 * lisp.h (header_size, bool_header_size, word_size): Now here.
3505 (struct Lisp_Vector): Add comment.
3506 (struct Lisp_Bool_Vector): Move up to define handy constants.
3507 (VECSIZE, PSEUDOVECSIZE): Simplify.
3508 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3509 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3510 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3511 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3512 * xfont.c, xmenu.c: Use word_size where appropriate.
3513
d32e47af
LM
35142012-08-05 Lawrence Mitchell <wence@gmx.li>
3515
3516 * search.c (Freplace_match): Treat \? in the replacement text
3517 literally (Bug#8161).
3518
e5d9c0d1
CY
35192012-08-05 Chong Yidong <cyd@gnu.org>
3520
3521 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3522 * frame.c (Vdelete_frame_functions):
3523 * emacs.c (Vkill_emacs_hook): Doc fix.
3524
8da0576b
EZ
35252012-08-04 Eli Zaretskii <eliz@gnu.org>
3526
3527 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3528 --with-x-toolkit=no builds.
3529 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3530
02676e5d
CY
35312012-08-04 Chong Yidong <cyd@gnu.org>
3532
3533 * syntax.c (Fmodify_syntax_entry): Doc fix.
3534
97147da9
EZ
35352012-08-04 Eli Zaretskii <eliz@gnu.org>
3536
76151e2c
EZ
3537 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3538 * w32.c (init_environment): Change the default values of many
3539 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
3540 them into environment when they were not already defined.
3541 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 3542 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
3543 (check_windows_init_file): Now external, not static.
3544 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
3545 called when Vload_path is already set up.
3546
3547 * w32.h (check_windows_init_file): Add prototype.
3548
3549 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3550 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3551 compatibility with Posix platforms.
3552 (main): Move the call to check_windows_init_file to here from
3553 w32.c.
3554 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3555 any, in the DEFALT argument into the root of the Emacs build or
3556 installation tree, as appropriate.
3557
3558 * callproc.c (init_callproc_1): Call decode_env_path instead of
3559 doing its equivalent by hand.
3560 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3561 the code that sets Vexec_path run on MS-Windows.
3562
3563 * lread.c (init_lread): Add comments to #ifdef's.
3564
97147da9
EZ
3565 * msdos.c (dos_set_window_size, IT_update_begin)
3566 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3567 instead of direct references.
3568
185ee146
PE
35692012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3570
3571 Export DEFAULT_REHASH_* to GDB.
3572 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3573 Now constants, not macros.
3574
8834c57a
PE
35752012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3576
98c6f1e3
PE
3577 Remove unnecessary casts involving pointers.
3578 These casts are no longer needed now that we assume C89 or later,
3579 since they involve casting to or from void *.
3580 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3581 (make_pure_float, make_pure_vector):
3582 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3583 * macros.c (Fstart_kbd_macro):
3584 * menu.c (find_and_return_menu_selection):
3585 * minibuf.c (read_minibuf_noninteractive):
3586 * sysdep.c (closedir):
3587 * xdisp.c (x_produce_glyphs):
3588 * xfaces.c (compare_fonts_by_sort_order):
3589 * xfns.c (x_real_positions, select_visual):
3590 * xselect.c (x_stop_queuing_selection_requests)
3591 (x_get_window_property, x_get_window_property_as_lisp_data):
3592 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3593 Remove unnecessary pointer casts.
3594 * alloc.c (record_xmalloc): New function.
3595 * lisp.h (record_xmalloc): New decl.
3596 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3597 more like a function. This is because the pointer cast is not
3598 needed. All uses changed.
3599 * print.c (print_string, print_error_message): Avoid length recalc.
3600
8834c57a
PE
3601 Improve fix for macroexp crash with debugging (Bug#12118).
3602 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3603 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3604 not supposed to be invoked from the garbage collector.
3605 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3606 (gc_aset): New function, which is like ASET but can be
3607 used in the garbage collector.
3608 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3609 (set_hash_index): Use it instead of ASET.
3610
6dad7178
EZ
36112012-08-03 Eli Zaretskii <eliz@gnu.org>
3612
3613 Support symlinks on latest versions of MS-Windows.
3614 * w32.c: Include winioctl.h and aclapi.h.
3615 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3616 (revert_to_self): Forward declarations of static functions.
3617 <static BOOL g_b_init_get_security_info>:
3618 <g_b_init_create_symbolic_link>: New static flags.
3619 (globals_of_w32): Initialize them to zero.
3620 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3621 (map_w32_filename): Improve commentary. Simplify switch.
3622 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3623 headers (most versions of MinGW w32api don't).
3624 (get_security_info, create_symbolic_link)
3625 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3626 New functions.
3627 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3628 in the argument file name.
3629 (sys_access): Call unc_volume_file_attributes only if
3630 GetFileAttributes fails with network-related error codes.
3631 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3632 have the required privileges.
14ae4239 3633 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
3634 get_file_security_desc.
3635 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
3636 with addition of handling of symlinks and support for 'lstat'.
3637 If possible, get file's attributes and security information by
6dad7178
EZ
3638 handle, not by name. Produce S_IFLNK bit for symlinks, when
3639 called from 'lstat'.
3640 (stat, lstat): New functions, call 'stat_worker'.
3641 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3642 symlinks when the underlying filesystem supports them.
3643
f162bcc3
PE
36442012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3645
79ea6c20
PE
3646 Fix macroexp crash on Windows with debugging (Bug#12118).
3647 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3648 checking subscripts; problem introduced with the recent
3649 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3650 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3651 since it's used in non-static inline functions now.
3652
c0ce93fd
PE
3653 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3654 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 3655
f162bcc3
PE
3656 Use C99-style 'extern inline' if available.
3657 * buffer.h (BUFFER_INLINE):
3658 * category.h (CATEGORY_INLINE):
3659 * character.h (CHARACTER_INLINE):
3660 * charset.h (CHARSET_INLINE):
3661 * composite.h (COMPOSITE_INLINE):
3662 * dispextern.h (DISPEXTERN_INLINE):
3663 * lisp.h (LISP_INLINE):
3664 * systime.h (SYSTIME_INLINE):
3665 New macro, replacing 'static inline' in this header.
3666 * buffer.h, category.h, character.h, charset.h, composite.h:
3667 * dispextern.h, lisp.h, systime.h:
3668 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3669 * alloc.c (LISP_INLINE):
3670 * buffer.c (BUFFER_INLINE):
3671 * category.c (CATEGORY_INLINE):
3672 * character.c (CHARACTER_INLINE):
3673 * charset.c (CHARSET_INLINE):
3674 * composite.c (COMPOSITE_INLINE):
3675 * dispnew.c (DISPEXTERN_INLINE):
3676 * sysdep.c (SYSTIME_INLINE):
3677 Define to EXTERN_INLINE, so that the corresponding functions
3678 are compiled into code.
3679 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3680 (INLINE_HEADER_END): New macros.
3681 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3682 since it's used in non-static inline functions now.
a8333d03 3683 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 3684
837b365b
GM
36852012-08-02 Glenn Morris <rgm@gnu.org>
3686
d66b744d
GM
3687 * s/: Remove empty directory.
3688
837b365b
GM
3689 * s/ms-w32.h: Move to ../nt/inc.
3690 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3691 Update for new ms-w32.h location.
3692
13294f95
PE
36932012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3694
3695 Port to Solaris 8.
3696 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3697
90df0db3
GM
36982012-08-02 Glenn Morris <rgm@gnu.org>
3699
3700 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3701 hard-coding the path separator.
3702
4939150c
PE
37032012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3704
3705 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3706 This how ASET and AREF are supposed to work, and makes
3707 it easier to think about future improvements. See
3708 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3709 * charset.h (set_charset_attr): New function.
3710 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3711 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3712 (aref_addr): New function. All uses of &AREF(...) changed.
3713 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3714 (set_hash_index): New functions. All lvalue-style uses of
3715 HASH_KEY etc. changed.
3716 * keyboard.c (set_prop): New function. All lvalue-style uses
3717 of PROP changed.
3718
947b2afd
AA
37192012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3720
3721 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3722 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3723 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3724 * nsfns.m (ns_set_name_as_filename): Likewise.
3725 * nsmenu.m (ns_update_menubar): Likewise.
3726 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3727
4f5d0325
EZ
37282012-08-01 Eli Zaretskii <eliz@gnu.org>
3729
2008beae
EZ
3730 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3731 Adapt to latest changes in field names of the corresponding Lisp
288479f6 3732 objects.
2008beae 3733
4f5d0325
EZ
3734 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3735
fe3cc771
GM
37362012-08-01 Glenn Morris <rgm@gnu.org>
3737
3738 * s/msdos.h: Remove file.
3739 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3740 * Makefile.in (S_FILE): Remove.
3741 (config_h): Remove S_FILE.
3742
c90acc54
JB
37432012-08-01 Juanma Barranquero <lekktu@gmail.com>
3744
3745 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3746 Remove; moved to nt/config.nt.
3747
d8a05828
DA
37482012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3749
3750 Use INTERNAL_FIELD for conses and overlays.
3751 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3752 Remove obsolete comment.
3753 (MVAR): New macro.
3754 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3755 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3756
8271d590
DA
37572012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3758
3759 Use INTERNAL_FIELD for symbols.
3760 * lisp.h (SVAR): New macro. Adjust users.
3761 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3762 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3763
3193acd2
DA
37642012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3765
3766 Use INTERNAL_FIELD for processes.
3767 * process.h (PVAR): New macro. Adjust style.
3768 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3769 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3770
3a45383a
DA
37712012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3772
3773 Use INTERNAL_FIELD for windows.
3774 * window.h (WVAR): New macro.
3775 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3776 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3777 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3778 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3779 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3780 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3781
c1dbc63c
PE
37822012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3783
3784 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3785
5c0c0e8a
GM
37862012-08-01 Glenn Morris <rgm@gnu.org>
3787
3788 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3789 Move to configure.ac.
3790
552a99b4
JB
37912012-08-01 Juanma Barranquero <lekktu@gmail.com>
3792
3793 * makefile.w32-in (CONFIG_H): Update dependencies.
3794 (CONF_POST_H): New macro.
3795
3796 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3797
8d8e2dfe
GM
37982012-07-31 Glenn Morris <rgm@gnu.org>
3799
bc96620a
GM
3800 * Makefile.in (S_FILE): No longer set by configure.
3801
476b1b2d
GM
3802 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3803 is available.
3804 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3805
b2c7a106
GM
3806 * process.h (NULL_DEVICE):
3807 * emacs.c (SEPCHAR):
3808 * editfns.c (USER_FULL_NAME): Let configure set them.
3809
d53d062a
GM
3810 * s/README, s/template.h: Remove files.
3811
4515017f
GM
3812 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3813
8d8e2dfe
GM
3814 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3815 Move to configure.ac.
3816
5b20b3cc
EZ
38172012-07-31 Eli Zaretskii <eliz@gnu.org>
3818
1e0afd9a
EZ
3819 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3820 resulting renaming of 'struct frame' members.
3821
5b20b3cc
EZ
3822 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3823
3824 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3825 after introduction of FVAR.
3826
f1310128
JD
38272012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3828
79e721e0
JD
3829 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3830
3831 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3832 instead of compositeToPoint.
3833 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3834
8d7c7eed 3835 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 3836
e34f7f79
DA
38372012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3838
3839 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3840 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 3841 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
3842 (BVAR): Change to use INTERNAL_FIELD.
3843 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3844 (KVAR): Change to use INTERNAL_FIELD.
3845 * frame.h (FVAR): New macro.
3846 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
3847 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3848 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3849 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
3850 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3851
c09bfb2f
DA
38522012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3853
3854 Miscellaneous fixes for non-default X toolkits.
3855 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3856 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3857 Move under #ifdef USE_LUCID.
3858 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3859 definition and usage to avoid warnings.
3860
14c114ae
JD
38612012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3862
3863 * nsterm.m (openFiles): Fix previous checkin.
3864
3bd21e82
PE
38652012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3866
3867 * indent.c (compute_motion): Remove unused local.
3868
c1529ded
GM
38692012-07-31 Glenn Morris <rgm@gnu.org>
3870
400d5621
GM
3871 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3872
268e2432
GM
3873 * conf_post.h [USG5_4]:
3874 Move remaining contents of s/usg5-4-common.h here.
3875 * s/usg5-4-common.h: Remove file.
3876
7552f3ee
GM
3877 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3878 * s/irix6-5.h: Remove file.
3879
6a381852
GM
3880 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3881 * s/darwin.h: Remove file.
3882
c1529ded
GM
3883 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3884 * s/hpux10-20.h: Remove file, which is now empty.
3885
b429a4ee
GM
38862012-07-30 Glenn Morris <rgm@gnu.org>
3887
3888 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3889 * Makefile.in (config_h): Add conf_post.h.
3890 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3891
adff3182
JD
38922012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3893
3894 * nsterm.m (ns_do_open_file): New variable.
b9031d69 3895 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
3896 (openFile, openTempFile, openFileWithoutUI, openFiles):
3897 Open files only if ns_do_open_file.
adff3182 3898
c32af1e4
PE
38992012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3900
7393bcbb
PE
3901 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3902 This no-op macro hasn't been needed for many years.
3903 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3904
c32af1e4
PE
3905 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3906 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3907 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3908 gdb_make_enums_visible.
3909 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3910 (DIRECTORY_SEP): Now a constant, not a macro.
3911
302fc036
EZ
39122012-07-30 Eli Zaretskii <eliz@gnu.org>
3913
3914 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3915 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3916
3917 * w32term.c <w32_keyboard_codepage>: Renamed from
3918 keyboard_codepage and now external. All users changed.
3919
3920 * w32term.h: Add declaration of w32_keyboard_codepage.
3921
3922 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3923 the codepage to translate keys to Unicode. If this argument is
3924 -1, use the value returned by GetConsoleCP. All callers changed.
3925
88fb40b4
PE
39262012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3927
0aee6912
PE
3928 Update .PHONY listings in makefiles.
3929 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3930 bootstrap-clean, distclean, maintainer-clean, versioclean,
3931 extraclean, frc.
3932
88fb40b4
PE
3933 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3934 This is a bit clearer. Fix some commentary typos.
3935
0a763bd1
GM
39362012-07-30 Glenn Morris <rgm@gnu.org>
3937
32bac6d6
GM
3938 * s/netbsd.h: Let configure include signal.h if needed.
3939 Remove file, which is now empty.
3940
b65e7c46
GM
3941 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3942 Let configure set them.
3943 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3944 No more need to undefine.
0a763bd1 3945
169304bd
AS
39462012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3947
3948 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3949 non-single-byte char when adding meta modifier. (Bug#12090)
3950
6cd7a139
DA
39512012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3952
3953 Convert safe_call to use variable number of arguments.
3954 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3955 (safe_call2): Fix comment.
3956 * lisp.h (safe_call): Adjust prototype.
3957 * coding.c (encode_coding_object): Change to use safe_call2.
3958 * xfaces.c (merge_face_heights): Change to use safe_call1.
3959
d34d6ffc
GM
39602012-07-30 Glenn Morris <rgm@gnu.org>
3961
7b8a48e4 3962 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 3963 does that unconditionally. Remove file, which is now empty.
7b8a48e4 3964
d34d6ffc
GM
3965 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3966 Remove empty files.
3967
03a660a6
PE
39682012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3969
3970 Export to GDB most of lisp.h's remaining object-like macros.
3971 * lisp.h (min, max): Move earlier, because they're used earlier now.
3972 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3973 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3974 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3975 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3976 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3977 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3978 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3979 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3980 Now constants, for GDB. They need not be macros.
3981 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3982 Now constants, for GDB, as well as macros, for static initializers.
3983 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3984 Move to after the definition of struct Lisp_Char_Table,
3985 since the former now needs that type defined.
3986 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3987 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3988 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3989 New enums, for gdb_make_enums_visible.
3990 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 3991 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
3992 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3993 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3994 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3995 enum maxargs, enum MAX_ALLOCA.
3996 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3997 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3998 no longer needed, now that they are done in lisp.h.
3999
e499d0ee
DA
40002012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4001
4002 Cleanup string bytes checking.
4003 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
4004 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
4005 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
4006 (check_sblock, compact_small_strings): Simplify.
4007
d5040d2d
PE
40082012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4009
4010 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
4011 These macros are confusing and no longer need to be defined, as
4012 the enum values now suffice. All uses replaced with definiens.
4013 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
4014
7f259ae6
JB
40152012-07-29 Juanma Barranquero <lekktu@gmail.com>
4016
4017 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
4018 ($(BLD)/w32console.$(O)): Update dependencies.
4019
7e63e0c3
DA
40202012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4021
4022 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
4023 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
4024 time. Adjust users.
4025 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
4026
ffd817eb
JD
40272012-07-29 Jan Djärv <jan.h.d@swipnet.se>
4028
4029 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
4030 setting sitelisp (Bug#12010).
4031
417a7a0e
EZ
40322012-07-29 Eli Zaretskii <eliz@gnu.org>
4033
14ae4239 4034 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
4035
4036 * w32heap.c (cache_system_info):
4037 * w32.c (sys_rename):
4038 * w32proc.c (find_child_console, sys_kill): All users changed.
4039
387d4d92
PE
40402012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4041
4042 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4043
55a6cca6
EZ
40442012-07-29 Eli Zaretskii <eliz@gnu.org>
4045
4046 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
4047
dbcf001c
DA
40482012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4049
4050 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
4051 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
4052 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 4053
e2688e4a
DA
40542012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4055
4056 Generalize marker debugging code under MARKER_DEBUG and use eassert.
4057 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
4058 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
4059 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
4060 (replace_range, replace_range_2, del_range_2): Change to eassert.
4061 * marker.c (byte_char_debug_check): Adjust style.
4062
b46a6a83
PE
40632012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4064
4065 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4066 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4067 long-ago-commented-out code that talks about "WIN32".
4068 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4069 All uses changed.
4070
e32a5799
PE
40712012-07-28 Paul Eggert <eggert@cs.ucla.edu>
4072
4073 Use Gnulib stdalign module (Bug#9772, Bug#9960).
4074 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4075 Simplify by using alignof.
4076 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4077 * lisp.h: Include <stdalign.h>.
4078 (GCALIGNMENT): New macro and constant.
4079 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
4080 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4081 (stdalign): New macro, if not already defined.
4082
df81cd29
EZ
40832012-07-28 Eli Zaretskii <eliz@gnu.org>
4084
01bd1b0d
EZ
4085 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
4086 * w32inevt.c: Include w32inevt.h.
4087 (w32_read_console_input): New inline function, calls either
4088 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4089 w32_console_unicode_input.
4090 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4091 (w32_kbd_patch_key, key_event): Use the codepage returned by
4092 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4093 (key_event): use uChar.UnicodeChar only if
4094 w32_console_unicode_input is non-zero.
4095
4096 * w32console.c: Include w32heap.h.
4097 <w32_console_unicode_input>: New global variable.
4098 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4099 family of Windows, zero otherwise.
4100
4101 * w32inevt.h: Declare w32_console_unicode_input.
4102
df81cd29
EZ
4103 * xdisp.c (init_iterator): Don't reference tip_frame in a build
4104 --without-x. (Bug#11742)
4105
c20fdd9e
PE
41062012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4107
4108 Adjust GDB to reflect pvec_type changes (Bug#12036).
4109 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
4110 2012-07-04 changes to pseudovector representation.
4111 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 4112
32770973 41132012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
4114
4115 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4116 bus address.
4117 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4118
3438fe21
EZ
41192012-07-27 Eli Zaretskii <eliz@gnu.org>
4120
bcfbc9de
EZ
4121 * alloc.c (listn): Fix the order the arguments are consed onto the
4122 list.
4123
3438fe21
EZ
4124 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4125 enumeration constants, as PURE and HEAP are too general, and clash
4126 with other headers and sources, such as gmalloc.c and the
4127 MS-Windows system headers. All users changed.
4128
eeaea515
DA
41292012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4130
4131 Revert last save_excursion_save and save_excursion_restore changes.
4132 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4133 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4134
073c88c2
DA
41352012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4136
4137 Fix recently-introduced typos in Windows port.
4138 Reported by Martin Rudalics <rudalics@gmx.at>.
4139 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 4140 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 4141
4706125e
PE
41422012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4143
4144 Improve GDB symbol export (Bug#12036).
4145 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4146 arms of an 'if', not using conditional expressions; otherwise GDB
4147 complains about the types in the unevaluated arm when the argument
4148 is an integer literal.
4149 (xgetint): Simplify expression.
4150 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4151 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4152 Zaretskii in <http://bugs.gnu.org/12036#13>.
4153 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4154 needed now that we have gdb_make_enums_visible.
4155 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4156 (enum enum_USE_LSB_TAG):
4157 New enum types, packaging up enums that need to be exported to GDB.
4158
694b6c97
DA
41592012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4160
4161 Utility function to make a list from specified amount of objects.
4162 * lisp.h (enum constype): New datatype.
4163 (listn): New prototype.
4164 * alloc.c (listn): New function.
4165 (Fmemory_use_count, syms_of_alloc): Use it.
4166 * buffer.c (syms_of_buffer): Likewise.
4167 * callint.c (syms_of_callint): Likewise.
4168 * charset.c (define_charset_internal): Likewise.
4169 * coding.c (syms_of_coding): Likewise.
4170 * keymap.c (syms_of_keymap): Likewise.
4171 * search.c (syms_of_search): Likewise.
4172 * syntax.c (syms_of_syntax): Likewise.
4173 * w32.c (init_environment): Likewise.
4174 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4175 * xdisp.c (syms_of_xdisp): Likewise.
4176 * xfns.c (syms_of_xfns): Likewise.
4177
6195f384
DA
41782012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4179
4180 Fast save_excursion_save and save_excursion_restore.
4181 * lisp.h (struct Lisp_Excursion): New data type.
4182 (PVEC_EXCURSION): New pseudovector type.
4183 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
4184 to deal with it. Adjust comments.
4185 (init_marker, attach_marker): New prototype.
4186 (unchain_marker): Adjust prototype.
4187 * marker.c (attach_marker): Change to global.
4188 (init_marker): New function.
4189 * alloc.c (Fmake_marker, build_marker): Use it.
4190 (build_marker): More easserts.
4191 (mark_object): Handle struct Lisp_Excursion.
4192 * editfns.c (save_excursion_save, save_excursion_restore):
4193 Reimplement to use struct Lisp_Excursion. Add comments.
4194
5eceb8fb
PE
41952012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4196
4197 Fix export of symbols to GDB (Bug#12036).
4198 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
4199 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
4200 emacs.c, as this is a more-suitable home. Had this been done earlier
4201 the fix for 12036 would have avoided some of the problems noted in
4202 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
4203 would have been more obvious.
562157c8
PE
4204 * emacs.c: Do not include <verify.h>; no longer needed.
4205 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
4206 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
4207 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4208 Remove; now done in lisp.h.
4209 * lisp.h (PUBLISH_TO_GDB): New macro.
4210 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
4211 (DATA_SEG_BITS): Use it.
4212 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
4213 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
4214 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
4215 not be usable in #if. This simplifies things.
4216
d6749401
JB
42172012-07-26 Juanma Barranquero <lekktu@gmail.com>
4218
4219 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
4220
1781b9e9
PE
42212012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4222
d89518db 4223 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
4224 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
4225 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
4226 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
4227 Adjust to changes in lisp.h and emacs.c, by using
4228 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
4229 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
4230 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
4231 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
4232 instead of gdb_valbits.
4233 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
4234 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
4235 instead of gdb_array_mark_flag.
4236 (xboolvector): Get size from $->size, not $->header.size.
4237 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
4238 (xreload, hook-run, hookpost-run): Remove.
4239 * emacs.c: Include <verify.h>.
4240 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
4241 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
4242 Remove.
4243 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
4244 (gdb_USE_LSB_TAG): New enum constants.
4245 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4246 Also define these as enum constants, so they're visible to GDB.
4247 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4248 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4249 as constants, so they're visible to GDB.
4250 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4251 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4252 Now enum constants, not macros, so they're visible to GDB.
4253 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4254 more convenient now. All uses changed.
4255 (VALMASK) [USE_LSB_TAG]: Also define in this case.
4256 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4257
3628596a
DA
42582012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
4259
4260 Explicitly free restriction data that are not needed anymore.
4261 * editfns.c (save_restriction_restore): Free restriction data.
4262
7abaf5cc
SM
42632012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
4264
4265 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4266 add argument, tune behavior, and adjust all callers.
4267
71f88e00
PE
42682012-07-25 Paul Eggert <eggert@cs.ucla.edu>
4269
4270 Use typedef for EMACS_INT, EMACS_UINT.
4271 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4272 than macros. This simplifies debugging in the usual case, since
4273 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4274 and it allows expressions involving EMACS_INT casts.
4275 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4276
57ec3034
JD
42772012-07-25 Jan Djärv <jan.h.d@swipnet.se>
4278
4279 * nsterm.m (ns_read_socket): Return early if there is a modal
4280 window (Bug#12043).
4281
8137e7b3
MR
42822012-07-25 Martin Rudalics <rudalics@gmx.at>
4283
4284 * frame.c (Fredirect_frame_focus): In doc-string don't mention
4285 that FOCUS-FRAME can be omitted.
4286
04e9897c
DA
42872012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
4288
4289 Adjust buffer text indirection counters at the end of Fkill_buffer.
4290 * buffer.c (Fkill_buffer): Adjust indirection counters when the
4291 buffer is definitely dead. This should really fix an issue reported
4292 by Christoph Scholtes again. (Bug#12007).
4293 (init_buffer_once): Initialize indirection counters of
4294 buffer_defaults and buffer_local_symbols (for sanity and safety).
4295
8a0484e1
EZ
42962012-07-24 Eli Zaretskii <eliz@gnu.org>
4297
4298 * xdisp.c (init_iterator): Don't compute dimensions of truncation
4299 and continuation glyphs on tooltip frames, leave them at zero.
4300 Avoids continued lines in tooltips. (Bug#11832)
4301
fa691a83
DA
43022012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
4303
4304 Simplify copy_overlay.
04e9897c 4305 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
4306 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4307
436bc8e0
EZ
43082012-07-23 Eli Zaretskii <eliz@gnu.org>
4309
4310 * print.c (print_object): Don't crash when a frame's name is nil
4311 or invalid. (Bug#12025)
4312
4313 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4314 it signals an error when a tooltip frame is being created.
4315
d7a7fda3
DA
43162012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4317
4318 Cleanup miscellaneous objects allocation and initialization.
4319 * alloc.c (allocate_misc): Change to static. Add argument to
4320 specify the subtype. Adjust comment and users.
4321 (build_overlay): New function.
4322 * buffer.c (copy_overlays, Fmake_overlay): Use it.
4323 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4324 (allocate_misc): Remove prototype.
4325 (build_overlay): Add prototype.
4326
43272012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
4328
4329 Swap buffer text indirection counters in Fbuffer_swap_text.
4330 * buffer.c (Fbuffer_swap_text): Swap indirections too.
4331 This avoids crash reported by Christoph Scholtes at
4332 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4333
9d7fa573
JD
43342012-07-22 Jan Djärv <jan.h.d@swipnet.se>
4335
4336 * nsmenu.m (Popdown_data): New struct.
4337 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
4338 free Popdown_data.
4339 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
4340 (initWithContentRect): Make imgView and contentView non-static
4341 and autorelease them. Also autorelease img and matrix (Bug#12005).
4342 (dealloc): Remove (Bug#12005).
4343
0dd6d66d
DA
43442012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4345
4346 Adjust consing_since_gc when objects are explicitly freed.
4347 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
4348 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
4349 (free_cons, free_misc): Subtract object size from consing_since_gc.
4350
d36d71df
DA
43512012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4352
4353 Simplify and cleanup markers positioning code.
4354 * marker.c (attach_marker): More useful eassert.
4355 (live_buffer, set_marker_internal): New function.
4356 (Fset_marker, set_marker_restricted): Use set_marker_internal.
4357 (set_marker_both, set_marker_restricted_both): Use live_buffer.
4358
fb9ea40f
PE
43592012-07-22 Paul Eggert <eggert@cs.ucla.edu>
4360
4361 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
4362 as it's limited by the amount of memory, not by INT_MAX.
4363
2d5c5f7d
EZ
43642012-07-21 Eli Zaretskii <eliz@gnu.org>
4365
07fb592e
EZ
4366 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
4367 in special-event-map. See the discussion at
4368 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4369 for the reasons.
4370
37a9eac8 4371 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
4372 info.dwItemData. Fixes crashes on 64-bit Windows.
4373 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 4374
c4328746
JD
43752012-07-21 Jan Djärv <jan.h.d@swipnet.se>
4376
fc0c31f8 4377 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 4378 (conversationIdentifier): Return value is NSInteger.
784051c4 4379 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 4380
6e5d1c12
CY
43812012-07-21 Chong Yidong <cyd@gnu.org>
4382
4383 * window.c (decode_any_window): Signal an error if the window is
4384 on a dead frame (Bug#11984).
4385
9928463d
DA
43862012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4387
4388 Add indirection counting to speed up Fkill_buffer.
4389 * buffer.h (struct buffer): New member.
4390 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4391 (Fmake_indirect_buffer): Set indirection counter to -1, increment
4392 base buffer indirection counter.
4393 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4394 (Fkill_buffer): Adjust indirection counters as needed, don't walk
4395 through buffer list if indirection counter is 0.
4396
f8643a6b
DA
43972012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4398
4399 Extend the value returned by Fgarbage_collect with heap statistics.
4400 * alloc.c (Qheap): New symbol.
4401 (syms_of_alloc): DEFSYM it.
4402 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4403 (Fmemory_free): Remove.
4404 (syms_of_alloc): Don't defsubr it.
4405 * buffer.c (Fcompact_buffer): Remove.
4406 (syms_of_buffer): Don't defsubr it.
4407
dac616ff
DA
44082012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4409
4410 Make maybe_gc inline.
4411 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4412 * lisp.h (consing_since_gc, gc_relative_threshold)
4413 (memory_full_cons_threshold): Revert declaration.
4414 (maybe_gc): Remove prototype, define as inline.
4415 * alloc.c: Remove old commented-out code.
4416 (consing_since_gc, gc_relative_threshold)
4417 (memory_full_cons_threshold): Revert to global.
4418 (maybe_gc): Remove.
4419
d7ea76b4
DA
44202012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4421
4422 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4423 * lisp.h (build_unibyte_string): New function.
4424 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4425 * sysdep.c, w32fns.c, xfns.c: Use it.
4426 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4427 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4428 Adjust users accordingly.
4429 * font.h (font_open_by_name): Adjust prototype.
4430
765e61e3
DA
44312012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4432
4433 Cleanup calls to Fgarbage_collect.
4434 * lisp.h (maybe_gc): New prototype.
4435 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4436 Remove declarations.
4437 * alloc.c (maybe_gc): New function.
4438 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4439 Make them static.
4440 * bytecode.c (MAYBE_GC): Use maybe_gc.
4441 * eval.c (eval_sub, Ffuncall): Likewise.
4442 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4443 to avoid dependency from auto-save feature.
4444
52b852c7
PE
44452012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4446
4447 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4448 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4449 'for_each_per_buffer_object_at'.
4450 All uses changed. It's better to use upper-case for macros that
4451 cannot be implemented as functions, to give the reader a clue
4452 that they're special.
4453
5db81e33
SM
44542012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4455
4456 * alloc.c (Fgarbage_collect): Tweak docstring.
4457
5b835e1d
DA
44582012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4459
4460 Tweak the value returned from Fgarbage_collect again.
4461 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4462 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4463 Adjust documentation.
4464 (total_vector_bytes): Rename to total_vector_slots, adjust
4465 accounting.
4466 (total_free_vector_bytes): Rename to total_free_vector_slots,
4467 adjust accounting.
4468 (Qstring_bytes, Qvector_slots): New symbols.
4469 (syms_of_alloc): DEFSYM them.
4470
9cd47b72
DA
44712012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4472
4473 Buffer compaction primitive which may be used from Lisp.
4474 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4475 (syms_of_buffer): Register Fcompact_buffer.
4476 * alloc.c (Fgarbage_collect): Use compact_buffer.
4477 * buffer.h (compact_buffer): New prototype.
4478 (struct buffer_text): New member.
4479
d17337e5
DA
44802012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4481
4482 New macro to iterate over all buffers, miscellaneous cleanups.
4483 * lisp.h (all_buffers): Remove declaration.
4484 * buffer.h (all_buffers): Add declaration, with comment.
4485 (for_each_buffer): New macro.
4486 * alloc.c (Fgarbage_collect, mark_object): Use it.
4487 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4488 (init_buffer): Likewise.
4489 * data.c (Fset_default): Likewise.
4490 * coding.c (code_conversion_restore): Remove redundant check
4491 for dead buffer.
4492 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4493
60cfd278
AS
44942012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4495
4496 Fix bug that created negative-length intervals.
4497 * intervals.c (merge_interval_right, merge_interval_left):
4498 Do not zero out this interval if it is absorbed by its children,
4499 as this interval's total length doesn't change in that case. See
4500 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4501
d06714cb
PE
45022012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4503
83713154
PE
4504 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4505 when invoking (make-bool-vector N t) and N is a positive
4506 multiple of 8 -- the last 8 bits were mistakenly cleared.
4507
d06714cb
PE
4508 Remove some struct layout assumptions in bool vectors.
4509 * alloc.c (bool_header_size): New constant.
4510 (header_size, word_size): Move earlier, as they're now used earlier.
4511 Use 'word_size' in a few more places, where it's appropriate.
4512 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4513 padding before the data member of a bool vector.
4514 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4515 than doing the check by hand with an abort ().
4516
464d5a5e
SM
45172012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4518
5fbc0409
SM
4519 * eval.c (Fdefvar): Don't check constants since we only set the var if
4520 it's not yet defined anyway (bug#11904).
4521
464d5a5e
SM
4522 * lisp.h (last_undo_boundary): Declare new var.
4523 * keyboard.c (command_loop_1): Set it.
4524 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4525 were auto-added by the command loop (bug#11774).
4526
8dc2e44a
AS
45272012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4528
4529 * w32font.c (Qsymbol): Remove local definition.
4530 (syms_of_w32font): Don't DEFSYM it.
4531
169925ec
DA
45322012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4533
4534 Fix sweep_vectors to handle large bool vectors correctly.
4535 * alloc.c (sweep_vectors): Account total_vector_bytes for
4536 bool vectors larger than VBLOCK_BYTES_MAX.
4537
5fbfb018
CY
45382012-07-18 Chong Yidong <cyd@gnu.org>
4539
4540 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4541 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4542
3ab6e069
DA
45432012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4544
4545 Return more descriptive data from Fgarbage_collect.
4546 Suggested by Stefan Monnier in
4547 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4548 * alloc.c (bounded_number): New function.
4549 (total_buffers, total_vectors): New variable.
4550 (total_string_size): Rename to total_string_bytes, adjust users.
4551 (total_vector_size): Rename to total_vector_bytes, adjust users.
4552 (sweep_vectors): Account total_vectors and total_vector_bytes.
4553 (Fgarbage_collect): New return value. Adjust documentation.
4554 (gc_sweep): Account total_buffers.
4555 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4556 (VECTOR_SIZE): Remove.
4557 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4558 (Qinterval, Qmisc): New symbols.
4559 (syms_of_data): Initialize them.
4560 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4561 (Qcons, Qbuffer): New declarations.
4562
6d02fe5b
PE
45632012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4564
4565 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4566 Round up, not down. Improve doc.
4567
b7ffe040
DA
45682012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4569
4570 Restore old code in allocate_string_data to avoid Faset breakage.
4571 Reported by Julien Danjou <julien@danjou.info> in
4572 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4573 * alloc.c (allocate_string_data): Restore old code with minor
4574 adjustments, fix comment to explain this subtle issue.
4575
4dc7c8d5
SM
45762012-07-17 Eli Zaretskii <eliz@gnu.org>
4577
4578 Remove FILE_SYSTEM_CASE.
4579 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4580
4581 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4582 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4583 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4584 call-process-region passes it through expand-file-name.
4585
4586 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4587
45882012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4589
4590 Fix crash when creating indirect buffer (Bug#11917)
4591 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4592 Don't handle unbound variables specially if non-zero.
4593 (Fbuffer_local_variables): Pass zero.
4594 (clone_per_buffer_values): Pass non-zero.
4595
45962012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4597
4598 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4599 to make the loop interruptible.
4600
46012012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4602
4603 * gnutls.c (emacs_gnutls_handshake): Only retry if
4604 GNUTLS_E_INTERRUPTED.
4605
cce7fefc
DA
46062012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4607
4608 Cleanup and convert miscellaneous checks to eassert.
4609 * alloc.c (mark_interval): Fix comment, partially rephrase
4610 old comment from intervals.h (see below).
4611 * intervals.c (find_interval, adjust_intervals_for_insertion)
4612 (delete_interval, adjust_intervals_for_deletion)
4613 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4614 Convert to eassert.
4615 (adjust_intervals_for_insertion, make_new_interval):
4616 Remove obsolete and unused code.
4617 * intervals.h (struct interval): Remove obsolete comment.
4618 * textprotp.c (erase_properties): Remove unused code.
4619 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4620 (Fremove_list_of_text_properties): Convert to eassert.
4621
9ea10cc3
CY
46222012-07-17 Chong Yidong <cyd@gnu.org>
4623
4624 * editfns.c (Finsert_char): Doc fix.
4625
3900d5de
DA
46262012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4627
4628 Fix previous change to make Fmemory_free always accurate.
4629 * alloc.c (make_interval): Update total_free_intervals.
4630 (make_float): Likewise for total_free_floats.
4631 (free_cons, Fcons): Likewise for total_free_conses.
4632 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4633 Likewise for total_free_vector_bytes.
4634 (Fmake_symbol): Likewise for total_free_symbols.
4635 (bytes_free): Remove.
4636
7098646f
DA
46372012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4638
4639 Simple free memory accounting feature.
4640 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4641 (sweep_vectors): Accumulate size of free vectors.
4642 (Fgarbage_collect): Setup bytes_free.
4643 (Fmemory_free): New function.
4644 (syms_of_alloc): Register it.
4645
22657b40
DA
46462012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4647
4648 Cleanup overlays checking.
4649 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4650 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4651 eassert and OVERLAYP.
4652 (sort_overlays): Change to use OVERLAYP.
4653
ddfc8813
RK
46542012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4655
4656 * editfns.c (Finsert_char): Make it interactive, and make the
4657 second arg optional. Copy interactive spec and docstring from
4658 ucs-insert.
4659
7c26cf3c
PE
46602012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4661
4662 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4663 Unlike the other wrapped functions, fabs has an unspecified
4664 effect on errno.
4665
5d127af9
JD
46662012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4667
4668 * nsterm.m (keyDown): Interpret flags without left/right bits
4669 as the left key (Bug#11670).
4670
6a0dd1d7
DA
46712012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4672
4673 Remove empty and useless init functions.
4674 * lisp.h (init_character_once, init_fns, init_image)
4675 (init_filelock, init_sound): Remove prototype.
4676 * character.c (init_character_once): Remove.
4677 * filelock.c (init_filelock): Likewise.
4678 * fns.c (init_fns): Likewise.
4679 * image.c (init_image): Likewise.
4680 * sound.c (init_sound): Likewise.
4681 * emacs.c (main): Adjust accordingly.
4682
7a6136fd
DA
46832012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4684
4685 * gtkutil.h: Tiny cleanups.
4686 (use_old_gtk_file_dialog): Remove useless declaration.
4687 (xg_uses_old_file_dialog): Add suggested const attribute.
4688
ce811ad9
EZ
46892012-07-15 Eli Zaretskii <eliz@gnu.org>
4690
4691 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4692 (bidi_paragraph_init): Use it to limit search forward for a strong
4693 directional character in abnormally large paragraphs full of
4694 neutral or weak characters. (Bug#11943)
4695
c9adfeaa
SF
46962012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4697
4698 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4699 the toolbar (Bug#9451).
4700 (xg_make_tool_item): Give the widget event box a transparent
4701 background.
4702
fff62aa9
DA
47032012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4704
4705 Cleanup basic allocation variables and functions.
4706 * alloc.c (ignore_warnings, init_intervals, init_float)
4707 (init_cons, init_symbol, init_marker): Remove.
4708 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4709 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4710 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4711 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4712 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4713 (staticidx, init_alloc_once, init_strings, free_ablock):
4714 Remove redundant initialization.
4715 * fns.c (init_weak_hash_tables): Remove.
4716 * lisp.h (init_weak_hash_tables): Remove prototype.
4717
9730daca
DA
47182012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4719
4720 Use zero_vector where appropriate.
4721 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4722 accordingly.
4723 * lisp.h (zero_vector): New declaration.
4724 * font.c (null_vector): Remove.
4725 (syms_of_font): Remove initialization and staticpro.
4726 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4727 * keymap.c (Faccessible_keymaps): Likewise.
4728
2e2d2a13
LL
47292012-07-15 Leo Liu <sdl.web@gmail.com>
4730
4731 * fringe.c: Fix typo in comments.
4732
cd276f6e
LL
47332012-07-14 Leo Liu <sdl.web@gmail.com>
4734
4735 * fringe.c: Add a new bitmap exclamation-mark.
4736
5a1131d9
EZ
47372012-07-14 Eli Zaretskii <eliz@gnu.org>
4738
4739 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4740
4741 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4742 (HAVE_MENUS): Don't define, defined by editing config.in with
4743 msdos/sed2v2.inp.
4744 (GMALLOC_INHIBIT_VALLOC): Don't define.
4745 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4746
22e983b7
JB
47472012-07-14 Juanma Barranquero <lekktu@gmail.com>
4748
4749 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4750
5b3f250f
GM
47512012-07-14 Glenn Morris <rgm@gnu.org>
4752
4753 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4754 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4755 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4756
33d63ff4
GM
47572012-07-13 Glenn Morris <rgm@gnu.org>
4758
5b633342
GM
4759 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4760
33d63ff4
GM
4761 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4762 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4763
b55b9f85
JD
47642012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4765
0dc8cf50
JD
4766 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4767 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4768 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4769 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4770 where appropriate.
4771 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4772 as boolean expression.
4773 (x_set_window_size): Remove unused variable toolbar.
4774 (ns_get_color_default, ns_mod_to_lisp): Remove.
4775 (ns_mouse_position): Remove unused variables xchar and ychar.
4776 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4777 (ns_set_vertical_scroll_bar): Remove unused variable count.
4778 (ns_delete_terminal): Remove unused variable i.
4779 (ns_term_init): Remove unused variables r, g and b.
4780 (mouseDown): Remove unused variable window.
4781 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4782 (initFrameFromEmacs): Remove unused variable vbextra.
4783 (mouseEntered): Remove unused variables p and dpyinfo.
4784 (mouseExited): Remove unused variables p and r.
4785 (ns_define_frame_cursor, ns_clear_frame_area)
4786 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4787 (menuDown): Assign [sender tag] to variable and cast the variable.
4788
4789 * nsterm.h (menuDown): Add id as type to argument sender.
4790 (ns_display_info_for_name): Add Lisp_Object argument.
4791 (ns_term_init): Add Lisp_Object argument.
4792 (ns_map_event_to_object): Add void argument.
4793 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4794 prototype with arguments and only declare if __OBJC__.
4795 (nxatoms_of_nsselect): Add void argument.
4796 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4797 (ns_alloc_autorelease_pool): Add void argument.
4798 (ns_release_autorelease_pool): Add void* argument.
4799 (ns_get_defaults_value): Add const char* argument.
4800
4801 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4802 (initFromContents): Use SSDATA where appropriate.
4803 (ns_update_menubar): Add braces to ambigous if-else.
4804 (initWithTitle): Put () around assignment in if statement.
4805 (ns_menu_show): Remove unused variables window and keymap.
4806 (update_frame_tool_bar): Remove unused variable selected_p.
4807 (initWithContentRect): Remove unused variable this_cmd_name.
4808
4809 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4810 appropriate.
4811 (setXBMColor): Remove unused variable len.
4812 (setPixmapData): Put () around assignment in loop statement.
4813
4814 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4815 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4816 where appropriate.
4817 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4818 around assignment in loop statement.
4819 (nsfont_open): Remove unused variable i.
4820 (nsfont_open): Remove unused variable len.
4821 (nsfont_draw): Remove unused variable cs.
4822
4823 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4824 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4825 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4826 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4827 (Fns_font_name, Fns_perform_service)
4828 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4829 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4830 (ns_set_name): Remove unused variable view.
4831 (x_set_menu_bar_lines): Remove unused variable olines.
4832 (x_set_tool_bar_lines): Remove unused variable root_window.
4833 (Fns_list_colors): Put () around assignment in while statement.
4834 (Fns_perform_service): Remove unused variable len.
4835 (Fns_display_usable_bounds): Remove unused variable top.
4836 (syms_of_nsfns): Remove unused variable i.
4837
b55b9f85
JD
4838 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4839 memcpy (Bug#11907).
4840
ed9265fc 48412012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
4842
4843 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4844 and free it with DestroyExceptionInfo (Bug#11558).
4845
ef099b57
JB
48462012-07-13 Juanma Barranquero <lekktu@gmail.com>
4847
4848 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4849 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4850 Set here, not in nt/config.nt.
4851
ea814a5d
EZ
48522012-07-13 Eli Zaretskii <eliz@gnu.org>
4853
4854 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4855 cursor overflow into the last glyph on display line when the right
4856 fringe is off. (Bug#11832)
4857
1a952767
PE
48582012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4859
4860 * xdisp.c (produce_special_glyphs): Now static.
4861 * dispextern.h (produce_special_glyphs): Remove decl.
4862
983188fd
GM
48632012-07-13 Glenn Morris <rgm@gnu.org>
4864
8d7c7eed 4865 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
4866 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4867
983188fd
GM
4868 * s/usg5-4-common.h (USG, USG5):
4869 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4870 * s/sol2-6.h (SOLARIS2):
4871 * s/irix6-5.h (IRIX6_5):
4872 * s/hpux10-20.h (USG, USG5, HPUX):
4873 * s/gnu-linux.h (USG, GNU_LINUX):
4874 * s/freebsd.h (BSD_SYSTEM):
4875 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4876 * s/cygwin.h (CYGWIN):
4877 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4878 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4879
d1e68667 48802012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
4881
4882 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 4883
6de0e799
GM
48842012-07-13 Glenn Morris <rgm@gnu.org>
4885
739ae010
GM
4886 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4887
dbee5793
GM
4888 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4889
6de0e799
GM
4890 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4891 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4892
b82da769
GM
48932012-07-12 Glenn Morris <rgm@gnu.org>
4894
4fae5a7a 4895 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
4896
4897 * process.c (init_process_emacs): Rename from init_process.
4898 The old name is also the name of a Mach system call.
4899 * lisp.h, emacs.c: Update for this name change.
4900 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4901 longer needed.
4902
5a979817
EZ
49032012-07-12 Eli Zaretskii <eliz@gnu.org>
4904
4905 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4906 memmove call that removes glyphs covered by the left truncation
4907 glyph. Improve commentary.
4908 (display_line): Fix display of continuation glyphs on GUI frames
4909 when the right fringe is turned off and variable-size fonts are
4910 used in the window. Move the code that appends a stretch glyph to
4911 produce_special_glyphs, so that it could be used for truncation
4912 and continuation glyphs alike.
4913 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4914 glyph of a suitably computed width, to align the special glyphs at
4915 the window margin. Code moved from display_line. (Bug#11832)
4916
3e91a053
GM
49172012-07-12 Glenn Morris <rgm@gnu.org>
4918
ba9e4b84
GM
4919 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4920
4921 * s/gnu-linux.h, s/hpux10-20.h:
4922 Do not unconditionally define HAVE_XRMSETDATABASE.
4923
3e91a053
GM
4924 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4925
b300b1f4
PE
49262012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4927
4928 Fix typos that broke OS X build.
4929 Reported by Randal L. Schwartz in
4930 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4931 * nsterm.m (ns_timeout): Add missing local decl.
4932 (ns_get_color): snprintf -> sprintf, to fix typo.
4933
6e777848
GM
49342012-07-12 Glenn Morris <rgm@gnu.org>
4935
3f922c37
GM
4936 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4937 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4938 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4939 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4940
0ab7b23a
GM
4941 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4942 Move PTY_OPEN to configure.
4943
6e777848
GM
4944 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4945 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4946 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4947
4a7edc24
DA
49482012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4949
4950 Use empty_unibyte_string where applicable.
4951 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4952 * lread.c (read1): Likewise.
4953 * xsettings.c (syms_of_xsettings): Likewise.
4954
308aab79
GM
49552012-07-12 Glenn Morris <rgm@gnu.org>
4956
42bd1719
GM
4957 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4958 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
4959 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4960 * s/hpux10-20.h (RUN_TIME_REMAP):
4961 * s/bsd-common.h (TABDLY): Move to configure.
4962
4963 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4964
4965 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4966
ea0bbd17 4967 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 4968 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
4969
4970 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 4971
308aab79
GM
4972 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4973 * s/template.h: Move NARROWPROTO to configure.
4974
ee1cf5cf
GM
49752012-07-11 Glenn Morris <rgm@gnu.org>
4976
30fe9bf4
GM
4977 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4978 unused since 2011-01-17 change to systty.h.
4979
ee1cf5cf
GM
4980 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4981 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4982 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4983
63e47e07
PE
49842012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4985
4986 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4987
c43fb4c3
GM
49882012-07-11 Glenn Morris <rgm@gnu.org>
4989
4990 * s/darwin.h, s/gnu-linux.h, s/template.h:
4991 Move INTERRUPT_INPUT to configure.
4992
e8df9267
DA
49932012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4994
4995 Minor adjustments to interning code.
4996 * lisp.h (intern, intern_c_string): Redefine as static inline
4997 wrappers for intern_1 and intern_c_string_1, respectively.
4998 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
4999 * lread.c (intern_1, intern_c_string_1, oblookup):
5000 Simplify Vobarray checking.
e8df9267
DA
5001 * font.c (font_intern_prop): Likewise. Adjust comment.
5002 * w32font.c (intern_font_name): Likewise.
5003
34348bd4
AS
50042012-07-11 Andreas Schwab <schwab@linux-m68k.org>
5005
d96a1e0c
AS
5006 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
5007
34348bd4
AS
5008 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
5009 of Fcar/Fcdr if possible.
5010 * font.c (check_otf_features): Likewise.
5011 * fontset.c (Fnew_fontset): Likewise.
5012 * gnutls.c (Fgnutls_boot): Likewise.
5013 * minibuf.c (read_minibuf): Likewise.
5014 * msdos.c (IT_set_frame_parameters): Likewise.
5015 * xmenu.c (Fx_popup_dialog): Likewise.
5016 * w32menu.c (Fx_popup_dialog): Likewise.
5017
c8add24e
GM
50182012-07-11 Glenn Morris <rgm@gnu.org>
5019
4b575b3c
GM
5020 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
5021 since nothing has defined it on these platforms.
5022
09f4e3b0
GM
5023 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
5024 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
5025
172bedef
GM
5026 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5027 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5028 Move CLASH_DETECTION to configure.
5029
249685df
GM
5030 * s/gnu.h: Remove file, which is now empty.
5031
c8add24e
GM
5032 * s/gnu.h, s/gnu-linux.h:
5033 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
5034
b41253a3
JW
50352012-07-11 John Wiegley <johnw@newartisans.com>
5036
5037 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
5038 function attribute, so we only use it if it exists in the
5039 compiler.
5040
d923b542
DA
50412012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5042
5043 Avoid call to strlen in fast_c_string_match_ignore_case.
5044 * search.c (fast_c_string_match_ignore_case): Change to use
5045 length argument. Adjust users accordingly.
5046 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
5047
5ebbef1d
PE
50482012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5049
bb352260
PE
5050 Assume mkdir, rmdir.
5051 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
5052 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
5053
57054ddd
PE
5054 Assume rename.
5055 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
5056
b747d3f7
PE
5057 Assume perror.
5058 * s/hpux10-20.h (HAVE_PERROR): Remove.
5059 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
5060 Remove dummy definition, as this problem was obsolete long ago.
5061
5ebbef1d
PE
5062 Assume strerror.
5063 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5064
984e7f30
DA
50652012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5066
5067 Avoid calls to strlen in font processing functions.
5068 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
5069 (font_open_by_name): Change to use length argument.
5070 Adjust users accordingly.
d923b542
DA
5071 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5072 Adjust prototypes.
5073 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5074 Change to return ptrdiff_t.
984e7f30
DA
5075 (xfont_list_pattern, xfont_match): Use length returned by
5076 xfont_decode_coding_xlfd.
5077 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5078
20e94fdd
GM
50792012-07-11 Glenn Morris <rgm@gnu.org>
5080
9d596af3
GM
5081 * s/darwin.h, s/freebsd.h, s/netbsd.h:
5082 Move DONT_REOPEN_PTY to configure.
5083
20e94fdd
GM
5084 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5085 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5086
e99a530f
PE
50872012-07-10 Paul Eggert <eggert@cs.ucla.edu>
5088
22ffb973
PE
5089 Remove "#define unix" that is no longer needed (Bug#11905).
5090 * s/aix4-2.h (unix): Remove; no longer needed.
5091
e9a9ae03
PE
5092 EMACS_TIME simplification (Bug#11875).
5093 This replaces macros (which typically do not work in GDB)
5094 with functions, typedefs and enums, making the code easier to debug.
5095 The functional style also makes code easier to read and maintain.
5096 * systime.h: Include <sys/time.h> on all hosts, not just if
5097 WINDOWSNT, since 'struct timeval' is needed in general.
5098 (EMACS_TIME): Now a typedef, not a macro.
5099 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5100 not macros.
5101 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
5102 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
5103 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
5104 (EMACS_TIME_LE): Now functions, not macros.
5105 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
5106 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
5107 which are not functions. All uses rewritten to use:
5108 (make_emacs_time): New function.
5109 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5110 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5111 not functions. All uses rewritten to use the following, respectively:
5112 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5113 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 5114 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
5115 * fileio.c (Fcopy_file):
5116 * xterm.c (XTflash): Get the current time closer to when it's used.
5117 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5118
ffacb126
PE
5119 * bytecode.c (targets): Suppress -Woverride-init warnings.
5120
e99a530f
PE
5121 Simplify by avoiding confusing use of strncpy etc.
5122 * doc.c (Fsnarf_documentation):
5123 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5124 * frame.c (Fmake_terminal_frame):
5125 * gtkutil.c (get_utf8_string):
5126 * lread.c (openp):
5127 * nsmenu.m (ns_update_menubar):
5128 * regex.c (regerror):
5129 Prefer memcpy to strncpy and strncat when either will do.
5130 * fileio.c (Fsubstitute_in_file_name):
5131 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5132 (menu_separator_name_p):
5133 * nsmenu.m (ns_update_menubar):
5134 Prefer memcmp to strncmp when either will do.
5135 * nsterm.m: Include <ftoastr.h>.
5136 (ns_get_color):
5137 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5138 Prefer snprintf to strncpy.
5139 * nsterm.m (ns_term_init):
5140 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5141 * nsterm.m (ns_term_init):
5142 Avoid the need for strncpy, by using build_string or
5143 make_unibyte_string directly. Use dtoastr, not snprintf.
5144 * process.c (Fmake_network_process): Diagnose service names that
5145 are too long, rather than silently truncating them or creating
5146 non-null-terminated names.
5147 (Fnetwork_interface_info): Likewise, for interface names.
5148 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5149 Prefer sprintf to strncat.
5150 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5151 Prefer vsnprintf to vsprintf + strncpy.
5152
c59592b3
GM
51532012-07-10 Glenn Morris <rgm@gnu.org>
5154
5155 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5156 Clarify fallback case.
5157
7d7bbefd
DA
51582012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5159
5160 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5161 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5162 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 5163 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
5164 where argument type is known to be a Lisp_Cons.
5165
3a4c8000
TT
51662012-07-10 Tom Tromey <tromey@redhat.com>
5167
5168 * bytecode.c (BYTE_CODE_THREADED): New macro.
5169 (BYTE_CODES): New macro. Replaces all old byte-code defines.
5170 (enum byte_code_op): New type.
5171 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5172 (exec_byte_code): Use them. Use token threading when applicable.
5173
2a0213a6
DA
51742012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5175
5176 Optimize pure C strings initialization.
5177 * lisp.h (make_pure_string): Fix prototype.
5178 (build_pure_c_string): New function, defined as static inline. This
5179 provides a better opportunity to optimize away calls to strlen when
5180 the function is called with compile-time constant argument.
5181 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
5182 argument, adjust users accordingly. Use build_pure_c_string where
5183 appropriate.
5184 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
5185 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
5186 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
5187
cb1caeaf
DA
51882012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5189
5190 Avoid calls to strlen in miscellaneous functions.
5191 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
5192 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
5193 * lread.c (openp): Likewise.
5194
c293e30c
DA
51952012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5196
5197 Avoid calls to strlen in path processing functions.
5198 * fileio.c (file_name_as_directory): Add comment. Change to add
5199 srclen argument and return the length of result. Adjust users
5200 accordingly.
5201 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
5202 swap 1st and 2nd arguments to obey the common convention.
5203 Adjust users accordingly.
c293e30c
DA
5204 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
5205
9e059e3f
GM
52062012-07-10 Glenn Morris <rgm@gnu.org>
5207
d02eb359
GM
5208 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
5209 Move PENDING_OUTPUT_COUNT definition to configure.
5210
882cf227
GM
5211 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
5212 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
5213 * s/gnu.h (DATA_START): Move definitions to configure.
5214
af6e839f
GM
5215 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
5216 We include usg5-4-common.h, which defines them both.
5217
40289a12
GM
5218 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
5219 O_RDONLY already includes it).
5220
9e059e3f
GM
5221 Stop ns builds setting the EMACSLOADPATH environment variable.
5222 * nsterm.m (ns_load_path): Rename from ns_init_paths.
5223 Now it does not set EMACSLOADPATH, just returns the load-path string.
5224 * nsterm.h: Update accordingly.
5225 * lread.c [HAVE_NS]: Include nsterm.h.
5226 (init_lread) [HAVE_NS]: Use ns_load_path.
5227 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
5228
7c4e8ec0
GM
52292012-07-09 Glenn Morris <rgm@gnu.org>
5230
d4f600ff
GM
5231 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
5232 since the included bsd-common.h does so.
5233
cbb31951
GM
5234 Stop ns builds setting the EMACSPATH environment variable.
5235 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
5236 (ns_init_paths): Do not set EMACSPATH.
5237 * nsterm.h (ns_exec_path): Add it.
5238 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
5239 Use ns_exec_path.
5240
7c4e8ec0
GM
5241 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
5242
26bccfae
PE
52432012-07-09 Paul Eggert <eggert@cs.ucla.edu>
5244
a0bee46f
PE
5245 * process.c (wait_reading_process_output): 'waitchannels' was unset
5246 when read_kbd || !NILP (wait_for_cell); fix this.
5247
5994c183
PE
5248 Add GCC-style 'const' attribute to functions that can use it.
5249 * character.h (char_resolve_modifier_mask):
5250 * keyboard.h (make_ctrl_char):
5251 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5252 (init_character_once, next_almost_prime, init_fns, init_image)
5253 (flush_pending_output, init_sound):
5254 * mem-limits.h (start_of_data):
5255 * menu.h (finish_menu_items):
5256 Add ATTRIBUTE_CONST.
5257 * emacs.c (DEFINE_DUMMY_FUNCTION):
5258 Declare the dummy function with ATTRIBUTE_CONST.
5259 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5260 Add decls with ATTRIBUTE_CONST.
5261
26bccfae
PE
5262 Minor improvements to make_formatted_string.
5263 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5264 where int is good enough, as vsprintf returns an int.
5265 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5266
a8290ec3
DA
52672012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5268
5269 Use make_formatted_string to avoid double length calculation.
5270 * lisp.h (make_formatted_string): New prototype.
5271 * alloc.c (make_formatted_string): New function.
5272 * buffer.c (Fgenerate_new_buffer_name): Use it.
5273 * dbus.c (syms_of_dbusbind): Likewise.
5274 * editfns.c (Fcurrent_time_zone): Likewise.
5275 * filelock.c (get_boot_time): Likewise.
5276 * frame.c (make_terminal_frame, set_term_frame_name)
5277 (x_report_frame_params): Likewise.
5278 * image.c (gs_load): Likewise.
5279 * minibuf.c (get_minibuffer): Likewise.
5280 * msdos.c (dos_set_window_size): Likewise.
5281 * process.c (make_process): Likewise.
5282 * xdisp.c (ensure_echo_area_buffers): Likewise.
5283 * xsettings.c (apply_xft_settings): Likewise.
5284
d01ba2f1
GM
52852012-07-09 Glenn Morris <rgm@gnu.org>
5286
5287 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5288 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5289 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5290 * nsterm.h (ns_etc_directory): Add it.
5291 * callproc.c [HAVE_NS]: Include nsterm.h.
5292 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5293
f1f924b6
DA
52942012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5295
5296 Move marker debugging code under MARKER_DEBUG.
5297 * marker.c (MARKER_DEBUG): Move marker debugging code under
5298 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5299 for bootstrap with --enable-checking (~3x slowdown reported
5300 by Juanma Barranquero <lekktu@gmail.com>).
5301 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5302
ab531b66
PE
53032012-07-08 Paul Eggert <eggert@cs.ucla.edu>
5304
5305 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5306 See <http://bugs.gnu.org/11825#29>.
5307
c4b3bc8a
EZ
53082012-07-08 Eli Zaretskii <eliz@gnu.org>
5309
5310 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5311 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
5312 (display_line): Add commentary about displaying truncation glyphs
5313 on GUI frames.
5314 (produce_special_glyphs): Move here from term.c.
5315
5316 * term.c (produce_special_glyphs): Move to xdisp.c.
5317
5318 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5319 section.
c4b3bc8a 5320
b676b881
AS
53212012-07-07 Andreas Schwab <schwab@linux-m68k.org>
5322
f17c5273
AS
5323 * xdisp.c (display_line): Avoid warning about implicit declaration
5324 of FRAME_FONT.
5325
298819b9
AS
5326 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5327
b676b881
AS
5328 * lisp.h: Remove empty conditional.
5329
6045c4fd
PE
53302012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5331
b3350bf9
PE
5332 * lread.c (load_path_check): Now static.
5333
6045c4fd
PE
5334 Fix some minor --with-ns problems found by static checking.
5335 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
5336 (x_set_font) [!HAVE_X_WINDOWS]:
5337 * image.c (xpm_load_image) [HAVE_NS]:
5338 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
5339 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
5340 Remove unused local.
5341 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
5342 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
5343 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
5344 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
5345 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
5346 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
5347 Fix pointer signedness problem.
5348 * xfaces.c (FRAME_X_FONT_TABLE):
5349 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
5350
929e7845
GM
53512012-07-07 Glenn Morris <rgm@gnu.org>
5352
5353 * lread.c (load_path_check): New function, split from init_lread.
5354 (init_lread): Reorganize. Motivation:
5355 If EMACSLOADPATH is set, check/warn about that rather than the
5356 defaults, which we are not going to use. Hence we can remove
5357 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
5358 Don't warn if site-lisp directories are missing.
5359 If not installed, start from a blank load-path, since
5360 PATH_LOADSEARCH refers to the eventual installation directories.
5361
58dd0aa4
EZ
53622012-07-07 Eli Zaretskii <eliz@gnu.org>
5363
5364 Support truncation and continuation glyphs on GUI frames, when
5365 fringes are disabled. (Bug#11832)
5366 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
5367 continuation glyphs even if on GUI frames.
5368 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
5369 or both, are absent.
5370 (start_display, move_it_in_display_line_to): Handle the case of a
5371 GUI frame without a fringe to display continuation or truncation
5372 glyphs.
5373 (insert_left_trunc_glyphs): Support GUI frames: make sure
5374 truncation glyphs overwrite enough glyphs from the current line to
5375 have sufficient space in pixels.
5376 (display_line): Support truncation and continuation glyphs on GUI
5377 frames. If some spare pixels are left on the line after inserting
5378 the truncation glyphs, fill that space with a stretch glyph of a
5379 suitably computed width.
5380
5381 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5382 produce_glyphs, to support GUI sessions.
5383
31571fd7
PE
53842012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5385
5a16b9bc
PE
5386 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5387
f3047c75
PE
5388 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5389
31571fd7
PE
5390 Do not require float-time's arg to fit in time_t (Bug#11825).
5391 This works better on hosts where time_t is unsigned, and where
5392 float-time is applied to the (negative) difference between two times.
5393 * editfns.c (decode_time_components): Last arg is now double *,
5394 not int *, and means to store all the result as a double, without
5395 worrying about whether the seconds part fits in time_t.
5396 All callers changed.
5397 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5398 All callers changed.
5399 (Ffloat_time): Do not fail merely because the specified time falls
5400 outside of time_t range.
5401
4516fbef
GM
54022012-07-07 Glenn Morris <rgm@gnu.org>
5403
5404 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5405 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5406 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5407
07adc2c6
JB
54082012-07-07 Juanma Barranquero <lekktu@gmail.com>
5409
5410 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5411 Update dependencies.
5412
5413 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5414
fd573f31
PE
54152012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5416
fee5959d
PE
5417 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5418 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5419 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5420 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5421 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5422 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5423
fd573f31
PE
5424 * xfont.c (compare_font_names): Redo to omit the need for casts.
5425
ddadbc0e
AS
54262012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5427
fca8d6b6
AS
5428 * xfns.c (Fx_change_window_property): Doc fix.
5429 * w32fns.c (Fx_change_window_property): Doc fix.
5430
ddadbc0e
AS
5431 * w32fns.c (Fx_window_property): Accept the same arguments as the
5432 X Windows version. Doc fix.
5433 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5434
ed9265fc 54352012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
5436 Eli Zaretskii <eliz@gnu.org>
5437
5438 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5439 Windows-specific code from nt/config.nt moved here.
5440 Obsolete settings removed.
5441
216ee680
PE
54422012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5443
5444 * process.c: Avoid unnecessary calls to gettime.
5445 (wait_reading_process_output): Don't get the time of day
5446 when gobbling data immediately and not waiting, as there's no need
5447 for it in that case. This removes a FIXME.
5448
bdd091e4
JD
54492012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5450
5451 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5452 is defined (Bug#11768).
5453
9d44f8ce
DA
54542012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5455
5456 Fix marker debugging code.
5457 * marker.c (byte_char_debug_check): Do not perform the check
5458 if buffer is not multibyte.
090bd7cb
JB
5459 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5460 Call byte_char_debug_check with correct arguments.
9d44f8ce 5461
90fc4786
DA
54622012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5463
5464 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
5465 * marker.c (byte_char_debug_check, count_markers):
5466 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
5467 (byte_debug_flag): Remove.
5468 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5469 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5470
7b7ae965
DA
54712012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5472
4e57b342
DA
5473 Avoid code repetition in marker-related functions.
5474 * marker.c (attach_marker): New function.
5475 (Fset_marker, set_marker_restricted, set_marker_both)
5476 (set_marker_restricted_both): Use it.
5477 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5478 Consistently rename charno to charpos.
5479 (marker_position): Add eassert.
5480 (marker_byte_position): Convert to eassert.
5481
54822012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5483
5484 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 5485 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 5486 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 5487
657924ff
DA
54882012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5489
5490 Introduce fast path for the widely used marker operation.
5491 * alloc.c (build_marker): New function.
5492 * lisp.h (build_marker): New prototype.
5493 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5494 * composite.c (autocmp_chars): Likewise.
5495 * editfns.c (buildmark): Remove.
5496 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5497 (save_restriction_save): Use build_marker.
5498 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5499 * window.c (save_window_save): Likewise.
5500
041a49a6
DA
55012012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5502
5503 Do not use Fdelete_overlay in delete_all_overlays
5504 to avoid redundant calls to unchain_overlay.
5505 * buffer.c (drop_overlay): New function.
5506 (delete_all_overlays, Fdelete_overlay): Use it.
5507 * minibuf.c (get_minibuffer): Fix comment.
5508
7dca65a4
PE
55092012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5510
5511 Port to OpenBSD 5.1 amd64.
5512 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5513 This is needed for OpenBSD, and should be harmless on all BSD systems.
5514 Also, include <sys/sysctl.h>, as it should be available on all
5515 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5516 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5517 use p_pid member, not kp_proc.pid.
5518
8eb876e2
GM
55192012-07-06 Glenn Morris <rgm@gnu.org>
5520
5521 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5522
38182d90
PE
55232012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5524
5525 More xmalloc and related cleanup.
5526 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5527 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5528 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5529 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5530 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5531 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5532 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5533 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5534 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5535 * xterm.c:
5536 Omit needless casts involving void * pointers and allocation.
5537 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5538 as the former is more robust if P's type is changed.
5539 Prefer xzalloc to xmalloc + memset 0.
5540 Simplify malloc-or-realloc to realloc.
5541 Don't worry about xmalloc returning a null pointer.
5542 Prefer xstrdup to xmalloc + strcpy.
5543 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5544 growing it.
5545 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5546 alloca of a constant.
5547
6dd5a677
EZ
55482012-07-05 Eli Zaretskii <eliz@gnu.org>
5549
5550 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5551 hscroll is larger than the line width. Fixes long and futile
5552 looping inside extend_face_to_end_of_line (on a TTY) producing
5553 glyphs that are not needed and thrown away.
5554
6b312f0f
DA
55552012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5556
5557 * marker.c (set_marker_restricted_both): Simplify by using
5558 clip_to_bounds.
5559
f520ef9b
PE
55602012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5561
5562 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5563
383b7c95
JD
55642012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5565
5566 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5567 not defined (Bug#11768).
5568 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5569 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5570 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5571 followed by gtk_box_set_homogeneous (Bug#11768).
5572 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
5573 (update_theme_scrollbar_width, xg_create_scroll_bar):
5574 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
5575 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5576 (is_box_type): New function (Bug#11768).
5577 (xg_tool_item_stale_p): Call is_box_type.
5293d758 5578 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
5579 with default display (Bug#11768).
5580
d6e7bf45
EZ
55812012-07-05 Eli Zaretskii <eliz@gnu.org>
5582
5583 * xdisp.c (window_hscroll_limited): New function.
5584 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5585 coordinates when window's hscroll is set to insanely large
5586 values. (Bug#11857)
5587
431391ec
JB
55882012-07-05 Juanma Barranquero <lekktu@gmail.com>
5589
5590 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5591 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5592
23f86fce
DA
55932012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5594
5595 Cleanup xmalloc.
5596 * lisp.h (xzalloc): New prototype. Omit needless casts.
5597 * alloc.c (xzalloc): New function. Omit needless casts.
5598 * charset.c: Omit needless casts. Convert all calls to
5599 xmalloc with following memset to xzalloc.
5600 * dispnew.c: Likewise.
5601 * fringe.c: Likewise.
5602 * image.c: Likewise.
5603 * sound.c: Likewise.
5604 * term.c: Likewise.
5605 * w32fns.c: Likewise.
5606 * w32font.c: Likewise.
5607 * w32term.c: Likewise.
5608 * xfaces.c: Likewise.
5609 * xfns.c: Likewise.
5610 * xterm.c: Likewise.
5611 * atimer.c: Omit needless casts.
5612 * buffer.c: Likewise.
5613 * callproc.c: Likewise.
5614 * ccl.c: Likewise.
5615 * coding.c: Likewise.
5616 * composite.c: Likewise.
5617 * doc.c: Likewise.
5618 * doprnt.c: Likewise.
5619 * editfns.c: Likewise.
5620 * emacs.c: Likewise.
5621 * eval.c: Likewise.
5622 * filelock.c: Likewise.
5623 * fns.c: Likewise.
5624 * gtkutil.c: Likewise.
5625 * keyboard.c: Likewise.
5626 * lisp.h: Likewise.
5627 * lread.c: Likewise.
5628 * minibuf.c: Likewise.
5629 * msdos.c: Likewise.
5630 * print.c: Likewise.
5631 * process.c: Likewise.
5632 * region-cache.c: Likewise.
5633 * search.c: Likewise.
5634 * sysdep.c: Likewise.
5635 * termcap.c: Likewise.
5636 * terminal.c: Likewise.
5637 * tparam.c: Likewise.
5638 * w16select.c: Likewise.
5639 * w32.c: Likewise.
5640 * w32reg.c: Likewise.
5641 * w32select.c: Likewise.
5642 * w32uniscribe.c: Likewise.
5643 * widget.c: Likewise.
5644 * xdisp.c: Likewise.
5645 * xmenu.c: Likewise.
5646 * xrdb.c: Likewise.
5647 * xselect.c: Likewise.
5648
0497dc44
PE
56492012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5650
5651 * fileio.c (time_error_value): Check the right error number.
5652 Problem reported by Troels Nielsen in
5653 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5654
356e7178
PE
56552012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5656
4e71fd89
PE
5657 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5658 This should be fixed in a better way; see Eli Zaretskii in
5659 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5660 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5661
f0941253
PE
5662 * fileio.c (time_error_value): Rename from special_mtime.
5663 The old name's problems were noted by Eli Zaretskii in
5664 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5665
065c9eb4
PE
5666 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5667 This variable's comment says Emacs needs at least one GDB-visible
5668 symbol of type enum pvec_type, to work around GDB problems.
5669 The symbol's value doesn't matter.
5670
356e7178
PE
5671 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5672 that causes compilation to fail on pre-C99 compilers.
5673
ed9265fc 56742012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
5675
5676 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5677 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5678
3884d954
DA
56792012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5680
d209e2fb 5681 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
5682 headers for buffer_defaults and buffer_local_symbols.
5683 Reported by Juanma Barranquero <lekktu@gmail.com>.
5684
ee28be33
SM
56852012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5686
5687 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5688 * lisp.h (enum pvec_type): Use fewer bits.
5689 (PSEUDOVECTOR_SIZE_BITS): New constant.
5690 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5691 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5692 change in pvec_type.
5693 (PSEUDOVECTOR_TYPEP): New macro.
5694 (TYPED_PSEUDOVECTORP): Use it.
5695 * fns.c (internal_equal): Adapt code to extract pvectype.
5696 * emacs.c (gdb_pvec_type): Update type.
5697 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5698 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5699 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5700 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5701 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5702 abusing vector->header.next.nbytes.
5703 (live_vector_p): Use PVEC_TYPE.
5704 (mark_object): Adapt code to extract pvectype. Use switch.
5705
c7f2cd7f
PE
57062012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5707
5708 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5709 Tighten new eassert a bit.
5710
8ce70ed2
DA
57112012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5712
5713 Fix compilation with --enable-gcc-warnings and -O1
5714 optimization level.
5715 * doprnt.c (doprnt): Change type of tem to int, initialize
5716 to avoid compiler warning. Add eassert.
5717 * search.c (simple_search): Initialize match_byte to avoid
5718 compiler warning. Add eassert.
5719
dea7f1e5
PE
57202012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5721
24a212eb
PE
5722 Avoid weird behavior with large horizontal scrolls.
5723 Without this change, for example, large hscroll values would
5724 mess up Emacs's display on Fedora 15 x86, presumably due to
5725 overflows in int calculations in the display code.
5726 Also, if buffers had long lines, Emacs would freeze.
5727 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5728 (set_window_hscroll): New function, containing the old guts of
5729 Fset_window_hscroll. Return the clipped value.
5730 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5731 This avoids the need to check against PTRDIFF_MAX.
5732
dea7f1e5
PE
5733 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5734
76046526
DA
57352012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5736
5737 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5738
39adff0d
PE
57392012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5740
63807d47
PE
5741 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5742 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5743 since GCC 4.4.6 issues a bogus warning for them.
5744
39adff0d
PE
5745 Fix bugs in file timestamp newness comparisons.
5746 * fileio.c (Ffile_newer_than_file_p):
5747 * lread.c (Fload): Use full timestamp resolution of files,
5748 not just the 1-second resolution, so that files that are only
5749 slightly newer still count as newer.
5750 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5751 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5752
dbeed9a6
PE
57532012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5754
5755 * fileio.c: Improve handling of file time marker. (Bug#11852)
5756 (special_mtime): New function.
5757 (Finsert_file_contents, Fverify_visited_file_modtime):
5758 Use it to set special mtime values consistently.
5759
636334d6
AS
57602012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5761
5762 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5763 marker for non-existing file. (Bug#11852)
5764
e2017fe2
GM
57652012-07-03 Glenn Morris <rgm@gnu.org>
5766
5767 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5768 and did not make it into globals.h).
5769
404dbd37
TT
57702012-07-03 Tom Tromey <tromey@redhat.com>
5771
5772 * window.c (Fset_window_margins, Fset_window_fringes)
5773 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5774 * textprop.c (Fprevious_property_change): No longer static.
5775 * syntax.c (Fsyntax_table_p): No longer static.
5776 * process.c (Fget_process, Fprocess_datagram_address): No longer
5777 static.
5778 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5779 * keyboard.c (Fcommand_execute): No longer static.
5780 Remove EXFUN.
5781 * insdel.c (Fcombine_after_change_execute): No longer static.
5782 * image.c (Finit_image_library): No longer static.
5783 * fileio.c (Fmake_symbolic_link): No longer static.
5784 * eval.c (Ffetch_bytecode): No longer static.
5785 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
5786 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5787 No longer static.
404dbd37
TT
5788 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5789 static.
5790 * dired.c (Ffile_attributes): No longer static.
5791 * composite.c (Fcomposition_get_gstring): No longer static.
5792 * callproc.c (Fgetenv_internal): No longer static.
5793
5794 * ccl.h: Remove EXFUNs.
5795 * buffer.h: Remove EXFUNs.
5796 * dispextern.h: Remove EXFUNs.
5797 * intervals.h: Remove EXFUNs.
5798 * fontset.h: Remove EXFUN.
5799 * font.h: Remove EXFUNs.
5800 * dosfns.c (system_process_attributes): Remove EXFUN.
5801 * keymap.h: Remove EXFUNs.
5802 * lisp.h: Remove EXFUNs.
5803 * w32term.h: Remove EXFUNs.
5804 * window.h: Remove EXFUNs.
5805 * xsettings.h: Remove EXFUN.
5806 * xterm.h: Remove EXFUN.
5807
8e4fd1e1
GM
58082012-07-03 Glenn Morris <rgm@gnu.org>
5809
5810 * lisp.h (Frandom): Make it visible to C.
5811 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5812 buffer for invisible buffers. (Bug#1229)
5813
ca95b3eb
DA
58142012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5815
5816 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5817 values which aren't power of 2.
14ae4239
BT
5818 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5819 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
5820 accordingly.
5821
7555c33f
SM
58222012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5823
5824 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5825
5826 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5827
d12e8f5a
DA
58282012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5829
5830 * alloc.c (allocate_vector_block): Remove redundant
5831 calls to mallopt if DOUG_LEA_MALLOC is defined.
5832 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5833 avoid calls to mallopt if zero_vector is returned.
5834
296094c3
DA
58352012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5836
5837 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5838 is enabled, avoid dereferencing NULL current_sblock if
5839 running undumped.
5840
36429c89
DA
58412012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5842
5843 Cleanup basic buffer management.
5844 * buffer.h (struct buffer): Change layout to use generic vector
5845 marking code. Fix some comments. Change type of 'clip_changed'
5846 to bitfield. Remove unused #ifndef old.
5847 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5848 (GET_OVERLAYS_AT): Fix indentation.
5849 (for_each_per_buffer_object_at): New macro.
5850 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5851 (Fbuffer_local_variables): Use it.
5852 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5853 * alloc.c (allocate_buffer): Adjust to match new layout of
5854 struct buffer. Fix comment.
5855 (mark_overlay): New function.
5856 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5857 Lisp area of struct buffer.
5858 (mark_object): Use it. Adjust marking of misc objects
5859 and related comments.
5860
3b3e4cac
PE
58612012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5862
5863 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5864 wrapper that is not needed because the wrapped code is a no-op (zero
5865 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5866 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5867
cf5c0175
DA
58682012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5869
5870 * alloc.c (mark_buffer): Simplify. Remove prototype.
5871 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 5872 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
5873 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5874 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 5875
ca26824c
GM
58762012-06-30 Glenn Morris <rgm@gnu.org>
5877
2e4c5312
GM
5878 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5879
ca26824c
GM
5880 * epaths.in (PATH_SITELOADSEARCH): New.
5881 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5882 This is rather than relying on --enable-locallisppath elements
5883 having "site-lisp" in their names. (Bug#10208#25, 11658)
5884
0d23c240
EZ
58852012-06-30 Eli Zaretskii <eliz@gnu.org>
5886
c9240d7a
EZ
5887 * w32proc.c (sys_select): Accept and ignore one more argument.
5888
5889 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5890
0d23c240 5891 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 5892 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
5893
5894 * sysdep.c: Don't include dos.h and dosfns.h.
5895
5896 * process.c (sys_select):
5897 * msdos.c (sys_select): Accept one more argument and ignore it.
5898
5899 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5900 adapt data types and code to that.
5901
5902 * dosfns.c:
5903 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5904 which clashes with the gnulib function of the same name.
5905
af5a5a98
AS
59062012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5907
c5e4379c
AS
5908 * font.c (font_style_to_value, font_style_symbolic)
5909 (font_prop_validate_style): Add type checks for values in
5910 font_style_table.
5911
af5a5a98
AS
5912 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5913 argument.
5914 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5915 uses.
5916
8d38f461
EZ
59172012-06-29 Eli Zaretskii <eliz@gnu.org>
5918
2e5a6631
EZ
5919 * xdisp.c (try_window_id): Undo last change.
5920
8d38f461
EZ
5921 * w32.c (getwd): Adjust commentary about startup_dir.
5922 (init_environment): Always call sys_access, even in non-MSVC
5923 builds. Don't chdir to the directory of the Emacs executable.
5924 This undoes code from 1997 which was justified by the need to
5925 "avoid conflicts when removing and renaming directories". But its
5926 downside was that every relative file name was being interpreted
5927 relative to the directory of the Emacs executable, which can never
5928 be TRT. In particular, it broke sys_access when called with
5929 relative file names.
5930 (sys_access): Map GetLastError to errno.
5931
2af3565e
DA
59322012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5933
5934 * window.h (struct window): Change type of 'fringes_outside_margins'
5935 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 5936 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
5937 Adjust comment.
5938 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5939 to ptrdiff_t.
5940
c8d3a25c 59412012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 5942
c8d3a25c
GM
5943 * gnutls.c (emacs_gnutls_handshake):
5944 Add QUIT to make the loop interruptible.
57570cd3 5945
c8d3a25c 59462012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 5947
c8d3a25c
GM
5948 * charset.c (init_charset): Make lack of etc/charsets fatal.
5949
3e984ee8
DA
59502012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5951
5952 * editfns.c (region_limit): Fix type mismatch.
5953
ef884f23
DA
59542012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5955
5956 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5957 undefined. Convert from xassert to eassert.
5958 * nsmenu.m: Convert from xassert to eassert.
5959 * nsterm.m: Likewise.
5960
7d7e0027
SM
59612012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5962
5963 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5964
aa754e6a
PE
59652012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5966
5967 Avoid integer overflow on scroll-left and scroll-right.
5968 * window.c (HSCROLL_MAX): New macro.
5969 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5970 overflow when requested scroll falls outside ptrdiff_t range.
5971
80b00b08
DA
59722012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5973
5974 * window.h (struct window): Change type of 'hscroll',
5975 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5976 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5977 Adjust users accordingly.
5978 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5979 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5980 from EMACS_INT to ptrdiff_t.
5981 (make_window): Omit redundant initialization.
5982
62b2bcf6
JB
59832012-06-28 Juanma Barranquero <lekktu@gmail.com>
5984
5985 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5986
45942c7d
DA
59872012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5988
5989 * window.h (struct window): Change type of 'use_time' and
5990 'sequence_number' from Lisp_Object to int.
5991 * frame.c (make_frame): Adjust users accordingly.
5992 * print.c (print_object): Likewise.
5993 * window.c (select_window, Fwindow_use_time, make_parent_window)
5994 (make_window): Likewise.
5995
e509cfa6
DA
59962012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5997
5998 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5999 enabled with --enable-checking=[all,glyphs] configure option.
6000 Fix GLYPH_DEBUG usage assuming that it may be undefined,
6001 adjust comments accordingly.
6002 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
6003 undefined, adjust comments accordingly.
6004 * image.c: Likewise.
6005 * scroll.c: Likewise.
6006 * w32fns.c: Likewise.
6007 * w32term.c: Likewise.
6008 * xdisp.c: Likewise.
6009 * xfaces.c: Likewise.
6010 * xfns.c: Likewise.
6011 * xterm.c: Likewise.
6012
a54e2c05
DA
60132012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6014
6015 Generalize run-time debugging checks.
6016 * dispextern.h (XASSERTS): Remove.
6017 * fontset.c (xassert): Remove.
6018 Convert from xassert to eassert.
6019 * alloc.c: Convert from xassert to eassert.
6020 * bidi.c: Likewise.
6021 * dispnew.c: Likewise.
6022 * fns.c: Likewise.
6023 * fringe.c: Likewise.
6024 * ftfont.c: Likewise.
6025 * gtkutil.c: Likewise.
6026 * image.c: Likewise.
6027 * keyboard.c: Likewise.
6028 * menu.c: Likewise.
6029 * process.c: Likewise.
6030 * scroll.c: Likewise.
6031 * sound.c: Likewise.
6032 * term.c: Likewise.
6033 * w32console.c: Likewise.
6034 * w32fns.c: Likewise.
6035 * w32term.c: Likewise.
6036 * window.c: Likewise.
6037 * xdisp.c: Likewise.
6038 * xfaces.c: Likewise.
6039 * xfns.c: Likewise.
6040 * xselect.c: Likewise.
6041 * xterm.c: Likewise.
6042
1ec4b7b2
SM
60432012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
6044
6045 * fns.c (maybe_resize_hash_table): Output message when growing the
6046 purify-hashtable.
6047
2014308a
DA
60482012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6049
6050 * alloc.c (allocate_string_data): Remove dead code.
6051 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
6052 avoid GCC warning about unused macro.
6053
246155eb
DA
60542012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6055
6056 * alloc.c (allocate_string): Omit intervals initialization.
6057 * alloc.c (make_uninit_multibyte_string): Initialize intervals
6058 as in make_pure_string and make_pure_c_string.
6059
43184b7b
DA
60602012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6061
d209e2fb 6062 * alloc.c (allocate_string): Fix last change.
43184b7b 6063
3fe6dd74
DA
60642012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6065
d209e2fb 6066 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
6067 to memset, add explicit initialization where appropriate.
6068
1ba6038a
GM
60692012-06-27 Glenn Morris <rgm@gnu.org>
6070
6071 * lisp.mk (lisp): Remove paths.elc.
6072
c89926a5
CY
60732012-06-27 Chong Yidong <cyd@gnu.org>
6074
6075 * doc.c (Fsubstitute_command_keys): Fix punctuation.
6076
ed6b3510
JW
60772012-06-26 John Wiegley <johnw@newartisans.com>
6078
1ec4b7b2 6079 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
6080 on Mac OS X Lion: __mod_init_func and __mod_term_func.
6081
ed6b3510
JW
6082 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6083 when building with Clang.
6084
8edd4a2b
SM
60852012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
6086
6087 * eval.c (Fapply): Allow calling it with a single argument.
6088
f6f62d1b
EZ
60892012-06-26 Eli Zaretskii <eliz@gnu.org>
6090
6091 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6092 _stricmp and _strnicmp.
6093 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6094
62efea5e
DA
60952012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6096
6097 * alloc.c (allocate_window): Zero out non-Lisp part of newly
6098 allocated window.
6099 (allocate_process): Likewise for new process.
8edd4a2b 6100 (allocate_terminal): Change to use offsetof.
62efea5e
DA
6101 (allocate_frame): Likewise.
6102 * frame.c (make_frame): Omit redundant initialization.
6103 * window.c (make_parent_window): Use memset.
6104 (make_window): Omit redundant initialization.
6105 * process.c (make_process): Omit redundant initialization.
6106 * terminal.c (create_terminal): Likewise.
6107
42997f4d
DA
61082012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6109
6110 * term.c (delete_tty): Remove redundant call to memset.
6111
1130ecfc
DA
61122012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6113
6114 * alloc.c: Remove build_string.
6115 * lisp.h: Define build_string as static inline. This provides
6116 a better opportunity to optimize away calls to strlen when the
6117 function is called with compile-time constant argument.
6118 * image.c (imagemagick_error): Convert to build_string.
6119 * w32proc.c (sys_spawnve): Likewise.
6120 * xterm.c (x_term_init): Likewise.
6121
cf38a720
PE
61222012-06-26 Paul Eggert <eggert@cs.ucla.edu>
6123
99027bdd
PE
6124 Use sprintf return value instead of invoking strlen on result.
6125 In the old days this wasn't portable, since some sprintf
6126 implementations returned char *. But they died out years ago and
6127 Emacs already assumes sprintf returns int.
6128 Similarly for float_to_string.
6129 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6130 * ccl.c (ccl_driver):
6131 * character.c (string_escape_byte8):
6132 * data.c (Fnumber_to_string):
6133 * doprnt.c (doprnt):
6134 * print.c (print_object):
6135 * xdisp.c (message_dolog):
6136 * xfns.c (syms_of_xfns):
6137 Use sprintf or float_to_string result to avoid need to call strlen.
6138 * data.c (Fnumber_to_string):
6139 Use make_unibyte_string, since the string must be ASCII.
6140 * lisp.h, print.c (float_to_string): Now returns int length.
6141 * term.c (produce_glyphless_glyph):
6142 Use sprintf result rather than recomputing it.
6143
cf38a720
PE
6144 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6145 * Makefile.in (ALL_CFLAGS):
6146 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6147 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6148
3511c784
DA
61492012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6150
0a08eb21 6151 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
6152 strcasecmp if available.
6153 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6154
fb7da12e
AS
61552012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6156
6157 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6158 Avoid comma operator.
6159 * menu.c (push_submenu_start, push_submenu_end)
6160 (push_left_right_boundary, push_menu_pane): Likewise.
6161 * msdos.c (dos_rawgetc): Likewise.
6162
afa2ffd8
DA
61632012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6164
6165 * xfns.c (xic_create_fontsetname): Remove redundant calls
6166 to memset.
6167
b3b4476b
PE
61682012-06-25 Paul Eggert <eggert@cs.ucla.edu>
6169
4495ff38
PE
6170 * gtkutil.c (get_utf8_string): Remove redundant assignment.
6171 sprintf already null-terminates its output.
6172
b3b4476b
PE
6173 * xfns.c (x_window): Remove redundant cast.
6174
b00876c9
DA
61752012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6176
6177 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6178 `const char *' to `char *' to avoid compiler warning.
6179
d188e26b
PE
61802012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6181
885d1d74
PE
6182 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6183 instead of truncating it to 63 (admittedly a generous limit).
6184
d188e26b
PE
6185 * process.c: Fix spelling and caps in comments.
6186
e2f560b1
DN
61872012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
6188
e86db54b 6189 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
6190 * sysdep.c (setpgrp): Remove definition, not used in this file.
6191
7583a3a1
JB
61922012-06-24 Juanma Barranquero <lekktu@gmail.com>
6193
6194 * makefile.w32-in: Update dependencies.
6195
696056c2
EZ
61962012-06-24 Eli Zaretskii <eliz@gnu.org>
6197
6198 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
6199 (SYSTIME_H): Add nt/inc/sys/time.h.
6200
6201 * systime.h [WINDOWSNT]: Include sys/time.h.
6202
6203 * s/ms-w32.h (struct timespec): Definition moved from
6204 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
6205
845ca893
PE
62062012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6207
6208 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
6209 * buffer.h (buffer_slot_type_mismatch):
6210 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6211 * eval.c (unwind_to_catch):
6212 * image.c (my_png_error, my_error_exit):
6213 * keyboard.c (quit_throw_to_read_char, user_error)
6214 (Fexit_recursive_edit, Fabort_recursive_edit):
6215 * lisp.h (die, args_out_of_range, args_out_of_range_3)
6216 (wrong_type_argument, buffer_overflow, __executable_start)
6217 (memory_full, buffer_memory_full, string_overflow, Fthrow)
6218 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
6219 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
6220 (fatal):
6221 (child_setup) [!DOS_NT]:
6222 * lread.c (end_of_file_error, invalid_syntax):
6223 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6224 * puresize.h (pure_write_error):
6225 * search.c (matcher_overflow):
6226 * sound.c (sound_perror, alsa_sound_perror):
6227 * sysdep.c, syssignal.h (croak):
6228 * term.c (maybe_fatal, vfatal):
6229 * textprop.c (text_read_only):
6230 * undo.c (user_error):
6231 * unexmacosx.c (unexec_error):
6232 * xterm.c (x_ins_del_lines, x_delete_glyphs):
6233 Use _Noreturn rather than NO_RETURN.
6234 No need for separate decl merely because of _Noreturn.
6235 * sound.c (sound_warning, parse_sound):
6236 Remove unnecessary forward decls.
6237
f1dd8073
PE
62382012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6239
6240 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
6241 * lisp.h (WAIT_READING_MAX): New macro.
6242 * dispnew.c (Fsleep_for, sit_for):
6243 * keyboard.c (kbd_buffer_get_event):
6244 * process.c (Faccept_process_output):
6245 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6246 This improves on the previous patch, which introduced a bug
6247 when time_t is unsigned and as wide as intmax_t.
6248 See <http://bugs.gnu.org/9000#51>.
6249
b82c1755
EZ
62502012-06-23 Eli Zaretskii <eliz@gnu.org>
6251
6252 * dispnew.c (sit_for, Fsleep_for):
6253 * keyboard.c (kbd_buffer_get_event):
6254 * process.c (Faccept_process_output): Avoid compiler warnings when
6255 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6256
ca300656
JB
62572012-06-23 Juanma Barranquero <lekktu@gmail.com>
6258
049ec95b
JB
6259 * makefile.w32-in: Update dependencies.
6260
ca300656
JB
6261 * w32.c (ltime): Add return type and declare static.
6262 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6263
db7b8d06
PE
62642012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6265
6266 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6267 Privately reported by Herbert J. Skuhra.
6268 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6269 All uses changed.
6270 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6271 not make_lisp_timeval, when the argument is of type EMACS_TIME.
6272
0bd8297f
EZ
62732012-06-23 Eli Zaretskii <eliz@gnu.org>
6274
96512555
EZ
6275 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6276 last argument of make_unibyte_string.
6277
0bd8297f
EZ
6278 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6279 language ID in the event parameters.
6280
6281 * w32term.c (w32_read_socket): Put the new keyboard codepage into
6282 event.code, not the obscure "character set ID".
6283
63def6b6
CY
62842012-06-23 Chong Yidong <cyd@gnu.org>
6285
6286 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6287
e8a02204
EZ
62882012-06-23 Eli Zaretskii <eliz@gnu.org>
6289
388cdec0
EZ
6290 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6291 * w32.c (fdutimens): New function.
6292
6293 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6294
6295 * s/ms-w32.h (pselect): Redirect to sys_select.
6296
6297 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6298
e8a02204
EZ
6299 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6300 in the logic of incrementing and decrementing the value of
6301 use_relocatable_buffers.
6302
d054f3fb
PE
63032012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6304
6305 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6306 Privately reported by Herbert J. Skuhra.
6307 [__FreeBSD__]: Remove "*/" typo after "#include".
6308 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6309 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6310 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6311 Don't assume EMACS_TIME and struct timeval are the same type.
6312
d35af63c
PE
63132012-06-22 Paul Eggert <eggert@cs.ucla.edu>
6314
6315 Support higher-resolution time stamps (Bug#9000).
6316 The time stamps are only nanosecond-resolution at the C level,
6317 since that's the best that any real-world system supports now.
6318 But they are picosecond-resolution at the Lisp level, as that's
6319 easy, and leaves room for future OS improvements.
6320
6321 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6322 (LIBES): Use it.
6323
6324 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6325 Don't get current time unless it's needed.
6326
6327 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6328 now provides it if it's absent.
6329 (start_atimer): Port to higher-res time stamps.
6330 Check for time stamp overflow. Don't get current time more
6331 often than is needed.
6332
6333 * buffer.h (struct buffer): Buffer modtime now has high resolution.
6334 Include systime.h, not time.h.
6335 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
6336
6337 * dired.c: Include stat-time.h.
6338 (Ffile-attributes): File times now have higher resolution.
6339
6340 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
6341 (struct image): Timestamp now has higher resolution.
6342
6343 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
6344 has at least microseconds now. All uses removed.
6345 (update_frame, update_single_window, update_window, update_frame_1)
6346 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 6347 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
6348
6349 * editfns.c (time_overflow): Now extern.
6350 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
6351 (float-time, Fformat_time_string, Fcurrent_time_string)
6352 (Fcurrent_time_zone): Accept and generate higher-resolution
6353 time stamps.
6354 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
6355 (decode_time_components, lisp_seconds_argument): New functions.
6356 (make_time): Now static.
6357 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
6358 Report an error if the time is invalid, rather than having the caller
6359 do that.
6360
6361 * fileio.c: Include <stat-time.h>
6362 (Fcopy_file): Copy higher-resolution time stamps.
6363 Prefer to set the time stamp via a file descriptor if that works.
6364 (Fset_file_times, Finsert_file_contents, Fwrite_region)
6365 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
6366 (Fvisited_file_modtime, Fset_visited_file_modtime):
6367 Support higher-resolution time stamps.
6368
6369 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6370
6371 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6372
6373 * image.c (prepare_image_for_display, clear_image_cache)
6374 (lookup_image): Port to higer-resolution time stamps.
6375
6376 * keyboard.c (start_polling, bind_polling_period):
6377 Check for time stamp overflow.
6378 (read_char, kbd_buffer_get_event, timer_start_idle)
6379 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6380 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6381 Port to higher-resolution time stamps. Do not assume time_t is signed.
6382 (decode_timer): New function. Timers are now vectors of length 9,
6383 not 8, to accommodate the picosecond component.
6384 (timer_check_2): Use it.
6385
6386 * nsterm.m (select_timeout, timeval_subtract): Remove.
6387 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6388 as they're a bit more accurate and handle overflow better.
6389 (ns_select): Change prototype to be compatible with pselect.
6390 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6391 * nsterm.h (ns_select): Adjust prototype.
6392
6393 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6394 us-resolution time stamps.
6395 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6396
6397 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6398
6399 * lisp.h (time_overflow): New decl.
6400 (wait_reading_process_output): First arg is now intmax_t, not int,
6401 to accommodate larger waits.
6402
6403 * process.h (struct Lisp_Process.read_output_delay):
6404 Now counts nanoseconds, not microseconds.
6405 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6406 EMACS_HAS_USECS.
6407 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6408 (wait_reading_process_output):
6409 Port to ns-resolution time stamps.
6410 (Faccept_process_output, wait_reading_process_output):
6411 Check for time stamp overflow. Do not assume time_t is signed.
6412 (select_wrapper): Remove; we now use pselect.
6413 (Fprocess_attributes): Now generates ns-resolution time stamps.
6414
6415 * sysdep.c: Include utimens.h. Don't include utime.h
6416 or worry about struct utimbuf; gnulib does that for us now.
6417 (gettimeofday): Remove; gnulib provides a substitute.
6418 (make_timeval): New function.
6419 (set_file_times): Now sets ns-resolution time stamps.
6420 New arg FD; all uses changed.
6421 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6422 (system_process_attributes):
6423 Now returns ns-resolution time stamp. All uses changed.
6424 Check for time stamp overflow.
6425
6426 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6427 provides a substitute now.
6428
6429 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6430 since it guarantees struct timespec.
6431 (EMACS_TIME): Now struct timespec, so that we can support
6432 ns-resolution time stamps.
6433 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6434 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6435 (EMACS_USECS): Remove.
6436 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6437 so multiply the arg by 1000 before storing it.
6438 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6439 New macros.
6440 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6441 Port to ns-resolution time stamps.
6442 (EMACS_TIME_NEG_P): Remove; replaced by....
6443 (EMACS_TIME_SIGN): New macro.
6444 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6445 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6446 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6447 (make_timeval, make_lisp_time, decode_time_components): New decls.
6448 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6449 that it mishandled time_t overflow. You can't compare by subtracting!
6450 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6451 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6452
6453 * term.c: Include <sys/time.h>.
6454 (timeval_to_Time): New function, for proper overflow wraparound.
6455 (term_mouse_position, term_mouse_click): Use it.
6456
6457 * undo.c (record_first_change): Support higher-resolution time stamps
6458 in the undo buffer.
6459 (Fprimitive_undo): Use them when restoring time stamps.
6460
6461 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6462 (w32_get_internal_run_time):
6463 Port to higher-resolution Emacs time stamps.
6464 (ltime): Now accepts single 64-bit integer, as that's more convenient
6465 for callers.
6466
6467 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6468
6469 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6470 for compatibility with pselect. Support ns-resolution time stamps.
6471
6472 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6473
6474 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6475 Check for time stamp overflow, and support ns-resolution time stamps.
6476
6477 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6478 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6479 (timeval_subtract): Remove; no longer needed.
6480 (XTflash, XTring_bell, x_wait_for_event):
6481 Port to ns-resolution time stamps. Don't assume time_t is signed.
6482
b6a92dfe
CY
64832012-06-22 Chong Yidong <cyd@gnu.org>
6484
6485 * xdisp.c (x_consider_frame_title): Revert last change.
6486
d251c37c
EZ
64872012-06-22 Eli Zaretskii <eliz@gnu.org>
6488
6489 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6490 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6491 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6492 staticidx goes up to 1597 out of 1600 = 0x640.)
6493
f10deafb
PE
64942012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6495
6496 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6497 Otherwise, the umask might be mistakenly 0 while handling input signals.
6498
ec6de1e2
SM
64992012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6500
6501 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6502
28be1ada
DA
65032012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6504
6505 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6506 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6507 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6508 access to `contents' member of Lisp_Vector objects with AREF and ASET
6509 where appropriate.
6510
c6bf3022
CY
65112012-06-19 Chong Yidong <cyd@gnu.org>
6512
6513 * frame.c (delete_frame): When selecting a frame on a different
6514 text terminal, do not alter the terminal's top-frame.
6515
6516 * xdisp.c (format_mode_line_unwind_data): Record the target
6517 frame's selected window and its terminal's top-frame.
6518 (unwind_format_mode_line): Restore them.
6519 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6520 Callers changed.
6521 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6522 since tty frames can be explicitly named.
6523 (prepare_menu_bars): Likewise.
6524
6525 * term.c (Ftty_top_frame): New function.
6526
defd4196
PE
65272012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6528
6529 Port byte-code-meter to modern targets.
6530 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6531 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 6532 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
6533 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6534 (METER_1, METER_2): Simplify.
6535
1053a871
SM
65362012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6537
6538 * data.c (Fdefalias): Return `symbol' (bug#11686).
6539
b7e8d081
MR
65402012-06-18 Martin Rudalics <rudalics@gmx.at>
6541
6542 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
6543 gets killed during executing of this function (Bug#11665).
6544 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
6545 (Vkill_buffer_query_functions): In doc-string say that functions
6546 run by this hook should not change the current buffer.
6547
7ea2b339
PE
65482012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6549
6550 Fix recently-introduced process.c problems found by static checking.
6551 * process.c (write_queue_push, write_queue_pop, send_process):
6552 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6553 (write_queue_pop): Fix pointer signedness problem.
6554 (send_process): Remove unused local.
6555
96a313a1
CY
65562012-06-17 Chong Yidong <cyd@gnu.org>
6557
6558 * xdisp.c (redisplay_internal): No need to redisplay terminal
6559 frames that are not on top.
6560
20ca2e94
TN
65612012-06-17 Troels Nielsen <bn.troels@gmail.com>
6562
6563 * process.c (make_process): Initialize write_queue.
6564 (write_queue_push, write_queue_pop): New functions.
6565 (send_process): Use them to maintain correct ordering of process
6566 writes (Bug#10815).
6567
9a900ca9
PE
65682012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6569
310fbfa8
PE
6570 * lisp.h (eassert): Assume C89 or later.
6571 This removes the need for CHECK.
6572 (CHECK): Remove. Its comments about always evaluating its
6573 argument were confusing, as 'eassert' typically does not evaluate
6574 its argument.
6575
27bb1ca4
PE
6576 * coding.c (produce_chars): Use ptrdiff_t, not int.
6577
9a900ca9
PE
6578 * xterm.c (x_draw_underwave): Check for integer overflow.
6579 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6580
41b7f8bc 65812012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
6582
6583 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6584 referenced (Bug#11583).
6585
9b0e3eba
AA
65862012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6587
6588 Implement wave-style variant of underlining.
6589 * dispextern.h (face_underline_type): New enum.
6590 (face): Add field for underline type.
6591 * nsterm.m (ns_draw_underwave): New function.
6592 (ns_draw_text_decoration): Use it.
6593 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6594 New functions.
6595 (x_draw_glyph_string): Use them.
6596 * xfaces.c (Qline, Qwave): New Lisp objects.
6597 (check_lface_attrs, merge_face_ref)
1053a871
SM
6598 (Finternal_set_lisp_face_attribute, realize_x_face):
6599 Handle wave-style underline face attributes.
9b0e3eba
AA
6600 * xterm.c (x_draw_underwave): New function.
6601 (x_draw_glyph_string): Use it.
6602
0fb52f11
JB
66032012-06-16 Juanma Barranquero <lekktu@gmail.com>
6604
6605 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6606 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6607 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6608 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6609 ($(BLD)/w32select.$(O)): Update dependencies.
6610
e5560ff7
AS
66112012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6612
6613 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6614 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6615 * character.c (_fetch_multibyte_char_p): Remove.
6616 * alloc.c: Include "character.h" before "buffer.h".
6617 * bidi.c: Likewise.
6618 * buffer.c: Likewise.
6619 * bytecode.c: Likewise.
6620 * callint.c: Likewise.
6621 * callproc.c: Likewise.
6622 * casefiddle.c: Likewise.
6623 * casetab.c: Likewise.
6624 * category.c: Likewise.
6625 * cmds.c: Likewise.
6626 * coding.c: Likewise.
6627 * composite.c: Likewise.
6628 * dired.c: Likewise.
6629 * dispnew.c: Likewise.
6630 * doc.c: Likewise.
6631 * dosfns.c: Likewise.
6632 * editfns.c: Likewise.
6633 * emacs.c: Likewise.
6634 * fileio.c: Likewise.
6635 * filelock.c: Likewise.
6636 * font.c: Likewise.
6637 * fontset.c: Likewise.
6638 * fringe.c: Likewise.
6639 * indent.c: Likewise.
6640 * insdel.c: Likewise.
6641 * intervals.c: Likewise.
6642 * keyboard.c: Likewise.
6643 * keymap.c: Likewise.
6644 * lread.c: Likewise.
6645 * macros.c: Likewise.
6646 * marker.c: Likewise.
6647 * minibuf.c: Likewise.
6648 * nsfns.m: Likewise.
6649 * nsmenu.m: Likewise.
6650 * print.c: Likewise.
6651 * process.c: Likewise.
6652 * regex.c: Likewise.
6653 * region-cache.c: Likewise.
6654 * search.c: Likewise.
6655 * syntax.c: Likewise.
6656 * term.c: Likewise.
6657 * textprop.c: Likewise.
6658 * undo.c: Likewise.
6659 * unexsol.c: Likewise.
6660 * w16select.c: Likewise.
6661 * w32fns.c: Likewise.
6662 * w32menu.c: Likewise.
6663 * window.c: Likewise.
6664 * xdisp.c: Likewise.
6665 * xfns.c: Likewise.
6666 * xmenu.c: Likewise.
6667 * xml.c: Likewise.
6668 * xselect.c: Likewise.
6669
2f07e6af
EZ
66702012-06-16 Eli Zaretskii <eliz@gnu.org>
6671
1053a871
SM
6672 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6673 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 6674 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
6675 row.
6676 (handle_face_prop): Use chunk-relative overlay string index when
6677 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
6678 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6679 the rightmost. (Bug#11720)
2f07e6af 6680
29b83cec
AS
66812012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6682
6683 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6684 (CATEGORY_MEMBER): Enforce 1/0 value.
6685 * category.c (_temp_category_set): Remove.
6686
4c5501e9
EZ
66872012-06-16 Eli Zaretskii <eliz@gnu.org>
6688
6689 * window.c (Fdelete_other_windows_internal)
6690 (Fdelete_window_internal): Don't access frame's mouse highlight
6691 info of the initial frame. (Bug#11677)
6692
2b570124
PE
66932012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6694
e93864f9
PE
6695 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6696 Assume USE_2_TAGS_FOR_INTS.
6697 (xreload): Adjust $tagmask width to match recent lisp.h change.
6698
2b570124
PE
6699 Simplify lisp.h in minor ways that should not affect code.
6700 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6701 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6702 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6703 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6704 (INTTYPEBITS): New macro, for clarity.
6705 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
6706 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6707 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
6708 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6709 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6710
81755f69
JB
67112012-06-13 Juanma Barranquero <lekktu@gmail.com>
6712
6713 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6714
16192a57
GM
67152012-06-13 Glenn Morris <rgm@gnu.org>
6716
6717 * s/bsd-common.h (BSD4_3):
6718 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6719
646b5f55
AS
67202012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6721
6722 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6723 instead of union.
6724 (XLI, XIL): Define.
1053a871
SM
6725 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6726 Use them.
6727 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 6728 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 6729 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
6730 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6731 * frame.c (delete_frame): Remove outdated comment.
6732 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6733 USE_LISP_UNION_TYPE.
6734 (Fw32_unregister_hot_key): Likewise.
6735 (Fw32_toggle_lock_key): Likewise.
6736 * w32menu.c (add_menu_item): Likewise.
6737 (w32_menu_display_help): Use XIL instead of checking
6738 USE_LISP_UNION_TYPE.
6739 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6740 (init_heap): Likewise.
6741 * w32term.c (w32_read_socket): Update comment.
6742
1d3823c9
GM
67432012-06-13 Glenn Morris <rgm@gnu.org>
6744
c62ff706
GM
6745 * s/usg5-4-common.h, src/s/unixware.h:
6746 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6747
1d3823c9
GM
6748 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6749
bfe3e0a2
PE
67502012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6751
6752 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6753 * alloc.c (make_number) [!defined make_number]:
6754 Remove, as lisp.h always defines this now.
6755 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6756 (roundup_size): Verify that it is a power of 2.
6757 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6758 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6759 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6760 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6761 USE_LSB_TAG now is always defined to be either 0 or 1.
6762 All uses changed.
6763 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6764 code works fine either way, and efficiency is not a concern here,
6765 as the union type is for debugging, not for production.
6766 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6767 Use an inline function on all platforms when using the union type,
6768 since this is simpler and 'static inline' can be used portably
6769 within Emacs now.
6770 (LISP_INITIALLY_ZERO): New macro.
6771 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6772 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6773
45fa9c0f
GM
67742012-06-12 Glenn Morris <rgm@gnu.org>
6775
b4492cba
GM
6776 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6777
6778 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 6779
45fa9c0f
GM
6780 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6781 Move BROKEN_SIGIO to configure.
6782
6783 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6784 Move NO_TERMIO to configure.
6785
0e25d334
CY
67862012-06-12 Chong Yidong <cyd@gnu.org>
6787
6788 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6789 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6790 MagickExportImagePixels is undefined.
6791
43682bb6
PE
67922012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6793
6794 * image.c (imagemagick_load_image): Remove unused label.
6795
a9be7d2b
GM
67962012-06-11 Glenn Morris <rgm@gnu.org>
6797
6798 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6799 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6800 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6801 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6802
3017f87f
SM
68032012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6804
6805 * alloc.c (make_byte_code): New function.
6806 (Fmake_byte_code): Use it. Don't purify here.
6807 * lread.c (read1): Use it as well to avoid extra allocation.
6808
1b9b4cf4
CY
68092012-06-11 Chong Yidong <cyd@gnu.org>
6810
6811 * image.c (imagemagick_load_image): Implement transparency.
6812
95988fcf
AS
68132012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6814
6815 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6816 account for preceding backslashes. (Bug#11663)
6817
cd4eb164
CY
68182012-06-09 Chong Yidong <cyd@gnu.org>
6819
6820 * term.c: Support italics in capable terminals (Bug#9652).
6821 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6822 (turn_on_face): Output using TS_enter_italic_mode if available.
6823 Don't handle unused blinking and alt-charset cases.
6824 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6825 and tty_alt_charset_p cases.
6826 (tty_capable_p, init_tty): Support italics.
6827
6828 * termchar.h (struct tty_display_info): Add field for italics.
6829 Remove unused blink field.
6830
6831 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6832 Handle slant.
6833
6834 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6835 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6836 tty_alt_charset_p. Add tty_italic_p.
6837
ff88beb8
MA
68382012-06-09 Michael Albinus <michael.albinus@gmx.de>
6839
6840 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6841 dbus_type_is_basic if available.
6842 (xd_extract_signed, xd_extract_unsigned): Rename from
6843 extract_signed and extract_unsigned, respectively. Adapt callers.
6844
44286096
CY
68452012-06-09 Chong Yidong <cyd@gnu.org>
6846
1682701f
CY
6847 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6848
44286096
CY
6849 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6850 case (Bug#9752).
6851
d86feb17
PE
68522012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6853
6854 * xdisp.c (vmessage): Treat frame message as multibyte.
6855 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6856 would generate the diagnostic "Making \302\247 buffer-local while
6857 let-bound!".
6858
d5c20fe8
EZ
68592012-06-08 Eli Zaretskii <eliz@gnu.org>
6860
6861 * dispnew.c (showing_window_margins_p): Undo last change, which
6862 was done due to an inadvertent commit.
6863 (adjust_frame_glyphs_for_frame_redisplay): Do call
6864 showing_window_margins_p.
6865
513749ee
SM
68662012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6867
6868 * eval.c (Fmake_var_non_special): New primitive.
6869 (syms_of_eval): Defsubr it.
6870 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6871
d4a8f5c1
JB
68722012-06-08 Juanma Barranquero <lekktu@gmail.com>
6873
6874 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6875 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6876
8bbbc977
EZ
68772012-06-08 Eli Zaretskii <eliz@gnu.org>
6878
6879 * alloc.c (allocate_vectorlike): Fix last change.
6880
f3372c87
DA
68812012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6882
6883 Block-based vector allocation of small vectors.
6884 * lisp.h (struct vectorlike_header): New field `nbytes',
6885 adjust comment accordingly.
6886 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 6887 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
6888 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6889 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6890 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6891 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6892 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6893 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6894 (roundup_size): New constant.
6895 (struct vector_block): New data type.
6896 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 6897 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
6898 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6899 (sweep_vectors): New functions.
6900 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 6901 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
6902 or equal to VBLOCK_BYTES_MAX.
6903 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6904 (init_alloc_once): Add call to init_vectors.
6905
4f18a4ed
SM
69062012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6907
6908 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6909
86f158bc
PE
69102012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6911
6912 * doprnt.c (doprnt): Truncate multibyte char correctly.
6913 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6914 would mishandle a string argument "Xc" if X was a multibyte
6915 character of length 2: it would truncate after X's first byte
6916 rather than including all of X.
6917
c5cfcbe0
CY
69182012-06-06 Chong Yidong <cyd@gnu.org>
6919
6920 * buffer.c (word_wrap): Doc fix.
6921
c05cf390
PE
69222012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6923
6924 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6925
0c3461de
GM
69262012-06-03 Glenn Morris <rgm@gnu.org>
6927
6928 * xdisp.c (tool-bar-style): Doc fix.
6929
c71232db
UM
69302012-06-03 Ulrich Müller <ulm@gentoo.org>
6931
6932 * Makefile.in (PAXCTL): Define.
6933 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6934 binary via PaX flags if the paxctl utility is available.
6935 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6936 Restore PaX flags to their default. (Bug#11398)
6937
383f7350
CY
69382012-06-03 Chong Yidong <cyd@gnu.org>
6939
6940 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6941 buffer (Bug#11226).
6942
5f2c76c6
CY
69432012-06-03 Chong Yidong <cyd@gnu.org>
6944
6945 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6946 (note_mode_line_or_margin_highlight): If there is no help echo,
6947 use mode-line-default-help-echo. Handle the case where the mouse
6948 position is past the end of the mode line string.
6949
6950 * buffer.c (buffer_local_value_1): New function, split from
6951 Fbuffer_local_value; can return Qunbound.
6952 (Fbuffer_local_value): Use it.
6953 (Vmode_line_format): Docstring tweaks.
6954
773d47f6
PE
69552012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6956
6957 * sysdep.c (system_process_attributes): Improve comment.
6958
f2d6a3df
SM
69592012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6960
6961 * keyboard.c: Export real-this-command to Elisp.
6962 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6963 and DEFVAR it. Update all users.
6964
63810350
PE
69652012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6966
7bd5c1f4
PE
6967 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6968
63810350
PE
6969 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6970 Convert pctcpu and pctmem to Lisp float properly.
6971 Let the compiler fold better, as 100.0/0x8000 is exact.
6972
a2821611
AS
69732012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6974
6975 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6976 cons_block.
6977
5fceba1d
PE
69782012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6979
6980 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6981
c98ff5dd
DA
69822012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6983
6984 For a 'struct window', replace some Lisp_Object fields to
6985 bitfields where appropriate, remove unused fields.
6986 * window.h (struct window): Remove unused 'last_mark_x' and
6987 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6988 change it's type from Lisp_Object to bitfield.
6989 Change type of 'force_start', 'optional_new_start',
6990 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 6991 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 6992
ca34e0be
PE
69932012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6994
6995 Pacify gcc -Wdouble-precision when using Xaw.
6996 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6997 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6998 Use 'float' consistently, rather than 'float' in most places
6999 and 'double' in a couple of places.
7000
efc00ab1 70012012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
7002
7003 * xdisp.c (handle_stop): Detect whether we have overlay strings
7004 loaded by testing it->current.overlay_string_index to be
7005 non-negative, instead of checking whether n_overlay_strings is
7006 positive. (Bug#11587)
7007
efc00ab1 70082012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
7009
7010 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
7011
7012 * doc.c (Fsubstitute_command_keys): Doc fix.
7013
efc00ab1 70142012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
7015
7016 * search.c (search_buffer): Remove calls to
7017 r_alloc_inhibit_buffer_relocation, as it is now called by
7018 maybe_unify_char, which was the cause of relocation of buffer text
7019 in bug#11519.
7020
efc00ab1 70212012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
7022
7023 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
7024 for the duration of call to load_charset, to avoid problems with
7025 callers of maybe_unify_char that access buffer text through C
7026 pointers.
7027
7028 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
7029 decrement the inhibition flag, instead of just setting or
7030 resetting it.
7031
ba93a187
PE
70322012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7033
7034 Remove obsolete '#define static' cruft.
7035 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
7036 This #undef was "temporary" in 2000; it is no longer needed
7037 now that '#define static' has gone away.
7038 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
7039 (gray_bitmap_bits): Remove; no longer needed.
7040 All uses replaced with definiens.
7041 * xterm.c: Include "bitmaps/gray.xbm".
7042
9e4bf381
PE
70432012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7044
7045 Clean up __executable_start, monstartup when --enable-profiling.
7046 The following changes affect the code only when profiling.
7047 * dispnew.c (__executable_start): Rename from safe_bcopy.
7048 Define only on platforms that need it.
7049 * emacs.c: Include <sys/gmon.h> when profiling.
7050 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
7051 (__executable_start): Remove decl, since lisp.h does it now.
7052 (safe_bcopy): Remove decl; no longer has that name.
7053 (main): Coalesce #if into single bit of code, for simplicity.
7054 Cast pointers to uintptr_t, since standard libraries want integers
7055 and not pointers.
7056 * lisp.h (__executable_start): New decl.
7057
32d72c2f
GM
70582012-05-31 Glenn Morris <rgm@gnu.org>
7059
7060 * image.c (Fimagemagick_types): Doc fix.
7061
baac5bc7
JM
70622012-05-30 Jim Meyering <meyering@redhat.com>
7063
7064 * callproc.c (Fcall_process_region): Include directory component
7065 in mkstemp error message (Bug#11586).
7066
72cb32cf
PE
70672012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7068
7069 * alloc.c, lisp.h (make_pure_vector): Now static.
7070
61b108cc
SM
70712012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
7072
7073 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7074 Move to byte-run.el.
7075 (Fautoload): Do the hash-doc more carefully.
7076 * data.c (Fdefalias): Purify definition, except for keymaps.
7077 (Qdefun): Move from eval.c.
7078 * lisp.h (Qdefun): Remove.
7079 * lread.c (read1): Tiny simplification.
7080
471fe23d
TN
70812012-05-29 Troels Nielsen <bn.troels@gmail.com>
7082
934f3f58 7083 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
7084 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7085 Bug#9642, but explicitly check that the buffer the overlay would
7086 be moved to is live and rearrange lines to make sure that errors
7087 will not put the overlay in an inconsistent state.
7088 (Fdelete_overlay): Cosmetics.
7089
85d0efd1
EZ
70902012-05-28 Eli Zaretskii <eliz@gnu.org>
7091
7092 * w32term.c (my_bring_window_to_top): New function.
7093 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
7094 could be different from the original one.
7095 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
7096 (Bug#11513)
7097
7098 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7099 by calling BringWindowToTop.
7100
7101 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
7102 (WM_EMACS_END): Increase by one.
7103
da92a98c
PE
71042012-05-28 Paul Eggert <eggert@cs.ucla.edu>
7105
7106 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
7107 This avoids undefined behavior that might cause the eassert
7108 to not catch an out-of-range value.
7109
74d1f848
JB
71102012-05-28 Juanma Barranquero <lekktu@gmail.com>
7111
7112 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7113 Update dependencies.
7114
9e1a06fc
EZ
71152012-05-27 Eli Zaretskii <eliz@gnu.org>
7116
7117 * bidi.c (bidi_mirror_char): Fix last change.
7118
f3dd7312
AS
71192012-05-27 Andreas Schwab <schwab@linux-m68k.org>
7120
7121 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7122 when referring to sectname field in printf format.
7123
81899c91
PE
71242012-05-27 Paul Eggert <eggert@cs.ucla.edu>
7125
57b81a9f
PE
7126 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7127 Only r_alloc_inhibit_buffer_relocation needed to be added;
7128 the others were already declared.
7129
81899c91
PE
7130 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7131 before checking whether it's out of range. Put the check inside
7132 eassert. See
7133 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7134
33017faf 71352012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
7136
7137 * callproc.c (Fcall_process): Restore a line that was accidentally
7138 commented out in the 2011-02-13 change (bug#11547).
7139
33017faf 71402012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
7141
7142 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7143 defined on ralloc.c.
7144
7145 * buffer.c [REL_ALLOC]: Remove prototypes of
7146 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7147 they are now on lisp.h.
7148
7149 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7150
7151 * search.c (search_buffer): Use it to inhibit relocation of buffer
7152 text while re_search_2 is doing its job, because re_search_2 is
7153 passed C pointers to buffer text. (Bug#11519)
7154
23415acf
EZ
7155 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7156 Update value to 24.
7157
44e27368
EZ
7158 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7159 state after an additional call to move_it_in_display_line_to, keep
7160 the values of it->max_ascent and it->max_descent found for the
7161 entire line.
7162 (pos_visible_p): Revert the comparison against bottom_y to what it
7163 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7164 (Bug#11464)
7165
c1892f11
PE
71662012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7167
7168 Fix coding-related core dumps with gcc -ftrapv.
7169 The code was computing A - B, where A and B are pointers, and B is
7170 random garbage. This can lead to core dumps on platforms that
7171 have special pointer registers, and it also leads to core dumps on
7172 x86-64 when compiled with gcc -ftrapv. The fix is to compute
7173 A - B only when B is initialized properly.
7174 * coding.c (coding_set_source, coding_set_destination): Return void.
7175 (coding_change_source, coding_change_destinations): New functions,
7176 with the old behaviors of coding_set_source and coding_set_destination.
7177 All callers that need an offset changed to use these new functions.
7178
eb7afdad
GM
71792012-05-26 Glenn Morris <rgm@gnu.org>
7180
7181 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
7182
f12fdf02
EZ
71832012-05-26 Eli Zaretskii <eliz@gnu.org>
7184
53a63be6 7185 Extend mouse support on W32 text-mode console.
61b108cc
SM
7186 * xdisp.c (draw_row_with_mouse_face):
7187 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 7188
eb3f6f01 7189 * w32console.c: Include window.h.
61b108cc
SM
7190 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
7191 New functions.
eb3f6f01
EZ
7192 (initialize_w32_display): Initialize mouse-highlight data.
7193
53a63be6
EZ
7194 * w32inevt.c: Include termchar.h and window.h.
7195 (do_mouse_event): Support mouse-autoselect-window. When the mouse
7196 moves, call note_mouse_highlight. If help_echo changed, call
7197 gen_help_event to produce help-echo message in the echo area.
7198 Call clear_mouse_face if mouse_face_hidden is set in the mouse
7199 highlight info.
7200
4cfd81f6
PE
72012012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7202
7203 * lread.c (read1): Simplify slightly to avoid an overflow warning
7204 with GCC 4.7.0 on x86-64.
7205
4446092a
EZ
72062012-05-26 Eli Zaretskii <eliz@gnu.org>
7207
7208 * bidi.c (bidi_mirror_char): Revert last change: an int is
7209 definitely wide enough here.
7210
42b2a986 72112012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 7212
42b2a986 7213 Fix integer width and related bugs (Bug#9874).
eb106a49 7214 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
7215 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
7216 (string_bytes, check_sblock, allocate_string_data):
7217 (compact_small_strings, Fmake_bool_vector, make_string)
7218 (make_unibyte_string, make_multibyte_string)
7219 (make_string_from_bytes, make_specified_string)
7220 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
7221 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
7222 (mark_vectorlike):
7223 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7224 (allocate_pseudovector):
7225 Use int, not EMACS_INT, where int is wide enough.
7226 (inhibit_garbage_collection, Fgarbage_collect):
7227 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7228 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
7229 int might not be wide enough.
7230 (bidi_cache_search, bidi_cache_find, bidi_init_it)
7231 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
7232 (bidi_at_paragraph_end, bidi_find_paragraph_start)
7233 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7234 (bidi_level_of_next_char, bidi_move_to_visually_next):
7235 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7236 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
7237 (Fkill_buffer, Fset_buffer_major_mode)
7238 (advance_to_char_boundary, Fbuffer_swap_text)
7239 (Fset_buffer_multibyte, overlays_at, overlays_in)
7240 (overlay_touches_p, struct sortvec, record_overlay_string)
7241 (overlay_strings, recenter_overlay_lists)
7242 (adjust_overlays_for_insert, adjust_overlays_for_delete)
7243 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
7244 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
7245 (Foverlay_recenter, last_overlay_modification_hooks_used)
7246 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7247 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
7248 (validate_region): Omit unnecessary test for b <= e,
7249 since that's guaranteed by the previous test.
d311d28c
PE
7250 (adjust_overlays_for_delete): Avoid pos + length overflow.
7251 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7252 (report_overlay_modification):
7253 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7254 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7255 Omit pointer cast, which isn't needed anyway, and doesn't work
7256 after the EMACS_INT -> ptrdiff_t change.
02481186 7257 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
7258 * buffer.h: Adjust decls to match defn changes elsewhere.
7259 (struct buffer_text, struct buffer):
7260 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7261 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
7262 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7263 not int, to avoid needless 32-bit limit on 64-bit hosts.
7264 (exec_byte_code): Use tighter memory-full test, one that checks
7265 for alloca overflow. Don't compute the address of the object just
7266 before an array, as that's not portable. Use EMACS_INT, not
7267 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
7268 * callint.c (Fcall_interactively):
7269 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7270 * callproc.c (call_process_kill, Fcall_process):
7271 Don't assume pid_t fits into an Emacs fixnum.
7272 (call_process_cleanup, Fcall_process, child_setup):
7273 Don't assume pid_t fits into int.
7274 (call_process_cleanup, Fcall_process, delete_temp_file)
7275 (Fcall_process_region):
7276 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7277 (Fcall_process): Simplify handling of volatile integers.
7278 Use int, not EMACS_INT, where int will do.
7279 * casefiddle.c (casify_object, casify_region, operate_on_word)
7280 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7281 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7282 (casify_object): Avoid integer overflow when overallocating buffer.
7283 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 7284 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
7285 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7286 * category.h (CATEGORYP): Don't assume arg is nonnegative.
7287 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7288 integers are now checked earlier. All uses replaced with XINT.
7289 (ccl_driver):
7290 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7291 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
7292 (ccl_driver, Fregister_code_conversion_map):
7293 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
7294 (resolve_symbol_ccl_program): Check that vector header is in range.
7295 Always copy the vector, so that we can check its contents reliably
7296 now rather than having to recheck each instruction as it's being
7297 executed. Check that vector words fit in 'int'.
7298 (ccl_get_compiled_code, Fregister_ccl_program)
7299 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7300 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7301 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7302 contents are in range.
7303 (Fccl_execute_on_string): Check that status is in range.
7304 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7305 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7306 Accept and return EMACS_INT, not int, because callers can pass values
7307 out of 'int' range.
7308 (c_string_width, strwidth, lisp_string_width, chars_in_text)
7309 (multibyte_chars_in_text, parse_str_as_multibyte)
7310 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7311 (str_as_unibyte, str_to_unibyte, string_count_byte8)
7312 (string_escape_byte8, Fget_byte):
7313 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 7314 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
7315 avoid mishandling large integers.
7316 * character.h: Adjust decls to match defn changes elsewhere.
7317 * charset.c (load_charset_map_from_file, find_charsets_in_text)
7318 (Ffind_charset_region):
7319 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7320 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7321 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 7322 Don't assume fixnum fits in int.
d311d28c
PE
7323 (load_charset_map_from_vector, Fmap_charset_chars):
7324 Remove now-unnecessary CHECK_NATNUMs.
7325 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
7326 Don't rely on undefined behavior with signed left shift overflow.
7327 Don't assume unsigned int fits into fixnum, or that fixnum fits
7328 into unsigned int. Don't require max_code to be a valid fixnum;
7329 that's not true for gb10830 4-byte on a 32-bit host. Allow
7330 invalid_code to be a cons, for the same reason. Require code_offset
7331 to be a character. Avoid int overflow if max_char is close
7332 to INT_MAX.
7333 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7334 this is intended anyway and avoids some undefined behavior.
7335 (load_charset_map): Pass unsigned, not int, as 2nd arg of
7336 INDEX_TO_CODE_POINT, as that's what it expects.
7337 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
7338 * charset.h (DECODE_CHAR): Return int, not unsigned;
7339 this is what was intended anyway, and it avoids undefined behavior.
7340 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
7341 integer-overflow issues.
7342 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
7343 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
7344 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
7345 * chartab.c (Fmake_char_table, Fset_char_table_range)
7346 (uniprop_get_decoder, uniprop_get_encoder):
7347 Don't assume fixnum fits in int.
7348 * cmds.c (move_point): New function, that does the gist of
7349 Fforward_char and Fbackward_char, but does so while checking
7350 for integer overflow more accurately.
c96e5d6a 7351 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
7352 (Fforward_line, Fend_of_line, internal_self_insert)
7353 (internal_self_insert):
7354 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7355 Fix a FIXME, by checking for integer overflow when calculating
7356 target_clm and actual_clm.
7357 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 7358 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
7359 (ASSURE_DESTINATION, coding_alloc_by_realloc)
7360 (coding_alloc_by_making_gap, alloc_destination)
7361 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
7362 (encode_coding_utf_16, detect_coding_emacs_mule)
7363 (decode_coding_emacs_mule, encode_coding_emacs_mule)
7364 (detect_coding_iso_2022, decode_coding_iso_2022)
7365 (encode_invocation_designation, encode_designation_at_bol)
7366 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7367 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7368 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7369 (encode_coding_ccl, encode_coding_raw_text)
7370 (detect_coding_charset, decode_coding_charset)
7371 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7372 (produce_composition, produce_charset, produce_annotation)
7373 (decode_coding, handle_composition_annotation)
7374 (handle_charset_annotation, consume_chars, decode_coding_gap)
7375 (decode_coding_object, encode_coding_object, detect_coding_system)
7376 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7377 (code_convert_region, code_convert_string)
8f50130c
PE
7378 (Fdefine_coding_system_internal)
7379 (coding_set_source, coding_set_destination):
d311d28c
PE
7380 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7381 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7382 (Fdefine_coding_system_internal):
7383 Don't assume fixnums fit in int.
7384 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 7385 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
7386 (Funencodable_char_position, Fcheck_coding_systems_region)
7387 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 7388 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 7389 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 7390 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 7391 Don't access memory outside of the args array.
d311d28c 7392 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
7393 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7394 result of ENCODE_CHAR.
d311d28c
PE
7395 * coding.h: Adjust decls to match defn changes elsewhere.
7396 (struct coding_system):
7397 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7398 * composite.c (get_composition_id, find_composition)
7399 (run_composition_function, update_compositions)
7400 (compose_text, composition_gstring_put_cache)
7401 (composition_gstring_p, composition_gstring_width)
7402 (fill_gstring_header, fill_gstring_body, autocmp_chars)
7403 (composition_compute_stop_pos, composition_reseat_it)
7404 (composition_update_it, struct position_record)
7405 (find_automatic_composition, composition_adjust_point)
7406 (Fcomposition_get_gstring, Ffind_composition_internal):
7407 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7408 (update_compositions):
7409 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7410 * composite.h: Adjust decls to match defn changes elsewhere.
7411 (struct composition):
7412 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7413 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7414 Do not attempt to compute the address of the object just before a
7415 buffer; this is not portable.
7416 (Faref, Faset):
7417 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7418 (Faset): Use int, not EMACS_INT, where int is wide enough.
7419 (Fstring_to_number): Don't assume fixnums fit in int.
7420 (Frem): Don't assume arg is nonnegative.
7421 * dbusbind.c (xd_append_arg): Check for integers out of range.
7422 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 7423 (extract_signed, extract_unsigned): New functions.
243e0530
PE
7424 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7425 (xd_get_connection_references): Return ptrdiff_t, not int.
7426 All uses changed.
7427 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7428 (xd_read_message_1):
7429 Use int, not unsigned, where the dbus API uses int.
7430 (Fdbus_message_internal): Don't overflow mtype.
7431 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
7432 * dired.c (directory_files_internal, file_name_completion, scmp)
7433 (file_name_completion_stat):
7434 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7435 (file_name_completion): Don't overflow matchcount.
7436 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7437 * dispextern.h: Adjust decls to match defn changes elsewhere.
7438 (struct text_pos, struct glyph, struct bidi_saved_info)
7439 (struct bidi_string_data, struct bidi_it, struct composition_it)
7440 (struct it):
7441 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7442 (struct display_pos, struct composition_it, struct it):
7443 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7444 * dispnew.c (increment_matrix_positions)
7445 (increment_row_positions, mode_line_string)
7446 (marginal_area_string):
7447 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 7448 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
7449 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7450 (duration_to_sec_usec): New function, to check for overflow better.
7451 (Fsleep_for, sit_for): Use it.
7452 * doc.c (get_doc_string, store_function_docstring):
7453 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7454 (get_doc_string, Fsnarf_documentation):
7455 Use int, not EMACS_INT, where int is wide enough.
7456 (get_doc_string):
7457 Use SAFE_ALLOCA, not alloca.
7458 Check for overflow when converting EMACS_INT to off_t.
7459 * doprnt.c (doprnt):
7460 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7461 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7462 Don't assume uid_t fits into fixnum.
7463 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7464 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7465 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7466 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7467 (general_insert_function)
7468 (Finsert_char, make_buffer_string, make_buffer_string_both)
7469 (update_buffer_properties, Fbuffer_substring)
7470 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7471 (Fsubst_char_in_region, check_translation)
7472 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7473 (transpose_markers, Ftranspose_regions):
7474 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7475 (clip_to_bounds): Move to lisp.h as an inline function).
7476 (Fconstrain_to_field): Don't assume integers are nonnegative.
7477 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7478 (Fsubst_char_in_region, Fsave_restriction):
7479 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7480 (Femacs_pid): Don't assume pid_t fits into fixnum.
7481 (lo_time): Use int, not EMACS_INT, when int suffices.
7482 (lisp_time_argument): Check for usec out of range.
7483 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
7484 (Fuser_login_name, Fuser_full_name): Signal an error
7485 if a uid argument is out of range, rather than relying on
7486 undefined behavior.
c8d5c857
PE
7487 (Fformat_time_string): Remove now-unnecessary check.
7488 lisp_time_argument checks for out-of-range usec now.
243e0530 7489 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
7490 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7491 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7492 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7493 (init_cmdargs, Fdump_emacs):
7494 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7495 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7496 the bottom (typically) 32 bits of the fixnum.
7497 * eval.c (specpdl_size, call_debugger):
7498 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7499 (when_entered_debugger, Fbacktrace_debug):
7500 Don't assume fixnum can fit in int.
7501 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7502 the object just before a buffer; this is not portable.
7503 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7504 (grow_specpdl, unbind_to):
7505 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7506 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7507 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 7508 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
7509 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7510 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7511 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7512 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7513 (a_write, e_write):
7514 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7515 (Fcopy_file, non_regular_nbytes, read_non_regular)
7516 (Finsert_file_contents):
7517 Use int, not EMACS_INT, where int is wide enough.
7518 (READ_BUF_SIZE): Verify that it fits in int.
7519 (Finsert_file_contents): Check that counts are in proper range,
7520 rather than assuming fixnums fit into ptrdiff_t etc.
7521 Don't assume fixnums fit into int.
125b3835 7522 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
7523 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7524 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
7525 (string_char_to_byte, string_byte_to_char)
7526 (string_make_multibyte, string_to_multibyte)
7527 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7528 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7529 (substring_both, Fdelete, internal_equal, Ffillarray)
7530 (Fclear_string, mapcar1)
7531 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7532 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7533 (larger_vector, make_hash_table, maybe_resize_hash_table)
7534 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7535 (Fmaphash, secure_hash):
7536 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7537 (concat): Check for string index and length overflow.
7538 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7539 (Frequire):
7540 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7541 (larger_vector): New API (vec, incr_min, size_max) replaces old
7542 one (vec, new_size, init). This catches size overflow.
7543 INIT was removed because it was always Qnil.
7544 All callers changed.
7545 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7546 the upper bound on a hash table index size.
7547 (make_hash_table, maybe_resize_hash_table): Use it.
7548 (secure_hash): Computer start_byte and end_byte only after
7549 they're known to be in ptrdiff_t range.
7550 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7551 (Ffont_get_glyphs, Ffont_at):
7552 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7553 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7554 (Flist_fonts, Fopen_font):
7555 Don't assume fixnum can fit in int.
7556 (check_gstring): Don't assume index can fit in int.
7557 (font_match_p): Check that fixnum is a character, not a nonnegative
7558 fixnum, since the later code needs to stuff it into an int.
7559 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7560 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7561 conversion overflow issues.
7562 (Fopen_font): Check for integer out of range.
7563 (Ffont_get_glyphs): Don't assume index can fit in int.
7564 * font.h: Adjust decls to match defn changes elsewhere.
7565 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7566 integer overflow.
7567 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7568 printmax_t, where ptrdiff_t is wide enough.
7569 (Finternal_char_font):
7570 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7571 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7572 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7573 (Fset_frame_position, x_set_frame_parameters)
7574 (x_set_line_spacing, x_set_border_width)
7575 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7576 Check that fixnums are in proper range for system types.
7577 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7578 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7579 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7580 Use SAFE_ALLOCA_LISP, not alloca.
7581 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7582 intptr_t is wide enough.
7583 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7584 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7585 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7586 Check for fixnum out of range.
7587 * ftfont.c (ftfont_list): Don't assume index fits in int.
7588 Check that fixnums are in proper range for system types.
7589 (ftfont_shape_by_flt):
7590 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
7591 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7592 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7593 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7594 Check that fixnums are in proper range for system types.
7595 * gnutls.h: Adjust decls to match defn changes elsewhere.
7596 * gtkutil.c (xg_dialog_run):
7597 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7598 (update_frame_tool_bar):
7599 Check that fixnums are in proper range for system types.
7600 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 7601 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
7602 * indent.c (last_known_column, last_known_column_point):
7603 (current_column_bol_cache):
7604 (skip_invisible, current_column, check_display_width):
7605 (check_display_width, scan_for_column, current_column_1)
7606 (Findent_to, Fcurrent_indentation, position_indentation)
7607 (indented_beyond_p, Fmove_to_column, compute_motion):
7608 (Fcompute_motion, Fvertical_motion):
7609 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7610 (last_known_column_modified): Use EMACS_INT, not int.
7611 (check_display_width):
7612 (Fcompute_motion):
7613 Check that fixnums and floats are in proper range for system types.
7614 (compute_motion): Don't assume index or fixnum fits in int.
7615 (compute_motion, Fcompute_motion):
7616 Use int, not EMACS_INT, when it is wide enough.
7617 (vmotion): Omit local var start_hpos that is always 0; that way
7618 we don't need to worry about overflow in expressions involving it.
7619 * indent.h: Adjust decls to match defn changes elsewhere.
7620 (struct position):
7621 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7622 Use int, not EMACS_INT, where int is wide enough.
7623 Remove unused members ovstring_chars_done and tab_offset;
7624 all uses removed.
7625 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7626 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7627 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7628 (make_gap, copy_text, insert, insert_and_inherit)
7629 (insert_before_markers, insert_before_markers_and_inherit)
7630 (insert_1, count_combining_before, count_combining_after)
7631 (insert_1_both, insert_from_string)
7632 (insert_from_string_before_markers, insert_from_string_1)
7633 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7634 (adjust_after_replace, adjust_after_insert, replace_range)
7635 (replace_range_2, del_range, del_range_1, del_range_byte)
7636 (del_range_both, del_range_2, modify_region)
7637 (prepare_to_modify_buffer, signal_before_change)
7638 (signal_after_change, Fcombine_after_change_execute):
7639 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7640 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7641 (balance_an_interval, split_interval_right, split_interval_left)
7642 (find_interval, next_interval, update_interval)
7643 (adjust_intervals_for_insertion, delete_node, delete_interval)
7644 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7645 (static_offset_intervals, offset_intervals)
7646 (merge_interval_right, merge_interval_left, make_new_interval)
7647 (graft_intervals_into_buffer, temp_set_point_both)
7648 (temp_set_point, set_point, adjust_for_invis_intang)
7649 (set_point_both, move_if_not_intangible, get_property_and_range)
7650 (get_local_map, copy_intervals, copy_intervals_to_string)
7651 (compare_string_intervals, set_intervals_multibyte_1):
7652 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7653 * intervals.h: Adjust decls to match defn changes elsewhere.
7654 (struct interval):
7655 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7656 * keyboard.c (this_command_key_count, this_single_command_key_start)
7657 (before_command_key_count, before_command_echo_length, echo_now)
7658 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7659 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7660 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7661 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7662 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7663 (last_non_minibuf_size, last_point_position, echo_truncate)
7664 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7665 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7666 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7667 (stuff_buffered_input):
7668 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7669 (last_auto_save, command_loop_1, read_char):
7670 Use EMACS_INT, not int, to avoid integer overflow.
7671 (record_char): Avoid overflow in total_keys computation.
7672 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7673 * keyboard.h: Adjust decls to match defn changes elsewhere.
7674 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7675 (Fkey_description, Fdescribe_vector, Flookup_key):
7676 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7677 (click_position): New function, to check that positions are in range.
7678 (Fcurrent_active_maps):
7679 (describe_command):
7680 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7681 (Faccessible_keymaps, Fkey_description):
7682 (preferred_sequence_p):
7683 Don't assume fixnum can fit into int.
7684 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7685 Check for integer overflow in size calculations.
7686 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7687 avoid mishandling large integers.
7688 * lisp.h: Adjust decls to match defn changes elsewhere.
7689 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7690 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7691 (struct Lisp_Marker):
7692 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7693 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
7694 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7695 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7696 All callers changed.
7697 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7698 Assume the arg has valid form, since it always does.
7699 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7700 unsigned integer system type.
7701 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7702 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7703 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7704 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7705 (duration_to_sec_usec): New decl.
7706 * lread.c (read_from_string_index, read_from_string_index_byte)
7707 (read_from_string_limit, readchar, unreadchar, openp)
7708 (read_internal_start, read1, oblookup):
7709 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7710 (Fload, readevalloop, Feval_buffer, Feval_region):
7711 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7712 (openp): Check for out-of-range argument to 'access'.
7713 (read1): Use int, not EMACS_INT, where int is wide enough.
7714 Don't assume fixnum fits into int.
6efdadfd 7715 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
7716 (read_filtered_event): Use duration_to_sec_usec
7717 to do proper overflow checking on durations.
d311d28c
PE
7718 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7719 in size calculation.
7720 (Fexecute_kbd_macro):
7721 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7722 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7723 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7724 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7725 (set_marker_both, set_marker_restricted_both, marker_position)
7726 (marker_byte_position, Fbuffer_has_markers_at):
7727 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7728 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 7729 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
7730 It now merely ensures that the menu is large enough, without
7731 necessarily growing it, as this avoids some integer overflow issues.
7732 All callers changed.
7733 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7734 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7735 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7736 Use SAFE_ALLOCA_LISP, not alloca.
7737 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7738 to EMACS_INT. Check that fixnums are in proper range for system types.
7739 * minibuf.c (minibuf_prompt_width, string_to_object)
7740 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7741 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7742 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7743 (get_minibuffer, read_minibuf_unwind):
7744 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7745 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7746 this simplifies overflow checking. All callers changed.
7747 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7748 (Ftest_completion):
7749 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7750 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7751 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7752 Check that fixnums are in proper range for system types.
7753 (Fx_create_frame, Fx_show_tip):
7754 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7755 * nsfont.m (ns_findfonts, nsfont_list_family):
7756 Don't assume fixnum fits in long.
7757 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7758 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7759 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7760 wide enough.
17fdb222 7761 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
7762 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7763 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7764 (PRINTDECLARE, PRINTPREPARE):
7765 (strout, print_string):
7766 (print, print_preprocess, print_check_string_charset_prop)
7767 (print_object):
7768 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7769 (PRINTDECLARE):
7770 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7771 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7772 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 7773 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 7774 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
7775 (print_error_message): Use SAFE_ALLOCA, not alloca.
7776 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
7777 (print_depth, new_backquote_output, print_number_index):
7778 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
7779 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7780 (Fset_process_window_size, Fformat_network_address)
7781 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 7782 (sigchld_handler):
d311d28c 7783 Check that fixnums are in proper range for system types.
d44287d4 7784 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
7785 Check for process-ids out of pid_t range rather than relying on
7786 undefined behavior.
e4d81efc 7787 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
7788 (Fformat_network_address, read_process_output, send_process)
7789 (Fprocess_send_region, status_notify):
7790 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7791 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7792 (wait_reading_process_output, read_process_output, exec_sentinel):
7793 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7794 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7795 (Faccept_process_output): Use duration_to_sec_usec to do proper
7796 overflow checking on durations.
dde14581
PE
7797 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7798 Don't assume pid_t fits in int.
02481186
PE
7799 * process.h (struct Lisp_Process): Members tick and update_tick
7800 are now of type EMACS_INT, not int.
b62b53e8
PE
7801 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7802 configured --with-wide-int.
d311d28c
PE
7803 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7804 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7805 * search.c (looking_at_1, string_match_1):
7806 (fast_string_match, fast_c_string_match_ignore_case)
7807 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7808 (scan_newline, find_before_next_newline, search_command)
7809 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7810 (set_search_regs, wordify):
7811 (Freplace_match):
7812 (Fmatch_data):
7813 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7814 (string_match_1, search_buffer, set_search_regs):
7815 (Fmatch_data):
7816 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7817 (wordify): Check for overflow in size calculation.
7818 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7819 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7820 Check that fixnums are in proper range for system types.
7821 * sound.c (struct sound_device)
7822 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7823 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7824 (Fplay_sound_internal):
7825 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 7826 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
7827 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7828 (Fparse_partial_sexp):
7829 Don't assume fixnums can fit in int.
7830 (struct lisp_parse_state, find_start_pos, find_start_value)
7831 (find_start_value_byte, find_start_begv)
7832 (update_syntax_table, char_quoted, dec_bytepos)
7833 (find_defun_start, prev_char_comend_first, back_comment):
7834 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7835 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7836 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7837 (Finternal_describe_syntax_value): Check that match_lisp is a
7838 character, not an integer, since the code stuffs it into int.
7839 (scan_words, scan_sexps_forward):
7840 Check that fixnums are in proper range for system types.
7841 (Fforward_word):
7842 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7843 (scan_sexps_forward):
7844 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7845 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7846 * syntax.h: Adjust decls to match defn changes elsewhere.
7847 (struct gl_state_s):
7848 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
7849 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7850 MOST_POSITIVE_FIXNUM.
d311d28c
PE
7851 * sysdep.c (wait_for_termination_1, wait_for_termination)
7852 (interruptible_wait_for_termination, mkdir):
7853 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7854 (emacs_read, emacs_write):
7855 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
7856 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7857 and double all fit in int.
d311d28c
PE
7858 * term.c (set_tty_color_mode):
7859 Check that fixnums are in proper range for system types.
7860 * termhooks.h (struct input_event):
7861 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7862 * textprop.c (validate_interval_range, interval_of)
7863 (Fadd_text_properties, set_text_properties_1)
7864 (Fremove_text_properties, Fremove_list_of_text_properties)
7865 (Ftext_property_any, Ftext_property_not_all)
7866 (copy_text_properties, text_property_list, extend_property_ranges)
7867 (verify_interval_modification):
7868 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7869 (Fnext_single_char_property_change)
7870 (Fprevious_single_char_property_change):
7871 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
7872 (copy_text_properties):
7873 Check for integer overflow in index calculation.
d311d28c
PE
7874 * undo.c (last_boundary_position, record_point, record_insert)
7875 (record_delete, record_marker_adjustment, record_change)
7876 (record_property_change):
7877 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7878 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7879 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7880 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7881 (Fx_hide_tip, Fx_file_dialog):
7882 * w32menu.c (set_frame_menubar):
7883 Use ptrdiff_t, not int, for consistency with rest of code.
7884 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7885 (select_window, Fdelete_other_windows_internal)
7886 (window_scroll_pixel_based, window_scroll_line_based)
7887 (Frecenter, Fset_window_configuration):
7888 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7889 (Fset_window_hscroll, run_window_configuration_change_hook)
7890 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 7891 (Fscroll_other_window, Frecenter):
d311d28c
PE
7892 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7893 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7894 Don't assume fixnum fits in int.
7895 (Fset_window_scroll_bars):
7896 Check that fixnums are in proper range for system types.
7897 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7898 (string_pos, c_string_pos, number_of_chars, init_iterator)
7899 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7900 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7901 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
7902 (face_before_or_after_it_pos, handle_invisible_prop)
7903 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
7904 (display_prop_intangible_p, string_buffer_position_lim)
7905 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7906 (get_overlay_strings_1, get_overlay_strings)
7907 (iterate_out_of_display_property, forward_to_next_line_start)
7908 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7909 (get_next_display_element, set_iterator_to_next)
7910 (get_visually_first_element, compute_stop_pos_backwards)
7911 (handle_stop_backwards, next_element_from_buffer)
7912 (move_it_in_display_line_to, move_it_in_display_line)
7913 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7914 (add_to_log, message_dolog, message_log_check_duplicate)
7915 (message2, message2_nolog, message3, message3_nolog
7916 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7917 (current_message_1, truncate_echo_area, truncate_message_1)
7918 (set_message, set_message_1, store_mode_line_noprop)
7919 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7920 (text_outside_line_unchanged_p, check_point_in_composition)
7921 (reconsider_clip_changes)
7922 (redisplay_internal, set_cursor_from_row, try_scrolling)
7923 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7924 (redisplay_window, find_last_unchanged_at_beg_row)
7925 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7926 (trailing_whitespace_p, find_row_edges, display_line)
7927 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7928 (display_mode_element, store_mode_line_string)
7929 (pint2str, pint2hrstr, decode_mode_spec)
7930 (display_count_lines, display_string, draw_glyphs)
7931 (x_produce_glyphs, x_insert_glyphs)
7932 (rows_from_pos_range, mouse_face_from_buffer_pos)
7933 (fast_find_string_pos, mouse_face_from_string_pos)
7934 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7935 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7936 (safe_call, init_from_display_pos, handle_fontified_prop)
7937 (handle_single_display_spec, load_overlay_strings)
7938 (with_echo_area_buffer, setup_echo_area_for_printing)
7939 (display_echo_area, echo_area_display)
7940 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7941 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
7942 (redisplay_window, dump_glyph_row, display_mode_line)
7943 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 7944 (handle_display_spec, display_prop_string_p):
d311d28c
PE
7945 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7946 (handle_single_display_spec, build_desired_tool_bar_string)
7947 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7948 (get_specified_cursor_type):
7949 Check that fixnums are in proper range for system types.
7950 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7951 (Flookup_image_map):
7952 Don't assume fixnums fit in int.
7953 (compare_overlay_entries):
7954 Avoid mishandling comparisons due to subtraction overflow.
7955 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7956 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7957 (handle_tool_bar_click):
7958 Use int, not unsigned, since we prefer signed and the signedness
7959 doesn't matter here.
7960 (get_next_display_element, next_element_from_display_vector):
7961 Use int, not EMACS_INT, when int is wide enough.
7962 (start_hourglass): Use duration_to_sec_usec to do proper
7963 overflow checking on durations.
7964 * xfaces.c (Fbitmap_spec_p):
7965 Check that fixnums are in proper range for system types.
7966 (compare_fonts_by_sort_order):
7967 Avoid mishandling comparisons due to subtraction overflow.
7968 (Fx_family_fonts, realize_basic_faces):
7969 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7970 (Fx_family_fonts):
7971 Don't assume fixnum fits in int.
7972 Use SAFE_ALLOCA_LISP, not alloca.
7973 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7974 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7975 (face_at_buffer_position, face_for_overlay_string)
7976 (face_at_string_position):
7977 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7978 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7979 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7980 (Fx_show_tip):
7981 Check that fixnums are in proper range for system types.
7982 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7983 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7984 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7985 (Fx_change_window_property): Don't assume fixnums fit in int.
7986 * xfont.c (xfont_chars_supported):
7987 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7988 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7989 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7990 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7991 * xml.c (parse_region):
7992 * xrdb.c (magic_file_p):
7993 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7994 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7995 (x_get_local_selection, x_reply_selection_request)
7996 (x_handle_selection_request, wait_for_property_change):
7997 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7998 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7999 short is wide enough.
8000 (x_send_client_event): Don't assume fixnum fits in int.
8001 * xterm.c (x_x_to_emacs_modifiers):
8002 Don't assume EMACS_INT overflows nicely into int.
8003 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
8004 may come from Lisp.
8005 (handle_one_xevent): NATNUMP can eval its arg twice.
8006 (x_connection_closed):
8007 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8008 * xterm.h: Adjust decls to match defn changes elsewhere.
8009 (struct scroll_bar): Use struct vectorlike_header
8010 rather than rolling our own approximation.
8011 (SCROLL_BAR_VEC_SIZE): Remove; not used.
8012
c6574eb5
GM
80132012-05-25 Glenn Morris <rgm@gnu.org>
8014
8015 * lisp.mk (lisp): Update for more files being compiled now.
8016
e8d32c7e
SM
80172012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
8018
48def666
SM
8019 * lread.c: Remove `read_pure' which makes no difference.
8020 (read_pure): Remove var.
8021 (unreadpure): Remove function.
8022 (readevalloop): Don't call read_list with -1 flag.
8023 (read1, read_vector): Don't test read_pure any more.
8024 (read_list): Simplify.
8025
e8d32c7e
SM
8026 * fileio.c, character.h: Minor style tweaks.
8027
4b2addb7
DA
80282012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
8029
8030 * window.h (clip_changed): Remove useless declaration.
8031
584461b2
JB
80322012-05-22 Juanma Barranquero <lekktu@gmail.com>
8033
8034 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
8035 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
8036
34374650
PE
80372012-05-22 Paul Eggert <eggert@cs.ucla.edu>
8038
8039 Remove src/m/*.
8040 This directory predates autoconf and is no longer needed nowadays.
8041 Move its few remaining bits of functionality to where they're needed.
8042 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8043 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8044 * m/template.h: Remove.
8045 * Makefile.in (M_FILE): Remove. All uses removed.
8046 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
8047 * lisp.h (USE_LSB_TAG):
8048 * mem-limits.h (EXCEEDS_LISP_PTR):
8049 Use VAL_MAX, not VALBITS, in #if.
8050 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
8051 (EMACS_UINT): Define unconditionally now.
8052 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
8053 (BITS_PER_EMACS_INT): New constants, replacing
8054 what used to be in config.h, but not useful in #if.
8055 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
8056 define them any more.
8057 (VAL_MAX): New macro.
8058 (VALMASK): Use it.
8059 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
8060 BITS_PER_EMACS_INT, in #if.
8061 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8062 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
8063 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8064 * s/ms-w32.h (DATA_START):
8065 Move here from removed file m/intel386.h.
8066 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8067 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8068
261cb4bb
PE
80692012-05-21 Paul Eggert <eggert@cs.ucla.edu>
8070
8071 Assume C89 or later.
8072 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8073 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8074 (xrealloc):
8075 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8076 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8077 * textprop.c, tparam.c (NULL): Remove.
8078 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8079 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8080 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
8081 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8082 * xterm.c (input_signal_count): Assume volatile works.
8083
ff23cd9f
KB
80842012-05-21 Ken Brown <kbrown@cornell.edu>
8085
8086 * xgselect.c (xg_select): Fix first argument in call to 'select'
8087 (bug#11508).
8088
1b170bc6
KB
80892012-05-20 Ken Brown <kbrown@cornell.edu>
8090
8091 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 8092 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 8093
b2f4d39f
KB
80942012-05-19 Ken Brown <kbrown@cornell.edu>
8095
8096 * xfns.c (x_in_use): Remove `static' qualifier.
8097 * xterm.h (x_in_use): Declare.
8098 * xgselect.c: Include xterm.h.
8099 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8100 and `display_arg' (bug#9754).
8101
003fdae2
PE
81022012-05-19 Paul Eggert <eggert@cs.ucla.edu>
8103
9232a6d9
PE
8104 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
8105
003fdae2
PE
8106 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
8107 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8108
784b56e2
EZ
81092012-05-18 Eli Zaretskii <eliz@gnu.org>
8110
8111 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8112
8113 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 8114 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
8115
8116 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8117 reference to image_cache->refcount.
8118 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8119
a0a79cde
JL
81202012-05-17 Juri Linkov <juri@jurta.org>
8121
8122 * search.c (Fword_search_regexp, Fword_search_backward)
8123 (Fword_search_forward, Fword_search_backward_lax)
8124 (Fword_search_forward_lax): Move functions to isearch.el
8125 (bug#10145, bug#11381).
8126
b0572523
PE
81272012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8128
8129 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8130
9660f5fc
SM
81312012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8132
8133 * lread.c (init_obarray): Declare Qt and Qnil as special.
8134
4374de83
GM
81352012-05-14 Glenn Morris <rgm@gnu.org>
8136
8137 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 8138 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 8139
dc44c39a
PE
81402012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8141
078c97cb
PE
8142 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8143
dc44c39a
PE
8144 * unexaix.c: Port to more-recent AIX compilers.
8145 (report_error, report_error_1, make_hdr, copy_sym)
8146 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8147 Make arguments const char *, not char *, to avoid violations of C
8148 standard and to fix some AIX warnings reported by Gilles Pion.
8149
e18afed7 81502012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
8151
8152 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8153 already have overlays loaded.
8154 (handle_single_display_spec): Before returning without displaying
8155 fringe bitmap, synchronize the bidi iterator with the main display
8156 iterator, by calling iterate_out_of_display_property.
8157 (iterate_out_of_display_property): Detect buffer iteration by
8158 testing that it->string is a Lisp string.
8159 (get_next_display_element): When the current object is exhausted,
8160 and there's something on it->stack, call set_iterator_to_next to
8161 proceed with what's on the stack, instead of returning zero.
8162 (set_iterator_to_next): If called at the end of a Lisp string,
8163 proceed to consider_string_end without incrementing string
8164 position. Don't increment display vector index past the end of
8165 the display vector. (Bug#11417)
c8fb9dc6
EZ
8166 (pos_visible_p): Don't report a position visible when move_it_to
8167 stopped at the last line of window, which happens to be scanned
8168 backwards by the bidi iteration. (Bug#11464)
ac268e67 8169
e18afed7 81702012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
8171
8172 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8173 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
8174 are on a TTY, and thus unable to display on the fringes.
8175 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
8176 so we need to signal to the caller that this is a "replacing"
8177 display spec. This fixes display when the spec is invalid or we
8178 are on a TTY.
8179
e18afed7 81802012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
8181
8182 * unexaix.c (make_hdr): Fix typo in prototype.
8183 This bug broke the build on AIX. Problem reported by Gilles Pion.
8184
9d0a235a
MA
81852012-05-14 Michael Albinus <michael.albinus@gmx.de>
8186
8187 * keyboard.c (kbd_buffer_get_event): Read special events also in
8188 batch mode. (Bug#11415)
8189
9e6b06ed
GM
81902012-05-12 Glenn Morris <rgm@gnu.org>
8191
8192 * ns.mk: Update for ns_appbindir no longer having trailing "/".
8193
c1a1d7a3
EZ
81942012-05-12 Eli Zaretskii <eliz@gnu.org>
8195
8196 * lisp.mk (lisp): Add newcomment.elc.
8197
3fe7cdc8
GM
81982012-05-12 Glenn Morris <rgm@gnu.org>
8199
8200 * Makefile.in (MKDIR_P): New, set by configure.
8201 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
8202
53f7d2c0
PE
82032012-05-11 Paul Eggert <eggert@cs.ucla.edu>
8204
8205 Remove unused function hourglass_started.
8206 * dispextern.h (hourglass_started):
8207 * w32fns.c (hourglass_started):
8208 * xdisp.c (hourglass_started): Remove.
8209
75aafb17
JB
82102012-05-10 Juanma Barranquero <lekktu@gmail.com>
8211
8212 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
8213 Update dependencies.
8214
12959e8e
PE
82152012-05-10 Paul Eggert <eggert@cs.ucla.edu>
8216
97107e2e
PE
8217 * xgselect.c (xg_select): Put maxfds+1 into a var.
8218 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
8219
12959e8e
PE
8220 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
8221
836d29b3
DA
82222012-05-10 Dave Abrahams <dave@boostpro.com>
8223
8224 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
8225 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
8226
5cb67954
MA
82272012-05-09 Michael Albinus <michael.albinus@gmx.de>
8228
8229 * dbusbind.c (xd_registered_buses): New internal Lisp object.
8230 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
8231 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
8232 Initialize xd_registered_buses.
8233
3478ec45
PE
82342012-05-09 Paul Eggert <eggert@cs.ucla.edu>
8235
b263a6b0
PE
8236 Untag more efficiently if USE_LSB_TAG.
8237 This is based on a proposal by YAMAMOTO Mitsuharu in
8238 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
8239 For an admittedly artificial (nth 8000 longlist) benchmark on
8240 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
8241 Emacs's overall text size by 1%.
8242 * lisp.h (XUNTAG): New macro.
8243 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
8244 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
8245 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8246 * eval.c (Fautoload):
8247 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8248 * frame.h (XFRAME): Use XUNTAG.
8249
3478ec45
PE
8250 Port recent dbusbind.c changes to 32-bit --with-wide-int.
8251 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8252 Remove unportable assumptions about print widths of types like
8253 dbus_uint32_t.
8254 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8255 intptr_t when converting between pointer and integer, to avoid GCC
8256 warnings about wrong width.
8257
666b903b 82582012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
8259
8260 * w32proc.c (new_child): Force Windows to reserve only 64KB of
8261 stack for each reader_thread, instead of defaulting to 8MB
8262 determined by the linker. This avoids failures in creating
8263 subprocesses on Windows 7, see the discussion in this thread:
8264 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8265
b120cc17
JC
82662012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
8267
8268 Fix up display of the *Minibuf-0* buffer in the mini window.
8269 * keyboard.c (read_char): Don't clear the echo area if there's no
8270 message to clear.
8271 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 8272 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 8273
9a4b36f8
MA
82742012-05-07 Michael Albinus <michael.albinus@gmx.de>
8275
8276 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8277 batch mode.
8278
e5f9458f
CY
82792012-05-06 Chong Yidong <cyd@gnu.org>
8280
8281 * lisp.mk (lisp): Update.
8282
eceeb5fc 82832012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
8284
8285 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8286
71873e2b
SM
82872012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
8288
8289 * data.c (PUT_ERROR): New macro.
8290 (syms_of_data): Use it. Add new error type `user-error'.
8291 * undo.c (user_error): New function.
8292 (Fprimitive_undo): Use it.
8293 * print.c (print_error_message): Adjust print style for `user-error'.
8294 * keyboard.c (user_error): New function.
8295 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8296
ab0fa4e4
PE
82972012-05-03 Paul Eggert <eggert@cs.ucla.edu>
8298
8299 Do not limit current-time-string to years 1000..9999.
8300 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8301 (Fcurrent_time_string): Support any year that is supported by the
8302 underlying localtime representation. Don't use asctime, as it
8303 has undefined behavior for years outside the range -999..9999.
8304
7ed806a7
PE
83052012-05-02 Paul Eggert <eggert@cs.ucla.edu>
8306
8307 Fix race conditions involving setenv, gmtime, localtime, asctime.
8308 Without this fix, interrupts could mess up code that uses these
8309 nonreentrant functions, since setting TZ invalidates existing
8310 tm_zone or tzname values, and since most of these functions return
8311 pointers to static storage.
8312 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8313 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8314 Grow the critical sections to include not just invoking
8315 localtime/gmtime, but also accessing these functions' results
8316 including their tm_zone values if any, and any related TZ setting.
8317 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
8318 so that the struct tm is saved in the critical section.
8319 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
8320 motivated by the fact that memory allocation needs to be outside
8321 the critical section.
8322
0c16dfed
DA
83232012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
8324
8325 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8326 with RESET_INTERVAL.
8327
8328 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8329 Remove duplicated buffer name initialization.
8330
3f83ace8
JM
83312012-05-02 Jim Meyering <jim@meyering.net>
8332
8333 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8334
c7b8541e
JM
8335 * xfns.c (x_window): Use xstrdup (Bug#11375).
8336
90207a15 83372012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
8338
8339 * xdisp.c (pos_visible_p): If already at a newline from the
8340 display string before the 'while' loop, don't walk back the glyphs
8341 from it3.glyph_row. Solves assertion violation when the display
8342 string begins with a newline (egg.el). (Bug#11367)
8343
b593d6a9
AH
83442012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
8345
8346 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
8347 Move to simple.el.
8348
4737362e
GM
83492012-05-01 Glenn Morris <rgm@gnu.org>
8350
99cf43f9
GM
8351 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
8352 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
8353 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
8354 All were removed before 23.1.
8355
9311dcff
GM
8356 * dispnew.c: Remove HAVE_LIBNCURSES test;
8357 it is always true on relevant platforms.
8358
4d5c6349
GM
8359 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
8360 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
8361
4737362e
GM
8362 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
8363
74dd3a6b
AS
83642012-04-30 Andreas Schwab <schwab@linux-m68k.org>
8365
8366 * .gdbinit (xpr): Remove checks for no longer existing misc types.
8367 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8368 Remove.
8369
13c379ee
PE
83702012-04-28 Paul Eggert <eggert@cs.ucla.edu>
8371
8372 Do not avoid creating empty evaporating overlays (Bug#9642).
8373 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8374 That is, do not delete an evaporating overlay if it becomes
8375 empty after its bounds are adjusted to fit within its buffer.
8376 This fix caused other problems, and I'm reverting it until we get
8377 to the bottom of them.
8378
a8e7d6d7 83792012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
8380
8381 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8382
a8e7d6d7 83832012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
8384
8385 * xdisp.c (pos_visible_p): If the window start position is beyond
8386 ZV, start the display from buffer beginning. Prevents assertion
8387 violation in init_iterator when the minibuffer window is scrolled
8388 via the scroll bar.
8389
8390 * window.c (window_scroll_pixel_based): Likewise.
8391
a8e7d6d7 83922012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
8393
8394 * keymap.c (where_is_internal): Doc fix (Bug#10872).
8395
a8e7d6d7 83962012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
8397
8398 * fileio.c (Fcopy_file, Fset_file_selinux_context):
8399 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
8400
a8e7d6d7 84012012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 8402
b593d6a9
AH
8403 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8404 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 8405
1c6900d9
EZ
84062012-04-26 Eli Zaretskii <eliz@gnu.org>
8407
4c3fa1d9
EZ
8408 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8409 display element, check also the underlying string or buffer
8410 character. (Bug#11341)
8411
1c6900d9
EZ
8412 * w32menu.c: Include w32heap.h.
8413 (add_menu_item): If the call to AppendMenuW (via
8414 unicode_append_menu) fails, disable Unicode menus only if we are
8415 running on Windows 9X/Me.
8416
42bf8205
AS
84172012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8418
8419 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8420 (xgetint): Add missing shift for LSB tags.
8421
b1bac16e
MR
84222012-04-24 Martin Rudalics <rudalics@gmx.at>
8423
8424 * keyboard.c (read_char): Don't wipe echo area for select window
8425 events: These might get delayed via `mouse-autoselect-window'
8426 (Bug#11304).
8427
d69621cc
JB
84282012-04-24 Juanma Barranquero <lekktu@gmail.com>
8429
8430 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8431 manipulation of :loaded-from data.
8432
02fd101b
JB
84332012-04-23 Juanma Barranquero <lekktu@gmail.com>
8434
8435 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8436 now a cons (bug#11311).
8437
888bec30
PE
84382012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8439
89a438bd
PE
8440 Do not create empty overlays with the evaporate property (Bug#9642).
8441 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8442 if it becomes empty after its bounds are adjusted to fit within
8443 its buffer. Without this fix, in a nonempty buffer (let ((o
8444 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8445 yields an empty overlay that has the evaporate property, which is
8446 not supposed to happen.
8447
1068fe4d
PE
8448 Fix minor GTK3 problems found by static checking.
8449 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8450 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8451 (struct _EmacsFixedClass, emacs_fixed_get_type):
8452 Move decls here from emacsgtkfixed.h, since they needn't be public.
8453 (emacs_fixed_get_type): Now static.
8454 (emacs_fixed_class_init): Omit unused local.
8455 (emacs_fixed_child_type): Remove; unused.
8456 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8457 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8458 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8459 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8460 (EMACS_FIXED_GET_CLASS): Remove; unused.
8461 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8462
888bec30
PE
8463 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8464 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8465
de85e130
PE
84662012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8467
d0baac98 8468 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 8469 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
8470 (__malloc_size_t, __malloc_ptrdiff_t):
8471 Remove. All uses removed, replaced by the definiens if needed,
8472 since we can assume C89 or better now.
8473 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8474 (protect_malloc_state, align, get_contiguous_space)
8475 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8476 (malloc_atfork_handler_child, malloc_enable_thread)
8477 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8478 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8479 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8480 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8481 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8482 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8483 Define using prototypes, not old style.
8484 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8485 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8486 (align): Don't assume that signed integer overflow wraps around.
8487 Omit unused local var.
8488 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8489 (_free_internal_nolock, memalign, mallochook, reallochook):
8490 Omit no-longer-needed casts.
8491 (valloc): Use getpagesize, not __getpagesize.
8492 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8493 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8494
de85e130
PE
8495 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8496
dcbf5805
MA
84972012-04-22 Michael Albinus <michael.albinus@gmx.de>
8498
8499 Move functions from C to Lisp. Make non-blocking method calls
8500 the default. Implement further D-Bus standard interfaces.
8501
8502 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8503 (QCdbus_request_name_allow_replacement)
8504 (QCdbus_request_name_replace_existing)
8505 (QCdbus_request_name_do_not_queue)
8506 (QCdbus_request_name_reply_primary_owner)
8507 (QCdbus_request_name_reply_in_queue)
8508 (QCdbus_request_name_reply_exists)
8509 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8510 (QCdbus_registered_serial, QCdbus_registered_method)
8511 (QCdbus_registered_signal): New Lisp objects.
8512 (XD_DEBUG_MESSAGE): Use sizeof.
8513 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8514 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8515 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8516 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8517 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8518 (xd_signature, xd_append_arg): Allow float for integer types.
8519 (xd_get_connection_references): New function.
b593d6a9
AH
8520 (xd_get_connection_address): Rename from xd_initialize.
8521 Return cached address.
dcbf5805
MA
8522 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8523 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8524 level.
8525 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 8526 Return number of refcounts.
dcbf5805
MA
8527 (Fdbus_get_unique_name): Make stronger parameter check.
8528 (Fdbus_message_internal): New defun.
8529 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8530 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8531 (Fdbus_send_signal, Fdbus_register_service)
8532 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8533 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8534 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8535 (Vdbus_compiled_version, Vdbus_runtime_version)
8536 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8537 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8538 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
8539 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8540 Adapt docstring.
dcbf5805 8541
52828e02
PE
85422012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8543
da05bc4c
PE
8544 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8545 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8546 Do not assume ptrdiff_t is the same width as 'int'.
8547
52828e02
PE
8548 * alloc.c: Handle unusual debugging option combinations.
8549 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8550 since the two debugging options are incompatible.
8551 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8552 is defined.
8553 (mem_init, mem_insert, mem_insert_fixup):
8554 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8555 (NEED_MEM_INSERT): Remove; no longer needed.
8556
f01769f9
LL
85572012-04-22 Leo Liu <sdl.web@gmail.com>
8558
8559 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8560
5790543d
PE
85612012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8562
8563 * sysdep.c [__FreeBSD__]: Minor cleanups.
8564 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8565 Use Emacs indenting style more consistently. Avoid some casts.
8566 Use 'double' consistently rather than mixing 'float' and 'double'.
8567
b91b7e4d
EW
85682012-04-21 Eduard Wiebe <usenet@pusto.de>
8569
b593d6a9
AH
8570 * sysdep.c (list_system_processes, system_process_attributes):
8571 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 8572
6114eb15
AS
85732012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8574
8575 * lisp.mk (lisp): Update.
8576
2f38dff7
PE
85772012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8578
8579 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8580 It is never used otherwise.
8581
4ae29f89
SM
85822012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8583
8584 * print.c (print_preprocess): Only check print_depth if print-circle
8585 is nil.
8586 (print_object): Check for cycles even when print-circle is nil and
8587 print-gensym is t, but only check print_depth if print-circle is nil.
8588
f30d612a
CY
85892012-04-20 Chong Yidong <cyd@gnu.org>
8590
8591 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8592 set the status to "failed" and ensure that sentinel is run.
8593
c07a4c0b 85942012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
8595
8596 * process.c (Fset_process_inherit_coding_system_flag)
8597 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 8598 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 8599
c07a4c0b 86002012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
8601
8602 * xdisp.c (string_buffer_position_lim): Limit starting position to
8603 BEGV.
8604 (set_cursor_from_row): If called for a mode-line or header-line
8605 row, return zero immediately.
8606 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
8607 farther than the first row after the header line, if any.
8608 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
8609 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8610
c07a4c0b 86112012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8612
4ae29f89
SM
8613 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8614 (bug#11238).
ad3a2b41 8615
c07a4c0b 86162012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 86172012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
8618
8619 configure: new option --enable-gcc-warnings (Bug#11207)
8620 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8621 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8622 (ALL_CFLAGS): Use new macros rather than old.
8623 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8624 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8625 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8626 -Wunused-result, -Wunused-variable. This should go away once
8627 the Emacs and Gnulib regex code is merged.
8628 (xmalloc, xrealloc): Now static.
8629
aba027e8
PE
86302012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8631
8632 * dired.c (Fsystem_groups): Remove unused local.
8633
e5a36063
GM
86342012-04-17 Glenn Morris <rgm@gnu.org>
8635
8636 * dired.c (Fsystem_users): Doc fix.
8637
316411f0
DA
86382012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8639
8640 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8641 (syms_of_dired): Add them.
8642
9426aba4
PE
86432012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8644
b62a57be
PE
8645 Fix minor alloc.c problems found by static checking.
8646 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8647 New extern decls, to avoid calling undeclared functions.
8648 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8649 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8650 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8651 (NEED_MEM_INSERT): New macro.
8652 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 8653 Remove one incorrect comment and fix another.
b62a57be 8654
3539f31f
PE
8655 Fix minor ralloc.c problems found by static checking.
8656 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8657 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8658 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8659 (r_alloc_sbrk): Now static.
8660
a041960a
PE
8661 Improve ralloc.c interface checking.
8662 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8663 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8664 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8665 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8666 [REL_ALLOC]: ... to here, to check interface.
8667 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8668 Remove decls. This fixes an "It stinks!".
8669
9426aba4
PE
8670 * alloc.c (which_symbols): Fix alignment issue / type clash.
8671
d55c12ed
AS
86722012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8673
8674 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8675 (struct Lisp_Misc_Any): Likewise.
8676 (struct Lisp_Free): Likewise.
8677 * alloc.c (union aligned_Lisp_Symbol): Define.
8678 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8679 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8680 (union aligned_Lisp_Misc): Define.
8681 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8682 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 8683 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 8684
b948ce8b
PE
86852012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8686
8687 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8688 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8689 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8690 * s/netbsd.h, s/sol2-6.h:
8691 Remove definition of GC_MARK_STACK, since the default now works.
8692 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8693 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8694 no longer the default.
8695 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8696
35dc09a1 86972012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8698
35dc09a1
GM
8699 * lread.c (lisp_file_lexically_bound_p):
8700 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 8701
35dc09a1
GM
87022012-04-14 Eli Zaretskii <eliz@gnu.org>
8703
8704 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8705 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8706
87072012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8708
8709 * nsterm.m (constrainFrameRect): Always constrain when there is only
8710 one screen (Bug#10962).
8711
bcd86815
KB
87122012-04-13 Ken Brown <kbrown@cornell.edu>
8713
8714 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8715
c25df26e
RT
87162012-04-13 Reuben Thomas <rrt@sc3d.org>
8717
8718 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8719
0fc59f1e
DC
87202012-04-11 Daniel Colascione <dancol@dancol.org>
8721
8722 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8723 against is gone. It's better to use vfork now so that when Cygwin
8724 gains a new, working vfork, we use it automatically (bug#10398).
8725
de8c03dc
SM
87262012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8727
8728 * window.c (save_window_save): Obey window-point-insertion-type.
8729
2f097256
GM
87302012-04-11 Glenn Morris <rgm@gnu.org>
8731
8732 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8733
453b951e
SM
87342012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8735
8736 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8737
75f1671a 87382012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
8739
8740 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8741 (force_quit_count): New var.
8742 (handle_interrupt): Use it.
8743
2a8ce227
JB
87442012-04-10 Juanma Barranquero <lekktu@gmail.com>
8745
8746 * w32.c (w32_delayed_load): Record the full path of the library
8747 being loaded (bug#10424).
8748
935396c0
GM
87492012-04-09 Glenn Morris <rgm@gnu.org>
8750
05920a43
GM
8751 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8752 not just in the obarray, before snarfing them. (Bug#11036)
8753
935396c0
GM
8754 * Makefile.in ($(leimdir)/leim-list.el):
8755 Pass EMACS rather than BUILT_EMACS.
8756
a18ecafa
TZ
87572012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8758
8759 * process.c (make_process):
8760 * process.h: Add integer `gnutls_handshakes_tried' member to
8761 process struct.
8762
6bbef4e5
JC
8763 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8764 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
8765
8766 * gnutls.c (gnutls_log_function2i): Convenience log function.
8767 (emacs_gnutls_read): Use new log functions,
8768 `gnutls_handshakes_tried' process member, and
8769 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8770 attempts per process (connection).
8771
b4d3bc10
CY
87722012-04-09 Chong Yidong <cyd@gnu.org>
8773
8774 * eval.c (Fuser_variable_p, user_variable_p_eh)
8775 (lisp_indirect_variable): Functions deleted.
8776 (Fdefvar): Caller changed.
8777
8778 * callint.c (Finteractive, Fcall_interactively):
8779 * minibuf.c (Fread_variable): Callers changed.
8780
70f4d973
EZ
87812012-04-09 Eli Zaretskii <eliz@gnu.org>
8782
8783 * xdisp.c (set_cursor_from_row): If the display string appears in
8784 the buffer at position that is closer to point than the position
8785 after the display string, display the cursor on the first glyph of
8786 the display string. Fixes cursor display when a 'display' text
8787 property immediately follows invisible text. (Bug#11094)
8788
cb3c2e3e
PE
87892012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8790
8791 composite.c: use 'double' consistently
8792 * composite.c (get_composition_id): Use 'double' consistently
8793 instead of converting 'float' to 'double' and vice versa; this is
8794 easier to understand and avoids a GCC warning.
8795
fd06db5d
GM
87962012-04-09 Glenn Morris <rgm@gnu.org>
8797
50fe702a
GM
8798 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8799 preparation for dumping it with emacs. (Bug#4789)
8800 (leimdir): New variable.
8801 ($(leimdir)/leim-list.el): New rule.
8802 (emacs$(EXEEXT)): Depend on leim-list.el.
8803
fd06db5d
GM
8804 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8805 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8806 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8807
55c131ee
AS
88082012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8809
8810 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8811 proper alignment.
8812
9209588f
JB
88132012-04-07 Juanma Barranquero <lekktu@gmail.com>
8814
8815 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8816 Remove unused local variable.
8817
e3fb2efb
PE
88182012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8819
8820 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8821 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8822 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8823 objects, as mark_maybe_pointer will catch them otherwise.
8824 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8825 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8826
b5385551
PE
88272012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8828
8829 Fix typo that broke non-Windows builds.
8830 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8831
9078ead6
EZ
88322012-04-07 Eli Zaretskii <eliz@gnu.org>
8833
8834 Support building on MS-Windows with libxml2.
8835
8836 * makefile.w32-in (OBJ2): Add xml.$(O).
8837 (GLOBAL_SOURCES): Add xml.c.
8838 ($(BLD)/xml.$(O)): New dependency list.
8839
8840 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8841 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8842 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8843 [!WINDOWSNT]: New macros.
8844 (init_libxml2_functions, libxml2_loaded_p): New functions.
8845 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8846 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8847 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8848 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8849 linked in).
6bbef4e5
JC
8850 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8851 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
8852 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8853
8854 * emacs.c: Don't include libxml/parser.h.
8855 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8856 xmlCleanupParser directly.
8857
8858 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8859
3811fdf3
EZ
88602012-04-07 Eli Zaretskii <eliz@gnu.org>
8861
8862 * indent.c (Fvertical_motion): If there is a display string at
8863 point, use it.vpos to compute how many lines to backtrack after
8864 move_it_to point. (Bug#11133)
8865
2f8e16b2
EZ
88662012-04-06 Eli Zaretskii <eliz@gnu.org>
8867
8868 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8869 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8870 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8871 macros related to unification of CJK characters. For the details,
8872 see the discussion following the message here:
8873 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8874
3d439cd1
CY
88752012-04-04 Chong Yidong <cyd@gnu.org>
8876
8877 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8878
8bc53d00
EZ
88792012-04-01 Eli Zaretskii <eliz@gnu.org>
8880
8881 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8882 instead of alloca. (Bug#11138)
8883
3b0512a3
AS
88842012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8885
8886 * w32menu.c (is_simple_dialog): Properly check lisp types.
8887 (Bug#11141)
8888
8427ddd2
EZ
88892012-03-31 Eli Zaretskii <eliz@gnu.org>
8890
979022ef
EZ
8891 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8892 position we get to after a call to move_it_to fails the
8893 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8894 only if we wind up in a string from display property. (Bug#11063)
8895
a6b1c7cc
EZ
8896 * window.c (Fdelete_other_windows_internal): Invalidate the row
8897 and column information about mouse highlight, so that redisplay
8898 restores it after reallocating the glyph matrices. (Bug#7464)
8899
8427ddd2
EZ
8900 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8901 string comes from a `display' text property, use the buffer
8902 position of that property as if we actually saw that position in
8903 the row's glyphs.
697ba24b
EZ
8904 (move_it_by_lines): Remove the assertion that
8905 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8906 violated when there's a before-string at the beginning of a line.
8907 (Bug#11063)
8427ddd2 8908
65a0a738
EZ
89092012-03-30 Eli Zaretskii <eliz@gnu.org>
8910
8911 * xdisp.c (append_space_for_newline): If the default face was
8912 remapped, use the remapped face for the appended newline.
8913 (extend_face_to_end_of_line): Use the remapped default face for
8914 extending the face to the end of the line.
8915 (display_line): Call extend_face_to_end_of_line when the default
8916 face was remapped. (Bug#11068)
8917
581355cc
EZ
89182012-03-29 Eli Zaretskii <eliz@gnu.org>
8919
8920 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8921
e8fc049f
SM
89222012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8923
8924 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8925
4fb9a543
GM
89262012-03-27 Glenn Morris <rgm@gnu.org>
8927
8928 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8929 Doc fixes.
8930
679910f1
KH
89312012-03-26 Kenichi Handa <handa@m17n.org>
8932
8933 * dispextern.h (struct glyph): Fix previous change. Change the
8934 bit length of glyphless.ch to 25 (Bug#11082).
8935
90d49b7f
CY
89362012-03-26 Chong Yidong <cyd@gnu.org>
8937
8938 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8939 (command_loop_1): Use it; inhibit selection update for
8940 handle-select-window too (Bug#8996).
8941
f514f6f0
FP
89422012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8943
e8fc049f 8944 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 8945
bf43fa51
KH
89462012-03-25 Kenichi Handa <handa@m17n.org>
8947
8948 * dispextern.h (struct glyph): Change the bit length of
8949 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8950
8a0c01dd
EZ
89512012-03-24 Eli Zaretskii <eliz@gnu.org>
8952
8953 * s/ms-w32.h (tzname): Include time.h before redirecting to
8954 _tzname. Fixes the MSVC build. (Bug#9960)
8955
7d1c3a76
AS
89562012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8957
8ed79523
AS
8958 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8959 characters.
8960
7d1c3a76
AS
8961 * xterm.c (XTread_socket): Only modify handling_signal if
8962 !SYNC_INPUT. (Bug#11080)
8963
e99a9b8b
EZ
89642012-03-23 Eli Zaretskii <eliz@gnu.org>
8965
8966 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8967 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8968 when fetching a multibyte character consumes more bytes than
8969 CHAR_BYTES returns, due to unification of CJK characters in
8970 string_char. (Bug#11073)
8971
5063c0e1
TN
89722012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8973
8974 * process.c (wait_reading_process_output): Handle pty disconnect
8975 by refraining from sending oneself a SIGCHLD (bug#10933).
8976
9f851fbd
CY
89772012-03-22 Chong Yidong <cyd@gnu.org>
8978
8979 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8980
5063c0e1 8981 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
8982 Mark string as coming from a prefix property.
8983 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8984 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8985
fb5b8aca
CY
89862012-03-21 Chong Yidong <cyd@gnu.org>
8987
8988 * xfaces.c (Vface_remapping_alist): Doc fix.
8989
62356a1b
EZ
89902012-03-20 Eli Zaretskii <eliz@gnu.org>
8991
8992 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
8993 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8994 Doc fixes.
62356a1b 8995
025de85b
CY
89962012-03-20 Chong Yidong <cyd@gnu.org>
8997
8998 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8999 to reflect default non-nil value of redisplay-dont-pause.
9000
4827f94e
KH
90012012-03-19 Kenichi Handa <handa@m17n.org>
9002
9003 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
9004 it fit in a valid range (Bug#11003).
9005
e50a24a2
EZ
90062012-03-18 Eli Zaretskii <eliz@gnu.org>
9007
9008 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
9009 that is not from display property, accept the row as a "cursor
9010 row" if one of the string's character has a non-nil `cursor'
9011 property. Fixes cursor positioning when there are newlines in
9012 overlay strings, e.g. in icomplete.el. (Bug#11035)
9013
9af5ed87
PE
90142012-03-12 Paul Eggert <eggert@cs.ucla.edu>
9015
9016 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
9017
d1f55f16
CY
90182012-03-12 Chong Yidong <cyd@gnu.org>
9019
9020 * eval.c (inhibit_lisp_code): Rename from
9021 inhibit_window_configuration_change_hook; move from window.c.
9022
9023 * xfns.c (unwind_create_frame_1, Fx_create_frame):
9024 * window.c (run_window_configuration_change_hook)
9025 (syms_of_window): Callers changed.
9026
66c5eebd
CY
90272012-03-11 Chong Yidong <cyd@gnu.org>
9028
413df973
CY
9029 * keymap.c (Fkey_description): Doc fix (Bug#9700).
9030
66c5eebd
CY
9031 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
9032
1de11f56
CY
90332012-03-10 Chong Yidong <cyd@gnu.org>
9034
9035 * frame.c (other_visible_frames): Don't assume the selected frame
9036 is visible (Bug#10955).
9037
cae07000
SM
90382012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
9039
9040 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9041
89c94350
JD
90422012-03-08 Jan Djärv <jan.h.d@swipnet.se>
9043
9044 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9045 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
9046 zero (Bug#10954).
9047
999dd333
GM
90482012-03-03 Glenn Morris <rgm@gnu.org>
9049
01a6dcc8 9050 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 9051
de0100f2
EZ
90522012-03-02 Eli Zaretskii <eliz@gnu.org>
9053
9054 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
9055 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
9056 (redisplay_window, next_element_from_string): Fix typos in
9057 comments.
3e441275
EZ
9058 (redisplay_window): Pass to move_it_vertically the margin in
9059 pixels, not in screen lines.
de0100f2 9060
96a72ee9
GM
90612012-03-02 Glenn Morris <rgm@gnu.org>
9062
9063 * buffer.c (buffer-list-update-hook): Doc fix.
9064
312508d7
EZ
90652012-02-29 Eli Zaretskii <eliz@gnu.org>
9066
9067 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9068 push_it before setting up the iterator for the first overlay
9069 string, even if we have an empty string loaded.
9070 (next_overlay_string): If there's an empty string on the iterator
9071 stack, pop the stack. (Bug#10903)
9072
27f3c637
PE
90732012-02-25 Paul Eggert <eggert@cs.ucla.edu>
9074
9075 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9076 Suggested by Stefan Monnier in
9077 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9078 * alloc.c (widen_to_Lisp_Object): New static function.
9079 (mark_memory): Also mark Lisp_Objects by fetching pointer words
9080 and widening them to Lisp_Objects. This would work even if
9081 USE_LSB_TAG is defined and wide integers are used, which might
9082 happen in a future version of Emacs.
9083
3c9dfce6
CY
90842012-02-25 Chong Yidong <cyd@gnu.org>
9085
fa74b241
CY
9086 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9087 Doc fix.
9088
3c9dfce6
CY
9089 * xselect.c (Fx_selection_exists_p): Doc fix.
9090 (x_clipboard_manager_save_all): Print an informative message
9091 before saving to clipboard manager.
9092
9486df08
CY
90932012-02-24 Chong Yidong <cyd@gnu.org>
9094
9095 * keyboard.c (process_special_events): Handle all X selection
9096 requests in kbd_buffer, not just the next one (Bug#8869).
9097
f01d3321
CY
90982012-02-23 Chong Yidong <cyd@gnu.org>
9099
9100 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9101 call when setting menu-bar-lines and tool-bar-lines parameters.
9102 (unwind_create_frame_1): New helper function.
9103
9104 * window.c (inhibit_window_configuration_change_hook): New var.
9105 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 9106 (syms_of_window): Initialize it.
f01d3321 9107
86b847b6
CY
91082012-02-22 Chong Yidong <cyd@gnu.org>
9109
9110 * xterm.c (x_draw_image_relief): Add missing type check for
9111 Vtool_bar_button_margin (Bug#10743).
9112
a59225b1
CY
91132012-02-21 Chong Yidong <cyd@gnu.org>
9114
9115 * fileio.c (Vfile_name_handler_alist): Doc fix.
9116
9117 * buffer.c (Fget_file_buffer): Protect against invalid file
9118 handler return value.
9119
310f5bd4
PE
91202012-02-20 Paul Eggert <eggert@cs.ucla.edu>
9121
cb3a28cc
PE
9122 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9123 when computing $valmask.
9124
310f5bd4
PE
9125 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9126 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9127 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9128 It's useless in that case, and it can cause problems on hosts
9129 that allocate halves of EMACS_INT values separately.
9130 Reported by Dan Horák. Diagnosed by Andreas Schwab in
9131 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9132 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9133 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
9134 it avoids undefined behavior on hosts where shifting right by more
9135 than the word width has undefined behavior.
9136
2375c96a
CY
91372012-02-19 Chong Yidong <cyd@gnu.org>
9138
9139 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9140 (Funhandled_file_name_directory, Ffile_name_as_directory)
9141 (Fdirectory_file_name, Fexpand_file_name)
9142 (Fsubstitute_in_file_name): Protect against invalid file handler
9143 return values (Bug#10845).
9144
3eb49e71
EZ
91452012-02-18 Eli Zaretskii <eliz@gnu.org>
9146
9147 * .gdbinit (pitx): Fix incorrect references to fields of the
9148 iterator stack.
9149
7b926f3f
CY
91502012-02-17 Chong Yidong <cyd@gnu.org>
9151
9152 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9153
11273115
PE
91542012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9155
9156 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9157 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9158
c3a70e2b
CY
91592012-02-15 Chong Yidong <cyd@gnu.org>
9160
9161 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9162 marked as special. Also, starting docstrings with * is obsolete.
9163
0ca43699
AS
91642012-02-13 Andreas Schwab <schwab@linux-m68k.org>
9165
9166 * gnutls.c (emacs_gnutls_write): Fix last change.
9167
2e8f3c56
LI
91682012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
9169
9170 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9171 send_process.
9172
af70074f
SM
91732012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
9174
9175 * keymap.c (Fsingle_key_description): Handle char ranges.
9176
95986d52
CY
91772012-02-12 Chong Yidong <cyd@gnu.org>
9178
afd83bd1
CY
9179 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9180 as that creates a dangerous corner case.
9181
95986d52
CY
9182 * window.c (Fdelete_window_internal): Invalidate the mouse
9183 highlight (Bug#9904).
9184
bd7da63e
GM
91852012-02-12 Glenn Morris <rgm@gnu.org>
9186
9187 * xselect.c (Fx_own_selection_internal)
9188 (Fx_get_selection_internal, Fx_disown_selection_internal)
9189 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
9190 * nsselect.m (Fx_own_selection_internal)
9191 (Fx_disown_selection_internal, Fx_selection_exists_p)
9192 (Fx_selection_owner_p, Fx_get_selection_internal):
9193 Sync docs and argument specs with the xselect.c versions.
9194
77abcbc2
LI
91952012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
9196
9197 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
9198
90b671e2
EZ
91992012-02-11 Eli Zaretskii <eliz@gnu.org>
9200
1c0ca0b7
EZ
9201 * w32select.c (Fx_selection_exists_p): Sync doc string and
9202 argument list with xselect.c. (Bug#10783)
9203
9204 * w16select.c (Fx_selection_exists_p): Sync doc string and
9205 argument list with xselect.c. (Bug#10783)
90b671e2 9206
49241268
GM
92072012-02-10 Glenn Morris <rgm@gnu.org>
9208
9209 * fns.c (Fsecure_hash): Doc fix.
9210
f998bbe7 92112012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
9212
9213 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
9214
0992bd9c
CY
92152012-02-07 Chong Yidong <cyd@gnu.org>
9216
9217 * buffer.c (Fbuffer_local_variables)
9218 (buffer_lisp_local_variables): Handle unbound vars correctly;
9219 don't let Qunbound leak into Lisp.
9220
af008560
GM
92212012-02-07 Glenn Morris <rgm@gnu.org>
9222
dd605cc4
GM
9223 * image.c (Fimagemagick_types): Doc fix.
9224
af008560
GM
9225 * image.c (imagemagick-render-type): Change it from a lisp object
9226 to an integer. Move the doc here from the lisp manual.
9227 Treat all values not equal to 0 the same.
9228
1449fa1d
CY
92292012-02-06 Chong Yidong <cyd@gnu.org>
9230
9231 * doc.c (store_function_docstring): Avoid applying docstring of
9232 alias to base function (Bug#2603).
9233
3723ec07
AS
92342012-02-04 Andreas Schwab <schwab@linux-m68k.org>
9235
9236 * .gdbinit (pp1, pv1): Remove redundant defines.
9237 (pr): Use pp.
9238
79c1cc1e
CY
92392012-02-04 Chong Yidong <cyd@gnu.org>
9240
9241 * nsterm.m: Declare a global (Bug#10694).
9242
d7f29f8e
EZ
92432012-02-04 Eli Zaretskii <eliz@gnu.org>
9244
cae07000
SM
9245 * w32.c (get_emacs_configuration_options):
9246 Include --enable-checking, if specified, in the return value.
d7f29f8e 9247
3b95a6f9
MR
92482012-02-04 Martin Rudalics <rudalics@gmx.at>
9249
9250 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9251 after rounding frame sizes. (Bug#9723)
9252
d6fa96a6
EZ
92532012-02-04 Eli Zaretskii <eliz@gnu.org>
9254
9255 * keyboard.c (adjust_point_for_property): Don't position point
9256 before BEGV. (Bug#10696)
9257
df0b2940
PE
92582012-02-03 Paul Eggert <eggert@cs.ucla.edu>
9259
9260 Handle overflow when computing char display width (Bug#9496).
9261 * character.c (char_width): Return EMACS_INT, not int.
9262 (char_width, c_string_width): Check for overflow when
9263 computing the width; this is possible now that individual
9264 characters can have unbounded width. Problem introduced
9265 by merge from Emacs 23 on 2012-01-19.
9266
6bee44d6
MA
92672012-02-02 Michael Albinus <michael.albinus@gmx.de>
9268
9269 * dbusbind.c (Fdbus_register_method): Mention the return value
9270 :ignore in the docstring.
9271
44f92739
GM
92722012-02-02 Glenn Morris <rgm@gnu.org>
9273
1b9f60cc
GM
9274 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9275
44f92739
GM
9276 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9277 Unconditionally set to t. (Bug#10673)
9278 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9279 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9280 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9281
c5d3843c
KH
92822012-02-02 Kenichi Handa <handa@m17n.org>
9283
9284 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
9285 0, do not call append_composite_glyph.
9286
159462d4 92872012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
9288
9289 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9290 NULL (Bug#6988).
9291 (x_produce_glyphs): If the component of a composition is a null
9292 string, set it->pixel_width to 1 to avoid zero-width glyph.
9293
78cef877
EZ
92942012-02-01 Eli Zaretskii <eliz@gnu.org>
9295
9296 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9297 first 2 arguments are identical. This makes inserting large
9298 output from a subprocess an order of magnitude faster on
9299 MS-Windows, where all sbrk'ed memory is always contiguous.
9300
97897668
GM
93012012-01-31 Glenn Morris <rgm@gnu.org>
9302
9303 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 9304 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
9305 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9306
31fd3586
GM
93072012-01-29 Glenn Morris <rgm@gnu.org>
9308
9309 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9310
0e24a8b2
CY
93112012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
9312
9313 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9314
cc0adcb0
CY
93152012-01-28 Chong Yidong <cyd@gnu.org>
9316
9317 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9318
acc28cb9
CY
93192012-01-26 Chong Yidong <cyd@gnu.org>
9320
9c69cfb7
CY
9321 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9322
acc28cb9
CY
9323 * search.c (Fsearch_forward, Fsearch_backward): Document negative
9324 repeat counts (Bug#10507).
9325
48da7392
GM
93262012-01-26 Glenn Morris <rgm@gnu.org>
9327
9328 * lread.c (syms_of_lread): Doc fix.
9329
14af5f7f
CY
93302012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
9331
9332 * coding.c (encode_designation_at_bol): Change return value to
9333 EMACS_INT.
9334
0b21c100
CY
93352012-01-25 Chong Yidong <cyd@gnu.org>
9336
9337 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
9338
3c2907f7
CY
93392012-01-21 Chong Yidong <cyd@gnu.org>
9340
9341 * floatfns.c (Fcopysign): Make the second argument non-optional,
9342 since nil is not allowed anyway.
9343
959ad23f
AS
93442012-01-21 Andreas Schwab <schwab@linux-m68k.org>
9345
9346 * process.c (read_process_output): Use p instead of XPROCESS (proc).
9347 (send_process): Likewise.
9348
34a02f46
MR
93492012-01-19 Martin Rudalics <rudalics@gmx.at>
9350
9351 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
9352 (Vwindow_persistent_parameters): Do not use Qstate.
9353 Rewrite doc-strings.
34a02f46 9354
1259009a 93552012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
9356
9357 * character.c (char_width): New function.
70d4fdf6
GM
9358 (Fchar_width, c_string_width, lisp_string_width):
9359 Use char_width (Bug#9496).
25ed9e61 9360
6a6ee00d
MR
93612012-01-16 Martin Rudalics <rudalics@gmx.at>
9362
9363 * window.c (Vwindow_persistent_parameters): New variable.
9364 (Fset_window_configuration, save_window_save): Handle persistent
9365 window parameters.
9366
c85efaf7
EZ
93672012-01-14 Eli Zaretskii <eliz@gnu.org>
9368
9369 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9370 thrashing the stack of the thread. (Bug#9087)
9371
5944709e
PE
93722012-01-12 Paul Eggert <eggert@cs.ucla.edu>
9373
9374 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9375
e71f5d99
EZ
93762012-01-11 Eli Zaretskii <eliz@gnu.org>
9377
9378 * xdisp.c (rows_from_pos_range): Handle the case where the
9379 highlight ends on a newline. (Bug#10464)
9380 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9381 he end column for display of highlight that ends on a newline
9382 before a R2L line.
9383
ce316182
GM
93842012-01-11 Glenn Morris <rgm@gnu.org>
9385
9386 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9387 from load-path also when installation-directory is nil. (Bug#10208)
9388
5b43da69
GM
93892012-01-10 Glenn Morris <rgm@gnu.org>
9390
74cc8ff9
GM
9391 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9392
7d8d6e4e
GM
9393 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9394 Update template values to be closer to their typical values these days.
5b43da69 9395
a0db8d43
EZ
93962012-01-09 Eli Zaretskii <eliz@gnu.org>
9397
9398 * xdisp.c (rows_from_pos_range): Accept additional argument
9399 DISP_STRING, and accept any glyph in a row whose object is that
9400 string as eligible for mouse highlight. Fixes mouse highlight of
9401 display strings from overlays. (Bug#10464)
9402
9a0115ab 94032012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 9404
b9110d6a 9405 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
9406 * fileio.c (auto_saving_dir_umask): New static var.
9407 (Fmake_directory_internal): Use it.
9408 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9409 creating the directory. The old code temporarily assigns
9410 too-generous permissions to the directory.
9411 (do_auto_save_eh): Clear it.
b9110d6a 9412 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
9413 that the var is always cleared.
9414
6c1bd3f3
EZ
94152012-01-07 Eli Zaretskii <eliz@gnu.org>
9416
9417 * search.c (scan_buffer): Pass character positions to
9418 know_region_cache, not byte positions. (Bug#6540)
9419
069d2b50
L
94202012-01-07 LynX <_LynX@bk.ru> (tiny change)
9421
9422 * w32.c (sys_rename): Report EXDEV when rename of a directory
9423 fails because the target is on another logical disk. (Bug#10284)
9424
75bf0d33
DB
94252012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9426
9427 * xterm.c (x_embed_request_focus): New function.
9428
9429 * xterm.h: Add prototype.
9430
9431 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9432
1c6e5a32
GM
94332012-01-05 Glenn Morris <rgm@gnu.org>
9434
9435 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9436
651e947e
EZ
94372012-01-01 Eli Zaretskii <eliz@gnu.org>
9438
9439 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9440 Load gnutls_transport_set_lowat only if GnuTLS version is below
9441 2.11.1.
9442 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9443 GnuTLS versions below 2.11.1.
9444
3778cdd8
AL
94452011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9446
9447 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9448 to the doc string advising against its use for altering the way
9449 windows are scrolled.
9450
0e5317f7
KH
94512011-12-28 Kenichi Handa <handa@m17n.org>
9452
9453 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9454 coding-system ASCII compatible only when it does not produce BOM
9455 on encoding (Bug#10383).
9456
93d5ca1f
JD
94572011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9458
9459 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9460 can scroll.
9461 (create_and_show_popup_menu): Always use menu_position_func for
9462 Gtk3 (Bug#10361).
9463
ca22b785
AS
94642011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9465
9466 * callint.c (Fcall_interactively): Don't truncate prompt string.
9467
d048e1e6
EZ
94682011-12-23 Eli Zaretskii <eliz@gnu.org>
9469
9470 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9471 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 9472 resumed from there (after widening). (Bug#10360)
d048e1e6 9473
5ccaba1f
JD
94742011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9475
9476 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9477
204ee57f
JD
94782011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9479
b81d40f0
JB
9480 * nsterm.m (x_free_frame_resources):
9481 Release f->output_data.ns->miniimage.
204ee57f
JD
9482 (ns_index_color): Fix indentation. Do not retain
9483 color_table->colors[i].
9484
9485 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9486 before returning.
9487
9488 * nsfns.m (x_set_background_color): Assign return value from
9489 ns_index_color to face-background instead of NSColor*.
9490 (ns_implicitly_set_icon_type): Fix indentation.
9491 Change assignment in for loop to comparison.
9492
9493 * emacs.c (ns_pool): New variable.
9494 (main): Assign ns_pool.
9495 (Fkill_emacs): Call ns_release_autorelease_pool.
9496
9497 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9498 autorelease fdesc, release fdAttrs and tdict.
9499 (ns_get_covering_families): Release charset.
9500 (ns_findfonts): Release NSFontDescriptor created with new.
9501 (ns_uni_to_glyphs): Fix indentation.
9502 (setString): Release attrStr before assigning new value.
9503
c803b2b7
JD
95042011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9505
678f4426
JD
9506 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9507 and NS_IMPL_COCOA.
9508 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9509 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9510
cd394be1 95112011-12-18 David Reitter <reitter@cmu.edu>
678f4426 9512
5fecd5fc
JD
9513 * nsterm.m (ns_term_init): Subscribe for notifications
9514 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9515 to method trackingNotification in EmacsMenu.
9516
9517 * nsmenu.m (trackingMenu): New variable.
3771cb17 9518 (trackingNotification): New method (from Aquamacs).
5fecd5fc 9519 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 9520 from Aquamacs (Bug#7030).
678f4426
JD
9521
95222011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 9523
c803b2b7
JD
9524 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9525 (symbol_to_nsstring): Fix indentation.
9526 (ns_symbol_to_pb): New function.
cae07000
SM
9527 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9528 (Fns_rotate_cut_buffers_internal): Remove.
9529 (Fns_store_selection_internal): Rename from
c803b2b7
JD
9530 Fns_store_cut_buffer_internal.
9531 (ns_get_foreign_selection, Fx_own_selection_internal)
9532 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
9533 (Fns_get_selection_internal, Fns_store_selection_internal):
9534 Use ns_symbol_to_pb and check if return value is nil.
9535 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9536 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
9537 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9538 renamed to Sns_store_selection_internal.
9539 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9540 and remove this function.
9541 (ns_handle_selection_clear): Remove, never used.
9542 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9543 here.
9544
e1b01a3a
KB
95452011-12-17 Ken Brown <kbrown@cornell.edu>
9546
9547 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9548 GID is unknown (Bug#10257).
9549
2adb6e85
PE
95502011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9551
9552 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9553 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9554 which caused a build failure on GNU/Linux IA-64. This problem was
9555 introduced by my 2011-10-07 patch.
9556
d1d7b339
JL
95572011-12-15 Juri Linkov <juri@jurta.org>
9558
9559 * image.c (imagemagick_error): New function. (Bug#10112)
9560 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9561 Use `imagemagick_error' where ImageMagick functions return
9562 `MagickFalse'.
9563 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9564 proper order.
9565
100d5755
KH
95662011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9567
9568 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9569 fill background (Bug#8992).
9570
454592a6
MR
95712011-12-13 Martin Rudalics <rudalics@gmx.at>
9572
9573 * window.c (Vwindow_combination_resize)
9574 (Vwindow_combination_limit): Use t instead of non-nil in
9575 doc-strings.
61d4b438
MR
9576 (Vrecenter_redisplay): Add first sentence of doc-string on
9577 separate line.
53524d93 9578 (Frecenter): Fix doc-string typo.
454592a6 9579
3633e3aa
KH
95802011-12-11 Kenichi Handa <handa@m17n.org>
9581
9582 * coding.c (Funencodable_char_position): Pay attention to the
9583 buffer text relocation (Bug#9389).
9584
7b9d523a 95852011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 9586
7b9d523a
JD
9587 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9588 gtk_init (Bug#10100).
9589
b73189c6
EZ
95902011-12-10 Eli Zaretskii <eliz@gnu.org>
9591
9592 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9593 IT->string is nil. (Bug#10263)
9594
f7dfe5d6
JD
95952011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9596
83faebb4
JD
9597 * nsterm.h (x_free_frame_resources): Declare.
9598
f7dfe5d6
JD
9599 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9600 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9601
9602 * nsterm.h (ns_get_defaults_value): Declare.
9603
9604 * nsterm.m (ns_default): Call ns_get_defaults_value.
9605
7cd4e72c
EZ
96062011-12-09 Eli Zaretskii <eliz@gnu.org>
9607
9608 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9609 (Bug#10170)
9610
b34d7317
YM
96112011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9612
9613 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9614 that where the value of an _OBJC_* symbol points to is in the .bss
9615 section (Bug#10240).
9616
76470ad1
KH
96172011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9618
9619 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 9620 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 9621
745fff94
KH
96222011-12-08 Kenichi Handa <handa@m17n.org>
9623
9624 * ftfont.c (get_adstyle_property): Fix previous change
9625 (Bug#10233).
9626
6e44397c
JB
96272011-12-07 Juanma Barranquero <lekktu@gmail.com>
9628
9629 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9630 dirs from the default value of EMACSLOADPATH (bug#10208).
9631
7efa6272
GM
96322011-12-07 Glenn Morris <rgm@gnu.org>
9633
9634 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9635 installation and source directories as well. (Bug#10208)
9636
f6fc4d87
CY
96372011-12-06 Chong Yidong <cyd@gnu.org>
9638
9639 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9640
2bf26180
GM
96412011-12-06 Glenn Morris <rgm@gnu.org>
9642
9643 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9644 as an error, not just -1. (Bug#10217)
9645
3a6ad4f0
CY
96462011-12-05 Chong Yidong <cyd@gnu.org>
9647
9648 * keyboard.c (process_special_events): New function.
9649 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9650
75a3b399
PE
96512011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9652
9653 * coding.c (encode_designation_at_bol): Don't use uninitialized
9654 local variable (Bug#9318).
9655
c3c9e25e
KH
96562011-12-05 Kenichi Handa <handa@m17n.org>
9657
9658 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9659 return Qnil (Bug#8046, Bug#10193).
9660
5eb05ea3
KH
96612011-12-05 Kenichi Handa <handa@m17n.org>
9662
9663 * coding.c (encode_designation_at_bol): New args charbuf_end and
9664 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
9665 (coding_set_source): Return how many bytes coding->source was
9666 relocated.
9667 (coding_set_destination): Return how many bytes
9668 coding->destination was relocated.
9669 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 9670 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
9671
96722011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9673
9674 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9675 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9676 macro (Bug#9318).
9677
96782011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9679
9680 The following changes are to fix Bug#9318.
9681
a79703f5 9682 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
9683 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9684 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 9685 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 9686
7dbda6df
JB
96872011-12-05 Juanma Barranquero <lekktu@gmail.com>
9688
9689 * lisp.h (process_quit_flag): Fix external declaration.
9690
6d5eb5b0
SM
96912011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9692
9693 Don't macro-inline non-performance-critical code.
9694 * eval.c (process_quit_flag): New function.
9695 * lisp.h (QUIT): Use it.
9696
a0c3fad0
JD
96972011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9698
9699 * nsfns.m (get_geometry_from_preferences): New function.
9700 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9701
6c07aac2
AS
97022011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9703
9704 * emacs.c (Qkill_emacs): Define.
9705 (syms_of_emacs): Initialize it.
9706 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9707 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
9708 (quit_throw_to_read_char): Add parameter `from_signal'.
9709 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
9710 * lisp.h (QUIT): Call Fkill_emacs if requested.
9711
c052ead4
JD
97122011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9713
9714 * widget.c (update_wm_hints): Return if wmshell is null.
9715 (widget_update_wm_size_hints): New function.
9716
9717 * widget.h (widget_update_wm_size_hints): Declare.
9718
9719 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9720 widget_update_wm_size_hints (Bug#10104).
9721
9e49252b
EZ
97222011-12-03 Eli Zaretskii <eliz@gnu.org>
9723
9724 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9725 before a newline, prepare the bidi iterator for consuming the
9726 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 9727 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 9728
02b16839
JL
97292011-12-02 Juri Linkov <juri@jurta.org>
9730
9731 * search.c (Fword_search_regexp): New Lisp function created from
9732 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9733 (Fword_search_backward, Fword_search_forward)
9734 (Fword_search_backward_lax, Fword_search_forward_lax):
9735 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9736 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9737
0068070e
SM
97382011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9739
9740 * fileio.c (Finsert_file_contents): Move after-change-function call
9741 to before the "handled:" label, since all "goto handled" appear in
9742 cases where the *-change-functions have already been properly called
9743 (bug#10117).
9744
3360a3fc
AS
97452011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9746
9747 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9748 waiting for input. (Bug#10169)
9749
73d6c093
EZ
97502011-11-30 Eli Zaretskii <eliz@gnu.org>
9751
9752 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9753 verifies glyph row's hash code--we have just reallocated the
9754 glyphs, so their contents can be complete garbage. (Bug#10164)
9755
febe6bea
JB
97562011-11-30 Juanma Barranquero <lekktu@gmail.com>
9757
9758 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9759
801a4313
EZ
97602011-11-30 Eli Zaretskii <eliz@gnu.org>
9761
9762 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9763 attributes are tested _before_ calling verify_row_hash, to protect
9764 against GCC re-ordering of the tests. (Bug#10164)
9765
2b56b87e
JD
97662011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9767
9768 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9769
9770 * xterm.c (handle_one_xevent): Only set async_visible and friends
9771 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 9772 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
9773 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9774
dbf31225
PE
97752011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9776
9777 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9778 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9779 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9780 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9781 All uses changed to use GCPRO1 etc.
9782 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9783 Revert to old implementation (i.e., before 2011-03-11).
9784
1305621b
YM
97852011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9786
9787 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9788 of scroll runs so as to avoid assigning disabled bogus rows and
9789 unnecessary graphics copy operations.
9790
8c9afb46
EZ
97912011-11-27 Eli Zaretskii <eliz@gnu.org>
9792
9793 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9794 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9795 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9796 (malloc, free, realloc, calloc): Redirect to e_* only when
9797 compiling Emacs.
9798
9799 * lisp.h (GCTYPEBITS): Move before first use.
9800 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9801 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9802 this macro definition.
9803
9804 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9805 _MSC_VER.
9806
54e9e3bf
JD
98072011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9808
6d5eb5b0
SM
9809 * gtkutil.c (xg_create_frame_widgets):
9810 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
9811 present with Gtk+ 2.0.
9812
83aca1cb
PE
98132011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9814
9815 * fileio.c (Finsert_file_contents): Undo previous change; see
9816 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9817
5b76caa4
PE
98182011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9819
9820 Rename locals to avoid shadowing.
9821 * fileio.c (Finsert_file_contents):
9822 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9823 * process.c (wait_reading_process_output):
9824 Rename inner 'proc' to 'p' to avoid shadowing.
9825 Indent for consistency with usual Emacs style.
9826
8c535114
EZ
98272011-11-25 Eli Zaretskii <eliz@gnu.org>
9828
9829 * xdisp.c (redisplay_window): If cursor row is not fully visible
9830 after recentering, and scroll-conservatively is set to a large
9831 number, scroll window by a few more lines to make the cursor fully
9832 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
9833 (start_display): Don't move to the next line if the display should
9834 start at a newline that is part of a display vector or an overlay
9835 string. (Bug#10119)
8c535114 9836
fa4fdb5c
JL
98372011-11-24 Juri Linkov <juri@jurta.org>
9838
9839 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9840 after the `MagickPingImage' call. (Bug#10112)
9841
90ec88df
CY
98422011-11-23 Chong Yidong <cyd@gnu.org>
9843
9844 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9845
56e2e794
MR
98462011-11-23 Martin Rudalics <rudalics@gmx.at>
9847
9848 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9849 making another buffer current. (Bug#10114)
9850
b6e64c41
GM
98512011-11-23 Glenn Morris <rgm@gnu.org>
9852
9853 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9854
6b21de18
CY
98552011-11-23 Chong Yidong <cyd@gnu.org>
9856
9857 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9858 using it (Bug#5984).
9859
b12cd789
EZ
98602011-11-22 Eli Zaretskii <eliz@gnu.org>
9861
9862 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9863 and header-lines, as they don't have one computed for them.
9864 (Bug#10098)
9865
9866 * .gdbinit (prow): Make displayed values more self-explaining.
9867 Add row's hash code.
9868
261b6fd4
LMI
98692011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9870
9871 * process.c (wait_reading_process_output): Fix asynchrounous
9872 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 9873 (wait_reading_process_output): Add comment and URL.
261b6fd4 9874
e7cfd277
JD
98752011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9876
9877 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9878
a9b9b7f5
CY
98792011-11-21 Chong Yidong <cyd@gnu.org>
9880
9881 * window.c (Fnext_window, Fprevious_window): Doc fix.
9882
b0d15b4f
SM
98832011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9884
9885 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9886
fe7a3057
JB
98872011-11-20 Juanma Barranquero <lekktu@gmail.com>
9888
9889 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9890
d2999b1a
MR
98912011-11-20 Martin Rudalics <rudalics@gmx.at>
9892
9893 * window.c (Fset_window_combination_limit): Rename argument
9894 STATUS to LIMIT.
9895 (Vwindow_combination_limit): Remove "status" from doc-string.
9896
d5ff9cd0
AS
98972011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9898
9899 * m/ibms390.h: Remove.
9900 * m/ibms390x.h: Don't include "ibms390.h".
9901
a5bb9bd3
SM
99022011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9903
9904 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9905 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9906
cd1181db
JB
99072011-11-20 Juanma Barranquero <lekktu@gmail.com>
9908
9909 * casetab.c (Fset_case_table):
9910 * charset.c (Fcharset_after): Fix typos.
9911
615a3b8d 99122011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 9913
17e845af
PE
9914 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9915 Otherwise, valgrind does not work on some platforms.
9916 Problem reported by Andreas Schwab in
6a0bf43d
PE
9917 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9918 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9919 is set, removing the need for VIRT_ADDRESS_VARIES.
9920 (PURE_P): Use a more-efficient implementation that needs just one
9921 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9922 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9923 to 4 (xorl, subq, cmpq, setbe).
9924 * alloc.c (pure): Always extern now, since that's the
9925 VIRT_ADDR_VARIES behavior.
9926 (PURE_POINTER_P): Use a single comparison, not two, for
9927 consistency with the new puresize.h.
9928 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9929 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9930 Remove VIRT_ADDR_VARIES no longer needed.
9931
f8fe6f96
EZ
99322011-11-19 Eli Zaretskii <eliz@gnu.org>
9933
9934 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9935 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9936 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9937 behave as if the cursor position were at the window margin.
9938
9939 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9940 and the cursor position is out of bounds, behave as if the cursor
9941 position were at the window margin. (Bug#10075)
9942
df05a53c
CY
99432011-11-18 Chong Yidong <cyd@gnu.org>
9944
9945 * window.c (Fwindow_combination_limit): Make first argument
9946 non-optional, since it is meaningless for live windows like the
9947 selected window.
61ccba97 9948
2071918e
DA
99492011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9950
9951 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9952
b50a28de
SM
99532011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9954
9955 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9956 (graft_intervals_into_buffer): Simplify.
9957
015137db
EZ
99582011-11-18 Eli Zaretskii <eliz@gnu.org>
9959
9960 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9961 hash values of the two rows.
9962 (copy_row_except_pointers): Preserve the used[] arrays and the
9963 hash values of the two rows. (Bug#10035)
68c95424 9964 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
9965
9966 * xdisp.c (row_hash): New function, body extracted from
9967 compute_line_metrics.
9968 (compute_line_metrics): Call row_hash, instead of computing the
9969 hash code inline.
9970
9971 * dispnew.c (verify_row_hash): Call row_hash for computing the
9972 hash code of a row, instead of duplicating code from xdisp.c.
9973
9974 * dispextern.h (row_hash): Add prototype.
9975
a2addb04
TH
99762011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9977
9978 * frame.c (delete_frame): Don't delete the terminal when the last
9979 X frame is closed if emacs is built with GTK toolkit.
9980
df85d315
JB
99812011-11-17 Juanma Barranquero <lekktu@gmail.com>
9982
9983 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9984
a0c2d0ae
MR
99852011-11-17 Martin Rudalics <rudalics@gmx.at>
9986
9987 * window.c (Vwindow_splits): Rename to
9988 Vwindow_combination_resize. Suggested by Juri Linkov.
9989 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9990 of Vwindow_splits.
9991
58179cce
JB
99922011-11-16 Juanma Barranquero <lekktu@gmail.com>
9993
7877f373
JB
9994 * nsfns.m (Fns_font_name):
9995 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 9996
b6f67890
MR
99972011-11-16 Martin Rudalics <rudalics@gmx.at>
9998
9999 * window.h (window): Rename slot "nest" to "combination_limit".
10000 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
10001 (Fset_window_nest): Rename to Fset_window_combination_limit.
10002 (Vwindow_nest): Rename to Vwindow_combination_limit.
10003 (recombine_windows, make_parent_window, make_window)
10004 (Fsplit_window_internal, saved_window)
10005 (Fset_window_configuration, save_window_save): Rename all
10006 occurrences of window_nest to window_combination_limit.
10007
c7015153
JB
100082011-11-15 Juanma Barranquero <lekktu@gmail.com>
10009
10010 * image.c (imagemagick_load_image): Fix typo.
10011
322ad6ec
EZ
100122011-11-14 Eli Zaretskii <eliz@gnu.org>
10013
10014 * xdisp.c (display_line): Move the call to
10015 highlight_trailing_whitespace before the call to
10016 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
10017 faces of all the glyphs to compute ROW's hash value.
10018 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 10019
f067b8ec
JB
100202011-11-14 Juanma Barranquero <lekktu@gmail.com>
10021
10022 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
10023 just return (bug#10044).
10024
1e5b2111
EZ
100252011-11-12 Eli Zaretskii <eliz@gnu.org>
10026
7ef3cbd5
EZ
10027 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
10028 with user-defined heap size. Bump the default size of the temacs
10029 heap to 27MB, to avoid memory warning when running temacs.
10030 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
10031
1e5b2111
EZ
10032 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
10033 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
10034 (verify_row_hash) [XASSERTS]: New function.
10035 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
10036 that the hash value of glyph rows is correct.
1e5b2111 10037
89d61221
MR
100382011-11-12 Martin Rudalics <rudalics@gmx.at>
10039
10040 * window.h (window): Remove splits slot.
10041 * window.c (Fwindow_splits, Fset_window_splits): Remove.
10042 (Fdelete_other_windows_internal, make_parent_window)
10043 (make_window, Fsplit_window_internal, Fdelete_window_internal)
10044 (Fset_window_configuration, save_window_save): Don't deal with
10045 split status of windows.
10046 (saved_window): Remove splits slot.
10047 (Vwindow_splits): Rewrite doc-string.
10048
97f18cc8
JD
100492011-11-11 Jan Djärv <jan.h.d@swipnet.se>
10050
10051 * xfns.c (unwind_create_frame):
10052 * nsfns.m (unwind_create_frame):
10053 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
10054 Vframe_list (Bug#9999).
10055
22a648b4
DA
100562011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
10057
0b381c7e 10058 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 10059
659afede
KH
100602011-11-11 Kenichi Handa <handa@m17n.org>
10061
10062 * callproc.c (Fcall_process): Set the member dst_multibyte of
10063 process_coding.
10064
9ac0394b
KH
100652011-11-11 Johan Bockgård <bojohan@gnu.org>
10066
10067 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10068 avoid a crash (bug#9496).
10069
2fbdc249
CY
100702011-11-09 Chong Yidong <cyd@gnu.org>
10071
10072 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10073 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10074
ac6b1f81
PE
100752011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10076
10077 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10078
09db192c
PE
100792011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10080
10081 Avoid some portability problems by eschewing 'extern inline' functions.
10082 The trivial performance wins aren't worth the portability hassles; see
10083 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10084 et seq.
10085 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10086 (window_box_width, window_box_left, window_box_left_offset)
10087 (window_box_right, window_box_right_offset): Undo previous change,
10088 by removing the "extern"s.
10089 * intervals.c (adjust_intervals_for_insertion)
10090 (adjust_intervals_for_deletion): Undo previous change,
10091 making these static again.
10092 (offset_intervals, temp_set_point_both, temp_set_point)
10093 (copy_intervals_to_string): No longer inline.
10094 * xdisp.c (window_text_bottom_y, window_box_width)
10095 (window_box_height, window_box_left_offset)
10096 (window_box_right_offset, window_box_left, window_box_right)
10097 (window_box): No longer inline.
10098
105216ed
CY
100992011-11-08 Chong Yidong <cyd@gnu.org>
10100
10101 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
10102 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
10103 Signal an error if not a live window.
105216ed
CY
10104 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
10105 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
10106
ae9e237f
JB
101072011-11-07 Juanma Barranquero <lekktu@gmail.com>
10108
10109 * lisp.h (syms_of_abbrev): Remove declaration.
10110 Reported by CHENG Gao <chenggao@royau.me>.
10111
c7aa8333
EZ
101122011-11-07 Eli Zaretskii <eliz@gnu.org>
10113
10114 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10115 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
10116 of temacs in GUI mode.
10117
be7f5545
MR
101182011-11-07 Martin Rudalics <rudalics@gmx.at>
10119
10120 * window.h: Declare delete_all_child_windows instead of
10121 delete_all_subwindows.
10122 * window.c (Fwindow_nest, Fset_window_nest)
10123 (Fset_window_new_total, Fset_window_new_normal)
10124 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10125 (delete_all_subwindows): Rename to delete_all_child_windows.
10126 (Fdelete_other_windows_internal, Fset_window_configuration):
10127 Call delete_all_child_windows instead of delete_all_subwindows.
10128 * frame.c (delete_frame): Call delete_all_child_windows instead
10129 of delete_all_subwindows.
10130
ca78dc43
PE
101312011-11-07 Paul Eggert <eggert@cs.ucla.edu>
10132
10133 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10134 This is also needed for porting to any host where GC_MARK_STACK is
10135 not GC_MAKE_GCPROS_NOOPS.
10136 (which_symbols): Use it.
10137
a0241d01
KH
101382011-11-07 Kenichi Handa <handa@m17n.org>
10139
10140 * coding.c (coding_set_destination): Check coding->src_pos only
10141 when coding->src_object is a buffer (bug#9910).
10142
10143 * process.c (send_process): Set the member src_multibyte of coding
10144 to 0 (bug#9911) when sending a unibyte text.
10145
10146 * callproc.c (Fcall_process): Set the member src_multibyte of
10147 process_coding to 0 (bug#9912).
10148
a64bfdfa 101492011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
10150
10151 * xmenu.c (cleanup_widget_value_tree): New function.
10152 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10153 calling free_menubar_widget_value_tree directly (Bug#9830).
10154
cb41b32a
PE
101552011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10156
10157 Fix some portability problems with 'inline'.
10158 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10159 (window_box_width, window_box_left, window_box_left_offset)
10160 (window_box_right, window_box_right_offset): Declare extern.
10161 Otherwise, these inline functions do not conform to C99 and
10162 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
10163 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10164 * intervals.c (adjust_intervals_for_insertion)
10165 (adjust_intervals_for_deletion): Now extern, because otherwise the
10166 extern inline functions 'offset_intervals' couldn't refer to it.
10167 (static_offset_intervals): Remove.
10168 (offset_intervals): Rewrite using the old contents of
10169 static_offset_intervals. The old version didn't conform to C99
10170 because an extern inline function contained a reference to an
10171 identifier with static linkage.
10172
b7041366
AS
101732011-11-06 Andreas Schwab <schwab@linux-m68k.org>
10174
10175 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10176 GC.
10177
88a37c4d
EZ
101782011-11-06 Eli Zaretskii <eliz@gnu.org>
10179
10180 * xdisp.c (init_iterator, reseat_to_string): Don't set the
10181 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
10182 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10183 return Qleft_to_right.
10184
49745b39
CY
101852011-11-06 Chong Yidong <cyd@gnu.org>
10186
10187 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
10188 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
10189 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
10190 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
10191 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
10192 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
10193 (Fwindow_vscroll): Doc fix.
10194 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
10195 argument, since it makes no sense to pass a live window and for
10196 consistency with window-child.
10197
1f05cd82
CS
101982011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
10199
10200 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
10201 support MSVC.
10202
22610910
JR
102032011-11-05 Jason Rumney <jasonr@gnu.org>
10204
10205 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
10206 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
10207 fonts (Bug#6029).
10208 (add_font_entity_to_list): Fix logic errors in mixed boolean and
10209 bitwise arithmetic preventing use of unicode-sip and non-truetype
10210 opentype fonts.
10211
a06776b2
EZ
102122011-11-05 Eli Zaretskii <eliz@gnu.org>
10213
3ad924ba
EZ
10214 * s/ms-w32.h (fstat, stat, utime): Move redirections to
10215 "emacs"-only part.
10216
a06776b2
EZ
10217 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
10218 initialization code to keep similarity to xfns.c after changes
10219 from 2011-11-05.
10220
c9e7db78
JD
102212011-11-05 Jan Djärv <jan.h.d@swipnet.se>
10222
a97f8f3f
JD
10223 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
10224 (unwind_create_frame): New function (Bug#9943).
10225 (Fx_create_frame): Restructure code to be more similar to the one in
10226 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
10227 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
10228 Move terminal->reference_count++ just before making the frame official
10229 (Bug#9943).
10230
10231 * nsterm.m (x_free_frame_resources): New function.
10232 (x_destroy_window): Move code to x_free_frame_resources.
10233
c9e7db78 10234 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
10235 (Fx_create_frame, x_create_tip_frame):
10236 Move terminal->reference_count++ just before making the frame
75f1671a 10237 official. Move initialization of image_cache_refcount and
c9e7db78
JD
10238 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
10239
a6fc3b5c
EZ
102402011-11-05 Eli Zaretskii <eliz@gnu.org>
10241
10242 Support MSVC build with newer versions of Visual Studio.
10243 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
10244 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
10245 nt/gmake.defs.
10246
10247 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10248 which are not supported by MSVC.
10249 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10250 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10251 bitfields.
10252 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10253 types in bitfields.
10254 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10255
10256 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10257
58179cce 102582011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
10259
10260 Support MSVC build with newer versions of Visual Studio.
10261 * w32.c: Don't include w32api.h for MSVC.
10262 (init_environment) [_MSC_VER]: Call sys_access, not _access.
10263
10264 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10265 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10266 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10267 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10268 e_* cousins.
10269 (alloca) [_MSC_VER]: Define to _alloca.
10270
10271 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10272
10273 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10274
a58c13ed
EZ
102752011-11-04 Eli Zaretskii <eliz@gnu.org>
10276
10277 * xdisp.c (note_mouse_highlight): If either of
10278 previous/next-single-property-change returns nil, treat that as
10279 the beginning or the end of the buffer. (Bug#9955)
10280
fe0b6370
JD
102812011-11-04 Jan Djärv <jan.h.d@swipnet.se>
10282
a58c13ed 10283 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
10284 label is not null (Bug#9951).
10285 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10286 may be NULL.
10287
89bd5ee1
EZ
102882011-11-04 Eli Zaretskii <eliz@gnu.org>
10289
10290 * window.c (Fwindow_body_size): Mention in the doc string that the
10291 return value is in frame's canonical units. (Bug#9949)
10292
84c3edb9
EZ
102932011-11-03 Eli Zaretskii <eliz@gnu.org>
10294
4e2fb5c7
EZ
10295 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
10296
84c3edb9 10297 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 10298 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 10299 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 10300
bc17a887
EZ
103012011-11-01 Eli Zaretskii <eliz@gnu.org>
10302
10303 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10304 Don't stop backward scan on the continuation glyph, even though
10305 its CHARPOS is positive.
6d5eb5b0
SM
10306 (mouse_face_from_buffer_pos, note_mouse_highlight):
10307 Rename cover_string to disp_string.
bc17a887 10308
4ee88440
MR
103092011-11-01 Martin Rudalics <rudalics@gmx.at>
10310
10311 * window.c (temp_output_buffer_show): Don't use
10312 Vtemp_buffer_show_specifiers.
10313 (Vtemp_buffer_show_specifiers): Remove unused variable.
10314
c2ff3c02
EZ
103152011-10-30 Eli Zaretskii <eliz@gnu.org>
10316
10317 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10318 past the beginning of the current glyph matrix.
10319
58179cce 103202011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
10321
10322 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10323 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10324 HAVE_GTK3 (Bug#9869).
b77a6a7f 10325
3b574623
JD
10326 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10327 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10328
b77a6a7f
JD
10329 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10330
10331 * xterm.c: Declare x_handle_net_wm_state to return int.
10332 (handle_one_xevent): Check if we are iconified but don't have
10333 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
10334 (get_current_wm_state): Return non-zero if not hidden,
10335 check for _NET_WM_STATE_HIDDEN (Bug#9893).
10336 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
10337 (x_handle_net_wm_state): Return what get_current_wm_state returns.
10338 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
10339
196e41e4
PE
103402011-10-29 Paul Eggert <eggert@cs.ucla.edu>
10341
10342 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
10343 so that this new function doesn't get optimized away by a
10344 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
10345
021f2e1a
AS
103462011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10347
10348 * frame.h (MOUSE_HL_INFO): Remove excess parens.
10349
8b058d44
EZ
103502011-10-29 Eli Zaretskii <eliz@gnu.org>
10351
10352 Fix the `xbytecode' command.
10353 * .gdbinit (xprintbytestr): New command.
b50a28de 10354 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
10355 (xbytecode): Print the byte-code string as well.
10356
4452fb80
EZ
103572011-10-29 Kim Storm <storm@cua.dk>
10358
8b058d44
EZ
10359 * alloc.c (which_symbols): New function.
10360
21b72067
AS
103612011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10362
10363 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
10364 line. (Bug#9903)
10365
83ed7b5c
GM
103662011-10-29 Glenn Morris <rgm@gnu.org>
10367
10368 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10369 Not clear what it was for, and it causes various bugs. (Bug#9839)
10370
5a7a728b
EZ
103712011-10-28 Eli Zaretskii <eliz@gnu.org>
10372
10373 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10374 possible random value that matches one of those tested as
10375 condition to clear the mouse face.
10376
d3d0842f
CY
103772011-10-28 Chong Yidong <cyd@gnu.org>
10378
10379 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10380
31b39d13
DN
103812011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
10382
10383 * window.c (make_window): Initialize phys_cursor_on_p.
10384
9aba6043
SM
103852011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
10386
10387 * lisp.h (struct Lisp_Symbol): Update comments.
10388
c20992f4
JB
103892011-10-28 Juanma Barranquero <lekktu@gmail.com>
10390
10391 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10392
db4f02f2
EZ
103932011-10-28 Eli Zaretskii <eliz@gnu.org>
10394
10395 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
10396 <oslsachem@gmail.com> for helping to debug this.
10397
10398 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10399 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10400 (g_b_init_get_glyph_outline_w): New static variables.
10401 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10402 (GetGlyphOutlineW_Proc): New typedefs.
10403 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
10404 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10405 New functions.
10406 (w32font_open_internal, compute_metrics):
10407 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
10408 instead of calling the "wide" APIs directly.
10409
10410 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10411
10412 * w32.h (syms_of_w32font): Add prototype.
10413
87e68db4
JB
104142011-10-27 Juanma Barranquero <lekktu@gmail.com>
10415
10416 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10417 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10418 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10419 (Fmove_to_window_line): Doc fix.
10420
435c1d67
CY
104212011-10-27 Chong Yidong <cyd@gnu.org>
10422
10423 * process.c (make_process): Set gnutls_state to NULL.
10424
10425 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10426 non-NULL, regardless of GNUTLS_INITSTAGE.
10427 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10428 an error. Set process slots as soon as we allocate them.
10429
10430 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10431
9c6c6f49
CY
104322011-10-27 Chong Yidong <cyd@gnu.org>
10433
9aba6043
SM
10434 * gnutls.c (emacs_gnutls_deinit): New function.
10435 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
10436 (Fgnutls_deinit, Fgnutls_boot): Use it.
10437
10438 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10439 (deactivate_process): Call emacs_gnutls_deinit.
10440
657d08d3
JB
104412011-10-27 Juanma Barranquero <lekktu@gmail.com>
10442
10443 * image.c (x_create_x_image_and_pixmap):
10444 * w32.c (sys_rename, w32_delayed_load):
10445 * w32font.c (fill_in_logfont):
10446 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10447
5430d399
JB
104482011-10-26 Juanma Barranquero <lekktu@gmail.com>
10449
10450 * w32fns.c (w32_default_color_map): New function,
10451 extracted from Fw32_default_color_map.
a7ef684b 10452 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 10453
fe0055fa
PE
104542011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10455
10456 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10457
e6346438
SM
104582011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10459
10460 * keyboard.c (test_undefined): New function (bug#9751).
10461 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10462
e112cc37
ET
104632011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10464
10465 * sysdep.c (init_sys_modes): Fix the check for the controlling
10466 terminal (Bug#6649).
10467
7b5d6677
EZ
104682011-10-20 Eli Zaretskii <eliz@gnu.org>
10469
10470 * dispextern.h (struct bidi_it): New member next_en_type.
10471
10472 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10473 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10474 current character, check also for next_en_type being WEAK_EN.
10475 (bidi_resolve_weak): Don't enter the expensive loop if the current
10476 position is before next_en_pos. Record the bidi type of the first
10477 non-ET, non-BN character we find, in addition to its position.
10478 (bidi_level_of_next_char): Invalidate next_en_type when
10479 next_en_pos is over-stepped.
10480
7da0b018
PE
104812011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10482
10483 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10484 * editfns.c: Rewrite current-time-zone so that it invokes
10485 the equivalent of (format-time-string "%Z") to get the time zone name.
10486 This fixes a bug when the time zone name contains characters that
10487 need converting from the system time locale to Emacs internal format.
10488 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10489 that patch fixed format-time-string to do the conversion, but
10490 I forgot to fix current-time-zone.
10491 (format_time_string): New function, containing most of
10492 what Fformat_time_string used to contain.
10493 (Fformat_time_string): Rewrite in terms of format_time_string.
10494 This doesn't change this function's behavior.
10495 (current-time-zone): Rewrite to use format_time_string.
10496 This fixes the bug reported by Michael Schierl in
10497 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10498 Jason Rumney's 2007-06-07 change worked around this bug, but
10499 didn't fix it.
10500 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10501
8547b010
EZ
105022011-10-19 Eli Zaretskii <eliz@gnu.org>
10503
10504 * xdisp.c (start_display): If the character at POS is displayed
10505 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
10506 (try_window_reusing_current_matrix): If a line ends in a display
10507 vector or the next line starts in a display vector, continue
10508 redrawing the window even though the character position of
10509 start_row was reached.
8547b010
EZ
10510 (Bug#9771, part 2)
10511
4e948d15
CY
105122011-10-18 Chong Yidong <cyd@gnu.org>
10513
10514 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10515 with nobreak-char-display too.
10516
4787455f
EZ
105172011-10-18 Eli Zaretskii <eliz@gnu.org>
10518
10519 Fix part 3 of bug#9771.
10520 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10521 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10522 non-neutral characters if the current character is a paragraph
10523 separator (a.k.a. Newline). This avoids running the same
10524 expensive loop twice, once when we consume the preceding newline
10525 and the other time when the line actually needs to be displayed.
10526 Avoid the loop when we see neutrals on the base embedding level
10527 following a character whose directionality is the same as the
10528 paragraph's. This avoids running the expensive loop when a line
10529 ends in a long sequence of neutrals, like control characters.
10530 Add assertion against STRONG_AL type. Slightly rearrange code
10531 that determines the type of a neutral given the first non-neutral
10532 that follows it.
10533 (bidi_level_of_next_char): Set next_en_pos to zero when
10534 invalidating its info.
10535
2c91f553
EZ
105362011-10-17 Eli Zaretskii <eliz@gnu.org>
10537
10538 * xdisp.c (push_display_prop): Determine whether to record string
10539 or buffer position by IT->string, not by IT->method. Allow
10540 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
10541 (move_it_vertically_backward): Don't look for character position
10542 immediately after the newline when in a continuation line.
10543 (Bug#9771, part 1)
2c91f553 10544
c7b08b0d
MR
105452011-10-15 Martin Rudalics <rudalics@gmx.at>
10546
10547 * window.c (coordinates_in_window): Rewrite and delabelize
10548 vertical border check. (Bug#5357) (Bug#9618)
10549
6b02f655
SM
105502011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10551
10552 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10553 errors in XSetWindowBorder (bug#9310).
10554
81d40c92
DA
105552011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10556
10557 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10558 avoid crash when xmalloc overrun checking is enabled.
10559
d4172c3b
EZ
105602011-10-13 Eli Zaretskii <eliz@gnu.org>
10561
10562 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10563 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10564 cursor motion with <left> and <right> arrow keys.
10565
10566 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10567 some callers set that themselves.
10568
b00eea75
EZ
105692011-10-12 Eli Zaretskii <eliz@gnu.org>
10570
10571 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10572 display string and the previous row comes from the same string and
10573 is empty. (Bug#9739) (Bug#9738)
10574
8fe012c4
SM
105752011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10576
10577 * doc.c (get_doc_string): Encode file name (bug#9735).
10578
0074aef2
EZ
105792011-10-12 Eli Zaretskii <eliz@gnu.org>
10580
79beb178
EZ
10581 * bidi.c (bidi_level_of_next_char):
10582 * xdisp.c (get_visually_first_element): Remove old incorrect
10583 comments regarding the Unicode Line Separator character.
10584
0074aef2
EZ
10585 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10586
6e4b3fbe
DA
105872011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10588
10589 * alloc.c (Fgc_status): Do not access beyond zombies array
10590 boundary if nzombies > MAX_ZOMBIES.
10591 * alloc.c (dump_zombies): Add missing format specifier.
10592
0324f3af
PE
105932011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10594
b5525cac
PE
10595 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10596 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10597
0324f3af
PE
10598 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10599 Some packages use them to denote characters with modifiers.
10600
e9b5f888
AS
106012011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10602
10603 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10604 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10605 matching a pp-number. Rename parameter var to var1.
10606
127827c0
SM
106072011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10608
10609 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10610
c8fd3bd0
GM
106112011-10-08 Glenn Morris <rgm@gnu.org>
10612
10613 * callint.c (Fcall_interactively): Give a more explicit error for the
10614 'c' case with a non-character input. (Bug#8479)
10615
352ec8ff
EZ
106162011-10-08 Eli Zaretskii <eliz@gnu.org>
10617
03669ccb
EZ
10618 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10619 lines.
7061c986
EZ
10620 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10621 lines that are hscrolled on the left.
03669ccb 10622
352ec8ff
EZ
10623 * dispnew.c (buffer_posn_from_coords): Account for a possible
10624 presence of header-line. (Bug#4426)
10625
a66cfb1c
SM
106262011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10627
6b02f655
SM
10628 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10629 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 10630
7c5ee88e
PE
106312011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10632
10633 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10634 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10635 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10636 this makes Emacs dump core during garbage collection on rare
10637 occasions. sizeof is obviously inferior to offsetof here, so
10638 stick with offsetof.
10639 (GC_POINTER_ALIGNMENT): New macro.
10640 (mark_memory): Omit 3rd (offset) arg; caller changed.
10641 Don't assume EMACS_INT alignment is the same as pointer alignment.
10642
df1bbe5b
SM
106432011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10644
10645 * keyboard.c (read_key_sequence_remapped): New var.
10646 (read_key_sequence): Compute remapping in the right buffer.
10647 (command_loop_1): Use read_key_sequence's remapping directly.
10648
51553db6
SM
106492011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10650
32c1fffd
SM
10651 * dired.c (file_name_completion): Don't expand file name.
10652 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10653 before checking file name handler.
10654
51553db6
SM
10655 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10656 they've been requested explicitly (bug#9591).
10657
b6bd1599 106582011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
10659
10660 * keymap.c (Fsingle_key_description): Use make_specified_string
10661 instead of build_string to build string from push_key_description.
10662 (Bug#5193)
10663
f701dc2a
PE
106642011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10665
4222c55d
PE
10666 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10667 This fixes a Y2038 bug on 64-bit hosts.
10668 * buffer.c (reset_buffer):
10669 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10670 (Fclear_buffer_auto_save_failure):
10671 Use 0, not -1, to represent an unset failure time, since time_t
10672 might not be signed.
10673
f701dc2a
PE
10674 Remove dependency on glibc malloc internals.
10675 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10676 Move back here from lisp.h, but with their new implementations.
10677 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10678 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10679 * charset.c (charset_table_init): New static var.
10680 (syms_of_charset): Use it instead of xmalloc. This removes a
10681 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10682 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10683 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10684 Move back to alloc.c.
10685 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10686 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10687
9ceebf39
JD
106882011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10689
10690 * nsterm.m (windowDidResize): Call x_set_window_size only when
10691 ns_in_resize is true. Otherwise set pixelwidth/height and
10692 call change_frame_size (Bug#9628).
10693
cb993c58
PE
106942011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10695
3930c88b
PE
10696 Port --enable-checking=all to Fedora 14 x86-64.
10697 * charset.c (syms_of_charset): Also account for glibc malloc's
10698 internal overhead when calculating the initial malloc maximum.
10699
cb993c58
PE
10700 Port --enable-checking=all to Fedora 14 x86.
10701 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10702 Move to lisp.h.
10703 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10704 (overrun_check_realloc, overrun_check_free):
10705 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10706 That way, xmalloc returns a properly-aligned pointer even if
10707 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10708 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10709 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10710 into account when calculating the initial malloc maximum.
10711 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10712 Move here from alloc.c, so that charset.c can use it too.
10713 Properly align; the old code wasn't right for common 32-bit hosts
10714 when configured with --enable-checking=all.
10715 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10716 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10717
31bed486
EZ
107182011-09-29 Eli Zaretskii <eliz@gnu.org>
10719
04c70788 10720 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
10721 use EDOM.
10722
fbcaa2f3
EZ
107232011-09-28 Eli Zaretskii <eliz@gnu.org>
10724
10725 * xdisp.c (compute_display_string_end): If there's no display
10726 string at CHARPOS, return -1.
10727
10728 * bidi.c (bidi_fetch_char): When compute_display_string_end
10729 returns a negative value, treat the character as a normal
10730 character not covered by a display string. (Bug#9624)
10731
a239d4e9
JB
107322011-09-28 Juanma Barranquero <lekktu@gmail.com>
10733
10734 * lread.c (Fread_from_string): Fix typo in docstring.
10735
88652fd5
EZ
107362011-09-27 Eli Zaretskii <eliz@gnu.org>
10737
10738 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10739 newline, reseat the iterator instead of bidi-iterating there one
10740 character at a time. (Bug#9610)
32c1fffd
SM
10741 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10742 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 10743
ed497dd4
AS
107442011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10745
10746 * lread.c (readevalloop): Use correct code for NBSP.
10747 (read1): Likewise. (Bug#9608)
10748
b2bf61aa
MA
107492011-09-25 Michael Albinus <michael.albinus@gmx.de>
10750
10751 * dbusbind.c (Fdbus_register_signal): When service is not
10752 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10753
32bbb17c
GM
107542011-09-25 Glenn Morris <rgm@gnu.org>
10755
10756 * buffer.c (truncate-lines): Doc fix.
10757
94e0933e
CY
107582011-09-24 Chong Yidong <cyd@stupidchicken.com>
10759
10760 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10761 (Fset_window_next_buffers): Doc fix.
10762
cddde921
GM
107632011-09-24 Glenn Morris <rgm@gnu.org>
10764
10765 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10766
1260aef1
PE
107672011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10768
25b4bfa0
PE
10769 Fix minor problems found by static checking.
10770 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
10771 * indent.c (Fvertical_motion): Fix == vs = typo.
10772
e3cbd34b
EZ
107732011-09-24 Eli Zaretskii <eliz@gnu.org>
10774
a66cfb1c
SM
10775 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10776 Default value is now t. Doc fix.
6bf7006f 10777
e3cbd34b 10778 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 10779 logic when moving up, not only when moving down. Fix the
e3cbd34b 10780 confusing name and values of the it_overshoot_expected variable;
32c1fffd 10781 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
10782
10783 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10784 CHARPOS is covered by a display string which includes newlines.
10785 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10786 is covered by a display string with embedded newlines.
10787
a3de0cbd
MA
107882011-09-24 Michael Albinus <michael.albinus@gmx.de>
10789
10790 * dbusbind.c (Fdbus_register_signal): Add match rule to
10791 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
10792 (Fdbus_register_method, Vdbus_registered_objects_table):
10793 Fix docstring.
a3de0cbd 10794
b260039d
JM
107952011-09-24 Jim Meyering <meyering@redhat.com>
10796
32c1fffd 10797 do not ignore write error for any output size
b260039d
JM
10798 The previous change was incomplete.
10799 While it makes emacs --batch detect the vast majority of stdout
10800 write failures, errors were still ignored whenever the output size is
10801 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10802 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10803 && echo FAIL: ignored write error
10804 FAIL: ignored write error
10805 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10806 && echo FAIL: ignored write error
10807 FAIL: ignored write error
10808 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10809
8eca8a7c
AS
108102011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10811
10812 * emacs.c (Fkill_emacs): In noninteractive mode exit
10813 non-successfully if a write error occurred on stdout. (Bug#9574)
10814
3341db62
EZ
108152011-09-21 Eli Zaretskii <eliz@gnu.org>
10816
10817 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10818 the xassert test.
10819
10820 * dispextern.h (struct it): Update the comment documenting what
10821 can it->OBJECT be.
10822
8c203dbf
EZ
108232011-09-20 Eli Zaretskii <eliz@gnu.org>
10824
10825 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10826 a display string, extend search for cursor position to end of row.
10827 (find_row_edges): If the row ends in a newline from a display
10828 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10829 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
10830 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10831 non-empty line. Fixes confusing cursor motion with arrow keys at
10832 the beginning of a line that starts with whitespace.
8c203dbf 10833
a4824228
LMI
108342011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10835
10836 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10837 (bug#9493).
10838
33ed493b
CY
108392011-09-18 Chong Yidong <cyd@stupidchicken.com>
10840
10841 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10842 boolean (Bug#9154).
10843
56cd55c8
EZ
108442011-09-18 Eli Zaretskii <eliz@gnu.org>
10845
10846 * xdisp.c (display_line): Record maximum and minimum buffer
10847 positions even if no glyphs were produced (e.g., by a zero-width
10848 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10849 buffer positions that will be removed from the glyph row because
10850 they don't fit.
c02dcedf
EZ
10851 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10852 column is beyond frame width: don't subtract 1 "pixel" when
10853 computing width of the stretch.
3e62b7e0
EZ
10854 (reseat_at_next_visible_line_start): Undo the change made on
10855 2011-09-17 that saved paragraph information and restored it after
10856 the call to `reseat'. (Bug#9545)
56cd55c8 10857
5ed99d36 108582011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
10859
10860 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10861 and turn window cursor on if cleared (Bug#9415).
10862
5ed99d36 108632011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
10864
10865 * search.c (boyer_moore): Take unibyte characters from pattern
10866 literally. (Bug#9458)
10867
9bade7b2
EZ
108682011-09-18 Eli Zaretskii <eliz@gnu.org>
10869
10870 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10871
e5e9d610
PE
108722011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10873
87e4427a
PE
10874 Fix minor problem found by static checking.
10875 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10876 initialized, to pacify gcc -Wuninitialized.
10877
e5e9d610
PE
10878 * fileio.c: Report proper errno when syscall falls.
10879 (Finsert_file_contents): Save and restore errno,
10880 so that report_file_error outputs the correct diagnostic.
10881 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10882
a1674f0b
EZ
108832011-09-18 Eli Zaretskii <eliz@gnu.org>
10884
10885 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10886
fbfb6dd4
EZ
108872011-09-17 Eli Zaretskii <eliz@gnu.org>
10888
10889 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10890 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10891
bb187662
EZ
108922011-09-17 Eli Zaretskii <eliz@gnu.org>
10893
1137e8b8 10894 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 10895 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
10896
10897 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10898 (bidi_find_paragraph_start): Search back for paragraph beginning
10899 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10900 (bidi_move_to_visually_next): Only trigger paragraph-related
10901 computations when the last character is a newline or at EOB, not
10902 just any NEUTRAL_B. (Bug#9470)
10903
bb187662
EZ
10904 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10905 truncated lines if point is covered by a display string. (Bug#9524)
10906
2e621251
PE
109072011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10908
10909 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10910 (cons_to_x_long): New function.
10911 (lisp_data_to_selection_data): Use it. Correct the test for
10912 short-versus-long data; it was negated. Break out of vector
10913 loop, for efficiency, when a long datum is discovered.
10914
91a15bc6
SM
109152011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10916
10917 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10918
b41c3a35
EZ
109192011-09-16 Eli Zaretskii <eliz@gnu.org>
10920
10921 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10922 GCC PR/17406) by declaring this function with external scope.
10923
7812ba2d
PE
109242011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10925
10926 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10927 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10928
cf7edc2a
AS
109292011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10930
10931 * editfns.c (Fformat): Correctly handle text properties on "%%".
10932
bd01620e
EZ
109332011-09-15 Eli Zaretskii <eliz@gnu.org>
10934
10935 * xterm.c (x_draw_composite_glyph_string_foreground):
10936 * w32term.c (x_draw_composite_glyph_string_foreground):
10937 * term.c (encode_terminal_code):
10938 * composite.c (composition_update_it, get_composition_id):
10939 * xdisp.c (get_next_display_element)
10940 (fill_composite_glyph_string): Add comments about special meaning
10941 of TAB characters in a composition.
10942
a02719a3
PE
109432011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10944
10945 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
10946 This occurs when processing a multibyte format.
10947 Problem reported by Wolfgang Jenker.
a02719a3 10948
72589a3c
JB
109492011-09-15 Johan Bockgård <bojohan@gnu.org>
10950
10951 * xdisp.c (try_cursor_movement): Only check for exact match if
10952 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10953
1c14176c
PE
109542011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10955
10956 Remove unused external symbols.
10957 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10958 * xdisp.c (calc_pixel_width_or_height): Now static.
10959 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10960 * indent.c (check_display_width):
10961 * w32term.c: Fix comment to match code.
10962 * xterm.c, xterm.h (x_catching_errors): Remove.
10963
d2eea5b5
PE
109642011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10965
10966 * xselect.c: Use signed conversions more consistently (Bug#9498).
10967 (selection_data_to_lisp_data): Assume incoming selection data are
10968 signed integers, not unsigned. This is to be consistent with
10969 outgoing selection data, which was modified to use signed integers
10970 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10971 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10972 expects long, not unsigned long.
10973
46888499
EZ
109742011-09-14 Eli Zaretskii <eliz@gnu.org>
10975
10976 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10977 computation of loop end. Reported by Johan Bockgård
10978 <bojohan@gnu.org>.
10979
ef8ef9fb
CY
109802011-09-13 Chong Yidong <cyd@stupidchicken.com>
10981
10982 * frame.c (Fother_visible_frames_p): Function deleted.
10983
fa819fed
EZ
109842011-09-12 Eli Zaretskii <eliz@gnu.org>
10985
10986 * indent.c (compute_motion): Process display vector front to back
10987 rather than the other way around. (Bug#2496)
10988
2ba8e008
SM
109892011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10990
10991 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10992
20f53c69
CY
109932011-09-11 Chong Yidong <cyd@stupidchicken.com>
10994
10995 * minibuf.c (Fread_from_minibuffer): Doc fix.
10996
d562d7a4
EZ
109972011-09-11 Eli Zaretskii <eliz@gnu.org>
10998
10999 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
11000 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
11001
1c4d7f3d
LMI
110022011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11003
11004 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
11005 value for non-existent files.
11006
b885bf36
EZ
110072011-09-11 Eli Zaretskii <eliz@gnu.org>
11008
11009 * fileio.c (Finsert_file_contents): If the file cannot be opened,
11010 set its "size" to -1. This will set the modtime_size field of
11011 the corresponding buffer to -1, which is what
11012 verify-visited-file-modtime expects for files that do not exist.
11013 (Bug#9139)
11014
6612f0bf
PE
110152011-09-11 Paul Eggert <eggert@cs.ucla.edu>
11016
11017 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
11018 here ...
11019 * lisp.h: ... from here. push_key_description is no longer
11020 defined in keyboard.c, so its declaration should not be in
11021 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
11022 logically belongs with push_key_description.
11023
dfb3f755
PE
110242011-09-10 Paul Eggert <eggert@cs.ucla.edu>
11025
11026 * buffer.h: Include <sys/types.h> instead of <time.h>.
11027 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
11028 Problem reported by Herbert J. Skuhra.
11029
3134906c
LMI
110302011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
11031
11032 * xml.c (parse_region): Make the parsing work for
11033 non-comment-starting XML files again (bug#9144).
11034
8d903f4e
AS
110352011-09-10 Andreas Schwab <schwab@linux-m68k.org>
11036
11037 * image.c (gif_load): Fix calculation of bottom and right corner.
11038 (Bug#9468)
11039
80ad64f4
EZ
110402011-09-10 Eli Zaretskii <eliz@gnu.org>
11041
11042 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
11043 redisplay in small windows.
11044
208a048d
EZ
110452011-09-09 Eli Zaretskii <eliz@gnu.org>
11046
11047 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
11048
9b1c252e
MR
110492011-09-08 Martin Rudalics <rudalics@gmx.at>
11050
11051 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
11052 Operate on live windows only.
11053
2949f33b
JB
110542011-09-08 Juanma Barranquero <lekktu@gmail.com>
11055
11056 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
11057
e08dcafd
EZ
110582011-09-07 Eli Zaretskii <eliz@gnu.org>
11059
11060 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
11061 only under bidi iteration.
11062
115b96bd
JD
110632011-09-07 Jan Djärv <jan.h.d@swipnet.se>
11064
11065 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11066
c8199d0f
PE
110672011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11068
11069 isnan: Fix porting problem to Solaris 10 with bundled gcc.
11070 Without this fix, the command to link temacs failed due to an
11071 undefined symbol __builtin_isnan. This is because
11072 /usr/include/iso/math_c99.h #defines isnan(x) to
11073 __builtin_isnan(x), but the bundled gcc, which identifies itself
11074 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11075 a __builtin_isnan.
11076 * floatfns.c (isnan): #undef, and then #define to a clone of
11077 what's in data.c.
11078 (Fisnan): Always define, since it's always available now.
11079 (syms_of_floatfns): Always define isnan at the Lisp level.
11080
e39b275c 110812011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
11082
11083 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11084
b2db44d9 110852011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 11086
f4af5137 11087 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
11088 The previous code assumed that file offsets (off_t values) fit in
11089 EMACS_INT variables, which is not true on typical 32-bit hosts.
11090 The code messed up by falsely reporting buffer overflow in cases
11091 such as (insert-file-contents "big" nil 1 2) into an empty buffer
11092 when "big" contains more than 2**29 bytes, even though this
11093 inserts just one byte and does not overflow the buffer.
11094 (Finsert_file_contents): Store file offsets as off_t
11095 values, not as EMACS_INT values. Check for overflow when
11096 converting between EMACS_INT and off_t. When checking for
11097 buffer overflow or for overlap, take the offsets into account.
11098 Don't use EMACS_INT for small values where int suffices.
11099 When checking for overlap, fix a typo: ZV was used where
11100 ZV_BYTE was intended.
11101 (Fwrite_region): Don't assume off_t fits into 'long'.
11102 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
11103
ecfc0a49
MA
111042011-09-05 Michael Albinus <michael.albinus@gmx.de>
11105
11106 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
11107
6511acf2 111082011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 11109
0999621a 11110 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
11111
11112 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 11113 (esprintf, exprintf, evxprintf): New functions.
62f19c19 11114 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 11115 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
11116 (modify_event_symbol): Do not assume that the length of
11117 name_alist_or_stem is safe to alloca and fits in int.
11118 (Fexecute_extended_command): Likewise for function name and binding.
11119 (Frecursion_depth): Wrap around reliably on integer overflow.
11120 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11121 since some callers pass EMACS_INT values.
11122 (Fsingle_key_description): Don't crash if symbol name contains more
11123 than MAX_ALLOCA bytes.
11124 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11125 (get_minibuffer): Arg is now EMACS_INT, not int.
11126 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 11127 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
11128 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11129
2be7d702
PE
11130 * dbusbind.c (signature_cat): New function.
11131 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
11132 Do not overrun buffer; instead, report string overflow.
11133
9d1df220
PE
11134 * dispnew.c (add_window_display_history): Don't overrun buffer.
11135 Truncate instead; this is OK since it's just a log.
11136
33ef5c64
PE
11137 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11138 even if the time zone offset is outlandishly large.
11139 Don't mishandle offset == INT_MIN.
11140
66c6fdd5
PE
11141 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11142 when creating daemon; the previous buffer-overflow check was incorrect.
11143
d749b01b
PE
11144 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11145 which has the guts of the old verror function.
11146
b5cd1905
PE
11147 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11148 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11149
6e1a67fb
PE
11150 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11151 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 11152 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 11153 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
11154 length of string rather than counting it via multiple sprintfs;
11155 that's simpler and more reliable.
c21721cc
PE
11156 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11157 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11158 sprintf, in case result does not fit in int.
11159
c57b67fc
PE
11160 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11161 (fontset_from_font): Print it.
11162
8a401434
PE
11163 * frame.c (tty_frame_count): Now printmax_t, not int.
11164 (make_terminal_frame, set_term_frame_name): Print it.
11165 (x_report_frame_params): In X, window IDs are unsigned long,
11166 not signed long, so print them as unsigned.
11167 (validate_x_resource_name): Check for implausibly long names,
11168 and don't assume name length fits in 'int'.
11169 (x_get_resource_string): Don't blindly alloca invocation name;
11170 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
11171 not fit in int.
11172
6e1a67fb
PE
11173 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11174 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
11175 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11176
0df02bf3
PE
11177 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11178 Use esprintf, not sprintf, in case result does not fit in int.
11179
48e30793
PE
11180 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11181 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11182 it as a large positive number.
11183 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
11184 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11185
a66ff6d8
PE
11186 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
11187 in case result does not fit in int.
11188
aca216ff
PE
11189 * print.c (float_to_string): Detect width overflow more reliably.
11190 (print_object): Make sprintf buffer a bit bigger, to avoid potential
11191 buffer overrun. Don't assume list length fits in 'int'. Treat
11192 print length of 0 as 0, not as infinity; to be consistent with other
11193 uses of print length in this function. Don't overflow print length
11194 index. Don't assume hash table size fits in 'long', or that
11195 vectorlike size fits in 'unsigned long'.
11196
31c286f7
PE
11197 * process.c (make_process): Use printmax_t, not int, to format
11198 process-name gensyms.
11199
55e5faa1
PE
11200 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
11201
80f2e268
PE
11202 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
11203 to avoid potential buffer overrun.
11204
670741ab
PE
11205 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
11206 if X resource line is longer than 512 bytes.
11207
b7163a50
PE
11208 * xfns.c (x_window): Make sprintf buffer a bit bigger
11209 to avoid potential buffer overrun.
11210
ae58ff1f
PE
11211 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
11212
c43c8a6a
PE
11213 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
11214
3f8236f4
PE
112152011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11216
53e9fe90 11217 Integer overflow fixes for scrolling, etc.
6511acf2
PE
11218 Without these, Emacs silently mishandles large integers sometimes.
11219 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
11220 it were "C-u 1 M-x recenter" on a typical 64-bit host.
11221
6511acf2
PE
11222 * xdisp.c (try_window_id): Check Emacs fixnum range before
11223 converting to 'int'.
806add1d 11224
6511acf2 11225 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
11226 Check that an Emacs fixnum is in range before assigning it to 'int'.
11227 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
11228 values converted from Emacs fixnums.
11229 (Frecenter): Don't wrap around a line count if it is out of 'int'
11230 range; instead, treat it as an extreme value.
11231 (Fset_window_configuration, compare_window_configurations):
11232 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
11233
6511acf2
PE
11234 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
11235 that can exceed INT_MAX. Check that EMACS_INT value is in range
11236 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
11237 (match_limit): Don't assume that a fixnum can fit in 'int'.
11238
6511acf2 11239 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
11240 exceed INT_MAX.
11241
6511acf2 11242 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
11243 (Fvertical_motion): Don't wrap around LINES values that don't fit
11244 in 'int'. Instead, treat them as extreme values. This is good
11245 enough for windows, which can't have more than INT_MAX lines anyway.
11246
fcb901a7
LMI
112472011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11248
0f2f6b6d
LMI
11249 * Require libxml/parser.h to avoid compilation warning.
11250
fcb901a7
LMI
11251 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11252
11253 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11254 since this reportedly can destroy thread storage.
11255
6e20a0d4
CY
112562011-08-30 Chong Yidong <cyd@stupidchicken.com>
11257
11258 * syntax.c (find_defun_start): Update all cache variables if
11259 exiting early (Bug#9401).
11260
148ae00e
EZ
112612011-08-30 Eli Zaretskii <eliz@gnu.org>
11262
f6cfbd8f
EZ
11263 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11264
148ae00e
EZ
11265 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11266 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
11267 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
11268
11269 * term.c (tty_append_glyph): New function.
11270 (produce_stretch_glyph): Static function and its prototype deleted.
11271
a66cfb1c
SM
11272 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11273 Add prototypes.
148ae00e 11274
c4a07a4c
PE
112752011-08-29 Paul Eggert <eggert@cs.ucla.edu>
11276
11277 * image.c (parse_image_spec): Check for nonnegative, not for positive,
11278 when checking :margin (Bug#9390).
11279 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 11280 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
11281 so that the name doesn't mislead. All uses changed.
11282
6bc8cd65
JB
112832011-08-28 Johan Bockgård <bojohan@gnu.org>
11284
11285 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11286 set_tty_hooks.
11287
dca4927e
EZ
112882011-08-27 Eli Zaretskii <eliz@gnu.org>
11289
11290 * xdisp.c (move_it_to): Don't bail out early when reaching
11291 position beyond to_charpos, if we are scanning backwards.
11292 (move_it_vertically_backward): When DY == 0, make sure we get to
11293 the first character in the line after the newline.
11294
f2cad773
PE
112952011-08-27 Paul Eggert <eggert@cs.ucla.edu>
11296
11297 * ccl.c: Improve and simplify overflow checking (Bug#9196).
11298 (ccl_driver): Do not generate an out-of-range pointer.
11299 (Fccl_execute_on_string): Remove unnecessary check for
11300 integer overflow, noted by Stefan Monnier in
11301 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11302 Remove a FIXME that didn't need fixing.
11303 Simplify the newly-introduced buffer reallocation code.
11304
0cae2cdb
JB
113052011-08-27 Juanma Barranquero <lekktu@gmail.com>
11306
11307 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11308
5fc295a4 113092011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 11310
70c60eb2 11311 Integer and memory overflow issues (Bug#9196).
726e0ab1 11312
d31850da
PE
11313 * doc.c (get_doc_string): Rework so that
11314 get_doc_string_buffer_size is the actual buffer size, rather than
11315 being 1 less than the actual buffer size; this makes xpalloc more
11316 convenient.
11317
a69fbedb
PE
11318 * image.c (x_allocate_bitmap_record, cache_image):
11319 * xselect.c (Fx_register_dnd_atom):
11320 Simplify previous changes by using xpalloc.
11321
fe5c5d37
PE
11322 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11323 since either will do and ptrdiff_t is convenient with xpalloc.
11324
0065d054
PE
11325 * charset.c (charset_table_size)
11326 (struct charset_sort_data.priority): Now ptrdiff_t.
11327 (charset_compare): Don't overflow if priorities differ greatly.
11328 (Fsort_charsets): Don't assume list length fits in int.
11329 Check for size-calculation overflow when allocating sort data.
11330 (syms_of_charset): Allocate an initial charset table that is
11331 just under 64 KiB, to avoid problems with glibc malloc and mmap.
11332
11333 * cmds.c (internal_self_insert): Check for size-calculation overflow.
11334
11335 * composite.h (struct composition.glyph_len): Now int, not unsigned.
11336 The actual value is always <= INT_MAX, and leaving it unsigned made
11337 overflow checking harder.
11338
11339 * dispextern.h (struct glyph_matrix.rows_allocated)
11340 (struct face_cache.size): Now ptrdiff_t, for convenience in use
11341 with xpalloc. The values are still always <= INT_MAX.
11342
11343 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
11344
11345 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
11346 (SAFE_NALLOCA): New macro.
11347
11348 * region-cache.c (struct boundary.pos, find_cache_boundary)
11349 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
11350 (set_cache_region, invalidate_region_cache)
11351 (revalidate_region_cache, know_region_cache, region_cache_forward)
11352 (region_cache_backward, pp_cache):
11353 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
11354 so that ptrdiff_t * can be passed to xpalloc.
11355 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
11356 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
11357 (pp_cache): Don't assume cache_len fits in int.
11358 * region-cache.h: Adjust extern decls to match.
11359
11360 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
11361 EMACS_INT, since either will do, for xpalloc.
11362
11363 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
11364 (xnmalloc, xnrealloc, xpalloc): New functions.
11365
726e0ab1
PE
11366 * bidi.c (bidi_shelve_header_size): New constant.
11367 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11368 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11369
51f30bc5 11370 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
11371 * buffer.c (overlays_at, overlays_in, record_overlay_string)
11372 (overlay_strings):
11373 Don't update size of array until after memory allocation succeeds,
11374 because xmalloc/xrealloc may not return.
0065d054
PE
11375 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11376 now that we have proper integer overflow checking.
11377 (record_overlay_string, overlay_strings): Catch overflows when
11378 calculating size of overlay_str_buf.
726e0ab1 11379
0065d054
PE
11380 * callproc.c (Fcall_process): Check for size overflow when
11381 calculating size of args2.
11382 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11383 Normally we prefer signed values, but sticking with ptrdiff_t would
11384 require adding more-complicated checks.
726e0ab1
PE
11385
11386 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11387 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11388 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 11389 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
11390
11391 * character.c (Fstring): Check for size-calculation overflow.
11392
11393 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11394 unnecessary integer overflow. Check for size overflow.
11395 (encode_coding_object): Don't update size until xmalloc succeeds.
11396
11397 * composite.c (get_composition_id): Check for overflow in glyph
11398 length calculations.
11399
11400 Integer and memory overflow fixes for display code.
11401 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11402 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11403 (scrolling_window): Check for overflow in size calculations.
11404 (line_draw_cost, realloc_glyph_pool, add_row_entry):
11405 Don't assume glyph table len fits in int.
11406 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11407 (row_table_size): Now ptrdiff_t, not int.
11408 (scrolling_window): Avoid overflow in size calculations.
11409 Don't update size until allocation succeeds.
11410 * fns.c (concat): Check for overflow in size calculations.
11411 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11412 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11413 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11414
11415 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11416 (get_doc_string): Check for size calculation overflow.
11417 Don't update size until allocation succeeds.
11418 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11419 EMACS_INT, where ptrdiff_t will do.
11420 (Fsubstitute_command_keys): Check for string overflow.
11421
11422 * editfns.c (set_time_zone_rule): Don't assume environment length
11423 fits in int.
11424 (message_length): Now ptrdiff_t, not int.
11425 (Fmessage_box): Don't update size until allocation succeeds.
11426 Don't assume message length fits in int.
11427 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11428
0065d054
PE
11429 * emacs.c (main): Do not reallocate argv, since there is a null at
11430 the end that can be overwritten, and this way there's no need to
11431 worry about size-calculation overflow.
11432 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
11433
11434 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11435 alloc succeeds.
11436 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11437
11438 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11439 (x_set_scroll_bar_width, x_figure_window_size):
11440 Check for integer overflow.
11441 (x_set_alpha): Do not assume XINT fits in int.
11442
11443 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11444 This is for the members text_lines, text_cols, total_lines, total_cols,
11445 where the system imposes an 'int' limit.
11446
11447 * fringe.c (Fdefine_fringe_bitmap):
11448 Don't update size until alloc works.
11449
11450 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11451 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11452
11453 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11454 Check for size-calculation overflow.
11455 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11456 do, as we prefer signed integers.
11457 (id_to_widget.max_size, id_to_widget.used)
11458 (xg_store_widget_in_map, xg_remove_widget_from_map)
11459 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11460 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11461 Use and return ptrdiff_t, not int.
11462 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11463 * gtkutil.h: Change prototypes to match the above.
11464
11465 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11466 are duplicate now that they've been promoted to lisp.h.
11467 (x_allocate_bitmap_record, x_alloc_image_color)
11468 (make_image_cache, cache_image, xpm_load):
11469 Don't update size until alloc is done.
11470 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11471 (x_detect_edges):
3256efce 11472 Check for size calculation overflow.
726e0ab1
PE
11473 (ct_colors_allocated_max): New constant.
11474 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11475 overflow.
3256efce 11476
726e0ab1
PE
11477 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11478 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11479 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11480 Use ptrdiff_t, not int, to count maps.
11481 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
11482 calculations. Don't update size until allocation succeeds.
11483 Redo calculations to avoid overflow.
726e0ab1
PE
11484 * keyboard.h: Change prototypes to match the above.
11485
11486 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11487 to count maps.
11488 (current_minor_maps): Check for size calculation overflow.
11489 * keymap.h: Change prototypes to match the above.
11490
11491 * lread.c (read1, init_obarray): Don't update size until alloc done.
11492
11493 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11494 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11495
726e0ab1
PE
11496 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11497 Now ptrdiff_t, not int.
11498 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11499 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11500
11501 * process.c (Fnetwork_interface_list): Check for overflow
11502 in size calculation.
11503
11504 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11505
11506 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11507 overflow. Don't bother calling xmalloc when xrealloc will do.
11508
11509 * search.c (Freplace_match): Check for size calculation overflow.
11510 (Fset_match_data): Don't assume list lengths fit in 'int'.
11511
11512 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11513 for command line length. Do not attempt to address one before the
11514 beginning of an array, as that's not portable.
11515
11516 * term.c (max_frame_lines): Remove; unused.
11517 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11518 not int.
11519 (encode_terminal_code, calculate_costs): Check for size
11520 calculation overflow.
11521 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11522 table lengths and related sizes. Don't update size until alloc
11523 done. Redo calculations to avoid overflow.
11524 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11525
11526 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11527 subtracting pointers.
11528 (gobble_line): Check for overflow more carefully. Don't update size
11529 until alloc done.
11530
11531 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11532 Don't update size until alloc done.
11533 Redo size calculations to avoid overflow.
11534 Check for size calculation overflow.
0065d054 11535 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
11536
11537 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11538 Use ptrdiff_t, not int, for sizes.
11539 (store_mode_line_noprop_char): Don't update size until alloc done.
11540
0065d054
PE
11541 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11542 Use ptrdiff_t, not int, for sizes.
11543 (Finternal_make_lisp_face, cache_face):
11544 Check for size calculation overflow.
11545 (cache_face): Treat size calculation overflows as if they were
11546 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
11547
11548 * xfns.c (x_encode_text, x_set_name_internal)
11549 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11550 sizes, since they can exceed INT_MAX in size. Check for size
11551 calculation overflow.
11552
0065d054
PE
11553 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11554 (xg_select): Check for size calculation overflow.
726e0ab1
PE
11555 Don't update size until alloc done.
11556
0065d054 11557 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 11558 as sprintf is limited to int lengths.
1d526e2f 11559
252c5ee1
PE
11560 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11561 (X_LONG_MIN): New macros.
864d7ce7
PE
11562 Use them to make the following changes clearer.
11563 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11564 This change doesn't affect the value now, but it may help remind
11565 future maintainers not to raise the value too much later.
11566 (SELECTION_QUANTUM): Remove, replacing with ...
11567 (selection_quantum): ... new function, which avoids overflow.
11568 All uses changed.
11569 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11570 assumption that selection length fits in 'int'.
11571 (x_reply_selection_request, x_handle_selection_request)
11572 (x_get_window_property, receive_incremental_selection)
11573 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11574 (lisp_data_to_selection_data, clean_local_selection_data):
11575 Use ptrdiff_t, not int, to record length of selection.
11576 (x_reply_selection_request, x_get_window_property)
11577 (receive_incremental_selection, x_property_data_to_lisp):
11578 Redo calculations to avoid overflow.
11579 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 11580 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
11581 something.
11582 (x_get_window_property, receive_incremental_selection)
11583 (lisp_data_to_selection_data, x_property_data_to_lisp):
11584 Check for size-calculation overflow.
11585 (x_get_window_property, receive_incremental_selection)
11586 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11587 Don't store size until memory allocation succeeds.
11588 (x_get_window_property): Plug memory leak on memory exhaustion.
11589 Don't double-block input; malloc is safe here. Don't assume 2**34
11590 - 4 fits in unsigned long. Add an xassert to check
11591 XGetWindowProperty overflow. Be more careful about overflow
11592 calculations, and distinguish size from memory overflow better.
11593 (receive_incremental_selection): When tracing, don't assume
11594 unsigned int is less than INT_MAX.
11595 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11596 harmful) conversions of unsigned short to int.
11597 (lisp_data_to_selection_data): Don't assume that integers
11598 in the range -65535 through -1 fit in an X unsigned short.
11599 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11600 result parameters unless successful. Rely on cons_to_unsigned
11601 to report problems with elements; the old code wasn't right anyway.
11602 (x_check_property_data): Check for int overflow; we cannot use
11603 a wider type due to X limits.
11604 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11605
726e0ab1 11606 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 11607
0065d054
PE
11608 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11609 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
11610 (x_color_cells): Don't store size until memory allocation succeeds.
11611 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 11612 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
11613 (x_term_init): Don't assume length fits in int (sprintf is limited
11614 to int size).
bc18e09d 11615
ebfa62c0
PE
11616 Use ptrdiff_t for composition IDs.
11617 * character.c (lisp_string_width):
11618 * composite.c (composition_table_size, n_compositions)
11619 (get_composition_id, composition_gstring_from_id):
11620 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11621 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11622 * window.c (Frecenter):
11623 Use ptrdiff_t, not int, for composition IDs.
11624 * composite.c (get_composition_id): Check for integer overflow.
11625 * composite.h: Adjust prototypes to match the above changes.
11626
d3411f89
PE
11627 Use ptrdiff_t for hash table indexes.
11628 * category.c (hash_get_category_set):
11629 * ccl.c (ccl_driver):
11630 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11631 * coding.c (coding_system_charset_list, detect_coding_system):
11632 * coding.h (struct coding_system.id):
11633 * composite.c (get_composition_id, gstring_lookup_cache):
11634 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11635 * image.c (xpm_get_color_table_h):
11636 * lisp.h (hash_lookup, hash_put):
11637 * minibuf.c (Ftest_completion):
11638 Use ptrdiff_t for hash table indexes, not int (which is too
11639 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11640 32-bit --with-wide-int hosts).
11641
e097a6fa
PE
11642 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11643 Add a FIXME comment about memory leaks.
11644 (syms_of_charset): Don't assume xmalloc returns.
11645
5637687f
PE
11646 Don't assume that stated character widths fit in int.
11647 * character.c (Fchar_width, c_string_width, lisp_string_width):
11648 * character.h (CHAR_WIDTH):
11649 * indent.c (MULTIBYTE_BYTES_WIDTH):
11650 Use sanitize_char_width to avoid undefined and/or bad behavior
11651 with outlandish widths.
a66cfb1c 11652 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
11653 now that we have two such functions. All uses changed.
11654 (sanitize_char_width): New inline function.
11655
a2271ba2
PE
11656 Don't assume that tab-width fits in int.
11657 * character.h (sanitize_width): New inline function.
11658 (SANE_TAB_WIDTH): New macro.
11659 (ASCII_CHAR_WIDTH): Use it.
11660 * indent.c (sane_tab_width): Remove. All uses replaced by
11661 SANE_TAB_WIDTH (current_buffer).
11662 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11663
18c52557
PE
11664 * fileio.c: Integer overflow issues with file modes.
11665 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11666
caeeedc1
PE
11667 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11668 Remove unreachable code.
11669 (read_hex, load_charset_map_from_file): Check for integer overflow.
11670
6df6ae42 11671 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
11672 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11673 (x_send_scroll_bar_event): Likewise. Check that the size does not
11674 exceed limits imposed by XClientMessageEvent, as well as the usual
11675 ptrdiff_t and size_t limits.
11676
b13995db
PE
11677 * keyboard.c: Overflow, signedness and related fixes.
11678 (make_lispy_movement): Use same integer type in forward decl
11679 that is used in the definition.
11680 (read_key_sequence, keyremap_step):
11681 Change bufsize argument back to int, undoing my 2011-03-30 change.
11682 We prefer signed types, and int is wide enough here.
11683 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11684 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11685 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11686 length, not size_t. Use ptrdiff_t for index, not int.
11687 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11688 possibility of integer overflow.
11689
13464394
PE
11690 Overflow, signedness and related fixes for images.
11691
11692 * dispextern.h (struct it.stack[0].u.image.image_id)
11693 (struct_it.image_id, struct image.id, struct image_cache.size)
11694 (struct image_cache.used, struct image_cache.ref_count):
11695 * gtkutil.c (update_frame_tool_bar):
11696 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11697 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11698 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11699 * nsmenu.m (update_frame_tool_bar):
11700 * xdisp.c (calc_pixel_width_or_height):
11701 * xfns.c (image_cache_refcount):
11702 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11703 on typical 64-bit hosts.
11704
11705 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11706 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11707 Omit unnecessary casts to int.
11708 (parse_image_spec): Check that integers fall into 'int' range
11709 when the callers expect that.
11710 (image_ascent): Redo ascent calculation to avoid int overflow.
11711 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11712 (lookup_image): Remove unnecessary tests.
11713 (xbm_image_p): Locals are now of int, not EMACS_INT,
11714 since parse_image_check makes sure they fit into int.
11715 (png_load, gif_load, svg_load_image):
11716 Prefer int to unsigned where either will do.
11717 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
11718 old tiff_error_handler and tiff_warning_handler.
11719 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
11720 stack buffer overflows. It uses only the features of vsnprintf
11721 that are common to both POSIX and native Microsoft.
11722 (tiff_error_handler, tiff_warning_handler): Use it.
11723 (tiff_load, gif_load, imagemagick_load_image):
11724 Don't assume :index value fits in 'int'.
11725 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11726 (imagemagick_load_image): Check that crop parameters fit into
11727 the integer types that MagickCropImage accepts. Don't assume
11728 Vimagemagick_render_type has a nonnegative value. Don't assume
11729 size_t fits in 'long'.
11730 (gs_load): Use printmax_t to print the widest integers possible.
11731 Check for integer overflow when computing image height and width.
11732
c11821d4
EZ
117332011-08-26 Eli Zaretskii <eliz@gnu.org>
11734
11735 * xdisp.c (redisplay_window): Don't force window start if point
11736 will be invisible in the resulting window. (Bug#9324)
11737
0c95fcf7
EZ
117382011-08-25 Eli Zaretskii <eliz@gnu.org>
11739
11740 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11741 the display spec is of the form `(space ...)'.
11742 (handle_display_spec): Return the value returned by
11743 handle_single_display_spec, not just 1 or zero.
11744 (handle_single_display_spec): If the display spec is of the form
11745 `(space ...)', and specifies display in the text area, return 2
11746 rather than 1.
fee65a97 11747 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
11748 accurately, and prefer exact match for point under bidi.
11749 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
11750
11751 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11752 into disp_prop; all users changed.
11753
11754 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11755 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11756 for the text covered by the display property.
11757
e4ed06f1
CY
117582011-08-25 Chong Yidong <cyd@stupidchicken.com>
11759
11760 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11761 Change return value to nil.
11762 (Frecord_buffer): Delete unused function.
11763
f67cdd7f
EZ
117642011-08-24 Eli Zaretskii <eliz@gnu.org>
11765
5980d4c6
EZ
11766 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11767 buffers, return left-to-right.
8610fe8b
EZ
11768 (set_cursor_from_row): Consider candidate row a win if its glyph
11769 represents a newline and point is on that newline. Fixes cursor
11770 positioning on the newline at EOL of R2L text within L2R
11771 paragraph, and vice versa.
11772 (try_cursor_movement): Check continued rows, in addition to
11773 continuation rows. Fixes unwarranted scroll when point enters a
11774 continued line of R2L text within an L2R paragraph, or vice versa.
11775 (cursor_row_p): Consider the case of point being equal to
11776 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11777 from the end of a short line to the beginning of a continued line
11778 of R2L text within L2R paragraph.
11779 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11780 composed characters.
5980d4c6 11781
f67cdd7f
EZ
11782 * bidi.c (bidi_check_type): Use xassert.
11783 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11784 members.
11785
bca633fb
EZ
117862011-08-23 Eli Zaretskii <eliz@gnu.org>
11787
11788 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11789 a character.
11790
4a5885a7
CY
117912011-08-23 Chong Yidong <cyd@stupidchicken.com>
11792
11793 * nsfont.m (ns_otf_to_script): Fix typo.
11794
0902a04e
KH
117952011-08-22 Kenichi Handa <handa@m17n.org>
11796
11797 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11798 extra slot even if the purpose is char-code-property-table.
11799
1a2e6670
EZ
118002011-08-23 Eli Zaretskii <eliz@gnu.org>
11801
8ddde651
EZ
11802 * xdisp.c (redisplay_window): When computing centering_position,
11803 account for the height of the header line. (Bug#8874)
11804
425cc014
EZ
11805 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11806 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11807 candidate is selected by the mouse, and that candidate has a
11808 composed character under the mouse.
11809
1a2e6670
EZ
11810 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11811 coordinates reported by pos-visible-in-window-p for a composed
11812 character in column zero.
11813
8b76d6f8
SM
118142011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11815
11816 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11817
dac347dd
EZ
118182011-08-22 Eli Zaretskii <eliz@gnu.org>
11819
11820 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11821 consider it a hit if to_charpos is anywhere in the range of the
11822 composed buffer positions.
11823
e013fb34
CY
118242011-08-22 Chong Yidong <cyd@stupidchicken.com>
11825
11826 * image.c (gif_load): Don't assume that each subimage has the same
11827 dimensions as the base image. Handle disposal method that is
11828 "undefined" by the gif spec (Bug#9335).
11829
bd1ba3e8
CY
118302011-08-20 Chong Yidong <cyd@stupidchicken.com>
11831
11832 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 11833 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 11834
54a1215b
EZ
118352011-08-19 Eli Zaretskii <eliz@gnu.org>
11836
823564e5
EZ
11837 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11838 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11839 from an Org mode buffer to a Speedbar frame.
11840
54a1215b
EZ
11841 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11842 a composition, take its buffer position from IT->cmp_it.charpos.
11843 Fixes cursor positioning at the beginning of a line that begins
11844 with a composed character.
11845
9778ebcc
EZ
118462011-08-18 Eli Zaretskii <eliz@gnu.org>
11847
0be6ee06
EZ
11848 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11849 character bidirectional type, use STRONG_L instead. Fixes crashes
11850 in a buffer produced by `describe-categories'.
11851
9778ebcc
EZ
11852 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11853 members before the level stack, so they would be saved and
11854 restored when copying iterator state. Fixes incorrect reordering
11855 around TABs covered by display properties.
11856
156bffbe
AS
118572011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11858
6b02f655 11859 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 11860
72ad093b
CY
118612011-08-17 Chong Yidong <cyd@stupidchicken.com>
11862
11863 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
11864 (internal_condition_case_2, internal_condition_case_n):
11865 Remove unnecessary aborts (Bug#9081).
72ad093b 11866
35774242
EZ
118672011-08-17 Eli Zaretskii <eliz@gnu.org>
11868
11869 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11870 has no `load' handler, try opening the file locally. (Bug#9311)
11871
db76dd85
KB
118722011-08-16 Ken Brown <kbrown@cornell.edu>
11873
11874 * gmalloc.c: Expand comment.
11875
b215eee5
EZ
118762011-08-16 Eli Zaretskii <eliz@gnu.org>
11877
11878 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11879 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11880
a4579d33
KB
118812011-08-16 Ken Brown <kbrown@cornell.edu>
11882
11883 Fix memory allocation problems in Cygwin build (Bug#9273).
11884
11885 * unexcw.c ( __malloc_initialized): Declare external variable.
11886 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11887
8b76d6f8
SM
11888 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11889 New variables.
a4579d33
KB
11890 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11891 dumped emacs.
11892 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11893 in the static heap.
11894 [CYGWIN] (special_realloc): New function.
11895 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11896 requests to realloc storage in the static heap.
11897
3ebec551
PE
118982011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11899
11900 * bidi.c (bidi_initialize): Remove unused local.
11901
9fd8be00
EZ
119022011-08-15 Eli Zaretskii <eliz@gnu.org>
11903
6b02f655
SM
11904 * bidimirror.h:
11905 * biditype.h: Remove file.
11906 * makefile.w32-in ($(BLD)/bidi.$(O)):
11907 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
11908
11909 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11910
11911 * chartab.c: Improve commentary for the uniprop_table API.
11912
32413314
EZ
11913 * bidi.c (bidi_paragraph_init): Support zero value of
11914 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
11915 (bidi_initialize): Use uniprop_table instead of including
11916 biditype.h and bidimirror.h.
32413314 11917
9fd8be00
EZ
11918 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11919 coordinates of the iterator when restoring from ppos_it.
11920 (Bug#9296)
11921
5cf2b69b
KH
119222011-08-14 Kenichi Handa <handa@m17n.org>
11923
11924 * process.c (create_process): Call setup_process_coding_systems
72ad093b 11925 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 11926
daf17d00
EZ
119272011-08-14 Eli Zaretskii <eliz@gnu.org>
11928
11929 * xdisp.c (move_it_in_display_line_to): Don't invoke
11930 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11931 ppos_it. Fixes vertical cursor motion when line beginning is
11932 covered by an image. (Bug#9296)
11933
08e3161a
JD
119342011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11935
11936 * nsterm.h (ns_run_ascript): Declare.
11937 (NSAPP_DATA2_RUNASSCRIPT): Define.
11938
11939 * nsfns.m (as_script, as_result, as_status): New static variables.
11940 (ns_run_ascript): New function.
5e617bc2 11941 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
11942 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11943 the event loop. Get status from as_status (Bug#7276).
11944
11945 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11946 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11947 the event loop (Bug#7276).
11948
a3720aa2
AS
119492011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11950
11951 * gnutls.c (QCgnutls_bootprop_priority)
11952 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11953 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11954 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11955 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11956 (QCgnutls_bootprop_verify_hostname_error)
11957 (QCgnutls_bootprop_callbacks_verify): Rename from
11958 Qgnutls_bootprop_..., all uses changed.
11959
11960 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11961 uses changed.
11962
0a0d27fb
PE
119632011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11964
19d5c50c
PE
11965 * xfaces.c (Qframe_set_background_mode): Now static.
11966 * dispextern.h (Qframe_set_background_mode): Remove decl.
11967
0a0d27fb
PE
11968 * process.c (Fnetwork_interface_info): Declare local only if needed.
11969
377538cb
JD
119702011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11971
11972 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11973 (Fnetwork_interface_list): Allocate in increments of bytes instead
11974 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11975 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11976 sockaddr.
11977 (struct ifflag_def): notrailers is smart on OSX.
11978 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11979 Get hardware address with getifaddrs if available.
11980
08fff70c
EZ
119812011-08-12 Eli Zaretskii <eliz@gnu.org>
11982
11983 * xdisp.c (iterate_out_of_display_property): xassert that
11984 IT->position is set to within IT->object's boundaries. Break from
11985 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
11986 when IT->position is set up wrongly due to some bug.
11987 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
11988 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11989 entry. Force push_it to save on the stack the current
11990 buffer/string position, to be restored by pop_it. Fix flags in
11991 the iterator structure wrt the object coming from a display
11992 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11993 properties. (Bug#9284)
11994
7be1c708 119952011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 11996
7be1c708
CY
11997 * fontset.c (fontset_get_font_group): Add proper type checks.
11998 (Bug#9172)
aac0c6e3 11999
7be1c708 120002011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 12001
7be1c708
CY
12002 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
12003 and LC_VERSION_MIN_MACOSX.
12004 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
12005 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 12006
97bb72a6
EZ
120072011-08-08 Eli Zaretskii <eliz@gnu.org>
12008
12009 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
12010 no-display-properties-and-no-overlays under bidi display.
12011 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 12012 properties and overlays.
97bb72a6 12013
d5617611
CY
120142011-08-08 Chong Yidong <cyd@stupidchicken.com>
12015
37e11a63
CY
12016 * editfns.c (Fset_time_zone_rule): Document relationship with the
12017 setenv function.
12018
d5617611
CY
12019 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
12020 the font entity extracted from the cache (Bug#8109).
12021
58872834
CY
120222011-08-07 Chong Yidong <cyd@stupidchicken.com>
12023
12024 * composite.c (autocmp_chars): Don't reset point. That is done by
12025 restore_point_unwind (Bug#5984).
12026
75bfc667
JL
120272011-08-07 Juri Linkov <juri@jurta.org>
12028
12029 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
12030 to show the arg `TIME' instead of `TIMEVAL'.
12031
d1410150
EZ
120322011-08-06 Eli Zaretskii <eliz@gnu.org>
12033
12034 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
12035 display property strides EOL and includes a newline, as in
12036 longlines-mode. (Bug#9254)
75b771e4
EZ
12037 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
12038 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
12039
12040 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12041 is non-zero, even if the data buffer is NULL. Fixes a crash in
12042 vertical-motion with longlines-mode. (Bug#9254)
12043
35928349
EZ
120442011-08-05 Eli Zaretskii <eliz@gnu.org>
12045
ec7cc85b
EZ
12046 * bidi.c <bidi_cache_total_alloc>: Now static.
12047 (bidi_initialize): Initialize bidi_cache_total_alloc.
12048
8b76d6f8 12049 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
12050 cache. (Bug#9221)
12051
12052 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
12053 amount allocated this far in `bidi_cache_total_alloc'.
12054 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
12055 non-zero, only free the data buffer without restoring the cache
12056 contents. All callers changed.
12057
12058 * dispextern.h (bidi_unshelve_cache): Update prototype.
12059
12060 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
12061 (move_it_in_display_line, move_it_to)
12062 (move_it_vertically_backward, move_it_by_lines): Replace the call
12063 to xfree to an equivalent call to bidi_unshelve_cache.
12064 (move_it_in_display_line_to): Fix logic of returning
412b6358 12065 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 12066
e2e2423b
EZ
120672011-08-05 Eli Zaretskii <eliz@gnu.org>
12068
12069 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12070 came from a string character with a `cursor' property. (Bug#9229)
12071
ae9e757a
JD
120722011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12073
12074 * Makefile.in (LIB_PTHREAD): New variable.
12075 (LIBES): Add LIB_PTHREAD (Bug#9216).
12076
12077 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12078 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12079
213bd7f2
AS
120802011-08-04 Andreas Schwab <schwab@linux-m68k.org>
12081
6b02f655 12082 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 12083
99aaf75f
JD
120842011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12085
12086 * xterm.c (x_find_topmost_parent): New function.
12087 (x_set_frame_alpha): Find topmost parent window with
12088 x_find_topmost_parent and set the property there also (bug#9181).
12089 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12090
c74e9d86
PE
120912011-08-04 Paul Eggert <eggert@cs.ucla.edu>
12092
12093 * callproc.c (Fcall_process): Avoid vfork clobbering
12094 the local vars buffer, coding_systems, current_dir.
12095
640c8776
SM
120962011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
12097
12098 * keymap.c (Fmake_composed_keymap): Move to subr.el.
12099
f26d0e4c
PE
121002011-08-03 Paul Eggert <eggert@cs.ucla.edu>
12101
8a10d76c
PE
12102 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
12103 so that it is not optimized away.
12104
f26d0e4c
PE
12105 * xdisp.c (compute_display_string_pos): Remove unused local.
12106
55439c61
EZ
121072011-08-02 Eli Zaretskii <eliz@gnu.org>
12108
12109 Fix slow cursor motion and scrolling in large buffers with
12110 selective display, like Org Mode buffers. (Bug#9218)
12111
12112 * dispextern.h (struct bidi_it): New member disp_prop_p.
12113
12114 * xdisp.c: Remove one-slot cache of display string positions.
12115 (compute_display_string_pos): Accept an additional argument
5e617bc2 12116 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
12117 for a display string or property. If found, set DISP_PROP_P
12118 non-zero.
12119
12120 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
12121 DISP_PROP_P, and pass it to compute_display_string_pos.
12122 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
12123 non-zero. All callers of bidi_fetch_char changed.
12124
fb33fa43
SM
121252011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
12126
12127 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12128
b099e063
DM
121292010-12-03 Don March <don@ohspite.net>
12130
12131 * keymap.c (Fdefine_key): Fix non-prefix key error message when
12132 last character M-[char] is translated to ESC [char] (bug#7541).
12133
5cc7f7af
KH
121342011-08-02 Kenichi Handa <handa@m17n.org>
12135
d0fffa3f 12136 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
12137
12138 * chartab.c (uniprop_table): Make it non-static.
12139
525d5e6e
EZ
121402011-08-01 Eli Zaretskii <eliz@gnu.org>
12141
12142 * xdisp.c (forward_to_next_line_start): Accept additional argument
12143 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12144 on the newline.
12145 (reseat_at_next_visible_line_start): Use the bidi iterator state
12146 returned by forward_to_next_line_start to restore the state of
12147 it->bidi_it after backing up to previous newline. (Bug#9212)
12148
31011111
AS
121492011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12150
12151 * regex.c (re_comp): Protoize.
12152 (re_exec): Fix return type.
12153 (regexec): Fix type of `ret'. (Bug#9203)
12154
476371c4
PE
121552011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12156
e5d76069
PE
12157 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12158 This is needed if max-image-size is a floating-point number.
12159
9a79b20c
AS
121602011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12161
12162 * print.c (print_object): Print empty symbol as ##.
12163
12164 * lread.c (read1): Read ## as empty symbol.
12165
d8c2fa78
AA
121662011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12167
12168 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12169 setting frame foreground color (Bug#9175).
12170 (x_set_background_color): Likewise.
12171
ffe57a7a
AA
12172 * nsmenu.m (-setText): Size tooltip dimensions precisely to
12173 contents (Bug#9176).
12174 (EmacsTooltip -init): Remove bezels and add shadows to
12175 tooltip windows.
12176
bf3492a5
AA
12177 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12178 or scroll bar (Bug#8470).
12179
d55e9c53
AA
12180 * nsfont.m (nsfont_open): Remove assignment to voffset and
12181 unnecessary vars hshink, expand, hd, full_height, min_height.
12182 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12183
12184 * nsterm.h (nsfont_info): Remove voffset field.
12185
d8c2fa78 121862011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
12187
12188 Implement strike-through and overline on NextStep (Bug#8863).
12189
12190 * nsfont.m (nsfont_open): Use underline position provided by font,
12191 instead of hard-coded value of 2.
12192 (nsfont_draw): Call ns_draw_text_decoration instead.
12193
12194 * nsterm.h: Add declaration for ns_draw_text_decoration.
12195
12196 * nsterm.m (ns_draw_text_decoration): New function for drawing
12197 underline, overline, and strike-through.
12198 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
12199 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 12200 accommodate underlining, etc.
4843aac3 12201
4cc60b9b
EZ
122022011-07-28 Eli Zaretskii <eliz@gnu.org>
12203
bc7ece87
EZ
12204 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
12205 default.
4cc60b9b 12206
476371c4
PE
122072011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12208
66606eea
PE
12209 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
12210 Without this fix, if a signal arrives just after memory fills up,
12211 'malloc' might be invoked reentrantly.
12212
476371c4
PE
12213 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
12214 In other words, assume that every image size is allowed, on non-X
12215 hosts. This assumption is probably wrong, but it lets Emacs compile.
12216
f3fcc40d
AS
122172011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12218
12219 * regex.c (re_iswctype): Convert return values to boolean.
12220
350c992f
EZ
122212011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
12222
12223 * xdisp.c (compute_display_string_pos): Don't use cached display
12224 string position if the buffer had its restriction changed.
12225 (Bug#9184)
12226
5266b4bb
PE
122272011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12228
12229 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12230
2573a837 122312011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 12232
41f55ccd 12233 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 12234
39e378da
PE
12235 * bidi.c: Integer size and overflow fixes.
12236 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
12237 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
12238 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12239 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
12240 (bidi_find_other_level_edge):
12241 Use ptrdiff_t instead of EMACS_INT where either will do.
12242 This works better on 32-bit hosts configured --with-wide-int.
12243 (bidi_cache_ensure_space): Check for size-calculation overflow.
12244 Use % rather than repeated addition, for better worst-case speed.
12245 Don't set bidi_cache_size until after xrealloc returns, because it
12246 might not return.
12247 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
12248 (bidi_cache_ensure_space): Also check that the bidi cache size
12249 does not exceed that of the largest Lisp string or buffer. See Eli
12250 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 12251
5e927815
PE
12252 * alloc.c (__malloc_size_t): Remove.
12253 All uses replaced by size_t. See Andreas Schwab's note
12254 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12255
ca4aa935
PE
12256 * image.c: Improve checking for integer overflow.
12257 (check_image_size): Assume that f is nonnull, since
12258 it is always nonnull in practice. This is one less thing to
12259 worry about when checking for integer overflow later.
12260 (x_check_image_size): New function, which checks for integer
12261 overflow issues inside X.
12262 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12263 This removes the need for a memory_full check.
12264 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12265 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12266 (xbm_read_bitmap_data): Change locals back to 'int', since
12267 their values must fit in 'int'.
12268 (xpm_load_image, png_load, tiff_load):
12269 Invoke x_create_x_image_and_pixmap earlier,
12270 to avoid much needless work if the image is too large.
12271 (tiff_load): Treat overly large images as if
12272 x_create_x_image_and_pixmap failed, not as malloc failures.
12273 (gs_load): Use x_check_image_size.
12274
5f8f9cc2
PE
12275 * gtkutil.c: Omit integer casts.
12276 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12277 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12278
5adf60bc
PE
12279 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12280
c8907a93
PE
12281 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12282 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12283 would wrongly return t on a 64-bit host.
12284
e3c25c68
PE
12285 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12286 The plain *_OVERFLOW macros run afoul of GCC bug 49705
12287 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12288 and therefore cause GCC to emit a bogus diagnostic in some cases.
12289
3f791afe
PE
12290 * image.c: Integer signedness and overflow and related fixes.
12291 This is not an exhaustive set of fixes, but it's time to
12292 record what I've got.
12293 (lookup_pixel_color, check_image_size): Remove redundant decls.
12294 (check_image_size): Don't assume that arbitrary EMACS_INT values
12295 fit in 'int', or that arbitrary 'double' values fit in 'int'.
12296 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12297 (tiff_load, imagemagick_load_image):
12298 Check for overflow in size calculations.
12299 (x_create_x_image_and_pixmap): Remove unnecessary test for
12300 xmalloc returning NULL; that can't happen.
12301 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12302 (xpm_color_bucket): Use better integer hashing function.
12303 (xpm_cache_color): Don't possibly over-allocate memory.
12304 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12305 (gif_memory_source):
12306 Use ptrdiff_t, not int or size_t, to record sizes.
12307 (png_load): Don't assume values greater than 2**31 fit in 'int'.
12308 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12309 either works, as we prefer signed integers.
12310 (tiff_read_from_memory, tiff_write_from_memory):
12311 Return tsize_t, not size_t, since that's what the TIFF API wants.
12312 (tiff_read_from_memory): Don't fail simply because the read would
12313 go past EOF; instead, return a short read.
12314 (tiff_load): Omit no-longer-needed casts.
12315 (Fimagemagick_types): Don't assume size fits into 'int'.
12316
3cc5a532
PE
12317 Improve hashing quality when configured --with-wide-int.
12318 * fns.c (hash_string): New function, taken from sxhash_string.
12319 Do not discard information about ASCII character case; this
12320 discarding is no longer needed.
12321 (sxhash-string): Use it. Change sig to match it. Caller changed.
12322 * lisp.h: Declare it.
12323 * lread.c (hash_string): Remove, since we now use fns.c's version.
12324 The fns.c version returns a wider integer if --with-wide-int is
12325 specified, so this should help the quality of the hashing a bit.
12326
b312a492
PE
12327 * emacs.c: Integer overflow minor fix.
12328 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
12329 Define only if GNU_LINUX.
12330 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12331
dfd153ae
PE
12332 * dispnew.c: Integer signedness and overflow fixes.
12333 Remove unnecessary forward decls, that were a maintenance hassle.
12334 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12335 All uses changed.
12336 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
12337 (scrolling_window): Use ptrdiff_t, not int, for byte count.
12338 (prepare_desired_row, line_draw_cost):
12339 Use int, not unsigned, where either works.
12340 (save_current_matrix, restore_current_matrix):
12341 Use ptrdiff_t, not size_t, where either works.
12342 (init_display): Check for overflow more accurately, and without
12343 relying on undefined behavior.
12344
a81d11a3
PE
12345 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
12346 Remove, replacing with the new symbols in lisp.h. All uses changed.
12347 * fileio.c (make_temp_name):
12348 * filelock.c (lock_file_1, lock_file):
12349 * xdisp.c (message_dolog):
12350 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
12351 Use pMd etc. instead.
12352 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
12353 replacing the pWIDE etc. symbols removed from editfns.c.
12354
3300e6fd
PE
12355 * keyboard.h (num_input_events): Now uintmax_t.
12356 This is (very slightly) less likely to mess up due to wraparound.
12357 All uses changed.
12358
fd05c7e9
PE
12359 * buffer.c: Integer signedness fixes.
12360 (alloc_buffer_text, enlarge_buffer_text):
12361 Use ptrdiff_t rather than size_t when either will do, as we prefer
12362 signed integers.
12363
903fe15d
PE
12364 * alloc.c: Integer signedness and overflow fixes.
12365 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
12366 (__malloc_size_t): Default to size_t, not to int.
12367 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12368 (Fgarbage_collect, mark_object_loop_halt, mark_object):
12369 Prefer ptrdiff_t to size_t when either would do, as we prefer
12370 signed integers.
12371 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12372 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12373 Now const. Initialize with values that are in range even if char
12374 is signed.
12375 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12376 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
12377 These functions do the right thing with sizes > 2**32.
12378 (check_depth): Now ptrdiff_t, not int.
12379 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12380 Adjust to new way of storing sizes. Check for size overflow bugs
12381 in rest of code.
12382 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
12383 slightly wrong anyway, as it missed one instance of
12384 XMALLOC_OVERRUN_CHECK_OVERHEAD.
12385 (refill_memory_reserve): Omit needless cast to size_t.
12386 (mark_object_loop_halt): Mark as externally visible.
12387
ac82cc6a
PE
12388 * xselect.c: Integer signedness and overflow fixes.
12389 (Fx_register_dnd_atom, x_handle_dnd_message):
12390 Use ptrdiff_t, not size_t, since we prefer signed.
12391 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12392 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12393 x_dnd_atoms_size and x_dnd_atoms_length.
12394
c2d1e36d
PE
12395 * doprnt.c: Prefer signed to unsigned when either works.
12396 * eval.c (verror):
12397 * doprnt.c (doprnt):
12398 * lisp.h (doprnt):
12399 * xdisp.c (vmessage):
12400 Use ptrdiff_t, not size_t, when using or implementing doprnt,
12401 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12402 prefer signed arithmetic to avoid comparison confusion.
12403 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12404 but is a bit tricky.
12405
0e926e56
PE
12406 Assume freestanding C89 headers, string.h, stdlib.h.
12407 * data.c, doprnt.c, floatfns.c, print.c:
12408 Include float.h unconditionally.
12409 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12410 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12411 * regex.c: Likewise for stddef.h, string.h.
12412 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12413 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12414 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12415 (STDC_HEADERS): Remove obsolete defines.
12416 * sysdep.c: Include limits.h unconditionally.
12417
9cfdb3ec
PE
12418 Assume support for memcmp, memcpy, memmove, memset.
12419 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12420 * regex.c (memcmp, memcpy):
12421 Remove; we assume C89 now.
12422
12423 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12424 (__malloc_safe_bcopy): Remove; no longer needed.
12425
cf950e6b 12426 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
12427 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12428 well either way, and we prefer signed to unsigned.
12429
dbf38e02
LMI
124302011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12431
12432 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12433 closes the connection while we're reading (bug#9182).
12434
d6f0886c 124352011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 12436
d6f0886c
JD
12437 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12438 are specified (Bug#9168).
24e0f6b1 12439
2eb1f9e6
PE
124402011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12441
12442 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12443 Found by GCC static checking and --with-wide-int on a 32-bit host.
12444
22381272 124452011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
12446
12447 * xdisp.c (compute_display_string_pos): Fix logic of caching
12448 previous display string position. Initialize cached_prev_pos to
12449 -1. Fixes slow-down at the beginning of a buffer.
12450
f25e39b4
EZ
124512011-07-24 Eli Zaretskii <eliz@gnu.org>
12452
12453 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12454 for attrs[LFACE_FONTSET_INDEX].
12455
04c4b52e
PE
124562011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12457
12458 * xml.c (parse_region): Remove unused local
12459 that was recently introduced.
12460
c1734fbd
EZ
124612011-07-23 Eli Zaretskii <eliz@gnu.org>
12462
be18c5a5
EZ
12463 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12464 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12465
c1734fbd
EZ
12466 * xdisp.c (move_it_in_display_line_to): Record the best matching
12467 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
12468 exit if none of the characters scanned was an exact match.
12469 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
12470 when exact match is impossible due to invisible text, and the
12471 lines are truncated.
12472
a258d627
JD
124732011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12474
12475 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12476 for OSX >= 10.7.
12477
b6d5a689
EZ
124782011-07-22 Eli Zaretskii <eliz@gnu.org>
12479
0f74f785
EZ
12480 Fix a significant slow-down of cursor motion with C-n, C-p,
12481 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12482 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 12483 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
12484 (next_element_from_buffer): Call compute_stop_pos_backwards to
12485 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
12486 base_level_stop.
12487 (reseat): Don't look for prev_stop, as that could mean a very long
12488 run.
12489 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12490 <cached_disp_overlay_modiff>: Cache for last found display string
12491 position.
551918c1 12492 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
12493 about the same buffer in the same area of character positions, and
12494 the buffer wasn't changed since the time the display string
12495 position was cached.
551918c1 12496
b2d0c91a
EZ
124972011-07-22 Eli Zaretskii <eliz@gnu.org>
12498
12499 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12500 is an integer, which is important for empty lines. (Bug#9149)
12501
043604ee
CY
125022011-07-22 Chong Yidong <cyd@stupidchicken.com>
12503
12504 * frame.c (Fmodify_frame_parameters): In tty case, update the
12505 default face if necessary (Bug#4238).
12506
da4adb04
CY
125072011-07-21 Chong Yidong <cyd@stupidchicken.com>
12508
12509 * editfns.c (Fstring_to_char): No need to explain what a character
12510 is in the docstring (Bug#6576).
12511
9abd0532
LMI
125122011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12513
12514 * xml.c (parse_region): Make sure we always return a tree.
12515
36881d16
HK
125162011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12517
12518 * xml.c (parse_region): If a document contains only comments,
12519 return that, too.
12520
1e98674d
LMI
125212011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12522
12523 * xml.c (make_dom): Return comments, too.
12524
590bd467
PE
125252011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12526
12527 Port to OpenBSD.
12528 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12529 and the surrounding thread.
12530 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12531 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12532 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12533 timer goes off.
12534 * s/openbsd.h (BROKEN_SIGIO): Define.
12535 * unexelf.c (unexec) [__OpenBSD__]:
12536 Don't update the .mdebug section of the Alpha COFF symbol table.
12537
f41628b2
LMI
125382011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12539
12540 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12541 (bug#8460).
12542
b59b67c5
PE
125432011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12544
15e3a074
PE
12545 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12546 This fixes some race conditions on the permissions of any newly
12547 created file.
12548
41bed37d
PE
12549 * alloc.c (valid_pointer_p): Use pipe, not open.
12550 This fixes some permissions issues when debugging.
12551
b59b67c5
PE
12552 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12553 If fchown fails to set both uid and gid, try to set just gid,
12554 as that is sometimes allowed. Adjust the file's mode to eliminate
12555 setuid or setgid bits that are inappropriate if fchown fails.
12556
925a6be7
SM
125572011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12558
12559 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12560 to compare Lisp_Objects.
12561 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12562 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12563 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12564
52968808
AS
125652011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12566
0a6a104b
AS
12567 * lread.c (read_integer): Unread even EOF character.
12568 (read1): Likewise. Properly record start position of symbol.
12569
52968808
AS
12570 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12571 symbol character follows.
12572
9e381cdd
PE
125732011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12574
12575 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12576 This works around a problem with the previous change to Fcopy_file.
12577 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12578 and without this change, GCC might complain about discarding
12579 fchown's return value.
12580
b5641435
JB
125812011-07-16 Juanma Barranquero <lekktu@gmail.com>
12582
12583 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12584
a8031457
PE
125852011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12586
12587 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12588
dd889327
LMI
125892011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12590
750c33f7
LMI
12591 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12592 it's used from the C level.
12593
dd889327
LMI
12594 * process.c: Use the same condition for POLL_FOR_INPUT in both
12595 keyboard.c and process.c (bug#1858).
12596
87e86684
LM
125972011-07-09 Lawrence Mitchell <wence@gmx.li>
12598
12599 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12600 (Fgnutls_boot): Use it.
12601
64348f40
AS
126022011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12603
12604 * doc.c (Fsubstitute_command_keys): Revert last change.
12605
1d698799
LMI
126062011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12607
f863868c
LMI
12608 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12609 quotes the next character, and doesn't affect other longer
12610 sequences (bug#8935).
12611
1d698799
LMI
12612 * lread.c (syms_of_lread): Clarify that is isn't only
12613 `eval-buffer' and `eval-defun' that's affected by
12614 `lexical-binding' (bug#8460).
12615
aa4b6df6
EZ
126162011-07-15 Eli Zaretskii <eliz@gnu.org>
12617
12618 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 12619 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 12620
5d856da6
PE
126212011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12622
ad6042bb
PE
12623 Fix minor problems found by static checking.
12624 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12625 (elsz): Now a signed constant, not a size_t var. We prefer signed
12626 types to unsigned, to avoid integer comparison confusion. Without
12627 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12628 "cannot optimize loop, the loop counter may overflow", a symptom
12629 of the confusion.
f00bbb22 12630 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
12631 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12632
6468f31c
LMI
126332011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12634
49080b10
LMI
12635 * search.c (Fre_search_backward): Mention `case-fold-search' in
12636 all the re_search_* functions (bug#8138).
12637
6468f31c
LMI
12638 * keyboard.c (Fopen_dribble_file): Document when the file is
12639 closed (bug#8056).
12640
c965adc5
EZ
126412011-07-14 Eli Zaretskii <eliz@gnu.org>
12642
df9733bf
EZ
12643 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12644 bidi_cache_idx.
12645
0bb23927
EZ
12646 Support bidi reordering of display and overlay strings.
12647 * xdisp.c (compute_display_string_pos)
12648 (compute_display_string_end): Accept additional argument STRING.
12649 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12650 (reseat_to_string): Initialize bidi_it->string.s and
12651 bidi_it->string.schars.
12652 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
12653 NULL (avoids a crash in bidi_paragraph_init).
12654 Initialize itb.string.lstring.
0bb23927
EZ
12655 (init_iterator): Call bidi_init_it only of a valid
12656 buffer position was specified. Initialize paragraph_embedding to
12657 L2R.
12658 (reseat_to_string): Initialize the bidi iterator.
12659 (display_string): If we need to ignore text properties of
12660 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12661 original value of -1 will not work with bidi.)
12662 (compute_display_string_pos): First arg is now struct
12663 `text_pos *'; all callers changed. Support display properties on
12664 Lisp strings.
12665 (compute_display_string_end): Support display properties on Lisp
12666 strings.
12667 (init_iterator, reseat_1, reseat_to_string): Initialize the
12668 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12669 when iterating on a string not from display properties).
640c8776
SM
12670 (compute_display_string_pos, compute_display_string_end):
12671 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
12672 arrow keys.
12673 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
12674 base_level_stop; instead, set base_level_stop to BEGV.
12675 Fixes crashes in vertical-motion.
0bb23927
EZ
12676 (next_element_from_buffer): Improve commentary for when
12677 the iterator is before prev_stop.
12678 (init_iterator): Initialize bidi_p from the default value of
12679 bidi-display-reordering, not from buffer-local value. Use the
12680 buffer-local value only if initializing for buffer iteration.
12681 (handle_invisible_prop): Support invisible properties on strings
12682 that are being bidi-reordered.
12683 (set_iterator_to_next): Support bidi reordering of C strings and
12684 Lisp strings.
12685 (next_element_from_string): Support bidi reordering of Lisp
12686 strings.
12687 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
12688 (display_string): Support display of R2L glyph rows.
12689 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
12690 (init_iterator): Don't initialize it->bidi_p for strings
12691 here.
12692 (reseat_to_string): Initialize it->bidi_p for strings here.
12693 (next_element_from_string, next_element_from_c_string)
12694 (next_element_from_buffer): Add xassert's for correspondence
12695 between IT's object being iterated and it->bidi_it.string
12696 structure.
12697 (face_before_or_after_it_pos): Support bidi iteration.
12698 (next_element_from_c_string): Handle the case of the first string
12699 character that is not the first one in the visual order.
12700 (get_visually_first_element): New function, refactored from common
12701 parts of next_element_from_buffer, next_element_from_string, and
12702 next_element_from_c_string.
12703 (tool_bar_lines_needed, redisplay_tool_bar)
12704 (display_menu_bar): Force left-to-right direction. Add a FIXME
12705 comment for making that be controlled by a user option.
12706 (push_it, pop_it): Save and restore the state of the
12707 bidi iterator. Save and restore the bidi_p flag.
12708 (pop_it): Iterate out of display property for string iteration as
12709 well.
12710 (iterate_out_of_display_property): Support iteration over strings.
12711 (handle_single_display_spec): Set up it->bidi_it for iteration
12712 over a display string, and call bidi_init_it.
12713 (handle_single_display_spec, next_overlay_string)
12714 (get_overlay_strings_1, push_display_prop): Set up the bidi
12715 iterator for displaying display or overlay strings.
12716 (forward_to_next_line_start): Don't use the shortcut if
12717 bidi-iterating.
12718 (back_to_previous_visible_line_start): If handle_display_prop
12719 pushed the iterator stack, restore the internal state of the bidi
12720 iterator by calling bidi_pop_it same number of times.
12721 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12722 and we are bidi-iterating, don't decrement the iterator position;
12723 instead, set the first_elt flag in the bidi iterator, to produce
12724 the same effect.
12725 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12726 (push_display_prop): xassert that we are iterating a buffer.
12727 (push_it, pop_it): Save and restore paragraph_embedding member.
12728 (handle_single_display_spec, next_overlay_string)
12729 (get_overlay_strings_1, reseat_1, reseat_to_string)
12730 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12731 correctly. Don't assume unibyte strings are not bidi-reordered.
12732 (compute_display_string_pos)
12733 (compute_display_string_end): Fix handling the case of C string.
12734 (push_it, pop_it): Save and restore from_disp_prop_p.
12735 (handle_single_display_spec, push_display_prop): Set the
12736 from_disp_prop_p flag.
12737 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12738 (pop_it): Call iterate_out_of_display_property only if we are
12739 popping after iteration over a string that came from a display
12740 property. Fix a typo in popping stretch info. Add an assertion
12741 for verifying that the iterator position is in sync with the bidi
12742 iterator.
12743 (handle_single_display_spec, get_overlay_strings_1)
12744 (push_display_prop): Fix initialization of paragraph direction for
12745 string when that of the parent object is not yet determined.
12746 (reseat_1): Call bidi_init_it to resync the bidi
12747 iterator with IT's position. (Bug#7616)
12748 (find_row_edges): If ROW->start.pos gives position
12749 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12750 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12751 Reset the from_disp_prop_p flag.
12752 (SAVE_IT, RESTORE_IT): New macros.
12753 (pos_visible_p, face_before_or_after_it_pos)
12754 (back_to_previous_visible_line_start)
12755 (move_it_in_display_line_to, move_it_in_display_line)
12756 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12757 (try_scrolling, redisplay_window, display_line): Use them when
12758 saving a temporary copy of the iterator and restoring it back.
12759 (back_to_previous_visible_line_start, reseat_1)
12760 (init_iterator): Empty the bidi cache "stack".
12761 (move_it_in_display_line_to): If iterator ended up at
12762 EOL, but we never saw any buffer positions smaller than
12763 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12764 motion in bidi-reordered lines.
12765 (move_it_in_display_line_to): Record prev_method and prev_pos
12766 immediately before the call to set_iterator_to_next. Fixes cursor
12767 motion in bidi-reordered lines with stretch glyphs and strings
12768 displayed in margins. (Bug#8133) (Bug#8867)
12769 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12770 TO_CHARPOS.
640c8776
SM
12771 (pos_visible_p): Support positions in bidi-reordered lines.
12772 Save and restore bidi cache.
0bb23927
EZ
12773
12774 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12775 (bidi_paragraph_info): Delete unused struct.
12776 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12777 (bidi_cache_start): New variable.
12778 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12779 to zero.
12780 (bidi_cache_fetch_state, bidi_cache_search)
12781 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12782 (bidi_cache_find, bidi_peek_at_next_level)
12783 (bidi_level_of_next_char, bidi_find_other_level_edge)
12784 (bidi_move_to_visually_next): Compare cache index with
12785 bidi_cache_start rather than with zero.
12786 (bidi_fetch_char): Accept new argument STRING; all callers
12787 changed. Support iteration over a string. Support strings with
12788 display properties. Support unibyte strings. Fix the type of
12789 `len' according to what STRING_CHAR_AND_LENGTH expects.
12790 (bidi_paragraph_init, bidi_resolve_explicit_1)
12791 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
12792 (bidi_level_of_next_char, bidi_move_to_visually_next):
12793 Support iteration over a string.
0bb23927
EZ
12794 (bidi_set_sor_type, bidi_resolve_explicit_1)
12795 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12796 can now be zero (for strings); special values 0 and -1 were
12797 changed to -1 and -2, respectively.
12798 (bidi_char_at_pos): New function.
12799 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12800 Call it instead of FETCH_MULTIBYTE_CHAR.
12801 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12802 initialized to valid values.
12803 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12804 values.
12805 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12806 the test for valid cached positions. Fix the logic for looking up
12807 the sentinel state in the cache. GCPRO the Lisp string we are
12808 iterating.
12809 (bidi_push_it, bidi_pop_it): New functions.
12810 (bidi_initialize): Initialize the bidi cache start stack pointer.
12811 (bidi_cache_ensure_space): New function, refactored from part of
12812 bidi_cache_iterator_state. Don't assume the required size is just
12813 one BIDI_CACHE_CHUNK away.
12814 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12815 (bidi_count_bytes, bidi_char_at_pos): New functions.
12816 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12817 always valid if bidi_cache_idx is valid.
12818 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12819 is valid if it's going to be used.
12820 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12821 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
12822 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12823 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
12824 (bidi_find_other_level_edge, bidi_cache_start_stack):
12825 All variables related to cache indices are now EMACS_INT.
c965adc5 12826
0bb23927
EZ
12827 * dispextern.h (struct bidi_string_data): New structure.
12828 (struct bidi_it): New member `string'. Make flag members be 1-bit
12829 fields, and put them last in the struct.
640c8776
SM
12830 (compute_display_string_pos, compute_display_string_end):
12831 Update prototypes.
0bb23927
EZ
12832 (bidi_push_it, bidi_pop_it): Add prototypes.
12833 (struct iterator_stack_entry): New members bidi_p,
12834 paragraph_embedding, and from_disp_prop_p.
12835 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
12836 (bidi_shelve_cache, bidi_unshelve_cache):
12837 Declare prototypes.
0bb23927
EZ
12838
12839 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12840 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12841 and vector-like objects.
12842
12843 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12844 cache around display iteration.
12845
12846 * window.c (Fwindow_end, window_scroll_pixel_based)
12847 (displayed_window_lines, Frecenter): Save and restore the bidi
12848 cache around display iteration.
12849
3bbd2265
LMI
128502011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12851
12852 * editfns.c (Fdelete_region): Clarify the use of the named
12853 parameters (bug#6788).
12854
adc47434
MR
128552011-07-14 Martin Rudalics <rudalics@gmx.at>
12856
12857 * indent.c (Fvertical_motion): Set and restore w->pointm when
12858 saving and restoring the window's buffer (Bug#9006).
12859
837c31f8
LMI
128602011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12861
12862 * editfns.c (Fstring_to_char): Clarify just what is returned
12863 (bug#6576). Text by Eli Zaretskii.
12864
ac389d0c
JB
128652011-07-13 Juanma Barranquero <lekktu@gmail.com>
12866
12867 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12868
0be0ce47
EZ
128692011-07-13 Eli Zaretskii <eliz@gnu.org>
12870
12871 * buffer.c (mmap_find): Fix a typo.
12872
cd18e7e3
JB
128732011-07-13 Johan Bockgård <bojohan@gnu.org>
12874
12875 Fix execution of x selection hooks.
12876 * xselect.c (Qx_lost_selection_functions)
12877 (Qx_sent_selection_functions): New vars.
12878 (syms_of_xselect): DEFSYM them.
12879 (x_handle_selection_request): Pass Qx_sent_selection_functions
12880 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12881 (x_handle_selection_clear,x_clear_frame_selections):
12882 Pass Qx_lost_selection_functions rather than
12883 Vx_lost_selection_functions to Frun_hook_with_args.
12884
47ea7f44
PE
128852011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12886
ac389d0c 12887 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
12888 The old code sometimes used this field without initializing it.
12889
47ea7f44
PE
12890 * alloc.c (gc_sweep): Don't read past end of array.
12891 In theory, the old code could also have corrupted Emacs internals,
12892 though it'd be very unlikely.
12893
bc985c87
AS
128942011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12895
12896 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 12897 argument. (Bug#4026)
bc985c87 12898
0cf34688
LMI
128992011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12900
b3dadd76
LMI
12901 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12902 key" (bug#4257).
12903
0cf34688
LMI
12904 * window.c (Fset_window_start): Doc fix (bug#4199).
12905 (Fset_window_hscroll): Ditto.
12906
270768cd
PE
129072011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12908
077e3dda 12909 Fix minor new problems caught by GCC 4.6.1.
270768cd 12910 * term.c (init_tty): Remove unused local.
490011a6 12911 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 12912 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 12913 not used otherwise.
270768cd 12914
b1f58454
CY
129152011-07-12 Chong Yidong <cyd@stupidchicken.com>
12916
12917 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12918
22b9578d
LMI
129192011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12920
6e70ab07
LMI
12921 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12922 are the mini-buffer and the echo area (bug#3320).
12923
22b9578d
LMI
12924 * term.c (init_tty): Remove support for supdup, c10 and perq
12925 terminals, which are no longer supported (bug#1482).
12926
8974cc9f
JB
129272011-07-10 Johan Bockgård <bojohan@gnu.org>
12928
12929 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12930
a560d974
JD
129312011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12932
12933 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12934 for non-popups (Bug#3642).
12935
1dae0f0a
AS
129362011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12937
268c2c36 12938 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 12939 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
12940 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12941 * cm.c (losecursor): Likewise.
1dae0f0a
AS
12942 * data.c (fmod): Likewise.
12943 * dispnew.c (swap_glyphs_in_rows): Likewise.
12944 * emacs.c (memory_warning_signal): Likewise.
12945 * floatfns.c (float_error): Likewise.
12946 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12947 (otf_open, font_otf_capability, generate_otf_features)
12948 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12949 Likewise.
12950 * image.c (pbm_read_file): Likewise.
12951 * indent.c (string_display_width): Likewise.
12952 * intervals.c (check_for_interval, search_for_interval)
12953 (inc_interval_count, count_intervals, root_interval)
12954 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12955 * lread.c (defalias): Likewise.
268c2c36 12956 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
12957 * regex.c (set_image_of_range_1, set_image_of_range)
12958 (regex_grow_registers): Likewise.
12959 * sysdep.c (strerror): Likewise.
12960 * termcap.c (valid_filename_p, tprint, main): Likewise.
12961 * tparam.c (main): Likewise.
12962 * unexhp9k800.c (run_time_remap, save_data_space)
12963 (update_file_ptrs, read_header, write_header, calculate_checksum)
12964 (copy_file, copy_rest, display_header): Likewise.
12965 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12966 Likewise.
12967 * xdisp.c (check_it): Likewise.
12968 * xfaces.c (register_color, unregister_color, unregister_colors):
12969 Likewise.
12970 * xfns.c (print_fontset_result): Likewise.
12971 * xrdb.c (member, fatal, main): Likewise.
12972
99033785
PE
129732011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12974
12975 Fix minor problems found by static checking (Bug#9031).
12976 * chartab.c (char_table_set_range, map_sub_char_table):
12977 Remove unused locals.
12978 (uniprop_table): Now static.
12979 * composite.c (_work_char): Remove unused static var.
12980
9cb2ac56
JB
129812011-07-09 Juanma Barranquero <lekktu@gmail.com>
12982
12983 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12984
f25661f0
JD
129852011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12986
12987 * gtkutil.c (qttip_cb): Remove code without function.
12988
8278c4fe
EZ
129892011-07-09 Eli Zaretskii <eliz@gnu.org>
12990
12991 * w32.c (pthread_sigmask): New stub.
12992
1692ae2d 129932011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 12994
8a6ebd58 12995 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
12996 sigprocmask is portable only for single-threaded applications, and
12997 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
12998 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12999 (LIBES): Use it.
13000 * callproc.c (Fcall_process):
13001 * process.c (create_process):
13002 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
13003 Use pthread_sigmask, not sigprocmask.
123403e4 13004
1b854618
JD
130052011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13006
13007 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
13008 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
13009 wrong (Bug#8591).
13010
3fe4b549
JD
130112011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13012
0ce7e563
JD
13013 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
13014 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
13015 (xg_hide_tooltip): Fix comment.
13016
3fe4b549
JD
13017 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
13018 in registerServicesMenuSendTypes.
13019 (validRequestorForSendType): Don't check ns_return_types.
13020
13021 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
13022 ns_return_type.
13023
5df75e47
JR
130242011-07-08 Jason Rumney <jasonr@gnu.org>
13025
22610910
JR
13026 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
13027 SH_SHOW for hidden windows (Bug#5482).
13028
5df75e47
JR
13029 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
13030 frame struct members of non-existent frames (Bug#6284).
13031
699c10bd
JD
130322011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13033
4393663b
JD
13034 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
13035 variable firstTime not needed on OSX >= 10.6.
13036 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
13037 >= 10.5. Use setKnobProportion, setDoubleValue.
13038
13039 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13040 (MAC_OS_X_VERSION_10_5): Define if not defined.
13041 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13042 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13043 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13044
13045 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 13046 cString and lossyCString on OSX >= 10.4.
4393663b 13047
58179cce 13048 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
13049 sizeToFit on OSX >= 10.2.
13050
13051 * nsimage.m (allocInitFromFile): Don't use deprecated method
13052 bestRepresentationForDevice on OSX >= 10.6.
13053
13054 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
13055 to avoid warning.
13056
13057 * emacs.c: Declare unexec_init_emacs_zone.
13058
a63e0781
JD
13059 * nsgui.h: Fix compiler warning about gnulib redefining verify.
13060
699c10bd
JD
13061 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
13062
13063 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13064 on svcsMenu (Bug#8842).
13065
13066 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13067 ns_return_types.
13068 (Fns_list_services): Just return Qnil on 10.6, code not working there.
13069
13070 * nsterm.m (QUTF8_STRING): Declare.
13071 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13072 (validRequestorForSendType): Return type is (id).
13073 Change indexOfObjectIdenticalTo to indexOfObject.
13074 Check if we have local selection before returning self (Bug#8842).
13075 (writeSelectionToPasteboard): Put local selection into paste board
13076 if we have a local selection (Bug#8842).
13077 (syms_of_nsterm): DEFSYM QUTF8_STRING.
13078
13079 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13080 (ns_get_local_selection): Declare.
13081
54e10184
LMI
130822011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
13083
9888ff71
LMI
13084 * keymap.c (describe_map_tree): Don't insert a double newline at
13085 the end of the buffer (bug#1169) and return whether we inserted
13086 something.
13087
54e10184
LMI
13088 * callint.c (Fcall_interactively): Change "reading args" to
13089 "providing args" to try to clarify what it does (bug#1010).
13090
15fa4783
KH
130912011-07-07 Kenichi Handa <handa@m17n.org>
13092
13093 * composite.c (composition_compute_stop_pos): Ignore a static
13094 composition starting before CHARPOS (Bug#8915).
13095
13096 * xdisp.c (handle_composition_prop): Likewise.
13097
a8815b00
EZ
130982011-07-07 Eli Zaretskii <eliz@gnu.org>
13099
13100 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13101 (Bug#9015)
13102
ef7b981d 131032011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
13104
13105 * character.h (unicode_category_t): New enum type.
13106
13107 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13108 (Qchar_code_property_table): New variable.
13109 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13110 (UNIPROP_COMPRESSED_FORM_P): New macros.
13111 (char_table_ascii): Uncompress the compressed values.
13112 (sub_char_table_ref): New arg is_uniprop. Callers changed.
13113 Uncompress the compressed values.
ac389d0c 13114 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
13115 (char_table_ref_and_range): Uncompress the compressed values.
13116 (sub_char_table_set): New arg is_uniprop. Callers changed.
13117 Uncompress the compressed values.
13118 (sub_char_table_set_range): Args changed. Callers changed.
13119 (char_table_set_range): Adjuted for the above change.
13120 (map_sub_char_table): Delete args default_val and parent. Add arg
13121 top. Give decoded values to a Lisp function.
640c8776 13122 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
13123 values to a Lisp function. Gcpro more variables.
13124 (uniprop_table_uncompress)
13125 (uniprop_decode_value_run_length): New functions.
13126 (uniprop_decoder, uniprop_decoder_count): New variables.
13127 (uniprop_get_decoder, uniprop_encode_value_character)
13128 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13129 New functions.
13130 (uniprop_encoder, uniprop_encoder_count): New variables.
13131 (uniprop_get_encoder, uniprop_table)
13132 (Funicode_property_table_internal, Fget_unicode_property_internal)
13133 (Fput_unicode_property_internal): New functions.
13134 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13135 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 13136 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
13137 char-code-property-alist.
13138
640c8776 13139 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
13140 Vunicode_category_table.
13141
640c8776 13142 * font.c (font_range): Adjust for the change of
c805dec0
KH
13143 Vunicode_category_table.
13144
76b397fb
DN
131452011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13146
13147 * m/iris4d.h: Remove file, move contents ...
13148 * s/irix6-5.h: ... here.
13149
22b4128e
PE
131502011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13151
13152 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
13153 * alloc.c (mark_buffer):
13154 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13155 (clone_per_buffer_values): Don't assume that
22b4128e
PE
13156 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13157 This isn't true in general, and it's particularly not true
13158 if Emacs is configured with --with-wide-int.
13159 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13160 New macros, used in the buffer.c change.
13161
869795d6
JD
131622011-07-05 Jan Djärv <jan.h.d@swipnet.se>
13163
13164 * xsettings.c: Use both GConf and GSettings if both are available.
13165 (store_config_changed_event): Add comment.
13166 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13167 (store_tool_bar_style_changed): New functions.
5e617bc2 13168 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
13169 (struct xsettings): Move font inside HAVE_XFT.
13170 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 13171 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 13172 Move inside HAVE_XFT.
640c8776 13173 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
13174 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13175 also.
13176 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 13177 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 13178 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
13179 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13180 (parse_settings): Move check for font inside HAVE_XFT.
13181 (read_settings, apply_xft_settings): Add comment.
13182 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
13183 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
13184 call store_font_name_changed.
13185 (xft_settings_event): Add comment.
13186 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
13187 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
13188 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
13189 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
13190 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
13191 (xsettings_get_system_font, xsettings_get_system_normal_font):
13192 Add comment.
869795d6 13193
d8ed26bd
PE
131942011-07-05 Paul Eggert <eggert@cs.ucla.edu>
13195
13196 Random fixes. E.g., (random) never returned negative values.
13197 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
13198 subseconds part to the entropy, as that's a bit more random.
13199 Prefer signed to unsigned, since the signedness doesn't matter and
13200 in general we prefer signed. When given a limit, use a
13201 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
13202 latter isn't right if USE_2_TAGS_FOR_INTS.
13203 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
13204 not 0..VALMASK. Don't discard "excess" bits that random () returns.
13205
cabf1cac
SM
132062011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
13207
13208 * textprop.c (text_property_stickiness):
13209 Obey Vtext_property_default_nonsticky.
13210 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
13211 * w32fns.c (syms_of_w32fns):
13212 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
13213
6e9b2be9
PE
132142011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13215
13216 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
13217 This is more efficient than Ffile_directory_p and avoids a minor race.
13218
90186c68
LMI
132192011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
13220
7c301272
LMI
13221 * buffer.c (Foverlay_put): Say what the return value is
13222 (bug#7835).
13223
c4f2d8d4
LMI
13224 * fileio.c (barf_or_query_if_file_exists): Check first if the file
13225 is a directory before asking whether to use the file name
13226 (bug#7564).
ad637907
LMI
13227 (barf_or_query_if_file_exists): Make the "File is a directory"
13228 error be more correct.
c4f2d8d4 13229
90186c68
LMI
13230 * fns.c (Frequire): Remove the mention of the .gz files, since
13231 that's installation-specific, but keep the mention of
13232 `get-load-suffixes'.
13233
da64016e
PE
132342011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13235
13236 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
13237 Report string overflow if the output is too long.
13238
7d47b580
JB
132392011-07-04 Juanma Barranquero <lekktu@gmail.com>
13240
a555cb87
JB
13241 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
13242 (syms_of_gnutls): Remove duplicate DEFSYM for
13243 Qgnutls_bootprop_verify_hostname_error, an error for
13244 Qgnutls_bootprop_verify_error (which is no longer used).
13245
7d47b580
JB
13246 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13247 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
13248 Also (re)move comments that are misplaced or no longer relevant.
13249
1e49bfab
LMI
132502011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13251
13252 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13253
1485f4c0
CY
132542011-07-03 Chong Yidong <cyd@stupidchicken.com>
13255
13256 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13257 and background color parameters if they have been changed.
13258
a9ab721e
LMI
132592011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13260
13261 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13262
cf7cff57
PE
132632011-07-03 Paul Eggert <eggert@cs.ucla.edu>
13264
2e13213d
PE
13265 * xsettings.c (SYSTEM_FONT): Define only when used.
13266 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13267
cf7cff57
PE
13268 * keymap.c (access_keymap_1): Now static.
13269
7a8e04f7
CY
132702011-07-02 Chong Yidong <cyd@stupidchicken.com>
13271
13272 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13273 leave any prefix arg for the up event (Bug#1586).
13274
61352f62
LMI
132752011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
13276
69bb1ef7
LMI
13277 * lread.c (syms_of_lread): Mention single symbols defined by
13278 `defvar' or `defconst' (bug#7154).
13279
61352f62 13280 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 13281 (Frequire): Mention get-load-suffixes.
61352f62 13282
28545e04
MR
132832011-07-02 Martin Rudalics <rudalics@gmx.at>
13284
13285 * window.h (window): Remove clone_number slot.
13286 * window.c (Fwindow_clone_number, Fset_window_clone_number):
13287 Remove.
13288 (make_parent_window, make_window, saved_window)
13289 (Fset_window_configuration, save_window_save): Don't deal with
13290 clone numbers.
13291 * buffer.c (Qclone_number): Remove declaration.
13292 (sort_overlays, overlay_strings): Don't deal with clone numbers.
13293
3349e122
SM
132942011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
13295
13296 Add multiple inheritance to keymaps.
13297 * keymap.c (Fmake_composed_keymap): New function.
13298 (Fset_keymap_parent): Simplify.
13299 (fix_submap_inheritance): Remove.
13300 (access_keymap_1): New function extracted from access_keymap to handle
13301 embedded parents and handle lists of maps.
13302 (access_keymap): Use it.
13303 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13304 (Fcopy_keymap): Handle embedded parents.
13305 (Fcommand_remapping, define_as_prefix): Simplify.
13306 (Fkey_binding): Simplify.
13307 (syms_of_keymap): Move minibuffer-local-completion-map,
13308 minibuffer-local-filename-completion-map,
13309 minibuffer-local-must-match-map, and
13310 minibuffer-local-filename-must-match-map to Elisp.
13311 (syms_of_keymap): Defsubr make-composed-keymap.
13312 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13313 (parse_menu_item): Trivial simplification.
13314
3279eb87
GM
133152011-07-01 Glenn Morris <rgm@gnu.org>
13316
13317 * Makefile.in (SETTINGS_LIBS): Fix typo.
13318
39cb9e56 133192011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
13320
13321 * coding.c (Fencode_coding_string): Record the last coding system
13322 used, as the function doc string says (bug#8738).
13323
0949d2b6
JD
133242011-07-01 Jan Djärv <jan.h.d@swipnet.se>
13325
13326 * xsettings.c (store_monospaced_changed): Take new font as arg and
13327 check for change against current_mono_font.
13328 (EMACS_TYPE_SETTINGS): Remove this and related defines.
13329 (emacs_settings_constructor, emacs_settings_get_property)
13330 (emacs_settings_set_property, emacs_settings_class_init)
13331 (emacs_settings_init, gsettings_obj): Remove.
13332 (something_changedCB): New function for HAVE_GSETTINGS.
13333 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13334 with value as argument.
13335 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
13336 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 13337 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
13338 "changed".
13339
13340 * xgselect.c: Add defined (HAVE_GSETTINGS).
13341 (xgselect_initialize): Ditto.
13342
13343 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
13344 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
13345 xg_select.
13346
bbc6b304
PE
133472011-07-01 Paul Eggert <eggert@cs.ucla.edu>
13348
13349 * eval.c (struct backtrace): Simplify and port the data structure.
13350 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
13351 signed bit field, as this assumption is not portable and it makes
13352 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
13353 "char debug_on_exit : 1" as this is not portable either; instead,
13354 use the portable "unsigned int debug_on_exit : 1". Remove unused
13355 member evalargs. Remove obsolete comments about cc bombing out.
13356
9851bfc5
JD
133572011-06-30 Jan Djärv <jan.h.d@swipnet.se>
13358
51bb811f 13359 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
13360 Let HAVE_GSETTINGS override HAVE_GCONF.
13361 (store_monospaced_changed): New function.
13362 (EMACS_SETTINGS): A new type derived from GObject to handle
13363 GSettings notifications.
13364 (emacs_settings_constructor, emacs_settings_get_property)
13365 (emacs_settings_set_property, emacs_settings_class_init):
13366 New functions.
13367 (gsettings_client, gsettings_obj): New variables.
13368 (GSETTINGS_SCHEMA): New define.
13369 (something_changedCB): Call store_monospaced_changed.
13370 (init_gsettings): New function.
13371 (xsettings_initialize): Call init_gsettings.
13372 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13373 to NULL.
13374
640c8776 13375 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
13376 GCONF_CFLAGS/LIBS.
13377
5386012d
MR
133782011-06-29 Martin Rudalics <rudalics@gmx.at>
13379
13380 * window.c (resize_root_window, grow_mini_window)
13381 (shrink_mini_window): Rename Qresize_root_window to
13382 Qwindow_resize_root_window and Qresize_root_window_vertically to
13383 Qwindow_resize_root_window_vertically.
13384
f13e0b08
PE
133852011-06-28 Paul Eggert <eggert@cs.ucla.edu>
13386
13387 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13388
94515237
JB
133892011-06-27 Juanma Barranquero <lekktu@gmail.com>
13390
13391 * makefile.w32-in: Redesign dependencies so they reflect more
13392 clearly which files are directly included by each source file,
13393 and not through other includes.
13394
e43b6e43
MR
133952011-06-27 Martin Rudalics <rudalics@gmx.at>
13396
13397 * buffer.c (Qclone_number): Declare static and DEFSYM it.
13398 (sort_overlays, overlay_strings): When an overlay's clone number
13399 matches the window's clone number process the overlay even if
13400 the overlay's window property doesn't match the current window.
13401
d68443dc
MR
13402 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13403 (Fwindow_hchild): Rename to Fwindow_left_child.
13404 (Fwindow_next): Rename to Fwindow_next_sibling.
13405 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
13406 (resize_window_check): Rename to window_resize_check.
13407 (resize_window_apply): Rename to window_resize_apply.
13408 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13409 (Fdelete_other_windows_internal, resize_frame_windows)
13410 (Fsplit_window_internal, Fdelete_window_internal)
13411 (grow_mini_window, shrink_mini_window)
13412 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 13413
c7e73be5
JD
134142011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13415
13416 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13417 (emacs_fixed_set_min_size): Remove.
13418 (emacs_fixed_new): Take frame as argument.
13419
13420 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13421 (_EmacsFixedPrivate): Remove minwidth/height.
13422 Add struct frame *f.
13423 (emacs_fixed_init): Initialize priv->f.
13424 (get_parent_class, emacs_fixed_set_min_size): Remove.
13425 (emacs_fixed_new): Set priv->f to argument.
13426 (emacs_fixed_get_preferred_width)
13427 (emacs_fixed_get_preferred_height): Use min_width/height from
13428 frames size_hint to set minimum and natural (Bug#8919).
13429 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13430 and use min_width/height from frames size_hint to set
13431 min_width/height (Bug#8919).
13432
13433 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
13434 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13435 Fix indentation.
c7e73be5 13436
cf99dcf8
EZ
134372011-06-26 Eli Zaretskii <eliz@gnu.org>
13438
13439 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13440 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13441 called at ZV.
13442
029529ac
CY
134432011-06-26 Chong Yidong <cyd@stupidchicken.com>
13444
13445 * process.c (wait_reading_process_output): Bypass select if
13446 waiting for a cell while ignoring keyboard input, and input is
13447 pending. Suggested by Jan Djärv (Bug#8869).
13448
7a7ef429
PE
134492011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13450
13451 Use gnulib's dup2 module instead of rolling our own.
13452 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13453
11fdef7d 134542011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
13455
13456 * dispnew.c (scrolling_window): Before scrolling, turn off a
13457 mouse-highlight in the window being scrolled.
13458
cd3520a4
JB
134592011-06-24 Juanma Barranquero <lekktu@gmail.com>
13460
13461 Move DEFSYM to lisp.h and use everywhere.
13462
13463 * character.h (DEFSYM): Move declaration...
13464 * lisp.h (DEFSYM): ...here.
13465
13466 * gnutls.c:
13467 * minibuf.c:
13468 * w32menu.c:
13469 * w32proc.c:
13470 * w32select.c: Don't include character.h.
13471
13472 * alloc.c (syms_of_alloc):
13473 * buffer.c (syms_of_buffer):
13474 * bytecode.c (syms_of_bytecode):
13475 * callint.c (syms_of_callint):
13476 * casefiddle.c (syms_of_casefiddle):
13477 * casetab.c (init_casetab_once):
13478 * category.c (init_category_once, syms_of_category):
13479 * ccl.c (syms_of_ccl):
13480 * cmds.c (syms_of_cmds):
13481 * composite.c (syms_of_composite):
13482 * dbusbind.c (syms_of_dbusbind):
13483 * dired.c (syms_of_dired):
13484 * dispnew.c (syms_of_display):
13485 * doc.c (syms_of_doc):
13486 * editfns.c (syms_of_editfns):
13487 * emacs.c (syms_of_emacs):
13488 * eval.c (syms_of_eval):
13489 * fileio.c (syms_of_fileio):
13490 * fns.c (syms_of_fns):
13491 * frame.c (syms_of_frame):
13492 * fringe.c (syms_of_fringe):
13493 * insdel.c (syms_of_insdel):
13494 * keymap.c (syms_of_keymap):
13495 * lread.c (init_obarray, syms_of_lread):
13496 * macros.c (syms_of_macros):
13497 * msdos.c (syms_of_msdos):
13498 * print.c (syms_of_print):
13499 * process.c (syms_of_process):
13500 * search.c (syms_of_search):
13501 * sound.c (syms_of_sound):
13502 * syntax.c (init_syntax_once, syms_of_syntax):
13503 * terminal.c (syms_of_terminal):
13504 * textprop.c (syms_of_textprop):
13505 * undo.c (syms_of_undo):
13506 * w32.c (globals_of_w32):
13507 * window.c (syms_of_window):
13508 * xdisp.c (syms_of_xdisp):
13509 * xfaces.c (syms_of_xfaces):
13510 * xfns.c (syms_of_xfns):
13511 * xmenu.c (syms_of_xmenu):
13512 * xsettings.c (syms_of_xsettings):
13513 * xterm.c (syms_of_xterm): Use DEFSYM.
13514
4228cf16
TZ
135152011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13516
cd3520a4 13517 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 13518
7fcccf1e
PE
135192011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13520
7efb4e0e
PE
13521 Integer and buffer overflow fixes (Bug#8873).
13522
ff5844ad
PE
13523 * print.c (printchar, strout): Check for string overflow.
13524 (PRINTPREPARE, printchar, strout):
13525 Don't set size unless allocation succeeds.
13526
90532f02
PE
13527 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13528 for sizes. Check for string overflow more accurately.
13529 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13530
6d84508d
PE
13531 * macros.c: Integer and buffer overflow fixes.
13532 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13533 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13534 Use ptrdiff_t, not int, for sizes.
13535 Don't increment bufsize until after realloc succeeds.
13536 Check for size-calculation overflow.
13537 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13538
437b2cb4
PE
13539 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13540
8b9ac8b4
PE
13541 * lread.c: Integer overflow fixes.
13542 (read_integer): Radix is now EMACS_INT, not int,
13543 to improve quality of diagnostics for out-of-range radices.
13544 Calculate buffer size correctly for out-of-range radices.
13545 (read1): Check for integer overflow in radices, and in
13546 read-circle numbers.
82cb60d3
PE
13547 (read_escape): Avoid int overflow.
13548 (Fload, openp, read_buffer_size, read1)
13549 (substitute_object_recurse, read_vector, read_list, map_obarray):
13550 Use ptrdiff_t, not int, for sizes.
13551 (read1): Use EMACS_INT, not int, for sizes.
20270765 13552 Check for size overflow.
8b9ac8b4 13553
7fcccf1e
PE
13554 * image.c (cache_image): Check for size arithmetic overflow.
13555
bfbbd7e7
PE
13556 * lread.c: Integer overflow issues.
13557 (saved_doc_string_size, saved_doc_string_length)
13558 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13559 Now ptrdiff_t, not int.
13560 (read1): Don't assume doc string length fits in int. Check for
13561 out-of-range doc string lengths.
13562 (read_list): Don't assume file position fits in int.
39019e54 13563 (read_escape): Check for hex character overflow.
bfbbd7e7 13564
4e323265
LL
135652011-06-22 Leo Liu <sdl.web@gmail.com>
13566
13567 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13568 Move to minibuffer.el.
13569
85fece3e
PE
135702011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13571
20b84ce9 13572 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
13573 The following patches are for when GLYPH_DEBUG && !XASSERT.
13574 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13575 * dispnew.c (flush_stdout):
13576 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13577 Mark as externally visible.
13578 * dispnew.c (check_window_matrix_pointers): Now static.
13579 * dispnew.c (window_to_frame_vpos):
13580 * xfns.c (unwind_create_frame):
13581 * xterm.c (x_check_font): Remove unused local.
13582 * scroll.c (CHECK_BOUNDS):
13583 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13584 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13585 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13586 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13587 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13588 Now static.
13589 (debug_method_add): Use va_list and vsprintf rather than relying
13590 on undefined behavior with wrong number of arguments.
13591 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13592 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13593 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13594 since we're not interested in debugging glyphs with old libraries.
13595 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13596 GCC 4.6.0's static checking.
13597
0766b489
PE
135982011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13599
31fd4b32
PE
13600 Integer overflow and signedness fixes (Bug#8873).
13601 A few related buffer overrun fixes, too.
13602
b79e8648
PE
13603 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13604
0766b489
PE
13605 * dispextern.h (struct face.stipple):
13606 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13607 (x_bitmap_mask, x_allocate_bitmap_record)
13608 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13609 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13610 (x_create_bitmap_from_xpm_data):
13611 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13612 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13613 (.bitmaps_last):
13614 * xfaces.c (load_pixmap):
13615 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13616 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13617 (.bitmaps_last, struct x_output.icon_bitmap):
13618 Use ptrdiff_t, not int, for bitmap indexes.
13619 (x_allocate_bitmap_record): Check for size overflow.
13620 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13621
b081724f
PE
13622 Use ptrdiff_t, not int, for overlay counts.
13623 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13624 * editfns.c (overlays_around, get_pos_property):
13625 * textprop.c (get_char_property_and_overlay):
13626 * xdisp.c (next_overlay_change, note_mouse_highlight):
13627 * xfaces.c (face_at_buffer_position):
21514da7
PE
13628 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13629 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13630 (Fnext_overlay_change, Fprevious_overlay_change)
13631 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 13632 Use ptrdiff_t, not int, for sizes.
21514da7 13633 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 13634
3de73e5e
PE
13635 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13636
2606c57b
PE
13637 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13638 (x_session_initialize): Do not assume string length fits in int.
13639
aaafe47a
PE
13640 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13641 This is unlikely, but can occur if DPI is outlandish.
13642
2674ddc8 13643 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
13644 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13645
28154962
PE
13646 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13647 * xrdb.c (magic_file_p, search_magic_path):
13648 Omit last arg SUFFIX; it was always 0. All callers changed.
13649 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13650
7de51af5
PE
13651 * xfont.c (xfont_match): Avoid need for strlen.
13652
25ed6cc3
PE
13653 * xfns.c: Don't assume strlen fits in int.
13654 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13655
4eab31dd
PE
13656 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13657 not unsigned long, as we prefer signed integers. All callers changed.
13658 Detect integer overflow in repeat count.
13659 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 13660 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 13661
171e2a58
PE
13662 * termcap.c: Don't assume sizes fit in int and never overflow.
13663 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13664 (gobble_line): Check for size-calculation overflow.
13665
ad39faca 13666 * minibuf.c (Fread_buffer):
6e5bb2dc 13667 * lread.c (intern, intern_c_string):
74ca2eb3
PE
13668 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13669 Don't assume string length fits in int.
13670
52c61c22 13671 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
13672 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13673
b5b8c9e5
PE
13674 * font.c: Don't assume string length fits in int.
13675 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13676 Use ptrdiff_t, not int.
ccd6111c
PE
13677 (font_intern_prop): Don't assume string length fits in int.
13678 Don't assume integer property fits in fixnum.
13679 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 13680
882f0d81 13681 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 13682 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
13683 Reformulate so as not to need the command string.
13684 Invoke gzip -cd rather than gunzip, as it's more portable.
13685 (lock_info_type, lock_file_1, lock_file):
13686 Don't assume pid_t and time_t fit in unsigned long.
13687 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13688 (current_lock_owner): Prefer signed type for sizes.
13689 Use memcpy, not strncpy, where memcpy is what is really wanted.
13690 Don't assume (via atoi) that time_t and pid_t fit in int.
13691 Check for time_t and/or pid_t out of range, e.g., via a network share.
13692 Don't alloca where an auto var works fine.
13693
93f4cf88
PE
13694 * fileio.c: Fix some integer overflow issues.
13695 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13696 Don't assume string length fits in int.
13697 (directory_file_name): Don't assume string length fits in long.
13698 (make_temp_name): Don't assume pid fits in int, or that its print
13699 length is less than 20.
13700
f3e92b69
PE
13701 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13702
1bfdaf10
PE
13703 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13704
35016e9a
PE
13705 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13706
3d1e65a1
PE
13707 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13708 We prefer signed integers, even for size calculations.
13709
0b963a93
PE
13710 * emacs.c: Don't assume string length fits in 'int'.
13711 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13712 (main): Don't invoke strlen when not needed.
13713
573f4b54
PE
13714 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13715 (XD_DEBUG_MESSAGE): Don't waste a byte.
13716
989f33ba
PE
13717 * callproc.c (getenv_internal_1, getenv_internal)
13718 (Fgetenv_internal):
965d34eb
PE
13719 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13720
e4d29b33
PE
13721 * lread.c (invalid_syntax): Omit length argument.
13722 All uses changed. This doesn't fix a bug, but it simplifies the
13723 code away from its former Hollerith-constant appearance, and it's
13724 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 13725 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 13726
eb49b136
PE
13727 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13728 This didn't break anything, but it didn't help either.
13729 It's confusing to put a bogus integer in a place where the actual
13730 value does not matter.
9f62aeb1 13731 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 13732 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 13733
15375a22
PE
13734 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13735 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13736 implementation.
b61cc01c
PE
13737 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13738 We prefer signed types, and the value cannot exceed the EMACS_INT
13739 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
13740 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13741 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13742 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 13743
53b2623d
PE
13744 * indent.c (sane_tab_width): New function.
13745 (current_column, scan_for_column, Findent_to, position_indentation)
13746 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 13747 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 13748
51cab52b 13749 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 13750
f2ed8a70
PE
13751 * lisp.h (lint_assume): New macro.
13752 * composite.c (composition_gstring_put_cache):
13753 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13754
abe80cc6
PE
13755 * editfns.c, insdel.c:
13756 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 13757
b02c740e
PE
13758 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13759
ebc96716
PE
13760 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13761
b4e50fa0 13762 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 13763 Use much-faster test for byte-length change.
311d5d7c 13764 Don't assume string byte-length fits in 'int'.
a4cf38e4 13765 Check that character arg fits in 'int'.
85461888 13766 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 13767
c0c1ee9f
PE
13768 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13769
a498d7f4
PE
13770 * fns.c (concat): Catch string overflow earlier.
13771 Do not rely on integer wraparound.
13772
51cab52b
PE
13773 * dispextern.h (struct it.overlay_strings_charpos)
13774 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
13775 * xdisp.c (forward_to_next_line_start)
13776 (back_to_previous_visible_line_start)
13777 (reseat_at_next_visible_line_start, next_element_from_buffer):
13778 Don't arbitrarily truncate the value of 'selective' to int.
13779
76031fad
PE
13780 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13781
5eb55db9
PE
13782 * composite.c: Don't truncate sizes to 'int'.
13783 (composition_gstring_p, composition_reseat_it)
13784 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
13785 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13786 not EMACS_UINT, for indexes.
5eb55db9 13787
0703a717
PE
13788 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13789
d6202519
PE
13790 * buffer.c: Include <verify.h>.
13791 (struct sortvec.priority, struct sortstr.priority):
8961a454 13792 Now EMACS_INT, not int.
c20998a7 13793 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
13794 (struct sortstr.size, record_overlay_string)
13795 (struct sortstrlist.size, struct sortlist.used):
13796 Don't truncate size to int.
13797 (record_overlay_string): Check for size-calculation overflow.
d6202519 13798 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 13799
d5a19415
JM
138002011-06-22 Jim Meyering <meyering@redhat.com>
13801
029529ac 13802 Don't leak an XBM-image-sized buffer
d5a19415
JM
13803 * image.c (xbm_load): Free the image buffer after using it.
13804
a9041e6c
PE
138052011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13806
13807 Port to Sun C.
13808 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13809 that Sun C diagnosed.
13810 * fns.c (secure_hash): Fix pointer signedness issue.
13811 * intervals.c (static_offset_intervals): New function.
13812 (offset_intervals): Use it.
13813
7f3f739f
LL
138142011-06-21 Leo Liu <sdl.web@gmail.com>
13815
13816 * deps.mk (fns.o):
13817 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13818 sha512.h.
13819
13820 * fns.c (secure_hash): Rename from crypto_hash_function and change
13821 the first arg to accept symbols.
5b66d427 13822 (Fsecure_hash): New primitive.
7f3f739f
LL
13823 (syms_of_fns): New symbols.
13824
76147d94
DD
138252011-06-20 Deniz Dogan <deniz@dogan.se>
13826
13827 * process.c (Fset_process_buffer): Clarify return value in
13828 docstring.
13829
7d7d0045
CY
138302011-06-18 Chong Yidong <cyd@stupidchicken.com>
13831
13832 * dispnew.c (add_window_display_history): Use BVAR.
13833
13834 * xdisp.c (debug_method_add): Use BVAR.
13835 (check_window_end, dump_glyph_matrix, dump_glyph)
13836 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13837
13838 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13839 Likewise.
13840
13841 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13842 check till after the cache is created in init_frame_faces.
13843
ff2bc410
SM
138442011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13845
13846 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13847
28177add
PE
138482011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13849
dd3482fe
PE
13850 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13851 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13852 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13853
393d71f3 13854 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
13855 * fileio.c (Finsert_file_contents):
13856 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13857 Remove the old (too-loose) buffer overflow checks.
13858 They weren't needed, since make_gap checks for buffer overflow.
13859 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13860 The old code merely checked for Emacs fixnum overflow, and relied
13861 on undefined (wraparound) behavior. The new code avoids undefined
13862 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13863
2e6813b0 13864 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
13865 Tune. Don't use wider integers than needed. Don't use alloca.
13866 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 13867
599a9e4f
PE
13868 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13869
99561444
PE
13870 * insdel.c, lisp.h (buffer_overflow): New function.
13871 (insert_from_buffer_1, replace_range, replace_range_2):
13872 * insdel.c (make_gap_larger):
13873 * editfns.c (Finsert_char):
13874 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13875
28177add
PE
13876 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13877
e69dafad
PE
138782011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13879
4baa020d 13880 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 13881
b1c46f02
PE
13882 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13883 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13884
e69dafad
PE
13885 * fileio.c: Don't assume EMACS_INT fits in off_t.
13886 (emacs_lseek): New static function.
13887 (Finsert_file_contents, Fwrite_region): Use it.
13888 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13889
566684ea
PE
13890 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13891
e6966cd6
PE
13892 * fns.c: Don't overflow int when computing a list length.
13893 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13894 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13895 truncation on 64-bit hosts. Check for QUIT every
13896 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13897 faster and is responsive enough.
13898 (Flength): Report an error instead of overflowing an integer.
13899 (Fsafe_length): Return a float if the value is not representable
13900 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 13901 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 13902 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 13903
dd0b0efb
PE
13904 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13905 (header_size, word_size): New constants.
13906 (allocate_vectorlike): Don't check size overflow here.
13907 (allocate_vector): Check it here instead, since this is the only
13908 caller of allocate_vectorlike that could cause overflow.
13909 Check that the new vector's length is representable as a fixnum.
13910
86fe5cfe
PE
13911 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13912 The previous code was bogus. For example, next_almost_prime (32)
13913 returned 39, which is undesirable as it is a multiple of 3; and
13914 next_almost_prime (24) returned 25, which is a multiple of 5 so
13915 why was the code bothering to check for multiples of 7?
13916
80e88859
PE
13917 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13918
4a2f0ad6
PE
13919 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13920
f66c7cf8
PE
13921 Variadic C functions now count arguments with ptrdiff_t.
13922 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13923 Back then I didn't know that the Emacs coding style prefers signed int.
13924 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
13925 were being counted with int, which may truncate counts on 64-bit
13926 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
13927 * lisp.h (struct Lisp_Subr.function.aMANY)
13928 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13929 Arg counts are now ptrdiff_t, not size_t.
13930 All variadic functions and their callers changed accordingly.
13931 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13932 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13933 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13934 * callint.c (Fcall_interactively): Check arg count for overflow,
13935 to avoid potential buffer overrun. Use signed char, not 'int',
13936 for 'varies' array, so that we needn't bother to check its size
13937 calculation for overflow.
13938 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13939 * eval.c (apply_lambda):
13940 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13941 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13942 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13943
a1759b76
PE
13944 * callint.c (Fcall_interactively): Don't use index var as event count.
13945
d96be9fc
PE
13946 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13947 * mem-limits.h (SIZE): Remove; no longer used.
13948
a690a978 13949 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 13950
578c21e6
PE
13951 Remove unnecessary casts.
13952 * xterm.c (x_term_init):
13953 * xfns.c (x_set_border_pixel):
13954 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13955 These aren't needed now that we assume ANSI C.
13956
96f53c6c
PE
13957 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13958 It's more likely to cause problems (due to unsigned overflow)
13959 than to cure them.
13960
83c77d31
PE
13961 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13962
ee2079f1
PE
13963 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13964
6da65536
PE
13965 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13966
7147c4a4
PE
13967 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13968
193e32d9
PE
13969 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13970
e5533da6
PE
13971 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13972
9910e595
PE
13973 GLYPH_CODE_FACE returns EMACS_INT, not int.
13974 * dispextern.h (merge_faces):
13975 * xfaces.c (merge_faces):
01103c44
PE
13976 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13977 Don't assume EMACS_INT fits in int.
9910e595 13978
2638320e
PE
13979 * character.h (CHAR_VALID_P): Remove unused parameter.
13980 * fontset.c, lisp.h, xdisp.c: All uses changed.
13981
045eb8d9
PE
13982 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13983
c1f134b5
PE
13984 * fns.c (concat): Minor tuning based on overflow analysis.
13985 This doesn't fix any bugs. Use int to hold character, instead
13986 of constantly refetching from Emacs object. Use XFASTINT, not
13987 XINT, for value known to be a character. Don't bother comparing
13988 a single byte to 0400, as it's always less.
13989
395fcb93 13990 * floatfns.c (Fexpt):
327eeec8
PE
13991 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13992
abbd3d23
PE
13993 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13994 for characters.
13995
684a03ef
PE
13996 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13997
0fed43f3
PE
13998 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13999 Without this fix, on a 64-bit host (aset S 0 4294967386) would
14000 incorrectly succeed when S was a string, because 4294967386 was
14001 truncated before it was used.
14002
8fd02eb7
PE
14003 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
14004 Otherwise, an out-of-range integer could cause undefined behavior
14005 on a 64-bit host.
14006
f8c86b69
PE
14007 * composite.c: Use int, not EMACS_INT, for characters.
14008 (fill_gstring_body, composition_compute_stop_pos): Use int, not
14009 EMACS_INT, for values that are known to be in character range.
14010 This doesn't fix any bugs but is the usual style inside Emacs and
14011 may generate better code on 32-bit machines.
14012
34206dd2
PE
14013 Make sure a 64-bit char is never passed to ENCODE_CHAR.
14014 This is for reasons similar to the recent CHAR_STRING fix.
14015 * charset.c (Fencode_char): Check that character arg is actually
14016 a character. Pass an int to ENCODE_CHAR.
14017 * charset.h (ENCODE_CHAR): Verify that the character argument is no
14018 wider than 'int', as a compile-time check to prevent future regressions
14019 in this area.
14020
c5958d4c 14021 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
14022
14023 Make sure a 64-bit char is never passed to CHAR_STRING.
14024 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
14025 by silently ignoring the top 32 bits, allowing some values
14026 that were far too large to be valid characters.
14027 * character.h: Include <verify.h>.
14028 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
14029 arguments are no wider than unsigned, as a compile-time check
14030 to prevent future regressions in this area.
14031 * data.c (Faset):
01103c44 14032 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
14033 (Fsubst_char_in_region):
14034 * fns.c (concat):
14035 * xdisp.c (decode_mode_spec_coding):
14036 Adjust to CHAR_STRING's new requirement.
14037 * editfns.c (Finsert_char, Fsubst_char_in_region):
14038 * fns.c (concat): Check that character args are actually
14039 characters. Without this test, these functions did the wrong
14040 thing with wildly out-of-range values on 64-bit hosts.
14041
d37ca623
PE
14042 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14043 These casts should not be needed on 32-bit hosts, either.
14044 * keyboard.c (read_char):
14045 * lread.c (Fload): Remove casts to unsigned.
14046
ea204efb
PE
14047 * lisp.h (UNSIGNED_CMP): New macro.
14048 This fixes comparison bugs on 64-bit hosts.
14049 (ASCII_CHAR_P): Use it.
14050 * casefiddle.c (casify_object):
01103c44 14051 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
14052 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
14053 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
14054 * dispextern.h (FACE_FROM_ID):
14055 * keyboard.c (read_char): Use UNSIGNED_CMP.
14056
41cb286c
PE
14057 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
14058 not to EMACS_INT, to avoid GCC warning.
14059
4a1b9832
PE
14060 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
14061
55daad71
PE
14062 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
14063 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14064 isn't needed on 32-bit machines.
8f95c75c 14065
01103c44
PE
14066 * buffer.c (Fgenerate_new_buffer_name):
14067 Use EMACS_INT for count, not int.
0ceccced 14068 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
14069
14070 * data.c (Qcompiled_function): Now static.
14071
c6f072e7
PE
14072 * window.c (window_body_lines): Now static.
14073
20ce5912
PE
14074 * image.c (gif_load): Rename local to avoid shadowing.
14075
9c4c5f81
PE
14076 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14077 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14078 * alloc.c (make_save_value): Integer argument is now of type
14079 ptrdiff_t, not int.
14080 (mark_object): Use ptrdiff_t, not int.
14081 * lisp.h (pD): New macro.
14082 * print.c (print_object): Use it.
14083
c0c5c8ae
PE
14084 * alloc.c: Use EMACS_INT, not int, to count objects.
14085 (total_conses, total_markers, total_symbols, total_vector_size)
14086 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
14087 (total_free_floats, total_floats, total_free_intervals)
14088 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
14089 Now EMACS_INT, not int. All uses changed.
14090 (Fgarbage_collect): Compute overall total using a double, so that
14091 integer overflow is less likely to be a problem. Check for overflow
14092 when converting back to an integer.
5a25e253
PE
14093 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14094 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14095 These were 'int' variables that could overflow on 64-bit hosts;
14096 they were never used, so remove them instead of repairing them.
211a0b2a 14097 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
14098 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14099 Previously, this ceilinged at INT_MAX, but that doesn't work on
14100 64-bit machines.
e46bb31a 14101 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 14102
c78baabf 14103 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 14104 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
14105 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
14106 when a (possibly-narrower) signed value would do just as well.
14107 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 14108
c9d624c6
PE
14109 * alloc.c: Catch some string size overflows that we were missing.
14110 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14111 for convenience in STRING_BYTES_MAX.
14112 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14113 The definition here is exact; the one in lisp.h was approximate.
14114 (allocate_string_data): Check for string overflow. This catches
14115 some instances we weren't catching before. Also, it catches
14116 size_t overflow on (unusual) hosts where SIZE_MAX <= min
14117 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14118 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 14119
c9d624c6
PE
14120 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14121 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 14122 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 14123
353032ce
PE
14124 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14125
2bccce07
PE
14126 * alloc.c (Fmake_string): Check for out-of-range init.
14127
0ac30604
SM
141282011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14129
14130 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14131
c195f2de
JD
141322011-06-14 Jan Djärv <jan.h.d@swipnet.se>
14133
14134 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14135 xg_get_default_scrollbar_width.
14136
14137 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14138 (int_gtk_range_get_value): Move to the scroll bar part of the file.
14139 (style_changed_cb): Call update_theme_scrollbar_width and call
14140 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14141 all frames (Bug#8505).
14142 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14143 Call gtk_window_set_resizable if HAVE_GTK3.
14144 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14145 and height if HAVE_GTK3 (Bug#8505).
14146 (scroll_bar_width_for_theme): New variable.
14147 (update_theme_scrollbar_width): New function.
14148 (xg_get_default_scrollbar_width): Move code to
14149 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14150 (xg_initialize): Call update_theme_scrollbar_width.
14151
14152 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14153
14154 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14155
e10ac9f1
MR
141562011-06-12 Martin Rudalics <rudalics@gmx.at>
14157
14158 * frame.c (make_frame): Call other_buffer_safely instead of
14159 other_buffer.
14160
14161 * window.c (temp_output_buffer_show): Call display_buffer with
14162 second argument Vtemp_buffer_show_specifiers and reset latter
14163 immediately after the call.
14164 (Vtemp_buffer_show_specifiers): New variable.
14165 (auto_window_vscroll_p, next_screen_context_lines)
14166 (Vscroll_preserve_screen_position): Remove leading asterisks from
14167 doc-strings.
14168
2d3c217e 141692011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 14170
7b7f97e8 14171 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
14172 * buffer.c (Qclone_number): Remove for now, as it's unused.
14173 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14174 (record_buffer): Remove unused local.
14175 * frame.c (other_visible_frames, frame_buffer_list): Now static.
14176 (set_frame_buffer_list): Remove; unused.
14177 * frame.h (other_visible_frames): Remove decl.
14178 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14179 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14180 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14181 if HAVE_GPM.
14182 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14183 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
14184 Define only if HAVE_GPM.
14185 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
14186 (update_hints_inhibit): Remove; never set. All uses removed.
14187 * widgetprv.h (emacsFrameClassRec): Remove decl.
14188 * window.c (delete_deletable_window): Now returns void, since it
14189 wasn't returning anything.
14190 (compare_window_configurations): Remove unused locals.
14191 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
14192 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
14193 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
14194 the same widths as pointers. This follows up on the 2011-05-06 patch.
14195 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
14196 * xterm.h: Likewise.
14197 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
14198
1384b89e
JB
141992011-06-12 Juanma Barranquero <lekktu@gmail.com>
14200
14201 * makefile.w32-in: Update dependencies.
14202 (LISP_H): Add lib/intprops.h.
14203
1100a63c
CY
142042011-06-11 Chong Yidong <cyd@stupidchicken.com>
14205
14206 * image.c (gif_load): Add animation frame delay to the metadata.
14207 (syms_of_image): Use DEFSYM. New symbol `delay'.
14208
6198ccd0
MR
142092011-06-11 Martin Rudalics <rudalics@gmx.at>
14210
14211 * window.c (delete_deletable_window): Re-add.
14212 (Fset_window_configuration): Rewrite to handle dead buffers and
14213 consequently deletable windows.
14214 (window_tree, Fwindow_tree): Remove. Supply functionality in
14215 window.el.
14216 (compare_window_configurations): Simplify code.
14217
b6e3633c
AS
142182011-06-11 Andreas Schwab <schwab@linux-m68k.org>
14219
1ab0dee5
AS
14220 * image.c (imagemagick_load_image): Fix type mismatch.
14221 (Fimagemagick_types): Likewise.
14222
b6e3633c
AS
14223 * window.h (replace_buffer_in_windows): Declare.
14224
9397e56f
MR
142252011-06-11 Martin Rudalics <rudalics@gmx.at>
14226
14227 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
14228 Qclone_number. Remove external declaration of Qdelete_window.
14229 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
14230 code.
640c8776
SM
14231 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
14232 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
14233 (Fother_buffer): Rewrite doc-string. Major rewrite for new
14234 buffer list implementation.
14235 (other_buffer_safely): New function.
14236 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
14237 calls to replace_buffer_in_windows and
14238 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
14239 if allowed.
14240 (record_buffer): Inhibit quitting and rewrite using quittable
14241 functions. Run Qbuffer_list_update_hook if allowed.
14242 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
14243 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
14244 Move switch-to-buffer to window.el.
9397e56f
MR
14245 (bury-buffer): Move to window.el.
14246 (Vbuffer_list_update_hook): New variable.
14247
14248 * lisp.h (other_buffer_safely): Add prototype in buffer.c
14249 section.
14250
14251 * window.h (resize_frame_windows): Move up in code.
14252 (Fwindow_frame): Remove EXFUN.
14253 (replace_buffer_in_all_windows): Remove prototype.
14254 (replace_buffer_in_windows_safely): Add prototype.
14255
14256 * window.c: Declare Qdelete_window static again. Move down
14257 declaration of select_count.
14258 (Fnext_window, Fprevious_window): Rewrite doc-strings.
14259 (Fother_window): Move to window.el.
14260 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14261 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14262 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14263 window.el.
14264 (replace_buffer_in_windows): Implement by calling
14265 Qreplace_buffer_in_windows.
14266 (replace_buffer_in_all_windows): Remove with some functionality
14267 moved into replace_buffer_in_windows_safely.
14268 (replace_buffer_in_windows_safely): New function.
14269 (select_window_norecord, select_frame_norecord): Move in front
14270 of run_window_configuration_change_hook. Remove now obsolete
14271 declarations.
640c8776
SM
14272 (Fset_window_buffer): Rewrite doc-string.
14273 Call Qrecord_window_buffer.
9397e56f
MR
14274 (keys_of_window): Move binding for other-window to window.el.
14275
b50691aa
CY
142762011-06-11 Chong Yidong <cyd@stupidchicken.com>
14277
14278 * dispextern.h (struct image): Replace data member, whose int_val
14279 and ptr_val fields were not used by anything, with a single
14280 lisp_val object.
14281
14282 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14283 (gif_clear_image, gif_load, imagemagick_load_image)
14284 (gs_clear_image, gs_load): Callers changed.
14285
3f754b86
PE
142862011-06-10 Paul Eggert <eggert@cs.ucla.edu>
14287
cca69397
PE
14288 * buffer.h: Include <time.h>, for time_t.
14289 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
14290
109e28d0
PE
14291 Fix minor problems found by static checking.
14292
60737f02
PE
14293 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14294
4b66faf3
PE
14295 Make identifiers static if they are not used in other modules.
14296 * data.c (Qcompiled_function, Qframe, Qvector):
14297 * image.c (QimageMagick, Qsvg):
14298 * minibuf.c (Qmetadata):
14299 * window.c (resize_window_check, resize_root_window): Now static.
14300 * window.h (resize_window_check, resize_root_window): Remove decls.
14301
109e28d0
PE
14302 * window.c (window_deletion_count, delete_deletable_window):
14303 Remove; unused.
46a4ce9e
PE
14304 (window_body_lines): Now static.
14305 (Fdelete_other_windows_internal): Mark vars as initialized.
14306 Make sure 'resize_failed' is initialized.
14307 (run_window_configuration_change_hook): Rename local to avoid shadowing.
14308 (resize_window_apply): Remove unused local.
14309 * window.h (delete_deletable_window): Remove decl.
14310
109e28d0 14311 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
14312 (imagemagick_load_image): Fix pointer signedness problem by changing
14313 last arg from unsigned char * to char *. All uses changed.
14314 Also, fix a local for similar reasons.
14315 Remove unused locals. Remove locals to avoid shadowing.
14316 (fn_rsvg_handle_free): Remove; unused.
14317 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 14318 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 14319
3f754b86
PE
14320 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14321
2547adb1
CY
143222011-06-10 Chong Yidong <cyd@stupidchicken.com>
14323
14324 * image.c (gif_load): Fix omitted cast error introduced by
14325 2011-06-06 change.
14326
2c8e37d4
MR
143272011-06-10 Martin Rudalics <rudalics@gmx.at>
14328
14329 * window.h (resize_proportionally, orig_total_lines)
14330 (orig_top_line): Remove from window structure.
14331 (set_window_height, set_window_width, change_window_heights)
14332 (Fdelete_window): Remove prototypes.
14333 (resize_frame_windows): Remove duplicate declaration.
14334
440a42e3
EZ
143352011-06-10 Eli Zaretskii <eliz@gnu.org>
14336
14337 * window.h (resize_frame_windows, resize_window_check)
14338 (delete_deletable_window, resize_root_window)
14339 (resize_frame_windows): Declare prototypes.
14340
14341 * window.c (resize_window_apply): Make definition be "static" to
14342 match the prototype.
14343
562dd5e9
MR
143442011-06-10 Martin Rudalics <rudalics@gmx.at>
14345
14346 * window.c: Remove declarations of Qwindow_size_fixed,
14347 window_min_size_1, window_min_size_2, window_min_size,
14348 size_window, window_fixed_size_p, enlarge_window, delete_window.
14349 Remove static from declaration of Qdelete_window, it's
14350 temporarily needed by Fbury_buffer.
14351 (replace_window): Don't assign orig_top_line and
14352 orig_total_lines.
14353 (Fdelete_window, delete_window): Remove. Window deletion is
14354 handled by window.el.
640c8776
SM
14355 (window_loop): Remove DELETE_OTHER_WINDOWS case.
14356 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
14357 (Fdelete_other_windows): Remove. Deleting other windows is
14358 handled by window.el.
14359 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
14360 handled in window.el.
14361 (window_min_size_2, window_min_size_1, window_min_size): Remove.
14362 Window minimum sizes are handled in window.el.
14363 (shrink_windows, size_window, set_window_height)
14364 (set_window_width, change_window_heights, window_height)
14365 (window_width, CURBEG, CURSIZE, enlarge_window)
14366 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
14367 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
14368 handled in window.el.
14369 (make_dummy_parent): Rename to make_parent_window and give it a
14370 second argument horflag.
14371 (make_window): Don't set resize_proportionally any more.
14372 (Fsplit_window): Remove. Windows are split in window.el.
14373 (save_restore_action, save_restore_orig_size)
14374 (shrink_window_lowest_first, save_restore_orig_size): Remove.
14375 Resize mini windows in window.el.
14376 (grow_mini_window, shrink_mini_window): Implement by calling
14377 Qresize_root_window_vertically, resize_window_check and
14378 resize_window_apply.
640c8776
SM
14379 (saved_window, Fset_window_configuration, save_window_save):
14380 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
14381 resize_proportionally.
14382 (window_min_height, window_min_width): Move to window.el.
14383 (keys_of_window): Move bindings for delete-other-windows,
14384 split-window, delete-window and enlarge-window to window.el.
14385
14386 * buffer.c: Temporarily extern Qdelete_window.
14387 (Fbury_buffer): Temporarily call Qdelete_window instead of
14388 Fdelete_window (Fbury_buffer will move to window.el soon).
14389
14390 * frame.c (set_menu_bar_lines_1): Remove code handling
14391 orig_top_line and orig_total_lines.
14392
14393 * dispnew.c (adjust_frame_glyphs_initially): Don't use
14394 set_window_height but set heights directly.
14395 (change_frame_size_1): Use resize_frame_windows.
14396
14397 * xdisp.c (init_xdisp): Don't use set_window_height but set
14398 heights directly.
14399
640c8776
SM
14400 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14401 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
14402 run_window_configuration_change_hook.
14403
14404 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14405 instead of change_window_heights and run
14406 run_window_configuration_change_hook.
14407
1a13852e
MR
144082011-06-09 Martin Rudalics <rudalics@gmx.at>
14409
14410 * window.c (replace_window): Rename second argument REPLACEMENT to
14411 NEW. New third argument SETFLAG. Rewrite.
14412 (delete_window, make_dummy_parent): Call replace_window with
14413 third argument 1.
14414 (window_list_1): Move down in code.
14415 (run_window_configuration_change_hook): Move set_buffer part
14416 before select_frame_norecord part in order to unwind correctly.
14417 Rename count1 to count.
14418 (recombine_windows, delete_deletable_window, resize_root_window)
14419 (Fdelete_other_windows_internal)
14420 (Frun_window_configuration_change_hook, make_parent_window)
14421 (resize_window_check, resize_window_apply, Fresize_window_apply)
14422 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
14423 (Fdelete_window_internal, Fresize_mini_window_internal):
14424 New functions.
1a13852e
MR
14425 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14426
f3d1777e
MR
144272011-06-08 Martin Rudalics <rudalics@gmx.at>
14428
496e208e
MR
14429 * window.h (window): Add some new members to window structure -
14430 normal_lines, normal_cols, new_total, new_normal, clone_number,
14431 splits, nest, prev_buffers, next_buffers.
14432 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 14433 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 14434
f3d1777e
MR
14435 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14436 Remove.
496e208e
MR
14437 (make_dummy_parent): Set new members of windows structure.
14438 (make_window): Move down in code. Handle new members of window
14439 structure.
14440 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14441 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14442 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14443 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
14444 (Fset_window_next_buffers, Fset_window_clone_number):
14445 New functions.
496e208e
MR
14446 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14447 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14448 Doc-string fixes.
14449 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14450 Argument WINDOW can be now internal window too.
14451 (Fwindow_use_time): Move up in code.
14452 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14453 Rewrite doc-string.
14454 (Fset_window_configuration, saved_window)
14455 (Fcurrent_window_configuration, save_window_save): Handle new
14456 members of window structure.
b9e809c2
MR
14457 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14458 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14459 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14460 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14461 Qget_mru_window, Qresize_root_window,
14462 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14463 Qauto_buffer_name; staticpro them.
f3d1777e 14464
abde8f8c
MR
144652011-06-07 Martin Rudalics <rudalics@gmx.at>
14466
14467 * window.c (Fwindow_total_size, Fwindow_left_column)
14468 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14469 (Fwindow_list_1): New functions.
14470 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
14471 (Fwindow_width, Fscroll_left, Fscroll_right):
14472 Use window_body_cols instead of window_box_text_cols.
14473 (delete_window, Fset_window_configuration):
14474 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
14475 (delete_all_subwindows): Take a window as argument and not a
14476 structure. Rewrite.
190b47e6
MR
14477 (window_loop): Remove handling of GET_LRU_WINDOW and
14478 GET_LARGEST_WINDOW.
14479 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
14480
14481 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
14482 window_box_text_cols. delete_all_subwindows now takes a
14483 Lisp_Object as argument.
abde8f8c 14484
640c8776
SM
14485 * indent.c (compute_motion, Fcompute_motion):
14486 Use window_body_cols instead of window_box_text_cols.
abde8f8c 14487
fa8a67e6
MR
14488 * frame.c (delete_frame): Call delete_all_subwindows with root
14489 window as argument.
14490
a54e3482
DC
144912011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14492
14493 * fns.c (Fputhash): Document return value.
14494
60002bf5
CY
144952011-06-06 Chong Yidong <cyd@stupidchicken.com>
14496
14497 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14498
0c671da6 144992011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 14500
b862a52a 14501 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 14502
be44ca6c
PE
14503 Check for overflow when converting integer to cons and back.
14504 * charset.c (Fdefine_charset_internal, Fdecode_char):
14505 Use cons_to_unsigned to catch overflow.
14506 (Fencode_char): Use INTEGER_TO_CONS.
14507 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14508 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14509 * data.c (long_to_cons, cons_to_long): Remove.
14510 (cons_to_unsigned, cons_to_signed): New functions.
14511 These signal an error for invalid or out-of-range values.
14512 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14513 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14514 * font.c (Ffont_variation_glyphs):
14515 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14516 * lisp.h: Include <intprops.h>.
14517 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14518 (cons_to_signed, cons_to_unsigned): New decls.
14519 (long_to_cons, cons_to_long): Remove decls.
14520 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14521 (Fprimitive_undo): Use CONS_TO_INTEGER.
14522 * xfns.c (Fx_window_property): Likewise.
14523 * xselect.c: Include <limits.h>.
14524 (x_own_selection, selection_data_to_lisp_data):
14525 Use INTEGER_TO_CONS.
14526 (x_handle_selection_request, x_handle_selection_clear)
14527 (x_get_foreign_selection, Fx_disown_selection_internal)
14528 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14529 (lisp_data_to_selection_data): Use cons_to_unsigned.
14530 (x_fill_property_data): Use cons_to_signed.
14531 Report values out of range.
14532
d1f3d2af
PE
14533 Check for buffer and string overflow more precisely.
14534 * buffer.h (BUF_BYTES_MAX): New macro.
14535 * lisp.h (STRING_BYTES_MAX): New macro.
14536 * alloc.c (Fmake_string):
14537 * character.c (string_escape_byte8):
14538 * coding.c (coding_alloc_by_realloc):
14539 * doprnt.c (doprnt):
14540 * editfns.c (Fformat):
14541 * eval.c (verror):
14542 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14543 since they may not be the same number.
14544 * editfns.c (Finsert_char):
14545 * fileio.c (Finsert_file_contents):
14546 Likewise for BUF_BYTES_MAX.
14547
dd52fcea
PE
14548 * image.c: Use ptrdiff_t, not int, for sizes.
14549 (slurp_file): Switch from int to ptrdiff_t.
14550 All uses changed.
14551 (slurp_file): Check that file size fits in both size_t (for
14552 malloc) and ptrdiff_t (for sanity and safety).
14553
7f9bbdbb
PE
14554 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14555 if b->modtime has its maximal value.
14556
dfe18f82
PE
14557 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14558
84acfcf0
PE
14559 Don't assume time_t can fit into int.
14560 * buffer.h (struct buffer.modtime): Now time_t, not int.
14561 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14562 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14563
ccd9a01a
PE
14564 Minor fixes for signed vs unsigned integers.
14565 * character.h (MAYBE_UNIFY_CHAR):
14566 * charset.c (maybe_unify_char):
14567 * keyboard.c (read_char, reorder_modifiers):
14568 XINT -> XFASTINT, since the integer must be nonnegative.
14569 * ftfont.c (ftfont_spec_pattern):
14570 * keymap.c (access_keymap, silly_event_symbol_error):
14571 XUINT -> XFASTINT, since the integer must be nonnegative.
14572 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14573 since it makes no difference and we prefer signed.
14574 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14575 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14576 nonnegative.
14577
d6d100dd
SM
145782011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14579
14580 * window.h (Fwindow_frame): Declare.
14581
2b6148e4
PE
145822011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14583
14584 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14585 (SPARE_MEMORY): Always define.
14586 (LARGE_REQUEST): Remove.
14587 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14588
f230ecc9
MR
145892011-06-06 Martin Rudalics <rudalics@gmx.at>
14590
727e958e
MR
14591 * lisp.h: Move EXFUNS for Fframe_root_window,
14592 Fframe_first_window and Fset_frame_selected_window to window.h.
14593
14594 * window.h: Move EXFUNS for Fframe_root_window,
14595 Fframe_first_window and Fset_frame_selected_window here from
14596 lisp.h.
14597
14598 * frame.c (Fwindow_frame, Fframe_first_window)
14599 (Fframe_root_window, Fframe_selected_window)
14600 (Fset_frame_selected_window): Move to window.c.
14601 (Factive_minibuffer_window): Move to minibuf.c.
14602 (Fother_visible_frames_p): New function.
14603
14604 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14605
f230ecc9
MR
14606 * window.c (decode_window, decode_any_window): Move up in code.
14607 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14608 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
14609 (Fwindow_buffer): Move up and rewrite doc-string.
14610 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14611 (Fwindow_prev): New functions.
727e958e
MR
14612 (Fwindow_frame): Move here from frame.c. Accept any window as
14613 argument.
14614 (Fframe_root_window, Fframe_first_window)
14615 (Fframe_selected_window): Move here from frame.c. Accept frame
14616 or arbitrary window as argument. Update doc-strings.
14617 (Fminibuffer_window): Move up in code.
14618 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
14619 (Fset_frame_selected_window): Move here from frame.c.
14620 Marginal rewrite.
727e958e
MR
14621 (Fselected_window, select_window, Fselect_window): Move up in
14622 code. Minor doc-string fixes.
f230ecc9 14623
4d09bcf6
PE
146242011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14625
14626 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14627 Do not assume that spare memory exists; that assumption is valid
14628 only if SYSTEM_MALLOC.
14629 (LARGE_REQUEST): New macro, so that the issue of large requests
14630 is separated from the issue of spare memory.
14631
810928a2
AS
146322011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14633
172418ad
AS
14634 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14635 format. (Bug#8806)
14636
43f862f7
AS
14637 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14638
810928a2
AS
14639 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14640 before statements.
14641
a059fe24
JD
146422011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14643
14644 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14645
14646 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14647
14648 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14649 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14650
989bf368
JB
146512011-06-05 Juanma Barranquero <lekktu@gmail.com>
14652
14653 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14654
4b80f674
CY
146552011-06-04 Chong Yidong <cyd@stupidchicken.com>
14656
14657 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14658 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
14659 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14660 New error handlers.
4b80f674
CY
14661 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14662 Obey Vx_select_enable_clipboard_manager. Catch errors in
14663 x_clipboard_manager_save (Bug#8779).
14664 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 14665 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 14666
99a33b77 146672011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
14668
14669 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14670
99a33b77 146712011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
14672
14673 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14674 in the current matrix if keep_current_p is non-zero.
14675
8264569d
EZ
146762011-06-04 Eli Zaretskii <eliz@gnu.org>
14677
14678 * bidi.c (bidi_level_of_next_char): Fix last change.
14679
57f97249
EZ
146802011-06-03 Eli Zaretskii <eliz@gnu.org>
14681
fec2107c 14682 Support bidi reordering of text covered by display properties.
57f97249 14683
fec2107c
EZ
14684 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14685 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14686 (bidi_cache_search, bidi_cache_iterator_state)
14687 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
14688 (bidi_level_of_next_char, bidi_move_to_visually_next):
14689 Support character positions inside a run of characters covered by a
fec2107c
EZ
14690 display string.
14691 (bidi_paragraph_init, bidi_resolve_explicit_1)
14692 (bidi_level_of_next_char): Call bidi_fetch_char and
14693 bidi_fetch_char_advance instead of FETCH_CHAR and
14694 FETCH_CHAR_ADVANCE.
14695 (bidi_init_it): Initialize new members.
14696 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14697 definitions.
14698 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14699 instead of using explicit *_CHAR codes.
d6d100dd
SM
14700 (bidi_resolve_explicit, bidi_resolve_weak):
14701 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
14702 bidirectional text is supported only in multibyte buffers.
14703 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14704 it to initialize the frame_window_p member of struct bidi_it.
14705 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14706 (bidi_resolve_explicit, bidi_resolve_weak)
14707 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14708 bidi_it->nchars is non-positive.
14709 (bidi_level_of_next_char): Don't try to lookup the cache for the
14710 next/previous character if nothing is cached there yet, or if we
14711 were just reseat()'ed to a new position.
c40e2fb2 14712
0e14fe90
EZ
14713 * xdisp.c (set_cursor_from_row): Set start and stop points
14714 according to the row's direction when priming the loop that looks
14715 for the glyph on which to display cursor.
14716 (single_display_spec_intangible_p): Function deleted.
14717 (display_prop_intangible_p): Reimplement to call
14718 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
14719 Accept 3 additional arguments needed by handle_display_spec.
14720 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
14721 values: lists, `(when COND...)' forms, etc.
14722 (single_display_spec_string_p): Support property values that are
14723 lists with the argument STRING its top-level element.
14724 (display_prop_string_p): Fix the condition for processing a
14725 property that is a list to be consistent with handle_display_spec.
fec2107c 14726 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
14727 last portion of handle_display_prop.
14728 (compute_display_string_pos): Accept additional argument
14729 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14730 value of a `display' property is a "replacing spec".
14731 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14732 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14733 the display property, but just return a value indicating whether
14734 the display property will replace the characters it covers.
14735 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14736 frame_window_p members of struct bidi_it.
d6d100dd
SM
14737 (compute_display_string_pos, compute_display_string_end):
14738 New functions.
fec2107c
EZ
14739 (push_it): Accept second argument POSITION, where pop_it should
14740 jump to continue iteration.
14741 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 14742
fec2107c
EZ
14743 * keyboard.c (adjust_point_for_property): Adjust the call to
14744 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
14745
14746 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
14747 (bidi_init_it): Update prototypes.
14748 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
14749 (compute_display_string_pos, compute_display_string_end):
14750 Declare prototypes.
fec2107c
EZ
14751 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14752 EMACS_INT.
fc6f18ce 14753
40087514 147542011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 14755
57f53182
PE
14756 Malloc failure behavior now depends on size of allocation.
14757 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14758 * lisp.h: Change signatures accordingly.
14759 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14760 All callers changed. (Bug#8762)
14761
14762 * gnutls.c: Use Emacs's memory allocators.
14763 Without this change, the gnutls library would invoke malloc etc.
14764 directly, which causes problems on non-SYNC_INPUT hosts, and which
14765 runs afoul of improving memory_full behavior. (Bug#8761)
14766 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14767 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14768 xfree instead of the default malloc, realloc, free.
14769 (Fgnutls_boot): No need to check for memory allocation failure,
14770 since xmalloc does that for us.
14771
ac32cd99 14772 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
14773 * category.c (hash_get_category_set):
14774 * ccl.c (ccl_driver):
14775 * charset.c (Fdefine_charset_internal):
14776 * charset.h (struct charset.hash_index):
14777 * composite.c (get_composition_id, gstring_lookup_cache)
14778 (composition_gstring_put_cache):
14779 * composite.h (struct composition.hash_index):
14780 * dispextern.h (struct image.hash):
14781 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14782 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14783 (hashfn_equal, hashfn_user_defined, make_hash_table)
14784 (maybe_resize_hash_table, hash_lookup, hash_put)
14785 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14786 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14787 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14788 * image.c (make_image, search_image_cache, lookup_image)
14789 (xpm_put_color_table_h):
14790 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 14791 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 14792 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 14793 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
14794 * alloc.c (allocate_vectorlike):
14795 Check for overflow in vector size calculations.
14796 * ccl.c (ccl_driver):
14797 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
14798 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14799 need to be updated by these changes.
40087514
PE
14800 * fns.c (make_hash_table, maybe_resize_hash_table):
14801 Check for integer overflow with large hash tables.
0de4bb68
PE
14802 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14803 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14804 (SXHASH_REDUCE): New macro.
14805 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14806 Use it instead of discarding useful hash info with large hash values.
14807 (sxhash_float): New function.
14808 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14809 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
14810 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14811 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
14812 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14813 Adjust signatures to match updated version of code.
14814 (consing_since_gc): Now EMACS_INT, since a single hash table can
14815 use more than INT_MAX bytes.
14816
698d32e2
DN
148172011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14818
14819 Make it possible to build with GCC-4.6+ -O2 -flto.
14820
14821 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14822
fd6fa53f
SM
148232011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14824
14825 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14826 Call minibuffer-inactive-mode.
14827
864db017
JB
148282011-05-31 Juanma Barranquero <lekktu@gmail.com>
14829
14830 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14831 Update dependencies.
14832
2ad0baf4
DN
148332011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14834
14835 * data.c (init_data): Remove code for UTS, this system is not
14836 supported anymore.
14837
4fcc2638
DN
148382011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14839
14840 Don't force ./temacs to start in terminal mode.
14841
14842 * frame.c (make_initial_frame): Initialize faces in all cases, not
14843 only when CANNOT_DUMP is defined.
14844 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14845
c56e0fd5
DN
148462011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14847
14848 * dispnew.c (add_window_display_history): Use const for the string
14849 pointer. Remove declaration, not needed.
14850
333d54da 148512011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 14852
55d4c1b2 14853 Use 'inline', not 'INLINE'.
333d54da 14854 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
14855 * alloc.c, fontset.c (INLINE): Remove.
14856 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14857 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14858 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14859 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14860 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14861
738db178
DN
148622011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14863
14864 Make it possible to run ./temacs.
14865
14866 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14867 syms_of_callproc does the same thing. Remove test for
14868 "initialized", do it in the caller.
14869 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14870
620c53a6
SM
148712011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14872
14873 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14874 (read_minibuf): Use get_minibuffer.
14875 (syms_of_minibuf): Use DEFSYM.
14876 (Qmetadata): New var.
14877 * data.c (Qbuffer): Don't make it static.
14878 (syms_of_data): Use DEFSYM.
14879
e003a292
PE
148802011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14881
14882 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14883 (CCL_CODE_MIN): New macro.
14884
ed008a6d
PE
148852011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14886
3687c2ef
PE
14887 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14888
ed008a6d
PE
14889 * eval.c (Qdebug): Now static.
14890 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14891 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14892 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14893
d66c4c7c
CY
148942011-05-29 Chong Yidong <cyd@stupidchicken.com>
14895
14896 * image.c: Various fixes to ImageMagick code comments.
14897 (Fimagemagick_types): Doc fix.
14898
5fbc2025
PE
148992011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14900
0196f88a
PE
14901 Minor fixes prompted by GCC 4.6.0 warnings.
14902
14903 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14904
5fbc2025
PE
14905 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14906 (x_clipboard_manager_save_all): Move extern decl to ...
14907 * xterm.h: ... here, so that it can be checked for consistency.
14908
1dd3c2d9
CY
149092011-05-29 Chong Yidong <cyd@stupidchicken.com>
14910
14911 * xselect.c (x_clipboard_manager_save_frame)
14912 (x_clipboard_manager_save_all): New functions.
14913 (Fx_clipboard_manager_save): Lisp function deleted.
14914
14915 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14916 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14917
14918 * xterm.h: Update prototype.
14919
5ba6571d
WX
149202011-05-28 William Xu <william.xwl@gmail.com>
14921
14922 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14923 exiting (Bug#8239).
14924
3eaff834
JM
149252011-05-28 Jim Meyering <meyering@redhat.com>
14926
e1900994 14927 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
14928 * fns.c (to_uchar): Define.
14929 (crypto_hash_function): Use it to convert some newly-signed
14930 variables to unsigned, to avoid sign-extension bugs. For example,
14931 without this change, (md5 "truc") would evaluate to
14932 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14933 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 14934 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 14935
0f6990a7
PE
149362011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14937
14938 Integer overflow fixes.
c8a9ca5a 14939
08686060
PE
14940 * dbusbind.c: Serial number integer overflow fixes.
14941 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
14942 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14943 to hold a serial number that is too large for a fixnum.
14944 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14945 Check for serial numbers out of range. Decode any serial number
59568bf0 14946 that was so large that it became a float. (Bug#8722)
08686060 14947
2d1fc3c7
PE
14948 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14949 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14950 Use XFASTINT rather than XUINT when numbers are nonnegative.
14951 (xd_append_arg, Fdbus_method_return_internal):
14952 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14953 arguments, check that Lisp number is nonnegative, rather than
59568bf0 14954 silently wrapping negative numbers around. (Bug#8722)
30217ff0 14955 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 14956 (Bug#8722)
2d1fc3c7 14957
c8a9ca5a
PE
14958 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14959
519e1d69
PE
14960 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14961
6df6ae42 14962 ccl: Add integer overflow checks.
30569699
PE
14963 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14964 (IN_INT_RANGE): New macros.
14965 (ccl_driver): Use them to check for integer overflow when
14966 decoding a CCL program. Many of the new checks are whether XINT (x)
14967 fits in int; it doesn't always, on 64-bit hosts. The new version
14968 doesn't catch all possible integer overflows, but it's an
847044ea 14969 improvement. (Bug#8719)
30569699 14970
c11285dc
PE
14971 * alloc.c (make_event_array): Use XINT, not XUINT.
14972 There's no need for unsigned here.
14973
fdccd48e
PE
14974 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14975 This follows up to the 2011-05-06 change that substituted uintptr_t
14976 for EMACS_INT. This case wasn't caught back then.
14977
37910ab2
PE
14978 Rework Fformat to avoid integer overflow issues.
14979 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14980 now (part of C89). Include <verify.h>.
14981 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14982 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14983 (Fformat): Avoid the prepass trying to compute sizes; it was only
14984 approximate and thus did not catch overflow reliably. Instead, walk
14985 through the format just once, formatting and computing sizes as we go,
14986 checking for integer overflow at every step, and allocating a larger
14987 buffer as needed. Keep track separately whether the format is
14988 multibyte. Keep only the most-recently calculated precision, rather
14989 than them all. Record whether each argument has been converted to
14990 string. Use EMACS_INT, not int, for byte and char and arg counts.
14991 Support field widths and precisions larger than INT_MAX. Avoid
14992 sprintf's undefined behavior with conversion specifications such as %#d
14993 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14994 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14995 formatting out-of-range floating point numbers with int
9173deec 14996 formats. (Bug#8668)
37910ab2 14997
2e6578fb
PE
14998 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14999
0ae6bdee
PE
15000 * data.c: Avoid integer truncation in expressions involving floats.
15001 * data.c: Include <intprops.h>.
15002 (arith_driver): When there's an integer overflow in an expression
15003 involving floating point, convert the integers to floating point
15004 so that the resulting value does not suffer from catastrophic
15005 integer truncation. For example, on a 64-bit host (* 4
15006 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
15007 Do not rely on undefined behavior after integer overflow.
15008
de883a70
PE
15009 merge count_size_as_multibyte, parse_str_to_multibyte
15010 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 15011 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
15012 Check for integer overflow.
15013 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
15014 since it's now a duplicate of the other. This is more of
15015 a character than a buffer op, so better that it's in character.c.
15016 * fns.c, print.c: Adjust to above changes.
15017
2ff916cb
PE
150182011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
15019
15020 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
15021
f1b54466
PE
150222011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15023
fb1ac845
PE
15024 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15025 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
15026 (x_clipboard_manager_save): Now static.
15027 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
15028
f1b54466
PE
15029 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15030 (crypto_hash_function): Now static.
15031 Fix pointer signedness problems. Avoid unnecessary initializations.
15032
a9f737ee
CY
150332011-05-27 Chong Yidong <cyd@stupidchicken.com>
15034
15035 * termhooks.h (Vselection_alist): Make it terminal-local.
15036
15037 * terminal.c (create_terminal): Initialize it.
15038
15039 * xselect.c: Support for clipboard managers.
15040 (Vselection_alist): Move to termhooks.h as terminal-local var.
15041 (LOCAL_SELECTION): New macro.
15042 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15043 (symbol_to_x_atom): Remove gratuitous arg.
15044 (x_handle_selection_request, lisp_data_to_selection_data)
15045 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
15046 (x_own_selection, x_get_local_selection, x_convert_selection):
15047 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
15048 (some_frame_on_display): Delete unused function.
15049 (Fx_own_selection_internal, Fx_get_selection_internal)
15050 (Fx_disown_selection_internal, Fx_selection_owner_p)
15051 (Fx_selection_exists_p): New optional frame arg.
15052 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
15053 (x_handle_selection_clear): Don't treat other terminals with the
15054 same keyboard specially. Use the terminal-local Vselection_alist.
15055 (x_clear_frame_selections): Use Frun_hook_with_args.
15056
15057 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
15058
15059 * xterm.h: Add support for those atoms.
15060
e067f0c1
CY
150612011-05-26 Chong Yidong <cyd@stupidchicken.com>
15062
15063 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15064 (converted_selections, conversion_fail_tag): New global variables.
15065 (x_selection_request_lisp_error): Free the above.
15066 (x_get_local_selection): Remove unnecessary code.
15067 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
15068 of converted selections stored in converted_selections.
15069 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
15070 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15071 (x_convert_selection): New function.
15072 (x_handle_selection_event): Simplify.
15073 (x_get_foreign_selection): Don't ignore incoming requests while
15074 waiting for an answer; this will fail when we implement
15075 SAVE_TARGETS, and seems unnecessary anyway.
15076 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15077 (Vx_sent_selection_functions): Doc fix.
15078
0f4aebc0
LL
150792011-05-26 Leo Liu <sdl.web@gmail.com>
15080
15081 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
15082
e61124cd
YM
150832011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15084
15085 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15086
15087 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15088 for fringe update if it has periodic bitmap.
ac389d0c 15089 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
15090 and fringe_bitmap_periodic_p.
15091
15092 * fringe.c (get_fringe_bitmap_data): New function.
15093 (draw_fringe_bitmap_1, update_window_fringes): Use it.
15094 (update_window_fringes): Record periodicity of fringe bitmap in glyph
15095 row. Mark glyph row for fringe update if periodicity changed.
15096
15097 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15098 for fringe update unless it has periodic bitmap.
15099
f16d9837
KH
151002011-05-25 Kenichi Handa <handa@m17n.org>
15101
15102 * xdisp.c (get_next_display_element): Set correct it->face_id for
15103 a static composition.
15104
e1b90ef6
LL
151052011-05-24 Leo Liu <sdl.web@gmail.com>
15106
15107 * deps.mk (fns.o):
15108 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15109
15110 * fns.c (crypto_hash_function, Fsha1): New function.
15111 (Fmd5): Use crypto_hash_function.
15112 (syms_of_fns): Add Ssha1.
15113
7400048f
PE
151142011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15115
15116 * gnutls.c: Remove unused macros.
15117 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15118 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15119 Remove macros that are defined and never used.
15120 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15121
abb71cf4
CY
151222011-05-22 Chong Yidong <cyd@stupidchicken.com>
15123
15124 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15125 (Fx_get_selection_internal): Minor cleanup.
15126 (Fx_own_selection_internal): Rename arguments for consistency with
15127 select.el.
15128
6307db39
PE
151292011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15130
15131 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15132
f3d4e0a4
CY
151332011-05-22 Chong Yidong <cyd@stupidchicken.com>
15134
15135 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15136
4d8ade89
YM
151372011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15138
15139 * dispnew.c (scrolling_window): Don't exclude the case that the
15140 last enabled row in the desired matrix touches the bottom boundary.
15141
32078c8d
GM
151422011-05-21 Glenn Morris <rgm@gnu.org>
15143
15144 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
15145 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15146 and add some more files.
32078c8d 15147
7285dc67
EZ
151482011-05-20 Eli Zaretskii <eliz@gnu.org>
15149
15150 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15151 report_file_error introduced by the change from 2011-05-07.
15152
89d1bd22
PE
151532011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15154
15155 * systime.h (Time): Define only if emacs is defined.
15156 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15157 where the include path doesn't have X11/X.h by default. See
15158 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15159
cd394be1 151602011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
15161
15162 * composite.c (find_automatic_composition): Fix previous change.
15163
b9704ad9
GM
151642011-05-20 Glenn Morris <rgm@gnu.org>
15165
15166 * lisp.mk: New file, split from Makefile.in.
15167 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15168 (shortlisp): Remove.
15169 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15170
4a720484
GM
151712011-05-19 Glenn Morris <rgm@gnu.org>
15172
15173 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15174 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15175 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15176 (lisp): Set the order to that of loadup.el.
15177 (shortlisp): Make it a copy of $lisp.
15178 (SOME_MACHINE_LISP): Remove.
15179 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15180 Use just $shortlisp, not $SOME_MACHINE_LISP too.
15181
a28d4396
KH
151822011-05-18 Kenichi Handa <handa@m17n.org>
15183
15184 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
15185 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
15186 (find_automatic_composition): Mostly rewrite for efficiency.
15187
a2b1fa8e
JB
151882011-05-18 Juanma Barranquero <lekktu@gmail.com>
15189
15190 * makefile.w32-in: Update dependencies.
15191
8e1f5610
CS
151922011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
15193
15194 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 15195 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 15196
7025ee00 151972011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 15198
cdfa6eab
PE
15199 Fix some integer overflow issues, such as string length overflow.
15200
06d6db33
PE
15201 * insdel.c (count_size_as_multibyte): Check for string overflow.
15202
2b4560a8
PE
15203 * character.c (lisp_string_width): Check for string overflow.
15204 Use EMACS_INT, not int, for string indexes and lengths; in
15205 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
15206 the resulting string length overflows an EMACS_INT; instead,
15207 report a string overflow if no precision given. When checking for
15208 precision exhaustion, use a check that cannot possibly have
15209 integer overflow. (Bug#8675)
15210 * character.h (lisp_string_width): Adjust to new signature.
15211
cb93f9be
PE
15212 * alloc.c (string_overflow): New function.
15213 (Fmake_string): Use it. This doesn't change behavior, but saves
15214 a few bytes and will simplify future changes.
15215 * character.c (string_escape_byte8): Likewise.
15216 * lisp.h (string_overflow): New decl.
15217
1a1f3366
PE
15218 Fixups, following up to the user-interface timestamp change.
15219 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
15220 for UI timestamps, instead of unsigned long.
9fbd6841
PE
15221 * msdos.c (mouse_get_pos): Likewise.
15222 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
15223 * w32gui.h (Time): Define by including "systime.h" rather than by
15224 declaring it ourselves. (Bug#8664)
15225
d4e3e4d3
PE
15226 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
15227 * image.c (clear_image_cache): Likewise.
15228
f6a24d19
PE
15229 * term.c (term_mouse_position): Don't assume time_t wraparound.
15230
08dc5ae6
PE
15231 Be more systematic about user-interface timestamps.
15232 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
15233 and sometimes 'EMACS_UINT', to represent these timestamps.
15234 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
15235 This makes the code easier to follow, and makes it easier to catch
15236 integer overflow bugs such as Bug#8664.
15237 * frame.c (Fmouse_position, Fmouse_pixel_position):
15238 Use Time, not unsigned long, for user-interface timestamps.
15239 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
15240 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
15241 * keyboard.h (last_event_timestamp): Likewise.
15242 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15243 * menu.h (xmenu_show): Likewise.
15244 * term.c (term_mouse_position): Likewise.
15245 * termhooks.h (struct input_event.timestamp): Likewise.
15246 (struct terminal.mouse_position_hook): Likewise.
15247 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15248 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15249 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
15250 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15251 what it was before.
15252 * menu.h, termhooks.h: Include "systime.h", for Time.
15253
8e55734a
PE
15254 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15255 Don't assume that the difference between two unsigned long values
15256 can fit into an integer. At this point, we know button_down_time
15257 <= event->timestamp, so the difference must be nonnegative, so
15258 there's no need to cast the result if double-click-time is
15259 nonnegative, as it should be; check that it's nonnegative, just in
15260 case. This bug is triggered when events are more than 2**31 ms
86db42d2 15261 apart (about 25 days). (Bug#8664)
8e55734a 15262
841f1b75 15263 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 15264 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 15265
3e26f69c
PE
15266 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15267 that always fit in int. Use a sentinel instead of a counter, to
15268 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
15269 * frame.h (struct frame): Use int for menu_bar_items_used
15270 instead of EMACS_INT, since it always fits in int.
3e26f69c 15271
5cc152c0
PE
15272 * menu.c (grow_menu_items): Check for int overflow.
15273
d89eb65e
PE
15274 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15275
5235bd3e
PE
15276 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15277 Before, the code was not consistent. These values cannot exceed
15278 2**31 - 1 so there's no need to make them unsigned.
15279 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15280 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15281 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15282 as modifiers.
15283 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15284
bc827e23
PE
15285 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15286 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15287 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15288 presumably because the widths might not match.
15289
78eb494e
PE
15290 * window.c (size_window): Avoid needless test at loop start.
15291
04f2d78b
CB
152922011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
15293
15294 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15295
d2fc7e3d 152962011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
15297
15298 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15299
d2fc7e3d 153002011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
15301
15302 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15303 `width' to `bar_area_x' and `bar_area_width', respectively.
15304 (x_scroll_run): Take account of fringe background extension.
15305
04f2d78b
CB
15306 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15307 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
15308 `bar_area_width', respectively.
15309 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15310 background extension.
15311
79b70037
GM
153122011-05-10 Jim Meyering <meyering@redhat.com>
15313
15314 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15315
2f142cc5
JB
153162011-05-10 Juanma Barranquero <lekktu@gmail.com>
15317
15318 * image.c (Finit_image_library): Return t for built-in image types,
15319 like pbm and xbm. (Bug#8640)
15320
57679c86
AS
153212011-05-09 Andreas Schwab <schwab@linux-m68k.org>
15322
15323 * w32menu.c (set_frame_menubar): Fix submenu allocation.
15324
888c9e86
EZ
153252011-05-07 Eli Zaretskii <eliz@gnu.org>
15326
b0512a1d
EZ
15327 * w32console.c (Fset_screen_color): Doc fix.
15328 (Fget_screen_color): New function.
15329 (syms_of_ntterm): Defsubr it.
15330
7285dc67
EZ
15331 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15332 unlink the temporary file if Fcall_process didn't create it in the
15333 first place.
15334 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15335 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
15336 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
15337 cue to call_process_cleanup not to close that handle.
15338
4d3fcc8e
BK
153392011-05-07 Ben Key <bkey76@gmail.com>
15340
15341 * makefile.w32-in: The bootstrap-temacs rule now makes use of
15342 one of two shell specific rules, either bootstrap-temacs-CMD or
15343 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
15344 to the previous implementation of the bootstrap-temacs rule.
15345 The bootstrap-temacs-CMD rule is similar to the previous
15346 implementation of the bootstrap-temacs rule except that it
15347 makes use of the ESC_CFLAGS variable instead of the CFLAGS
15348 variable.
15349
15350 These changes, along with some changes to nt/configure.bat,
15351 nt/gmake.defs, and nt/nmake.defs, are required to extend my
15352 earlier fix to add support for --cflags and --ldflags options
15353 that include quotes so that it works whether make uses cmd or
15354 sh as the shell.
15355
b4289b64
MA
153562011-05-06 Michael Albinus <michael.albinus@gmx.de>
15357
15358 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
15359 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
15360 is a constant.
15361 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
15362 a string. Handle both cases.
15363 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
15364 (Fdbus_register_method): Use Qinvalid_function.
15365
af4c0e28
JB
153662011-05-06 Juanma Barranquero <lekktu@gmail.com>
15367
15368 * makefile.w32-in: Update dependencies.
15369 (LISP_H): Add inttypes.h and stdin.h.
15370 (PROCESS_H): Add unistd.h.
15371
c51453d9
EZ
153722011-05-06 Eli Zaretskii <eliz@gnu.org>
15373
15374 * lread.c: Include limits.h (fixes the MS-Windows build broken by
15375 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15376
8ff0ac3c 153772011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 15378
4c4b566b
PE
15379 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15380
aab2b9b5
PE
15381 * term.c (vfatal): Remove stray call to va_end.
15382 It's not needed and the C Standard doesn't allow it here anyway.
15383
c378da0b
PE
15384 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15385 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
15386
288b08c7
PE
15387 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15388 bytes.
15389
e3601888
PE
15390 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15391
db6c0e74
PE
15392 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15393
dd5963ea
PE
15394 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15395
88c9450f
PE
15396 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15397
2f9442b8
PE
15398 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15399
c032b5f8
PE
15400 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15401 * charset.c (Fdefine_charset_internal): Don't initialize
15402 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 15403 32-bit int (Bug#8600).
a108c10b
PE
15404
15405 * lread.c (read_integer): Be more consistent with string-to-number.
15406 Use string_to_number to do the actual conversion; this avoids
15407 rounding errors and fixes some other screwups. Without this fix,
15408 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15409 (digit_to_number): Move earlier, for benefit of read_integer.
15410 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 15411 not a digit in any supported base. (Bug#8602)
a108c10b 15412
ad5f9eea
PE
15413 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15414
aec1708a
PE
15415 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15416 to match comment at start of function. This also removes a
15417 GCC warning about overflow in a 32+64-bit port.
15418
47be4ab5
PE
15419 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15420
371cac43
PE
15421 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15422 Reported by Stefan Monnier in
15423 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
15424 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15425 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 15426
d01a7826
PE
15427 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15428 (EMACS_UINTPTR): Likewise, with uintptr_t.
15429
7fd47d5c
PE
15430 * lisp.h: Prefer 64-bit EMACS_INT if available.
15431 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15432 on 32-bit hosts that have 64-bit int, so that they can access
15433 large files.
122b0c86
PE
15434 However, temporarily disable this change unless the temporary
15435 symbol WIDE_EMACS_INT is defined.
7fd47d5c 15436
8727937b
PE
15437 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15438
8ac068ac
PE
15439 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15440 This removes an assumption that EMACS_INT and long are the same
15441 width as pointers. The assumption is true for Emacs porting targets
15442 now, but we want to make other targets possible.
15443 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15444 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15445 In the rest of the code, change types of integers that hold casted
15446 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15447 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15448 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15449 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15450 No need to cast type when ORing.
15451 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15452 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15453 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15454 assume EMACS_INT is the same width as char *.
15455 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15456 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15457 Remove no-longer-needed casts.
15458 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15459 (xg_tool_bar_help_callback, xg_make_tool_item):
15460 Use EMACS_INTPTR to hold an integer
15461 that will be cast to void *; this can avoid a GCC warning
15462 if EMACS_INT is not the same width as void *.
15463 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15464 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15465 (current_message_1, set_message_1):
15466 Use a local to convert to proper width without a cast.
15467 * xmenu.c (dialog_selection_callback): Likewise.
15468
ede49d71
PE
15469 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15470 Also, don't assume VALBITS / RAND_BITS is less than 5,
15471 and don't rely on undefined behavior when shifting a 1 left into
15472 the sign bit.
15473 * lisp.h (get_random): Change signature to match.
15474
2f30ecd0
PE
15475 * lread.c (hash_string): Use size_t, not int, for hash computation.
15476 Normally we prefer signed values; but hashing is special, because
15477 it's better to use unsigned division on hash table sizes so that
15478 the remainder is nonnegative. Also, size_t is the natural width
15479 for hashing into memory. The previous code used 'int', which doesn't
15480 retain enough info to hash well into very large tables.
15481 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15482
2a866e7b
PE
15483 * dbusbind.c: Don't possibly lose pointer info when converting.
15484 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15485 Use XPNTR rather than XHASH, so that the high-order bits of
15486 the pointer aren't lost when converting through void *.
15487
51639eac
PE
15488 * eval.c (Fautoload): Don't double-shift a pointer.
15489
92394119
PE
15490 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15491
dbdb9a7c
JB
154922011-05-06 Juanma Barranquero <lekktu@gmail.com>
15493
15494 * gnutls.c (DEF_GNUTLS_FN):
15495 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15496
db7a0b4f
AS
154972011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15498
15499 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15500 marker. (Bug#8610)
15501
cd394be1 155022011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
15503
15504 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15505 New version that can reserve upto 2GB of heap space.
15506
f7ff1b0f 155072011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
15508
15509 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15510
639c109b
TZ
155112011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15512
15513 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15514 `gnutls_certificate_set_x509_key_file'.
15515
d2127135
JB
155162011-05-05 Juanma Barranquero <lekktu@gmail.com>
15517
15518 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15519 Update dependencies.
15520
e968f4f3
JB
155212011-05-04 Juanma Barranquero <lekktu@gmail.com>
15522
15523 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15524 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15525 Remove unused parameter `fildes'.
15526 * process.c (read_process_output, send_process): Don't pass it.
15527
84d358f0
JB
155282011-05-04 Juanma Barranquero <lekktu@gmail.com>
15529
15530 Fix previous change: the library cache is defined in w32.c.
15531 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15532 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15533
0898ca10
JB
155342011-05-04 Juanma Barranquero <lekktu@gmail.com>
15535
15536 Implement dynamic loading of GnuTLS on Windows.
15537
15538 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15539 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15540 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15541 Declare.
15542
15543 * gnutls.c (Qgnutls_dll): Define.
15544 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15545 (gnutls_*): Declare function pointers.
15546 (init_gnutls_functions): New function to initialize function pointers.
15547 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15548 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15549 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15550 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15551 (emacs_gnutls_write, emacs_gnutls_read)
15552 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15553 (Fgnutls_available_p): New function.
15554 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15555 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15556 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15557
15558 * image.c: Include w32.h.
15559 (Vimage_type_cache): Delete.
15560 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15561 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15562 (w32_delayed_load): Move to w32.c.
15563
15564 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15565
15566 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15567 (w32_delayed_load): Move from image.c. When loading a library, record
15568 its filename in the :loaded-from property of the library id.
15569 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15570 Initialize and staticpro them.
15571 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15572
15573 * process.c: Include lisp.h before w32.h, not after.
15574 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15575 instead of gnutls_record_check_pending.
15576
15577 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15578
ff4de4aa
TZ
155792011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15580
15581 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15582 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15583 as passed in.
15584
abe95abb
JD
155852011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15586
15587 * xterm.c (x_set_frame_alpha): Do not set property on anything
15588 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15589
e16e55d4
JB
155902011-05-02 Juanma Barranquero <lekktu@gmail.com>
15591
15592 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15593
bafcf6a5
JB
155942011-05-02 Juanma Barranquero <lekktu@gmail.com>
15595
15596 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15597 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15598 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15599 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15600 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15601 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15602 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15603 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15604 (Qgnutls_bootprop_callbacks_verify): Make static.
15605
e7a6747f
AS
156062011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15607
19ed11ba
AS
15608 * callproc.c: Indentation fixup.
15609
e7a6747f 15610 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
15611 (wait_for_termination, interruptible_wait_for_termination):
15612 Move after wait_for_termination_1.
e7a6747f 15613
1ef14cb4
LMI
156142011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15615
15616 * sysdep.c (interruptible_wait_for_termination): New function
15617 which is like wait_for_termination, but allows keyboard
15618 interruptions.
15619
15620 * callproc.c (Fcall_process): Add (:file "file") as an option for
15621 the STDOUT buffer.
15622 (Fcall_process_region): Ditto.
15623
330d880c
EZ
156242011-04-30 Eli Zaretskii <eliz@gnu.org>
15625
8db90b73
EZ
15626 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15627 rather than `XVECTOR (FOO)->size'.
15628
330d880c
EZ
15629 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15630 inttypes.h, as a gnulib replacement is used if it not available in
15631 system headers.
15632
15cbd324
EZ
156332011-04-21 Eli Zaretskii <eliz@gnu.org>
15634
15635 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15636 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15637 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15638
15639 * coding.c (coding_alloc_by_realloc): Error out if destination
15640 will grow beyond MOST_POSITIVE_FIXNUM.
15641 (decode_coding_emacs_mule): Abort if there isn't enough place in
15642 charbuf for the composition carryover bytes. Reserve an extra
15643 space for up to 2 characters produced in a loop.
15644 (decode_coding_iso_2022): Abort if there isn't enough place in
15645 charbuf for the composition carryover bytes.
15646
156472011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 15648
ae940cca
EZ
15649 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15650 aborting when %lld or %lll format is passed.
15651 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15652 %llo or %llx format is passed. (Bug#8545)
15653
03ab8921
EZ
15654 * window.c (window_scroll_line_based): Use a marker instead of
15655 simple variables to record original value of point. (Bug#7952)
15656
afda1437
EZ
15657 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15658 produced by %s or %c overflows available buffer space. (Bug#8545)
15659
f76dee0c
PE
156602011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15661
15662 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 15663 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 15664
fdc5744d
JB
156652011-04-28 Juanma Barranquero <lekktu@gmail.com>
15666
15667 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15668
638f053a
JB
156692011-04-28 Juanma Barranquero <lekktu@gmail.com>
15670
15671 * keyboard.c (Qdelayed_warnings_hook): Define.
15672 (command_loop_1): Run `delayed-warnings-hook'
15673 if Vdelayed_warnings_list is non-nil.
15674 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15675 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15676
d178f871
EZ
156772011-04-28 Eli Zaretskii <eliz@gnu.org>
15678
15679 * doprnt.c (doprnt): Don't return value smaller than the buffer
15680 size if the message was truncated. (Bug#8545).
15681
b124fd93
JB
156822011-04-28 Juanma Barranquero <lekktu@gmail.com>
15683
15684 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15685 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15686
e810457d
PE
156872011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15688
15689 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15690
ea51cceb
JB
156912011-04-27 Juanma Barranquero <lekktu@gmail.com>
15692
15693 * makefile.w32-in: Update dependencies.
15694
94dcfacf
EZ
156952011-04-27 Eli Zaretskii <eliz@gnu.org>
15696
15697 Improve `doprnt' and its usage. (Bug#8545)
15698 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15699 `format_end'. Remove support for %l as a conversion specifier.
15700 Don't use xrealloc. Improve diagnostics when the %l size modifier
15701 is used. Update the commentary.
15702
15703 * eval.c (verror): Simplify calculation of size_t.
15704
15705 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15706 messages.
15707
f61f41d7
PE
157082011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15709
15710 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15711 change.
15712
96fb4434
PE
157132011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15714
15715 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15716 This makes this file independent of the recent pseudovector change.
15717
671875da 157182011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 15719
69e9b5a3
PE
15720 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15721
b5f869a7 15722 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 15723 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 15724 Remove unused local.
c8926152 15725 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 15726
841a1577 15727 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
15728 GCC 4.6.0 optimizes based on type-based alias analysis.
15729 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
15730 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15731 != &v->size, and therefore "v->size = 1; b->size = 2; return
15732 v->size;" must therefore return 1. This assumption is incorrect
15733 for Emacs, since it type-puns struct Lisp_Vector * with many other
15734 types. To fix this problem, this patch adds a new type struct
f904488f 15735 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
15736 and pseudovectors, and helps optimizing compilers not get fooled
15737 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15738 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
15739 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15740 the size member.
eab3844f
PE
15741 (XSETPVECTYPE): Rewrite in terms of new macro.
15742 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15743 This is a bit clearer, and further avoids the possibility of
15744 undesirable aliasing.
15745 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 15746 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
15747 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15748 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
15749 (ASIZE): Now uses header.size rather than size.
15750 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
15751 to avoid the hassle of writing XVECTOR (foo)->header.size.
15752 (struct vectorlike_header): New type.
eab3844f
PE
15753 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15754 object, to help avoid aliasing.
15755 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15756 (SUBRP): Likewise, since Lisp_Subr is a special case.
15757 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15758 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15759 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 15760 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
15761 changed to be "header.size" and "header.next".
15762 * buffer.h (struct buffer): Likewise.
15763 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15764 * frame.h (struct frame): Likewise.
15765 * process.h (struct Lisp_Process): Likewise.
15766 * termhooks.h (struct terminal): Likewise.
15767 * window.c (struct save_window_data, struct saved_window): Likewise.
15768 * window.h (struct window): Likewise.
15769 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15770 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15771 * buffer.c (init_buffer_once): Likewise.
15772 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15773 special case.
15774 * process.c (Fformat_network_address): Use local var for size,
15775 for brevity.
15776
0df1eac5
PE
15777 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15778
847ab9d1 15779 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
15780 * data.c (atof): Remove decl; no longer used or needed.
15781 (digit_to_number): Move to lread.c.
15782 (Fstring_to_number): Use new string_to_number function, to be
15783 consistent with how the Lisp reader treats infinities and NaNs.
15784 Do not assume that floating-point numbers represent EMACS_INT
15785 without losing information; this is not true on most 64-bit hosts.
15786 Avoid double-rounding errors, by insisting on integers when
15787 parsing non-base-10 numbers, as the documentation specifies.
15788 * lisp.h (string_to_number): New decl, replacing ...
15789 (isfloat_string): Remove.
bc0a5c13 15790 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 15791 (read1): Do not accept +. and -. as integers; this
452f4150
PE
15792 appears to have been a coding error. Similarly, do not accept
15793 strings like +-1e0 as floating point numbers. Do not report
15794 overflow for integer overflows unless the base is not 10 which
15795 means we have no simple and reliable way to continue.
15796 Break out the floating-point parsing into a new
15797 function string_to_number, so that Fstring_to_number parses
15798 floating point numbers consistently with the Lisp reader.
04f2d78b 15799 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
15800 (E_CHAR, EXP_INT): Remove, replacing with ...
15801 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15802 (string_to_number): New function, replacing isfloat_string.
15803 This function checks for valid syntax and produces the resulting
15804 Lisp float number too. Rework it so that string-to-number
bc0a5c13 15805 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
15806 so that overflow for non-base-10 numbers is reported only when
15807 there's no portable and simple way to convert to floating point.
452f4150 15808
67769ffc
PE
15809 * textprop.c (set_text_properties_1): Rewrite for clarity,
15810 and to avoid GCC warning about integer overflow.
15811
c20db43f
PE
15812 * intervals.h (struct interval): Use EMACS_INT for members
15813 where EMACS_UINT might cause problems. See
15814 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15815 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15816 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15817 All uses changed.
37aa2f85
PE
15818 (offset_intervals): Tell GCC not to worry about length overflow
15819 when negating a negative length.
c20db43f 15820
2538aa2f
PE
15821 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15822 (overrun_check_free): Likewise.
15823
f2d3008d
PE
15824 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15825 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15826 word size.
15827
ec8df744
PE
15828 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15829 (gnutls_make_error): Rename local to avoid shadowing.
15830 (gnutls_emacs_global_deinit): ifdef out; not used.
15831 (Fgnutls_boot): Use const for pointer to readonly storage.
15832 Comment out unused local. Fix pointer signedness problems.
15833
640ee02d
PE
15834 * lread.c (openp): Don't stuff size_t into an 'int'.
15835 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15836 about possible signed overflow.
15837
6048fb2a
PE
15838 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15839 (GDK_KEY_g): Don't define if already defined.
15840 (xg_prepare_tooltip): Avoid pointer signedness problem.
15841 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15842
fa3c87e1
PE
15843 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15844 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15845
2172544b
PE
15846 * xfns.c (Fx_window_property): Simplify a bit,
15847 to make a bit faster and to avoid GCC 4.6.0 warning.
15848 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15849
9b821a21
PE
15850 * fns.c (internal_equal): Don't assume size_t fits in int.
15851
3c616cfa
PE
15852 * alloc.c (compact_small_strings): Tighten assertion a little.
15853
c2982e87
PE
15854 Replace pEd with more-general pI, and fix some printf arg casts.
15855 * lisp.h (pI): New macro, generalizing old pEd macro to other
15856 conversion specifiers. For example, use "...%"pI"d..." rather
15857 than "...%"pEd"...".
15858 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 15859 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
15860 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15861 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15862 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15863 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15864 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15865 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15866 64-bit hosts.
15867 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15868 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15869 * print.c (safe_debug_print, print_object): Likewise.
15870 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15871 to int.
6f04d126
PE
15872 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15873 avoiding the 0 flag, which is not portable.
c2982e87
PE
15874 * process.c (Fmake_network_process): Use pI to avoid cast.
15875 * region-cache.c (pp_cache): Likewise.
15876 * xdisp.c (decode_mode_spec): Likewise.
15877 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15878 behavior on 64-bit hosts with printf arg.
6f04d126 15879 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
15880 (x_stop_queuing_selection_requests): Likewise.
15881 (x_get_window_property): Don't truncate byte count to an 'int'
15882 when tracing.
0b432f21 15883
5e073ec7
PE
15884 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15885 here, since it parses constructs like leading '-' and spaces,
15886 which are not wanted; and it overflows with large numbers.
15887 Instead, simply match F[0-9]+, which is what is wanted anyway.
15888
36372bf9
PE
15889 * alloc.c: Remove unportable assumptions about struct layout.
15890 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15891 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15892 (allocate_vectorlike, make_pure_vector): Use the new macros,
15893 plus offsetof, to remove unportable assumptions about struct layout.
15894 These assumptions hold on all porting targets that I know of, but
15895 they are not guaranteed, they're easy to remove, and removing them
15896 makes further changes easier.
15897
0b432f21
PE
15898 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15899 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
15900 (string_overrun_cookie): Now const. Use initializers that
15901 don't formally overflow signed char, to avoid warnings.
000098c1
PE
15902 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15903 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
15904 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15905 multiple of sizeof (EMACS_INT); it need not be, if
15906 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 15907 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 15908
895009e1
JB
159092011-04-26 Juanma Barranquero <lekktu@gmail.com>
15910
15911 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15912
6a7a1b0b
TZ
159132011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15914
15915 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 15916 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
15917 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15918
841a1577 159192011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
15920
15921 * lisp.h (Qdebug): List symbol.
895009e1 15922 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
15923 * keyboard.c (debug-on-event): New variable.
15924 (handle_user_signal): Break into debugger when debug-on-event
15925 matches the current signal symbol.
15926
f2d3ba6f
DN
159272011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15928
15929 * alloc.c (check_sblock, check_string_bytes)
15930 (check_string_free_list): Convert to standard C.
15931
42ce4c63
TZ
159322011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15933
15934 * w32.c (emacs_gnutls_push): Fix typo.
15935
825cd63c
EZ
159362011-04-25 Eli Zaretskii <eliz@gnu.org>
15937
fb11d64d
EZ
15938 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15939 "cast to pointer from integer of different size".
15940
825cd63c
EZ
15941 Improve doprnt and its use in verror. (Bug#8545)
15942 * doprnt.c (doprnt): Document the set of format control sequences
15943 supported by the function. Use SAFE_ALLOCA instead of always
15944 using `alloca'.
15945
15946 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15947 is one byte too soon. Don't use xrealloc; instead xfree and
15948 xmalloc anew.
15949
e061a11b
TZ
159502011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15951
15952 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15953 callbacks stage.
15954
15955 * gnutls.c: Renamed global_initialized to
15956 gnutls_global_initialized. Added internals for the
15957 :verify-hostname-error, :verify-error, and :verify-flags
15958 parameters of `gnutls-boot' and documented those parameters in the
15959 docstring. Start callback support.
9173deec
JB
15960 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15961 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15962 on error. Return error code.
e061a11b
TZ
15963 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15964 (emacs_gnutls_read): Likewise.
15965 (Fgnutls_boot): Return handshake error code.
15966 (emacs_gnutls_handle_error): New function.
15967 (wsaerror_to_errno): Likewise.
15968
15969 * w32.h (emacs_gnutls_pull): Add prototype.
15970 (emacs_gnutls_push): Likewise.
15971
15972 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15973 (emacs_gnutls_push): Likewise.
15974
159752011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15976
15977 * process.c (wait_reading_process_output): Check if GnuTLS
15978 buffered some data internally if no FDs are set for TLS
15979 connections.
15980
15981 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15982 (LIBS): Link to USER_LIBS.
15983 ($(BLD)/gnutls.$(0)): New target.
15984
fa6996bc
EZ
159852011-04-24 Eli Zaretskii <eliz@gnu.org>
15986
eb35682e
EZ
15987 * xdisp.c (handle_single_display_spec): Rename the
15988 display_replaced_before_p argument into display_replaced_p, to
15989 make it consistent with the commentary. Fix typos in the
15990 commentary.
15991
e2ad650c
EZ
15992 * textprop.c (syms_of_textprop): Remove dead code.
15993 (copy_text_properties): Delete obsolete commentary about an
15994 interface that was deleted long ago. Fix typos in the description
15995 of arguments.
15996
1b2de274
EZ
15997 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15998 to changes in oldXMenu/XMenu.h from 2011-04-16.
15999 <menu_help_message, prev_menu_help_message>: Constify.
16000 (IT_menu_make_room): menu->help_text is now `const char **';
16001 adjust.
16002
16003 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
16004 to changes in oldXMenu/XMenu.h from 2011-04-16.
16005 (struct XMenu): Declare `help_text' `const char **'.
16006
16007 * xfaces.c <Qunspecified>: Make extern again.
16008
16009 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 16010 required by POSIX.
1b2de274 16011
762b15be
EZ
16012 * doc.c (get_doc_string): Improve the format passed to `error'.
16013
16014 * doprnt.c (doprnt): Improve commentary.
16015
16016 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
16017
16018 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
16019 them with etags.
16020
f1052e5d
EZ
16021 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
16022 changes in globals.h immediately force recompilation.
762b15be
EZ
16023 (TAGS): Depend on $(CURDIR)/m/intel386.h and
16024 $(CURDIR)/s/ms-w32.h.
16025 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 16026
fa6996bc
EZ
16027 * character.c (Fchar_direction): Function deleted.
16028 (syms_of_character): Don't defsubr it.
16029 <char-direction-table>: Deleted.
16030
e6c3da20
EZ
160312011-04-23 Eli Zaretskii <eliz@gnu.org>
16032
16033 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
16034 * doprnt.c: Include limits.h.
16035 (SIZE_MAX): New macro.
04f2d78b
CB
16036 (doprnt): Return a size_t value. 2nd arg is now size_t.
16037 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
16038 Improve overflow protection. Support `l' modifier for integer
16039 conversions. Support %l conversion. Don't assume an EMACS_INT
16040 argument for integer conversions and for %c.
16041
16042 * lisp.h (doprnt): Restore prototype.
16043
16044 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16045 $(SRC)/character.h.
16046
16047 * Makefile.in (base_obj): Add back doprnt.o.
16048
16049 * deps.mk (doprnt.o): Add back prerequisites.
16050 (callint.o): Depend on character.h.
16051
16052 * eval.c (internal_lisp_condition_case): Include the handler
16053 representation in the error message.
16054 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
16055 when breaking from the loop.
16056
16057 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
16058
16059 * callint.c (Fcall_interactively): When displaying error message
16060 about invalid control letter, pass the character's codepoint, not
16061 a pointer to its multibyte form. Improve display of the character
16062 in octal and display also its hex code.
16063
16064 * character.c (char_string): Use %x to display the (unsigned)
16065 codepoint of an invalid character, to avoid displaying a bogus
16066 negative value.
16067
16068 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16069 `error', not SYMBOL_NAME itself.
16070
16071 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16072 character arguments to `error'.
16073
16074 * charset.c (check_iso_charset_parameter): Fix incorrect argument
16075 to `error' in error message about FINAL_CHAR argument. Make sure
16076 FINAL_CHAR is a character, and use %c when it is passed as
16077 argument to `error'.
16078
4ffd0d6b 160792011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
16080
16081 * s/ms-w32.h (localtime): Redirect to sys_localtime.
16082
16083 * w32.c: Include <time.h>.
16084 (sys_localtime): New function.
16085
4ffd0d6b 160862011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
16087
16088 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16089
4ffd0d6b 16090 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 16091
4ffd0d6b 160922011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 16093
4ffd0d6b
GM
16094 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16095 zombies (Bug#8467).
aac0c6e3 16096
04c56954
EZ
160972011-04-19 Eli Zaretskii <eliz@gnu.org>
16098
16099 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16100 gl_state.e_property when gl_state.object is Qt.
16101
16102 * insdel.c (make_gap_larger): Remove limitation of buffer size
16103 to <= INT_MAX.
16104
16a43933
CY
161052011-04-18 Chong Yidong <cyd@stupidchicken.com>
16106
16107 * xdisp.c (lookup_glyphless_char_display)
16108 (produce_glyphless_glyph): Handle cons cell entry in
16109 glyphless-char-display.
16110 (Vglyphless_char_display): Document it.
16111
16112 * term.c (produce_glyphless_glyph): Handle cons cell entry in
16113 glyphless-char-display.
16114
4581706e
CY
161152011-04-17 Chong Yidong <cyd@stupidchicken.com>
16116
16117 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16118
16119 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16120
16121 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16122 definition for no-X builds.
16123
4887c6e2 161242011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 16125
fd35b6f9
PE
16126 Static checks with GCC 4.6.0 and non-default toolkits.
16127
5c1ccb01
PE
16128 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16129
006c5daa
PE
16130 * process.c (keyboard_bit_set): Define only if SIGIO.
16131 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16132 (send_process): Repair possible setjmp clobbering.
16133
efc736d3
PE
16134 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16135
4e2fe2e6
PE
16136 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16137
f97334a2
PE
16138 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16139
4e75f29d
PE
16140 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16141 Define only if needed.
16142
90efadd1
PE
16143 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16144 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 16145 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 16146
3c647824
PE
16147 * dispextern.h (struct redisplay_interface): Rename param
16148 to avoid shadowing.
e264f262 16149 * termhooks.h (struct terminal): Likewise.
761383f4 16150 * xterm.c (xembed_send_message): Likewise.
3c647824 16151
b58c5c4a
PE
16152 * insdel.c (make_gap_smaller): Define only if
16153 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16154
cad59032
PE
16155 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16156 it.
16157
c339dc2e
PE
16158 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16159 so that we aren't warned about unused symbols.
16160
91a3e27b
PE
16161 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16162
399c71d3 16163 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 16164
8ffc96f5
PE
16165 * xfns.c (x_real_positions): Mark locals as initialized.
16166
eef9bc79
PE
16167 * xmenu.c (xmenu_show): Don't use uninitialized vars.
16168
098db9dd
PE
16169 * xterm.c: Fix problems found by static analysis with other toolkits.
16170 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
16171 (x_dispatch_event): Declare static if USE_GTK, and
16172 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 16173 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 16174 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
16175 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16176 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 16177
eb18f6cc
PE
16178 * xmenu.c (menu_help_callback): Pointer type fixes.
16179 Use const pointers when pointing at readonly data. Avoid pointer
16180 signedness clashes.
16181 (FALSE): Remove unused macro.
16182 (update_frame_menubar): Remove unused decl.
16183
1fe72bf8
PE
16184 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
16185
60d9e1db
PE
16186 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
16187 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
16188 (single_menu_item): Rename local to avoid shadowing.
16189
39261c26
PE
16190 * keyboard.c (make_lispy_event): Remove unused local var.
16191
018c5e19
PE
16192 * frame.c, frame.h (x_get_resource_string): Bring this back, but
16193 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
16194
63d2b86e
PE
16195 * bitmaps: Change bitmaps from unsigned char back to the X11
16196 compatible char. Avoid the old compiler warnings about
16197 out-of-range initializers by using, for example, '\xab' rather
16198 than 0xab.
16199
aefd87e1
PE
16200 * xgselect.c (xgselect_initialize): Check vs interface
16201 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
16202
bf501fb9
PE
16203 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
16204
e9829fdf
PE
16205 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
16206 to read-only memory.
16207
1086c095
PE
16208 * fns.c (vector): Remove; this old hack is no longer needed.
16209
2baccd04 16210 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 16211 Remove unused var.
dde42981 16212 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 16213
72391843 16214 * xrdb.c (x_load_resources): Omit unused local.
3565b346 16215
436c16df 16216 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 16217 (x_window): Rename locals to avoid shadowing.
dc5ddd85 16218 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 16219
92bb796d 16220 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 16221 (x_term_init): Remove local to avoid shadowing.
92bb796d 16222
764430a3 16223 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
16224
16225 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
16226 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
16227
d1dfb56c
EZ
162282011-04-16 Eli Zaretskii <eliz@gnu.org>
16229
c4354cb4
EZ
16230 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
16231
d1dfb56c
EZ
16232 Fix regex.c, syntax.c and friends for buffers > 2GB.
16233 * syntax.h (struct gl_state_s): Declare character position members
16234 EMACS_INT.
16235
16236 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
16237
04f2d78b
CB
16238 * textprop.c (verify_interval_modification, interval_of):
16239 Declare arguments EMACS_INT.
d1dfb56c
EZ
16240
16241 * intervals.c (adjust_intervals_for_insertion): Declare arguments
16242 EMACS_INT.
16243
16244 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
16245
16246 * indent.c (Fvertical_motion): Local variable it_start is now
16247 EMACS_INT.
16248
16249 * regex.c (re_match, re_match_2, re_match_2_internal)
16250 (bcmp_translate, regcomp, regexec, print_double_string)
16251 (group_in_compile_stack, re_search, re_search_2, regex_compile)
16252 (re_compile_pattern, re_exec): Declare arguments and local
16253 variables `size_t' and `ssize_t' and return values `regoff_t', as
16254 appropriate.
16255 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16256 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16257 <compile_stack_type>: `size' and `avail' are now `size_t'.
16258
16259 * regex.h <regoff_t>: Use ssize_t, not int.
16260 (re_search, re_search_2, re_match, re_match_2): Arguments that
16261 specify buffer/string position and length are now ssize_t and
16262 size_t. Return type is regoff_t.
16263
613052cd
BK
162642011-04-16 Ben Key <bkey76@gmail.com>
16265
16266 * nsfont.m: Fixed bugs in ns_get_family and
16267 ns_descriptor_to_entity that were caused by using free to
16268 deallocate memory blocks that were allocated by xmalloc (via
16269 xstrdup). This caused Emacs to crash when compiled with
16270 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16271 --enable-checking=xmallocoverrun). xfree is now used to
16272 deallocate these memory blocks.
16273
4170f62f 162742011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 16275
71b41406
PE
16276 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16277
9587a89d
PE
16278 emacs_write: Accept and return EMACS_INT for sizes.
16279 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16280 et seq.
16281 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16282 Accept and return EMACS_INT.
16283 (emacs_gnutls_write): Return the number of bytes written on
16284 partial writes.
16285 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
16286 (emacs_read, emacs_write): Remove check for negative size, as the
16287 Emacs source code has been audited now.
9587a89d
PE
16288 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16289 (emacs_read, emacs_write): Use it.
273a5f82
PE
16290 * process.c (send_process): Adjust to the new signatures of
16291 emacs_write and emacs_gnutls_write. Do not attempt to store
16292 a byte offset into an 'int'; it might overflow.
9587a89d 16293 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 16294
3e047f51
PE
16295 * sound.c: Don't assume sizes fit in 'int'.
16296 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 16297 Return EMACS_INT, not int.
3e047f51 16298 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
16299 Accept EMACS_INT, not int.
16300 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
16301 record read return values.
16302
cc39a9db
BK
163032011-04-15 Ben Key <bkey76@gmail.com>
16304
c9d0ec6d
JB
16305 * keyboard.c (Qundefined): Don't declare static since it is used
16306 in nsfns.m.
16307 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16308 static since they are used in nsfont.m.
cc39a9db 16309
6c60eb9f
SM
163102011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
16311
16312 * process.c (Qprocessp): Don't declare static.
16313 * lisp.h (Qprocessp): Declare again.
16314
7990b61a
JB
163152011-04-15 Juanma Barranquero <lekktu@gmail.com>
16316
16317 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16318
5d4cb038
PE
163192011-04-14 Paul Eggert <eggert@cs.ucla.edu>
16320
8bd7b830 16321 Improve C-level modularity by making more things 'static'.
cd64ea1d 16322
e3b27b31
PE
16323 Don't publish debugger-only interfaces to other modules.
16324 * lisp.h (safe_debug_print, debug_output_compilation_hack):
16325 (verify_bytepos, count_markers): Move decls to the only modules
16326 that need them.
16327 * region-cache.h (pp_cache): Likewise.
16328 * window.h (check_all_windows): Likewise.
16329 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16330
5d4cb038
PE
16331 * sysdep.c (croak): Now static, if
16332 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16333 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
16334
16335 * alloc.c (refill_memory_reserve): Now static if
16336 !defined REL_ALLOC || defined SYSTEM_MALLOC.
16337 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 16338
e87b6180
PE
16339 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
16340 Define only if USE_LUCID.
16341
ac64929e
PE
16342 * xrdb.c (x_customization_string, x_rm_string): Now static.
16343
6f37259d
PE
16344 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
16345 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
16346
1683e3ab
PE
16347 * xdisp.c (draw_row_with_mouse_face): Now static.
16348 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
16349
de9c2632
PE
16350 * window.h (check_all_windows): Mark externally visible.
16351
2b96acb7
PE
16352 * window.c (window_deletion_count): Now static.
16353
16354 * undo.c: Make symbols static if they're not exported.
16355 (last_undo_buffer, last_boundary_position, pending_boundary):
16356 Now static.
16357
50436f33
PE
16358 * textprop.c (interval_insert_behind_hooks): Now static.
16359 (interval_insert_in_front_hooks): Likewise.
16360
64520e5c
PE
16361 * term.c: Make symbols static if they're not exported.
16362 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
16363 (max_frame_lines, tty_set_terminal_modes):
16364 (tty_reset_terminal_modes, tty_turn_off_highlight):
16365 (get_tty_terminal): Now static.
16366 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
16367 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 16368 HAVE_WINDOW_SYSTEM.
64520e5c
PE
16369 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16370 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16371
1fa53021
PE
16372 * sysdep.c: Make symbols static if they're not exported.
16373 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16374 Now static.
16375 (sigprocmask_set, full_mask): Remove; unused.
16376 (wait_debugging): Mark as visible.
16377 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16378 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16379
d4b43b22
PE
16380 * syntax.c (syntax_temp): Define only if !__GNUC__.
16381
b7c513d0
PE
16382 * sound.c (current_sound_device, current_sound): Now static.
16383
989b29ad
PE
16384 * search.c (searchbufs, searchbuf_head): Now static.
16385
13a55a78
PE
16386 * scroll.c (scroll_cost): Remove; unused.
16387 * dispextern.h (scroll_cost): Remove decl.
16388
de68a1fc
PE
16389 * region-cache.h (pp_cache): Mark as externally visible.
16390
40ccffa6
PE
16391 * process.c: Make symbols static if they're not exported.
16392 (process_tick, update_tick, create_process, chan_process):
16393 (Vprocess_alist, proc_buffered_char, datagram_access):
16394 (fd_callback_data, send_process_frame, process_sent_to): Now static.
16395 (deactivate_process): Mark defn as static, as well as decl.
16396 * lisp.h (create_process): Remove decl.
16397 * process.h (chan_process, Vprocess_alist): Remove decls.
16398
ad64fc97
PE
16399 * print.c: Make symbols static if they're not exported.
16400 (print_depth, new_backquote_output, being_printed, print_buffer):
16401 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16402 (print_interval, print_number_index, initial_stderr_stream):
16403 Now static.
16404 * lisp.h (Fprinc): Remove decl.
16405 (debug_output_compilation_hack): Mark as externally visible.
16406
adddb265
PE
16407 * sysdep.c (croak): Move decl from here to syssignal.h.
16408 * syssignal.h (croak): Put it here, so the API can be checked when
16409 'croak' is called from dissociate_if_controlling_tty.
16410
1717ede2
PE
16411 * minibuf.c: Make symbols static if they're not exported.
16412 (minibuf_save_list, choose_minibuf_frame): Now static.
16413 * lisp.h (choose_minibuf_frame): Remove decl.
16414
fa5fb2bc
PE
16415 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16416
1e3890d1
PE
16417 * lread.c: Make symbols static if they're not exported.
16418 (read_objects, initial_obarray, oblookup_last_bucket_number):
16419 Now static.
16420 (make_symbol): Remove; unused.
16421 * lisp.h (initial_obarray, make_symbol): Remove decls.
16422
8a1414fa
PE
16423 * keyboard.c: Make symbols static if they're not exported.
16424 (single_kboard, recent_keys_index, total_keys, recent_keys):
16425 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16426 (this_single_command_key_start, echoing, last_auto_save):
16427 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16428 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16429 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16430 (Vlispy_mouse_stem, double_click_count):
16431 Now static.
16432 (force_auto_save_soon): Define only if SIGDANGER.
16433 (ignore_mouse_drag_p): Now static if
16434 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16435 (print_help): Remove; unused.
16436 (stop_character, last_timer_event): Mark as externally visible.
16437 * keyboard.h (ignore_mouse_drag_p): Declare only if
16438 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16439 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16440 * lisp.h (echoing): Remove decl.
16441 (force_auto_save_soon): Declare only if SIGDANGER.
16442 * xdisp.c (redisplay_window): Simplify code, to make it more
16443 obvious that ignore_mouse_drag_p is not accessed if !defined
16444 USE_GTK && !defined HAVE_NS.
16445
93ea6e8f
PE
16446 * intervals.c: Make symbols static if they're not exported.
16447 (merge_properties_sticky, merge_interval_right, delete_interval):
16448 Now static.
16449 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16450
77382fcc
PE
16451 * insdel.c: Make symbols static if they're not exported.
16452 However, leave prepare_to_modify_buffer alone. It's never
16453 called from outside this function, but that appears to be a bug.
16454 (combine_after_change_list, combine_after_change_buffer):
4889fc82 16455 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
16456 (adjust_after_replace_noundo): Remove; unused.
16457 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 16458 (signal_before_change): Remove decls.
77382fcc 16459
9306c32e
PE
16460 * indent.c (val_compute_motion, val_vmotion): Now static.
16461
cd44d2eb
PE
16462 * image.c: Make symbols static if they're not exported.
16463 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16464 if USE_GTK.
16465 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16466 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16467
ad9a7a06
PE
16468 * fringe.c (standard_bitmaps): Now static.
16469 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16470
81626931
PE
16471 * frame.c: Make symbols static if they're not exported.
16472 (x_report_frame_params, make_terminal_frame): Now static.
16473 (get_frame_param): Now static, unless HAVE_NS.
16474 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16475 (x_get_resource_string): Remove; not used.
16476 * frame.h (make_terminal_frame, x_report_frame_params):
16477 (x_get_resource_string); Remove decls.
16478 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16479 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16480
239f9db9
PE
16481 * font.c, fontset.c: Make symbols static if they're not exported.
16482 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16483 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16484 * font.c (font_close_object): Now static.
16485 * font.h (font_close_object): Remove.
16486 * fontset.c (FONTSET_OBJLIST): Remove.
16487 (free_realized_fontset) #if-0 the body, which does nothing.
16488 (face_suitable_for_char_p): #if-0, as it's never called.
16489 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
16490 * xfaces.c (face_at_string_position):
16491 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
16492 since 0 is always ASCII.
16493
dfcf3579
PE
16494 * fns.c (weak_hash_tables): Now static.
16495
5045092b
PE
16496 * fileio.c: Make symbols static if they're not exported.
16497 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16498 (Vwrite_region_annotation_buffers): Now static.
16499
57a96f5c
PE
16500 * eval.c: Make symbols static if they're not exported.
16501 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16502 * lisp.h (backtrace_list): Remove decl.
16503
35f08c38
PE
16504 * emacs.c: Make symbols static if they're not exported.
16505 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16506 (fatal_error_code, fatal_error_signal_hook, standard_args):
16507 Now static.
16508 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16509 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16510 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16511 * lisp.h (fatal_error_signal_hook): Remove decl.
16512 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16513
f44bd759
PE
16514 * editfns.c: Move a (normally-unused) function to its only use.
16515 * editfns.c, lisp.h (get_operating_system_release): Remove.
16516 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16517 worth the hassle of breaking this out.
16518
b532497d
PE
16519 * xterm.c: Make symbols static if they're not exported.
16520 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16521 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16522 (x_destroy_window, x_delete_display):
16523 Now static.
16524 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16525 (x_mouse_leave): Remove; unused.
16526 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16527 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16528 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16529 Remove decls.
16530 (x_mouse_leave): Declare only if WINDOWSNT.
16531 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16532 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16533 USE_X_TOOLKIT.
16534
1675728f
PE
16535 * ftxfont.c: Make symbols static if they're not exported.
16536 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16537 HAVE_FREETYPE.
16538 * font.h (ftxfont_driver): Likewise.
16539
e4cebfca
PE
16540 * xfns.c: Make symbols static if they're not exported.
16541 (x_last_font_name, x_display_info_for_name):
16542 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16543 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16544 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16545 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16546 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16547 (last_show_tip_args): Now static.
16548 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16549 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16550 (x_screen_planes): Remove; unused.
16551 * dispextern.h (x_screen_planes): Remove decl.
16552
5bf46f05
PE
16553 * dispnew.c: Make symbols static if they're not exported.
16554 * dispextern.h (redraw_garbaged_frames, scrolling):
16555 (increment_row_positions): Remove.
16556 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16557 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16558 Now static.
16559 (redraw_garbaged_frames): Remove; unused.
16560
435f4c28
PE
16561 * xfaces.c: Make symbols static if they're not exported.
16562 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16563 Remove decls.
16564 * xterm.h (defined_color): Remove decls.
16565 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16566 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16567 (menu_face_changed_default, defined_color, free_realized_face):
16568 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16569 (ascii_face_of_lisp_face): Remove; unused.
16570
8524aef3
PE
16571 * xdisp.c: Make symbols static if they're not exported.
16572 * dispextern.h (scratch_glyph_row, window_box_edges):
16573 (glyph_to_pixel_coords, set_cursor_from_row):
16574 (get_next_display_element, set_iterator_to_next):
16575 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16576 (show_mouse_face): Remove decls
16577 * frame.h (message_buf_print): Likewise.
16578 * lisp.h (pop_message, set_message, check_point_in_composition):
16579 Likewise.
16580 * xterm.h (set_vertical_scroll_bar): Likewise.
16581 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16582 (message_buf_print, scratch_glyph_row, displayed_buffer):
16583 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16584 (get_next_display_element, show_mouse_face, window_box_edges):
16585 (frame_to_window_pixel_xy, check_point_in_composition):
16586 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16587 (glyph_to_pixel_coords): Remove; unused.
16588
16390cd2
PE
16589 * dired.c (file_name_completion): Now static.
16590
16591 * dbusbind.c (xd_in_read_queued_messages): Now static.
16592
a25f4dfa
PE
16593 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16594 * data.c (circular_list_error): Remove.
16595
14a9c8df
PE
16596 * commands.h (last_point_position, last_point_position_buffer):
16597 (last_point_position_window): Remove decls.
16598 * keyboard.c: Make these variables static.
16599
04f2d78b
CB
16600 * coding.h (coding, code_convert_region, encode_coding_gap):
16601 Remove decls.
74ab6df5
PE
16602 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16603 (iso_code_class, detect_coding, code_convert_region): Now static.
16604 (encode_coding_gap): Remove; unused.
16605
38dfbee1
PE
16606 * chartab.c (chartab_chars, chartab_bits): Now static.
16607
a2cb4e63
PE
16608 * charset.h (charset_iso_8859_1): Remove decl.
16609 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16610 Now static.
16611
127198fd
PE
16612 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16613 * ccl.c (Vccl_program_table): Now static.
16614 (check_ccl_update): Remove; unused.
16615
d85b608f
PE
16616 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16617 * category.h: ... from here.
16618 * category.c (check_category_table, set_category_set): Now static.
16619
31cd66f3
PE
16620 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16621 * lisp.h: Remove these decls.
16622
c358e587
PE
16623 * buffer.c (buffer_count): Remove unused var.
16624
e78aecca
PE
16625 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16626 so that it's not optimized away.
16627 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16628 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16629 exported only to the debugger.
16630
e192d7d3 16631 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 16632 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 16633
92470028
PE
16634 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16635 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16636 was inaccessible from Lisp.
16637 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16638 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16639
244ed907
PE
16640 alloc.c: Import and export fewer symbols, and remove unused items.
16641 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16642 is defined.
16643 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16644 it's not optimized away by whole-program optimization.
16645 (message_enable_multibyte, free_misc): Remove.
16646 (catchlist, handlerlist, mark_backtrace):
16647 Declare only if BYTE_MARK_STACK.
16648 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16649 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16650 (message_enable_multibyte): Remove decl.
16651 (free_misc, interval_free_list, float_block, float_block_index):
16652 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16653 (cons_free_list, last_marked_index):
16654 Now static.
16655 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16656 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16657 (mark_backtrace): Define only if BYTE_MARK_STACK.
16658 * xdisp.c (message_enable_multibyte): Now static.
16659
61c2b50e 16660 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
16661 This makes it easier for human readers (and static analyzers)
16662 to see whether these variables are used from other modules.
16663 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16664 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16665 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16666 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16667 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16668 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16669 * xmenu.c, xselect.c:
16670 Declare Q* vars static if they are not used in other modules.
16671 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16672 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16673 Remove decls of unexported vars.
16674 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16675
95c82688
PE
16676 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16677
16a97296
PE
16678 Make Emacs functions such as Fatom 'static' by default.
16679 This makes it easier for human readers (and static analyzers)
16680 to see whether these functions can be called from other modules.
16681 DEFUN now defines a static function. To make the function external
16682 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
16683 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16684 (Finit_image_library):
16a97296
PE
16685 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16686 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16687 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16688 Remove decls, since these functions are now static.
16689 (Funintern, Fget_internal_run_time): New decls, since these functions
16690 were already external.
95c82688 16691
16a97296
PE
16692 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16693 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16694 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16695 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16696 * keyboard.c, keymap.c, lread.c:
16697 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16698 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16699 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16700 Mark functions with DEFUE instead of DEFUN,
16701 if they are used in other modules.
16702 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16703 decls for now-static functions.
16704 * buffer.h (Fdelete_overlay): Remove decl.
16705 * callproc.c (Fgetenv_internal): Mark as internal.
16706 * composite.c (Fremove_list_of_text_properties): Remove decl.
16707 (Fcomposition_get_gstring): New forward static decl.
16708 * composite.h (Fcomposite_get_gstring): Remove decl.
16709 * dired.c (Ffile_attributes): New forward static decl.
16710 * doc.c (Fdocumntation_property): New forward static decl.
16711 * eval.c (Ffetch_bytecode): New forward static decl.
16712 (Funintern): Remove extern decl; now in .h file where it belongs.
16713 * fileio.c (Fmake_symbolic_link): New forward static decl.
16714 * image.c (Finit_image_library): New forward static decl.
16715 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16716 * intervals.h (Fprevious_property_change):
16717 (Fremove_list_of_text_properties): Remove decls.
16718 * keyboard.c (Fthis_command_keys): Remove decl.
16719 (Fcommand_execute): New forward static decl.
16720 * keymap.c (Flookup_key): New forward static decl.
16721 (Fcopy_keymap): Now static.
16722 * keymap.h (Flookup_key): Remove decl.
16723 * process.c (Fget_process): New forward static decl.
16724 (Fprocess_datagram_address): Mark as internal.
16725 * syntax.c (Fsyntax_table_p): New forward static decl.
16726 (skip_chars): Remove duplicate decl.
16727 * textprop.c (Fprevious_property_change): New forward static decl.
16728 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16729 Now internal.
16730 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16731 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16732
785bbd42
PE
16733 * editfns.c (Fformat): Remove unreachable code.
16734
8b913b57
AS
167352011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16736
16737 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16738 change. (Bug#8496)
16739
a6744a35
EZ
167402011-04-13 Eli Zaretskii <eliz@gnu.org>
16741
16742 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16743 when at ZV. (Bug#8487)
16744
e7974947
AS
167452011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16746
baad03f0
AS
16747 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16748 (Bug#8437)
16749 * keyboard.c (parse_tool_bar_item): Likewise.
16750 * sound.c (sound_cleanup, alsa_close): Likewise.
16751 * termcap.c (tgetent): Likewise.
16752 * xfns.c (x_default_font_parameter): Likewise.
16753 * xsettings.c (read_and_apply_settings): Likewise.
16754
e7974947
AS
16755 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16756 (overrun_check_free): Protoize.
16757
28272684
PE
167582011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16759
16760 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16761 since callers should never pass a negative size.
16762 Change the signature to match that of plain 'read' and 'write'; see
16763 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16764 * lisp.h: Update prototypes of emacs_write and emacs_read.
16765
11997c76
EZ
167662011-04-11 Eli Zaretskii <eliz@gnu.org>
16767
16768 * xdisp.c (redisplay_window): Don't try to determine the character
16769 position of the scroll margin if the window start point w->startp
e896f03c 16770 is outside the buffer's accessible region. (Bug#8468)
11997c76 16771
8a2cbd72
EZ
167722011-04-10 Eli Zaretskii <eliz@gnu.org>
16773
16774 Fix write-region and its subroutines for buffers > 2GB.
16775 * fileio.c (a_write, e_write): Modify declaration of arguments and
16776 local variables to support buffers larger than 2GB.
16777 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16778
16779 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16780 argument, local variables, and return value.
16781
16782 * lisp.h: Update prototypes of emacs_write and emacs_read.
16783
16784 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16785
4073e537 167862011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 16787
1ebfdcb6
PE
16788 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16789
b2ded58d
PE
16790 Fix more problems found by GCC 4.6.0's static checks.
16791
7d66342c
PE
16792 * xdisp.c (vmessage): Use a better test for character truncation.
16793
bbf47d44
PE
16794 * charset.c (load_charset_map): <, not <=, for optimization,
16795 and to avoid potential problems with integer overflow.
9248994d 16796 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 16797 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 16798 * editfns.c (Fformat): Likewise.
1e69125e 16799 * syntax.c (skip_chars): Likewise.
3befa583 16800
e3019616
PE
16801 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16802 This also lets GCC 4.6.0 generate slightly better loop code.
16803
becfa255
PE
16804 * callint.c (Fcall_interactively): <, not <=, for optimization.
16805 (Fcall_interactively): Count the number of arguments produced,
16806 not the number of arguments given. This is simpler and lets GCC
16807 4.6.0 generate slightly better code.
16808
dae0cd48
PE
16809 * ftfont.c: Distingish more carefully between FcChar8 and char.
16810 The previous code passed unsigned char * to a functions like
16811 strlen and xstrcasecmp that expect char *, which does not
16812 conform to the C standard.
16813 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16814 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16815 char * when the C standard requires it.
16816
76032d70
PE
16817 * keyboard.c (read_char): Remove unused var.
16818
eb3f1cc8
PE
16819 * eval.c: Port to Windows vsnprintf (Bug#8435).
16820 Include <limits.h>.
16821 (SIZE_MAX): Define if the headers do not.
16822 (verror): Do not give up if vsnprintf returns a negative count.
16823 Instead, grow the buffer. This ports to Windows vsnprintf, which
16824 does not conform to C99. Problem reported by Eli Zaretskii.
16825 Also, simplify the allocation scheme, by avoiding the need for
16826 calling realloc, and removing the ALLOCATED variable.
16827
70476b54
PE
16828 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16829
12020a9e
PE
16830 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16831 But keep the doprint source code for now, as we might revamp it
16832 and use it again (Bug#8435).
ea6c7ae6
PE
16833 * lisp.h (doprnt): Remove.
16834 * Makefile.in (base_obj): Remove doprnt.o.
16835 * deps.mk (doprnt.o): Remove.
16836
5fdb398c
PE
16837 error: Print 32- and 64-bit integers portably (Bug#8435).
16838 Without this change, on typical 64-bit hosts error ("...%d...", N)
16839 was used to print both 32- and 64-bit integers N, which relied on
16840 undefined behavior.
61bdb816 16841 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
16842 * lisp.h (error, verror): Mark as printf-like functions.
16843 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16844 Report overflow in size calculations when allocating printf buffer.
16845 Do not truncate output string at its first null byte.
16846 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16847 Truncate the output at a character boundary, since vsnprintf does not
16848 do that.
16849 * charset.c (check_iso_charset_parameter): Convert internal
16850 character to string before calling 'error', since %c now has the
16851 printf meaning.
16852 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16853 overflow when computing char to be passed to 'error'. Do not
16854 pass Lisp_Object to 'error'; pass the integer instead.
16855 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16856 formatted with plain %d.
16857
b189fa66
PE
16858 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16859
bff87ef0
PE
16860 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16861
7e2cac20
PE
16862 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16863
ce4d90b5
PE
16864 * xterm.c (x_catch_errors): Remove duplicate declaration.
16865
266c9547
PE
16866 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16867
79c49ad2
PE
16868 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16869
368f4090
JM
168702011-04-10 Jim Meyering <meyering@redhat.com>
16871
16872 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16873 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16874 return ssize_t not "int", and use size_t as the buffer length.
16875 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16876 * gnutls.h: Update declarations.
16877 * process.c (read_process_output): Use ssize_t, to match.
16878 (send_process): Likewise.
16879
a32d4040
CY
168802011-04-09 Chong Yidong <cyd@stupidchicken.com>
16881
16882 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16883
8546720e 168842011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 16885
04f2d78b
CB
16886 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16887 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 16888
8546720e
GM
16889 * xterm.c (handle_one_xevent):
16890 * xmenu.c (create_and_show_popup_menu):
16891 * xselect.c (x_decline_selection_request)
16892 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 16893
0a2f5c1a 168942011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
16895
16896 Fix some uses of `int' instead of EMACS_INT.
16897 * search.c (string_match_1, fast_string_match)
16898 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16899 (scan_buffer, find_next_newline_no_quit)
16900 (find_before_next_newline, search_command, Freplace_match)
16901 (Fmatch_data): Make some `int' variables be EMACS_INT.
16902
16903 * xdisp.c (display_count_lines): 3rd argument and return value now
16904 EMACS_INT. All callers changed.
16905 (pint2hrstr): Last argument is now EMACS_INT.
16906
16907 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16908 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16909 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16910 (decode_coding_utf_16, decode_coding_emacs_mule)
16911 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16912 (decode_coding_ccl, decode_coding_charset)
16913 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16914 (decode_coding_iso_2022, decode_coding_emacs_mule)
16915 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16916 <char_offset, last_offset>: Declare EMACS_INT.
16917 (encode_coding_utf_8, encode_coding_utf_16)
16918 (encode_coding_emacs_mule, encode_invocation_designation)
16919 (encode_designation_at_bol, encode_coding_iso_2022)
16920 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16921 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16922 Declare EMACS_INT.
16923 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16924 (encode_invocation_designation): Last argument P_NCHARS is now
16925 EMACS_INT.
16926 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16927 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16928
16929 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16930 All users changed.
16931
16932 * ccl.c (Fccl_execute_on_string): Declare some variables
16933 EMACS_INT.
16934
8546720e 169352011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
16936
16937 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16938
4e19a977
CS
169392011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16940
16941 * process.c (Fformat_network_address): Doc fix.
16942
87302331
R
169432011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16944
ee7683eb 16945 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 16946
cbb59342
CY
169472011-04-08 Chong Yidong <cyd@stupidchicken.com>
16948
16949 * keyboard.c (read_char): Call Lisp function help-form-show,
16950 instead of using internal_with_output_to_temp_buffer.
16951 (Qhelp_form_show): New var.
e0d38eeb 16952 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
16953
16954 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16955
16956 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16957
e67a13ab
CY
169582011-04-06 Chong Yidong <cyd@stupidchicken.com>
16959
04f2d78b
CB
16960 * process.c (Flist_processes): Remove to Lisp.
16961 (list_processes_1): Delete.
e67a13ab 16962
973f782d
EZ
169632011-04-06 Eli Zaretskii <eliz@gnu.org>
16964
7c106b1e
EZ
16965 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16966
973f782d
EZ
16967 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16968
41cf7d1a 169692011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 16970
ca23cc88
PE
16971 Fix more problems found by GCC 4.6.0's static checks.
16972
f390e2d5
PE
16973 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16974
42eea0d0
PE
16975 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16976
b69769da 16977 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 16978
f9541e84
PE
16979 * xdisp.c (vmessage): Mark as a printf-like function.
16980
13841b55
PE
16981 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16982
c136c10f
PE
16983 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16984
5e2d4a30
PE
16985 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16986 printf-like functions.
16987 (tiff_load): Add casts to remove these marks before passing them
16988 to system-supplied API.
16989
583f48b9
PE
16990 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16991
b25d760e
PE
16992 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16993 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
16994 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16995 directly, rather than having caller test rule sign. This avoids
16996 some unnecessary tests.
16997 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16998 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16999 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 17000
bc7b6697 17001 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 17002 (xfont_open): Avoid unnecessary tests.
bc7b6697 17003
27ccc379
PE
17004 * composite.c (composition_gstring_put_cache): Use unsigned integer.
17005
dcd5c89a
PE
17006 * composite.h, composite.c (composition_gstring_put_cache):
17007 Use EMACS_INT, not int, for length.
17008
b13a45c6
PE
17009 * composite.h (COMPOSITION_DECODE_REFS): New macro,
17010 breaking out part of COMPOSITION_DECODE_RULE.
17011 (COMPOSITION_DECODE_RULE): Use it.
17012 * composite.c (get_composition_id): Remove unused local vars,
17013 by using the new macro.
17014
1e792e4d
PE
17015 * textprop.c (set_text_properties_1): Change while to do-while,
17016 since the condition is always true at first.
17017
dc6c6455 17018 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
17019 (interval_deletion_adjustment): Return unsigned value.
17020 All uses changed.
dc6c6455 17021
aba7731a
PE
17022 * process.c (list_processes_1, create_pty, read_process_output):
17023 (exec_sentinel): Remove vars that were set but not used.
afd4052b 17024 (create_pty): Remove unnecessary "volatile"s.
bc57d757 17025 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 17026 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 17027 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 17028
fdfc4bf3
PE
17029 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
17030
fca8fe46 17031 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 17032 (update_syntax_table): Use unsigned instead of int.
fca8fe46 17033
06a0259a 17034 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 17035 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 17036 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 17037
e7b9e80f
PE
17038 * print.c (print_error_message): Avoid int overflow.
17039
56201685
PE
17040 * font.c (font_list_entities): Redo for clarity,
17041 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17042
78834453 17043 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 17044 (font_score): Avoid potential overflow in diff calculation.
78834453 17045
0bc0b309 17046 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 17047 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 17048
e610eaca
PE
17049 * eval.c (funcall_lambda): Rename local to avoid shadowing.
17050
b895abce
PE
17051 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
17052 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
17053 can always succeed if overflow has undefined behavior.
17054
1f1d9321 17055 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 17056 (wordify): Omit three unnecessary tests.
1f1d9321 17057
c59478bc
PE
17058 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
17059 All callers changed. This avoids the need for an unused var.
17060
79b73827
PE
17061 * casefiddle.c (casify_region): Remove var that is set but not used.
17062
a4db5dfe
PE
17063 * dired.c (file_name_completion): Remove var that is set but not used.
17064
43aae36e
PE
17065 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17066
2a47c44d 17067 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 17068 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 17069
a37c69bf
PE
17070 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17071 Check for integer overflow on size calculations.
17072
328ab8e7
PE
17073 * buffer.c (Fprevious_overlay_change): Remove var that is set
17074 but not used.
17075
e5a2a5cb
PE
17076 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17077 Remove vars that are set but not used.
8d84a6eb 17078 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 17079 (timer_check_2): Mark vars as initialized.
e5a2a5cb 17080
a60e5f68
PE
17081 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17082
f661cb61 17083 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 17084 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 17085
f0397f5a
PE
17086 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17087 that are set but not used.
17088
8664db06 17089 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 17090 if XCreateBitmapFromData fails (Bug#8410).
8664db06 17091
6abdaa4a
PE
17092 * xselect.c (x_get_local_selection, x_handle_property_notify):
17093 Remove vars that are set but not used.
17094
0ce7538d 17095 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 17096 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 17097
9ae848fc
PE
17098 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17099 Remove var that is set but not used.
0b918413
PE
17100 (scroll_bar_windows_size): Now size_t, not int.
17101 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
17102 Check for overflow.
9ae848fc 17103
a5a62657
PE
17104 * xfaces.c (realize_named_face): Remove vars that are set but not used.
17105 (map_tty_color) [!defined MSDOS]: Likewise.
17106
5c5cdd39
PE
17107 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17108
66ebf983
PE
17109 * coding.c: Remove vars that are set but not used.
17110 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17111 All callers changed.
17112 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17113 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17114 (decode_coding_charset): Remove vars that are set but not used.
17115
1be4d761
PE
17116 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17117 that is set but not used.
17118
47553fa8
PE
17119 * print.c (print_object): Remove var that is set but not used.
17120
1f7196bf 17121 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
17122 The gnulib version avoids calling malloc in the usual case,
17123 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17124 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17125 * filelock.c (current_lock_owner): Likewise.
17126 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17127 * sysdep.c: Include allocator.h, careadlinkat.h.
17128 (emacs_no_realloc_allocator): New static constant.
17129 (emacs_readlink): New function.
fdb61804
PE
17130 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17131 ../lib/careadlinkat.h.
d1fdcab7 17132
f84c17c7
SM
171332011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
17134
17135 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17136 first non-nil return value).
17137
ef3862ad
JD
171382011-04-03 Jan Djärv <jan.h.d@swipnet.se>
17139
17140 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17141 if not defined (Bug#8403).
17142
376a7006
JB
171432011-04-02 Juanma Barranquero <lekktu@gmail.com>
17144
17145 * xdisp.c (display_count_lines): Remove parameter `start',
17146 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17147 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17148 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17149 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17150 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17151 and thereabouts. All callers changed.
17152 (get_per_char_metric): Remove parameter `f', unused since
17153 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17154
6ca3801d
JM
171552011-04-02 Jim Meyering <meyering@redhat.com>
17156
17157 do not dereference NULL upon failed strdup
17158 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17159 (ns_get_family): Likewise.
17160
d8e2b5ba
JB
171612011-04-02 Juanma Barranquero <lekktu@gmail.com>
17162
17163 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17164
8c74fcbd
JD
171652011-04-02 Jan Djärv <jan.h.d@swipnet.se>
17166
17167 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17168 later (Bug#8403).
17169
7200d79c
SM
171702011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
17171
03408648 17172 Add lexical binding.
7200d79c 17173
03408648
SM
17174 * window.c (Ftemp_output_buffer_show): New fun.
17175 (Fsave_window_excursion):
17176 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17177
17178 * lread.c (lisp_file_lexically_bound_p): New function.
17179 (Fload): Bind Qlexical_binding.
17180 (readevalloop): Remove `evalfun' arg.
17181 Bind Qinternal_interpreter_environment.
17182 (Feval_buffer): Bind Qlexical_binding.
17183 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
17184 Mark as dynamic.
17185 (syms_of_lread): Declare `lexical-binding'.
17186
17187 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
17188
17189 * keyboard.c (eval_dyn): New fun.
17190 (menu_item_eval_property): Use it.
ca105506
SM
17191
17192 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 17193
03408648
SM
17194 * fns.c (concat, mapcar1): Accept byte-code-functions.
17195
17196 * eval.c (Fsetq): Handle lexical vars.
17197 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
17198 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
17199 (FletX, Flet): Obey lexical binding.
17200 (Fcommandp): Handle closures.
17201 (Feval): New `lexical' arg.
17202 (eval_sub): New function extracted from Feval. Use it almost
17203 everywhere where Feval was used. Look up vars in lexical env.
17204 Handle closures.
17205 (Ffunctionp): Move from subr.el.
17206 (Ffuncall): Handle closures.
17207 (apply_lambda): Remove `eval_flags'.
17208 (funcall_lambda): Handle closures and new byte-code-functions.
17209 (Fspecial_variable_p): New function.
17210 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
17211 but without exporting it to Lisp.
23aba0ea 17212
23aba0ea 17213 * doc.c (Fdocumentation, store_function_docstring):
03408648 17214 * data.c (Finteractive_form): Handle closures.
23aba0ea 17215
03408648
SM
17216 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
17217 interactive spec.
ba83908c 17218
04f2d78b
CB
17219 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
17220 New byte-codes.
03408648
SM
17221 (exec_byte_code): New function extracted from Fbyte_code to handle new
17222 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 17223
03408648 17224 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 17225
03408648 17226 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 17227
e2abce01
JB
172282011-03-31 Juanma Barranquero <lekktu@gmail.com>
17229
17230 * xdisp.c (redisplay_internal): Fix prototype.
17231
63696a73 172322011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 17233
63696a73 17234 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
17235 (try_scrolling): Use it when setting scroll_limit.
17236 Limit scrolling to 100 screen lines.
63696a73
EZ
17237 (redisplay_window): Even when falling back on "recentering",
17238 position point in the window according to scroll-conservatively,
17239 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
17240
17241 (try_scrolling): When point is above the window, allow searching
17242 as far as scroll_max, or one screenful, to compute vertical
17243 distance from PT to the scroll margin position. This prevents
17244 try_scrolling from unnecessarily failing when
17245 scroll-conservatively is set to a value slightly larger than the
17246 window height. Clean up the case of PT below the margin at bottom
17247 of window: scroll_max can no longer be INT_MAX. When aggressive
17248 scrolling is in use, don't let point enter the opposite scroll
17249 margin as result of the scroll.
17250 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
17251 threshold of 100 lines for never-recentering scrolling.
17252
e4cc2dfc
JB
172532011-03-31 Juanma Barranquero <lekktu@gmail.com>
17254
17255 * dispextern.h (move_it_by_lines):
17256 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17257 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
17258 (message_log_check_duplicate): Remove parameters `prev_bol' and
17259 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17260 (redisplay_internal): Remove parameter `preserve_echo_area',
17261 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
17262
17263 * indent.c (Fvertical_motion):
17264 * window.c (window_scroll_pixel_based, Frecenter):
17265 Don't pass `need_y_p' to `move_it_by_lines'.
17266
1c470562
SM
172672011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
17268
44f230aa
SM
17269 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17270 steal a few bits to be more compact.
17271 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17272 Remove unneeded casts.
17273
1c470562
SM
17274 * bytecode.c (Fbyte_code): CAR and CDR can GC.
17275
888adce9
ZK
172762011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
17277
17278 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17279 binding" message (bug#7967).
17280
f838ed7b
PE
172812011-03-30 Paul Eggert <eggert@cs.ucla.edu>
17282
77861b95
PE
17283 Fix more problems found by GCC 4.6.0's static checks.
17284
de6dbc14
PE
17285 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17286 Remove unused local var.
17287
f838ed7b
PE
17288 * editfns.c (Fmessage_box): Remove unused local var.
17289
792c7b2b
PE
17290 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17291 (note_mode_line_or_margin_highlight, note_mouse_highlight):
17292 Omit unused local vars.
c499e557 17293 * window.c (shrink_windows): Omit unused local var.
b01a1c29 17294 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
17295 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17296 Omit unused local var.
17297
ba0165e1
PE
17298 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17299 Don't assume string length fits in int.
32ad8845 17300 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 17301 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 17302
3c59b4c9
PE
17303 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17304 instead of alloca (Bug#8344).
17305
a3eed478 17306 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 17307 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 17308
eb4d412d
PE
17309 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17310
1658b401
PE
17311 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17312 concerns.
17313
17314 * term.c (produce_glyphless_glyph): Remove unnecessary test.
17315
17316 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 17317
9a2c6e05
PE
17318 * keyboard.c (syms_of_keyboard): Use the same style as later
17319 in this function when indexing through an array. This also
17320 works around GCC bug 48267.
17321
03d0a109
PE
17322 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17323
44f730c8
PE
17324 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17325
fe75f926
PE
17326 * chartab.c (sub_char_table_ref_and_range): Redo for slight
17327 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17328
ffa8c828
PE
17329 * keyboard.c, keyboard.h (num_input_events): Now size_t.
17330 This avoids undefined behavior on integer overflow, and is a bit
17331 more convenient anyway since it is compared to a size_t variable.
17332
c5101a77
PE
17333 Variadic C functions now count arguments with size_t, not int.
17334 This avoids an unnecessary limitation on 64-bit machines, which
17335 caused (substring ...) to crash on large vectors (Bug#8344).
17336 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
17337 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 17338 All variadic functions and their callers changed accordingly.
c5101a77
PE
17339 (struct gcpro.nvars): Now size_t, not int. All uses changed.
17340 * data.c (arith_driver, float_arith_driver): Likewise.
17341 * editfns.c (general_insert_function): Likewise.
17342 * eval.c (struct backtrace.nargs, interactive_p)
17343 (internal_condition_case_n, run_hook_with_args, apply_lambda)
17344 (funcall_lambda, mark_backtrace): Likewise.
17345 * fns.c (concat): Likewise.
17346 * frame.c (x_set_frame_parameters): Likewise.
17347 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
17348 0 if not found, not -1. All callers changed.
17349
dd3f25f7
PE
17350 * alloc.c (garbage_collect): Don't assume stack size fits in int.
17351 (stack_copy_size): Now size_t, not int.
17352 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
17353
461c2ab9
JB
173542011-03-28 Juanma Barranquero <lekktu@gmail.com>
17355
17356 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
17357 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17358 All callers changed.
17359
17360 * lisp.h (multibyte_char_to_unibyte):
17361 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
17362 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17363 * character.h (CHAR_TO_BYTE8):
17364 * cmds.c (internal_self_insert):
17365 * editfns.c (general_insert_function):
17366 * keymap.c (push_key_description):
17367 * search.c (Freplace_match):
17368 * xdisp.c (message_dolog, set_message_1): All callers changed.
17369
f6d62986
SM
173702011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
17371
17372 * keyboard.c (safe_run_hook_funcall): New function.
17373 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17374 don't set the hook to nil, but remove the offending function instead.
17375 (Qcommand_hook_internal): Remove, unused.
17376 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17377 Vcommand_hook_internal.
17378
17379 * eval.c (enum run_hooks_condition): Remove.
17380 (funcall_nil, funcall_not): New functions.
17381 (run_hook_with_args): Call each function through a `funcall' argument.
17382 Remove `cond' argument, now redundant.
17383 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17384 (Frun_hook_with_args_until_failure): Adjust accordingly.
17385 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17386
1db5b1ad
JB
173872011-03-28 Juanma Barranquero <lekktu@gmail.com>
17388
17389 * dispextern.h (string_buffer_position): Remove declaration.
17390
17391 * print.c (strout): Remove parameter `multibyte', unused since
17392 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
17393
17394 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17395 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17396 All callers changed.
17397
17398 * w32.c (_wsa_errlist): Use braces for struct initializers.
17399
17400 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17401 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17402 All callers changed.
17403 (string_buffer_position): Likewise. Also, make static (it's never
17404 used outside xdisp.c).
17405 (cursor_row_p): Remove parameter `w', unused since
17406 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
17407 (decode_mode_spec): Remove parameter `precision', introduced during
17408 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17409 All callers changed.
17410
5ffb62aa
JD
174112011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17412
17413 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17414
461c2ab9 174152011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
17416
17417 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17418 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17419 (ns_update_auto_hide_menu_bar): New functions.
17420 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17421 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17422 ns_constrain_all_frames.
17423 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17424 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17425
5c380ffb
JD
174262011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17427
17428 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17429
9af30bdf
GM
174302011-03-27 Glenn Morris <rgm@gnu.org>
17431
17432 * syssignal.h: Replace RETSIGTYPE with void.
17433 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17434 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17435 Replace SIGTYPE with void everywhere.
17436 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17437 * s/template.h (SIGTYPE): Remove commented out definition.
17438
e2abce01
JB
174392011-03-26 Eli Zaretskii <eliz@gnu.org>
17440
17441 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17442 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17443
f868cd8a
JB
174442011-03-26 Juanma Barranquero <lekktu@gmail.com>
17445
59eb0929
JB
17446 * w32.c (read_unc_volume): Use parameter `henum', instead of
17447 global variable `wget_enum_handle'.
17448
17449 * keymap.c (describe_vector): Remove parameters `indices' and
17450 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17451 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17452
f868cd8a
JB
17453 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17454
17455 * keyboard.c (timer_check): Remove parameter `do_it_now',
17456 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17457 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17458 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17459
17460 * keyboard.c (read_char):
17461 * w32menu.c (w32_menu_display_help):
17462 * xmenu.c (show_help_event, menu_help_callback):
17463 Adjust calls to `show_help_echo'.
17464
17465 * gtkutil.c (xg_maybe_add_timer):
17466 * keyboard.c (readable_events):
17467 * process.c (wait_reading_process_output):
17468 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17469
17470 * insdel.c (adjust_markers_gap_motion):
17471 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17472 (gap_left, gap_right): Don't call it.
17473
2ecf6fdb
CY
174742011-03-25 Chong Yidong <cyd@stupidchicken.com>
17475
17476 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17477 incurred during fontification.
17478
6b1f9ba4
JB
174792011-03-25 Juanma Barranquero <lekktu@gmail.com>
17480
17481 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17482 (DEFVAR_PER_BUFFER): Don't pass it.
17483
17484 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17485 (scrolling_window): Don't pass it.
17486
0f4a96b5
JB
174872011-03-25 Juanma Barranquero <lekktu@gmail.com>
17488
17489 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17490
17491 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17492 and `suffix'.
17493 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17494 of variables specific to SELinux and computation of `encoded_absname'.
17495
17496 * image.c (XPutPixel): Remove unused variable `height'.
17497
17498 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17499
17500 * unexw32.c (get_section_info): Remove unused variable `section'.
17501
17502 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17503 (system_process_attributes): Remove unused variable `sess'.
17504 (sys_read): Remove unused variable `err'.
17505
17506 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17507 (w32_wnd_proc): Remove unused variable `isdead'.
17508 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17509 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17510 (x_create_tip_frame): Remove unused variable `tem'.
17511
17512 * w32inevt.c (w32_console_read_socket):
17513 Remove unused variable `no_events'.
17514
17515 * w32term.c (x_draw_composite_glyph_string_foreground):
17516 Remove unused variable `width'.
17517
1149507c
JB
175182011-03-24 Juanma Barranquero <lekktu@gmail.com>
17519
17520 * w32term.c (x_set_glyph_string_clipping):
17521 Don't pass uninitialized region to CombineRgn.
17522
9c88f339
JB
175232011-03-23 Juanma Barranquero <lekktu@gmail.com>
17524
17525 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17526 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17527 (Fx_close_connection): Remove unused variable `i'.
17528
17529 * w32font.c (w32font_draw): Return number of glyphs.
17530 (w32font_open_internal): Remove unused variable `i'.
17531 (w32font_driver): Add missing initializer.
17532
17533 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17534 (fill_in_menu): Remove unused variable `items_added'.
17535
17536 * w32term.c (last_mouse_press_frame): Remove static global variable.
17537 (w32_clip_to_row): Remove unused variable `f'.
17538 (x_delete_terminal): Remove unused variable `i'.
17539
17540 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17541 (NOTHING): Remove unused static global variable.
17542 (uniscribe_check_otf): Remove unused variable `table'.
17543 (uniscribe_font_driver): Add missing initializers.
17544
dee091a3
JD
175452011-03-23 Julien Danjou <julien@danjou.info>
17546
17547 * term.c (Fsuspend_tty, Fresume_tty):
17548 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17549 * window.c (temp_output_buffer_show):
17550 * insdel.c (signal_before_change):
17551 * frame.c (Fhandle_switch_frame):
17552 * fileio.c (Fdo_auto_save):
17553 * emacs.c (Fkill_emacs):
17554 * editfns.c (save_excursion_restore):
17555 * cmds.c (internal_self_insert):
17556 * callint.c (Fcall_interactively):
17557 * buffer.c (Fkill_all_local_variables):
17558 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17559 Use Frun_hooks.
0f4a96b5 17560 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 17561 unconditionally since it does the check itself.
dee091a3 17562
2c520ab5 175632011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 17564
c9c49752
PE
17565 Fix more problems found by GCC 4.5.2's static checks.
17566
8abc3f12
PE
17567 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17568 the first time through the loop, since we know p0 < p1 then.
17569 This also avoids a gcc -Wstrict-overflow warning.
17570
a2d26660
PE
17571 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17572 leading to a memory leak, possible in functions like
17573 load_charset_map_from_file that can allocate an unbounded number
b12ef411 17574 of objects (Bug#8318).
a2d26660 17575
916c72e9
PE
17576 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17577 that could (at least in theory) be that large.
17578
19ab8a18
PE
17579 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17580 This is less likely to overflow, and avoids undefined behavior if
17581 overflow does occur. All callers changed. Use strtoul to scan
17582 for the unsigned long integer.
b7cbbd6f
PE
17583 (pint2hrstr): Simplify and tune code slightly.
17584 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 17585
f0641eff
PE
17586 * scroll.c (do_scrolling): Work around GCC bug 48228.
17587 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17588
7f650bb9
PE
17589 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17590 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
17591 (validate_x_resource_name): Simplify count usage.
17592 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 17593
37dd57d1
PE
17594 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17595 fail (Bug#8306).
81e56e61 17596
699979fc 17597 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 17598
401bf9b4
PE
17599 * process.c (Fmake_network_process): Use socklen_t, not int,
17600 where POSIX says socklen_t is required in portable programs.
17601 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 17602 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
17603 (Fmake_network_process, server_accept_connection):
17604 (wait_reading_process_output, read_process_output):
17605 Likewise.
17606
b93aacde
PE
17607 * process.c: Rename or move locals to avoid shadowing.
17608 (list_processes_1, Fmake_network_process):
17609 (read_process_output_error_handler, exec_sentinel_error_handler):
17610 Rename or move locals.
4dc343ee 17611 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 17612 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 17613 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 17614 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 17615 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 17616
af8a867c 17617 Make tparam.h and terminfo.c consistent.
44f230aa
SM
17618 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17619 Include tparam.h instead, since it declares them.
af8a867c
PE
17620 * cm.h (PC): Remove extern decl; tparam.h now does this.
17621 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17622 * terminfo.c: Include tparam.h, to check interfaces.
17623 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17624 (tparam): Adjust signature to match interface in tparam.h;
17625 this removes some undefined behavior. Check that outstring and len
17626 are zero, which they always are with Emacs.
17627 * tparam.h (PC, BC, UP): New extern decls.
17628
0248044d 17629 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 17630 (xftfont_open): Rename locals to avoid shadowing.
0248044d 17631
8ff096c1 17632 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
17633 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17634 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 17635 (ftfont_list): Remove unused local.
49eaafba
PE
17636 (get_adstyle_property, ftfont_pattern_entity):
17637 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17638 Rename locals to avoid shadowing.
8ff096c1 17639
e2be39f6
PE
17640 * xfont.c (xfont_list_family): Mark var as initialized.
17641
c9735e30
PE
17642 * xml.c (make_dom): Now static.
17643
8f5201ae
PE
17644 * composite.c (composition_compute_stop_pos): Rename local to
17645 avoid shadowing.
b246f932
PE
17646 (composition_reseat_it): Remove unused locals.
17647 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 17648 (composition_update_it): Mark var as initialized.
11b61122
PE
17649 (find_automatic_composition): Mark vars as initialized,
17650 with a FIXME (Bug#8290).
8f5201ae 17651
760fbc2c
PE
17652 character.h: Rename locals to avoid shadowing.
17653 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17654 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17655 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17656 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17657 to avoid shadowing.
17658
ff08eb85
PE
17659 * textprop.c (property_change_between_p): Remove; unused.
17660
fc7bf025
PE
17661 * intervals.c (interval_start_pos): Now static.
17662
235d7abc
PE
17663 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17664
44f230aa
SM
17665 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17666 Rename locals to avoid shadowing.
3e7d6594 17667
50060332
PE
17668 * sound.c (wav_play, au_play, Fplay_sound_internal):
17669 Fix pointer signedness.
d01f234b 17670 (alsa_choose_format): Remove unused local var.
c83b8872
PE
17671 (wav_play): Initialize a variable to 0, to prevent undefined
17672 behavior (Bug#8278).
50060332 17673
c4fc4e30
PE
17674 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17675
918436ed
PE
17676 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17677
c939f91b
PE
17678 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17679 clobbering (Bug#8298).
b9c7f648
PE
17680 * sysdep.c (sys_subshell): Likewise.
17681 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 17682
6bd8c144
PE
17683 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17684 This should get cleaned up, so that child_setup has the
17685 same signature on all platforms.
17686
7710357c 17687 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 17688 (relocate_fd): Rename locals to avoid shadowing.
7710357c 17689
c59da222
CY
176902011-03-22 Chong Yidong <cyd@stupidchicken.com>
17691
17692 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17693 not to be necessary, and produces flickering.
17694
66b87493
GM
176952011-03-20 Glenn Morris <rgm@gnu.org>
17696
17697 * config.in: Remove file.
17698
45b6f6d5
JB
176992011-03-20 Juanma Barranquero <lekktu@gmail.com>
17700
17701 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17702 are now in src/globals.h.
17703 (syms_of_minibuf): Remove spurious & from previous change.
17704
cd394be1 177052011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
17706
17707 * minibuf.c (completing-read-function): New variable.
17708 (completing-read-default): Rename from completing-read.
17709 (completing-read): Call completing-read-function.
17710
b14e3e21
CY
177112011-03-19 Juanma Barranquero <lekktu@gmail.com>
17712
17713 * xfaces.c (Fx_load_color_file):
17714 Read color file from absolute filename (bug#8250).
17715
f2b726e6
JB
177162011-03-19 Juanma Barranquero <lekktu@gmail.com>
17717
17718 * makefile.w32-in: Update dependencies.
17719
09f6ff02
EZ
177202011-03-17 Eli Zaretskii <eliz@gnu.org>
17721
17722 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17723
29a6015a
PE
177242011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17725
a3a6c54e
PE
17726 Fix more problems found by GCC 4.5.2's static checks.
17727
b766f867
PE
17728 * process.c (make_serial_process_unwind, send_process_trap):
17729 (sigchld_handler): Now static.
17730
be02381c
PE
17731 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17732 That way, the code declares only the vars that it needs.
17733 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17734 * s/cygwin.h (PTY_ITERATION): Likewise.
17735 * s/darwin.h (PTY_ITERATION): Likewise.
17736 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17737
57048744
PE
17738 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17739 * process.c (allocate_pty): Don't declare stb unless it's needed.
17740
7914961c 17741 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
17742 (CONSTANTLIM): Remove; unused.
17743 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17744 Define only if needed.
7914961c 17745
b3967b18
PE
17746 * unexelf.c (unexec): Name an expression,
17747 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
17748 Use a different way to cause a compilation error if anyone uses
17749 n rather than nn, a way that does not involve shadowing.
73366a00 17750 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 17751
29a6015a
PE
17752 * deps.mk (unexalpha.o): Remove; unused.
17753
43cfc33e 17754 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 17755 * unexec.h: New file.
ce701a33
PE
17756 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17757 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17758 Depend on unexec.h.
17759 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17760 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17761 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 17762 Change as necessary to match prototype in unexec.h.
ce701a33 17763
01f44d5a
PE
17764 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17765 shadowing.
4f63c6bb 17766 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 17767
a6670b0b
PE
17768 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17769 Rename locals to avoid shadowing.
17770
cef2010d 17771 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 17772 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 17773
d4d7173a
PE
17774 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17775
f08b802a
PE
17776 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17777 warning when compiling print.c.
17778
3ddb0639
PE
17779 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17780 instead of using an uninitialized var.
5ad03b97 17781 (font_sort_entities): Mark var as initialized.
3ddb0639 17782
170a2692
PE
17783 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17784
e663c700
PE
17785 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17786 pointers to constants.
89bc529a 17787 (font_parse_fcname): Remove unused vars.
7b81e2d0 17788 (font_delete_unmatched): Now static.
ea838e10 17789 (font_get_spec): Remove; unused.
13a547c6
PE
17790 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17791 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17792 Rename or move locals to avoid shadowing.
e663c700 17793
2a80c887 17794 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 17795 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 17796
1384fa33 17797 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 17798 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 17799
8b2c52e9
PE
17800 * alloc.c (mark_backtrace): Move decl from here ...
17801 * lisp.h: ... to here, so that it can be checked.
17802
475545b5 17803 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 17804 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
17805 (lisp_indirect_variable): Name an expression,
17806 to avoid gcc -Wbad-function-cast warning.
1faed8ae 17807 (Fdefvar): Rename locals to avoid shadowing.
475545b5 17808
b1349114 17809 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 17810 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 17811 Use const pointer when appropriate.
b1349114 17812
a2928364
PE
17813 * lisp.h (get_system_name, get_operating_system_release):
17814 Move decls here, to check interfaces.
17815 * process.c (get_operating_system_release): Move decl to lisp.h.
17816 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
17817 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17818 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17819 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
17820 (Fformat_time_string, Fencode_time, Finsert_char):
17821 (Ftranslate_region_internal, Fformat):
17822 Rename or remove local vars to avoid shadowing.
9710023e 17823 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 17824
a415e694
PE
17825 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17826 avoid shadowing.
17827
8ef4622d
PE
17828 * lisp.h (eassert): Check that the argument compiles, even if
17829 ENABLE_CHECKING is not defined.
17830
946f9a5b
PE
17831 * data.c (Findirect_variable): Name an expression, to avoid
17832 gcc -Wbad-function-cast warning.
112396d6 17833 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 17834 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
17835 (Fmake_variable_buffer_local, Fmake_local_variable):
17836 Mark variables as initialized.
52746918 17837 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 17838
e5aab7e7 17839 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
17840 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17841 Rename locals to avoid shadowing.
dff45157
PE
17842 (mark_stack): Move local variables into the #ifdef region where
17843 they're used.
7bc26fdb
PE
17844 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17845 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17846 needed otherwise.
17847 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17848 (GC_STRING_CHARS): Remove; not used.
d40d4be1 17849 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 17850
e5aab7e7
PE
17851 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17852 avoids undefined behavior in theory.
17853
4da60324
PE
17854 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17855
88043301
PE
17856 Use functions, not macros, for up- and down-casing (Bug#8254).
17857 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17858 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17859 to use the following functions instead of these macros.
17860 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17861 EMACS_INT, since callers assume the returned value fits in int.
17862 (upcase1): Likewise, for UPCASE_TABLE.
17863 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 17864 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 17865 the race-condition problem in the old DOWNCASE.
88043301 17866
19ed5445
PE
17867 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17868 Rename locals to avoid shadowing.
17869 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
17870 (regex_compile, re_search_2, re_match_2_internal):
17871 Remove unused local vars.
952db0d7
PE
17872 (FREE_VAR): Rewrite so as not to use empty "else",
17873 which gcc can warn about.
da053e48 17874 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
17875 (RETALLOC_IF): Define only if needed.
17876 (WORDCHAR_P): Likewise. This one is never needed, but is used
17877 only in a comment talking about a compiler bug, so put inside
17878 the #if 0 of that comment.
17879 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17880 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17881 Remove; unused.
19ed5445 17882
1f3561e4 17883 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
17884 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17885 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 17886
ded6f8f7
PE
17887 * search.c (simple_search): Remove unused var.
17888
dbd37a95
PE
17889 * dired.c (compile_pattern): Move decl from here ...
17890 * lisp.h: ... to here, so that it can be checked.
17891 (struct re_registers): New forward decl.
17892
7e47afad
PE
17893 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17894
85f24f61
PE
17895 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17896 All uses changed.
17897 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17898 Rename locals to avoid shadowing.
5671df8f 17899 (Fvertical_motion): Mark locals as initialized.
85f24f61 17900
181aa2be 17901 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 17902 (casify_region): Mark local as initialized.
181aa2be 17903
930d429c
PE
17904 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17905
7082eac6
PE
17906 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17907 New macros, so that the caller can use some names other than
17908 gcpro1, gcpro2, etc.
17909 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17910 of the new macros.
17911 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17912 argument, for consistency with GCPRO2_VAR, etc: it is now the
17913 prefix of the variable, not the variable itself. All uses
17914 changed.
38b2c076
PE
17915 * dired.c (directory_files_internal, file_name_completion):
17916 Rename locals to avoid shadowing.
17917
15206ed9
PE
17918 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17919 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17920 dired.c's scmp function, had undefined behavior.
17921 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17922 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17923 * buffer.h: ... to here, because these macros use current_buffer,
17924 and the new implementation with inline functions needs to have
17925 current_buffer in scope now, rather than later when the macros
17926 are used.
17927 (downcase, upcase1): New static inline functions.
17928 (DOWNCASE, UPCASE1): Reimplement using these functions.
17929 This avoids undefined behavior in expressions like
17930 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17931 from race conditions in accessing the global variables
17932 case_temp1 and case_temp2.
17933 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17934 * lisp.h (case_temp1, case_temp2): Remove their decls.
17935 * character.h (ASCII_CHAR_P): Move from here ...
17936 * lisp.h: ... to here, so that the inline functions mentioned
17937 above can use them.
17938
4a6bea26
PE
17939 * dired.c (directory_files_internal_unwind): Now static.
17940
f14b7e14
PE
17941 * fileio.c (file_name_as_directory, directory_file_name):
17942 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17943 Now static.
2893f146
PE
17944 (file_name_as_directory): Use const pointers when appropriate.
17945 (Fexpand_file_name): Likewise. In particular, newdir might
17946 point at constant storage, so make it a const pointer.
fd4ead52 17947 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
17948 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17949 signedness issues.
f839df0c
PE
17950 (Fset_file_times, Finsert_file_contents, auto_save_error):
17951 Rename locals to avoid shadowing.
f14b7e14 17952
5716756e 17953 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
17954 (Ftry_completion, Fall_completions): Rename or remove locals
17955 to avoid shadowing.
5716756e 17956
b4c3046a
PE
17957 * marker.c (bytepos_to_charpos): Remove; unused.
17958
b45db522
PE
17959 * lisp.h (verify_bytepos, count_markers): New decls,
17960 so that gcc does not warn that these functions aren't declared.
17961
85876d07
PE
17962 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17963 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 17964 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 17965 (copy_text): Remove unused local var.
85876d07 17966
03d78a21 17967 * filelock.c (within_one_second): Now static.
b3dd38ab 17968 (lock_file_1): Rename local to avoid shadowing.
03d78a21 17969
5df8f01b
PE
17970 * buffer.c (fix_overlays_before): Mark locals as initialized.
17971 (fix_start_end_in_overlays): Likewise. This function should be
17972 simplified by using pointers-to-pointers, but that's a different
17973 matter.
b1d876f1 17974 (switch_to_buffer_1): Now static.
8f54f30a
PE
17975 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17976 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 17977
a70072c9 17978 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 17979 Fix pointer signedness issue.
edced198
PE
17980 (sys_subshell): Mark local as volatile if checking for lint,
17981 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 17982 (MAXPATHLEN): Define only if needed.
a70072c9 17983
a0977c44
PE
17984 * process.c (serial_open, serial_configure): Move decls from here ...
17985 * systty.h: ... to here, so that they can be checked.
17986
a884fdcc
PE
17987 * fns.c (get_random, seed_random): Move extern decls from here ...
17988 * lisp.h: ... to here, so that they can be checked.
17989
604efe86 17990 * sysdep.c (reset_io): Now static.
b8950c94 17991 (wait_for_termination_signal): Remove; unused.
604efe86 17992
38fc62d9
PE
17993 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17994 (copy_keymap_item, append_key, push_text_char_description):
17995 Now static.
1004a21a 17996 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 17997 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
17998 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17999 (describe_map_tree):
18000 Rename locals to avoid shadowing.
38fc62d9 18001
2f2650da
PE
18002 * keyboard.c: Declare functions static if they are not used elsewhere.
18003 (echo_char, echo_dash, cmd_error, top_level_2):
18004 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
18005 (read_char, kbd_buffer_get_event, make_lispy_position):
18006 (make_lispy_event, make_lispy_movement, apply_modifiers):
18007 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
18008 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
18009 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 18010 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 18011 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 18012
a053e86c 18013 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
18014 (mark_kboards): Move decl here ...
18015 * alloc.c (mark_kboards): ... from here.
a053e86c 18016
4752793e
PE
18017 * lisp.h (force_auto_save_soon): New decl.
18018
74f10ca7 18019 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
18020 (DEFINE_DUMMY_FUNCTION): New macro.
18021 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
18022 Use it.
c03cd23f
PE
18023 (main): Add casts to avoid warnings
18024 if GCC considers string literals to be constants.
74f10ca7 18025
022e70d4
PE
18026 * lisp.h (fatal_error_signal): Add decl, since it's exported.
18027
59d6fe83
PE
18028 * dbusbind.c: Pointer signedness fixes.
18029 (xd_signature, xd_append_arg, xd_initialize):
18030 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18031 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18032 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
18033 (Fdbus_register_signal): Use SSDATA when the context wants char *.
18034
78320123
PE
18035 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
18036 if GCC considers string literals to be constants.
49cebcca 18037 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 18038
35ac2a97
SM
180392011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
18040
fb103ca9
SM
18041 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18042 (print_preprocess, print_object): New macro to fix last change.
18043
35ac2a97
SM
18044 * print.c (print_preprocess): Don't forget font objects.
18045
62973b41
JB
180462011-03-16 Juanma Barranquero <lekktu@gmail.com>
18047
18048 * emacs.c (USAGE3): Doc fixes.
18049
0e48bb22
AS
180502011-03-15 Andreas Schwab <schwab@linux-m68k.org>
18051
18052 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
18053 structure.
18054
7684e57b
JB
180552011-03-14 Juanma Barranquero <lekktu@gmail.com>
18056
18057 * lisp.h (VWindow_system, Qfile_name_history):
18058 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
18059 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
18060 (w32_system_caret_x, w32_system_caret_y): Declare extern.
18061
18062 * w32select.c: Don't #include "keyboard.h".
c96bbc66 18063 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
18064
18065 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18066 * w32console.c (detect_input_pending, read_input_pending)
18067 (encode_terminal_code):
18068 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18069 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18070 (w32_system_caret_y, Qfile_name_history):
18071 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18072 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18073 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18074 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18075 * w32proc.c (Qlocal, report_file_error):
18076 * w32term.c (Vwindow_system, updating_frame):
18077 * w32uniscribe.c (initialized, uniscribe_font_driver):
18078 Remove unneeded extern declarations.
18079
2aa46d6c
CY
180802011-03-14 Chong Yidong <cyd@stupidchicken.com>
18081
c96bbc66 18082 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 18083
cffc6f3b
CY
180842011-03-13 Chong Yidong <cyd@stupidchicken.com>
18085
18086 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18087 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18088 These macros can no longer be used for assignment.
18089
44f230aa
SM
18090 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18091 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
18092 (record_buffer_markers, fetch_buffer_markers): New functions for
18093 recording and fetching special buffer markers.
18094 (set_buffer_internal_1, set_buffer_temp): Use them.
18095
18096 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18097
18098 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18099
18100 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18101 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
18102
18103 * xdisp.c (hscroll_window_tree):
18104 (reconsider_clip_changes): Use PT instead of BUF_PT.
18105
d251f04b
EZ
181062011-03-13 Eli Zaretskii <eliz@gnu.org>
18107
18108 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18109 $(EMACS_ROOT)/lib/intprops.h.
18110
f0c77cd1
PE
181112011-03-13 Paul Eggert <eggert@cs.ucla.edu>
18112
3eca4629
PE
18113 Fix more problems found by GCC 4.5.2's static checks.
18114
7c86ee98
PE
18115 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18116 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
18117 (xg_free_frame_widgets): Make it clear that a local variable is
18118 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
18119 (gdk_window_get_screen): Make it clear that this macro is needed
18120 only if USE_GTK_TOOLTIP.
1e5524e7
PE
18121 (int_gtk_range_get_value): New function, which avoids a diagnostic
18122 from gcc -Wbad-function-cast.
18123 (xg_set_toolkit_scroll_bar_thumb): Use it.
18124 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18125 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
18126 (get_utf8_string, xg_get_file_with_chooser):
18127 Rename locals to avoid shadowing.
18128 (create_dialog): Move locals to avoid shadowing.
7c86ee98 18129
41729b81
PE
18130 * xgselect.c (xg_select): Remove unused var.
18131
f0c77cd1
PE
18132 * image.c (four_corners_best): Mark locals as initialized.
18133 (gif_load): Initialize transparent_p to zero (Bug#8238).
18134 Mark another local as initialized.
ec6cf4c6 18135 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 18136
ce0ad53d 18137 * image.c (clear_image_cache): Now static.
d5d5a617 18138 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 18139 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
18140 (x_edge_detection): Remove unnecessary cast that
18141 gcc -Wbad-function-cast diagnoses.
2037898d 18142 (gif_load): Fix pointer signedness.
6ae141d6
PE
18143 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18144 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 18145
33383987 181462011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 18147
d32df629
PE
18148 Improve quality of tests for time stamp overflow.
18149 For example, without this patch (encode-time 0 0 0 1 1
18150 1152921504606846976) returns the obviously-bogus value (-948597
18151 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18152 reports time overflow. See
18153 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
18154 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18155 * editfns.c: Include limits.h and intprops.h.
18156 (TIME_T_MIN, TIME_T_MAX): New macros.
18157 (time_overflow): Move earlier, to before first use.
18158 (hi_time, lo_time): New functions, for an accurate test for
18159 out-of-range times.
18160 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18161 (Fget_internal_run_time): Don't assume time_t fits in int.
18162 (make_time): Use list2 instead of Fcons twice.
18163 (Fdecode_time): More accurate test for out-of-range times.
18164 (check_tm_member): New function.
18165 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
18166 (lisp_time_argument): Don't rely on undefined left-shift and
18167 right-shift behavior when checking for time stamp overflow.
8be6f318 18168
fe31d94c
PE
18169 * editfns.c (time_overflow): New function, refactoring common code.
18170 (Fformat_time_string, Fdecode_time, Fencode_time):
18171 (Fcurrent_time_string): Use it.
18172
8be6f318
PE
18173 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18174 * dired.c (make_time): Move to ...
18175 * editfns.c (make_time): ... here.
18176 * systime.h: Note the move.
18177
09d9db2c 181782011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 18179
126bc0dc
YM
18180 * fringe.c (update_window_fringes): Remove unused variables.
18181
c47cbdfd
YM
18182 * unexmacosx.c (copy_data_segment): Also copy __got section.
18183 (Bug#8223)
18184
7ac80be9
EZ
181852011-03-12 Eli Zaretskii <eliz@gnu.org>
18186
c96bbc66 18187 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
18188 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
18189 Constify `char *' arguments and their references according to
18190 prototypes in tparam.h.
18191
ecb0f94d 18192 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 18193
7ac80be9
EZ
18194 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
18195 Adapt all references accordingly.
18196
18197 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
18198
ef1fd07e
TT
181992011-03-11 Tom Tromey <tromey@redhat.com>
18200
18201 * buffer.c (syms_of_buffer): Remove obsolete comment.
18202
7ef4b50c
EZ
182032011-03-11 Eli Zaretskii <eliz@gnu.org>
18204
18205 * termhooks.h (encode_terminal_code): Declare prototype.
18206
18207 * msdos.c (encode_terminal_code): Don't declare prototype.
18208
18209 * term.c (encode_terminal_code): Now external again, used by
18210 w32console.c and msdos.c.
18211
44f230aa
SM
18212 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
18213 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 18214
4b1ec863 182152011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 18216
1714f52b 18217 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 18218
4b1ec863
PE
18219 * fringe.c (update_window_fringes): Mark locals as initialized
18220 (Bug#8227).
18221 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 18222
524c7aa6
PE
18223 * alloc.c (mark_fringe_data): Move decl from here ...
18224 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
18225 to check its interface.
18226 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
18227
a5c0af81 18228 * fontset.c (free_realized_fontset): Now static.
7519b8cd 18229 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 18230 (fontset_font): Mark local as initialized.
a9a06e0b 18231 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 18232
b4716021
PE
18233 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
18234
811e9bac 18235 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 18236 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
18237 (x_own_selection, Fx_disown_selection_internal): Rename locals
18238 to avoid shadowing.
18239 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 18240
7e3ab302
PE
18241 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
18242 so that the caller can use some name other than gcpro1.
18243 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
18244 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18245 (Fx_backspace_delete_keys_p):
18246 Use them to avoid shadowing, and rename vars to avoid shadowing.
18247 (x_decode_color, x_set_name, x_window): Now static.
6b437900 18248 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 18249 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
18250 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18251 Remove unused locals.
7e3ab302
PE
18252 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18253 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18254 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18255 macros.
f78faa98 18256
e2b13473
PE
18257 * xterm.h (x_mouse_leave): New decl.
18258
77f23912
PE
18259 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18260 Remove unused functions.
cdf4ba58
PE
18261 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18262 (x_calc_absolute_position): Now static.
7411c686 18263 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 18264 Don't declare local "event" unless it's used.
ed7bf3a5
PE
18265 (x_iconify_frame, x_free_frame_resources): Don't declare locals
18266 unless they are used.
38d0b34a
PE
18267 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18268 (x_fatal_error_signal): Remove; not used.
a6067996
PE
18269 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18270 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18271 (x_error_catcher, x_connection_closed, x_error_handler):
18272 (x_error_quitter, xembed_send_message, x_iconify_frame):
18273 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 18274 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 18275 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 18276
44f230aa
SM
18277 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18278 Rename or move locals to avoid shadowing.
6b463e58 18279 (tty_defined_color, merge_face_heights): Now static.
5967d051 18280 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
18281 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18282 does not deduce is never used uninitialized.
73719eba
PE
18283 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18284 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 18285
426994c3 18286 * terminal.c (store_terminal_param): Now static.
5489860b 18287
032f1620 18288 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 18289 (set_frame_menubar): Remove unused local.
d4323972 18290 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
18291 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18292 since they might point to immutable storage.
281585b0
PE
18293 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18294 since it's unused otherwise.
032f1620 18295
367c19e5 18296 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 18297 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
18298 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18299 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 18300 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
18301 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18302 does not deduce are never used uninitialized.
70739cbe 18303
07b48fa9
PE
18304 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18305
8868a238 18306 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
18307 * window.c (window_loop, size_window):
18308 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 18309
7e5cf297 18310 * window.c (display_buffer): Now static.
d6550a9f
PE
18311 (size_window): Mark variables that gcc -Wuninitialized
18312 does not deduce are never used uninitialized.
a586633d
PE
18313 * window.h (check_all_windows): New decl, to forestall
18314 gcc -Wmissing-prototypes diagnostic.
5b555da1 18315 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 18316
f6095868
PE
18317 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18318 shadowing.
18319 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
18320 Include <limits.h>.
18321 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18322 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
18323 (load_charset_map): Mark variables that gcc -Wuninitialized
18324 does not deduce are never used uninitialized.
53df7c11 18325 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 18326
f38b440c
PE
18327 * coding.c (coding_set_source, coding_set_destination):
18328 Use "else { /* comment */ }" rather than "else /* comment */;"
18329 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
18330 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18331 a block, when the outer 'i' will do.
18332 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18333 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18334 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18335 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
18336 (Fdecode_sjis_char, Fdefine_coding_system_internal):
18337 Rename locals to avoid shadowing.
18338 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
18339 * coding.c (emacs_mule_char, encode_invocation_designation):
18340 Now static, since they're not used elsewhere.
413bb2db 18341 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 18342 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
18343 (decode_coding_emacs_mule): Mark variables that gcc
18344 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
18345 (detect_coding_iso_2022): Initialize a local variable that might
18346 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 18347 this initialization is needed. (Bug#8211)
5f58e762
PE
18348 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
18349 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
18350 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
18351 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
18352 Remove unused macros.
f38b440c 18353
232b38b9 18354 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 18355 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 18356 * character.c (string_count_byte8): Likewise.
232b38b9 18357
fb90da1b
PE
18358 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
18359 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
18360
fb93dbc2
PE
18361 * chartab.c (copy_sub_char_table): Now static, since it's not used
18362 elsewhere.
5c156ace
PE
18363 (sub_char_table_ref_and_range, char_table_ref_and_range):
18364 Rename locals to avoid shadowing.
bbcd0949 18365 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 18366
7d3b3862 18367 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 18368 (BIDI_BOB): Remove unused macro.
7d3b3862 18369
6be7d3da
PE
18370 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18371 deduce are never used uninitialized.
c2ed9c8b 18372 * term.c (encode_terminal_code): Likewise.
6be7d3da 18373
75f8807f 18374 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 18375
50938595
PE
18376 * tparam.h: New file.
18377 * term.c, tparam.h: Include it.
18378 * deps.mk (term.o, tparam.o): Depend on tparam.h.
18379 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18380 Move these decls to tparam.h, and make them agree with what
18381 is actually in tparam.c. The previous trick of using incompatible
18382 decls in different modules does not conform to the C standard.
18383 All callers of tparam changed to use tparam's actual API.
18384 * tparam.c (tparam1, tparam, tgoto):
18385 Use const pointers where appropriate.
18386
fbceeba2
PE
18387 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18388 * cm.h (struct cm): Likewise.
18389 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18390 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18391 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18392 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18393 (turn_on_face, init_tty): Likewise.
18394 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 18395
7f3f1250
PE
18396 * term.c (term_mouse_position): Rename local to avoid shadowing.
18397
e6ca6543
PE
18398 * alloc.c (mark_ttys): Move decl from here ...
18399 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18400
c40f8d15
AS
184012011-03-11 Andreas Schwab <schwab@linux-m68k.org>
18402
18403 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18404
cfe0661d
JB
184052011-03-09 Juanma Barranquero <lekktu@gmail.com>
18406
18407 * search.c (compile_pattern_1): Remove argument regp, unused since
18408 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18409 (compile_pattern): Don't pass it.
18410
0afb4571
J
184112011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18412
18413 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18414 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18415 for ! HAVE_GTK3.
18416 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18417
18418 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18419
18420 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18421 gdk_window_get_screen, gdk_window_get_geometry,
18422 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18423 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18424 (xg_get_pixbuf_from_pixmap): New function.
18425 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18426 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18427 Call xg_get_pixbuf_from_pixmap instead of
18428 gdk_pixbuf_get_from_drawable.
18429 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18430 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18431 (xg_check_special_colors): Use GtkStyleContext and its functions
18432 for HAVE_GTK3.
18433 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18434 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18435 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
18436 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18437 Call gtk_widget_get_preferred_size.
0afb4571
J
18438 (xg_frame_resized): gdk_window_get_geometry only takes 5
18439 parameters.
44f230aa
SM
18440 (xg_win_to_widget, xg_event_is_for_menubar):
18441 Call gdk_x11_window_lookup_for_display.
0afb4571
J
18442 (xg_set_widget_bg): New function.
18443 (delete_cb): New function.
895009e1 18444 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 18445 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
18446 (xg_set_background_color): Call xg_set_widget_bg.
18447 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18448 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18449 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18450 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18451 if ! HAVE_GTK3.
18452 (update_frame_tool_bar): Call gtk_widget_hide.
18453 (xg_initialize): Use GDK_KEY_g.
18454
18455 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18456 if ! HAVE_GTK3
18457 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18458
18459 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18460 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18461 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18462
1c2cc4ef
JB
184632011-03-08 Juanma Barranquero <lekktu@gmail.com>
18464
18465 * w32xfns.c (select_palette): Check success of RealizePalette against
18466 GDI_ERROR, not zero.
18467
33383987 18468See ChangeLog.11 for earlier changes.
aac0c6e3
MR
18469
18470;; Local Variables:
18471;; coding: utf-8
aac0c6e3
MR
18472;; End:
18473
2f097256 18474 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
18475
18476 This file is part of GNU Emacs.
18477
18478 GNU Emacs is free software: you can redistribute it and/or modify
18479 it under the terms of the GNU General Public License as published by
18480 the Free Software Foundation, either version 3 of the License, or
18481 (at your option) any later version.
18482
18483 GNU Emacs is distributed in the hope that it will be useful,
18484 but WITHOUT ANY WARRANTY; without even the implied warranty of
18485 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18486 GNU General Public License for more details.
18487
18488 You should have received a copy of the GNU General Public License
18489 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.