Support git commit --amend/--signoff
[bpt/emacs.git] / src / ChangeLog
CommitLineData
81550bf4
JB
12012-10-02 Juanma Barranquero <lekktu@gmail.com>
2
3 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
4 Update dependencies.
5
aa1ba90e
PE
62012-10-01 Paul Eggert <eggert@cs.ucla.edu>
7
8 Fix a malloc race condition involving strsignal.
9 A signal can arrive in the middle of a malloc, and Emacs's signal
10 handler can invoke strsignal, which can invoke malloc, which is
11 not portable. This race condition bug makes Emacs hang on GNU/Linux.
12 Fix it by altering the signal handler so that it does not invoke
13 strsignal.
14 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
15 * process.c (status_message): Use const pointer, in case strsignal
16 is #defined to safe_strsignal.
17 * sysdep.c (sys_siglist, init_signals): Always define and
18 initialize a substitute sys_siglist if the system does not define
19 one, even if HAVE_STRSIGNAL.
20 (safe_strsignal): Rename from strsignal. Always define,
21 using sys_siglist. Return a const pointer.
22 * syssignal.h (safe_strsignal): New decl.
23 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
24
ace917bd
EZ
252012-10-01 Eli Zaretskii <eliz@gnu.org>
26
27 * w32proc.c (timer_loop): Fix code that waits for timer
28 expiration, to avoid high CPU usage.
29
9eb71b9c
SM
302012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
31
32 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
33 (sweep_weak_table): Remove redundant prototypes.
34
b3317662
FP
352012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
36
37 * emacs.c: Move the inclusion of TERM_HEADER after including
38 windows.h on WINDOWSNT. This avoids compilation problems with
39 MSVC.
40
f0e5f225
EZ
412012-10-01 Eli Zaretskii <eliz@gnu.org>
42
2d7d1608
EZ
43 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
44 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
45 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
46 as the previous version used 'void *'.
47
48 * ralloc.c (ROUNDUP): Fix last change.
49 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
50 'size_t'.
51
f0e5f225
EZ
52 * w32proc.c <disable_itimers>: New static flag.
53 (init_timers): Initialize it to zero, after creating the critical
54 sections used by the timer threads.
55 (term_timers): Set to 1 before deleting the critical sections.
56 (getitimer, setitimer): If disable_itimers is non-zero, return an
57 error indication without doing anything. Reported by Fabrice
58 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
59 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
60 return results.
61 [!HAVE_SETITIMER]: Behave as the previous version that didn't
62 support timers.
f0e5f225
EZ
63
64 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
65 term_ntproc after all the other bookkeeping, to get timers working
66 as long as possible.
67
82ef37c1
PE
682012-10-01 Paul Eggert <eggert@cs.ucla.edu>
69
b3a4c387
PE
70 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
71 Suggested by Juri Linkov in
72 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
73
b0ab8123
PE
74 Prefer plain 'static' to 'static inline' (Bug#12541).
75 With static functions, modern compilers inline pretty well by
76 themselves; advice from programmers often hurts as much as it helps.
77 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
78 this change shrinks the text size of the Emacs executable by 1.1%
79 without affecting CPU significantly in my benchmark.
80 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
81 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
82 (mark_maybe_object, mark_maybe_pointer, bounded_number):
83 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
84 (bset_auto_fill_function, bset_auto_save_file_format)
85 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
86 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
87 (bset_cache_long_line_scans, bset_case_fold_search)
88 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
89 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
90 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
91 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
92 (bset_header_line_format, bset_indicate_buffer_boundaries)
93 (bset_indicate_empty_lines, bset_invisibility_spec)
94 (bset_left_fringe_width, bset_major_mode, bset_mark)
95 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
96 (bset_name, bset_overwrite_mode, bset_pt_marker)
97 (bset_right_fringe_width, bset_save_length)
98 (bset_scroll_bar_width, bset_scroll_down_aggressively)
99 (bset_scroll_up_aggressively, bset_selective_display)
100 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
101 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
102 (set_buffer_overlays_after):
103 * category.c (bset_category_table):
104 * charset.c (read_hex):
105 * coding.c (produce_composition, produce_charset)
106 (handle_composition_annotation, handle_charset_annotation)
107 (char_encodable_p):
108 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
109 (assign_row, set_frame_matrix_frame, make_current)
110 (add_row_entry):
111 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
112 * fns.c (maybe_resize_hash_table):
113 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
114 * gmalloc.c (register_heapinfo):
115 * image.c (lookup_image_type):
116 * intervals.c (set_interval_object, set_interval_left)
117 (set_interval_right, copy_interval_parent, rotate_right)
118 (rotate_left, balance_possible_root_interval):
119 * keyboard.c (kset_echo_string, kset_kbd_queue)
120 (kset_keyboard_translate_table, kset_last_prefix_arg)
121 (kset_last_repeatable_command, kset_local_function_key_map)
122 (kset_overriding_terminal_local_map, kset_real_last_command)
123 (kset_system_key_syms, clear_event, set_prop):
124 * lread.c (digit_to_number):
125 * marker.c (attach_marker, live_buffer, set_marker_internal):
126 * nsterm.m (ns_compute_glyph_string_overhangs):
127 * process.c (pset_buffer, pset_command)
128 (pset_decode_coding_system, pset_decoding_buf)
129 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
130 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
131 (pset_status, pset_tty_name, pset_type, pset_write_queue):
132 * syntax.c (bset_syntax_table, dec_bytepos):
133 * terminal.c (tset_param_alist):
134 * textprop.c (interval_has_some_properties)
135 (interval_has_some_properties_list):
136 * window.c (wset_combination_limit, wset_dedicated)
137 (wset_display_table, wset_hchild, wset_left_fringe_width)
138 (wset_left_margin_cols, wset_new_normal, wset_new_total)
139 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
140 (wset_right_fringe_width, wset_right_margin_cols)
141 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
142 (wset_vertical_scroll_bar_type, wset_window_parameters):
143 * xdisp.c (wset_base_line_number, wset_base_line_pos)
144 (wset_column_number_displayed, wset_region_showing)
145 (window_box_edges, run_window_scroll_functions)
146 (append_glyph_string_lists, prepend_glyph_string_lists)
147 (append_glyph_string, set_glyph_string_background_width)
148 (append_glyph, append_composite_glyph)
149 (take_vertical_position_into_account):
150 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
151 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
152 (lface_hash, lface_same_font_attributes_p, lookup_face):
153 * xml.c (libxml2_loaded_p):
154 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
155 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
156 Now 'static', not 'static inline'.
157
05584c31
PE
158 * bidi.c: Tune.
159 (bidi_copy_it): Do the whole copy with a single memcpy.
160 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
161
86ec63ba
PE
162 Revert the FOLLOW-SYMLINKS change for file-attributes.
163 Doing it right would require several changes to Tramp, and there's
164 not enough time to get that tested before the freeze today.
165 * dired.c (directory_files_internal, Ffile_attributes):
166 Undo last change.
167
82ef37c1
PE
168 * frame.c (x_report_frame_params): Port better to wider ints.
169 Do not assume that EMACS_UINT is the same width as uprintmax_t,
170 or that pointers can be printed in 15 decimal digits.
171 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
172
62aba0d4
FP
1732012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
174
175 Support x64 build on MS-Windows.
176 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
177 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
178 compatibility with x64.
5e4daaf3 179 (x_get_focus_frame): Add prototype.
62aba0d4
FP
180
181 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
182 defining an XRectangle structure.
183
184 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
185 arithmetics for compatibility with x64.
186
187 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
188 compatibility with x64.
189
190 * w32heap.h: Adjust prototypes and declarations.
191
192 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
193 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
194 DWORD, long, and unsigned long, for compatibility with x64.
195 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
196 (sbrk): Argument is now of type ptrdiff_t.
197
198 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
199 less than 0x0500.
200 (w32_msg_pump): Use WPARAM type for 'result'.
201
202 * w32.c (init_environment, get_emacs_configuration): Support AMD64
203 architecture.
204 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
205 compatibility with x64.
206
207 * vm-limit.c (lim_data): Now size_t.
208 (check_memory_limits): Adjust prototypes of real_morecore and
209 __morecore to receive argument of type ptrdiff_t. Use size_t for
210 five_percent and data_size.
211
212 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
213 variables, for compatibility with x64.
214 (rva_to_section, offset_to_section, relocate_offset)
215 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
216 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
217 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
218 for compatibility with x64.
219
220 * sysdep.c (STDERR_FILENO): Define if not already defined.
221
222 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
223 (__morecore): Argument type is now ptrdiff_t.
224 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
225 (relinquish): Use ptrdiff_t type for 'excess'.
226 (r_alloc_sbrk): Argument type is now ptrdiff_t.
227
228 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
229 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
230 instead of a literal number.
231
232 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
233 (min): Define only if not already defined.
234
235 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
236 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
237 hosts.
238
239 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
240 'bitmaps' is a pointer.
241
242 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
243
244 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
245
e7a2937b
PE
2462012-09-30 Paul Eggert <eggert@cs.ucla.edu>
247
248 file-attributes has a new optional arg FOLLOW-SYMLINKS.
249 * dired.c (directory_files_internal, Ffile_attributes):
250 New arg follow_symlinks. All uses changed.
251
b43d62ae
SM
2522012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
253
254 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
255
c06c382a
EZ
2562012-09-30 Eli Zaretskii <eliz@gnu.org>
257
258 Support atimers and CPU profiler via profile.c on MS-Windows.
259 * w32proc.c (sig_mask, crit_sig): New static variables.
260 (sys_signal): Support SIGALRM and SIGPROF.
261 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 262 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
263 sigfillset, and sigprocmask are no longer no-ops.
264 (sigismember): New function.
265 (struct itimer_data): New definition.
266 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
267 (crit_prof): New static variables.
268 (MAX_SINGLE_SLEEP): New definition.
269 (timer_loop, stop_timer_thread, term_timers, init_timers)
270 (start_timer_thread, getitimer, setitimer): New functions.
271 (alarm): No longer a no-op, calls setitimer.
272
273 * w32.c (term_ntproc): Call term_timers.
274 (init_ntproc): Make sure all signals are unblocked at startup, to
275 erase any traces of dumping. Call init_timers.
276
277 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
278 Windows-specific code to display the hourglass mouse pointer is no
279 longer used.
280 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
281 to hourglass timer expiration.
282 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
283 Remove, no longer used.
b43d62ae
SM
284 (w32_note_current_window, show_hourglass, hide_hourglass):
285 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
286 window systems.
287 (syms_of_w32fns): Don't initialize hourglass_timer.
288
289 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
290 WINDOWSNT as well.
291 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
292
293 * w32.h (init_timers, term_timers): Add prototypes.
294
95402d5f
KH
2952012-09-30 Kenichi Handa <handa@gnu.org>
296
297 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
298 to the buffer relocation which may be caused by ccl_driver.
299
dd946752
JD
3002012-09-30 Jan Djärv <jan.h.d@swipnet.se>
301
d7e642cc
JD
302 * xfns.c (Fx_file_dialog): Update comment.
303
304 * w32fns.c (Fx_file_dialog): Update comment.
305
306 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
307 Initialize panel name field if OSX >= 10.6.
308
309 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
310
dd946752
JD
311 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
312
313 * nsterm.m (NEW_STYLE_FS): New define.
314 (ns_fullscreen_hook, windowWillEnterFullScreen)
315 (windowDidEnterFullScreen, windowWillExitFullScreen)
316 (windowDidExitFullScreen, toggleFullScreen, handleFS)
317 (setFSValue): New functions.
318 (EmacsFSWindow): New implementation.
319 (canBecomeKeyWindow): New function for EmacsFSWindow.
320 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
321 (dealloc): Release nonfs_window if in fullscreen.
322 (updateFrameSize:): Call windowDidMove to update top/left.
323 (windowWillResize:toSize:): Check if frame is still maximized.
324 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
325 next_maximized, maximized_width, maximized_height and nonfs_window.
326 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
327 tbar_height.
328 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
329 fullscreen. Set maximized_width/height. Act on next_maximized.
330
331 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
332 (EmacsView): Add variables for fullscreen.
333 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
334 (EmacsFSWindow): New interface for fullscreen.
335
427730eb
JB
3362012-09-30 Juanma Barranquero <lekktu@gmail.com>
337
338 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
339
48de8b12
CY
3402012-09-30 Chong Yidong <cyd@gnu.org>
341
342 * fns.c (Frandom): Doc fix.
343
5938d519
MR
3442012-09-30 Martin Rudalics <rudalics@gmx.at>
345
346 * window.c (Vwindow_combination_limit): New default value.
347 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
348
cb5b0266
PE
3492012-09-30 Paul Eggert <eggert@cs.ucla.edu>
350
351 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
352 Suggested by Eli Zaretskii in
353 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
354
84f72efd
EZ
3552012-09-30 Eli Zaretskii <eliz@gnu.org>
356
357 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
358 HAVE_TIMER_SETTIME is defined.
359
9d4dcdc9
PE
3602012-09-30 Paul Eggert <eggert@cs.ucla.edu>
361
d89460ed
PE
362 Profiler improvements: more-accurate timers, overflow checks.
363 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
364 signal.h, setjmp.h. Include systime.h instead.
365 (saturated_add): New function.
366 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
367 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
368 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
369 New static vars.
84f72efd 370 (enum profiler_cpu_running): New enum.
d89460ed
PE
371 (profiler_cpu_running): Now of that enum type, not bool.
372 All uses changed to store the new value.
373 (handle_profiler_signal): Rename from sigprof_handler_1,
374 for consistency with other handlers. Do not check whether
375 cpu_log is a hash-table if garbage collecting, since it
376 doesn't matter in that case.
377 (deliver_profiler_signal): Rename from sigprof_handler,
378 for consistency with other handlers.
379 (setup_cpu_timer): New function, with much of what used to be in
380 Fprofiler_cpu_start. Check for out-of-range argument.
381 Prefer timer_settime if available, and prefer
382 thread cputime clocks, then process cputime clocks, then
383 monotonic clocks, to the old realtime clock. Use make_timeval
384 to round more-correctly when falling back to setitimer.
385 (Fprofiler_cpu_start): Use it.
386 (Fprofiler_cpu_stop): Prefer timer_settime if available.
387 Don't assume that passing NULL as the 2nd argument of setitimer
388 is the same as passing a pointer to all-zero storage.
389 Ignore SIGPROF afterwards.
390 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
391 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
392 non-fatal signal handlers. Ignore SIGPROF on startup.
393 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
394 in profiler.c, since sysdep.c now uses it.
395
9d4dcdc9
PE
396 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
397 Suggested by Eli Zaretskii in
398 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
399
8e5691a0
JB
4002012-09-29 Juanma Barranquero <lekktu@gmail.com>
401
402 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
403
e7c1b6ef
SM
4042012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
405
406 * lisp.h (struct backtrace): Remove indirection for `function' field.
407 * xdisp.c (redisplay_internal):
408 * profiler.c (record_backtrace, sigprof_handler_1):
409 * alloc.c (Fgarbage_collect):
410 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
411 (Fbacktrace_frame): Adjust accordingly.
412
e61d39cd 4132012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
414
415 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
416 (Frun_hook_with_args_until_failure): Doc fixes.
417
404043ea
EZ
4182012-09-28 Eli Zaretskii <eliz@gnu.org>
419
420 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
421 Qautomatic_redisplay and change the symbol name. All users changed.
422
704d3f45
TM
4232012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
424
425 * profiler.c (sigprof_handler): Fix race condition.
426
757140ff
GM
4272012-09-28 Glenn Morris <rgm@gnu.org>
428
429 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
430
a615a3ae
PE
4312012-09-27 Paul Eggert <eggert@cs.ucla.edu>
432
433 Check more robustly for timer_settime.
89d17fd0
PE
434 * Makefile.in (LIB_TIMER_TIME): New macro.
435 (LIBES): Add it.
a615a3ae
PE
436 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
437 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
438 call timer_settime.
439
3670daf7
TM
4402012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
441
442 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
443
6a586b7f
JB
4442012-09-26 Juanma Barranquero <lekktu@gmail.com>
445
446 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
447
41c8bfcf
PE
4482012-09-26 Paul Eggert <eggert@cs.ucla.edu>
449
450 * character.h (MAYBE_UNIFY_CHAR): Remove.
451 * charset.c, charset.h (maybe_unify_char): Now static.
452 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
453 Since this stuff is now private to charset.c, there's no need for
454 a public macro and no need to inline by hand.
455
3a880af4
SM
4562012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
457 Stefan Monnier <monnier@iro.umontreal.ca>
458 Juanma Barranquero <lekktu@gmail.com>
611b7507 459
3a880af4
SM
460 * profiler.c: New file.
461 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
462 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
463 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
464 * emacs.c (main): Call syms_of_profiler.
465 * alloc.c (Qautomatic_gc): New constant.
466 (MALLOC_PROBE): New macro.
467 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
468 (total_bytes_of_live_objects): New function.
469 (Fgarbage_collect): Use it. Record itself in backtrace_list.
470 Call malloc_probe for the memory profiler.
471 (syms_of_alloc): Define Qautomatic_gc.
472 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
473 race condition.
474 (struct backtrace): Move definition...
475 * lisp.h (struct backtrace): ..here.
476 (Qautomatic_gc, profiler_memory_running): Declare vars.
477 (malloc_probe, syms_of_profiler): Declare functions.
478 * xdisp.c (Qautomatic_redisplay): New constant.
479 (redisplay_internal): Record itself in backtrace_list.
480 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 481
5938d519 4822012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
4832012-09-25 Juanma Barranquero <lekktu@gmail.com>
484
485 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
486
e26fd2e4
PE
4872012-09-25 Paul Eggert <eggert@cs.ucla.edu>
488
489 Prefer POSIX timers if available.
490 They avoid a race if the timer is too close to the current time.
491 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
492 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 493 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 494
eedec3ee
EZ
4952012-09-25 Eli Zaretskii <eliz@gnu.org>
496
497 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
498 CHAR_STRING_ADVANCE.
499 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
500 STRING_CHAR_ADVANCE.
501
aa15c6bb
JB
5022012-09-25 Juanma Barranquero <lekktu@gmail.com>
503
504 Move Vlibrary_cache to emacs.c and reset before dumping.
505
506 * lisp.h (reset_image_types): Declare.
507 [WINDOWSNT] (Vlibrary_cache): Declare.
508
509 * image.c (reset_image_types): New function.
510
511 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
512 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
513 (Fdump_emacs): Reset Vlibrary_cache and image_types.
514
515 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
516 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
517
518 * w32.h (Vlibrary_cache): Do not declare.
519
54d629be
EZ
5202012-09-25 Eli Zaretskii <eliz@gnu.org>
521
16b22fef
EZ
522 * w32proc.c (sys_signal): Handle all signals defined by the
523 MS-Windows runtime, not just SIGCHLD. Actually install the signal
524 handlers for signals supported by Windows. Don't override
525 term_ntproc as the handler for SIGABRT.
526 (sigaction): Rewrite to call sys_signal instead of duplicating its
527 code.
528 (sys_kill): Improve commentary.
529
530 * w32.c (term_ntproc): Accept (and ignore) one argument, for
531 consistency with a signature of a signal handler. All callers
532 changed.
533 (init_ntproc): Accept an argument DUMPING. If dumping, don't
534 install term_ntproc as a signal handler for SIGABRT, as that
535 should be done by the dumped Emacs.
536
537 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
538
539 * w32select.c (term_w32select): Protect against repeated
540 invocation by setting clipboard_owner to NULL after calling
541 DestroyWindow.
542
543 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
544 and term_ntproc to their modified signatures.
545
54d629be
EZ
546 * character.c (char_string, string_char): Remove calls to
547 MAYBE_UNIFY_CHAR. See the discussion starting at
548 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
549 for the details.
550
59f7af81
CY
5512012-09-25 Chong Yidong <cyd@gnu.org>
552
553 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
554
22e8cf4a
SM
5552012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
556
557 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
558 when encountering an unknown bytecode.
559
578098f3
PE
5602012-09-24 Paul Eggert <eggert@cs.ucla.edu>
561
562 image.c, indent.c: Use bool for booleans.
563 * dispextern.h (struct image_type): Members valid_p, load, init
564 now return bool, not int. All uses changed.
565 * image.c: Omit unnecessary static decls.
566 (x_create_bitmap_mask, x_build_heuristic_mask):
567 Return void, not int, since callers don't care about the return value.
568 (x_create_bitmap_mask, define_image_type, valid_image_p)
569 (struct image_keyword, parse_image_spec, image_spec_value)
570 (check_image_size, image_background)
571 (image_background_transparent, x_clear_image_1)
572 (postprocess_image, lookup_image, x_check_image_size)
573 (x_create_x_image_and_pixmap, xbm_image_p)
574 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
575 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
576 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
577 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
578 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
579 (png_image_p, init_png_functions, png_load_body, png_load)
580 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
581 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
582 (init_gif_functions, gif_load, imagemagick_image_p)
583 (imagemagick_load_image, imagemagick_load, svg_image_p)
584 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
585 (gs_load):
586 * nsimage.m (ns_load_image):
587 * nsterm.m (ns_defined_color):
588 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
589 * xfns.c (x_defined_color):
590 * xterm.c (x_alloc_lighter_color_for_widget)
591 (x_alloc_nearest_color_1, x_alloc_nearest_color)
592 (x_alloc_lighter_color):
593 * indent.c (disptab_matches_widthtab, current_column)
594 (scan_for_column, string_display_width, indented_beyond_p)
595 (compute_motion, vmotion, Fvertical_motion):
596 Use bool for booleans.
597
a5f2b6ec
CY
5982012-09-24 Chong Yidong <cyd@gnu.org>
599
600 * chartab.c (Fset_char_table_default): Obsolete function removed.
601
18e27ea8
PE
6022012-09-23 Paul Eggert <eggert@cs.ucla.edu>
603
afea8a8a
PE
604 Move pid_t related decls out of lisp.h.
605 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
606 (interruptible_wait_for_termination):
607 Move these decls from lisp.h to syswait.h, since they use pid_t.
608 Needed on FreeBSD; see Herbert J. Skuhra in
609 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
610 * callproc.c: Include syswait.h.
611
18e27ea8
PE
612 gnutls.c, gtkutil.c: Use bool for boolean.
613 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
614 (emacs_gnutls_handle_error):
615 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
616 (xg_hide_tooltip, xg_create_frame_widgets)
617 (create_dialog, xg_uses_old_file_dialog)
618 (xg_get_file_with_chooser, xg_get_file_with_selection)
619 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
620 (xg_item_label_same_p, xg_update_menubar)
621 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
622 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
623 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
624 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
625 (update_frame_tool_bar, free_frame_tool_bar):
626 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
627 * nsmenu.m (ns_update_menubar):
628 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
629 * xfns.c (Fx_show_tip) [USE_GTK]:
630 Use bool for boolean.
631 * gtkutil.c (xg_update_frame_menubar):
632 * xmenu.c (update_frame_menubar):
633 Return void, not int, since caller ignores return value.
634 * gtkutil.c (xg_change_toolbar_position):
635 Return void, not 1.
636
af0e9f75
JB
6372012-09-23 Juanma Barranquero <lekktu@gmail.com>
638
639 * makefile.w32-in (BLOCKINPUT_H): Remove.
640 (SYSSIGNAL_H): New macro.
641 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
642 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
643 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
644 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
645 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
646 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
647 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
648 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
649 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
650 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
651 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
652 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
653 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
654 ($(BLD)/w32xfns.$(O)): Update dependencies.
655
5101529e
EZ
6562012-09-23 Eli Zaretskii <eliz@gnu.org>
657
658 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
659 fatal_error_backtrace.
660
661 * w32proc.c (sys_kill): Undo last change: don't do anything when
662 invoked to deliver SIGABRT to our own process. This is now
663 handled by emacs_raise.
664
2c3ee0ad
JB
6652012-09-23 Juanma Barranquero <lekktu@gmail.com>
666
667 * w32term.c (w32_read_socket): Remove leftover reference to
668 interrupt_input_pending.
669
62a1d661
PE
6702012-09-23 Paul Eggert <eggert@cs.ucla.edu>
671
672 Do not use SA_NODEFER.
673 Problem reported by Dani Moncayo in
674 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
675 * alloc.c (die):
676 * sysdep.c (emacs_abort): Do not reset signal handler.
677 * emacs.c (terminate_due_to_signal): Reset signal handler here.
678 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
679 wanted even on POSIXish hosts, and it doesn't work on Windows.
680
a0942b9a
JD
6812012-09-23 Jan Djärv <jan.h.d@swipnet.se>
682
683 * xterm.c (x_term_init): Call fixup_locale before and after calling
684 gtk_init (Bug#12392).
685
d07ff9db
CY
6862012-09-23 Chong Yidong <cyd@gnu.org>
687
688 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
689 Vdynamic_library_alist.
690
691 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
692 (Fgnutls_available_p): Caller changed.
693
694 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
695 (Flibxml_parse_xml_region): Likewise.
696
697 * dispextern.h (struct image_type): Remove arg from init function.
698
699 * image.c (Finit_image_library, lookup_image_type)
700 (define_image_type): Remove now-unneeded second arg.
701 (init_xpm_functions, init_png_functions, init_jpeg_functions)
702 (init_tiff_functions, init_gif_functions, init_svg_functions):
703 Arglist and w32_delayed_load calling convention changed.
704 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 705 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 706
4d7e6e51
PE
7072012-09-23 Paul Eggert <eggert@cs.ucla.edu>
708
709 Simplify and avoid signal-handling races (Bug#12471).
710 * alloc.c (die):
711 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
712 Avoid recursive loop if there's a fatal error in the function itself.
713 * atimer.c (pending_atimers):
714 * blockinput.h: Don't include "atimer.h"; no longer needed.
715 (interrupt_input_pending): Remove. All uses removed.
716 pending_signals now counts both atimers and ordinary interrupts.
717 This is less racy than having three separate pending-signal flags.
718 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
719 (input_blocked_p):
720 Rename from their upper-case counterparts BLOCK_INPUT,
721 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
722 INPUT_BLOCKED_P, and turn into functions. All uses changed.
723 This makes it easier to access volatile variables more accurately.
724 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
725 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
726 that's more reliable if the code is buggy and sets
727 interrupt_input_blocked to a negative value. All uses changed.
728 * atimer.c (deliver_alarm_signal):
729 Remove. No need to deliver this to the parent; any thread can
730 handle this signal now. All uses replaced by underlying handler.
731 * atimer.c (turn_on_atimers):
732 * dispnew.c (handle_window_change_signal):
733 * emacs.c (handle_danger_signal):
734 * keyboard.c (kbd_buffer_get_event):
735 Don't reestablish signal handler; not needed with sigaction.
736 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
737 (UNBLOCK_INPUT_TO):
738 Rework to avoid unnecessary accesses to volatile variables.
739 (UNBLOCK_INPUT_TO): Now a function.
740 (totally_unblock_input, unblock_input): New decls.
741 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
742 (init_data): Remove. Necessary stuff now done in init_signal.
743 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
744 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
745 (fatal_error_code): Remove; no longer needed.
746 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
747 it doesn't always backtrace. All uses changed. No need to reset
748 signal to default, since sigaction and/or die does that for us now.
749 Use emacs_raise (FOO), not kill (getpid (), FOO).
750 (main): Check more-accurately whether we're dumping.
751 Move fatal-error setup to sysdep.c
752 * floatfns.c: Do not include "syssignal.h"; no longer needed.
753 * gtkutil.c (xg_get_file_name, xg_get_font):
754 Remove no-longer-needed signal-mask manipulation.
755 * keyboard.c, process.c (POLL_FOR_INPUT):
756 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
757 * keyboard.c (read_avail_input): Remove.
758 All uses replaced by gobble_input.
759 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
760 (kbd_buffer_store_event_hold, gobble_input):
761 (record_asynch_buffer_change) [USABLE_SIGIO]:
762 (store_user_signal_events):
763 No need to mess with signal mask.
764 (gobble_input): If blocking input and there are terminals, simply
765 set pending_signals to 1 and return. All hooks changed to not
766 worry about whether input is blocked.
767 (process_pending_signals): Clear pending_signals before processing
768 them, in case a signal comes in while we're processing.
769 By convention callers now test pending_signals before calling us.
770 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
771 New functions, to support changes to blockinput.h.
772 (handle_input_available_signal): Now extern.
773 (reinvoke_input_signal): Remove. All uses replaced by
774 handle_async_input.
775 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
776 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
777 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
778 Clear sigmask reliably, even if Fsignal returns, which it can.
779 Omit unnecessary accesses to volatile var.
780 (quit_throw_to_read_char): No need to restore sigmask.
781 * keyboard.c (gobble_input, handle_user_signal):
782 * process.c (wait_reading_process_output):
783 Call signal-handling code rather than killing ourselves.
784 * lisp.h: Include <float.h>, for...
785 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
786 (pending_signals): Now volatile.
787 (syms_of_data): Now const if IEEE floating point.
788 (handle_input_available_signal) [USABLE_SIGIO]:
789 (terminate_due_to_signal, record_child_status_change): New decls.
790 * process.c (create_process): Avoid disaster if memory is exhausted
791 while we're processing a vfork, by tightening the critical section
792 around the vfork.
793 (send_process_frame, process_sent_to, handle_pipe_signal)
794 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
795 ignores SIGPIPE.
796 (send_process): No need for setjmp/longjmp any more, since the
797 SIGPIPE stuff is now gone. Instead, report an error if errno
798 is EPIPE.
799 (record_child_status_change): Now extern. PID and W are now args.
800 Return void, not bool. All callers changed.
801 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
802 Remove. All uses removed. This bug should be fixed now in a
803 different way.
804 (wait_for_termination_1): Use waitpid rather than sigsuspend,
805 and record the child status change directly. This avoids the
806 need to futz with the signal mask.
807 (process_fatal_action): Move here from emacs.c.
808 (emacs_sigaction_flags): New function, containing
809 much of what used to be in emacs_sigaction_init.
810 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
811 caught by emacs, to make races less likely.
812 (deliver_process_signal): Rename from handle_on_main_thread.
813 All uses changed.
814 (BACKTRACE_LIMIT_MAX): Now at top level.
815 (thread_backtrace_buffer, threadback_backtrace_pointers):
816 New static vars.
817 (deliver_thread_signal, deliver_fatal_thread_signal):
818 New functions, for more-accurate delivery of thread-specific signals.
819 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
820 (deliver_arith_signal): Handle in this thread, not
821 in the main thread, since it's triggered by this thread.
822 (maybe_fatal_sig): New function.
823 (init_signals): New arg DUMPING so that we can be more accurate
824 about whether we're dumping. Caller changed.
825 Treat thread-specific signals differently from process-general signals.
826 Block all signals while handling fatal error; that's safer.
827 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
828 on IEEE hosts.
829 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
830 Ignore SIGPIPE unless batch.
831 (emacs_backtrace): Output backtrace for the appropriate thread,
832 which is not necessarily the main thread.
833 * syssignal.h: Include <stdbool.h>.
834 (emacs_raise): New macro.
835 * xterm.c (x_connection_signal): Remove; no longer needed
836 now that we use sigaction.
837 (x_connection_closed): No need to mess with sigmask now.
838 (x_initialize): No need to reset SIGPIPE handler here, since
839 init_signals does this for us now.
840
8f4635e9
JD
8412012-09-23 Jan Djärv <jan.h.d@swipnet.se>
842
843 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 844 background rect may be larger (Bug#12245).
8f4635e9 845
3296976d
CY
8462012-09-23 Chong Yidong <cyd@gnu.org>
847
848 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
849
d41e491e
PE
8502012-09-22 Paul Eggert <eggert@cs.ucla.edu>
851
852 * .gdbinit: Just stop at fatal_error_backtrace.
853 See Stefan Monnier's request in
854 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
855 Remove no-longer-used query of system type.
856
c88b867f
CY
8572012-09-22 Chong Yidong <cyd@gnu.org>
858
859 * search.c (Freplace_match): Doc fix (Bug#12325).
860
861 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
862
863 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
864 (Fline_end_position): Doc fix.
865
866 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
867
bb4d86b4
CY
8682012-09-22 Chong Yidong <cyd@gnu.org>
869
870 * dispextern.h (struct image_type): Add new slot, storing a type
871 initialization function.
872
873 * image.c (define_image_type): Call the image initializer function
874 if it is defined. Arguments and return value changed.
875 (valid_image_p, make_image): Callers changed.
876 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
877 (gif_type, imagemagick_type, svg_type, gs_type):
878 Add initialization functions.
bb4d86b4
CY
879 (Finit_image_library): Call lookup_image_type.
880 (CHECK_LIB_AVAILABLE): Macro deleted.
881 (lookup_image_type): Call define_image_type here, rather than via
882 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
883 (syms_of_image): Move define_image_type calls for xbm_type and
884 pbm_type to lookup_image_type.
885
df9685f3
EZ
8862012-09-22 Eli Zaretskii <eliz@gnu.org>
887
888 * keyboard.c (timer_check_2): Move calculation of 'timers' and
889 'idle_timers' from here ...
890 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
891 lists, to avoid infloops when the timer does something stupid,
892 like reinvoke itself with the same or smaller time-out.
893 (Bug#12447)
894
8e17c9ba
MR
8952012-09-22 Martin Rudalics <rudalics@gmx.at>
896
897 * window.c (Fsplit_window_internal): Handle only Qt value of
898 Vwindow_combination_limit separately.
899 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
900 (Vwindow_combination_limit): New default value.
901 Rewrite doc-string.
8e17c9ba 902
589bd69b
EZ
9032012-09-22 Eli Zaretskii <eliz@gnu.org>
904
905 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
906 the new overlay string. (Bug#10159)
907
01108e3f
PE
9082012-09-22 Paul Eggert <eggert@cs.ucla.edu>
909
910 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
911 or that fprintf is async-signal-safe. POSIX doesn't require
912 either assumption.
913
82f8cd94
CY
9142012-09-22 Chong Yidong <cyd@gnu.org>
915
916 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
917 (Bug#8207).
918
3cccbd87
KH
9192012-09-22 Kenichi Handa <handa@gnu.org>
920
921 * composite.c (composition_reseat_it): Handle the case that a
922 grapheme cluster is not covered by a single font (Bug#12352).
923
09c01941
CY
9242012-09-21 Chong Yidong <cyd@gnu.org>
925
926 * image.c (define_image_type): Avoid adding duplicate types to
927 image_types (Bug#12463). Suggested by Jörg Walter.
928
acfa068f 9292012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
930
931 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
932 (print_load_command_name): Add case LC_DATA_IN_CODE.
933 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
934
acfa068f 9352012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
936
937 * eval.c (Frun_hook_with_args_until_success)
938 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
939
acfa068f 9402012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
941
942 * fileio.c (Ffile_selinux_context): Only call freecon when
943 lgetfilecon succeeded.
944 (Fset_file_selinux_context): Likewise. (Bug#12444)
945
acfa068f 9462012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
947
948 * xdisp.c (try_window_reusing_current_matrix): Under bidi
949 reordering, locate the cursor by calling set_cursor_from_row; if
950 that fails, clear the desired glyph matrix before returning a
951 failure indication to the caller. Fixes leaving garbled display
952 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
953 (compute_stop_pos_backwards): Fix a typo that caused crashes while
954 scrolling through multibyte text.
aa36e4d2 955
e99f70c8
SM
9562012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
957
958 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
959 calling mark_vectorlike since that's the one that marks the window.
960 (mark_discard_killed_buffers): Mark the final cdr.
961 * window.h (struct window): Move prev/next_buffers to the
962 non-standard fields.
963 * window.c (make_window): Initialize prev/next_buffers manually.
964
f75beb47
PE
9652012-09-20 Paul Eggert <eggert@cs.ucla.edu>
966
967 Omit unused arg EXPECTED from socket hooks.
968 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
969 * nsterm.m (ns_term_init):
970 * termhooks.h (struct terminal.read_socket_hook):
971 * w32inevt.c (w32_console_read_socket):
972 * w32term.c (w32_read_socket):
973 * xterm.c (XTread_socket):
974 Omit unused arg EXPECTED. All callers changed.
975 (store_user_signal_events): Return void, not int, since callers no
976 longer care about the return value. All uses changed.
977
b019b76a
JB
9782012-09-20 Juanma Barranquero <lekktu@gmail.com>
979
980 * w32gui.h (XParseGeometry): Do not declare.
981
05642592
PE
9822012-09-19 Paul Eggert <eggert@cs.ucla.edu>
983
e4bce92a
PE
984 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
985 Ignore 'expected'. See Eli Zaretskii in
986 <http://bugs.gnu.org/12471#8> (last line).
987
05642592
PE
988 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
989 (XParseGeometry): Now static. Substitute extremal values for
990 values that are out of range.
991
e543ae91
JD
9922012-09-19 Jan Djärv <jan.h.d@swipnet.se>
993
994 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
995
996 * nsfns.m (XParseGeometry): Remove.
997 (Fx_create_frame): Call x_set_offset to correctly interpret
998 top_pos in geometry.
999
3a880af4 1000 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
1001 (Fx_parse_geometry): If there is a space in string, call
1002 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1003
45ba16c7
EZ
10042012-09-17 Eli Zaretskii <eliz@gnu.org>
1005
c8b9f1bc
EZ
1006 * search.c (scan_buffer): Use character positions in calls to
1007 region_cache_forward and region_cache_backward, not byte
1008 positions. (Bug#12196)
1009
b4c932a2
EZ
1010 * w32term.c (w32_read_socket): Set pending_signals to 1, like
1011 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
1012
45ba16c7
EZ
1013 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1014 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1015 emacs_blocked_malloc, now deleted.
1016
eeceac93
PE
10172012-09-17 Paul Eggert <eggert@cs.ucla.edu>
1018
1019 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1020 The workaround was for improving performance on Solaris 2.4, but
1021 is getting in the way now. Emacs will still work if someone is
1022 still running Solaris 2.4 in a museum somewhere; Sun dropped
1023 support for Solaris 2.4 in 2003.
1024 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1025 * process.c (create_process) [HAVE_WORKING_VFORK]:
1026 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1027 since Emacs no longer uses vfork on that platform.
1028
78f83752
GM
10292012-09-17 Glenn Morris <rgm@gnu.org>
1030
1031 * emacs.c: Use COPYRIGHT.
1032
634b8cac
PE
10332012-09-16 Paul Eggert <eggert@cs.ucla.edu>
1034
0caaedb1
PE
1035 Remove configure's --without-sync-input option (Bug#12450).
1036 When auditing signal-handling in preparation for cleaning it up,
1037 I found that SYNC_INPUT has race conditions and would be a real
1038 pain to fix. Since it's an undocumented and deprecated
1039 configure-time option, now seems like a good time to remove it.
1040 Also see <http://bugs.gnu.org/11080#16>.
1041 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1042 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1043 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1044 (malloc_hysteresis):
1045 (check_depth) [XMALLOC_OVERRUN_CHECK]:
1046 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1047 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1048 (dont_register_blocks, bytes_used_when_reconsidered)
1049 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1050 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1051 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1052 Remove. All uses removed.
1053 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1054 implementation, one that depends on whether the new macro
1055 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1056 is defined.
1057 * atimer.c (run_timers, handle_alarm_signal):
1058 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1059 (handle_async_input, process_pending_signals)
1060 (handle_input_available_signal, init_keyboard):
1061 * nsterm.m (ns_read_socket):
1062 * process.c (wait_reading_process_output):
1063 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1064 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1065 (emacs_write):
1066 * xterm.c (XTread_socket):
1067 Assume SYNC_INPUT.
1068 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1069 * eval.c (handling_signal): Remove. All uses removed.
1070 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1071 All uses replaced with the SYNC_INPUT version.
1072 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1073 Remove decls.
1074 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1075 Now static.
1076
634b8cac
PE
1077 * font.c (Ffont_shape_gstring): Remove unused local.
1078
83da1b55
GM
10792012-09-16 Glenn Morris <rgm@gnu.org>
1080
518650a5
GM
1081 * Makefile.in (clean): No longer run nextstep's clean.
1082
83da1b55
GM
1083 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1084 (ns_frag): Remove.
1085 (ns-app): Move here from ns.mk, and simplify.
1086 (clean): Simplify nextstep entry.
1087 * ns.mk: Remove file.
1088
85a43e2e
KH
10892012-09-17 Kenichi Handa <handa@gnu.org>
1090
1091 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1092 not covert the last few charactes.
1093
ba13e616 10942012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
1095
1096 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1097 here, but just check the validity of glyphs in the glyph-string.
1098
a8c729af
MR
10992012-09-16 Martin Rudalics <rudalics@gmx.at>
1100
3a880af4
SM
1101 * window.c (Fwindow_parameter, Fset_window_parameter):
1102 Accept any window as argument (Bug#12452).
a8c729af 1103
c077c059
JD
11042012-09-16 Jan Djärv <jan.h.d@swipnet.se>
1105
1106 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1107 to ns_term_init to avoid memory leak.
1108
1109 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
1110 explicit retain/release.
1111 (ns_term_init): Only allow one display. Initialize outerpool and
1112 ns_*_types.
1113
39a57ad0
PE
11142012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1115
1116 Port _setjmp fix to POSIXish hosts as well as Microsoft.
1117 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
1118 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
1119 the Microsoft problem in a different way, by altering ../nt/config.nt.
1120
7105c8cb
EZ
11212012-09-15 Eli Zaretskii <eliz@gnu.org>
1122
1123 * w32xfns.c:
1124 * w32uniscribe.c:
1125 * w32term.c:
1126 * w32select.c:
1127 * w32reg.c:
1128 * w32proc.c:
1129 * w32menu.c:
1130 * w32inevt.c:
1131 * w32heap.c:
1132 * w32font.c:
1133 * w32fns.c:
1134 * w32console.c:
1135 * w32.c:
1136 * w16select.c: Remove inclusion of setjmp.h, as it is now included
1137 by lisp.h. This completes removal of setjmp.h inclusion
1138 erroneously announced in the previous commit. (Bug#12446)
1139
1140 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
1141 more accurate.
1142
1143 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
1144 not defined as a macro. The latter happens on MS-Windows.
1145 (Bug#12446)
1146
0328b6de
PE
11472012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1148
1149 Port better to POSIX hosts lacking _setjmp (Bug#12446).
1150 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 1151 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
1152 only reason for the instance was because "lisp.h" was included.
1153 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
1154 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
1155 and _longjmp with the new symbols. Emacs already uses _setjmp if
1156 available, so this change affects only POSIXish hosts that have
1157 sigsetjmp but not _setjmp, such as some versions of Solaris and
1158 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
1159 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
1160 (png_load_body) [HAVE_PNG]:
1161 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
1162 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
1163 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
1164 since PNG requires jmp_buf. This is the only exception to the
1165 general rule that we now use sys_setjmp and sys_longjmp.
1166 This exception is OK since this code does not change the signal
1167 mask or longjmp out of a signal handler.
1168
2af03429
PE
11692012-09-14 Paul Eggert <eggert@cs.ucla.edu>
1170
1171 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1172 Include "syssignal.h", for 'main_thread'.
1173
2f294edf
DA
11742012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
1175
1176 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
1177 * insdel.c (replace_range, replace_range_2):
1178 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
1179 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1180 Remove redundant check before calling offset_intervals.
1181
6b533e9c
MR
11822012-09-14 Martin Rudalics <rudalics@gmx.at>
1183
1184 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1185 current buffer (Bug#12387).
1186
2a7931e3
JB
11872012-09-14 Juanma Barranquero <lekktu@gmail.com>
1188
1189 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1190
c18e885b
PE
11912012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1192
1193 Use a more backwards-compatible timer format (Bug#12430).
1194 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1195 vector element, not from the 4th, since PSECS is now at the end.
1196 (Fcurrent_idle_time): Doc fix.
1197
d59a1afb
DA
11982012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
1199
1200 Function to mark objects and remove killed buffers at once.
1201 * alloc.c (discard_killed_buffers): Rename to ...
1202 (mark_discard_killed buffers) ... new name. Add marking
1203 of remaining objects. Fix comment. Adjust users.
1204 (mark_object): Do not touch frame buffer lists here.
1205 * frame.c (delete_frame): Reset frame buffer lists here.
1206
5f0cb45a
PE
12072012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1208
8ea47e3a
PE
1209 Better workaround for GNOME bug when --enable-gcc-warnings.
1210 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1211 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
1212 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1213
4a4bbad2
PE
1214 Simplify SIGIO usage (Bug#12408).
1215 The code that dealt with SIGIO was crufty and confusing, e.g., it
1216 played tricks like "#undef SIGIO" but these tricks were not used
1217 consistently. Simplify mostly by not #undeffing standard symbols,
1218 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1219 or not as we please) rather than "defined SIGIO" (standard symbol
1220 that we probably shouldn't #undef).
1221 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1222 Modules that need it can include it.
1223 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1224 * dispextern.h (ignore_sigio): New decl.
1225 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1226 unconditionally, since it's now a no-op if !USABLE_SIGIO.
1227 * emacs.c (shut_down_emacs):
1228 * keyboard.c (kbd_buffer_store_event_hold):
1229 Use ignore_sigio rather than invoking 'signal' directly.
1230 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1231 for FIONREAD.
1232 (FIONREAD, SIGIO): Do not #undef.
1233 (tty_read_avail_input): Use #error rather than a syntax error.
1234 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1235 for I_PIPE, used by SETUP_SLAVE_PTY.
1236 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1237 * sysdep.c (croak): Remove; no longer needed. This bit of
1238 temporary code, with Fred N. Fish's comment that it's temporary,
1239 has been in Emacs since at least 1992!
1240 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1241 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1242 * syssignal.h (croak): Remove decl.
1243 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1244 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1245 now that we're termios-only.
1246 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1247 * term.c (dissociate_if_controlling_tty): Use #error rather than
1248 a run-time error.
1249
5f0cb45a
PE
1250 Work around GCC and GNOME bugs when --enable-gcc-warnings.
1251 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1252 to work around GNOME bug 683906.
1253 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1254 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1255 This works around GCC bug 54561.
1256
40bce90b
PE
12572012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1258
1259 More fixes for 'volatile' and setjmp/longjmp.
1260 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1261 * image.c (struct png_load_context) [HAVE_PNG]: New type.
1262 (png_load_body) [HAVE_PNG]:
1263 (jpeg_load_body) [HAVE_JPEG]:
1264 New function, with most of the old parent function's body.
1265 (png_load) [HAVE_PNG]:
1266 (jpeg_load) [HAVE_JPEG]:
1267 Invoke the new function, to avoid longjmp munging our locals.
1268 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
1269 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
1270 longjmp is passed 2, as the C standard doesn't guarantee this.
1271 Instead, store the failure code into mgr->failure_code.
1272
bfeae2cf
SM
12732012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1274
1275 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
1276 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
1277 (syms_of_keyboard): Remove support for unread-command-char.
1278
8099e36b
EZ
12792012-09-12 Eli Zaretskii <eliz@gnu.org>
1280
1281 * w32proc.c (sys_kill): If PID is our process ID and the signal is
1282 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
1283 violation. (Bug#12426)
1284
92547ff9
PE
12852012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1286
1287 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
1288
45b82ad0
SM
12892012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1290
1291 * eval.c: Add `inhibit-debugger'.
1292 (Qinhibit_debugger): New symbol.
1293 (call_debugger): Bind it instead of Qdebug_on_error.
1294 (maybe_call_debugger): Test Vinhibit_debugger.
1295 (syms_of_eval): Define inhibit-debugger.
1296 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1297 (syms_of_xdisp): Remove inhibit-debug-on-message.
1298
5779a1dc
PE
12992012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1300
50f2e553
PE
1301 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1302 If a nonvolatile local variable is written before a _longjmp to
1303 the frame containing the variable, and is read after the _longjmp,
1304 the value read is indeterminate. Some local variables of type
1305 'struct handler' and 'struct catchtag' are used in this way, so
1306 mark each of their slots as volatile if the slot can be set before
1307 _longjmp and read afterwards.
1308 * lisp.h (struct handler): var and chosen_clause are now volatile.
1309 (struct catchtag): val, next, and pdlcount are now volatile.
1310
ae1d87e2
PE
1311 * bidi.c (bidi_push_it, bidi_pop_it):
1312 * fns.c (copy_hash_table):
1313 * image.c (define_image_type):
1314 * keyboard.c (kbd_buffer_store_event_hold):
1315 * process.c (Fprocess_send_eof):
1316 * xfaces.c (x_create_gc) [HAVE_NS]:
1317 * xgselect.c (xg_select):
1318 Prefer assignment to memcpy when either will do.
1319
5779a1dc
PE
1320 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1321 Use pointer-to-a-pointer to simplify and avoid a NILP check each
1322 time an item is removed. No need to mark this function 'inline';
1323 the compiler knows better than we do.
1324
c4c9756b
JD
13252012-09-11 Jan Djärv <jan.h.d@swipnet.se>
1326
1327 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1328 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1329 to change_frame_size (Bug#12388).
1330 (windowDidResize:): Pass YES to updateFrameSize.
1331
1332 * nsterm.h: Add delay parameter to updateFrameSize.
1333
d73e321c
DA
13342012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1335
1336 Discard killed buffers from deleted window and frame objects.
1337 This reduces an amount of references to killed buffers and
1338 helps GC to reclaim them faster.
1339 * alloc.c (discard_killed_buffers): New function.
1340 (mark_object): Use it for deleted windows and frames.
1341 (mark_object): If symbol's value is set up for a killed buffer
1342 or deleted frame, restore it's global binding.
1343 * data.c (swap_in_global_binding): Add GC notice.
1344 (swap_in_symval_forwarding): Use convenient set_blv_where.
1345 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1346 * window.h: ... to here.
1347
e578f381
DA
13482012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1349
1350 Convenient macro to check whether the buffer is live.
1351 * buffer.h (BUFFER_LIVE_P): New macro.
1352 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1353 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1354
3057e615
YM
13552012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1356
1357 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1358 composition cases (Bug#12364).
1359
1360 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1361 overhang of succeeding glyphs overlapping box cursor.
1362
1363 * w32term.c (x_draw_glyph_string): Likewise.
1364
6fda35f2
PE
13652012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1366
c990426a
PE
1367 Simplify, document, and port floating-point (Bug#12381).
1368 The porting part of this patch fixes bugs on non-IEEE platforms
1369 with frexp, ldexp, logb.
1370 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1371 Now static.
1372 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1373 support, by removing commented-out code and briefly listing the
1374 C89 functions excluded. The commented-out stuff was confusing
1375 maintenance, e.g., we thought we needed cbrt but it was commented out.
1376 (logb): Remove decl; no longer needed.
1377 (isfinite): New macro, if not already supplied.
1378 (isnan): Don't replace any existing macro.
1379 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1380 are present on all C89 platforms.
1381 (Ffrexp): Do not special-case zero, as frexp does the right thing
1382 for that case.
1383 (Flogb): Do not use logb, as it doesn't have the desired meaning
1384 on hosts that use non-base-2 floating point. Instead, stick with
1385 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1386 frexp, to avoid getting an unspecified result.
1387
6fda35f2
PE
1388 * xdisp.c (Qinhibit_debug_on_message): Now static.
1389
16130a58
JD
13902012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1391
1392 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1393 NSBezierPath (Bug#12131).
1394
d105a573
CY
13952012-09-10 Chong Yidong <cyd@gnu.org>
1396
1397 * fns.c (Fdelq, Fdelete): Doc fix.
1398
ff55dfe8
PE
13992012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1400
1401 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1402 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1403
e7032e7c
SM
14042012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1405
1406 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1407 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1408 Use it.
1409
e9957956
EZ
14102012-09-09 Eli Zaretskii <eliz@gnu.org>
1411
aba05ce9
EZ
1412 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1413 left fringe if the window has a left margin. This avoids leaving
1414 traces of the cursor because its leftmost pixel is not drawn over.
1415
e9957956
EZ
1416 * dispnew.c (update_window_line): When the left margin area of a
1417 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1418 that screen line. (Bug#12277)
1419
f6196b87
PE
14202012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1421
1422 Assume C89 or later for math functions (Bug#12381).
1423 This simplifies the code, and makes it a bit smaller and faster,
1424 and (most important) makes it easier to clean up signal handling
1425 since we can stop worring about floating-point exceptions in
1426 library code. That was a problem before C89, but the problem
1427 went away many years ago on all practical Emacs targets.
1428 * data.c, image.c, lread.c, print.c:
1429 Don't include <math.h>; no longer needed.
1430 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1431 might be autoconfigured, as that never happens.
1432 * data.c (fmod):
1433 * doprnt.c (DBL_MAX_10_EXP):
1434 * print.c (DBL_DIG):
1435 Remove. C89 or later always defines these.
1436 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1437 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1438 (arith_error, domain_error, domain_error2):
1439 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1440 no longer needed -- we simply return what C returns. All uses removed.
1441 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1442 the wrapped code.
1443 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1444 Remove. All uses expanded, as these macros are no longer used
1445 more than once and are now more trouble than they're worth.
1446 (Ftan): Use tan, not sin / cos.
1447 (Flogb): Assume C89 frexp.
1448 (fmod_float): Assume C89 fmod.
1449 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1450 (init_floatfns): Remove. All uses removed.
1451
9d7f1863
JD
14522012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1453
1454 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1455 compositeToPoint for OSX < 10.6 (Bug#12390).
1456
eabf0404
PE
14572012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1458
1459 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1460 This produces more-accurate results.
1461
0b3b1d23
JD
14622012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1463
1464 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1465 changes (Bug#12088).
1466
6dcef6ec
CY
14672012-09-08 Chong Yidong <cyd@gnu.org>
1468
1469 * syntax.c (Fstring_to_syntax): Doc fix.
1470
aa7d57c5
JD
14712012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1472
1473 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1474 in the internal border.
1475 (x_set_window_size): Remove static variables and their usage.
1476 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
1477 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1478 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
1479 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1480 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1481 (ns_fix_rect_ibw): Remove.
1482 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1483 (ns_dumpglyphs_box_or_relief): Ditto.
1484 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1485 adjustment.
1486 (ns_dumpglyphs_image): Ditto.
fc0c31f8 1487 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
1488 border adjustment.
1489 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1490 their usage. Add fringe_extended_p and its use as in other terms.
1491 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1492 scroll bar was removed.
1493 (updateFrameSize): New function.
1494 (windowDidResize): Move code to updateFrameSize and call it.
1495
1496 * nsterm.h (EmacsView): Add updateFrameSize.
1497
1a5432bc
CY
14982012-09-07 Chong Yidong <cyd@gnu.org>
1499
b4f5313e
CY
1500 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1501
1a5432bc
CY
1502 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1503
1a4f1e9b
PE
15042012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1505
1506 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
1507 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1508 Problem introduced when merging patches. Noted by Eli Zaretskii in
1509 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
1510 * floatfns.c: Comment fix.
1511 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1512 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1513 and anyway the declaration is harmless even if SIGDANGER is not defined.
1514 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1515 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1516 source files not surprisingly expected syssignal.h to define, or
1517 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1518 Include <sys/ioctl.h>, for FIONREAD.
1519 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1520 This eliminates a problem whereby other files mysteriously had
1521 to include "syssignal.h" before including "systty.h" if they
1522 wanted to use "#ifdef SIGIO".
1523
bc8000ff
EZ
15242012-09-07 Eli Zaretskii <eliz@gnu.org>
1525
3e6d6928
EZ
1526 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1527
1528 * w32.c (sigemptyset): Empty the set.
1529 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1530
bc8000ff
EZ
1531 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1532
b4fa72f2
DA
15332012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1534
1535 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1536 (mark_object): Likewise for frame objects.
1537
30730c93
PE
15382012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1539
1540 * syssignal.h (handle_on_main_thread): Always declare,
1541 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1542 This ports to platforms without HAVE_PTHREAD.
1543
2fe28299
PE
15442012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1545
1546 Signal-handler cleanup (Bug#12327).
1547 Emacs's signal handlers were written in the old 4.2BSD style with
1548 sigblock and sigmask and so forth, and this led to some
1549 inefficiencies and confusion. Rewrite these to use
1550 pthread_sigmask etc. without copying signal sets around. Also,
1551 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1552 'signal', and instead use functions that do not attempt to take
1553 over the system name space. This patch causes Emacs's text
1554 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1555 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1556 Do not include <signal.h> or "syssignal.h", as these
1557 modules do not use signals.
1558 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1559 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1560 Do not include <signal.h>, as "syssignal.h" does that for us now.
1561 * atimer.c (sigmask_atimers): New function.
1562 (block_atimers, unblock_atimers): New functions,
1563 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1564 All uses replaced.
1565 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1566 no longer needed here.
1567 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 1568 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
1569 * sysdep.c (struct save_signal): New member 'action', replacing
1570 old member 'handler'.
1571 (save_signal_handlers, restore_signal_handlers):
1572 Use sigaction instead of 'signal' to save and restore.
1573 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1574 New function. All users of 'signal' modified to use set_sighandler
1575 if they're writeonly, and to use sys_signal if they're read+write.
1576 (emacs_sigaction_init, forwarded_signal): New functions.
1577 (sys_signal): Remove. All uses replaced by calls to sigaction
1578 and emacs_sigaction_init, or by direct calls to 'signal'.
1579 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1580 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1581 all uses replaced by pthread_sigmask etc. calls.
1582 * syssignal.h: Include <signal.h>.
1583 (emacs_sigaction_init, forwarded_signal): New decls.
1584 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1585 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1586 (sigmask, sys_sigmask): Remove; no longer needed.
1587 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1588 (sigblock, sigunblock, sigfree):
1589 (sigsetmask) [!defined sigsetmask]:
1590 Remove. All uses replaced by pthread_sigmask.
1591 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1592 no longer need to be replaced, and its typical old uses
1593 are now done via emacs_sigaction_init and sigaction.
1594 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1595 (sys_sigdel): Remove; unused.
1596 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1597
0216c128
EZ
15982012-09-06 Eli Zaretskii <eliz@gnu.org>
1599
1600 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1601 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1602
c752cfa9
DA
16032012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1604
1605 Explicitly mark buffer_defaults and buffer_local_symbols.
1606 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1607 mark_local_symbols here.
1608 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1609 since special buffers aren't marked here any more.
1610 (allocate_buffer): Chain new buffer with all_buffers here...
1611 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1612 not here.
1613 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1614 (syms_of_buffer): Remove staticpro of the above.
1615 (init_buffer_once): Set names for buffer_defaults and
1616 buffer_local_symbols.
1617
a864ef14
PE
16182012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1619
1620 Use bool for booleans in font-related modules.
1621 * font.c (font_intern_prop, font_style_to_value)
1622 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1623 (generate_otf_features, font_check_otf_features, font_check_otf)
1624 (font_match_p, font_list_entities, font_at):
1625 * fontset.c (fontset_id_valid_p, reorder_font_vector
1626 (fontset_find_font, Fset_fontset_font)
1627 (face_suitable_for_char_p) [0]:
1628 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1629 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1630 (m17n_flt_initialized, ftfont_shape_by_flt):
1631 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1632 * nsfont.m (nsfont_draw):
1633 * w32font.c (w32font_draw):
1634 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1635 Use bool for booleans.
1636 * font.h: Adjust to above API changes.
1637 (struct font, struct font_driver, struct font_driver_list):
1638 Use bool for booleans.
1639 (struct font): Remove useless member encoding_type.
1640 All users removed.
1641 * fontset.c, xftfont.c: Omit unnecessary static decls.
1642
0699fc18
DA
16432012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1644
1645 * alloc.c (mark_object): Revert window marking code
1646 since it's unsafe for the Fset_window_configuration.
1647
20ef56db
PE
16482012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1649
2fe28299 1650 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
1651 Be more systematic about preserving errno whenever a signal
1652 handler returns, even if it's not in the main thread. Do this by
1653 renaming signal handlers to distinguish between signal delivery
1654 and signal handling. All uses changed.
1655 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1656 * data.c (deliver_arith_signal): Rename from arith_error.
1657 * dispnew.c (deliver_window_change_signal): Rename from
1658 window_change_signal.
1659 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1660 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1661 * keyboard.c (deliver_input_available_signal): Rename from
1662 input_available_signal.
1663 (deliver_user_signal): Rename from handle_user_signal.
1664 (deliver_interrupt_signal): Rename from interrupt_signal.
1665 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1666 (deliver_child_signal): Rename from sigchld_handler.
1667 * atimer.c (handle_alarm_signal):
1668 * data.c (handle_arith_signal):
1669 * dispnew.c (handle_window_change_signal):
1670 * emacs.c (handle_fatal_signal, handle_danger_signal):
1671 * keyboard.c (handle_input_available_signal):
1672 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1673 * process.c (handle_pipe_signal, handle_child_signal):
1674 New functions, with the actual signal-handling code taken from the
1675 original respective signal handlers, sans the sporadic attempts to
1676 preserve errno, since that's now done by handle_on_main_thread.
1677 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1678 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1679 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1680 Move to sysdep.c.
1681 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1682 Move initialization of main_thread to sysdep.c's init_signals.
1683 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1684 our usage, and simplifies the mainline code.
1685 (record_child_status_change): New static function, as a helper
1686 for handle_child_signal, and with most of the old child handler's
1687 contents.
1688 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1689 (handle_child_signal): Use the above.
1690 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1691 Moved here from emacs.c.
1692 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1693 code moved here from emacs.c's main function.
1694 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
1695 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
1696 This lets callers save and restore errno properly.
20ef56db 1697
e3ccf108
DA
16982012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1699
1700 Remove redundant or unused things here and there.
1701 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1702 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1703 * editfns.c (Fcompare_buffer_substrings): Likewise.
1704 * frame.h (struct terminal, struct font_driver_list):
1705 Remove redundant declarations.
1706 * window.h (Qleft, Qright): Likewise.
1707
697e1e39
DA
17082012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1709
1710 Do not mark objects from deleted buffers, windows and frames.
1711 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1712 (mark_object): Likewise for windows and frames.
1713
c1ca42ca
DA
17142012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1715
1716 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1717 buffer_defaults and buffer_local_symbols as valid objects.
1718 Return special value to denote them.
1719
014d93be
PE
17202012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1721
f75d7a91
PE
1722 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1723 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1724 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1725 (file_name_absolute_p, Fsubstitute_in_file_name):
1726 (check_executable, check_writable, Ffile_accessible_directory_p)
1727 (Fset_file_selinux_context, Fdefault_file_modes)
1728 (Finsert_file_contents, choose_write_coding_system)
1729 (Fwrite_region, build_annotations, a_write, e_write)
1730 (Fdo_auto_save):
1731 * filelock.c (boot_time_initialized, get_boot_time)
1732 (get_boot_time_1, lock_file_1, within_one_second):
1733 * floatfns.c (in_float):
1734 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1735 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1736 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1737 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1738 * window.c (compare_window_configurations):
1739 Use bool for booleans.
1740 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1741 (Fdefault_file_modes): Now mode_t, not int, for modes.
1742 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1743 (internal_delete_file): Now returns void, not a (boolean) int,
1744 since nobody was looking at the return value.
1745 * lisp.h, window.h: Adjust to above API changes.
1746
014d93be
PE
1747 * xdisp.c (set_message): Simplify and reindent last change.
1748
776f29e1
JB
17492012-09-05 Juanma Barranquero <lekktu@gmail.com>
1750
1751 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1752
7f7e0167
LI
17532012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1754
1755 * eval.c (call_debugger): Make the function non-static so that we
1756 can call it from set_message.
1757
1758 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1759 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1760
cf29dd84
PE
17612012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1762
1763 Give more-useful info on a fatal error (Bug#12328).
1764 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1765 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1766 of doing the work ourselves.
1767 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1768 do most of the work.
1769 (fatal_error_backtrace): New function, taken from the guts
1770 of the old fatal_error_signal, but with a new option to output
1771 a backtrace.
1772 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1773 info about the signal than just its number.
1774 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1775 * sysdep.c: Include <execinfo.h>
1776 (emacs_backtrace): New function, taken partly from the previous
1777 code of the 'die' function.
1778 (emacs_abort): Call fatal_error_backtrace rather than abort.
1779
972debf2
SM
17802012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1781
1782 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1783 eager (load-time) macro-expansion.
1784 * lisp.mk (lisp): Add macroexp.
1785
1088b922
PE
17862012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1787
1788 Simplify redefinition of 'abort' (Bug#12316).
1789 Do not try to redefine the 'abort' function. Instead, redo
1790 the code so that it calls 'emacs_abort' rather than 'abort'.
1791 This removes the need for the NO_ABORT configure-time macro
1792 and makes it easier to change the abort code to do a backtrace.
1793 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1794 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1795 Remove; sysdep.c's emacs_abort now takes its place.
1796 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1797 'abort' changed to use 'emacs_abort'.
1798 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1799 (abort) [!defined abort]: Rename to ...
1800 (emacs_abort): ... new name.
1801 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1802 the place of the old 'abort' in emacs.c.
1803 * w32.c, w32fns.c (abort): Do not #undef.
1804 * w32.c (emacs_abort): Rename from w32_abort.
1805
30934d33
EZ
18062012-09-04 Eli Zaretskii <eliz@gnu.org>
1807
1808 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1809 offsets[j].dv, since the y axis of the screen coordinates points
1810 down, while the y axis of the font definition coordinates points
1811 up. This fixes display of Arabic diacritics such as KASRA and
1812 KASRATAN. (Bug#11860)
1813
af26b72c
PE
18142012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1815
1816 Be more systematic about _setjmp vs setjmp.
1817 * alloc.c (test_setjmp, mark_stack):
1818 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1819 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1820 (png_load, my_error_exit, jpeg_load):
1821 * process.c (send_process_trap, send_process):
1822 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1823 The underscored versions are up to 30x faster on some hosts.
1824 Formerly, the code used setjmp+longjmp sometimes and
1825 _setjmp+_longjmp at other times, with no particular reason to
1826 prefer setjmp+longjmp.
1827
26d4541d
PE
18282012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1829
d42f4f0f 1830 Fix minor problem found by static checking.
26d4541d 1831 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 1832
c5e28e39
MR
18332012-09-03 Martin Rudalics <rudalics@gmx.at>
1834
1835 * buffer.c (Fdelete_all_overlays): New function.
1836
3eab3ca9
CY
18372012-09-03 Chong Yidong <cyd@gnu.org>
1838
1839 * gtkutil.c: Add extern decl for Qxft.
1840
c04889f8
PE
18412012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1842
1882aa38
PE
1843 * emacs.c, eval.c: Use bool for boolean.
1844 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1845 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1846 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1847 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1848 (main, decode_env_path, Fdaemon_initialized):
1849 * eval.c (call_debugger, Finteractive_p, interactive_p):
1850 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1851 (maybe_call_debugger, Fbacktrace):
1852 * process.c (read_process_output, exec_sentinel):
1853 Use bool for booleans.
1854 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1855 All callers changed.
1856 * eval.c (interactive_p): Omit always-true boolean argument
1857 EXCLUDE_SUBRS_P. All callers changed.
1858 * dispextern.h, lisp.h: Reflect above API changes.
1859 * firstfile.c (dummy): Use the address of 'main', whose signature
1860 won't change, instead of the address of 'initialize', whose
1861 signature just changed from int to bool.
1862 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1863 * msdos.c (fatal_error_in_progress): ... from here.
1864 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1865 of incrementing it.
1866 (redisplay_internal, unwind_redisplay): Simply clear
1867 REDISPLAYING_P when unwinding, instead of saving its previous,
1868 always-false value and then restoring it.
1869
a411ac43
PE
1870 Clean up some extern decls.
1871 Mostly, this hoists extern decls out of .c files and into .h files.
1872 That way, we're more likely to catch errors if the interfaces change.
1873 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1874 declare xg_mark_data.
1875 * dispextern.h (x_frame_parm_handlers):
1876 * font.h (Qxft):
1877 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1878 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1879 (Qultra_bold, Qoblique, Qitalic):
1880 Move extern decl here from .c file.
1881 * alloc.c (xg_mark_data) [USE_GTK]:
1882 * doc.c (Qclosure):
1883 * eval.c (Qlexical_binding):
1884 * fns.c (time) [!HAVE_UNISTD_H]:
1885 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1886 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1887 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1888 * lread.c (Qinternal_interpreter_environment):
1889 * minibuf.c (Qbuffer):
1890 * process.c (QCfamily, QCfilter):
1891 * widget.c (free_frame_faces):
1892 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1893 * xfont.c (x_clear_errors):
1894 * xterm.c (x_frame_parm_handlers):
1895 Remove now-redundant extern decls.
1896 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1897 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1898 Now static.
1899 * xfaces.c: Remove unnecessary static decls.
1900 * xterm.c (updating_frame): Remove decl of nonexistent object.
1901
c04889f8
PE
1902 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1903 when building globals.h, as the objects that are not built on
1904 this host are not needed to compile C files on this host.
1905
8b339673
JD
19062012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1907
1908 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1909
1910 * frame.h: Add missing prototype for x_wm_set_size_hint.
1911
a08d4ba7
PE
19122012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1913
1914 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1915 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1916 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1917 (Fsubstitute_command_keys):
1918 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1919 (save_excursion_save, save_excursion_restore)
1920 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1921 (format_time_string, general_insert_function)
1922 (make_buffer_string, make_buffer_string_both)
1923 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1924 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1925 (copy_text, insert_1, insert_1_both, insert_from_string)
1926 (insert_from_string_before_markers, insert_from_string_1)
1927 (insert_from_buffer, insert_from_buffer_1, replace_range)
1928 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1929 (del_range_2, modify_region):
1930 * intervals.c (intervals_equal, balance_possible_root_interval)
1931 (adjust_intervals_for_insertion, merge_properties_sticky)
1932 (graft_intervals_into_buffer, lookup_char_property)
1933 (adjust_for_invis_intang, set_point_both)
1934 (get_property_and_range, compare_string_intervals)
1935 (set_intervals_multibyte_1, set_intervals_multibyte):
1936 * keyboard.c (decode_timer):
1937 Use bool for boolean.
1938 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1939 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1940
48c948de
CY
19412012-09-02 Chong Yidong <cyd@gnu.org>
1942
1943 * keymap.c (push_key_description): Print M-TAB as C-M-i
1944 (Bug#11758).
1945
6c49a40b
JB
19462012-09-02 Juanma Barranquero <lekktu@gmail.com>
1947
1948 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1949 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1950 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1951 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1952 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1953 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1954 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1955
4dfbd238
EZ
19562012-09-01 Eli Zaretskii <eliz@gnu.org>
1957
7e510e28
EZ
1958 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1959 more than one grapheme cluster passed to the shaper: compute the
1960 offset adjustment values separately for each cluster. (Bug#11860)
1961
4dfbd238
EZ
1962 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1963 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1964 about implicit conversions from integer to pointer.
1965
86571ae0
DC
19662012-09-01 Daniel Colascione <dancol@dancol.org>
1967
1968 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1969 system used too early.
1970
0e23ef9d
PE
19712012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1972
1973 Better seed support for (random).
1974 * emacs.c (main): Call init_random.
1975 * fns.c (Frandom): Set the seed from a string argument, if given.
1976 Remove long-obsolete Gentzel cruft.
1977 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1978 (init_random): New function.
1979
17a2cbbd
DC
19802012-09-01 Daniel Colascione <dancol@dancol.org>
1981
1982 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1983 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1984 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1985 x_wm_set_size_hint, x_query_colors, x_real_positions,
1986 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1987 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1988 all of which have been moved to common code.
1989
1990 * xfaces.c: Include TERM_HEADER instead of listing all possible
1991 window-system headers.
1992
1993 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1994 to match header.
1995
1996 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1997 directly accessing frame internals.
1998
f18cbb28 1999 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
2000 globals_of_w32font.
2001
2002 * process.c: Include TERM_HEADER instead of listing all possible
2003 window-system headers.
2004
3a880af4
SM
2005 * nsterm.h: Remove declarations now in frame.h.
2006 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
2007
2008 * menu.c: Include TERM_HEADER instead of listing all possible
2009 window-system headers.
2010
2011 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2012 window system.
2013
2014 * keyboard.c: Include TERM_HEADER instead of listing all possible
2015 window-system headers.
2016
2017 * image.c: Include TERM_HEADER instead of listing all possible
2018 window-system headers. Declare Vlibrary_cache when compiling for
2019 Windows.
2020
2021 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2022 window system declarations.
2023
2024 * frame.h: Move common functions here: set_frame_menubar,
2025 x_set_window_size, x_sync, x_get_focus_frame,
2026 x_set_mouse_position, x_set_mouse_pixel_position,
2027 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
2028 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
2029 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
2030 x_activate_menubar, x_real_positions, x_bitmap_icon,
2031 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
2032 and x_query_colors.
2033
2034 * frame.c: Include TERM_HEADER instead of listing all possible
2035 window-system headers.
2036
2037 * font.c: Include TERM_HEADER instead of listing all possible
2038 window-system headers.
2039
2040 * emacs.c: Include TERM_HEADER.
2041
f18cbb28
EZ
2042 * dispnew.c: Include TERM_HEADER instead of listing all possible
2043 window-system headers.
17a2cbbd 2044
f18cbb28 2045 * ccl.h: Include character.h.
17a2cbbd
DC
2046
2047 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2048 the current window system; include in list of objects to link into
2049 Emacs.
2050
c650a5de
DA
20512012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2052
2053 Remove mark_ttys function and fix tty_display_info initialization.
2054 * lisp.h (mark_ttys): Remove prototype.
2055 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2056 to mark_ttys because all possible values of 'top_frame' slot are
2057 the frames which are reachable from Vframe_list.
2058 * term.c (mark_ttys): Remove.
2059 (init_tty): Safely initialize 'top_frame' slot with Qnil.
2060
4e0f6479
DA
20612012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2062
2063 Change struct frame bitfields from unsigned char to unsigned.
2064 * frame.h (struct frame): Change type of 'display_preempted',
2065 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2066 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2067 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2068 bitfields from unsigned char to unsigned.
2069
8b96a52c
DA
20702012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2071
2072 Remove unused member of struct x_output and struct w32_output.
2073 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2074 * w32term.h (struct w32_output): Likewise.
2075
b4444c8a
JD
20762012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2077
2078 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2079 does not become zero (Bug#12234).
2080
b98521db
PE
20812012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2082
2083 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2084 for GCC 4.7.1 x86-64.
2085
31d02438
GM
20862012-08-30 Glenn Morris <rgm@gnu.org>
2087
2088 * lread.c (init_lread): For out-of-tree builds, only add the
2089 source directory's site-lisp dir to the load-path if it exists,
2090 consistent with in-tree builds. (Bug#12302)
2091
7f8941d8
JD
20922012-08-28 Jan Djärv <jan.h.d@swipnet.se>
2093
2094 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 2095 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
2096 (windowShouldClose:): Set window_closed.
2097 (dealloc): New member, free button_values.
fc0c31f8
JB
2098 (process_dialog:): Make member function. Remove window argument,
2099 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
2100 in button_values.
2101 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 2102 with tag. Remove return self, declare return value as void.
7f8941d8
JD
2103 (addString:row:): Remove return self, declare return value as void.
2104 (addSplit): Remove return self, declare return value as void.
2105 (clicked:): Remove return self, declare return value as void.
fc0c31f8 2106 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
2107 (initFromContents:isQuestion:): Adjust call to process_dialog.
2108 Code formatting change.
2109 (timeout_handler:): Set timer_fired to YES.
2110 (runDialogAt:): Set timer_fired to NO.
2111 Handle click on close button as quit.
2112
2113 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
2114 Add window_closed and button_values. Add void as return value for
2115 add(Button|String|Split). addButton takes int instead of Lisp_Object.
2116 Add process_dialog as new member.
2117
eada0861 21182012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 2119
eada0861
GM
2120 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
2121 is not one of the heaps we manage. (Bug#12242)
2122
21232012-08-28 Glenn Morris <rgm@gnu.org>
2124
2125 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
2126
457294dd
MR
21272012-08-28 Martin Rudalics <rudalics@gmx.at>
2128
2129 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
2130 auto-buffer-name window parameter. Install revision of reverted
2131 fix.
457294dd 2132
4f2daf31
DA
21332012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2134
2135 Do not allow to set major mode for a dead buffer.
2136 * buffer.c (Fset_buffer_major_mode): Signal an error
2137 if the buffer is dead.
2138 (Fother_buffer, other_buffer_safely): Remove redundant
2139 nested declaration.
2140
66322887
DA
21412012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2142
2143 Always use set_buffer_if_live to restore original buffer at unwind.
2144 * buffer.h (record_unwind_current_buffer): New function.
2145 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
2146 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
2147 * undo.c, window.c: Adjust users.
2148 * buffer.c (set_buffer_if_live): Fix comment.
2149
a3d794a1
DA
21502012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2151
2152 Fix usage of set_buffer_internal.
2153 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
2154 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
2155 * coding.c (decode_coding): Omit redundant test.
2156 * fileio.c (decide_coding_unwind): Likewise.
2157 * fns.c (secure_hash): Likewise.
2158 * insdel.c (modify_region): Likewise.
2159 * keyboard.c (command_loop_1): Likewise.
2160 * print.c (PRINTFINISH): Likewise.
2161 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
2162
59ea14cd
PE
21632012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2164
2165 * dispnew.c: Use bool for boolean.
2166 (frame_garbaged, display_completed, delayed_size_change)
2167 (fonts_changed_p, add_window_display_history)
2168 (add_frame_display_history, verify_row_hash)
2169 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
2170 (row_equal_p, realloc_glyph_pool)
2171 (allocate_matrices_for_frame_redisplay)
2172 (showing_window_margins_p)
2173 (adjust_frame_glyphs_for_frame_redisplay)
2174 (build_frame_matrix_from_leaf_window, make_current)
2175 (mirrored_line_dance, mirror_line_dance, update_frame)
2176 (update_window_tree, update_single_window)
2177 (check_current_matrix_flags, update_window, update_text_area)
2178 (update_window_line, set_window_update_flags, scrolling_window)
2179 (update_frame_1, scrolling, buffer_posn_from_coords)
2180 (do_pending_window_change, change_frame_size)
2181 (change_frame_size_1, sit_for):
2182 Use bool for boolean.
2183 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2184 and remove last int (actually boolean) argument, which was always 0.
2185 All callers changed.
2186 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2187 * dispextern.h (struct composition_it): Use bool for boolean.
2188 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2189 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2190 * dired.c (file_name_completion):
2191 Use bool for boolean. (This was missed in an earlier change.)
2192
95072a94
MR
21932012-08-27 Martin Rudalics <rudalics@gmx.at>
2194
2195 * window.c (Fset_window_configuration): Revert first part of
2196 last change.
2197
0f19feff
JD
21982012-08-27 Jan Djärv <jan.h.d@swipnet.se>
2199
2200 * nsterm.h (NSPanel): New class variable dialog_return.
2201
3a880af4
SM
2202 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2203 Initialize dialog_return.
0f19feff
JD
2204 (windowShouldClose:): Use stop instead of stopModalWithCode.
2205 (clicked:): Ditto, and also set dialog_return (Bug#12258).
2206 (timeout_handler:): Use stop instead of abortModal. Send a dummy
2207 event.
2208 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
2209 modal loop returns.
2210
f10fe38f
PE
22112012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2212
de1339b0
PE
2213 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2214 * composite.c (find_composition, composition_gstring_p)
2215 (composition_reseat_it, find_automatic_composition):
2216 * data.c (let_shadows_buffer_binding_p)
2217 (let_shadows_global_binding_p, set_internal, make_blv)
2218 (Fmake_variable_buffer_local, Fmake_local_variable)
2219 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2220 (cons_to_signed, arith_driver):
2221 * dbusbind.c (xd_in_read_queued_messages):
2222 * dired.c (directory_files_internal, file_name_completion):
2223 Use bool for booleans.
2224 * dired.c (file_name_completion):
2225 * process.h (fd_callback):
2226 Omit int (actually boolean) argument. It wasn't being used.
2227 All uses changed.
2228 * composite.h, lisp.h: Reflect above API changes.
2229
f10fe38f
PE
2230 * cmds.c, coding.c: Use bool for booleans.
2231 * cmds.c (move_point, Fself_insert_command):
2232 * coding.h (struct composition status, struct coding_system):
2233 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2234 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2235 (emacs_mule_char, decode_coding_emacs_mule)
2236 (encode_coding_emacs_mule, detect_coding_iso_2022)
2237 (decode_coding_iso_2022, encode_invocation_designation)
2238 (encode_designation_at_bol, encode_coding_iso_2022)
2239 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2240 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2241 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2242 (encode_coding_raw_text, detect_coding_charset)
2243 (decode_coding_charset, encode_coding_charset, detect_eol)
2244 (detect_coding, get_translation_table, produce_chars)
2245 (consume_chars, reused_workbuf_in_use)
2246 (make_conversion_work_buffer, code_conversion_save)
2247 (decode_coding_object, encode_coding_object)
2248 (detect_coding_system, char_encodable_p)
2249 (Funencodable_char_position, code_convert_region)
2250 (code_convert_string, code_convert_string_norecord)
2251 (Fset_coding_system_priority):
2252 * fileio.c (Finsert_file_contents):
2253 Use bool for booleans.
2254 * coding.h, lisp.h: Reflect above API changes.
2255 * coding.c: Remove unnecessary static function decls.
2256 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2257 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2258 not a boolean 'int', since callers never look at the return value.
2259 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2260 * coding.h (decoding_buffer_size, encoding_buffer_size)
2261 (emacs_mule_string_char): Remove unused extern decls.
2262 (struct iso_2022_spec, struct coding_system):
2263 Use 'unsigned int : 1' for boolean fields, since there's more than one.
2264 (struct emacs_mule_spec): Remove unused field 'full_support'.
2265 All initializations removed.
2266 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2267
5474c384
DA
22682012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2269
f10fe38f 2270 Fix spare memory change (Bug#12286).
5474c384
DA
2271 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
2272 (valid_lisp_object_p): Likewise.
2273
c4b6914d
MR
22742012-08-27 Martin Rudalics <rudalics@gmx.at>
2275
2276 * window.c (Fset_window_configuration): Record any window's old
2277 buffer if it's replaced (see Bug#8789). If the new current
2278 buffer doesn't appear in the selected window, go to its old
2279 point (Bug#12208).
2280
35aaa1ea
DA
22812012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2282
2283 Special MEM_TYPE_SPARE to denote reserved memory.
2284 * alloc.c (enum mem_type): New memory type.
2285 (refill_memory_reserve): Use new type for spare memory.
2286 This prevents live_cons_p and live_string_p from incorrect
2287 detection of uninitialized objects from spare memory as live.
2288
6af64513
PE
22892012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2290
8b2e00a3
PE
2291 Spelling fixes.
2292 * Makefile.in (.PHONY): versioclean -> versionclean.
2293
b52d6985
PE
2294 Remove unused external symbols.
2295 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2296 * window.c (Qwindow_valid_p, decode_valid_window):
2297 Now static, not extern.
2298 * data.c (Qinterval): Remove; unused.
2299 (syms_of_data): Do not define 'interval'.
2300 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2301 * window.h (decode_valid_window):
2302 Remove decls.
2303
d5172d4f
PE
2304 * character.c, charset.c, chartab.c: Use bool for booleans.
2305 * character.c (lisp_string_width, string_count_byte8)
2306 (string_escape_byte8):
2307 * charset.c (charset_map_loaded, load_charset_map, read_hex):
2308 (load_charset_map_from_file, map_charset_chars)
2309 (Fdefine_charset_internal, define_charset_internal)
2310 (Fdeclare_equiv_charset, find_charsets_in_text)
2311 (Ffind_charset_region, char_charset, Fiso_charset):
2312 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2313 (sub_char_table_set, sub_char_table_set_range)
2314 (char_table_set_range, optimize_sub_char_table)
2315 (map_sub_char_table):
2316 Use bool for boolean.
2317 * character.c (str_to_unibyte): Omit last boolean argument; it was
2318 always 0. All callers changed.
2319 * character.h, charset.h: Adjust to match previous changes.
2320 * character.h (char_printable_p): Remove decl of nonexistent function.
2321 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2322 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2323 are all boolean, so make them single-bit bitfields.
2324
6af64513
PE
2325 * lisp.h (ASET): Remove attempt to detect side effects.
2326 It was meant to be temporary and it often doesn't work,
2327 because when IDX has side effects the behavior of IDX==IDX
2328 is undefined. See Stefan Monnier in
2329 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2330
e1f29348
BR
23312012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2332
2333 * lisp.h (functionp): New function (extracted from Ffunctionp).
2334 (FUNCTIONP): Use it.
2335 * eval.c (Ffunctionp): Use it.
2336
17c05d74
PE
23372012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2338
0f46bc75
PE
2339 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2340 as that's faster and simpler than static storage. Don't bother
2341 with the g_main_context_query overhead if g_main_context_pending
2342 says no events are pending.
2343 (gfds, gfds_size): Remove these static vars.
2344 (xgselect_initialize): Remove; no longer needed.
2345 All uses and decls removed.
2346
ee4c0f69
PE
2347 * emacs.c (fatal_error_signal_hook): Remove.
2348 All uses removed. This leftover from old code was always 0.
2349
17c05d74
PE
2350 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2351 * casefiddle.c (casify_object, casify_region):
2352 * casetab.c (set_case_table):
2353 * category.c, category.h (word_boundary_p):
2354 * category.h (CHAR_HAS_CATEGORY):
2355 Use bool for booleans, instead of int.
2356
391ceac5
EZ
23572012-08-25 Eli Zaretskii <eliz@gnu.org>
2358
2359 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2360
2f221583
PE
23612012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2362
f4a681b0
PE
2363 On assertion failure, print backtrace if available.
2364 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2365 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2366 * Makefile.in (LIB_EXECINFO): New macro.
2367 (LIBES): Use it.
2368
2f221583
PE
2369 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2370 * bytecode.c (exec_byte_code):
2371 * callint.c (check_mark, Fcall_interactively):
2372 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2373 (getenv_internal, sync_process_alive, call_process_exited):
2374 * lisp.h (USE_SAFE_ALLOCA):
2375 Use bool for booleans, instead of int.
2376 * lisp.h, process.h: Adjust prototypes to match above changes.
2377 * callint.c (Fcall_interactively): Don't assume the mark's
2378 offset fits in 'int'.
2379
37ef52bb
PE
23802012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2381
2382 * buffer.c, buffer.h: Use bool for boolean.
2383 * buffer.c (reset_buffer_local_variables)
2384 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2385 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2386 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2387 (overlay_touches_p, overlay_strings, Foverlay_put)
2388 (report_overlay_modification, call_overlay_mod_hooks):
2389 (mmap_enlarge, mmap_set_vars):
2390 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2391 Use bool for booleans, instead of int.
2392 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2393 since the 1-or-0 return value is always ignored anyway.
2394 (mmap_initialized_p):
2395 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2396 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2397
2cc21167
PE
23982012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2399
2400 * bidi.c: Use bool for boolean.
2401 This is a bit more readable, and makes the text segment of bidi.o
2402 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2403 Presumably it's faster too.
2404 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2405 Now bool.
2406 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2407 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2408 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2409 (bidi_explicit_dir_char, bidi_level_of_next_char)
2410 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2411 Use bool for booleans, instead of int.
2412 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2413 (bidi_unshelve_cache): Adjust decls to match code.
2414
7db4ddf4
MR
24152012-08-23 Martin Rudalics <rudalics@gmx.at>
2416
2417 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2418 argument.
2419
b1bb8011
PE
24202012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2421
2422 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2423 * atimer.h: Include <stdbool.h>.
2424
ff687885
DN
24252012-08-22 Dan Nicolaescu <dann@gnu.org>
2426
2427 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2428 compile time tests instead of run time tests on systems that do
2429 not use them.
2430 (FRAME_MAC_P): Remove leftover from deleted code.
2431 * frame.c (syms_of_frame): Remove leftover from deleted code.
2432
4ce7a138
JD
24332012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2434
2435 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2436
d733ec6d
PE
24372012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2438
2439 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2440 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 2441 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
2442 (fontset_add): Return void, for FONTSET_ADD.
2443
d0d2d26f
PE
24442012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2445
fce31d69
PE
2446 * alloc.c: Use bool for booleans.
2447 (gc_in_progress, abort_on_gc)
2448 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2449 (dont_register_blocks) [GC_MALLOC_CHECK]:
2450 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2451 (check_string_bytes, make_specified_string, memory_full)
2452 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2453 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2454 (mark_stack, valid_pointer_p, make_pure_string)
2455 (Fgarbage_collect, survives_gc_p, gc_sweep):
2456 Use bool for booleans, instead of int.
2457 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2458 Remove unused local.
2459 * alloc.c (PURE_POINTER_P):
2460 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2461 * editfns.c (Fformat):
2462 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2463 (Fdo_auto_save):
2464 * fns.c (sweep_weak_table):
2465 * lisp.h (suppress_checking, push_message, survives_gc_p)
2466 (make_pure_string, gc_in_progress, abort_on_gc):
2467 * lread.c (readchar, read1):
2468 * print.c (Fprin1_to_string):
2469 * xdisp.c (push_message):
2470 Use bool for booleans affected directly or indirectly by
2471 alloc.c's changes.
2472
d0d2d26f
PE
2473 Make recently-introduced setters macros.
2474 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2475 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2476 (set_fontset_default, set_fontset_fallback): Rename from their
2477 upper-case counterparts, and make them functions rather than macros.
2478 This is more consistent with the other recently-introduced setters.
2479 These don't need to be inline, since they're local.
2480
d18e2bb6
JD
24812012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2482
2483 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2484 the loop (Bug#12247).
2485
1b9d9d16
PE
24862012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2487
2488 * lisp.h (vcopy): Use memcpy rather than our own loop.
2489 This fixes a performance regression introduced by the recent
2490 addition of vcopy. This means 'vcopy' will need to be modified
2491 for a copying collector, but that's OK. Also, tighten the
2492 checking in the assertion.
2493
b2f09701
EZ
24942012-08-21 Eli Zaretskii <eliz@gnu.org>
2495
2496 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2497 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2498 non-base glyph for the width of the base character, according to
e1f29348
BR
2499 what x_draw_composite_glyph_string_foreground expects.
2500 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
2501 expectations, to produce correct width of the composed character.
2502 Reverse the sign of the DU offset produced by ScriptPlace.
2503
9b994fed
PE
25042012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2505
2506 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2507
086ca913
DA
25082012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2509
2510 Avoid direct writes to contents member of struct Lisp_Vector.
2511 * lisp.h (vcopy): New function to copy data into vector.
2512 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2513 * fns.c (Ffillarray): Use ASET.
2514 * keyboard.c (timer_check_2): Use AREF and ASET.
2515 (append_tool_bar_item, Frecent_keys): Use vcopy.
2516 * lread.c (read_vector): Use ASET.
2517 * msdos.c (Frecent_doskeys): Use vcopy.
2518 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2519 (Finternal_merge_in_global_face): Use ASET and vcopy.
2520 * xfont.c (xfont_list_pattern): Likewise.
2521
5481664a
MR
25222012-08-21 Martin Rudalics <rudalics@gmx.at>
2523
2524 * window.c (Fwindow_point): For the selected window always return
2525 the position of its buffer's point.
2526 (Fset_window_point): For the selected window always go in its
2527 buffer to the specified position.
2528
6d470bdd
DA
25292012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2530
2531 Setter macros for fontsets.
2532 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2533 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2534 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2535 Adjust users.
2536
24564fe1
GM
25372012-08-20 Glenn Morris <rgm@gnu.org>
2538
2539 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2540 Don't assume that `ln -f' works.
2541
0a05a035
EZ
25422012-08-20 Eli Zaretskii <eliz@gnu.org>
2543
2544 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2545 and later about non-assignments with no effect. See discussion at
2546 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2547 details.
2548
e46f2325
DA
25492012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2550
2551 Inline setter functions for Lisp_Objects slots of struct specbinding.
2552 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2553 Adjust users.
2554
734fbd86
MR
25552012-08-20 Martin Rudalics <rudalics@gmx.at>
2556
2557 * window.c (select_window): Always make selected window's buffer
2558 current.
2559
f1a95992
DA
25602012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2561
2562 Use AREF and ASET for docstrings of category tables.
2563 * category.h (CATEGORY_DOCSTRING): Use AREF.
2564 (SET_CATEGORY_DOCSTRING): Use ASET.
2565 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2566
e83064be
DA
25672012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2568
2569 Inline setter functions for hash table members.
2570 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2571 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2572 (set_hash_key_and_value, set_hash_index, set_hash_next)
2573 (set_hash_hash): New functions.
2574 * charset.c, fns.c: Adjust users.
2575
4ce60d2e
DA
25762012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2577
2578 Inline getter and setter functions for per-buffer values.
2579 * buffer.h (per_buffer_default, set_per_buffer_default)
2580 (per_buffer_value, set_per_buffer_value): New functions.
2581 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2582 * buffer.c, data.c: Adjust users.
2583
c06c9690
JB
25842012-08-20 Juanma Barranquero <lekktu@gmail.com>
2585
2586 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2587
32bd4250
PE
25882012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2589
bad03192 2590 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
2591 as gnulib does this if the system doesn't.
2592 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
2593 Remove declaration. MS-Windows declares it on stdlib.h which is
2594 included by conf_post.h.
b69a6d22
PE
2595 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2596 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2597 * vm-limit.c: Include <unistd.h>, for 'environ'.
2598
22d7feb2
PE
2599 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2600 (start_of_data): Remove decl; mem-limits.h provides it.
2601
32bd4250
PE
2602 * xdisp.c (handle_invisible_prop): Make it a bit faster
2603 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2604
450809af
CY
26052012-08-19 Chong Yidong <cyd@gnu.org>
2606
2607 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2608 ends (Bug#3874).
2609
9e677988
AS
26102012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2611
6b1319ce
AS
2612 * .gdbinit: Use call instead of set when calling a function in the
2613 inferior.
2614
9e677988
AS
2615 * data.c (set_internal): Don't use set_blv_found.
2616 (Fkill_local_variable): Likewise.
2617
d7191076
AA
26182012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2619
2620 * nsfont.m (ns_ascii_average_width): Ensure the string
2621 ascii_printable is initialized with a null-terminated character
2622 array. Otherwise, it can contain undesired extra characters.
2623
e757f1c6
PE
26242012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2625
2626 port new setting code to Sun C 5.8 2005/10/13
2627 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2628 Return void, not Lisp_Object. Otherwise, the compiler
2629 complains about (A?B:C) where B is void and C is Lisp_Object
2630 when compiling CHAR_TABLE_SET, due to the recent change to
2631 the API of sub_char_table_set_contents.
2632
a999ce26
CY
26332012-08-18 Chong Yidong <cyd@gnu.org>
2634
2635 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2636 for the string case (Bug#3874).
2637
3f22b86f
PE
26382012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2639
39eb03f1
PE
2640 * buffer.h (BSET): Remove (Bug#12215).
2641 Replace all uses with calls to new setter functions.
2642 (bset_bidi_paragraph_direction, bset_case_canon_table)
2643 (bset_case_eqv_table, bset_directory, bset_display_count)
2644 (bset_display_time, bset_downcase_table)
2645 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2646 (bset_last_selected_window, bset_local_var_alist)
2647 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2648 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2649 (bset_width_table):
2650 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2651 (bset_auto_fill_function, bset_auto_save_file_format)
2652 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2653 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2654 (bset_cache_long_line_scans, bset_case_fold_search)
2655 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2656 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2657 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2658 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2659 (bset_header_line_format, bset_indicate_buffer_boundaries)
2660 (bset_indicate_empty_lines, bset_invisibility_spec)
2661 (bset_left_fringe_width, bset_major_mode, bset_mark)
2662 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2663 (bset_name, bset_overwrite_mode, bset_pt_marker)
2664 (bset_right_fringe_width, bset_save_length)
2665 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2666 (bset_scroll_up_aggressively, bset_selective_display)
2667 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2668 (bset_word_wrap, bset_zv_marker):
2669 * category.c (bset_category_table):
2670 * syntax.c (bset_syntax_table):
2671 New setter functions.
2672
6a09a33b
PE
2673 * process.h (PSET): Remove (Bug#12215).
2674 Replace all uses with calls to new setter functions.
2675 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2676 (PROCESS_INLINE): New macro.
2677 (pset_childp): New setter function.
2678 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2679 * process.c (PROCESS_INLINE):
2680 Define to EXTERN_INLINE, so that the corresponding functions
2681 are compiled into code.
2682 (pset_buffer, pset_command, pset_decode_coding_system)
2683 (pset_decoding_buf, pset_encode_coding_system)
2684 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2685 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2686 (pset_type, pset_write_queue): New setter functions.
2687
e8c17b81
PE
2688 * window.h (WSET): Remove (Bug#12215).
2689 Replace all uses with calls to new setter functions.
2690 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2691 (WINDOW_INLINE): New macro.
2692 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2693 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2694 (wset_total_lines, wset_vertical_scroll_bar)
2695 (wset_window_end_pos, wset_window_end_valid)
2696 (wset_window_end_vpos): New setter functions.
2697 * window.c (WINDOW_INLINE):
2698 Define to EXTERN_INLINE, so that the corresponding functions
2699 are compiled into code.
2700 (wset_combination_limit, wset_dedicated, wset_display_table)
2701 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2702 (wset_new_normal, wset_new_total, wset_next_buffers)
2703 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2704 (wset_prev_buffers, wset_right_fringe_width)
2705 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2706 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2707 (wset_window_parameters):
2708 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2709 (wset_column_number_displayed, wset_region_showing):
2710 New setter functions.
2711
3f22b86f
PE
2712 * termhooks.h (TSET): Remove (Bug#12215).
2713 Replace all uses with calls to new setter functions.
2714 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2715 (TERMHOOKS_INLINE): New macro.
2716 (tset_charset_list, tset_selection_alist): New setter functions.
2717 * terminal.c (TERMHOOKS_INLINE):
2718 Define to EXTERN_INLINE, so that the corresponding functions
2719 are compiled into code.
2720 (tset_param_alist): New setter function.
2721
742af32f
PE
27222012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2723
15dbb4d6
PE
2724 * keyboard.h (KSET): Remove (Bug#12215).
2725 Replace all uses with calls to new setter functions.
2726 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2727 (KEYBOARD_INLINE): New macro.
2728 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2729 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2730 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2731 New setter functions.
2732 * keyboard.c (KEYBOARD_INLINE):
2733 Define to EXTERN_INLINE, so that the corresponding functions
2734 are compiled into code.
2735 (kset_echo_string, kset_kbd_queue)
2736 (kset_keyboard_translate_table, kset_last_prefix_arg)
2737 (kset_last_repeatable_command, kset_local_function_key_map)
2738 (kset_overriding_terminal_local_map, kset_real_last_command)
2739 (kset_system_key_syms): New setter functions.
2740
f00af5b1
PE
2741 * frame.h (FSET): Remove (Bug#12215).
2742 Replace all uses with calls to new setter functions.
2743 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2744 (FRAME_INLINE): New macro.
2745 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2746 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2747 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2748 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2749 (fset_param_alist, fset_root_window, fset_scroll_bars)
2750 (fset_selected_window, fset_title, fset_tool_bar_items)
2751 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2752 * frame.c (FRAME_INLINE):
2753 Define to EXTERN_INLINE, so that the corresponding functions
2754 are compiled into code.
2755 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2756
0c94c8d6
PE
2757 A few more naming-convention fixes for getters and setters.
2758 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2759 and rename from buffer_overlays_set_before.
2760 (set_buffer_overlays_after): Move here from buffer.h, and rename
2761 from buffer_overlays_set_after.
2762 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2763 All uses changed.
2764 (set_buffer_intervals): Rename from buffer_set_intervals.
2765 * intervals.c (set_interval_object): Move here from intervals.h,
2766 and rename from interval_set_object.
2767 (set_interval_left): Move here from intervals.h, and rename from
2768 interval_set_left.
2769 (set_interval_right): Move here from intervals.h, and rename from
2770 interval_set_right.
2771 (copy_interval_parent): Move here from intervals.h, and rename from
2772 interval_copy_parent.
2773 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2774 (set_interval_plist): Rename from interval_set_plist.
2775 Return void, not Lisp_Object, since no caller uses the result.
2776 * lisp.h (string_intervals): Rename from string_get_intervals.
2777 (set_string_intervals): Rename from string_set_intervals.
2778
34dabdb7
PE
2779 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2780 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 2781 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
2782 All uses changed. See the end of
2783 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2784
742af32f
PE
2785 * lisp.h (CSET): Remove (Bug#12215).
2786 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2787 (set_char_table_purpose): New functions,
2788 replacing CSET. All uses changed. For example, replace
2789 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 2790 "set_char_table_parent (char_table, parent);".
742af32f
PE
2791 The old version was confusing because it used the same name
2792 'parent' for two different things.
2793
a04e2c62
DA
27942012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2795
2796 Functions to get and set Lisp_Object fields of buffer-local variables.
2797 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2798 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2799 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2800 * data.c, eval.c, frame.c: Adjust users.
2801
383dcbf9
CY
28022012-08-17 Chong Yidong <cyd@gnu.org>
2803
2804 * xfaces.c (merge_face_vectors): If the target font specfies a
2805 font spec, make the font's attributes take precedence over
2806 directly-specified attributes.
2807 (merge_face_ref): Recognize :font.
2808
44386687
DA
28092012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2810
2811 Do not use memcpy for copying intervals.
2812 * intervals.c (reproduce_interval): New function.
2813 (reproduce_tree, reproduce_tree_obj): Use it.
2814 (reproduce_tree_obj): Remove prototype.
2815
927c7216
PE
28162012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2817
2818 * lisp.h (duration_to_sec_usec): Remove unused decl.
2819
93044f7b
AA
28202012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2821
2822 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2823 to an allocated instance of NSString, not to the class itself.
2824
9851e4a5
JB
28252012-08-17 Juanma Barranquero <lekktu@gmail.com>
2826
2827 * makefile.w32-in (C_CTYPE_H): New macro.
2828 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2829 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2830 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2831
620f13b0
PE
28322012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2833
2834 Use ASCII tests for character types.
2835 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2836 * xfns.c, xterm.c:
2837 Don't include <ctype.h>; was not needed.
2838 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2839 * sysdep.c, xfaces.c:
2840 Include <c-ctype.h> instead of <ctype.h>.
2841 * nsterm.m: Include <c-ctype.h>.
2842 * charset.c (read_hex):
2843 * doc.c (Fsnarf_documentation):
2844 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2845 (DRIVE_LETTER) [DOS_NT]:
2846 (Ffile_name_directory, Fexpand_file_name)
2847 (Fsubstitute_in_file_name):
2848 * font.c (font_parse_xlfd, font_parse_fcname):
2849 * frame.c (x_set_font_backend):
2850 * gtkutil.c (xg_get_font):
2851 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2852 * nsimage.m (hexchar):
2853 * nsterm.m (ns_xlfd_to_fontname):
2854 * sysdep.c (system_process_attributes):
2855 * xfaces.c (hash_string_case_insensitive):
2856 Use C-locale tests instead of locale-specific tests for character
2857 types, since we want the ASCII interpretation here, not the
2858 interpretation suitable for whatever happens to be the current locale.
2859
52162052
MR
28602012-08-16 Martin Rudalics <rudalics@gmx.at>
2861
2862 Consistently check windows for validity/liveness
2863 (Bug#11984, Bug#12025, Bug#12026).
2864 * lisp.h (CHECK_VALID_WINDOW): New macro.
2865 * window.c (decode_window): Rename to decode_live_window.
2866 (decode_valid_window, Fwindow_valid_p): New functions.
2867 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2868 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2869 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2870 (Fwindow_prev_sibling, Fwindow_combination_limit)
2871 (Fset_window_combination_limit, Fwindow_use_time)
2872 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2873 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2874 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2875 (Fwindow_hscroll, Fset_window_hscroll)
2876 (Fwindow_redisplay_end_trigger)
2877 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2878 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2879 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2880 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2881 (Fwindow_end, Fset_window_point, Fset_window_start)
2882 (Fpos_visible_in_window_p, Fwindow_line_height)
2883 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2884 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2885 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2886 (Fset_window_parameter, Fwindow_display_table)
2887 (Fset_window_display_table, Fdelete_other_windows_internal)
2888 (Fset_window_buffer, Fset_window_new_total)
2889 (Fset_window_new_normal, Fdelete_window_internal)
2890 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2891 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2892 (Fwindow_scroll_bars): Check whether argument window is a valid or
2893 live window. Update doc-strings.
2894 (syms_of_window): New symbol Qwindow_valid_p.
2895 * keyboard.c (Fposn_at_x_y): Check whether argument
2896 frame_or_window denotes a valid window.
2897
2751c80f
DA
28982012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2899
2900 Fix previous char table change.
2901 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2902 * chartab.c (optimize_sub_char_table): Likewise.
2903
032a42c8
CY
29042012-08-16 Chong Yidong <cyd@gnu.org>
2905
a2d19368
CY
2906 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2907
032a42c8
CY
2908 * xfont.c (xfont_open):
2909 * xftfont.c (xftfont_open): Set the font's max_width field.
2910
2911 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2912 min_width to space_width and average_width to the average over
2913 printable ASCII characters.
2914 (ns_char_width): Code cleanup.
2915 (ns_ascii_average_width): New utility function.
2916
2917 * font.h (struct font): Update comments.
2918
a098c930
DA
29192012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2920
032a42c8 2921 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
2922 * lisp.h (CSET): New macro.
2923 (char_table_set_extras, char_table_set_contents)
2924 (sub_char_table_set_contents): New function.
2925 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2926 * syntax.c: Adjust users.
2927
8be3a09c
SM
29282012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2929
2930 * eval.c (eval_sub): Bind lexical-binding.
2931 * lread.c (Qlexical_binding): Make non-static.
2932
ac4845a6
JD
29332012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2934
ddee6515
JD
2935 * nsmenu.m (popupSession): Remove.
2936 (pop_down_menu): Remove endModalSession.
2937 (timeout_handler:): New method.
2938 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2939 Call runModalForWindow. Check timer_fired when it returns.
2940 If not set, cancel timer and break out of loop.
2941 Otherwise loop again, with a new timeout.
2942
2943 * nsterm.m: Include fcntl.h if present.
2944 (fd_entry, t_readfds, inNsSelect): Remove.
2945 (select_writefds, select_valid, select_timeout, selfds)
2946 (select_mutex, apploopnr): Add.
2947 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2948 Otherwise call kbd_buffer_store_event.
2949 (ns_send_appdefined): Remove release of fd_entry.
2950 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2951 Increment and decrement apploopnr.
2952 (ns_select): If no file descriptors, just do a NSTimer.
2953 Otherwise copy read/write masks and start select thread (fd_handler).
2954 Start main loop and wait for application defined event.
2955 Inform select thread to stop selecting after main loop is exited.
2956 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 2957 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
2958 (fd_handler:): Loop forever, wait for info from the main thread
2959 to either start or stop selecting. When select returns, send
2960 and appdefined event.
2961 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2962 If not call kbd_buffer_store_event.
2963
2964 * nsterm.h (EmacsApp): fd_handler takes id argument.
2965 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2966
ac4845a6
JD
2967 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2968
eb424fe3
EZ
29692012-08-15 Eli Zaretskii <eliz@gnu.org>
2970
2971 * region-cache.c (move_cache_gap): Update gap_len using the actual
2972 growth of the boundaries array. Do not change cache_len.
2973 (Bug#12196)
2974
4e6a86c6
DA
29752012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2976
2977 Generalize and cleanup font subsystem checks.
2978 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
2979 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2980 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 2981
5bf192ca
DA
29822012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2983
2984 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2985
f2045622
CY
29862012-08-15 Chong Yidong <cyd@gnu.org>
2987
8be3a09c
SM
2988 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2989 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2990 extract the font descriptor instead of just the font name.
2991 In that case, return a font spec instead of a string.
f2045622
CY
2992 (x_last_font_name): Move to this file from xfns.c.
2993
2994 * xfns.c (Fx_select_font): The return value can also be a font
2995 spec. Move x_last_font_name management to gtkutil.c.
2996
2997 * xfaces.c: Make font weight and style symbols non-static.
2998
7f6feb56
SM
29992012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
3000
3001 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3002 (bug#12117).
3003
fecbd8ff
SM
30042012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
3005
3006 * alloc.c (Fgarbage_collect): Use plural form consistently.
3007
9b8d5165
EZ
30082012-08-14 Eli Zaretskii <eliz@gnu.org>
3009
3010 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3011 iteration through the command loop. Fixes a problem whereby mouse
3012 movements are ignored until the first mouse click.
3013
f5d9e83a
PE
30142012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3015
3016 Use bool, not int, for Lisp booleans.
3017 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3018 makes Emacs a bit smaller and presumably a bit faster.
3019 * lisp.h: Include <stdbool.h>.
3020 (struct Lisp_Boolfwd, defvar_bool):
3021 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3022 * regex.c [!emacs]: Include <stdbool.h>.
3023 (false, true): Remove; <stdbool.h> does this for us now.
3024
55802e4a
CY
30252012-08-14 Chong Yidong <cyd@gnu.org>
3026
4abcdac8
CY
3027 * character.c (Fcharacterp): Doc fix (Bug#12076).
3028
3029 * data.c (Findirect_variable): Doc fix (Bug#11040).
3030
55802e4a
CY
3031 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
3032
3033 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 3034 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 3035
8e99d072
BR
30362012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3037
3038 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3039 (bug#12022).
3040
08908aca
MR
30412012-08-14 Martin Rudalics <rudalics@gmx.at>
3042
3043 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3044 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3045 * minibuf.c (choose_minibuf_frame, read_minibuf):
3046 * w32fns.c (x_create_tip_frame):
3047 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3048 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3049
56120d6f
PE
30502012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3051
3052 * intervals.c (offset_intervals): Remove obsolete comment.
3053
67b77c0b
AS
30542012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3055
3056 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3057
f48b82fd
GR
30582012-08-14 Gergely Risko <gergely@risko.hu>
3059
3060 * coding.c (decode_coding): Record buffer modification before
3061 disabling undo_list (Bug#11773).
3062
fd318b54
DA
30632012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3064
3065 Revert and cleanup some recent overlay changes.
3066 * buffer.h (enum overlay_type): Remove.
3067 (buffer_get_overlays, buffer_set_overlays): Likewise.
3068 (buffer_set_overlays_before, buffer_set_overlays_after):
3069 New function. Adjust users.
3070 (unchain_both): Add eassert.
3071
41a62dd9
DA
30722012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3073
3074 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3075
5884c324
PE
30762012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3077
3078 * gtkutil.c (xg_mark_data): Don't assume C99.
3079
ca06f160
JD
30802012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3081
3082 * gtkutil.c (xg_frame_tb_info): New struct.
3083 (TB_INFO_KEY): New define.
3084 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3085 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3086 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3087 if not present.
3088 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 3089 is up to date. Otherwise store new data.
ca06f160
JD
3090 (free_frame_tool_bar): Free xg_frame_tb_info if present.
3091
7864a3f7
DA
30922012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3093
3094 Use KSET for write access to Lisp_Object members of struct kboard.
3095 * keyboard.h (KSET): New macro.
3096 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3097 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3098 * xterm.c: Adjust users.
3099
4c31be61
DA
31002012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3101
3102 Use BSET for write access to Lisp_Object members of struct buffer.
3103 * buffer.h (BSET): New macro.
3104 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3105 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3106 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3107 * window.c, xdisp.c, xfns.c: Adjust users.
3108
14ae4239
BT
31092012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
3110
3111 * lread.c (syms_of_lread): Initialize Vlexical_binding.
3112
32bcadb4
JD
31132012-08-11 Jan Djärv <jan.h.d@swipnet.se>
3114
3d29b2ce 3115 * nsterm.m (not_in_argv): New function.
fc0c31f8 3116 (application:openFile, application:openTempFile:):
3d29b2ce
JD
3117 (application:openFileWithoutUI:, application:openFiles:): Open file
3118 if not_in_argv returns non-zero (bug#12171).
3119
32bcadb4 3120 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
3121 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
3122 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
3123 (xg_get_font_name): Use those functions/macros here.
3124 Reported by Frans Oilinki <moilinki@gmail.com>.
3125
9ff9402d 31262012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
3127
3128 * unexmacosx.c (copy_data_segment): Copy initialized data in
3129 statically linked libraries from input file rather than memory.
3130
db74a5fc
YM
3131 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
3132 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
3133 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
3134
25e65510
GM
31352012-08-10 Glenn Morris <rgm@gnu.org>
3136
3137 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
3138 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
3139
7961135c
DA
31402012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3141
3142 Fix last change to allow compilation with low optimization levels.
3143 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
3144 Reported by Jan Djärv <jan.h.d@swipnet.se>.
3145
42b3a444
DA
31462012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3147
3148 Use common inline syntax in intervals.h.
3149 * intervals.h (INTERVALS_INLINE): New macro.
3150 Change all users from LISP_INLINE.
3151
9fb0c957
DA
31522012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3153
3154 Define Qnone once for all platforms.
3155 * frame.c (Qnone): Define here.
3156 (syms_of_frame): DEFSYM it.
3157 * lisp.h (Qnone): New declaration.
3158 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
3159 * xfns.c: Remove duplication. Adjust users.
3160
65e8ee52
DA
31612012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3162
3163 Remove unused macros from intervals.h.
3164 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
3165 * intervals.c: Adjust comment.
3166
9b855fd6
EZ
31672012-08-10 Eli Zaretskii <eliz@gnu.org>
3168
3169 * w32fns.c <w32_unicode_gui>: New static variable.
3170 (globals_of_w32fns): Initialize it according to os_subtype.
3171 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3172 testing os_subtype.
3173
39cb9e56 31742012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
3175 Eli Zaretskii <eliz@gnu.org>
3176
3177 Fix bug #10299 with Unicode characters sent by customized
3178 keyboards created by MSKLC.
3179 * w32fns.c (INIT_WINDOW_CLASS): New macro.
3180 (w32_init_class): Use it to initialize the Emacs class with either
3181 ANSI or Unicode API calls.
3182 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3183 later.
3184 (w32_wnd_proc): If the character code sent by WM_CHAR or
3185 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3186 original message. Call DefWindowProcW on NT and later.
3187
9374581a
GM
31882012-08-10 Glenn Morris <rgm@gnu.org>
3189
4b94e8cf
GM
3190 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3191
9374581a
GM
3192 * lisp.h (DIRECTORY_SEP): Let configure set it.
3193
a2752828
DA
31942012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
3195
3196 Use TSET for write access to Lisp_Object slots of struct terminal.
3197 * termhooks.h (TSET): New macro.
3198 * coding.c, terminal.c, xselect.c: Adjust users.
3199
cc92c454
SM
32002012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
3201
3202 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
3203 the failing expression, include them in the error message.
3204 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3205 * lisp.h (internal_condition_case_n): Update declaration.
3206
4cb3e6b3
DA
32072012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3208
3209 Inline functions to examine and change buffer overlays.
3210 * buffer.c (unchain_both): New function.
3211 * buffer.h (buffer_get_overlays, buffer_set_overlays):
3212 (buffer_has_overlays): New function.
3213 (enum overlay_type): New enum.
3214 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3215 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3216
8707c1e5
DA
32172012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3218
3219 Inline functions to examine and change buffer intervals.
3220 * alloc.c (mark_interval_tree): Remove.
3221 (MARK_INTERVAL_TREE): Simplify.
3222 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
3223 * intervals.c (buffer_balance_intervals): New function.
3224 (graft_intervals_into_buffer): Adjust indentation.
3225 (set_intervals_multibyte): Simplify.
3226 * buffer.h (BUF_INTERVALS): Remove.
3227 (buffer_get_intervals, buffer_set_intervals): New function.
3228 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3229 * intervals.c, textprop.c: Adjust users.
3230
ad8c997f
DA
32312012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3232
3233 Inline functions to examine and change string intervals.
3234 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3235 (string_get_intervals, string_set_intervals): New function.
3236 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3237 * lread.c, print.c, textprop.c: Adjust users.
3238
32ac3a6b
GM
32392012-08-08 Glenn Morris <rgm@gnu.org>
3240
3241 * lisp.mk (lisp): Remove language/persian.elc.
3242
77c7bcb1
DA
32432012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3244
3245 Cleanup intervals.
3246 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3247 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
3248 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3249 Adjust comment. Move under #if 0.
77c7bcb1
DA
3250 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3251 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3252
9c08a8d4
DA
32532012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3254
3255 Check total length of intervals with eassert.
3256 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3257 * intervals.c: Change all users to eassert.
3258
26d16b35
EZ
32592012-08-07 Eli Zaretskii <eliz@gnu.org>
3260
14ae4239
BT
3261 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
3262 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
3263 INTERNAL_FIELD in Lisp_Cons.
3264
c644523b
DA
32652012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3266
3267 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
3268 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
3269 name since all xname users are fixed long time ago. Do not
3270 use INTERNAL_FIELD.
3271 (set_symbol_name, set_symbol_function, set_symbol_plist):
3272 (set_symbol_next, set_overlay_plist): New function.
3273 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
3274 (struct Lisp_Overlay): Likewise.
3275 (CVAR, MVAR, SVAR): Remove.
3276 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
3277 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
3278 * xterm.c: Adjust users.
3279 * .gdbinit: Change to use name field of struct Lisp_Symbol
3280 where appropriate.
3281
6a3d20cc
DA
32822012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3283
3284 Basic functions to set Lisp_Object and pointer slots of intervals.
3285 * intervals.h (interval_set_parent, interval_set_object):
3286 (interval_set_left, interval_set_right, interval_set_plist):
3287 (interval_copy_parent): New function.
3288 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
3289 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
3290 Adjust indentation.
6a3d20cc
DA
3291 (INTERVAL_SIZE): Remove. Adjust users.
3292 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3293
4d2b044c
DA
32942012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3295
3296 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3297 * process.h (PGET): Remove.
3298 (struct Lisp_Process): Do not use INTERNAL_FIELD.
3299 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3300
d3d50620
DA
33012012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3302
3303 Drop WGET and revert read access to Lisp_Objects slots of struct window.
3304 * window.h (WGET): Remove.
3305 (struct window): Do not use INTERNAL_FIELD.
3306 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3307 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3308 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3309 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3310 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3311 Adjust users.
3312
d10a51dc
CY
33132012-08-07 Chong Yidong <cyd@gnu.org>
3314
3315 * window.c (Fwindow_edges, Fwindow_pixel_edges)
3316 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3317 (Fdelete_window_internal): Signal an error if the window is not on
3318 a live frame (Bug#12025).
3319
e69b0960
DA
33202012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3321
3322 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3323 * frame.h (FGET): Remove.
3324 (struct frame): Do not use INTERNAL_FIELD.
3325 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3326 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3327 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3328 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3329
25a20a3a
JB
33302012-08-06 Juanma Barranquero <lekktu@gmail.com>
3331
3332 * w32.c: Silence compiler warnings.
3333 (map_w32_filename): Remove unused variable `is_fat'.
3334 (chase_symlinks): Add parentheses around expression.
3335
1c6f11f4
GM
33362012-08-06 Glenn Morris <rgm@gnu.org>
3337
1db4583a
GM
3338 * sysdep.c: Respect BROKEN_GETWD.
3339
1c6f11f4
GM
3340 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3341 Let configure handle it.
3342 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3343
2b90362b
DA
33442012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3345
3346 Use GCALIGNMENT where appropriate.
3347 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3348 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3349 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3350
5f50daf2
EZ
33512012-08-06 Eli Zaretskii <eliz@gnu.org>
3352
14ae4239
BT
3353 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3354 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 3355
cbcc7007
SM
33562012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3357
3358 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3359 that should be sufficient for everyone.
3360
4d365fa4
JD
33612012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3362
3363 * keyboard.c (timer_check_2): Add break so timer_check returns next
3364 timeout.
3365
dd86bd82
DA
33662012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3367
3368 Fix Windows build errors introduced after converting to WGET and WSET.
3369 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3370 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3371
054e1668
JD
33722012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3373
3374 * nsterm.m (ns_frame_rehighlight): Use FSET.
3375
3376 * nsmenu.m (ns_update_menubar): Use FSET.
3377
21238f11
DA
33782012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3379
3380 Separate read and write access to Lisp_Object slots of Lisp_Process.
3381 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3382 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3383
077288cf
DA
33842012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3385
3386 Separate read and write access to Lisp_Object slots of struct window.
3387 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3388 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3389 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3390 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3391 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3392 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3393 Adjust users.
3394
71688bd7
DA
33952012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3396
3397 Fix Windows build errors introduced after converting to FGET and FSET.
3398 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3399 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3400 (w32_judge_scroll_bars): Change to use FSET.
3401 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3402
f99bac93
DA
34032012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3404
3405 Fix replacement typo.
3406 * window.c (replace_window): Set root_window instead of
3407 selected_window. This fixes a total window subsystem
3408 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3409
8c2a0f2d
GM
34102012-08-06 Glenn Morris <rgm@gnu.org>
3411
3412 * lisp.mk (lisp): Add language/persian.elc.
3413
edd74c35
DA
34142012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3415
3416 Separate read and write access to Lisp_Object slots of struct frame.
3417 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3418 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3419 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3420 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3421 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3422
8671676c
AS
34232012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3424
3425 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3426
663e2b3f
DA
34272012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3428
3429 Generalize common compile-time constants.
3430 * lisp.h (header_size, bool_header_size, word_size): Now here.
3431 (struct Lisp_Vector): Add comment.
3432 (struct Lisp_Bool_Vector): Move up to define handy constants.
3433 (VECSIZE, PSEUDOVECSIZE): Simplify.
3434 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3435 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3436 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3437 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3438 * xfont.c, xmenu.c: Use word_size where appropriate.
3439
d32e47af
LM
34402012-08-05 Lawrence Mitchell <wence@gmx.li>
3441
3442 * search.c (Freplace_match): Treat \? in the replacement text
3443 literally (Bug#8161).
3444
e5d9c0d1
CY
34452012-08-05 Chong Yidong <cyd@gnu.org>
3446
3447 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3448 * frame.c (Vdelete_frame_functions):
3449 * emacs.c (Vkill_emacs_hook): Doc fix.
3450
8da0576b
EZ
34512012-08-04 Eli Zaretskii <eliz@gnu.org>
3452
3453 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3454 --with-x-toolkit=no builds.
3455 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3456
02676e5d
CY
34572012-08-04 Chong Yidong <cyd@gnu.org>
3458
3459 * syntax.c (Fmodify_syntax_entry): Doc fix.
3460
97147da9
EZ
34612012-08-04 Eli Zaretskii <eliz@gnu.org>
3462
76151e2c
EZ
3463 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3464 * w32.c (init_environment): Change the default values of many
3465 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
3466 them into environment when they were not already defined.
3467 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 3468 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
3469 (check_windows_init_file): Now external, not static.
3470 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
3471 called when Vload_path is already set up.
3472
3473 * w32.h (check_windows_init_file): Add prototype.
3474
3475 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3476 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3477 compatibility with Posix platforms.
3478 (main): Move the call to check_windows_init_file to here from
3479 w32.c.
3480 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3481 any, in the DEFALT argument into the root of the Emacs build or
3482 installation tree, as appropriate.
3483
3484 * callproc.c (init_callproc_1): Call decode_env_path instead of
3485 doing its equivalent by hand.
3486 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3487 the code that sets Vexec_path run on MS-Windows.
3488
3489 * lread.c (init_lread): Add comments to #ifdef's.
3490
97147da9
EZ
3491 * msdos.c (dos_set_window_size, IT_update_begin)
3492 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3493 instead of direct references.
3494
185ee146
PE
34952012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3496
3497 Export DEFAULT_REHASH_* to GDB.
3498 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3499 Now constants, not macros.
3500
8834c57a
PE
35012012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3502
98c6f1e3
PE
3503 Remove unnecessary casts involving pointers.
3504 These casts are no longer needed now that we assume C89 or later,
3505 since they involve casting to or from void *.
3506 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3507 (make_pure_float, make_pure_vector):
3508 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3509 * macros.c (Fstart_kbd_macro):
3510 * menu.c (find_and_return_menu_selection):
3511 * minibuf.c (read_minibuf_noninteractive):
3512 * sysdep.c (closedir):
3513 * xdisp.c (x_produce_glyphs):
3514 * xfaces.c (compare_fonts_by_sort_order):
3515 * xfns.c (x_real_positions, select_visual):
3516 * xselect.c (x_stop_queuing_selection_requests)
3517 (x_get_window_property, x_get_window_property_as_lisp_data):
3518 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3519 Remove unnecessary pointer casts.
3520 * alloc.c (record_xmalloc): New function.
3521 * lisp.h (record_xmalloc): New decl.
3522 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3523 more like a function. This is because the pointer cast is not
3524 needed. All uses changed.
3525 * print.c (print_string, print_error_message): Avoid length recalc.
3526
8834c57a
PE
3527 Improve fix for macroexp crash with debugging (Bug#12118).
3528 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3529 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3530 not supposed to be invoked from the garbage collector.
3531 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3532 (gc_aset): New function, which is like ASET but can be
3533 used in the garbage collector.
3534 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3535 (set_hash_index): Use it instead of ASET.
3536
6dad7178
EZ
35372012-08-03 Eli Zaretskii <eliz@gnu.org>
3538
3539 Support symlinks on latest versions of MS-Windows.
3540 * w32.c: Include winioctl.h and aclapi.h.
3541 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3542 (revert_to_self): Forward declarations of static functions.
3543 <static BOOL g_b_init_get_security_info>:
3544 <g_b_init_create_symbolic_link>: New static flags.
3545 (globals_of_w32): Initialize them to zero.
3546 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3547 (map_w32_filename): Improve commentary. Simplify switch.
3548 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3549 headers (most versions of MinGW w32api don't).
3550 (get_security_info, create_symbolic_link)
3551 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3552 New functions.
3553 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3554 in the argument file name.
3555 (sys_access): Call unc_volume_file_attributes only if
3556 GetFileAttributes fails with network-related error codes.
3557 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3558 have the required privileges.
14ae4239 3559 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
3560 get_file_security_desc.
3561 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
3562 with addition of handling of symlinks and support for 'lstat'.
3563 If possible, get file's attributes and security information by
6dad7178
EZ
3564 handle, not by name. Produce S_IFLNK bit for symlinks, when
3565 called from 'lstat'.
3566 (stat, lstat): New functions, call 'stat_worker'.
3567 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3568 symlinks when the underlying filesystem supports them.
3569
f162bcc3
PE
35702012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3571
79ea6c20
PE
3572 Fix macroexp crash on Windows with debugging (Bug#12118).
3573 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3574 checking subscripts; problem introduced with the recent
3575 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3576 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3577 since it's used in non-static inline functions now.
3578
c0ce93fd
PE
3579 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3580 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 3581
f162bcc3
PE
3582 Use C99-style 'extern inline' if available.
3583 * buffer.h (BUFFER_INLINE):
3584 * category.h (CATEGORY_INLINE):
3585 * character.h (CHARACTER_INLINE):
3586 * charset.h (CHARSET_INLINE):
3587 * composite.h (COMPOSITE_INLINE):
3588 * dispextern.h (DISPEXTERN_INLINE):
3589 * lisp.h (LISP_INLINE):
3590 * systime.h (SYSTIME_INLINE):
3591 New macro, replacing 'static inline' in this header.
3592 * buffer.h, category.h, character.h, charset.h, composite.h:
3593 * dispextern.h, lisp.h, systime.h:
3594 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3595 * alloc.c (LISP_INLINE):
3596 * buffer.c (BUFFER_INLINE):
3597 * category.c (CATEGORY_INLINE):
3598 * character.c (CHARACTER_INLINE):
3599 * charset.c (CHARSET_INLINE):
3600 * composite.c (COMPOSITE_INLINE):
3601 * dispnew.c (DISPEXTERN_INLINE):
3602 * sysdep.c (SYSTIME_INLINE):
3603 Define to EXTERN_INLINE, so that the corresponding functions
3604 are compiled into code.
3605 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3606 (INLINE_HEADER_END): New macros.
3607 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3608 since it's used in non-static inline functions now.
a8333d03 3609 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 3610
837b365b
GM
36112012-08-02 Glenn Morris <rgm@gnu.org>
3612
d66b744d
GM
3613 * s/: Remove empty directory.
3614
837b365b
GM
3615 * s/ms-w32.h: Move to ../nt/inc.
3616 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3617 Update for new ms-w32.h location.
3618
13294f95
PE
36192012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3620
3621 Port to Solaris 8.
3622 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3623
90df0db3
GM
36242012-08-02 Glenn Morris <rgm@gnu.org>
3625
3626 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3627 hard-coding the path separator.
3628
4939150c
PE
36292012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3630
3631 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3632 This how ASET and AREF are supposed to work, and makes
3633 it easier to think about future improvements. See
3634 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3635 * charset.h (set_charset_attr): New function.
3636 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3637 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3638 (aref_addr): New function. All uses of &AREF(...) changed.
3639 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3640 (set_hash_index): New functions. All lvalue-style uses of
3641 HASH_KEY etc. changed.
3642 * keyboard.c (set_prop): New function. All lvalue-style uses
3643 of PROP changed.
3644
947b2afd
AA
36452012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3646
3647 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3648 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3649 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3650 * nsfns.m (ns_set_name_as_filename): Likewise.
3651 * nsmenu.m (ns_update_menubar): Likewise.
3652 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3653
4f5d0325
EZ
36542012-08-01 Eli Zaretskii <eliz@gnu.org>
3655
2008beae
EZ
3656 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3657 Adapt to latest changes in field names of the corresponding Lisp
288479f6 3658 objects.
2008beae 3659
4f5d0325
EZ
3660 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3661
fe3cc771
GM
36622012-08-01 Glenn Morris <rgm@gnu.org>
3663
3664 * s/msdos.h: Remove file.
3665 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3666 * Makefile.in (S_FILE): Remove.
3667 (config_h): Remove S_FILE.
3668
c90acc54
JB
36692012-08-01 Juanma Barranquero <lekktu@gmail.com>
3670
3671 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3672 Remove; moved to nt/config.nt.
3673
d8a05828
DA
36742012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3675
3676 Use INTERNAL_FIELD for conses and overlays.
3677 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3678 Remove obsolete comment.
3679 (MVAR): New macro.
3680 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3681 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3682
8271d590
DA
36832012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3684
3685 Use INTERNAL_FIELD for symbols.
3686 * lisp.h (SVAR): New macro. Adjust users.
3687 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3688 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3689
3193acd2
DA
36902012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3691
3692 Use INTERNAL_FIELD for processes.
3693 * process.h (PVAR): New macro. Adjust style.
3694 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3695 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3696
3a45383a
DA
36972012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3698
3699 Use INTERNAL_FIELD for windows.
3700 * window.h (WVAR): New macro.
3701 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3702 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3703 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3704 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3705 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3706 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3707
c1dbc63c
PE
37082012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3709
3710 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3711
5c0c0e8a
GM
37122012-08-01 Glenn Morris <rgm@gnu.org>
3713
3714 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3715 Move to configure.ac.
3716
552a99b4
JB
37172012-08-01 Juanma Barranquero <lekktu@gmail.com>
3718
3719 * makefile.w32-in (CONFIG_H): Update dependencies.
3720 (CONF_POST_H): New macro.
3721
3722 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3723
8d8e2dfe
GM
37242012-07-31 Glenn Morris <rgm@gnu.org>
3725
bc96620a
GM
3726 * Makefile.in (S_FILE): No longer set by configure.
3727
476b1b2d
GM
3728 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3729 is available.
3730 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3731
b2c7a106
GM
3732 * process.h (NULL_DEVICE):
3733 * emacs.c (SEPCHAR):
3734 * editfns.c (USER_FULL_NAME): Let configure set them.
3735
d53d062a
GM
3736 * s/README, s/template.h: Remove files.
3737
4515017f
GM
3738 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3739
8d8e2dfe
GM
3740 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3741 Move to configure.ac.
3742
5b20b3cc
EZ
37432012-07-31 Eli Zaretskii <eliz@gnu.org>
3744
1e0afd9a
EZ
3745 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3746 resulting renaming of 'struct frame' members.
3747
5b20b3cc
EZ
3748 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3749
3750 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3751 after introduction of FVAR.
3752
f1310128
JD
37532012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3754
79e721e0
JD
3755 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3756
3757 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3758 instead of compositeToPoint.
3759 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3760
8d7c7eed 3761 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 3762
e34f7f79
DA
37632012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3764
3765 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3766 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 3767 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
3768 (BVAR): Change to use INTERNAL_FIELD.
3769 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3770 (KVAR): Change to use INTERNAL_FIELD.
3771 * frame.h (FVAR): New macro.
3772 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
3773 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3774 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3775 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
3776 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3777
c09bfb2f
DA
37782012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3779
3780 Miscellaneous fixes for non-default X toolkits.
3781 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3782 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3783 Move under #ifdef USE_LUCID.
3784 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3785 definition and usage to avoid warnings.
3786
14c114ae
JD
37872012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3788
3789 * nsterm.m (openFiles): Fix previous checkin.
3790
3bd21e82
PE
37912012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3792
3793 * indent.c (compute_motion): Remove unused local.
3794
c1529ded
GM
37952012-07-31 Glenn Morris <rgm@gnu.org>
3796
400d5621
GM
3797 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3798
268e2432
GM
3799 * conf_post.h [USG5_4]:
3800 Move remaining contents of s/usg5-4-common.h here.
3801 * s/usg5-4-common.h: Remove file.
3802
7552f3ee
GM
3803 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3804 * s/irix6-5.h: Remove file.
3805
6a381852
GM
3806 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3807 * s/darwin.h: Remove file.
3808
c1529ded
GM
3809 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3810 * s/hpux10-20.h: Remove file, which is now empty.
3811
b429a4ee
GM
38122012-07-30 Glenn Morris <rgm@gnu.org>
3813
3814 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3815 * Makefile.in (config_h): Add conf_post.h.
3816 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3817
adff3182
JD
38182012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3819
3820 * nsterm.m (ns_do_open_file): New variable.
b9031d69 3821 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
3822 (openFile, openTempFile, openFileWithoutUI, openFiles):
3823 Open files only if ns_do_open_file.
adff3182 3824
c32af1e4
PE
38252012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3826
7393bcbb
PE
3827 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3828 This no-op macro hasn't been needed for many years.
3829 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3830
c32af1e4
PE
3831 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3832 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3833 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3834 gdb_make_enums_visible.
3835 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3836 (DIRECTORY_SEP): Now a constant, not a macro.
3837
302fc036
EZ
38382012-07-30 Eli Zaretskii <eliz@gnu.org>
3839
3840 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3841 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3842
3843 * w32term.c <w32_keyboard_codepage>: Renamed from
3844 keyboard_codepage and now external. All users changed.
3845
3846 * w32term.h: Add declaration of w32_keyboard_codepage.
3847
3848 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3849 the codepage to translate keys to Unicode. If this argument is
3850 -1, use the value returned by GetConsoleCP. All callers changed.
3851
88fb40b4
PE
38522012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3853
0aee6912
PE
3854 Update .PHONY listings in makefiles.
3855 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3856 bootstrap-clean, distclean, maintainer-clean, versioclean,
3857 extraclean, frc.
3858
88fb40b4
PE
3859 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3860 This is a bit clearer. Fix some commentary typos.
3861
0a763bd1
GM
38622012-07-30 Glenn Morris <rgm@gnu.org>
3863
32bac6d6
GM
3864 * s/netbsd.h: Let configure include signal.h if needed.
3865 Remove file, which is now empty.
3866
b65e7c46
GM
3867 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3868 Let configure set them.
3869 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3870 No more need to undefine.
0a763bd1 3871
169304bd
AS
38722012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3873
3874 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3875 non-single-byte char when adding meta modifier. (Bug#12090)
3876
6cd7a139
DA
38772012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3878
3879 Convert safe_call to use variable number of arguments.
3880 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3881 (safe_call2): Fix comment.
3882 * lisp.h (safe_call): Adjust prototype.
3883 * coding.c (encode_coding_object): Change to use safe_call2.
3884 * xfaces.c (merge_face_heights): Change to use safe_call1.
3885
d34d6ffc
GM
38862012-07-30 Glenn Morris <rgm@gnu.org>
3887
7b8a48e4 3888 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 3889 does that unconditionally. Remove file, which is now empty.
7b8a48e4 3890
d34d6ffc
GM
3891 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3892 Remove empty files.
3893
03a660a6
PE
38942012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3895
3896 Export to GDB most of lisp.h's remaining object-like macros.
3897 * lisp.h (min, max): Move earlier, because they're used earlier now.
3898 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3899 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3900 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3901 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3902 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3903 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3904 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3905 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3906 Now constants, for GDB. They need not be macros.
3907 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3908 Now constants, for GDB, as well as macros, for static initializers.
3909 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3910 Move to after the definition of struct Lisp_Char_Table,
3911 since the former now needs that type defined.
3912 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3913 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3914 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3915 New enums, for gdb_make_enums_visible.
3916 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 3917 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
3918 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3919 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3920 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3921 enum maxargs, enum MAX_ALLOCA.
3922 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3923 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3924 no longer needed, now that they are done in lisp.h.
3925
e499d0ee
DA
39262012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3927
3928 Cleanup string bytes checking.
3929 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3930 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3931 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3932 (check_sblock, compact_small_strings): Simplify.
3933
d5040d2d
PE
39342012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3935
3936 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3937 These macros are confusing and no longer need to be defined, as
3938 the enum values now suffice. All uses replaced with definiens.
3939 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3940
7f259ae6
JB
39412012-07-29 Juanma Barranquero <lekktu@gmail.com>
3942
3943 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3944 ($(BLD)/w32console.$(O)): Update dependencies.
3945
7e63e0c3
DA
39462012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3947
3948 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3949 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3950 time. Adjust users.
3951 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3952
ffd817eb
JD
39532012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3954
3955 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3956 setting sitelisp (Bug#12010).
3957
417a7a0e
EZ
39582012-07-29 Eli Zaretskii <eliz@gnu.org>
3959
14ae4239 3960 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
3961
3962 * w32heap.c (cache_system_info):
3963 * w32.c (sys_rename):
3964 * w32proc.c (find_child_console, sys_kill): All users changed.
3965
387d4d92
PE
39662012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3967
3968 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3969
55a6cca6
EZ
39702012-07-29 Eli Zaretskii <eliz@gnu.org>
3971
3972 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3973
dbcf001c
DA
39742012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3975
3976 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
3977 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3978 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 3979
e2688e4a
DA
39802012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3981
3982 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3983 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3984 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3985 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3986 (replace_range, replace_range_2, del_range_2): Change to eassert.
3987 * marker.c (byte_char_debug_check): Adjust style.
3988
b46a6a83
PE
39892012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3990
3991 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3992 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3993 long-ago-commented-out code that talks about "WIN32".
3994 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3995 All uses changed.
3996
e32a5799
PE
39972012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3998
3999 Use Gnulib stdalign module (Bug#9772, Bug#9960).
4000 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4001 Simplify by using alignof.
4002 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4003 * lisp.h: Include <stdalign.h>.
4004 (GCALIGNMENT): New macro and constant.
4005 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
4006 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4007 (stdalign): New macro, if not already defined.
4008
df81cd29
EZ
40092012-07-28 Eli Zaretskii <eliz@gnu.org>
4010
01bd1b0d
EZ
4011 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
4012 * w32inevt.c: Include w32inevt.h.
4013 (w32_read_console_input): New inline function, calls either
4014 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4015 w32_console_unicode_input.
4016 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4017 (w32_kbd_patch_key, key_event): Use the codepage returned by
4018 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4019 (key_event): use uChar.UnicodeChar only if
4020 w32_console_unicode_input is non-zero.
4021
4022 * w32console.c: Include w32heap.h.
4023 <w32_console_unicode_input>: New global variable.
4024 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4025 family of Windows, zero otherwise.
4026
4027 * w32inevt.h: Declare w32_console_unicode_input.
4028
df81cd29
EZ
4029 * xdisp.c (init_iterator): Don't reference tip_frame in a build
4030 --without-x. (Bug#11742)
4031
c20fdd9e
PE
40322012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4033
4034 Adjust GDB to reflect pvec_type changes (Bug#12036).
4035 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
4036 2012-07-04 changes to pseudovector representation.
4037 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 4038
32770973 40392012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
4040
4041 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4042 bus address.
4043 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4044
3438fe21
EZ
40452012-07-27 Eli Zaretskii <eliz@gnu.org>
4046
bcfbc9de
EZ
4047 * alloc.c (listn): Fix the order the arguments are consed onto the
4048 list.
4049
3438fe21
EZ
4050 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4051 enumeration constants, as PURE and HEAP are too general, and clash
4052 with other headers and sources, such as gmalloc.c and the
4053 MS-Windows system headers. All users changed.
4054
eeaea515
DA
40552012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4056
4057 Revert last save_excursion_save and save_excursion_restore changes.
4058 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4059 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4060
073c88c2
DA
40612012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4062
4063 Fix recently-introduced typos in Windows port.
4064 Reported by Martin Rudalics <rudalics@gmx.at>.
4065 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 4066 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 4067
4706125e
PE
40682012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4069
4070 Improve GDB symbol export (Bug#12036).
4071 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4072 arms of an 'if', not using conditional expressions; otherwise GDB
4073 complains about the types in the unevaluated arm when the argument
4074 is an integer literal.
4075 (xgetint): Simplify expression.
4076 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4077 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4078 Zaretskii in <http://bugs.gnu.org/12036#13>.
4079 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4080 needed now that we have gdb_make_enums_visible.
4081 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4082 (enum enum_USE_LSB_TAG):
4083 New enum types, packaging up enums that need to be exported to GDB.
4084
694b6c97
DA
40852012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4086
4087 Utility function to make a list from specified amount of objects.
4088 * lisp.h (enum constype): New datatype.
4089 (listn): New prototype.
4090 * alloc.c (listn): New function.
4091 (Fmemory_use_count, syms_of_alloc): Use it.
4092 * buffer.c (syms_of_buffer): Likewise.
4093 * callint.c (syms_of_callint): Likewise.
4094 * charset.c (define_charset_internal): Likewise.
4095 * coding.c (syms_of_coding): Likewise.
4096 * keymap.c (syms_of_keymap): Likewise.
4097 * search.c (syms_of_search): Likewise.
4098 * syntax.c (syms_of_syntax): Likewise.
4099 * w32.c (init_environment): Likewise.
4100 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4101 * xdisp.c (syms_of_xdisp): Likewise.
4102 * xfns.c (syms_of_xfns): Likewise.
4103
6195f384
DA
41042012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4105
4106 Fast save_excursion_save and save_excursion_restore.
4107 * lisp.h (struct Lisp_Excursion): New data type.
4108 (PVEC_EXCURSION): New pseudovector type.
4109 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
4110 to deal with it. Adjust comments.
4111 (init_marker, attach_marker): New prototype.
4112 (unchain_marker): Adjust prototype.
4113 * marker.c (attach_marker): Change to global.
4114 (init_marker): New function.
4115 * alloc.c (Fmake_marker, build_marker): Use it.
4116 (build_marker): More easserts.
4117 (mark_object): Handle struct Lisp_Excursion.
4118 * editfns.c (save_excursion_save, save_excursion_restore):
4119 Reimplement to use struct Lisp_Excursion. Add comments.
4120
5eceb8fb
PE
41212012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4122
4123 Fix export of symbols to GDB (Bug#12036).
4124 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
4125 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
4126 emacs.c, as this is a more-suitable home. Had this been done earlier
4127 the fix for 12036 would have avoided some of the problems noted in
4128 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
4129 would have been more obvious.
562157c8
PE
4130 * emacs.c: Do not include <verify.h>; no longer needed.
4131 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
4132 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
4133 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4134 Remove; now done in lisp.h.
4135 * lisp.h (PUBLISH_TO_GDB): New macro.
4136 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
4137 (DATA_SEG_BITS): Use it.
4138 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
4139 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
4140 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
4141 not be usable in #if. This simplifies things.
4142
d6749401
JB
41432012-07-26 Juanma Barranquero <lekktu@gmail.com>
4144
4145 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
4146
1781b9e9
PE
41472012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4148
d89518db 4149 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
4150 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
4151 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
4152 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
4153 Adjust to changes in lisp.h and emacs.c, by using
4154 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
4155 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
4156 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
4157 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
4158 instead of gdb_valbits.
4159 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
4160 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
4161 instead of gdb_array_mark_flag.
4162 (xboolvector): Get size from $->size, not $->header.size.
4163 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
4164 (xreload, hook-run, hookpost-run): Remove.
4165 * emacs.c: Include <verify.h>.
4166 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
4167 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
4168 Remove.
4169 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
4170 (gdb_USE_LSB_TAG): New enum constants.
4171 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4172 Also define these as enum constants, so they're visible to GDB.
4173 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4174 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4175 as constants, so they're visible to GDB.
4176 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4177 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4178 Now enum constants, not macros, so they're visible to GDB.
4179 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4180 more convenient now. All uses changed.
4181 (VALMASK) [USE_LSB_TAG]: Also define in this case.
4182 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4183
3628596a
DA
41842012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
4185
4186 Explicitly free restriction data that are not needed anymore.
4187 * editfns.c (save_restriction_restore): Free restriction data.
4188
7abaf5cc
SM
41892012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
4190
4191 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4192 add argument, tune behavior, and adjust all callers.
4193
71f88e00
PE
41942012-07-25 Paul Eggert <eggert@cs.ucla.edu>
4195
4196 Use typedef for EMACS_INT, EMACS_UINT.
4197 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4198 than macros. This simplifies debugging in the usual case, since
4199 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4200 and it allows expressions involving EMACS_INT casts.
4201 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4202
57ec3034
JD
42032012-07-25 Jan Djärv <jan.h.d@swipnet.se>
4204
4205 * nsterm.m (ns_read_socket): Return early if there is a modal
4206 window (Bug#12043).
4207
8137e7b3
MR
42082012-07-25 Martin Rudalics <rudalics@gmx.at>
4209
4210 * frame.c (Fredirect_frame_focus): In doc-string don't mention
4211 that FOCUS-FRAME can be omitted.
4212
04e9897c
DA
42132012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
4214
4215 Adjust buffer text indirection counters at the end of Fkill_buffer.
4216 * buffer.c (Fkill_buffer): Adjust indirection counters when the
4217 buffer is definitely dead. This should really fix an issue reported
4218 by Christoph Scholtes again. (Bug#12007).
4219 (init_buffer_once): Initialize indirection counters of
4220 buffer_defaults and buffer_local_symbols (for sanity and safety).
4221
8a0484e1
EZ
42222012-07-24 Eli Zaretskii <eliz@gnu.org>
4223
4224 * xdisp.c (init_iterator): Don't compute dimensions of truncation
4225 and continuation glyphs on tooltip frames, leave them at zero.
4226 Avoids continued lines in tooltips. (Bug#11832)
4227
fa691a83
DA
42282012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
4229
4230 Simplify copy_overlay.
04e9897c 4231 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
4232 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4233
436bc8e0
EZ
42342012-07-23 Eli Zaretskii <eliz@gnu.org>
4235
4236 * print.c (print_object): Don't crash when a frame's name is nil
4237 or invalid. (Bug#12025)
4238
4239 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4240 it signals an error when a tooltip frame is being created.
4241
d7a7fda3
DA
42422012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4243
4244 Cleanup miscellaneous objects allocation and initialization.
4245 * alloc.c (allocate_misc): Change to static. Add argument to
4246 specify the subtype. Adjust comment and users.
4247 (build_overlay): New function.
4248 * buffer.c (copy_overlays, Fmake_overlay): Use it.
4249 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4250 (allocate_misc): Remove prototype.
4251 (build_overlay): Add prototype.
4252
42532012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
4254
4255 Swap buffer text indirection counters in Fbuffer_swap_text.
4256 * buffer.c (Fbuffer_swap_text): Swap indirections too.
4257 This avoids crash reported by Christoph Scholtes at
4258 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4259
9d7fa573
JD
42602012-07-22 Jan Djärv <jan.h.d@swipnet.se>
4261
4262 * nsmenu.m (Popdown_data): New struct.
4263 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
4264 free Popdown_data.
4265 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
4266 (initWithContentRect): Make imgView and contentView non-static
4267 and autorelease them. Also autorelease img and matrix (Bug#12005).
4268 (dealloc): Remove (Bug#12005).
4269
0dd6d66d
DA
42702012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4271
4272 Adjust consing_since_gc when objects are explicitly freed.
4273 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
4274 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
4275 (free_cons, free_misc): Subtract object size from consing_since_gc.
4276
d36d71df
DA
42772012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4278
4279 Simplify and cleanup markers positioning code.
4280 * marker.c (attach_marker): More useful eassert.
4281 (live_buffer, set_marker_internal): New function.
4282 (Fset_marker, set_marker_restricted): Use set_marker_internal.
4283 (set_marker_both, set_marker_restricted_both): Use live_buffer.
4284
fb9ea40f
PE
42852012-07-22 Paul Eggert <eggert@cs.ucla.edu>
4286
4287 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
4288 as it's limited by the amount of memory, not by INT_MAX.
4289
2d5c5f7d
EZ
42902012-07-21 Eli Zaretskii <eliz@gnu.org>
4291
07fb592e
EZ
4292 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
4293 in special-event-map. See the discussion at
4294 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4295 for the reasons.
4296
37a9eac8 4297 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
4298 info.dwItemData. Fixes crashes on 64-bit Windows.
4299 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 4300
c4328746
JD
43012012-07-21 Jan Djärv <jan.h.d@swipnet.se>
4302
fc0c31f8 4303 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 4304 (conversationIdentifier): Return value is NSInteger.
784051c4 4305 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 4306
6e5d1c12
CY
43072012-07-21 Chong Yidong <cyd@gnu.org>
4308
4309 * window.c (decode_any_window): Signal an error if the window is
4310 on a dead frame (Bug#11984).
4311
9928463d
DA
43122012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4313
4314 Add indirection counting to speed up Fkill_buffer.
4315 * buffer.h (struct buffer): New member.
4316 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4317 (Fmake_indirect_buffer): Set indirection counter to -1, increment
4318 base buffer indirection counter.
4319 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4320 (Fkill_buffer): Adjust indirection counters as needed, don't walk
4321 through buffer list if indirection counter is 0.
4322
f8643a6b
DA
43232012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4324
4325 Extend the value returned by Fgarbage_collect with heap statistics.
4326 * alloc.c (Qheap): New symbol.
4327 (syms_of_alloc): DEFSYM it.
4328 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4329 (Fmemory_free): Remove.
4330 (syms_of_alloc): Don't defsubr it.
4331 * buffer.c (Fcompact_buffer): Remove.
4332 (syms_of_buffer): Don't defsubr it.
4333
dac616ff
DA
43342012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4335
4336 Make maybe_gc inline.
4337 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4338 * lisp.h (consing_since_gc, gc_relative_threshold)
4339 (memory_full_cons_threshold): Revert declaration.
4340 (maybe_gc): Remove prototype, define as inline.
4341 * alloc.c: Remove old commented-out code.
4342 (consing_since_gc, gc_relative_threshold)
4343 (memory_full_cons_threshold): Revert to global.
4344 (maybe_gc): Remove.
4345
d7ea76b4
DA
43462012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4347
4348 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4349 * lisp.h (build_unibyte_string): New function.
4350 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4351 * sysdep.c, w32fns.c, xfns.c: Use it.
4352 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4353 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4354 Adjust users accordingly.
4355 * font.h (font_open_by_name): Adjust prototype.
4356
765e61e3
DA
43572012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4358
4359 Cleanup calls to Fgarbage_collect.
4360 * lisp.h (maybe_gc): New prototype.
4361 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4362 Remove declarations.
4363 * alloc.c (maybe_gc): New function.
4364 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4365 Make them static.
4366 * bytecode.c (MAYBE_GC): Use maybe_gc.
4367 * eval.c (eval_sub, Ffuncall): Likewise.
4368 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4369 to avoid dependency from auto-save feature.
4370
52b852c7
PE
43712012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4372
4373 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4374 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4375 'for_each_per_buffer_object_at'.
4376 All uses changed. It's better to use upper-case for macros that
4377 cannot be implemented as functions, to give the reader a clue
4378 that they're special.
4379
5db81e33
SM
43802012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4381
4382 * alloc.c (Fgarbage_collect): Tweak docstring.
4383
5b835e1d
DA
43842012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4385
4386 Tweak the value returned from Fgarbage_collect again.
4387 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4388 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4389 Adjust documentation.
4390 (total_vector_bytes): Rename to total_vector_slots, adjust
4391 accounting.
4392 (total_free_vector_bytes): Rename to total_free_vector_slots,
4393 adjust accounting.
4394 (Qstring_bytes, Qvector_slots): New symbols.
4395 (syms_of_alloc): DEFSYM them.
4396
9cd47b72
DA
43972012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4398
4399 Buffer compaction primitive which may be used from Lisp.
4400 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4401 (syms_of_buffer): Register Fcompact_buffer.
4402 * alloc.c (Fgarbage_collect): Use compact_buffer.
4403 * buffer.h (compact_buffer): New prototype.
4404 (struct buffer_text): New member.
4405
d17337e5
DA
44062012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4407
4408 New macro to iterate over all buffers, miscellaneous cleanups.
4409 * lisp.h (all_buffers): Remove declaration.
4410 * buffer.h (all_buffers): Add declaration, with comment.
4411 (for_each_buffer): New macro.
4412 * alloc.c (Fgarbage_collect, mark_object): Use it.
4413 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4414 (init_buffer): Likewise.
4415 * data.c (Fset_default): Likewise.
4416 * coding.c (code_conversion_restore): Remove redundant check
4417 for dead buffer.
4418 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4419
60cfd278
AS
44202012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4421
4422 Fix bug that created negative-length intervals.
4423 * intervals.c (merge_interval_right, merge_interval_left):
4424 Do not zero out this interval if it is absorbed by its children,
4425 as this interval's total length doesn't change in that case. See
4426 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4427
d06714cb
PE
44282012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4429
83713154
PE
4430 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4431 when invoking (make-bool-vector N t) and N is a positive
4432 multiple of 8 -- the last 8 bits were mistakenly cleared.
4433
d06714cb
PE
4434 Remove some struct layout assumptions in bool vectors.
4435 * alloc.c (bool_header_size): New constant.
4436 (header_size, word_size): Move earlier, as they're now used earlier.
4437 Use 'word_size' in a few more places, where it's appropriate.
4438 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4439 padding before the data member of a bool vector.
4440 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4441 than doing the check by hand with an abort ().
4442
464d5a5e
SM
44432012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4444
5fbc0409
SM
4445 * eval.c (Fdefvar): Don't check constants since we only set the var if
4446 it's not yet defined anyway (bug#11904).
4447
464d5a5e
SM
4448 * lisp.h (last_undo_boundary): Declare new var.
4449 * keyboard.c (command_loop_1): Set it.
4450 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4451 were auto-added by the command loop (bug#11774).
4452
8dc2e44a
AS
44532012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4454
4455 * w32font.c (Qsymbol): Remove local definition.
4456 (syms_of_w32font): Don't DEFSYM it.
4457
169925ec
DA
44582012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4459
4460 Fix sweep_vectors to handle large bool vectors correctly.
4461 * alloc.c (sweep_vectors): Account total_vector_bytes for
4462 bool vectors larger than VBLOCK_BYTES_MAX.
4463
5fbfb018
CY
44642012-07-18 Chong Yidong <cyd@gnu.org>
4465
4466 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4467 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4468
3ab6e069
DA
44692012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4470
4471 Return more descriptive data from Fgarbage_collect.
4472 Suggested by Stefan Monnier in
4473 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4474 * alloc.c (bounded_number): New function.
4475 (total_buffers, total_vectors): New variable.
4476 (total_string_size): Rename to total_string_bytes, adjust users.
4477 (total_vector_size): Rename to total_vector_bytes, adjust users.
4478 (sweep_vectors): Account total_vectors and total_vector_bytes.
4479 (Fgarbage_collect): New return value. Adjust documentation.
4480 (gc_sweep): Account total_buffers.
4481 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4482 (VECTOR_SIZE): Remove.
4483 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4484 (Qinterval, Qmisc): New symbols.
4485 (syms_of_data): Initialize them.
4486 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4487 (Qcons, Qbuffer): New declarations.
4488
6d02fe5b
PE
44892012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4490
4491 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4492 Round up, not down. Improve doc.
4493
b7ffe040
DA
44942012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4495
4496 Restore old code in allocate_string_data to avoid Faset breakage.
4497 Reported by Julien Danjou <julien@danjou.info> in
4498 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4499 * alloc.c (allocate_string_data): Restore old code with minor
4500 adjustments, fix comment to explain this subtle issue.
4501
4dc7c8d5
SM
45022012-07-17 Eli Zaretskii <eliz@gnu.org>
4503
4504 Remove FILE_SYSTEM_CASE.
4505 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4506
4507 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4508 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4509 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4510 call-process-region passes it through expand-file-name.
4511
4512 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4513
45142012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4515
4516 Fix crash when creating indirect buffer (Bug#11917)
4517 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4518 Don't handle unbound variables specially if non-zero.
4519 (Fbuffer_local_variables): Pass zero.
4520 (clone_per_buffer_values): Pass non-zero.
4521
45222012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4523
4524 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4525 to make the loop interruptible.
4526
45272012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4528
4529 * gnutls.c (emacs_gnutls_handshake): Only retry if
4530 GNUTLS_E_INTERRUPTED.
4531
cce7fefc
DA
45322012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4533
4534 Cleanup and convert miscellaneous checks to eassert.
4535 * alloc.c (mark_interval): Fix comment, partially rephrase
4536 old comment from intervals.h (see below).
4537 * intervals.c (find_interval, adjust_intervals_for_insertion)
4538 (delete_interval, adjust_intervals_for_deletion)
4539 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4540 Convert to eassert.
4541 (adjust_intervals_for_insertion, make_new_interval):
4542 Remove obsolete and unused code.
4543 * intervals.h (struct interval): Remove obsolete comment.
4544 * textprotp.c (erase_properties): Remove unused code.
4545 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4546 (Fremove_list_of_text_properties): Convert to eassert.
4547
9ea10cc3
CY
45482012-07-17 Chong Yidong <cyd@gnu.org>
4549
4550 * editfns.c (Finsert_char): Doc fix.
4551
3900d5de
DA
45522012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4553
4554 Fix previous change to make Fmemory_free always accurate.
4555 * alloc.c (make_interval): Update total_free_intervals.
4556 (make_float): Likewise for total_free_floats.
4557 (free_cons, Fcons): Likewise for total_free_conses.
4558 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4559 Likewise for total_free_vector_bytes.
4560 (Fmake_symbol): Likewise for total_free_symbols.
4561 (bytes_free): Remove.
4562
7098646f
DA
45632012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4564
4565 Simple free memory accounting feature.
4566 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4567 (sweep_vectors): Accumulate size of free vectors.
4568 (Fgarbage_collect): Setup bytes_free.
4569 (Fmemory_free): New function.
4570 (syms_of_alloc): Register it.
4571
22657b40
DA
45722012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4573
4574 Cleanup overlays checking.
4575 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4576 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4577 eassert and OVERLAYP.
4578 (sort_overlays): Change to use OVERLAYP.
4579
ddfc8813
RK
45802012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4581
4582 * editfns.c (Finsert_char): Make it interactive, and make the
4583 second arg optional. Copy interactive spec and docstring from
4584 ucs-insert.
4585
7c26cf3c
PE
45862012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4587
4588 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4589 Unlike the other wrapped functions, fabs has an unspecified
4590 effect on errno.
4591
5d127af9
JD
45922012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4593
4594 * nsterm.m (keyDown): Interpret flags without left/right bits
4595 as the left key (Bug#11670).
4596
6a0dd1d7
DA
45972012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4598
4599 Remove empty and useless init functions.
4600 * lisp.h (init_character_once, init_fns, init_image)
4601 (init_filelock, init_sound): Remove prototype.
4602 * character.c (init_character_once): Remove.
4603 * filelock.c (init_filelock): Likewise.
4604 * fns.c (init_fns): Likewise.
4605 * image.c (init_image): Likewise.
4606 * sound.c (init_sound): Likewise.
4607 * emacs.c (main): Adjust accordingly.
4608
7a6136fd
DA
46092012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4610
4611 * gtkutil.h: Tiny cleanups.
4612 (use_old_gtk_file_dialog): Remove useless declaration.
4613 (xg_uses_old_file_dialog): Add suggested const attribute.
4614
ce811ad9
EZ
46152012-07-15 Eli Zaretskii <eliz@gnu.org>
4616
4617 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4618 (bidi_paragraph_init): Use it to limit search forward for a strong
4619 directional character in abnormally large paragraphs full of
4620 neutral or weak characters. (Bug#11943)
4621
c9adfeaa
SF
46222012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4623
4624 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4625 the toolbar (Bug#9451).
4626 (xg_make_tool_item): Give the widget event box a transparent
4627 background.
4628
fff62aa9
DA
46292012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4630
4631 Cleanup basic allocation variables and functions.
4632 * alloc.c (ignore_warnings, init_intervals, init_float)
4633 (init_cons, init_symbol, init_marker): Remove.
4634 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4635 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4636 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4637 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4638 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4639 (staticidx, init_alloc_once, init_strings, free_ablock):
4640 Remove redundant initialization.
4641 * fns.c (init_weak_hash_tables): Remove.
4642 * lisp.h (init_weak_hash_tables): Remove prototype.
4643
9730daca
DA
46442012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4645
4646 Use zero_vector where appropriate.
4647 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4648 accordingly.
4649 * lisp.h (zero_vector): New declaration.
4650 * font.c (null_vector): Remove.
4651 (syms_of_font): Remove initialization and staticpro.
4652 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4653 * keymap.c (Faccessible_keymaps): Likewise.
4654
2e2d2a13
LL
46552012-07-15 Leo Liu <sdl.web@gmail.com>
4656
4657 * fringe.c: Fix typo in comments.
4658
cd276f6e
LL
46592012-07-14 Leo Liu <sdl.web@gmail.com>
4660
4661 * fringe.c: Add a new bitmap exclamation-mark.
4662
5a1131d9
EZ
46632012-07-14 Eli Zaretskii <eliz@gnu.org>
4664
4665 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4666
4667 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4668 (HAVE_MENUS): Don't define, defined by editing config.in with
4669 msdos/sed2v2.inp.
4670 (GMALLOC_INHIBIT_VALLOC): Don't define.
4671 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4672
22e983b7
JB
46732012-07-14 Juanma Barranquero <lekktu@gmail.com>
4674
4675 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4676
5b3f250f
GM
46772012-07-14 Glenn Morris <rgm@gnu.org>
4678
4679 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4680 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4681 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4682
33d63ff4
GM
46832012-07-13 Glenn Morris <rgm@gnu.org>
4684
5b633342
GM
4685 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4686
33d63ff4
GM
4687 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4688 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4689
b55b9f85
JD
46902012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4691
0dc8cf50
JD
4692 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4693 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4694 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4695 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4696 where appropriate.
4697 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4698 as boolean expression.
4699 (x_set_window_size): Remove unused variable toolbar.
4700 (ns_get_color_default, ns_mod_to_lisp): Remove.
4701 (ns_mouse_position): Remove unused variables xchar and ychar.
4702 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4703 (ns_set_vertical_scroll_bar): Remove unused variable count.
4704 (ns_delete_terminal): Remove unused variable i.
4705 (ns_term_init): Remove unused variables r, g and b.
4706 (mouseDown): Remove unused variable window.
4707 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4708 (initFrameFromEmacs): Remove unused variable vbextra.
4709 (mouseEntered): Remove unused variables p and dpyinfo.
4710 (mouseExited): Remove unused variables p and r.
4711 (ns_define_frame_cursor, ns_clear_frame_area)
4712 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4713 (menuDown): Assign [sender tag] to variable and cast the variable.
4714
4715 * nsterm.h (menuDown): Add id as type to argument sender.
4716 (ns_display_info_for_name): Add Lisp_Object argument.
4717 (ns_term_init): Add Lisp_Object argument.
4718 (ns_map_event_to_object): Add void argument.
4719 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4720 prototype with arguments and only declare if __OBJC__.
4721 (nxatoms_of_nsselect): Add void argument.
4722 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4723 (ns_alloc_autorelease_pool): Add void argument.
4724 (ns_release_autorelease_pool): Add void* argument.
4725 (ns_get_defaults_value): Add const char* argument.
4726
4727 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4728 (initFromContents): Use SSDATA where appropriate.
4729 (ns_update_menubar): Add braces to ambigous if-else.
4730 (initWithTitle): Put () around assignment in if statement.
4731 (ns_menu_show): Remove unused variables window and keymap.
4732 (update_frame_tool_bar): Remove unused variable selected_p.
4733 (initWithContentRect): Remove unused variable this_cmd_name.
4734
4735 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4736 appropriate.
4737 (setXBMColor): Remove unused variable len.
4738 (setPixmapData): Put () around assignment in loop statement.
4739
4740 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4741 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4742 where appropriate.
4743 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4744 around assignment in loop statement.
4745 (nsfont_open): Remove unused variable i.
4746 (nsfont_open): Remove unused variable len.
4747 (nsfont_draw): Remove unused variable cs.
4748
4749 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4750 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4751 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4752 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4753 (Fns_font_name, Fns_perform_service)
4754 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4755 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4756 (ns_set_name): Remove unused variable view.
4757 (x_set_menu_bar_lines): Remove unused variable olines.
4758 (x_set_tool_bar_lines): Remove unused variable root_window.
4759 (Fns_list_colors): Put () around assignment in while statement.
4760 (Fns_perform_service): Remove unused variable len.
4761 (Fns_display_usable_bounds): Remove unused variable top.
4762 (syms_of_nsfns): Remove unused variable i.
4763
b55b9f85
JD
4764 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4765 memcpy (Bug#11907).
4766
ed9265fc 47672012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
4768
4769 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4770 and free it with DestroyExceptionInfo (Bug#11558).
4771
ef099b57
JB
47722012-07-13 Juanma Barranquero <lekktu@gmail.com>
4773
4774 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4775 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4776 Set here, not in nt/config.nt.
4777
ea814a5d
EZ
47782012-07-13 Eli Zaretskii <eliz@gnu.org>
4779
4780 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4781 cursor overflow into the last glyph on display line when the right
4782 fringe is off. (Bug#11832)
4783
1a952767
PE
47842012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4785
4786 * xdisp.c (produce_special_glyphs): Now static.
4787 * dispextern.h (produce_special_glyphs): Remove decl.
4788
983188fd
GM
47892012-07-13 Glenn Morris <rgm@gnu.org>
4790
8d7c7eed 4791 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
4792 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4793
983188fd
GM
4794 * s/usg5-4-common.h (USG, USG5):
4795 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4796 * s/sol2-6.h (SOLARIS2):
4797 * s/irix6-5.h (IRIX6_5):
4798 * s/hpux10-20.h (USG, USG5, HPUX):
4799 * s/gnu-linux.h (USG, GNU_LINUX):
4800 * s/freebsd.h (BSD_SYSTEM):
4801 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4802 * s/cygwin.h (CYGWIN):
4803 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4804 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4805
d1e68667 48062012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
4807
4808 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 4809
6de0e799
GM
48102012-07-13 Glenn Morris <rgm@gnu.org>
4811
739ae010
GM
4812 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4813
dbee5793
GM
4814 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4815
6de0e799
GM
4816 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4817 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4818
b82da769
GM
48192012-07-12 Glenn Morris <rgm@gnu.org>
4820
4fae5a7a 4821 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
4822
4823 * process.c (init_process_emacs): Rename from init_process.
4824 The old name is also the name of a Mach system call.
4825 * lisp.h, emacs.c: Update for this name change.
4826 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4827 longer needed.
4828
5a979817
EZ
48292012-07-12 Eli Zaretskii <eliz@gnu.org>
4830
4831 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4832 memmove call that removes glyphs covered by the left truncation
4833 glyph. Improve commentary.
4834 (display_line): Fix display of continuation glyphs on GUI frames
4835 when the right fringe is turned off and variable-size fonts are
4836 used in the window. Move the code that appends a stretch glyph to
4837 produce_special_glyphs, so that it could be used for truncation
4838 and continuation glyphs alike.
4839 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4840 glyph of a suitably computed width, to align the special glyphs at
4841 the window margin. Code moved from display_line. (Bug#11832)
4842
3e91a053
GM
48432012-07-12 Glenn Morris <rgm@gnu.org>
4844
ba9e4b84
GM
4845 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4846
4847 * s/gnu-linux.h, s/hpux10-20.h:
4848 Do not unconditionally define HAVE_XRMSETDATABASE.
4849
3e91a053
GM
4850 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4851
b300b1f4
PE
48522012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4853
4854 Fix typos that broke OS X build.
4855 Reported by Randal L. Schwartz in
4856 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4857 * nsterm.m (ns_timeout): Add missing local decl.
4858 (ns_get_color): snprintf -> sprintf, to fix typo.
4859
6e777848
GM
48602012-07-12 Glenn Morris <rgm@gnu.org>
4861
3f922c37
GM
4862 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4863 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4864 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4865 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4866
0ab7b23a
GM
4867 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4868 Move PTY_OPEN to configure.
4869
6e777848
GM
4870 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4871 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4872 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4873
4a7edc24
DA
48742012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4875
4876 Use empty_unibyte_string where applicable.
4877 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4878 * lread.c (read1): Likewise.
4879 * xsettings.c (syms_of_xsettings): Likewise.
4880
308aab79
GM
48812012-07-12 Glenn Morris <rgm@gnu.org>
4882
42bd1719
GM
4883 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4884 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
4885 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4886 * s/hpux10-20.h (RUN_TIME_REMAP):
4887 * s/bsd-common.h (TABDLY): Move to configure.
4888
4889 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4890
4891 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4892
ea0bbd17 4893 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 4894 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
4895
4896 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 4897
308aab79
GM
4898 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4899 * s/template.h: Move NARROWPROTO to configure.
4900
ee1cf5cf
GM
49012012-07-11 Glenn Morris <rgm@gnu.org>
4902
30fe9bf4
GM
4903 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4904 unused since 2011-01-17 change to systty.h.
4905
ee1cf5cf
GM
4906 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4907 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4908 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4909
63e47e07
PE
49102012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4911
4912 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4913
c43fb4c3
GM
49142012-07-11 Glenn Morris <rgm@gnu.org>
4915
4916 * s/darwin.h, s/gnu-linux.h, s/template.h:
4917 Move INTERRUPT_INPUT to configure.
4918
e8df9267
DA
49192012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4920
4921 Minor adjustments to interning code.
4922 * lisp.h (intern, intern_c_string): Redefine as static inline
4923 wrappers for intern_1 and intern_c_string_1, respectively.
4924 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
4925 * lread.c (intern_1, intern_c_string_1, oblookup):
4926 Simplify Vobarray checking.
e8df9267
DA
4927 * font.c (font_intern_prop): Likewise. Adjust comment.
4928 * w32font.c (intern_font_name): Likewise.
4929
34348bd4
AS
49302012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4931
d96a1e0c
AS
4932 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4933
34348bd4
AS
4934 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4935 of Fcar/Fcdr if possible.
4936 * font.c (check_otf_features): Likewise.
4937 * fontset.c (Fnew_fontset): Likewise.
4938 * gnutls.c (Fgnutls_boot): Likewise.
4939 * minibuf.c (read_minibuf): Likewise.
4940 * msdos.c (IT_set_frame_parameters): Likewise.
4941 * xmenu.c (Fx_popup_dialog): Likewise.
4942 * w32menu.c (Fx_popup_dialog): Likewise.
4943
c8add24e
GM
49442012-07-11 Glenn Morris <rgm@gnu.org>
4945
4b575b3c
GM
4946 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4947 since nothing has defined it on these platforms.
4948
09f4e3b0
GM
4949 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4950 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4951
172bedef
GM
4952 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4953 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4954 Move CLASH_DETECTION to configure.
4955
249685df
GM
4956 * s/gnu.h: Remove file, which is now empty.
4957
c8add24e
GM
4958 * s/gnu.h, s/gnu-linux.h:
4959 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4960
b41253a3
JW
49612012-07-11 John Wiegley <johnw@newartisans.com>
4962
4963 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4964 function attribute, so we only use it if it exists in the
4965 compiler.
4966
d923b542
DA
49672012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4968
4969 Avoid call to strlen in fast_c_string_match_ignore_case.
4970 * search.c (fast_c_string_match_ignore_case): Change to use
4971 length argument. Adjust users accordingly.
4972 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4973
5ebbef1d
PE
49742012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4975
bb352260
PE
4976 Assume mkdir, rmdir.
4977 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4978 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4979
57054ddd
PE
4980 Assume rename.
4981 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4982
b747d3f7
PE
4983 Assume perror.
4984 * s/hpux10-20.h (HAVE_PERROR): Remove.
4985 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4986 Remove dummy definition, as this problem was obsolete long ago.
4987
5ebbef1d
PE
4988 Assume strerror.
4989 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4990
984e7f30
DA
49912012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4992
4993 Avoid calls to strlen in font processing functions.
4994 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
4995 (font_open_by_name): Change to use length argument.
4996 Adjust users accordingly.
d923b542
DA
4997 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4998 Adjust prototypes.
4999 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5000 Change to return ptrdiff_t.
984e7f30
DA
5001 (xfont_list_pattern, xfont_match): Use length returned by
5002 xfont_decode_coding_xlfd.
5003 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5004
20e94fdd
GM
50052012-07-11 Glenn Morris <rgm@gnu.org>
5006
9d596af3
GM
5007 * s/darwin.h, s/freebsd.h, s/netbsd.h:
5008 Move DONT_REOPEN_PTY to configure.
5009
20e94fdd
GM
5010 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5011 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5012
e99a530f
PE
50132012-07-10 Paul Eggert <eggert@cs.ucla.edu>
5014
22ffb973
PE
5015 Remove "#define unix" that is no longer needed (Bug#11905).
5016 * s/aix4-2.h (unix): Remove; no longer needed.
5017
e9a9ae03
PE
5018 EMACS_TIME simplification (Bug#11875).
5019 This replaces macros (which typically do not work in GDB)
5020 with functions, typedefs and enums, making the code easier to debug.
5021 The functional style also makes code easier to read and maintain.
5022 * systime.h: Include <sys/time.h> on all hosts, not just if
5023 WINDOWSNT, since 'struct timeval' is needed in general.
5024 (EMACS_TIME): Now a typedef, not a macro.
5025 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5026 not macros.
5027 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
5028 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
5029 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
5030 (EMACS_TIME_LE): Now functions, not macros.
5031 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
5032 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
5033 which are not functions. All uses rewritten to use:
5034 (make_emacs_time): New function.
5035 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5036 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5037 not functions. All uses rewritten to use the following, respectively:
5038 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5039 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 5040 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
5041 * fileio.c (Fcopy_file):
5042 * xterm.c (XTflash): Get the current time closer to when it's used.
5043 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5044
ffacb126
PE
5045 * bytecode.c (targets): Suppress -Woverride-init warnings.
5046
e99a530f
PE
5047 Simplify by avoiding confusing use of strncpy etc.
5048 * doc.c (Fsnarf_documentation):
5049 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5050 * frame.c (Fmake_terminal_frame):
5051 * gtkutil.c (get_utf8_string):
5052 * lread.c (openp):
5053 * nsmenu.m (ns_update_menubar):
5054 * regex.c (regerror):
5055 Prefer memcpy to strncpy and strncat when either will do.
5056 * fileio.c (Fsubstitute_in_file_name):
5057 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5058 (menu_separator_name_p):
5059 * nsmenu.m (ns_update_menubar):
5060 Prefer memcmp to strncmp when either will do.
5061 * nsterm.m: Include <ftoastr.h>.
5062 (ns_get_color):
5063 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5064 Prefer snprintf to strncpy.
5065 * nsterm.m (ns_term_init):
5066 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5067 * nsterm.m (ns_term_init):
5068 Avoid the need for strncpy, by using build_string or
5069 make_unibyte_string directly. Use dtoastr, not snprintf.
5070 * process.c (Fmake_network_process): Diagnose service names that
5071 are too long, rather than silently truncating them or creating
5072 non-null-terminated names.
5073 (Fnetwork_interface_info): Likewise, for interface names.
5074 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5075 Prefer sprintf to strncat.
5076 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5077 Prefer vsnprintf to vsprintf + strncpy.
5078
c59592b3
GM
50792012-07-10 Glenn Morris <rgm@gnu.org>
5080
5081 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5082 Clarify fallback case.
5083
7d7bbefd
DA
50842012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5085
5086 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5087 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5088 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 5089 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
5090 where argument type is known to be a Lisp_Cons.
5091
3a4c8000
TT
50922012-07-10 Tom Tromey <tromey@redhat.com>
5093
5094 * bytecode.c (BYTE_CODE_THREADED): New macro.
5095 (BYTE_CODES): New macro. Replaces all old byte-code defines.
5096 (enum byte_code_op): New type.
5097 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5098 (exec_byte_code): Use them. Use token threading when applicable.
5099
2a0213a6
DA
51002012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5101
5102 Optimize pure C strings initialization.
5103 * lisp.h (make_pure_string): Fix prototype.
5104 (build_pure_c_string): New function, defined as static inline. This
5105 provides a better opportunity to optimize away calls to strlen when
5106 the function is called with compile-time constant argument.
5107 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
5108 argument, adjust users accordingly. Use build_pure_c_string where
5109 appropriate.
5110 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
5111 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
5112 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
5113
cb1caeaf
DA
51142012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5115
5116 Avoid calls to strlen in miscellaneous functions.
5117 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
5118 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
5119 * lread.c (openp): Likewise.
5120
c293e30c
DA
51212012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5122
5123 Avoid calls to strlen in path processing functions.
5124 * fileio.c (file_name_as_directory): Add comment. Change to add
5125 srclen argument and return the length of result. Adjust users
5126 accordingly.
5127 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
5128 swap 1st and 2nd arguments to obey the common convention.
5129 Adjust users accordingly.
c293e30c
DA
5130 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
5131
9e059e3f
GM
51322012-07-10 Glenn Morris <rgm@gnu.org>
5133
d02eb359
GM
5134 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
5135 Move PENDING_OUTPUT_COUNT definition to configure.
5136
882cf227
GM
5137 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
5138 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
5139 * s/gnu.h (DATA_START): Move definitions to configure.
5140
af6e839f
GM
5141 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
5142 We include usg5-4-common.h, which defines them both.
5143
40289a12
GM
5144 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
5145 O_RDONLY already includes it).
5146
9e059e3f
GM
5147 Stop ns builds setting the EMACSLOADPATH environment variable.
5148 * nsterm.m (ns_load_path): Rename from ns_init_paths.
5149 Now it does not set EMACSLOADPATH, just returns the load-path string.
5150 * nsterm.h: Update accordingly.
5151 * lread.c [HAVE_NS]: Include nsterm.h.
5152 (init_lread) [HAVE_NS]: Use ns_load_path.
5153 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
5154
7c4e8ec0
GM
51552012-07-09 Glenn Morris <rgm@gnu.org>
5156
d4f600ff
GM
5157 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
5158 since the included bsd-common.h does so.
5159
cbb31951
GM
5160 Stop ns builds setting the EMACSPATH environment variable.
5161 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
5162 (ns_init_paths): Do not set EMACSPATH.
5163 * nsterm.h (ns_exec_path): Add it.
5164 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
5165 Use ns_exec_path.
5166
7c4e8ec0
GM
5167 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
5168
26bccfae
PE
51692012-07-09 Paul Eggert <eggert@cs.ucla.edu>
5170
a0bee46f
PE
5171 * process.c (wait_reading_process_output): 'waitchannels' was unset
5172 when read_kbd || !NILP (wait_for_cell); fix this.
5173
5994c183
PE
5174 Add GCC-style 'const' attribute to functions that can use it.
5175 * character.h (char_resolve_modifier_mask):
5176 * keyboard.h (make_ctrl_char):
5177 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5178 (init_character_once, next_almost_prime, init_fns, init_image)
5179 (flush_pending_output, init_sound):
5180 * mem-limits.h (start_of_data):
5181 * menu.h (finish_menu_items):
5182 Add ATTRIBUTE_CONST.
5183 * emacs.c (DEFINE_DUMMY_FUNCTION):
5184 Declare the dummy function with ATTRIBUTE_CONST.
5185 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5186 Add decls with ATTRIBUTE_CONST.
5187
26bccfae
PE
5188 Minor improvements to make_formatted_string.
5189 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5190 where int is good enough, as vsprintf returns an int.
5191 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5192
a8290ec3
DA
51932012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5194
5195 Use make_formatted_string to avoid double length calculation.
5196 * lisp.h (make_formatted_string): New prototype.
5197 * alloc.c (make_formatted_string): New function.
5198 * buffer.c (Fgenerate_new_buffer_name): Use it.
5199 * dbus.c (syms_of_dbusbind): Likewise.
5200 * editfns.c (Fcurrent_time_zone): Likewise.
5201 * filelock.c (get_boot_time): Likewise.
5202 * frame.c (make_terminal_frame, set_term_frame_name)
5203 (x_report_frame_params): Likewise.
5204 * image.c (gs_load): Likewise.
5205 * minibuf.c (get_minibuffer): Likewise.
5206 * msdos.c (dos_set_window_size): Likewise.
5207 * process.c (make_process): Likewise.
5208 * xdisp.c (ensure_echo_area_buffers): Likewise.
5209 * xsettings.c (apply_xft_settings): Likewise.
5210
d01ba2f1
GM
52112012-07-09 Glenn Morris <rgm@gnu.org>
5212
5213 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5214 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5215 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5216 * nsterm.h (ns_etc_directory): Add it.
5217 * callproc.c [HAVE_NS]: Include nsterm.h.
5218 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5219
f1f924b6
DA
52202012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5221
5222 Move marker debugging code under MARKER_DEBUG.
5223 * marker.c (MARKER_DEBUG): Move marker debugging code under
5224 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5225 for bootstrap with --enable-checking (~3x slowdown reported
5226 by Juanma Barranquero <lekktu@gmail.com>).
5227 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5228
ab531b66
PE
52292012-07-08 Paul Eggert <eggert@cs.ucla.edu>
5230
5231 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5232 See <http://bugs.gnu.org/11825#29>.
5233
c4b3bc8a
EZ
52342012-07-08 Eli Zaretskii <eliz@gnu.org>
5235
5236 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5237 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
5238 (display_line): Add commentary about displaying truncation glyphs
5239 on GUI frames.
5240 (produce_special_glyphs): Move here from term.c.
5241
5242 * term.c (produce_special_glyphs): Move to xdisp.c.
5243
5244 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5245 section.
c4b3bc8a 5246
b676b881
AS
52472012-07-07 Andreas Schwab <schwab@linux-m68k.org>
5248
f17c5273
AS
5249 * xdisp.c (display_line): Avoid warning about implicit declaration
5250 of FRAME_FONT.
5251
298819b9
AS
5252 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5253
b676b881
AS
5254 * lisp.h: Remove empty conditional.
5255
6045c4fd
PE
52562012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5257
b3350bf9
PE
5258 * lread.c (load_path_check): Now static.
5259
6045c4fd
PE
5260 Fix some minor --with-ns problems found by static checking.
5261 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
5262 (x_set_font) [!HAVE_X_WINDOWS]:
5263 * image.c (xpm_load_image) [HAVE_NS]:
5264 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
5265 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
5266 Remove unused local.
5267 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
5268 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
5269 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
5270 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
5271 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
5272 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
5273 Fix pointer signedness problem.
5274 * xfaces.c (FRAME_X_FONT_TABLE):
5275 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
5276
929e7845
GM
52772012-07-07 Glenn Morris <rgm@gnu.org>
5278
5279 * lread.c (load_path_check): New function, split from init_lread.
5280 (init_lread): Reorganize. Motivation:
5281 If EMACSLOADPATH is set, check/warn about that rather than the
5282 defaults, which we are not going to use. Hence we can remove
5283 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
5284 Don't warn if site-lisp directories are missing.
5285 If not installed, start from a blank load-path, since
5286 PATH_LOADSEARCH refers to the eventual installation directories.
5287
58dd0aa4
EZ
52882012-07-07 Eli Zaretskii <eliz@gnu.org>
5289
5290 Support truncation and continuation glyphs on GUI frames, when
5291 fringes are disabled. (Bug#11832)
5292 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
5293 continuation glyphs even if on GUI frames.
5294 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
5295 or both, are absent.
5296 (start_display, move_it_in_display_line_to): Handle the case of a
5297 GUI frame without a fringe to display continuation or truncation
5298 glyphs.
5299 (insert_left_trunc_glyphs): Support GUI frames: make sure
5300 truncation glyphs overwrite enough glyphs from the current line to
5301 have sufficient space in pixels.
5302 (display_line): Support truncation and continuation glyphs on GUI
5303 frames. If some spare pixels are left on the line after inserting
5304 the truncation glyphs, fill that space with a stretch glyph of a
5305 suitably computed width.
5306
5307 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5308 produce_glyphs, to support GUI sessions.
5309
31571fd7
PE
53102012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5311
5a16b9bc
PE
5312 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5313
f3047c75
PE
5314 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5315
31571fd7
PE
5316 Do not require float-time's arg to fit in time_t (Bug#11825).
5317 This works better on hosts where time_t is unsigned, and where
5318 float-time is applied to the (negative) difference between two times.
5319 * editfns.c (decode_time_components): Last arg is now double *,
5320 not int *, and means to store all the result as a double, without
5321 worrying about whether the seconds part fits in time_t.
5322 All callers changed.
5323 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5324 All callers changed.
5325 (Ffloat_time): Do not fail merely because the specified time falls
5326 outside of time_t range.
5327
4516fbef
GM
53282012-07-07 Glenn Morris <rgm@gnu.org>
5329
5330 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5331 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5332 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5333
07adc2c6
JB
53342012-07-07 Juanma Barranquero <lekktu@gmail.com>
5335
5336 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5337 Update dependencies.
5338
5339 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5340
fd573f31
PE
53412012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5342
fee5959d
PE
5343 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5344 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5345 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5346 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5347 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5348 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5349
fd573f31
PE
5350 * xfont.c (compare_font_names): Redo to omit the need for casts.
5351
ddadbc0e
AS
53522012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5353
fca8d6b6
AS
5354 * xfns.c (Fx_change_window_property): Doc fix.
5355 * w32fns.c (Fx_change_window_property): Doc fix.
5356
ddadbc0e
AS
5357 * w32fns.c (Fx_window_property): Accept the same arguments as the
5358 X Windows version. Doc fix.
5359 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5360
ed9265fc 53612012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
5362 Eli Zaretskii <eliz@gnu.org>
5363
5364 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5365 Windows-specific code from nt/config.nt moved here.
5366 Obsolete settings removed.
5367
216ee680
PE
53682012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5369
5370 * process.c: Avoid unnecessary calls to gettime.
5371 (wait_reading_process_output): Don't get the time of day
5372 when gobbling data immediately and not waiting, as there's no need
5373 for it in that case. This removes a FIXME.
5374
bdd091e4
JD
53752012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5376
5377 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5378 is defined (Bug#11768).
5379
9d44f8ce
DA
53802012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5381
5382 Fix marker debugging code.
5383 * marker.c (byte_char_debug_check): Do not perform the check
5384 if buffer is not multibyte.
090bd7cb
JB
5385 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5386 Call byte_char_debug_check with correct arguments.
9d44f8ce 5387
90fc4786
DA
53882012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5389
5390 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
5391 * marker.c (byte_char_debug_check, count_markers):
5392 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
5393 (byte_debug_flag): Remove.
5394 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5395 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5396
7b7ae965
DA
53972012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5398
4e57b342
DA
5399 Avoid code repetition in marker-related functions.
5400 * marker.c (attach_marker): New function.
5401 (Fset_marker, set_marker_restricted, set_marker_both)
5402 (set_marker_restricted_both): Use it.
5403 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5404 Consistently rename charno to charpos.
5405 (marker_position): Add eassert.
5406 (marker_byte_position): Convert to eassert.
5407
54082012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5409
5410 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 5411 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 5412 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 5413
657924ff
DA
54142012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5415
5416 Introduce fast path for the widely used marker operation.
5417 * alloc.c (build_marker): New function.
5418 * lisp.h (build_marker): New prototype.
5419 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5420 * composite.c (autocmp_chars): Likewise.
5421 * editfns.c (buildmark): Remove.
5422 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5423 (save_restriction_save): Use build_marker.
5424 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5425 * window.c (save_window_save): Likewise.
5426
041a49a6
DA
54272012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5428
5429 Do not use Fdelete_overlay in delete_all_overlays
5430 to avoid redundant calls to unchain_overlay.
5431 * buffer.c (drop_overlay): New function.
5432 (delete_all_overlays, Fdelete_overlay): Use it.
5433 * minibuf.c (get_minibuffer): Fix comment.
5434
7dca65a4
PE
54352012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5436
5437 Port to OpenBSD 5.1 amd64.
5438 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5439 This is needed for OpenBSD, and should be harmless on all BSD systems.
5440 Also, include <sys/sysctl.h>, as it should be available on all
5441 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5442 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5443 use p_pid member, not kp_proc.pid.
5444
8eb876e2
GM
54452012-07-06 Glenn Morris <rgm@gnu.org>
5446
5447 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5448
38182d90
PE
54492012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5450
5451 More xmalloc and related cleanup.
5452 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5453 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5454 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5455 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5456 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5457 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5458 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5459 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5460 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5461 * xterm.c:
5462 Omit needless casts involving void * pointers and allocation.
5463 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5464 as the former is more robust if P's type is changed.
5465 Prefer xzalloc to xmalloc + memset 0.
5466 Simplify malloc-or-realloc to realloc.
5467 Don't worry about xmalloc returning a null pointer.
5468 Prefer xstrdup to xmalloc + strcpy.
5469 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5470 growing it.
5471 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5472 alloca of a constant.
5473
6dd5a677
EZ
54742012-07-05 Eli Zaretskii <eliz@gnu.org>
5475
5476 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5477 hscroll is larger than the line width. Fixes long and futile
5478 looping inside extend_face_to_end_of_line (on a TTY) producing
5479 glyphs that are not needed and thrown away.
5480
6b312f0f
DA
54812012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5482
5483 * marker.c (set_marker_restricted_both): Simplify by using
5484 clip_to_bounds.
5485
f520ef9b
PE
54862012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5487
5488 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5489
383b7c95
JD
54902012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5491
5492 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5493 not defined (Bug#11768).
5494 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5495 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5496 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5497 followed by gtk_box_set_homogeneous (Bug#11768).
5498 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
5499 (update_theme_scrollbar_width, xg_create_scroll_bar):
5500 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
5501 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5502 (is_box_type): New function (Bug#11768).
5503 (xg_tool_item_stale_p): Call is_box_type.
5293d758 5504 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
5505 with default display (Bug#11768).
5506
d6e7bf45
EZ
55072012-07-05 Eli Zaretskii <eliz@gnu.org>
5508
5509 * xdisp.c (window_hscroll_limited): New function.
5510 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5511 coordinates when window's hscroll is set to insanely large
5512 values. (Bug#11857)
5513
431391ec
JB
55142012-07-05 Juanma Barranquero <lekktu@gmail.com>
5515
5516 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5517 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5518
23f86fce
DA
55192012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5520
5521 Cleanup xmalloc.
5522 * lisp.h (xzalloc): New prototype. Omit needless casts.
5523 * alloc.c (xzalloc): New function. Omit needless casts.
5524 * charset.c: Omit needless casts. Convert all calls to
5525 xmalloc with following memset to xzalloc.
5526 * dispnew.c: Likewise.
5527 * fringe.c: Likewise.
5528 * image.c: Likewise.
5529 * sound.c: Likewise.
5530 * term.c: Likewise.
5531 * w32fns.c: Likewise.
5532 * w32font.c: Likewise.
5533 * w32term.c: Likewise.
5534 * xfaces.c: Likewise.
5535 * xfns.c: Likewise.
5536 * xterm.c: Likewise.
5537 * atimer.c: Omit needless casts.
5538 * buffer.c: Likewise.
5539 * callproc.c: Likewise.
5540 * ccl.c: Likewise.
5541 * coding.c: Likewise.
5542 * composite.c: Likewise.
5543 * doc.c: Likewise.
5544 * doprnt.c: Likewise.
5545 * editfns.c: Likewise.
5546 * emacs.c: Likewise.
5547 * eval.c: Likewise.
5548 * filelock.c: Likewise.
5549 * fns.c: Likewise.
5550 * gtkutil.c: Likewise.
5551 * keyboard.c: Likewise.
5552 * lisp.h: Likewise.
5553 * lread.c: Likewise.
5554 * minibuf.c: Likewise.
5555 * msdos.c: Likewise.
5556 * print.c: Likewise.
5557 * process.c: Likewise.
5558 * region-cache.c: Likewise.
5559 * search.c: Likewise.
5560 * sysdep.c: Likewise.
5561 * termcap.c: Likewise.
5562 * terminal.c: Likewise.
5563 * tparam.c: Likewise.
5564 * w16select.c: Likewise.
5565 * w32.c: Likewise.
5566 * w32reg.c: Likewise.
5567 * w32select.c: Likewise.
5568 * w32uniscribe.c: Likewise.
5569 * widget.c: Likewise.
5570 * xdisp.c: Likewise.
5571 * xmenu.c: Likewise.
5572 * xrdb.c: Likewise.
5573 * xselect.c: Likewise.
5574
0497dc44
PE
55752012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5576
5577 * fileio.c (time_error_value): Check the right error number.
5578 Problem reported by Troels Nielsen in
5579 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5580
356e7178
PE
55812012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5582
4e71fd89
PE
5583 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5584 This should be fixed in a better way; see Eli Zaretskii in
5585 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5586 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5587
f0941253
PE
5588 * fileio.c (time_error_value): Rename from special_mtime.
5589 The old name's problems were noted by Eli Zaretskii in
5590 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5591
065c9eb4
PE
5592 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5593 This variable's comment says Emacs needs at least one GDB-visible
5594 symbol of type enum pvec_type, to work around GDB problems.
5595 The symbol's value doesn't matter.
5596
356e7178
PE
5597 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5598 that causes compilation to fail on pre-C99 compilers.
5599
ed9265fc 56002012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
5601
5602 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5603 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5604
3884d954
DA
56052012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5606
d209e2fb 5607 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
5608 headers for buffer_defaults and buffer_local_symbols.
5609 Reported by Juanma Barranquero <lekktu@gmail.com>.
5610
ee28be33
SM
56112012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5612
5613 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5614 * lisp.h (enum pvec_type): Use fewer bits.
5615 (PSEUDOVECTOR_SIZE_BITS): New constant.
5616 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5617 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5618 change in pvec_type.
5619 (PSEUDOVECTOR_TYPEP): New macro.
5620 (TYPED_PSEUDOVECTORP): Use it.
5621 * fns.c (internal_equal): Adapt code to extract pvectype.
5622 * emacs.c (gdb_pvec_type): Update type.
5623 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5624 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5625 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5626 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5627 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5628 abusing vector->header.next.nbytes.
5629 (live_vector_p): Use PVEC_TYPE.
5630 (mark_object): Adapt code to extract pvectype. Use switch.
5631
c7f2cd7f
PE
56322012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5633
5634 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5635 Tighten new eassert a bit.
5636
8ce70ed2
DA
56372012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5638
5639 Fix compilation with --enable-gcc-warnings and -O1
5640 optimization level.
5641 * doprnt.c (doprnt): Change type of tem to int, initialize
5642 to avoid compiler warning. Add eassert.
5643 * search.c (simple_search): Initialize match_byte to avoid
5644 compiler warning. Add eassert.
5645
dea7f1e5
PE
56462012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5647
24a212eb
PE
5648 Avoid weird behavior with large horizontal scrolls.
5649 Without this change, for example, large hscroll values would
5650 mess up Emacs's display on Fedora 15 x86, presumably due to
5651 overflows in int calculations in the display code.
5652 Also, if buffers had long lines, Emacs would freeze.
5653 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5654 (set_window_hscroll): New function, containing the old guts of
5655 Fset_window_hscroll. Return the clipped value.
5656 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5657 This avoids the need to check against PTRDIFF_MAX.
5658
dea7f1e5
PE
5659 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5660
76046526
DA
56612012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5662
5663 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5664
39adff0d
PE
56652012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5666
63807d47
PE
5667 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5668 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5669 since GCC 4.4.6 issues a bogus warning for them.
5670
39adff0d
PE
5671 Fix bugs in file timestamp newness comparisons.
5672 * fileio.c (Ffile_newer_than_file_p):
5673 * lread.c (Fload): Use full timestamp resolution of files,
5674 not just the 1-second resolution, so that files that are only
5675 slightly newer still count as newer.
5676 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5677 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5678
dbeed9a6
PE
56792012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5680
5681 * fileio.c: Improve handling of file time marker. (Bug#11852)
5682 (special_mtime): New function.
5683 (Finsert_file_contents, Fverify_visited_file_modtime):
5684 Use it to set special mtime values consistently.
5685
636334d6
AS
56862012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5687
5688 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5689 marker for non-existing file. (Bug#11852)
5690
e2017fe2
GM
56912012-07-03 Glenn Morris <rgm@gnu.org>
5692
5693 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5694 and did not make it into globals.h).
5695
404dbd37
TT
56962012-07-03 Tom Tromey <tromey@redhat.com>
5697
5698 * window.c (Fset_window_margins, Fset_window_fringes)
5699 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5700 * textprop.c (Fprevious_property_change): No longer static.
5701 * syntax.c (Fsyntax_table_p): No longer static.
5702 * process.c (Fget_process, Fprocess_datagram_address): No longer
5703 static.
5704 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5705 * keyboard.c (Fcommand_execute): No longer static.
5706 Remove EXFUN.
5707 * insdel.c (Fcombine_after_change_execute): No longer static.
5708 * image.c (Finit_image_library): No longer static.
5709 * fileio.c (Fmake_symbolic_link): No longer static.
5710 * eval.c (Ffetch_bytecode): No longer static.
5711 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
5712 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5713 No longer static.
404dbd37
TT
5714 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5715 static.
5716 * dired.c (Ffile_attributes): No longer static.
5717 * composite.c (Fcomposition_get_gstring): No longer static.
5718 * callproc.c (Fgetenv_internal): No longer static.
5719
5720 * ccl.h: Remove EXFUNs.
5721 * buffer.h: Remove EXFUNs.
5722 * dispextern.h: Remove EXFUNs.
5723 * intervals.h: Remove EXFUNs.
5724 * fontset.h: Remove EXFUN.
5725 * font.h: Remove EXFUNs.
5726 * dosfns.c (system_process_attributes): Remove EXFUN.
5727 * keymap.h: Remove EXFUNs.
5728 * lisp.h: Remove EXFUNs.
5729 * w32term.h: Remove EXFUNs.
5730 * window.h: Remove EXFUNs.
5731 * xsettings.h: Remove EXFUN.
5732 * xterm.h: Remove EXFUN.
5733
8e4fd1e1
GM
57342012-07-03 Glenn Morris <rgm@gnu.org>
5735
5736 * lisp.h (Frandom): Make it visible to C.
5737 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5738 buffer for invisible buffers. (Bug#1229)
5739
ca95b3eb
DA
57402012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5741
5742 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5743 values which aren't power of 2.
14ae4239
BT
5744 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5745 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
5746 accordingly.
5747
7555c33f
SM
57482012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5749
5750 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5751
5752 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5753
d12e8f5a
DA
57542012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5755
5756 * alloc.c (allocate_vector_block): Remove redundant
5757 calls to mallopt if DOUG_LEA_MALLOC is defined.
5758 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5759 avoid calls to mallopt if zero_vector is returned.
5760
296094c3
DA
57612012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5762
5763 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5764 is enabled, avoid dereferencing NULL current_sblock if
5765 running undumped.
5766
36429c89
DA
57672012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5768
5769 Cleanup basic buffer management.
5770 * buffer.h (struct buffer): Change layout to use generic vector
5771 marking code. Fix some comments. Change type of 'clip_changed'
5772 to bitfield. Remove unused #ifndef old.
5773 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5774 (GET_OVERLAYS_AT): Fix indentation.
5775 (for_each_per_buffer_object_at): New macro.
5776 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5777 (Fbuffer_local_variables): Use it.
5778 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5779 * alloc.c (allocate_buffer): Adjust to match new layout of
5780 struct buffer. Fix comment.
5781 (mark_overlay): New function.
5782 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5783 Lisp area of struct buffer.
5784 (mark_object): Use it. Adjust marking of misc objects
5785 and related comments.
5786
3b3e4cac
PE
57872012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5788
5789 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5790 wrapper that is not needed because the wrapped code is a no-op (zero
5791 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5792 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5793
cf5c0175
DA
57942012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5795
5796 * alloc.c (mark_buffer): Simplify. Remove prototype.
5797 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 5798 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
5799 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5800 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 5801
ca26824c
GM
58022012-06-30 Glenn Morris <rgm@gnu.org>
5803
2e4c5312
GM
5804 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5805
ca26824c
GM
5806 * epaths.in (PATH_SITELOADSEARCH): New.
5807 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5808 This is rather than relying on --enable-locallisppath elements
5809 having "site-lisp" in their names. (Bug#10208#25, 11658)
5810
0d23c240
EZ
58112012-06-30 Eli Zaretskii <eliz@gnu.org>
5812
c9240d7a
EZ
5813 * w32proc.c (sys_select): Accept and ignore one more argument.
5814
5815 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5816
0d23c240 5817 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 5818 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
5819
5820 * sysdep.c: Don't include dos.h and dosfns.h.
5821
5822 * process.c (sys_select):
5823 * msdos.c (sys_select): Accept one more argument and ignore it.
5824
5825 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5826 adapt data types and code to that.
5827
5828 * dosfns.c:
5829 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5830 which clashes with the gnulib function of the same name.
5831
af5a5a98
AS
58322012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5833
c5e4379c
AS
5834 * font.c (font_style_to_value, font_style_symbolic)
5835 (font_prop_validate_style): Add type checks for values in
5836 font_style_table.
5837
af5a5a98
AS
5838 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5839 argument.
5840 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5841 uses.
5842
8d38f461
EZ
58432012-06-29 Eli Zaretskii <eliz@gnu.org>
5844
2e5a6631
EZ
5845 * xdisp.c (try_window_id): Undo last change.
5846
8d38f461
EZ
5847 * w32.c (getwd): Adjust commentary about startup_dir.
5848 (init_environment): Always call sys_access, even in non-MSVC
5849 builds. Don't chdir to the directory of the Emacs executable.
5850 This undoes code from 1997 which was justified by the need to
5851 "avoid conflicts when removing and renaming directories". But its
5852 downside was that every relative file name was being interpreted
5853 relative to the directory of the Emacs executable, which can never
5854 be TRT. In particular, it broke sys_access when called with
5855 relative file names.
5856 (sys_access): Map GetLastError to errno.
5857
2af3565e
DA
58582012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5859
5860 * window.h (struct window): Change type of 'fringes_outside_margins'
5861 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 5862 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
5863 Adjust comment.
5864 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5865 to ptrdiff_t.
5866
c8d3a25c 58672012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 5868
c8d3a25c
GM
5869 * gnutls.c (emacs_gnutls_handshake):
5870 Add QUIT to make the loop interruptible.
57570cd3 5871
c8d3a25c 58722012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 5873
c8d3a25c
GM
5874 * charset.c (init_charset): Make lack of etc/charsets fatal.
5875
3e984ee8
DA
58762012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5877
5878 * editfns.c (region_limit): Fix type mismatch.
5879
ef884f23
DA
58802012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5881
5882 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5883 undefined. Convert from xassert to eassert.
5884 * nsmenu.m: Convert from xassert to eassert.
5885 * nsterm.m: Likewise.
5886
7d7e0027
SM
58872012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5888
5889 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5890
aa754e6a
PE
58912012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5892
5893 Avoid integer overflow on scroll-left and scroll-right.
5894 * window.c (HSCROLL_MAX): New macro.
5895 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5896 overflow when requested scroll falls outside ptrdiff_t range.
5897
80b00b08
DA
58982012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5899
5900 * window.h (struct window): Change type of 'hscroll',
5901 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5902 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5903 Adjust users accordingly.
5904 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5905 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5906 from EMACS_INT to ptrdiff_t.
5907 (make_window): Omit redundant initialization.
5908
62b2bcf6
JB
59092012-06-28 Juanma Barranquero <lekktu@gmail.com>
5910
5911 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5912
45942c7d
DA
59132012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5914
5915 * window.h (struct window): Change type of 'use_time' and
5916 'sequence_number' from Lisp_Object to int.
5917 * frame.c (make_frame): Adjust users accordingly.
5918 * print.c (print_object): Likewise.
5919 * window.c (select_window, Fwindow_use_time, make_parent_window)
5920 (make_window): Likewise.
5921
e509cfa6
DA
59222012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5923
5924 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5925 enabled with --enable-checking=[all,glyphs] configure option.
5926 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5927 adjust comments accordingly.
5928 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5929 undefined, adjust comments accordingly.
5930 * image.c: Likewise.
5931 * scroll.c: Likewise.
5932 * w32fns.c: Likewise.
5933 * w32term.c: Likewise.
5934 * xdisp.c: Likewise.
5935 * xfaces.c: Likewise.
5936 * xfns.c: Likewise.
5937 * xterm.c: Likewise.
5938
a54e2c05
DA
59392012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5940
5941 Generalize run-time debugging checks.
5942 * dispextern.h (XASSERTS): Remove.
5943 * fontset.c (xassert): Remove.
5944 Convert from xassert to eassert.
5945 * alloc.c: Convert from xassert to eassert.
5946 * bidi.c: Likewise.
5947 * dispnew.c: Likewise.
5948 * fns.c: Likewise.
5949 * fringe.c: Likewise.
5950 * ftfont.c: Likewise.
5951 * gtkutil.c: Likewise.
5952 * image.c: Likewise.
5953 * keyboard.c: Likewise.
5954 * menu.c: Likewise.
5955 * process.c: Likewise.
5956 * scroll.c: Likewise.
5957 * sound.c: Likewise.
5958 * term.c: Likewise.
5959 * w32console.c: Likewise.
5960 * w32fns.c: Likewise.
5961 * w32term.c: Likewise.
5962 * window.c: Likewise.
5963 * xdisp.c: Likewise.
5964 * xfaces.c: Likewise.
5965 * xfns.c: Likewise.
5966 * xselect.c: Likewise.
5967 * xterm.c: Likewise.
5968
1ec4b7b2
SM
59692012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5970
5971 * fns.c (maybe_resize_hash_table): Output message when growing the
5972 purify-hashtable.
5973
2014308a
DA
59742012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5975
5976 * alloc.c (allocate_string_data): Remove dead code.
5977 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5978 avoid GCC warning about unused macro.
5979
246155eb
DA
59802012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5981
5982 * alloc.c (allocate_string): Omit intervals initialization.
5983 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5984 as in make_pure_string and make_pure_c_string.
5985
43184b7b
DA
59862012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5987
d209e2fb 5988 * alloc.c (allocate_string): Fix last change.
43184b7b 5989
3fe6dd74
DA
59902012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5991
d209e2fb 5992 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
5993 to memset, add explicit initialization where appropriate.
5994
1ba6038a
GM
59952012-06-27 Glenn Morris <rgm@gnu.org>
5996
5997 * lisp.mk (lisp): Remove paths.elc.
5998
c89926a5
CY
59992012-06-27 Chong Yidong <cyd@gnu.org>
6000
6001 * doc.c (Fsubstitute_command_keys): Fix punctuation.
6002
ed6b3510
JW
60032012-06-26 John Wiegley <johnw@newartisans.com>
6004
1ec4b7b2 6005 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
6006 on Mac OS X Lion: __mod_init_func and __mod_term_func.
6007
ed6b3510
JW
6008 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6009 when building with Clang.
6010
8edd4a2b
SM
60112012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
6012
6013 * eval.c (Fapply): Allow calling it with a single argument.
6014
f6f62d1b
EZ
60152012-06-26 Eli Zaretskii <eliz@gnu.org>
6016
6017 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6018 _stricmp and _strnicmp.
6019 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6020
62efea5e
DA
60212012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6022
6023 * alloc.c (allocate_window): Zero out non-Lisp part of newly
6024 allocated window.
6025 (allocate_process): Likewise for new process.
8edd4a2b 6026 (allocate_terminal): Change to use offsetof.
62efea5e
DA
6027 (allocate_frame): Likewise.
6028 * frame.c (make_frame): Omit redundant initialization.
6029 * window.c (make_parent_window): Use memset.
6030 (make_window): Omit redundant initialization.
6031 * process.c (make_process): Omit redundant initialization.
6032 * terminal.c (create_terminal): Likewise.
6033
42997f4d
DA
60342012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6035
6036 * term.c (delete_tty): Remove redundant call to memset.
6037
1130ecfc
DA
60382012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6039
6040 * alloc.c: Remove build_string.
6041 * lisp.h: Define build_string as static inline. This provides
6042 a better opportunity to optimize away calls to strlen when the
6043 function is called with compile-time constant argument.
6044 * image.c (imagemagick_error): Convert to build_string.
6045 * w32proc.c (sys_spawnve): Likewise.
6046 * xterm.c (x_term_init): Likewise.
6047
cf38a720
PE
60482012-06-26 Paul Eggert <eggert@cs.ucla.edu>
6049
99027bdd
PE
6050 Use sprintf return value instead of invoking strlen on result.
6051 In the old days this wasn't portable, since some sprintf
6052 implementations returned char *. But they died out years ago and
6053 Emacs already assumes sprintf returns int.
6054 Similarly for float_to_string.
6055 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6056 * ccl.c (ccl_driver):
6057 * character.c (string_escape_byte8):
6058 * data.c (Fnumber_to_string):
6059 * doprnt.c (doprnt):
6060 * print.c (print_object):
6061 * xdisp.c (message_dolog):
6062 * xfns.c (syms_of_xfns):
6063 Use sprintf or float_to_string result to avoid need to call strlen.
6064 * data.c (Fnumber_to_string):
6065 Use make_unibyte_string, since the string must be ASCII.
6066 * lisp.h, print.c (float_to_string): Now returns int length.
6067 * term.c (produce_glyphless_glyph):
6068 Use sprintf result rather than recomputing it.
6069
cf38a720
PE
6070 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6071 * Makefile.in (ALL_CFLAGS):
6072 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6073 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6074
3511c784
DA
60752012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6076
0a08eb21 6077 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
6078 strcasecmp if available.
6079 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6080
fb7da12e
AS
60812012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6082
6083 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6084 Avoid comma operator.
6085 * menu.c (push_submenu_start, push_submenu_end)
6086 (push_left_right_boundary, push_menu_pane): Likewise.
6087 * msdos.c (dos_rawgetc): Likewise.
6088
afa2ffd8
DA
60892012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6090
6091 * xfns.c (xic_create_fontsetname): Remove redundant calls
6092 to memset.
6093
b3b4476b
PE
60942012-06-25 Paul Eggert <eggert@cs.ucla.edu>
6095
4495ff38
PE
6096 * gtkutil.c (get_utf8_string): Remove redundant assignment.
6097 sprintf already null-terminates its output.
6098
b3b4476b
PE
6099 * xfns.c (x_window): Remove redundant cast.
6100
b00876c9
DA
61012012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6102
6103 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6104 `const char *' to `char *' to avoid compiler warning.
6105
d188e26b
PE
61062012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6107
885d1d74
PE
6108 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6109 instead of truncating it to 63 (admittedly a generous limit).
6110
d188e26b
PE
6111 * process.c: Fix spelling and caps in comments.
6112
e2f560b1
DN
61132012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
6114
e86db54b 6115 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
6116 * sysdep.c (setpgrp): Remove definition, not used in this file.
6117
7583a3a1
JB
61182012-06-24 Juanma Barranquero <lekktu@gmail.com>
6119
6120 * makefile.w32-in: Update dependencies.
6121
696056c2
EZ
61222012-06-24 Eli Zaretskii <eliz@gnu.org>
6123
6124 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
6125 (SYSTIME_H): Add nt/inc/sys/time.h.
6126
6127 * systime.h [WINDOWSNT]: Include sys/time.h.
6128
6129 * s/ms-w32.h (struct timespec): Definition moved from
6130 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
6131
845ca893
PE
61322012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6133
6134 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
6135 * buffer.h (buffer_slot_type_mismatch):
6136 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6137 * eval.c (unwind_to_catch):
6138 * image.c (my_png_error, my_error_exit):
6139 * keyboard.c (quit_throw_to_read_char, user_error)
6140 (Fexit_recursive_edit, Fabort_recursive_edit):
6141 * lisp.h (die, args_out_of_range, args_out_of_range_3)
6142 (wrong_type_argument, buffer_overflow, __executable_start)
6143 (memory_full, buffer_memory_full, string_overflow, Fthrow)
6144 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
6145 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
6146 (fatal):
6147 (child_setup) [!DOS_NT]:
6148 * lread.c (end_of_file_error, invalid_syntax):
6149 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6150 * puresize.h (pure_write_error):
6151 * search.c (matcher_overflow):
6152 * sound.c (sound_perror, alsa_sound_perror):
6153 * sysdep.c, syssignal.h (croak):
6154 * term.c (maybe_fatal, vfatal):
6155 * textprop.c (text_read_only):
6156 * undo.c (user_error):
6157 * unexmacosx.c (unexec_error):
6158 * xterm.c (x_ins_del_lines, x_delete_glyphs):
6159 Use _Noreturn rather than NO_RETURN.
6160 No need for separate decl merely because of _Noreturn.
6161 * sound.c (sound_warning, parse_sound):
6162 Remove unnecessary forward decls.
6163
f1dd8073
PE
61642012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6165
6166 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
6167 * lisp.h (WAIT_READING_MAX): New macro.
6168 * dispnew.c (Fsleep_for, sit_for):
6169 * keyboard.c (kbd_buffer_get_event):
6170 * process.c (Faccept_process_output):
6171 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6172 This improves on the previous patch, which introduced a bug
6173 when time_t is unsigned and as wide as intmax_t.
6174 See <http://bugs.gnu.org/9000#51>.
6175
b82c1755
EZ
61762012-06-23 Eli Zaretskii <eliz@gnu.org>
6177
6178 * dispnew.c (sit_for, Fsleep_for):
6179 * keyboard.c (kbd_buffer_get_event):
6180 * process.c (Faccept_process_output): Avoid compiler warnings when
6181 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6182
ca300656
JB
61832012-06-23 Juanma Barranquero <lekktu@gmail.com>
6184
049ec95b
JB
6185 * makefile.w32-in: Update dependencies.
6186
ca300656
JB
6187 * w32.c (ltime): Add return type and declare static.
6188 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6189
db7b8d06
PE
61902012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6191
6192 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6193 Privately reported by Herbert J. Skuhra.
6194 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6195 All uses changed.
6196 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6197 not make_lisp_timeval, when the argument is of type EMACS_TIME.
6198
0bd8297f
EZ
61992012-06-23 Eli Zaretskii <eliz@gnu.org>
6200
96512555
EZ
6201 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6202 last argument of make_unibyte_string.
6203
0bd8297f
EZ
6204 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6205 language ID in the event parameters.
6206
6207 * w32term.c (w32_read_socket): Put the new keyboard codepage into
6208 event.code, not the obscure "character set ID".
6209
63def6b6
CY
62102012-06-23 Chong Yidong <cyd@gnu.org>
6211
6212 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6213
e8a02204
EZ
62142012-06-23 Eli Zaretskii <eliz@gnu.org>
6215
388cdec0
EZ
6216 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6217 * w32.c (fdutimens): New function.
6218
6219 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6220
6221 * s/ms-w32.h (pselect): Redirect to sys_select.
6222
6223 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6224
e8a02204
EZ
6225 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6226 in the logic of incrementing and decrementing the value of
6227 use_relocatable_buffers.
6228
d054f3fb
PE
62292012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6230
6231 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6232 Privately reported by Herbert J. Skuhra.
6233 [__FreeBSD__]: Remove "*/" typo after "#include".
6234 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6235 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6236 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6237 Don't assume EMACS_TIME and struct timeval are the same type.
6238
d35af63c
PE
62392012-06-22 Paul Eggert <eggert@cs.ucla.edu>
6240
6241 Support higher-resolution time stamps (Bug#9000).
6242 The time stamps are only nanosecond-resolution at the C level,
6243 since that's the best that any real-world system supports now.
6244 But they are picosecond-resolution at the Lisp level, as that's
6245 easy, and leaves room for future OS improvements.
6246
6247 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6248 (LIBES): Use it.
6249
6250 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6251 Don't get current time unless it's needed.
6252
6253 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6254 now provides it if it's absent.
6255 (start_atimer): Port to higher-res time stamps.
6256 Check for time stamp overflow. Don't get current time more
6257 often than is needed.
6258
6259 * buffer.h (struct buffer): Buffer modtime now has high resolution.
6260 Include systime.h, not time.h.
6261 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
6262
6263 * dired.c: Include stat-time.h.
6264 (Ffile-attributes): File times now have higher resolution.
6265
6266 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
6267 (struct image): Timestamp now has higher resolution.
6268
6269 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
6270 has at least microseconds now. All uses removed.
6271 (update_frame, update_single_window, update_window, update_frame_1)
6272 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 6273 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
6274
6275 * editfns.c (time_overflow): Now extern.
6276 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
6277 (float-time, Fformat_time_string, Fcurrent_time_string)
6278 (Fcurrent_time_zone): Accept and generate higher-resolution
6279 time stamps.
6280 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
6281 (decode_time_components, lisp_seconds_argument): New functions.
6282 (make_time): Now static.
6283 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
6284 Report an error if the time is invalid, rather than having the caller
6285 do that.
6286
6287 * fileio.c: Include <stat-time.h>
6288 (Fcopy_file): Copy higher-resolution time stamps.
6289 Prefer to set the time stamp via a file descriptor if that works.
6290 (Fset_file_times, Finsert_file_contents, Fwrite_region)
6291 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
6292 (Fvisited_file_modtime, Fset_visited_file_modtime):
6293 Support higher-resolution time stamps.
6294
6295 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6296
6297 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6298
6299 * image.c (prepare_image_for_display, clear_image_cache)
6300 (lookup_image): Port to higer-resolution time stamps.
6301
6302 * keyboard.c (start_polling, bind_polling_period):
6303 Check for time stamp overflow.
6304 (read_char, kbd_buffer_get_event, timer_start_idle)
6305 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6306 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6307 Port to higher-resolution time stamps. Do not assume time_t is signed.
6308 (decode_timer): New function. Timers are now vectors of length 9,
6309 not 8, to accommodate the picosecond component.
6310 (timer_check_2): Use it.
6311
6312 * nsterm.m (select_timeout, timeval_subtract): Remove.
6313 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6314 as they're a bit more accurate and handle overflow better.
6315 (ns_select): Change prototype to be compatible with pselect.
6316 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6317 * nsterm.h (ns_select): Adjust prototype.
6318
6319 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6320 us-resolution time stamps.
6321 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6322
6323 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6324
6325 * lisp.h (time_overflow): New decl.
6326 (wait_reading_process_output): First arg is now intmax_t, not int,
6327 to accommodate larger waits.
6328
6329 * process.h (struct Lisp_Process.read_output_delay):
6330 Now counts nanoseconds, not microseconds.
6331 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6332 EMACS_HAS_USECS.
6333 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6334 (wait_reading_process_output):
6335 Port to ns-resolution time stamps.
6336 (Faccept_process_output, wait_reading_process_output):
6337 Check for time stamp overflow. Do not assume time_t is signed.
6338 (select_wrapper): Remove; we now use pselect.
6339 (Fprocess_attributes): Now generates ns-resolution time stamps.
6340
6341 * sysdep.c: Include utimens.h. Don't include utime.h
6342 or worry about struct utimbuf; gnulib does that for us now.
6343 (gettimeofday): Remove; gnulib provides a substitute.
6344 (make_timeval): New function.
6345 (set_file_times): Now sets ns-resolution time stamps.
6346 New arg FD; all uses changed.
6347 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6348 (system_process_attributes):
6349 Now returns ns-resolution time stamp. All uses changed.
6350 Check for time stamp overflow.
6351
6352 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6353 provides a substitute now.
6354
6355 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6356 since it guarantees struct timespec.
6357 (EMACS_TIME): Now struct timespec, so that we can support
6358 ns-resolution time stamps.
6359 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6360 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6361 (EMACS_USECS): Remove.
6362 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6363 so multiply the arg by 1000 before storing it.
6364 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6365 New macros.
6366 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6367 Port to ns-resolution time stamps.
6368 (EMACS_TIME_NEG_P): Remove; replaced by....
6369 (EMACS_TIME_SIGN): New macro.
6370 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6371 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6372 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6373 (make_timeval, make_lisp_time, decode_time_components): New decls.
6374 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6375 that it mishandled time_t overflow. You can't compare by subtracting!
6376 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6377 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6378
6379 * term.c: Include <sys/time.h>.
6380 (timeval_to_Time): New function, for proper overflow wraparound.
6381 (term_mouse_position, term_mouse_click): Use it.
6382
6383 * undo.c (record_first_change): Support higher-resolution time stamps
6384 in the undo buffer.
6385 (Fprimitive_undo): Use them when restoring time stamps.
6386
6387 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6388 (w32_get_internal_run_time):
6389 Port to higher-resolution Emacs time stamps.
6390 (ltime): Now accepts single 64-bit integer, as that's more convenient
6391 for callers.
6392
6393 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6394
6395 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6396 for compatibility with pselect. Support ns-resolution time stamps.
6397
6398 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6399
6400 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6401 Check for time stamp overflow, and support ns-resolution time stamps.
6402
6403 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6404 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6405 (timeval_subtract): Remove; no longer needed.
6406 (XTflash, XTring_bell, x_wait_for_event):
6407 Port to ns-resolution time stamps. Don't assume time_t is signed.
6408
b6a92dfe
CY
64092012-06-22 Chong Yidong <cyd@gnu.org>
6410
6411 * xdisp.c (x_consider_frame_title): Revert last change.
6412
d251c37c
EZ
64132012-06-22 Eli Zaretskii <eliz@gnu.org>
6414
6415 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6416 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6417 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6418 staticidx goes up to 1597 out of 1600 = 0x640.)
6419
f10deafb
PE
64202012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6421
6422 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6423 Otherwise, the umask might be mistakenly 0 while handling input signals.
6424
ec6de1e2
SM
64252012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6426
6427 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6428
28be1ada
DA
64292012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6430
6431 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6432 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6433 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6434 access to `contents' member of Lisp_Vector objects with AREF and ASET
6435 where appropriate.
6436
c6bf3022
CY
64372012-06-19 Chong Yidong <cyd@gnu.org>
6438
6439 * frame.c (delete_frame): When selecting a frame on a different
6440 text terminal, do not alter the terminal's top-frame.
6441
6442 * xdisp.c (format_mode_line_unwind_data): Record the target
6443 frame's selected window and its terminal's top-frame.
6444 (unwind_format_mode_line): Restore them.
6445 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6446 Callers changed.
6447 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6448 since tty frames can be explicitly named.
6449 (prepare_menu_bars): Likewise.
6450
6451 * term.c (Ftty_top_frame): New function.
6452
defd4196
PE
64532012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6454
6455 Port byte-code-meter to modern targets.
6456 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6457 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 6458 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
6459 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6460 (METER_1, METER_2): Simplify.
6461
1053a871
SM
64622012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6463
6464 * data.c (Fdefalias): Return `symbol' (bug#11686).
6465
b7e8d081
MR
64662012-06-18 Martin Rudalics <rudalics@gmx.at>
6467
6468 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
6469 gets killed during executing of this function (Bug#11665).
6470 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
6471 (Vkill_buffer_query_functions): In doc-string say that functions
6472 run by this hook should not change the current buffer.
6473
7ea2b339
PE
64742012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6475
6476 Fix recently-introduced process.c problems found by static checking.
6477 * process.c (write_queue_push, write_queue_pop, send_process):
6478 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6479 (write_queue_pop): Fix pointer signedness problem.
6480 (send_process): Remove unused local.
6481
96a313a1
CY
64822012-06-17 Chong Yidong <cyd@gnu.org>
6483
6484 * xdisp.c (redisplay_internal): No need to redisplay terminal
6485 frames that are not on top.
6486
20ca2e94
TN
64872012-06-17 Troels Nielsen <bn.troels@gmail.com>
6488
6489 * process.c (make_process): Initialize write_queue.
6490 (write_queue_push, write_queue_pop): New functions.
6491 (send_process): Use them to maintain correct ordering of process
6492 writes (Bug#10815).
6493
9a900ca9
PE
64942012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6495
310fbfa8
PE
6496 * lisp.h (eassert): Assume C89 or later.
6497 This removes the need for CHECK.
6498 (CHECK): Remove. Its comments about always evaluating its
6499 argument were confusing, as 'eassert' typically does not evaluate
6500 its argument.
6501
27bb1ca4
PE
6502 * coding.c (produce_chars): Use ptrdiff_t, not int.
6503
9a900ca9
PE
6504 * xterm.c (x_draw_underwave): Check for integer overflow.
6505 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6506
41b7f8bc 65072012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
6508
6509 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6510 referenced (Bug#11583).
6511
9b0e3eba
AA
65122012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6513
6514 Implement wave-style variant of underlining.
6515 * dispextern.h (face_underline_type): New enum.
6516 (face): Add field for underline type.
6517 * nsterm.m (ns_draw_underwave): New function.
6518 (ns_draw_text_decoration): Use it.
6519 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6520 New functions.
6521 (x_draw_glyph_string): Use them.
6522 * xfaces.c (Qline, Qwave): New Lisp objects.
6523 (check_lface_attrs, merge_face_ref)
1053a871
SM
6524 (Finternal_set_lisp_face_attribute, realize_x_face):
6525 Handle wave-style underline face attributes.
9b0e3eba
AA
6526 * xterm.c (x_draw_underwave): New function.
6527 (x_draw_glyph_string): Use it.
6528
0fb52f11
JB
65292012-06-16 Juanma Barranquero <lekktu@gmail.com>
6530
6531 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6532 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6533 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6534 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6535 ($(BLD)/w32select.$(O)): Update dependencies.
6536
e5560ff7
AS
65372012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6538
6539 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6540 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6541 * character.c (_fetch_multibyte_char_p): Remove.
6542 * alloc.c: Include "character.h" before "buffer.h".
6543 * bidi.c: Likewise.
6544 * buffer.c: Likewise.
6545 * bytecode.c: Likewise.
6546 * callint.c: Likewise.
6547 * callproc.c: Likewise.
6548 * casefiddle.c: Likewise.
6549 * casetab.c: Likewise.
6550 * category.c: Likewise.
6551 * cmds.c: Likewise.
6552 * coding.c: Likewise.
6553 * composite.c: Likewise.
6554 * dired.c: Likewise.
6555 * dispnew.c: Likewise.
6556 * doc.c: Likewise.
6557 * dosfns.c: Likewise.
6558 * editfns.c: Likewise.
6559 * emacs.c: Likewise.
6560 * fileio.c: Likewise.
6561 * filelock.c: Likewise.
6562 * font.c: Likewise.
6563 * fontset.c: Likewise.
6564 * fringe.c: Likewise.
6565 * indent.c: Likewise.
6566 * insdel.c: Likewise.
6567 * intervals.c: Likewise.
6568 * keyboard.c: Likewise.
6569 * keymap.c: Likewise.
6570 * lread.c: Likewise.
6571 * macros.c: Likewise.
6572 * marker.c: Likewise.
6573 * minibuf.c: Likewise.
6574 * nsfns.m: Likewise.
6575 * nsmenu.m: Likewise.
6576 * print.c: Likewise.
6577 * process.c: Likewise.
6578 * regex.c: Likewise.
6579 * region-cache.c: Likewise.
6580 * search.c: Likewise.
6581 * syntax.c: Likewise.
6582 * term.c: Likewise.
6583 * textprop.c: Likewise.
6584 * undo.c: Likewise.
6585 * unexsol.c: Likewise.
6586 * w16select.c: Likewise.
6587 * w32fns.c: Likewise.
6588 * w32menu.c: Likewise.
6589 * window.c: Likewise.
6590 * xdisp.c: Likewise.
6591 * xfns.c: Likewise.
6592 * xmenu.c: Likewise.
6593 * xml.c: Likewise.
6594 * xselect.c: Likewise.
6595
2f07e6af
EZ
65962012-06-16 Eli Zaretskii <eliz@gnu.org>
6597
1053a871
SM
6598 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6599 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 6600 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
6601 row.
6602 (handle_face_prop): Use chunk-relative overlay string index when
6603 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
6604 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6605 the rightmost. (Bug#11720)
2f07e6af 6606
29b83cec
AS
66072012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6608
6609 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6610 (CATEGORY_MEMBER): Enforce 1/0 value.
6611 * category.c (_temp_category_set): Remove.
6612
4c5501e9
EZ
66132012-06-16 Eli Zaretskii <eliz@gnu.org>
6614
6615 * window.c (Fdelete_other_windows_internal)
6616 (Fdelete_window_internal): Don't access frame's mouse highlight
6617 info of the initial frame. (Bug#11677)
6618
2b570124
PE
66192012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6620
e93864f9
PE
6621 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6622 Assume USE_2_TAGS_FOR_INTS.
6623 (xreload): Adjust $tagmask width to match recent lisp.h change.
6624
2b570124
PE
6625 Simplify lisp.h in minor ways that should not affect code.
6626 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6627 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6628 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6629 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6630 (INTTYPEBITS): New macro, for clarity.
6631 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
6632 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6633 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
6634 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6635 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6636
81755f69
JB
66372012-06-13 Juanma Barranquero <lekktu@gmail.com>
6638
6639 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6640
16192a57
GM
66412012-06-13 Glenn Morris <rgm@gnu.org>
6642
6643 * s/bsd-common.h (BSD4_3):
6644 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6645
646b5f55
AS
66462012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6647
6648 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6649 instead of union.
6650 (XLI, XIL): Define.
1053a871
SM
6651 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6652 Use them.
6653 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 6654 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 6655 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
6656 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6657 * frame.c (delete_frame): Remove outdated comment.
6658 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6659 USE_LISP_UNION_TYPE.
6660 (Fw32_unregister_hot_key): Likewise.
6661 (Fw32_toggle_lock_key): Likewise.
6662 * w32menu.c (add_menu_item): Likewise.
6663 (w32_menu_display_help): Use XIL instead of checking
6664 USE_LISP_UNION_TYPE.
6665 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6666 (init_heap): Likewise.
6667 * w32term.c (w32_read_socket): Update comment.
6668
1d3823c9
GM
66692012-06-13 Glenn Morris <rgm@gnu.org>
6670
c62ff706
GM
6671 * s/usg5-4-common.h, src/s/unixware.h:
6672 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6673
1d3823c9
GM
6674 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6675
bfe3e0a2
PE
66762012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6677
6678 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6679 * alloc.c (make_number) [!defined make_number]:
6680 Remove, as lisp.h always defines this now.
6681 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6682 (roundup_size): Verify that it is a power of 2.
6683 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6684 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6685 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6686 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6687 USE_LSB_TAG now is always defined to be either 0 or 1.
6688 All uses changed.
6689 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6690 code works fine either way, and efficiency is not a concern here,
6691 as the union type is for debugging, not for production.
6692 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6693 Use an inline function on all platforms when using the union type,
6694 since this is simpler and 'static inline' can be used portably
6695 within Emacs now.
6696 (LISP_INITIALLY_ZERO): New macro.
6697 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6698 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6699
45fa9c0f
GM
67002012-06-12 Glenn Morris <rgm@gnu.org>
6701
b4492cba
GM
6702 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6703
6704 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 6705
45fa9c0f
GM
6706 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6707 Move BROKEN_SIGIO to configure.
6708
6709 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6710 Move NO_TERMIO to configure.
6711
0e25d334
CY
67122012-06-12 Chong Yidong <cyd@gnu.org>
6713
6714 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6715 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6716 MagickExportImagePixels is undefined.
6717
43682bb6
PE
67182012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6719
6720 * image.c (imagemagick_load_image): Remove unused label.
6721
a9be7d2b
GM
67222012-06-11 Glenn Morris <rgm@gnu.org>
6723
6724 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6725 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6726 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6727 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6728
3017f87f
SM
67292012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6730
6731 * alloc.c (make_byte_code): New function.
6732 (Fmake_byte_code): Use it. Don't purify here.
6733 * lread.c (read1): Use it as well to avoid extra allocation.
6734
1b9b4cf4
CY
67352012-06-11 Chong Yidong <cyd@gnu.org>
6736
6737 * image.c (imagemagick_load_image): Implement transparency.
6738
95988fcf
AS
67392012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6740
6741 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6742 account for preceding backslashes. (Bug#11663)
6743
cd4eb164
CY
67442012-06-09 Chong Yidong <cyd@gnu.org>
6745
6746 * term.c: Support italics in capable terminals (Bug#9652).
6747 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6748 (turn_on_face): Output using TS_enter_italic_mode if available.
6749 Don't handle unused blinking and alt-charset cases.
6750 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6751 and tty_alt_charset_p cases.
6752 (tty_capable_p, init_tty): Support italics.
6753
6754 * termchar.h (struct tty_display_info): Add field for italics.
6755 Remove unused blink field.
6756
6757 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6758 Handle slant.
6759
6760 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6761 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6762 tty_alt_charset_p. Add tty_italic_p.
6763
ff88beb8
MA
67642012-06-09 Michael Albinus <michael.albinus@gmx.de>
6765
6766 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6767 dbus_type_is_basic if available.
6768 (xd_extract_signed, xd_extract_unsigned): Rename from
6769 extract_signed and extract_unsigned, respectively. Adapt callers.
6770
44286096
CY
67712012-06-09 Chong Yidong <cyd@gnu.org>
6772
1682701f
CY
6773 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6774
44286096
CY
6775 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6776 case (Bug#9752).
6777
d86feb17
PE
67782012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6779
6780 * xdisp.c (vmessage): Treat frame message as multibyte.
6781 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6782 would generate the diagnostic "Making \302\247 buffer-local while
6783 let-bound!".
6784
d5c20fe8
EZ
67852012-06-08 Eli Zaretskii <eliz@gnu.org>
6786
6787 * dispnew.c (showing_window_margins_p): Undo last change, which
6788 was done due to an inadvertent commit.
6789 (adjust_frame_glyphs_for_frame_redisplay): Do call
6790 showing_window_margins_p.
6791
513749ee
SM
67922012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6793
6794 * eval.c (Fmake_var_non_special): New primitive.
6795 (syms_of_eval): Defsubr it.
6796 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6797
d4a8f5c1
JB
67982012-06-08 Juanma Barranquero <lekktu@gmail.com>
6799
6800 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6801 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6802
8bbbc977
EZ
68032012-06-08 Eli Zaretskii <eliz@gnu.org>
6804
6805 * alloc.c (allocate_vectorlike): Fix last change.
6806
f3372c87
DA
68072012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6808
6809 Block-based vector allocation of small vectors.
6810 * lisp.h (struct vectorlike_header): New field `nbytes',
6811 adjust comment accordingly.
6812 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 6813 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
6814 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6815 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6816 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6817 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6818 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6819 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6820 (roundup_size): New constant.
6821 (struct vector_block): New data type.
6822 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 6823 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
6824 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6825 (sweep_vectors): New functions.
6826 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 6827 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
6828 or equal to VBLOCK_BYTES_MAX.
6829 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6830 (init_alloc_once): Add call to init_vectors.
6831
4f18a4ed
SM
68322012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6833
6834 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6835
86f158bc
PE
68362012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6837
6838 * doprnt.c (doprnt): Truncate multibyte char correctly.
6839 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6840 would mishandle a string argument "Xc" if X was a multibyte
6841 character of length 2: it would truncate after X's first byte
6842 rather than including all of X.
6843
c5cfcbe0
CY
68442012-06-06 Chong Yidong <cyd@gnu.org>
6845
6846 * buffer.c (word_wrap): Doc fix.
6847
c05cf390
PE
68482012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6849
6850 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6851
0c3461de
GM
68522012-06-03 Glenn Morris <rgm@gnu.org>
6853
6854 * xdisp.c (tool-bar-style): Doc fix.
6855
c71232db
UM
68562012-06-03 Ulrich Müller <ulm@gentoo.org>
6857
6858 * Makefile.in (PAXCTL): Define.
6859 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6860 binary via PaX flags if the paxctl utility is available.
6861 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6862 Restore PaX flags to their default. (Bug#11398)
6863
383f7350
CY
68642012-06-03 Chong Yidong <cyd@gnu.org>
6865
6866 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6867 buffer (Bug#11226).
6868
5f2c76c6
CY
68692012-06-03 Chong Yidong <cyd@gnu.org>
6870
6871 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6872 (note_mode_line_or_margin_highlight): If there is no help echo,
6873 use mode-line-default-help-echo. Handle the case where the mouse
6874 position is past the end of the mode line string.
6875
6876 * buffer.c (buffer_local_value_1): New function, split from
6877 Fbuffer_local_value; can return Qunbound.
6878 (Fbuffer_local_value): Use it.
6879 (Vmode_line_format): Docstring tweaks.
6880
773d47f6
PE
68812012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6882
6883 * sysdep.c (system_process_attributes): Improve comment.
6884
f2d6a3df
SM
68852012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6886
6887 * keyboard.c: Export real-this-command to Elisp.
6888 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6889 and DEFVAR it. Update all users.
6890
63810350
PE
68912012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6892
7bd5c1f4
PE
6893 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6894
63810350
PE
6895 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6896 Convert pctcpu and pctmem to Lisp float properly.
6897 Let the compiler fold better, as 100.0/0x8000 is exact.
6898
a2821611
AS
68992012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6900
6901 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6902 cons_block.
6903
5fceba1d
PE
69042012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6905
6906 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6907
c98ff5dd
DA
69082012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6909
6910 For a 'struct window', replace some Lisp_Object fields to
6911 bitfields where appropriate, remove unused fields.
6912 * window.h (struct window): Remove unused 'last_mark_x' and
6913 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6914 change it's type from Lisp_Object to bitfield.
6915 Change type of 'force_start', 'optional_new_start',
6916 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 6917 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 6918
ca34e0be
PE
69192012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6920
6921 Pacify gcc -Wdouble-precision when using Xaw.
6922 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6923 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6924 Use 'float' consistently, rather than 'float' in most places
6925 and 'double' in a couple of places.
6926
efc00ab1 69272012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
6928
6929 * xdisp.c (handle_stop): Detect whether we have overlay strings
6930 loaded by testing it->current.overlay_string_index to be
6931 non-negative, instead of checking whether n_overlay_strings is
6932 positive. (Bug#11587)
6933
efc00ab1 69342012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
6935
6936 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6937
6938 * doc.c (Fsubstitute_command_keys): Doc fix.
6939
efc00ab1 69402012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
6941
6942 * search.c (search_buffer): Remove calls to
6943 r_alloc_inhibit_buffer_relocation, as it is now called by
6944 maybe_unify_char, which was the cause of relocation of buffer text
6945 in bug#11519.
6946
efc00ab1 69472012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
6948
6949 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6950 for the duration of call to load_charset, to avoid problems with
6951 callers of maybe_unify_char that access buffer text through C
6952 pointers.
6953
6954 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6955 decrement the inhibition flag, instead of just setting or
6956 resetting it.
6957
ba93a187
PE
69582012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6959
6960 Remove obsolete '#define static' cruft.
6961 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6962 This #undef was "temporary" in 2000; it is no longer needed
6963 now that '#define static' has gone away.
6964 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6965 (gray_bitmap_bits): Remove; no longer needed.
6966 All uses replaced with definiens.
6967 * xterm.c: Include "bitmaps/gray.xbm".
6968
9e4bf381
PE
69692012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6970
6971 Clean up __executable_start, monstartup when --enable-profiling.
6972 The following changes affect the code only when profiling.
6973 * dispnew.c (__executable_start): Rename from safe_bcopy.
6974 Define only on platforms that need it.
6975 * emacs.c: Include <sys/gmon.h> when profiling.
6976 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6977 (__executable_start): Remove decl, since lisp.h does it now.
6978 (safe_bcopy): Remove decl; no longer has that name.
6979 (main): Coalesce #if into single bit of code, for simplicity.
6980 Cast pointers to uintptr_t, since standard libraries want integers
6981 and not pointers.
6982 * lisp.h (__executable_start): New decl.
6983
32d72c2f
GM
69842012-05-31 Glenn Morris <rgm@gnu.org>
6985
6986 * image.c (Fimagemagick_types): Doc fix.
6987
baac5bc7
JM
69882012-05-30 Jim Meyering <meyering@redhat.com>
6989
6990 * callproc.c (Fcall_process_region): Include directory component
6991 in mkstemp error message (Bug#11586).
6992
72cb32cf
PE
69932012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6994
6995 * alloc.c, lisp.h (make_pure_vector): Now static.
6996
61b108cc
SM
69972012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6998
6999 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7000 Move to byte-run.el.
7001 (Fautoload): Do the hash-doc more carefully.
7002 * data.c (Fdefalias): Purify definition, except for keymaps.
7003 (Qdefun): Move from eval.c.
7004 * lisp.h (Qdefun): Remove.
7005 * lread.c (read1): Tiny simplification.
7006
471fe23d
TN
70072012-05-29 Troels Nielsen <bn.troels@gmail.com>
7008
934f3f58 7009 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
7010 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7011 Bug#9642, but explicitly check that the buffer the overlay would
7012 be moved to is live and rearrange lines to make sure that errors
7013 will not put the overlay in an inconsistent state.
7014 (Fdelete_overlay): Cosmetics.
7015
85d0efd1
EZ
70162012-05-28 Eli Zaretskii <eliz@gnu.org>
7017
7018 * w32term.c (my_bring_window_to_top): New function.
7019 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
7020 could be different from the original one.
7021 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
7022 (Bug#11513)
7023
7024 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7025 by calling BringWindowToTop.
7026
7027 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
7028 (WM_EMACS_END): Increase by one.
7029
da92a98c
PE
70302012-05-28 Paul Eggert <eggert@cs.ucla.edu>
7031
7032 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
7033 This avoids undefined behavior that might cause the eassert
7034 to not catch an out-of-range value.
7035
74d1f848
JB
70362012-05-28 Juanma Barranquero <lekktu@gmail.com>
7037
7038 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7039 Update dependencies.
7040
9e1a06fc
EZ
70412012-05-27 Eli Zaretskii <eliz@gnu.org>
7042
7043 * bidi.c (bidi_mirror_char): Fix last change.
7044
f3dd7312
AS
70452012-05-27 Andreas Schwab <schwab@linux-m68k.org>
7046
7047 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7048 when referring to sectname field in printf format.
7049
81899c91
PE
70502012-05-27 Paul Eggert <eggert@cs.ucla.edu>
7051
57b81a9f
PE
7052 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7053 Only r_alloc_inhibit_buffer_relocation needed to be added;
7054 the others were already declared.
7055
81899c91
PE
7056 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7057 before checking whether it's out of range. Put the check inside
7058 eassert. See
7059 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7060
33017faf 70612012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
7062
7063 * callproc.c (Fcall_process): Restore a line that was accidentally
7064 commented out in the 2011-02-13 change (bug#11547).
7065
33017faf 70662012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
7067
7068 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7069 defined on ralloc.c.
7070
7071 * buffer.c [REL_ALLOC]: Remove prototypes of
7072 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7073 they are now on lisp.h.
7074
7075 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7076
7077 * search.c (search_buffer): Use it to inhibit relocation of buffer
7078 text while re_search_2 is doing its job, because re_search_2 is
7079 passed C pointers to buffer text. (Bug#11519)
7080
23415acf
EZ
7081 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7082 Update value to 24.
7083
44e27368
EZ
7084 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7085 state after an additional call to move_it_in_display_line_to, keep
7086 the values of it->max_ascent and it->max_descent found for the
7087 entire line.
7088 (pos_visible_p): Revert the comparison against bottom_y to what it
7089 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7090 (Bug#11464)
7091
c1892f11
PE
70922012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7093
7094 Fix coding-related core dumps with gcc -ftrapv.
7095 The code was computing A - B, where A and B are pointers, and B is
7096 random garbage. This can lead to core dumps on platforms that
7097 have special pointer registers, and it also leads to core dumps on
7098 x86-64 when compiled with gcc -ftrapv. The fix is to compute
7099 A - B only when B is initialized properly.
7100 * coding.c (coding_set_source, coding_set_destination): Return void.
7101 (coding_change_source, coding_change_destinations): New functions,
7102 with the old behaviors of coding_set_source and coding_set_destination.
7103 All callers that need an offset changed to use these new functions.
7104
eb7afdad
GM
71052012-05-26 Glenn Morris <rgm@gnu.org>
7106
7107 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
7108
f12fdf02
EZ
71092012-05-26 Eli Zaretskii <eliz@gnu.org>
7110
53a63be6 7111 Extend mouse support on W32 text-mode console.
61b108cc
SM
7112 * xdisp.c (draw_row_with_mouse_face):
7113 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 7114
eb3f6f01 7115 * w32console.c: Include window.h.
61b108cc
SM
7116 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
7117 New functions.
eb3f6f01
EZ
7118 (initialize_w32_display): Initialize mouse-highlight data.
7119
53a63be6
EZ
7120 * w32inevt.c: Include termchar.h and window.h.
7121 (do_mouse_event): Support mouse-autoselect-window. When the mouse
7122 moves, call note_mouse_highlight. If help_echo changed, call
7123 gen_help_event to produce help-echo message in the echo area.
7124 Call clear_mouse_face if mouse_face_hidden is set in the mouse
7125 highlight info.
7126
4cfd81f6
PE
71272012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7128
7129 * lread.c (read1): Simplify slightly to avoid an overflow warning
7130 with GCC 4.7.0 on x86-64.
7131
4446092a
EZ
71322012-05-26 Eli Zaretskii <eliz@gnu.org>
7133
7134 * bidi.c (bidi_mirror_char): Revert last change: an int is
7135 definitely wide enough here.
7136
42b2a986 71372012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 7138
42b2a986 7139 Fix integer width and related bugs (Bug#9874).
eb106a49 7140 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
7141 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
7142 (string_bytes, check_sblock, allocate_string_data):
7143 (compact_small_strings, Fmake_bool_vector, make_string)
7144 (make_unibyte_string, make_multibyte_string)
7145 (make_string_from_bytes, make_specified_string)
7146 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
7147 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
7148 (mark_vectorlike):
7149 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7150 (allocate_pseudovector):
7151 Use int, not EMACS_INT, where int is wide enough.
7152 (inhibit_garbage_collection, Fgarbage_collect):
7153 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7154 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
7155 int might not be wide enough.
7156 (bidi_cache_search, bidi_cache_find, bidi_init_it)
7157 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
7158 (bidi_at_paragraph_end, bidi_find_paragraph_start)
7159 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7160 (bidi_level_of_next_char, bidi_move_to_visually_next):
7161 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7162 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
7163 (Fkill_buffer, Fset_buffer_major_mode)
7164 (advance_to_char_boundary, Fbuffer_swap_text)
7165 (Fset_buffer_multibyte, overlays_at, overlays_in)
7166 (overlay_touches_p, struct sortvec, record_overlay_string)
7167 (overlay_strings, recenter_overlay_lists)
7168 (adjust_overlays_for_insert, adjust_overlays_for_delete)
7169 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
7170 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
7171 (Foverlay_recenter, last_overlay_modification_hooks_used)
7172 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7173 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
7174 (validate_region): Omit unnecessary test for b <= e,
7175 since that's guaranteed by the previous test.
d311d28c
PE
7176 (adjust_overlays_for_delete): Avoid pos + length overflow.
7177 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7178 (report_overlay_modification):
7179 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7180 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7181 Omit pointer cast, which isn't needed anyway, and doesn't work
7182 after the EMACS_INT -> ptrdiff_t change.
02481186 7183 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
7184 * buffer.h: Adjust decls to match defn changes elsewhere.
7185 (struct buffer_text, struct buffer):
7186 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7187 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
7188 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7189 not int, to avoid needless 32-bit limit on 64-bit hosts.
7190 (exec_byte_code): Use tighter memory-full test, one that checks
7191 for alloca overflow. Don't compute the address of the object just
7192 before an array, as that's not portable. Use EMACS_INT, not
7193 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
7194 * callint.c (Fcall_interactively):
7195 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7196 * callproc.c (call_process_kill, Fcall_process):
7197 Don't assume pid_t fits into an Emacs fixnum.
7198 (call_process_cleanup, Fcall_process, child_setup):
7199 Don't assume pid_t fits into int.
7200 (call_process_cleanup, Fcall_process, delete_temp_file)
7201 (Fcall_process_region):
7202 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7203 (Fcall_process): Simplify handling of volatile integers.
7204 Use int, not EMACS_INT, where int will do.
7205 * casefiddle.c (casify_object, casify_region, operate_on_word)
7206 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7207 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7208 (casify_object): Avoid integer overflow when overallocating buffer.
7209 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 7210 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
7211 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7212 * category.h (CATEGORYP): Don't assume arg is nonnegative.
7213 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7214 integers are now checked earlier. All uses replaced with XINT.
7215 (ccl_driver):
7216 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7217 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
7218 (ccl_driver, Fregister_code_conversion_map):
7219 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
7220 (resolve_symbol_ccl_program): Check that vector header is in range.
7221 Always copy the vector, so that we can check its contents reliably
7222 now rather than having to recheck each instruction as it's being
7223 executed. Check that vector words fit in 'int'.
7224 (ccl_get_compiled_code, Fregister_ccl_program)
7225 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7226 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7227 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7228 contents are in range.
7229 (Fccl_execute_on_string): Check that status is in range.
7230 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7231 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7232 Accept and return EMACS_INT, not int, because callers can pass values
7233 out of 'int' range.
7234 (c_string_width, strwidth, lisp_string_width, chars_in_text)
7235 (multibyte_chars_in_text, parse_str_as_multibyte)
7236 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7237 (str_as_unibyte, str_to_unibyte, string_count_byte8)
7238 (string_escape_byte8, Fget_byte):
7239 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 7240 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
7241 avoid mishandling large integers.
7242 * character.h: Adjust decls to match defn changes elsewhere.
7243 * charset.c (load_charset_map_from_file, find_charsets_in_text)
7244 (Ffind_charset_region):
7245 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7246 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7247 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 7248 Don't assume fixnum fits in int.
d311d28c
PE
7249 (load_charset_map_from_vector, Fmap_charset_chars):
7250 Remove now-unnecessary CHECK_NATNUMs.
7251 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
7252 Don't rely on undefined behavior with signed left shift overflow.
7253 Don't assume unsigned int fits into fixnum, or that fixnum fits
7254 into unsigned int. Don't require max_code to be a valid fixnum;
7255 that's not true for gb10830 4-byte on a 32-bit host. Allow
7256 invalid_code to be a cons, for the same reason. Require code_offset
7257 to be a character. Avoid int overflow if max_char is close
7258 to INT_MAX.
7259 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7260 this is intended anyway and avoids some undefined behavior.
7261 (load_charset_map): Pass unsigned, not int, as 2nd arg of
7262 INDEX_TO_CODE_POINT, as that's what it expects.
7263 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
7264 * charset.h (DECODE_CHAR): Return int, not unsigned;
7265 this is what was intended anyway, and it avoids undefined behavior.
7266 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
7267 integer-overflow issues.
7268 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
7269 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
7270 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
7271 * chartab.c (Fmake_char_table, Fset_char_table_range)
7272 (uniprop_get_decoder, uniprop_get_encoder):
7273 Don't assume fixnum fits in int.
7274 * cmds.c (move_point): New function, that does the gist of
7275 Fforward_char and Fbackward_char, but does so while checking
7276 for integer overflow more accurately.
c96e5d6a 7277 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
7278 (Fforward_line, Fend_of_line, internal_self_insert)
7279 (internal_self_insert):
7280 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7281 Fix a FIXME, by checking for integer overflow when calculating
7282 target_clm and actual_clm.
7283 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 7284 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
7285 (ASSURE_DESTINATION, coding_alloc_by_realloc)
7286 (coding_alloc_by_making_gap, alloc_destination)
7287 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
7288 (encode_coding_utf_16, detect_coding_emacs_mule)
7289 (decode_coding_emacs_mule, encode_coding_emacs_mule)
7290 (detect_coding_iso_2022, decode_coding_iso_2022)
7291 (encode_invocation_designation, encode_designation_at_bol)
7292 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7293 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7294 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7295 (encode_coding_ccl, encode_coding_raw_text)
7296 (detect_coding_charset, decode_coding_charset)
7297 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7298 (produce_composition, produce_charset, produce_annotation)
7299 (decode_coding, handle_composition_annotation)
7300 (handle_charset_annotation, consume_chars, decode_coding_gap)
7301 (decode_coding_object, encode_coding_object, detect_coding_system)
7302 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7303 (code_convert_region, code_convert_string)
8f50130c
PE
7304 (Fdefine_coding_system_internal)
7305 (coding_set_source, coding_set_destination):
d311d28c
PE
7306 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7307 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7308 (Fdefine_coding_system_internal):
7309 Don't assume fixnums fit in int.
7310 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 7311 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
7312 (Funencodable_char_position, Fcheck_coding_systems_region)
7313 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 7314 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 7315 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 7316 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 7317 Don't access memory outside of the args array.
d311d28c 7318 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
7319 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7320 result of ENCODE_CHAR.
d311d28c
PE
7321 * coding.h: Adjust decls to match defn changes elsewhere.
7322 (struct coding_system):
7323 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7324 * composite.c (get_composition_id, find_composition)
7325 (run_composition_function, update_compositions)
7326 (compose_text, composition_gstring_put_cache)
7327 (composition_gstring_p, composition_gstring_width)
7328 (fill_gstring_header, fill_gstring_body, autocmp_chars)
7329 (composition_compute_stop_pos, composition_reseat_it)
7330 (composition_update_it, struct position_record)
7331 (find_automatic_composition, composition_adjust_point)
7332 (Fcomposition_get_gstring, Ffind_composition_internal):
7333 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7334 (update_compositions):
7335 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7336 * composite.h: Adjust decls to match defn changes elsewhere.
7337 (struct composition):
7338 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7339 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7340 Do not attempt to compute the address of the object just before a
7341 buffer; this is not portable.
7342 (Faref, Faset):
7343 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7344 (Faset): Use int, not EMACS_INT, where int is wide enough.
7345 (Fstring_to_number): Don't assume fixnums fit in int.
7346 (Frem): Don't assume arg is nonnegative.
7347 * dbusbind.c (xd_append_arg): Check for integers out of range.
7348 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 7349 (extract_signed, extract_unsigned): New functions.
243e0530
PE
7350 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7351 (xd_get_connection_references): Return ptrdiff_t, not int.
7352 All uses changed.
7353 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7354 (xd_read_message_1):
7355 Use int, not unsigned, where the dbus API uses int.
7356 (Fdbus_message_internal): Don't overflow mtype.
7357 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
7358 * dired.c (directory_files_internal, file_name_completion, scmp)
7359 (file_name_completion_stat):
7360 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7361 (file_name_completion): Don't overflow matchcount.
7362 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7363 * dispextern.h: Adjust decls to match defn changes elsewhere.
7364 (struct text_pos, struct glyph, struct bidi_saved_info)
7365 (struct bidi_string_data, struct bidi_it, struct composition_it)
7366 (struct it):
7367 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7368 (struct display_pos, struct composition_it, struct it):
7369 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7370 * dispnew.c (increment_matrix_positions)
7371 (increment_row_positions, mode_line_string)
7372 (marginal_area_string):
7373 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 7374 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
7375 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7376 (duration_to_sec_usec): New function, to check for overflow better.
7377 (Fsleep_for, sit_for): Use it.
7378 * doc.c (get_doc_string, store_function_docstring):
7379 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7380 (get_doc_string, Fsnarf_documentation):
7381 Use int, not EMACS_INT, where int is wide enough.
7382 (get_doc_string):
7383 Use SAFE_ALLOCA, not alloca.
7384 Check for overflow when converting EMACS_INT to off_t.
7385 * doprnt.c (doprnt):
7386 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7387 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7388 Don't assume uid_t fits into fixnum.
7389 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7390 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7391 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7392 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7393 (general_insert_function)
7394 (Finsert_char, make_buffer_string, make_buffer_string_both)
7395 (update_buffer_properties, Fbuffer_substring)
7396 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7397 (Fsubst_char_in_region, check_translation)
7398 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7399 (transpose_markers, Ftranspose_regions):
7400 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7401 (clip_to_bounds): Move to lisp.h as an inline function).
7402 (Fconstrain_to_field): Don't assume integers are nonnegative.
7403 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7404 (Fsubst_char_in_region, Fsave_restriction):
7405 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7406 (Femacs_pid): Don't assume pid_t fits into fixnum.
7407 (lo_time): Use int, not EMACS_INT, when int suffices.
7408 (lisp_time_argument): Check for usec out of range.
7409 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
7410 (Fuser_login_name, Fuser_full_name): Signal an error
7411 if a uid argument is out of range, rather than relying on
7412 undefined behavior.
c8d5c857
PE
7413 (Fformat_time_string): Remove now-unnecessary check.
7414 lisp_time_argument checks for out-of-range usec now.
243e0530 7415 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
7416 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7417 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7418 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7419 (init_cmdargs, Fdump_emacs):
7420 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7421 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7422 the bottom (typically) 32 bits of the fixnum.
7423 * eval.c (specpdl_size, call_debugger):
7424 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7425 (when_entered_debugger, Fbacktrace_debug):
7426 Don't assume fixnum can fit in int.
7427 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7428 the object just before a buffer; this is not portable.
7429 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7430 (grow_specpdl, unbind_to):
7431 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7432 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7433 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 7434 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
7435 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7436 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7437 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7438 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7439 (a_write, e_write):
7440 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7441 (Fcopy_file, non_regular_nbytes, read_non_regular)
7442 (Finsert_file_contents):
7443 Use int, not EMACS_INT, where int is wide enough.
7444 (READ_BUF_SIZE): Verify that it fits in int.
7445 (Finsert_file_contents): Check that counts are in proper range,
7446 rather than assuming fixnums fit into ptrdiff_t etc.
7447 Don't assume fixnums fit into int.
125b3835 7448 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
7449 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7450 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
7451 (string_char_to_byte, string_byte_to_char)
7452 (string_make_multibyte, string_to_multibyte)
7453 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7454 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7455 (substring_both, Fdelete, internal_equal, Ffillarray)
7456 (Fclear_string, mapcar1)
7457 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7458 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7459 (larger_vector, make_hash_table, maybe_resize_hash_table)
7460 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7461 (Fmaphash, secure_hash):
7462 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7463 (concat): Check for string index and length overflow.
7464 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7465 (Frequire):
7466 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7467 (larger_vector): New API (vec, incr_min, size_max) replaces old
7468 one (vec, new_size, init). This catches size overflow.
7469 INIT was removed because it was always Qnil.
7470 All callers changed.
7471 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7472 the upper bound on a hash table index size.
7473 (make_hash_table, maybe_resize_hash_table): Use it.
7474 (secure_hash): Computer start_byte and end_byte only after
7475 they're known to be in ptrdiff_t range.
7476 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7477 (Ffont_get_glyphs, Ffont_at):
7478 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7479 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7480 (Flist_fonts, Fopen_font):
7481 Don't assume fixnum can fit in int.
7482 (check_gstring): Don't assume index can fit in int.
7483 (font_match_p): Check that fixnum is a character, not a nonnegative
7484 fixnum, since the later code needs to stuff it into an int.
7485 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7486 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7487 conversion overflow issues.
7488 (Fopen_font): Check for integer out of range.
7489 (Ffont_get_glyphs): Don't assume index can fit in int.
7490 * font.h: Adjust decls to match defn changes elsewhere.
7491 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7492 integer overflow.
7493 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7494 printmax_t, where ptrdiff_t is wide enough.
7495 (Finternal_char_font):
7496 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7497 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7498 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7499 (Fset_frame_position, x_set_frame_parameters)
7500 (x_set_line_spacing, x_set_border_width)
7501 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7502 Check that fixnums are in proper range for system types.
7503 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7504 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7505 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7506 Use SAFE_ALLOCA_LISP, not alloca.
7507 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7508 intptr_t is wide enough.
7509 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7510 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7511 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7512 Check for fixnum out of range.
7513 * ftfont.c (ftfont_list): Don't assume index fits in int.
7514 Check that fixnums are in proper range for system types.
7515 (ftfont_shape_by_flt):
7516 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
7517 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7518 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7519 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7520 Check that fixnums are in proper range for system types.
7521 * gnutls.h: Adjust decls to match defn changes elsewhere.
7522 * gtkutil.c (xg_dialog_run):
7523 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7524 (update_frame_tool_bar):
7525 Check that fixnums are in proper range for system types.
7526 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 7527 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
7528 * indent.c (last_known_column, last_known_column_point):
7529 (current_column_bol_cache):
7530 (skip_invisible, current_column, check_display_width):
7531 (check_display_width, scan_for_column, current_column_1)
7532 (Findent_to, Fcurrent_indentation, position_indentation)
7533 (indented_beyond_p, Fmove_to_column, compute_motion):
7534 (Fcompute_motion, Fvertical_motion):
7535 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7536 (last_known_column_modified): Use EMACS_INT, not int.
7537 (check_display_width):
7538 (Fcompute_motion):
7539 Check that fixnums and floats are in proper range for system types.
7540 (compute_motion): Don't assume index or fixnum fits in int.
7541 (compute_motion, Fcompute_motion):
7542 Use int, not EMACS_INT, when it is wide enough.
7543 (vmotion): Omit local var start_hpos that is always 0; that way
7544 we don't need to worry about overflow in expressions involving it.
7545 * indent.h: Adjust decls to match defn changes elsewhere.
7546 (struct position):
7547 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7548 Use int, not EMACS_INT, where int is wide enough.
7549 Remove unused members ovstring_chars_done and tab_offset;
7550 all uses removed.
7551 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7552 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7553 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7554 (make_gap, copy_text, insert, insert_and_inherit)
7555 (insert_before_markers, insert_before_markers_and_inherit)
7556 (insert_1, count_combining_before, count_combining_after)
7557 (insert_1_both, insert_from_string)
7558 (insert_from_string_before_markers, insert_from_string_1)
7559 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7560 (adjust_after_replace, adjust_after_insert, replace_range)
7561 (replace_range_2, del_range, del_range_1, del_range_byte)
7562 (del_range_both, del_range_2, modify_region)
7563 (prepare_to_modify_buffer, signal_before_change)
7564 (signal_after_change, Fcombine_after_change_execute):
7565 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7566 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7567 (balance_an_interval, split_interval_right, split_interval_left)
7568 (find_interval, next_interval, update_interval)
7569 (adjust_intervals_for_insertion, delete_node, delete_interval)
7570 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7571 (static_offset_intervals, offset_intervals)
7572 (merge_interval_right, merge_interval_left, make_new_interval)
7573 (graft_intervals_into_buffer, temp_set_point_both)
7574 (temp_set_point, set_point, adjust_for_invis_intang)
7575 (set_point_both, move_if_not_intangible, get_property_and_range)
7576 (get_local_map, copy_intervals, copy_intervals_to_string)
7577 (compare_string_intervals, set_intervals_multibyte_1):
7578 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7579 * intervals.h: Adjust decls to match defn changes elsewhere.
7580 (struct interval):
7581 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7582 * keyboard.c (this_command_key_count, this_single_command_key_start)
7583 (before_command_key_count, before_command_echo_length, echo_now)
7584 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7585 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7586 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7587 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7588 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7589 (last_non_minibuf_size, last_point_position, echo_truncate)
7590 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7591 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7592 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7593 (stuff_buffered_input):
7594 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7595 (last_auto_save, command_loop_1, read_char):
7596 Use EMACS_INT, not int, to avoid integer overflow.
7597 (record_char): Avoid overflow in total_keys computation.
7598 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7599 * keyboard.h: Adjust decls to match defn changes elsewhere.
7600 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7601 (Fkey_description, Fdescribe_vector, Flookup_key):
7602 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7603 (click_position): New function, to check that positions are in range.
7604 (Fcurrent_active_maps):
7605 (describe_command):
7606 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7607 (Faccessible_keymaps, Fkey_description):
7608 (preferred_sequence_p):
7609 Don't assume fixnum can fit into int.
7610 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7611 Check for integer overflow in size calculations.
7612 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7613 avoid mishandling large integers.
7614 * lisp.h: Adjust decls to match defn changes elsewhere.
7615 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7616 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7617 (struct Lisp_Marker):
7618 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7619 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
7620 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7621 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7622 All callers changed.
7623 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7624 Assume the arg has valid form, since it always does.
7625 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7626 unsigned integer system type.
7627 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7628 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7629 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7630 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7631 (duration_to_sec_usec): New decl.
7632 * lread.c (read_from_string_index, read_from_string_index_byte)
7633 (read_from_string_limit, readchar, unreadchar, openp)
7634 (read_internal_start, read1, oblookup):
7635 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7636 (Fload, readevalloop, Feval_buffer, Feval_region):
7637 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7638 (openp): Check for out-of-range argument to 'access'.
7639 (read1): Use int, not EMACS_INT, where int is wide enough.
7640 Don't assume fixnum fits into int.
6efdadfd 7641 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
7642 (read_filtered_event): Use duration_to_sec_usec
7643 to do proper overflow checking on durations.
d311d28c
PE
7644 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7645 in size calculation.
7646 (Fexecute_kbd_macro):
7647 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7648 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7649 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7650 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7651 (set_marker_both, set_marker_restricted_both, marker_position)
7652 (marker_byte_position, Fbuffer_has_markers_at):
7653 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7654 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 7655 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
7656 It now merely ensures that the menu is large enough, without
7657 necessarily growing it, as this avoids some integer overflow issues.
7658 All callers changed.
7659 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7660 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7661 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7662 Use SAFE_ALLOCA_LISP, not alloca.
7663 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7664 to EMACS_INT. Check that fixnums are in proper range for system types.
7665 * minibuf.c (minibuf_prompt_width, string_to_object)
7666 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7667 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7668 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7669 (get_minibuffer, read_minibuf_unwind):
7670 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7671 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7672 this simplifies overflow checking. All callers changed.
7673 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7674 (Ftest_completion):
7675 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7676 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7677 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7678 Check that fixnums are in proper range for system types.
7679 (Fx_create_frame, Fx_show_tip):
7680 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7681 * nsfont.m (ns_findfonts, nsfont_list_family):
7682 Don't assume fixnum fits in long.
7683 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7684 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7685 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7686 wide enough.
17fdb222 7687 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
7688 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7689 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7690 (PRINTDECLARE, PRINTPREPARE):
7691 (strout, print_string):
7692 (print, print_preprocess, print_check_string_charset_prop)
7693 (print_object):
7694 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7695 (PRINTDECLARE):
7696 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7697 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7698 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 7699 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 7700 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
7701 (print_error_message): Use SAFE_ALLOCA, not alloca.
7702 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
7703 (print_depth, new_backquote_output, print_number_index):
7704 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
7705 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7706 (Fset_process_window_size, Fformat_network_address)
7707 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 7708 (sigchld_handler):
d311d28c 7709 Check that fixnums are in proper range for system types.
d44287d4 7710 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
7711 Check for process-ids out of pid_t range rather than relying on
7712 undefined behavior.
e4d81efc 7713 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
7714 (Fformat_network_address, read_process_output, send_process)
7715 (Fprocess_send_region, status_notify):
7716 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7717 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7718 (wait_reading_process_output, read_process_output, exec_sentinel):
7719 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7720 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7721 (Faccept_process_output): Use duration_to_sec_usec to do proper
7722 overflow checking on durations.
dde14581
PE
7723 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7724 Don't assume pid_t fits in int.
02481186
PE
7725 * process.h (struct Lisp_Process): Members tick and update_tick
7726 are now of type EMACS_INT, not int.
b62b53e8
PE
7727 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7728 configured --with-wide-int.
d311d28c
PE
7729 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7730 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7731 * search.c (looking_at_1, string_match_1):
7732 (fast_string_match, fast_c_string_match_ignore_case)
7733 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7734 (scan_newline, find_before_next_newline, search_command)
7735 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7736 (set_search_regs, wordify):
7737 (Freplace_match):
7738 (Fmatch_data):
7739 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7740 (string_match_1, search_buffer, set_search_regs):
7741 (Fmatch_data):
7742 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7743 (wordify): Check for overflow in size calculation.
7744 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7745 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7746 Check that fixnums are in proper range for system types.
7747 * sound.c (struct sound_device)
7748 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7749 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7750 (Fplay_sound_internal):
7751 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 7752 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
7753 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7754 (Fparse_partial_sexp):
7755 Don't assume fixnums can fit in int.
7756 (struct lisp_parse_state, find_start_pos, find_start_value)
7757 (find_start_value_byte, find_start_begv)
7758 (update_syntax_table, char_quoted, dec_bytepos)
7759 (find_defun_start, prev_char_comend_first, back_comment):
7760 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7761 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7762 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7763 (Finternal_describe_syntax_value): Check that match_lisp is a
7764 character, not an integer, since the code stuffs it into int.
7765 (scan_words, scan_sexps_forward):
7766 Check that fixnums are in proper range for system types.
7767 (Fforward_word):
7768 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7769 (scan_sexps_forward):
7770 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7771 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7772 * syntax.h: Adjust decls to match defn changes elsewhere.
7773 (struct gl_state_s):
7774 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
7775 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7776 MOST_POSITIVE_FIXNUM.
d311d28c
PE
7777 * sysdep.c (wait_for_termination_1, wait_for_termination)
7778 (interruptible_wait_for_termination, mkdir):
7779 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7780 (emacs_read, emacs_write):
7781 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
7782 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7783 and double all fit in int.
d311d28c
PE
7784 * term.c (set_tty_color_mode):
7785 Check that fixnums are in proper range for system types.
7786 * termhooks.h (struct input_event):
7787 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7788 * textprop.c (validate_interval_range, interval_of)
7789 (Fadd_text_properties, set_text_properties_1)
7790 (Fremove_text_properties, Fremove_list_of_text_properties)
7791 (Ftext_property_any, Ftext_property_not_all)
7792 (copy_text_properties, text_property_list, extend_property_ranges)
7793 (verify_interval_modification):
7794 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7795 (Fnext_single_char_property_change)
7796 (Fprevious_single_char_property_change):
7797 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
7798 (copy_text_properties):
7799 Check for integer overflow in index calculation.
d311d28c
PE
7800 * undo.c (last_boundary_position, record_point, record_insert)
7801 (record_delete, record_marker_adjustment, record_change)
7802 (record_property_change):
7803 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7804 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7805 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7806 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7807 (Fx_hide_tip, Fx_file_dialog):
7808 * w32menu.c (set_frame_menubar):
7809 Use ptrdiff_t, not int, for consistency with rest of code.
7810 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7811 (select_window, Fdelete_other_windows_internal)
7812 (window_scroll_pixel_based, window_scroll_line_based)
7813 (Frecenter, Fset_window_configuration):
7814 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7815 (Fset_window_hscroll, run_window_configuration_change_hook)
7816 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 7817 (Fscroll_other_window, Frecenter):
d311d28c
PE
7818 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7819 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7820 Don't assume fixnum fits in int.
7821 (Fset_window_scroll_bars):
7822 Check that fixnums are in proper range for system types.
7823 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7824 (string_pos, c_string_pos, number_of_chars, init_iterator)
7825 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7826 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7827 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
7828 (face_before_or_after_it_pos, handle_invisible_prop)
7829 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
7830 (display_prop_intangible_p, string_buffer_position_lim)
7831 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7832 (get_overlay_strings_1, get_overlay_strings)
7833 (iterate_out_of_display_property, forward_to_next_line_start)
7834 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7835 (get_next_display_element, set_iterator_to_next)
7836 (get_visually_first_element, compute_stop_pos_backwards)
7837 (handle_stop_backwards, next_element_from_buffer)
7838 (move_it_in_display_line_to, move_it_in_display_line)
7839 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7840 (add_to_log, message_dolog, message_log_check_duplicate)
7841 (message2, message2_nolog, message3, message3_nolog
7842 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7843 (current_message_1, truncate_echo_area, truncate_message_1)
7844 (set_message, set_message_1, store_mode_line_noprop)
7845 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7846 (text_outside_line_unchanged_p, check_point_in_composition)
7847 (reconsider_clip_changes)
7848 (redisplay_internal, set_cursor_from_row, try_scrolling)
7849 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7850 (redisplay_window, find_last_unchanged_at_beg_row)
7851 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7852 (trailing_whitespace_p, find_row_edges, display_line)
7853 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7854 (display_mode_element, store_mode_line_string)
7855 (pint2str, pint2hrstr, decode_mode_spec)
7856 (display_count_lines, display_string, draw_glyphs)
7857 (x_produce_glyphs, x_insert_glyphs)
7858 (rows_from_pos_range, mouse_face_from_buffer_pos)
7859 (fast_find_string_pos, mouse_face_from_string_pos)
7860 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7861 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7862 (safe_call, init_from_display_pos, handle_fontified_prop)
7863 (handle_single_display_spec, load_overlay_strings)
7864 (with_echo_area_buffer, setup_echo_area_for_printing)
7865 (display_echo_area, echo_area_display)
7866 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7867 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
7868 (redisplay_window, dump_glyph_row, display_mode_line)
7869 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 7870 (handle_display_spec, display_prop_string_p):
d311d28c
PE
7871 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7872 (handle_single_display_spec, build_desired_tool_bar_string)
7873 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7874 (get_specified_cursor_type):
7875 Check that fixnums are in proper range for system types.
7876 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7877 (Flookup_image_map):
7878 Don't assume fixnums fit in int.
7879 (compare_overlay_entries):
7880 Avoid mishandling comparisons due to subtraction overflow.
7881 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7882 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7883 (handle_tool_bar_click):
7884 Use int, not unsigned, since we prefer signed and the signedness
7885 doesn't matter here.
7886 (get_next_display_element, next_element_from_display_vector):
7887 Use int, not EMACS_INT, when int is wide enough.
7888 (start_hourglass): Use duration_to_sec_usec to do proper
7889 overflow checking on durations.
7890 * xfaces.c (Fbitmap_spec_p):
7891 Check that fixnums are in proper range for system types.
7892 (compare_fonts_by_sort_order):
7893 Avoid mishandling comparisons due to subtraction overflow.
7894 (Fx_family_fonts, realize_basic_faces):
7895 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7896 (Fx_family_fonts):
7897 Don't assume fixnum fits in int.
7898 Use SAFE_ALLOCA_LISP, not alloca.
7899 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7900 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7901 (face_at_buffer_position, face_for_overlay_string)
7902 (face_at_string_position):
7903 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7904 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7905 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7906 (Fx_show_tip):
7907 Check that fixnums are in proper range for system types.
7908 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7909 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7910 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7911 (Fx_change_window_property): Don't assume fixnums fit in int.
7912 * xfont.c (xfont_chars_supported):
7913 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7914 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7915 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7916 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7917 * xml.c (parse_region):
7918 * xrdb.c (magic_file_p):
7919 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7920 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7921 (x_get_local_selection, x_reply_selection_request)
7922 (x_handle_selection_request, wait_for_property_change):
7923 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7924 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7925 short is wide enough.
7926 (x_send_client_event): Don't assume fixnum fits in int.
7927 * xterm.c (x_x_to_emacs_modifiers):
7928 Don't assume EMACS_INT overflows nicely into int.
7929 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7930 may come from Lisp.
7931 (handle_one_xevent): NATNUMP can eval its arg twice.
7932 (x_connection_closed):
7933 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7934 * xterm.h: Adjust decls to match defn changes elsewhere.
7935 (struct scroll_bar): Use struct vectorlike_header
7936 rather than rolling our own approximation.
7937 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7938
c6574eb5
GM
79392012-05-25 Glenn Morris <rgm@gnu.org>
7940
7941 * lisp.mk (lisp): Update for more files being compiled now.
7942
e8d32c7e
SM
79432012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7944
48def666
SM
7945 * lread.c: Remove `read_pure' which makes no difference.
7946 (read_pure): Remove var.
7947 (unreadpure): Remove function.
7948 (readevalloop): Don't call read_list with -1 flag.
7949 (read1, read_vector): Don't test read_pure any more.
7950 (read_list): Simplify.
7951
e8d32c7e
SM
7952 * fileio.c, character.h: Minor style tweaks.
7953
4b2addb7
DA
79542012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7955
7956 * window.h (clip_changed): Remove useless declaration.
7957
584461b2
JB
79582012-05-22 Juanma Barranquero <lekktu@gmail.com>
7959
7960 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7961 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7962
34374650
PE
79632012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7964
7965 Remove src/m/*.
7966 This directory predates autoconf and is no longer needed nowadays.
7967 Move its few remaining bits of functionality to where they're needed.
7968 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7969 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7970 * m/template.h: Remove.
7971 * Makefile.in (M_FILE): Remove. All uses removed.
7972 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7973 * lisp.h (USE_LSB_TAG):
7974 * mem-limits.h (EXCEEDS_LISP_PTR):
7975 Use VAL_MAX, not VALBITS, in #if.
7976 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7977 (EMACS_UINT): Define unconditionally now.
7978 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7979 (BITS_PER_EMACS_INT): New constants, replacing
7980 what used to be in config.h, but not useful in #if.
7981 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7982 define them any more.
7983 (VAL_MAX): New macro.
7984 (VALMASK): Use it.
7985 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7986 BITS_PER_EMACS_INT, in #if.
7987 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7988 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7989 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7990 * s/ms-w32.h (DATA_START):
7991 Move here from removed file m/intel386.h.
7992 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7993 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7994
261cb4bb
PE
79952012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7996
7997 Assume C89 or later.
7998 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7999 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8000 (xrealloc):
8001 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8002 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8003 * textprop.c, tparam.c (NULL): Remove.
8004 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8005 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8006 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
8007 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8008 * xterm.c (input_signal_count): Assume volatile works.
8009
ff23cd9f
KB
80102012-05-21 Ken Brown <kbrown@cornell.edu>
8011
8012 * xgselect.c (xg_select): Fix first argument in call to 'select'
8013 (bug#11508).
8014
1b170bc6
KB
80152012-05-20 Ken Brown <kbrown@cornell.edu>
8016
8017 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 8018 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 8019
b2f4d39f
KB
80202012-05-19 Ken Brown <kbrown@cornell.edu>
8021
8022 * xfns.c (x_in_use): Remove `static' qualifier.
8023 * xterm.h (x_in_use): Declare.
8024 * xgselect.c: Include xterm.h.
8025 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8026 and `display_arg' (bug#9754).
8027
003fdae2
PE
80282012-05-19 Paul Eggert <eggert@cs.ucla.edu>
8029
9232a6d9
PE
8030 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
8031
003fdae2
PE
8032 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
8033 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8034
784b56e2
EZ
80352012-05-18 Eli Zaretskii <eliz@gnu.org>
8036
8037 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8038
8039 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 8040 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
8041
8042 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8043 reference to image_cache->refcount.
8044 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8045
a0a79cde
JL
80462012-05-17 Juri Linkov <juri@jurta.org>
8047
8048 * search.c (Fword_search_regexp, Fword_search_backward)
8049 (Fword_search_forward, Fword_search_backward_lax)
8050 (Fword_search_forward_lax): Move functions to isearch.el
8051 (bug#10145, bug#11381).
8052
b0572523
PE
80532012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8054
8055 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8056
9660f5fc
SM
80572012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8058
8059 * lread.c (init_obarray): Declare Qt and Qnil as special.
8060
4374de83
GM
80612012-05-14 Glenn Morris <rgm@gnu.org>
8062
8063 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 8064 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 8065
dc44c39a
PE
80662012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8067
078c97cb
PE
8068 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8069
dc44c39a
PE
8070 * unexaix.c: Port to more-recent AIX compilers.
8071 (report_error, report_error_1, make_hdr, copy_sym)
8072 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8073 Make arguments const char *, not char *, to avoid violations of C
8074 standard and to fix some AIX warnings reported by Gilles Pion.
8075
e18afed7 80762012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
8077
8078 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8079 already have overlays loaded.
8080 (handle_single_display_spec): Before returning without displaying
8081 fringe bitmap, synchronize the bidi iterator with the main display
8082 iterator, by calling iterate_out_of_display_property.
8083 (iterate_out_of_display_property): Detect buffer iteration by
8084 testing that it->string is a Lisp string.
8085 (get_next_display_element): When the current object is exhausted,
8086 and there's something on it->stack, call set_iterator_to_next to
8087 proceed with what's on the stack, instead of returning zero.
8088 (set_iterator_to_next): If called at the end of a Lisp string,
8089 proceed to consider_string_end without incrementing string
8090 position. Don't increment display vector index past the end of
8091 the display vector. (Bug#11417)
c8fb9dc6
EZ
8092 (pos_visible_p): Don't report a position visible when move_it_to
8093 stopped at the last line of window, which happens to be scanned
8094 backwards by the bidi iteration. (Bug#11464)
ac268e67 8095
e18afed7 80962012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
8097
8098 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8099 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
8100 are on a TTY, and thus unable to display on the fringes.
8101 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
8102 so we need to signal to the caller that this is a "replacing"
8103 display spec. This fixes display when the spec is invalid or we
8104 are on a TTY.
8105
e18afed7 81062012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
8107
8108 * unexaix.c (make_hdr): Fix typo in prototype.
8109 This bug broke the build on AIX. Problem reported by Gilles Pion.
8110
9d0a235a
MA
81112012-05-14 Michael Albinus <michael.albinus@gmx.de>
8112
8113 * keyboard.c (kbd_buffer_get_event): Read special events also in
8114 batch mode. (Bug#11415)
8115
9e6b06ed
GM
81162012-05-12 Glenn Morris <rgm@gnu.org>
8117
8118 * ns.mk: Update for ns_appbindir no longer having trailing "/".
8119
c1a1d7a3
EZ
81202012-05-12 Eli Zaretskii <eliz@gnu.org>
8121
8122 * lisp.mk (lisp): Add newcomment.elc.
8123
3fe7cdc8
GM
81242012-05-12 Glenn Morris <rgm@gnu.org>
8125
8126 * Makefile.in (MKDIR_P): New, set by configure.
8127 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
8128
53f7d2c0
PE
81292012-05-11 Paul Eggert <eggert@cs.ucla.edu>
8130
8131 Remove unused function hourglass_started.
8132 * dispextern.h (hourglass_started):
8133 * w32fns.c (hourglass_started):
8134 * xdisp.c (hourglass_started): Remove.
8135
75aafb17
JB
81362012-05-10 Juanma Barranquero <lekktu@gmail.com>
8137
8138 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
8139 Update dependencies.
8140
12959e8e
PE
81412012-05-10 Paul Eggert <eggert@cs.ucla.edu>
8142
97107e2e
PE
8143 * xgselect.c (xg_select): Put maxfds+1 into a var.
8144 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
8145
12959e8e
PE
8146 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
8147
836d29b3
DA
81482012-05-10 Dave Abrahams <dave@boostpro.com>
8149
8150 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
8151 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
8152
5cb67954
MA
81532012-05-09 Michael Albinus <michael.albinus@gmx.de>
8154
8155 * dbusbind.c (xd_registered_buses): New internal Lisp object.
8156 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
8157 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
8158 Initialize xd_registered_buses.
8159
3478ec45
PE
81602012-05-09 Paul Eggert <eggert@cs.ucla.edu>
8161
b263a6b0
PE
8162 Untag more efficiently if USE_LSB_TAG.
8163 This is based on a proposal by YAMAMOTO Mitsuharu in
8164 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
8165 For an admittedly artificial (nth 8000 longlist) benchmark on
8166 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
8167 Emacs's overall text size by 1%.
8168 * lisp.h (XUNTAG): New macro.
8169 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
8170 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
8171 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8172 * eval.c (Fautoload):
8173 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8174 * frame.h (XFRAME): Use XUNTAG.
8175
3478ec45
PE
8176 Port recent dbusbind.c changes to 32-bit --with-wide-int.
8177 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8178 Remove unportable assumptions about print widths of types like
8179 dbus_uint32_t.
8180 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8181 intptr_t when converting between pointer and integer, to avoid GCC
8182 warnings about wrong width.
8183
666b903b 81842012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
8185
8186 * w32proc.c (new_child): Force Windows to reserve only 64KB of
8187 stack for each reader_thread, instead of defaulting to 8MB
8188 determined by the linker. This avoids failures in creating
8189 subprocesses on Windows 7, see the discussion in this thread:
8190 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8191
b120cc17
JC
81922012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
8193
8194 Fix up display of the *Minibuf-0* buffer in the mini window.
8195 * keyboard.c (read_char): Don't clear the echo area if there's no
8196 message to clear.
8197 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 8198 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 8199
9a4b36f8
MA
82002012-05-07 Michael Albinus <michael.albinus@gmx.de>
8201
8202 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8203 batch mode.
8204
e5f9458f
CY
82052012-05-06 Chong Yidong <cyd@gnu.org>
8206
8207 * lisp.mk (lisp): Update.
8208
eceeb5fc 82092012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
8210
8211 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8212
71873e2b
SM
82132012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
8214
8215 * data.c (PUT_ERROR): New macro.
8216 (syms_of_data): Use it. Add new error type `user-error'.
8217 * undo.c (user_error): New function.
8218 (Fprimitive_undo): Use it.
8219 * print.c (print_error_message): Adjust print style for `user-error'.
8220 * keyboard.c (user_error): New function.
8221 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8222
ab0fa4e4
PE
82232012-05-03 Paul Eggert <eggert@cs.ucla.edu>
8224
8225 Do not limit current-time-string to years 1000..9999.
8226 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8227 (Fcurrent_time_string): Support any year that is supported by the
8228 underlying localtime representation. Don't use asctime, as it
8229 has undefined behavior for years outside the range -999..9999.
8230
7ed806a7
PE
82312012-05-02 Paul Eggert <eggert@cs.ucla.edu>
8232
8233 Fix race conditions involving setenv, gmtime, localtime, asctime.
8234 Without this fix, interrupts could mess up code that uses these
8235 nonreentrant functions, since setting TZ invalidates existing
8236 tm_zone or tzname values, and since most of these functions return
8237 pointers to static storage.
8238 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8239 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8240 Grow the critical sections to include not just invoking
8241 localtime/gmtime, but also accessing these functions' results
8242 including their tm_zone values if any, and any related TZ setting.
8243 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
8244 so that the struct tm is saved in the critical section.
8245 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
8246 motivated by the fact that memory allocation needs to be outside
8247 the critical section.
8248
0c16dfed
DA
82492012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
8250
8251 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8252 with RESET_INTERVAL.
8253
8254 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8255 Remove duplicated buffer name initialization.
8256
3f83ace8
JM
82572012-05-02 Jim Meyering <jim@meyering.net>
8258
8259 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8260
c7b8541e
JM
8261 * xfns.c (x_window): Use xstrdup (Bug#11375).
8262
90207a15 82632012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
8264
8265 * xdisp.c (pos_visible_p): If already at a newline from the
8266 display string before the 'while' loop, don't walk back the glyphs
8267 from it3.glyph_row. Solves assertion violation when the display
8268 string begins with a newline (egg.el). (Bug#11367)
8269
b593d6a9
AH
82702012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
8271
8272 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
8273 Move to simple.el.
8274
4737362e
GM
82752012-05-01 Glenn Morris <rgm@gnu.org>
8276
99cf43f9
GM
8277 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
8278 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
8279 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
8280 All were removed before 23.1.
8281
9311dcff
GM
8282 * dispnew.c: Remove HAVE_LIBNCURSES test;
8283 it is always true on relevant platforms.
8284
4d5c6349
GM
8285 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
8286 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
8287
4737362e
GM
8288 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
8289
74dd3a6b
AS
82902012-04-30 Andreas Schwab <schwab@linux-m68k.org>
8291
8292 * .gdbinit (xpr): Remove checks for no longer existing misc types.
8293 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8294 Remove.
8295
13c379ee
PE
82962012-04-28 Paul Eggert <eggert@cs.ucla.edu>
8297
8298 Do not avoid creating empty evaporating overlays (Bug#9642).
8299 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8300 That is, do not delete an evaporating overlay if it becomes
8301 empty after its bounds are adjusted to fit within its buffer.
8302 This fix caused other problems, and I'm reverting it until we get
8303 to the bottom of them.
8304
a8e7d6d7 83052012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
8306
8307 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8308
a8e7d6d7 83092012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
8310
8311 * xdisp.c (pos_visible_p): If the window start position is beyond
8312 ZV, start the display from buffer beginning. Prevents assertion
8313 violation in init_iterator when the minibuffer window is scrolled
8314 via the scroll bar.
8315
8316 * window.c (window_scroll_pixel_based): Likewise.
8317
a8e7d6d7 83182012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
8319
8320 * keymap.c (where_is_internal): Doc fix (Bug#10872).
8321
a8e7d6d7 83222012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
8323
8324 * fileio.c (Fcopy_file, Fset_file_selinux_context):
8325 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
8326
a8e7d6d7 83272012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 8328
b593d6a9
AH
8329 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8330 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 8331
1c6900d9
EZ
83322012-04-26 Eli Zaretskii <eliz@gnu.org>
8333
4c3fa1d9
EZ
8334 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8335 display element, check also the underlying string or buffer
8336 character. (Bug#11341)
8337
1c6900d9
EZ
8338 * w32menu.c: Include w32heap.h.
8339 (add_menu_item): If the call to AppendMenuW (via
8340 unicode_append_menu) fails, disable Unicode menus only if we are
8341 running on Windows 9X/Me.
8342
42bf8205
AS
83432012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8344
8345 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8346 (xgetint): Add missing shift for LSB tags.
8347
b1bac16e
MR
83482012-04-24 Martin Rudalics <rudalics@gmx.at>
8349
8350 * keyboard.c (read_char): Don't wipe echo area for select window
8351 events: These might get delayed via `mouse-autoselect-window'
8352 (Bug#11304).
8353
d69621cc
JB
83542012-04-24 Juanma Barranquero <lekktu@gmail.com>
8355
8356 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8357 manipulation of :loaded-from data.
8358
02fd101b
JB
83592012-04-23 Juanma Barranquero <lekktu@gmail.com>
8360
8361 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8362 now a cons (bug#11311).
8363
888bec30
PE
83642012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8365
89a438bd
PE
8366 Do not create empty overlays with the evaporate property (Bug#9642).
8367 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8368 if it becomes empty after its bounds are adjusted to fit within
8369 its buffer. Without this fix, in a nonempty buffer (let ((o
8370 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8371 yields an empty overlay that has the evaporate property, which is
8372 not supposed to happen.
8373
1068fe4d
PE
8374 Fix minor GTK3 problems found by static checking.
8375 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8376 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8377 (struct _EmacsFixedClass, emacs_fixed_get_type):
8378 Move decls here from emacsgtkfixed.h, since they needn't be public.
8379 (emacs_fixed_get_type): Now static.
8380 (emacs_fixed_class_init): Omit unused local.
8381 (emacs_fixed_child_type): Remove; unused.
8382 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8383 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8384 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8385 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8386 (EMACS_FIXED_GET_CLASS): Remove; unused.
8387 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8388
888bec30
PE
8389 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8390 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8391
de85e130
PE
83922012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8393
d0baac98 8394 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 8395 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
8396 (__malloc_size_t, __malloc_ptrdiff_t):
8397 Remove. All uses removed, replaced by the definiens if needed,
8398 since we can assume C89 or better now.
8399 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8400 (protect_malloc_state, align, get_contiguous_space)
8401 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8402 (malloc_atfork_handler_child, malloc_enable_thread)
8403 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8404 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8405 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8406 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8407 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8408 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8409 Define using prototypes, not old style.
8410 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8411 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8412 (align): Don't assume that signed integer overflow wraps around.
8413 Omit unused local var.
8414 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8415 (_free_internal_nolock, memalign, mallochook, reallochook):
8416 Omit no-longer-needed casts.
8417 (valloc): Use getpagesize, not __getpagesize.
8418 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8419 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8420
de85e130
PE
8421 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8422
dcbf5805
MA
84232012-04-22 Michael Albinus <michael.albinus@gmx.de>
8424
8425 Move functions from C to Lisp. Make non-blocking method calls
8426 the default. Implement further D-Bus standard interfaces.
8427
8428 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8429 (QCdbus_request_name_allow_replacement)
8430 (QCdbus_request_name_replace_existing)
8431 (QCdbus_request_name_do_not_queue)
8432 (QCdbus_request_name_reply_primary_owner)
8433 (QCdbus_request_name_reply_in_queue)
8434 (QCdbus_request_name_reply_exists)
8435 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8436 (QCdbus_registered_serial, QCdbus_registered_method)
8437 (QCdbus_registered_signal): New Lisp objects.
8438 (XD_DEBUG_MESSAGE): Use sizeof.
8439 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8440 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8441 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8442 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8443 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8444 (xd_signature, xd_append_arg): Allow float for integer types.
8445 (xd_get_connection_references): New function.
b593d6a9
AH
8446 (xd_get_connection_address): Rename from xd_initialize.
8447 Return cached address.
dcbf5805
MA
8448 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8449 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8450 level.
8451 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 8452 Return number of refcounts.
dcbf5805
MA
8453 (Fdbus_get_unique_name): Make stronger parameter check.
8454 (Fdbus_message_internal): New defun.
8455 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8456 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8457 (Fdbus_send_signal, Fdbus_register_service)
8458 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8459 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8460 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8461 (Vdbus_compiled_version, Vdbus_runtime_version)
8462 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8463 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8464 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
8465 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8466 Adapt docstring.
dcbf5805 8467
52828e02
PE
84682012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8469
da05bc4c
PE
8470 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8471 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8472 Do not assume ptrdiff_t is the same width as 'int'.
8473
52828e02
PE
8474 * alloc.c: Handle unusual debugging option combinations.
8475 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8476 since the two debugging options are incompatible.
8477 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8478 is defined.
8479 (mem_init, mem_insert, mem_insert_fixup):
8480 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8481 (NEED_MEM_INSERT): Remove; no longer needed.
8482
f01769f9
LL
84832012-04-22 Leo Liu <sdl.web@gmail.com>
8484
8485 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8486
5790543d
PE
84872012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8488
8489 * sysdep.c [__FreeBSD__]: Minor cleanups.
8490 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8491 Use Emacs indenting style more consistently. Avoid some casts.
8492 Use 'double' consistently rather than mixing 'float' and 'double'.
8493
b91b7e4d
EW
84942012-04-21 Eduard Wiebe <usenet@pusto.de>
8495
b593d6a9
AH
8496 * sysdep.c (list_system_processes, system_process_attributes):
8497 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 8498
6114eb15
AS
84992012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8500
8501 * lisp.mk (lisp): Update.
8502
2f38dff7
PE
85032012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8504
8505 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8506 It is never used otherwise.
8507
4ae29f89
SM
85082012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8509
8510 * print.c (print_preprocess): Only check print_depth if print-circle
8511 is nil.
8512 (print_object): Check for cycles even when print-circle is nil and
8513 print-gensym is t, but only check print_depth if print-circle is nil.
8514
f30d612a
CY
85152012-04-20 Chong Yidong <cyd@gnu.org>
8516
8517 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8518 set the status to "failed" and ensure that sentinel is run.
8519
c07a4c0b 85202012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
8521
8522 * process.c (Fset_process_inherit_coding_system_flag)
8523 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 8524 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 8525
c07a4c0b 85262012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
8527
8528 * xdisp.c (string_buffer_position_lim): Limit starting position to
8529 BEGV.
8530 (set_cursor_from_row): If called for a mode-line or header-line
8531 row, return zero immediately.
8532 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
8533 farther than the first row after the header line, if any.
8534 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
8535 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8536
c07a4c0b 85372012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8538
4ae29f89
SM
8539 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8540 (bug#11238).
ad3a2b41 8541
c07a4c0b 85422012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 85432012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
8544
8545 configure: new option --enable-gcc-warnings (Bug#11207)
8546 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8547 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8548 (ALL_CFLAGS): Use new macros rather than old.
8549 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8550 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8551 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8552 -Wunused-result, -Wunused-variable. This should go away once
8553 the Emacs and Gnulib regex code is merged.
8554 (xmalloc, xrealloc): Now static.
8555
aba027e8
PE
85562012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8557
8558 * dired.c (Fsystem_groups): Remove unused local.
8559
e5a36063
GM
85602012-04-17 Glenn Morris <rgm@gnu.org>
8561
8562 * dired.c (Fsystem_users): Doc fix.
8563
316411f0
DA
85642012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8565
8566 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8567 (syms_of_dired): Add them.
8568
9426aba4
PE
85692012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8570
b62a57be
PE
8571 Fix minor alloc.c problems found by static checking.
8572 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8573 New extern decls, to avoid calling undeclared functions.
8574 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8575 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8576 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8577 (NEED_MEM_INSERT): New macro.
8578 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 8579 Remove one incorrect comment and fix another.
b62a57be 8580
3539f31f
PE
8581 Fix minor ralloc.c problems found by static checking.
8582 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8583 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8584 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8585 (r_alloc_sbrk): Now static.
8586
a041960a
PE
8587 Improve ralloc.c interface checking.
8588 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8589 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8590 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8591 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8592 [REL_ALLOC]: ... to here, to check interface.
8593 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8594 Remove decls. This fixes an "It stinks!".
8595
9426aba4
PE
8596 * alloc.c (which_symbols): Fix alignment issue / type clash.
8597
d55c12ed
AS
85982012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8599
8600 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8601 (struct Lisp_Misc_Any): Likewise.
8602 (struct Lisp_Free): Likewise.
8603 * alloc.c (union aligned_Lisp_Symbol): Define.
8604 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8605 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8606 (union aligned_Lisp_Misc): Define.
8607 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8608 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 8609 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 8610
b948ce8b
PE
86112012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8612
8613 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8614 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8615 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8616 * s/netbsd.h, s/sol2-6.h:
8617 Remove definition of GC_MARK_STACK, since the default now works.
8618 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8619 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8620 no longer the default.
8621 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8622
35dc09a1 86232012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8624
35dc09a1
GM
8625 * lread.c (lisp_file_lexically_bound_p):
8626 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 8627
35dc09a1
GM
86282012-04-14 Eli Zaretskii <eliz@gnu.org>
8629
8630 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8631 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8632
86332012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8634
8635 * nsterm.m (constrainFrameRect): Always constrain when there is only
8636 one screen (Bug#10962).
8637
bcd86815
KB
86382012-04-13 Ken Brown <kbrown@cornell.edu>
8639
8640 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8641
c25df26e
RT
86422012-04-13 Reuben Thomas <rrt@sc3d.org>
8643
8644 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8645
0fc59f1e
DC
86462012-04-11 Daniel Colascione <dancol@dancol.org>
8647
8648 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8649 against is gone. It's better to use vfork now so that when Cygwin
8650 gains a new, working vfork, we use it automatically (bug#10398).
8651
de8c03dc
SM
86522012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8653
8654 * window.c (save_window_save): Obey window-point-insertion-type.
8655
2f097256
GM
86562012-04-11 Glenn Morris <rgm@gnu.org>
8657
8658 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8659
453b951e
SM
86602012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8661
8662 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8663
75f1671a 86642012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
8665
8666 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8667 (force_quit_count): New var.
8668 (handle_interrupt): Use it.
8669
2a8ce227
JB
86702012-04-10 Juanma Barranquero <lekktu@gmail.com>
8671
8672 * w32.c (w32_delayed_load): Record the full path of the library
8673 being loaded (bug#10424).
8674
935396c0
GM
86752012-04-09 Glenn Morris <rgm@gnu.org>
8676
05920a43
GM
8677 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8678 not just in the obarray, before snarfing them. (Bug#11036)
8679
935396c0
GM
8680 * Makefile.in ($(leimdir)/leim-list.el):
8681 Pass EMACS rather than BUILT_EMACS.
8682
a18ecafa
TZ
86832012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8684
8685 * process.c (make_process):
8686 * process.h: Add integer `gnutls_handshakes_tried' member to
8687 process struct.
8688
6bbef4e5
JC
8689 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8690 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
8691
8692 * gnutls.c (gnutls_log_function2i): Convenience log function.
8693 (emacs_gnutls_read): Use new log functions,
8694 `gnutls_handshakes_tried' process member, and
8695 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8696 attempts per process (connection).
8697
b4d3bc10
CY
86982012-04-09 Chong Yidong <cyd@gnu.org>
8699
8700 * eval.c (Fuser_variable_p, user_variable_p_eh)
8701 (lisp_indirect_variable): Functions deleted.
8702 (Fdefvar): Caller changed.
8703
8704 * callint.c (Finteractive, Fcall_interactively):
8705 * minibuf.c (Fread_variable): Callers changed.
8706
70f4d973
EZ
87072012-04-09 Eli Zaretskii <eliz@gnu.org>
8708
8709 * xdisp.c (set_cursor_from_row): If the display string appears in
8710 the buffer at position that is closer to point than the position
8711 after the display string, display the cursor on the first glyph of
8712 the display string. Fixes cursor display when a 'display' text
8713 property immediately follows invisible text. (Bug#11094)
8714
cb3c2e3e
PE
87152012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8716
8717 composite.c: use 'double' consistently
8718 * composite.c (get_composition_id): Use 'double' consistently
8719 instead of converting 'float' to 'double' and vice versa; this is
8720 easier to understand and avoids a GCC warning.
8721
fd06db5d
GM
87222012-04-09 Glenn Morris <rgm@gnu.org>
8723
50fe702a
GM
8724 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8725 preparation for dumping it with emacs. (Bug#4789)
8726 (leimdir): New variable.
8727 ($(leimdir)/leim-list.el): New rule.
8728 (emacs$(EXEEXT)): Depend on leim-list.el.
8729
fd06db5d
GM
8730 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8731 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8732 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8733
55c131ee
AS
87342012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8735
8736 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8737 proper alignment.
8738
9209588f
JB
87392012-04-07 Juanma Barranquero <lekktu@gmail.com>
8740
8741 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8742 Remove unused local variable.
8743
e3fb2efb
PE
87442012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8745
8746 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8747 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8748 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8749 objects, as mark_maybe_pointer will catch them otherwise.
8750 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8751 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8752
b5385551
PE
87532012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8754
8755 Fix typo that broke non-Windows builds.
8756 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8757
9078ead6
EZ
87582012-04-07 Eli Zaretskii <eliz@gnu.org>
8759
8760 Support building on MS-Windows with libxml2.
8761
8762 * makefile.w32-in (OBJ2): Add xml.$(O).
8763 (GLOBAL_SOURCES): Add xml.c.
8764 ($(BLD)/xml.$(O)): New dependency list.
8765
8766 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8767 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8768 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8769 [!WINDOWSNT]: New macros.
8770 (init_libxml2_functions, libxml2_loaded_p): New functions.
8771 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8772 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8773 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8774 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8775 linked in).
6bbef4e5
JC
8776 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8777 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
8778 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8779
8780 * emacs.c: Don't include libxml/parser.h.
8781 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8782 xmlCleanupParser directly.
8783
8784 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8785
3811fdf3
EZ
87862012-04-07 Eli Zaretskii <eliz@gnu.org>
8787
8788 * indent.c (Fvertical_motion): If there is a display string at
8789 point, use it.vpos to compute how many lines to backtrack after
8790 move_it_to point. (Bug#11133)
8791
2f8e16b2
EZ
87922012-04-06 Eli Zaretskii <eliz@gnu.org>
8793
8794 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8795 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8796 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8797 macros related to unification of CJK characters. For the details,
8798 see the discussion following the message here:
8799 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8800
3d439cd1
CY
88012012-04-04 Chong Yidong <cyd@gnu.org>
8802
8803 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8804
8bc53d00
EZ
88052012-04-01 Eli Zaretskii <eliz@gnu.org>
8806
8807 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8808 instead of alloca. (Bug#11138)
8809
3b0512a3
AS
88102012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8811
8812 * w32menu.c (is_simple_dialog): Properly check lisp types.
8813 (Bug#11141)
8814
8427ddd2
EZ
88152012-03-31 Eli Zaretskii <eliz@gnu.org>
8816
979022ef
EZ
8817 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8818 position we get to after a call to move_it_to fails the
8819 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8820 only if we wind up in a string from display property. (Bug#11063)
8821
a6b1c7cc
EZ
8822 * window.c (Fdelete_other_windows_internal): Invalidate the row
8823 and column information about mouse highlight, so that redisplay
8824 restores it after reallocating the glyph matrices. (Bug#7464)
8825
8427ddd2
EZ
8826 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8827 string comes from a `display' text property, use the buffer
8828 position of that property as if we actually saw that position in
8829 the row's glyphs.
697ba24b
EZ
8830 (move_it_by_lines): Remove the assertion that
8831 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8832 violated when there's a before-string at the beginning of a line.
8833 (Bug#11063)
8427ddd2 8834
65a0a738
EZ
88352012-03-30 Eli Zaretskii <eliz@gnu.org>
8836
8837 * xdisp.c (append_space_for_newline): If the default face was
8838 remapped, use the remapped face for the appended newline.
8839 (extend_face_to_end_of_line): Use the remapped default face for
8840 extending the face to the end of the line.
8841 (display_line): Call extend_face_to_end_of_line when the default
8842 face was remapped. (Bug#11068)
8843
581355cc
EZ
88442012-03-29 Eli Zaretskii <eliz@gnu.org>
8845
8846 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8847
e8fc049f
SM
88482012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8849
8850 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8851
4fb9a543
GM
88522012-03-27 Glenn Morris <rgm@gnu.org>
8853
8854 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8855 Doc fixes.
8856
679910f1
KH
88572012-03-26 Kenichi Handa <handa@m17n.org>
8858
8859 * dispextern.h (struct glyph): Fix previous change. Change the
8860 bit length of glyphless.ch to 25 (Bug#11082).
8861
90d49b7f
CY
88622012-03-26 Chong Yidong <cyd@gnu.org>
8863
8864 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8865 (command_loop_1): Use it; inhibit selection update for
8866 handle-select-window too (Bug#8996).
8867
f514f6f0
FP
88682012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8869
e8fc049f 8870 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 8871
bf43fa51
KH
88722012-03-25 Kenichi Handa <handa@m17n.org>
8873
8874 * dispextern.h (struct glyph): Change the bit length of
8875 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8876
8a0c01dd
EZ
88772012-03-24 Eli Zaretskii <eliz@gnu.org>
8878
8879 * s/ms-w32.h (tzname): Include time.h before redirecting to
8880 _tzname. Fixes the MSVC build. (Bug#9960)
8881
7d1c3a76
AS
88822012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8883
8ed79523
AS
8884 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8885 characters.
8886
7d1c3a76
AS
8887 * xterm.c (XTread_socket): Only modify handling_signal if
8888 !SYNC_INPUT. (Bug#11080)
8889
e99a9b8b
EZ
88902012-03-23 Eli Zaretskii <eliz@gnu.org>
8891
8892 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8893 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8894 when fetching a multibyte character consumes more bytes than
8895 CHAR_BYTES returns, due to unification of CJK characters in
8896 string_char. (Bug#11073)
8897
5063c0e1
TN
88982012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8899
8900 * process.c (wait_reading_process_output): Handle pty disconnect
8901 by refraining from sending oneself a SIGCHLD (bug#10933).
8902
9f851fbd
CY
89032012-03-22 Chong Yidong <cyd@gnu.org>
8904
8905 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8906
5063c0e1 8907 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
8908 Mark string as coming from a prefix property.
8909 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8910 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8911
fb5b8aca
CY
89122012-03-21 Chong Yidong <cyd@gnu.org>
8913
8914 * xfaces.c (Vface_remapping_alist): Doc fix.
8915
62356a1b
EZ
89162012-03-20 Eli Zaretskii <eliz@gnu.org>
8917
8918 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
8919 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8920 Doc fixes.
62356a1b 8921
025de85b
CY
89222012-03-20 Chong Yidong <cyd@gnu.org>
8923
8924 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8925 to reflect default non-nil value of redisplay-dont-pause.
8926
4827f94e
KH
89272012-03-19 Kenichi Handa <handa@m17n.org>
8928
8929 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8930 it fit in a valid range (Bug#11003).
8931
e50a24a2
EZ
89322012-03-18 Eli Zaretskii <eliz@gnu.org>
8933
8934 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8935 that is not from display property, accept the row as a "cursor
8936 row" if one of the string's character has a non-nil `cursor'
8937 property. Fixes cursor positioning when there are newlines in
8938 overlay strings, e.g. in icomplete.el. (Bug#11035)
8939
9af5ed87
PE
89402012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8941
8942 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8943
d1f55f16
CY
89442012-03-12 Chong Yidong <cyd@gnu.org>
8945
8946 * eval.c (inhibit_lisp_code): Rename from
8947 inhibit_window_configuration_change_hook; move from window.c.
8948
8949 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8950 * window.c (run_window_configuration_change_hook)
8951 (syms_of_window): Callers changed.
8952
66c5eebd
CY
89532012-03-11 Chong Yidong <cyd@gnu.org>
8954
413df973
CY
8955 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8956
66c5eebd
CY
8957 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8958
1de11f56
CY
89592012-03-10 Chong Yidong <cyd@gnu.org>
8960
8961 * frame.c (other_visible_frames): Don't assume the selected frame
8962 is visible (Bug#10955).
8963
cae07000
SM
89642012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8965
8966 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8967
89c94350
JD
89682012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8969
8970 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8971 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8972 zero (Bug#10954).
8973
999dd333
GM
89742012-03-03 Glenn Morris <rgm@gnu.org>
8975
01a6dcc8 8976 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 8977
de0100f2
EZ
89782012-03-02 Eli Zaretskii <eliz@gnu.org>
8979
8980 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8981 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
8982 (redisplay_window, next_element_from_string): Fix typos in
8983 comments.
3e441275
EZ
8984 (redisplay_window): Pass to move_it_vertically the margin in
8985 pixels, not in screen lines.
de0100f2 8986
96a72ee9
GM
89872012-03-02 Glenn Morris <rgm@gnu.org>
8988
8989 * buffer.c (buffer-list-update-hook): Doc fix.
8990
312508d7
EZ
89912012-02-29 Eli Zaretskii <eliz@gnu.org>
8992
8993 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8994 push_it before setting up the iterator for the first overlay
8995 string, even if we have an empty string loaded.
8996 (next_overlay_string): If there's an empty string on the iterator
8997 stack, pop the stack. (Bug#10903)
8998
27f3c637
PE
89992012-02-25 Paul Eggert <eggert@cs.ucla.edu>
9000
9001 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9002 Suggested by Stefan Monnier in
9003 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9004 * alloc.c (widen_to_Lisp_Object): New static function.
9005 (mark_memory): Also mark Lisp_Objects by fetching pointer words
9006 and widening them to Lisp_Objects. This would work even if
9007 USE_LSB_TAG is defined and wide integers are used, which might
9008 happen in a future version of Emacs.
9009
3c9dfce6
CY
90102012-02-25 Chong Yidong <cyd@gnu.org>
9011
fa74b241
CY
9012 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9013 Doc fix.
9014
3c9dfce6
CY
9015 * xselect.c (Fx_selection_exists_p): Doc fix.
9016 (x_clipboard_manager_save_all): Print an informative message
9017 before saving to clipboard manager.
9018
9486df08
CY
90192012-02-24 Chong Yidong <cyd@gnu.org>
9020
9021 * keyboard.c (process_special_events): Handle all X selection
9022 requests in kbd_buffer, not just the next one (Bug#8869).
9023
f01d3321
CY
90242012-02-23 Chong Yidong <cyd@gnu.org>
9025
9026 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9027 call when setting menu-bar-lines and tool-bar-lines parameters.
9028 (unwind_create_frame_1): New helper function.
9029
9030 * window.c (inhibit_window_configuration_change_hook): New var.
9031 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 9032 (syms_of_window): Initialize it.
f01d3321 9033
86b847b6
CY
90342012-02-22 Chong Yidong <cyd@gnu.org>
9035
9036 * xterm.c (x_draw_image_relief): Add missing type check for
9037 Vtool_bar_button_margin (Bug#10743).
9038
a59225b1
CY
90392012-02-21 Chong Yidong <cyd@gnu.org>
9040
9041 * fileio.c (Vfile_name_handler_alist): Doc fix.
9042
9043 * buffer.c (Fget_file_buffer): Protect against invalid file
9044 handler return value.
9045
310f5bd4
PE
90462012-02-20 Paul Eggert <eggert@cs.ucla.edu>
9047
cb3a28cc
PE
9048 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9049 when computing $valmask.
9050
310f5bd4
PE
9051 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9052 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9053 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9054 It's useless in that case, and it can cause problems on hosts
9055 that allocate halves of EMACS_INT values separately.
9056 Reported by Dan Horák. Diagnosed by Andreas Schwab in
9057 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9058 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9059 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
9060 it avoids undefined behavior on hosts where shifting right by more
9061 than the word width has undefined behavior.
9062
2375c96a
CY
90632012-02-19 Chong Yidong <cyd@gnu.org>
9064
9065 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9066 (Funhandled_file_name_directory, Ffile_name_as_directory)
9067 (Fdirectory_file_name, Fexpand_file_name)
9068 (Fsubstitute_in_file_name): Protect against invalid file handler
9069 return values (Bug#10845).
9070
3eb49e71
EZ
90712012-02-18 Eli Zaretskii <eliz@gnu.org>
9072
9073 * .gdbinit (pitx): Fix incorrect references to fields of the
9074 iterator stack.
9075
7b926f3f
CY
90762012-02-17 Chong Yidong <cyd@gnu.org>
9077
9078 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9079
11273115
PE
90802012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9081
9082 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9083 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9084
c3a70e2b
CY
90852012-02-15 Chong Yidong <cyd@gnu.org>
9086
9087 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9088 marked as special. Also, starting docstrings with * is obsolete.
9089
0ca43699
AS
90902012-02-13 Andreas Schwab <schwab@linux-m68k.org>
9091
9092 * gnutls.c (emacs_gnutls_write): Fix last change.
9093
2e8f3c56
LI
90942012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
9095
9096 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9097 send_process.
9098
af70074f
SM
90992012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
9100
9101 * keymap.c (Fsingle_key_description): Handle char ranges.
9102
95986d52
CY
91032012-02-12 Chong Yidong <cyd@gnu.org>
9104
afd83bd1
CY
9105 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9106 as that creates a dangerous corner case.
9107
95986d52
CY
9108 * window.c (Fdelete_window_internal): Invalidate the mouse
9109 highlight (Bug#9904).
9110
bd7da63e
GM
91112012-02-12 Glenn Morris <rgm@gnu.org>
9112
9113 * xselect.c (Fx_own_selection_internal)
9114 (Fx_get_selection_internal, Fx_disown_selection_internal)
9115 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
9116 * nsselect.m (Fx_own_selection_internal)
9117 (Fx_disown_selection_internal, Fx_selection_exists_p)
9118 (Fx_selection_owner_p, Fx_get_selection_internal):
9119 Sync docs and argument specs with the xselect.c versions.
9120
77abcbc2
LI
91212012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
9122
9123 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
9124
90b671e2
EZ
91252012-02-11 Eli Zaretskii <eliz@gnu.org>
9126
1c0ca0b7
EZ
9127 * w32select.c (Fx_selection_exists_p): Sync doc string and
9128 argument list with xselect.c. (Bug#10783)
9129
9130 * w16select.c (Fx_selection_exists_p): Sync doc string and
9131 argument list with xselect.c. (Bug#10783)
90b671e2 9132
49241268
GM
91332012-02-10 Glenn Morris <rgm@gnu.org>
9134
9135 * fns.c (Fsecure_hash): Doc fix.
9136
f998bbe7 91372012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
9138
9139 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
9140
0992bd9c
CY
91412012-02-07 Chong Yidong <cyd@gnu.org>
9142
9143 * buffer.c (Fbuffer_local_variables)
9144 (buffer_lisp_local_variables): Handle unbound vars correctly;
9145 don't let Qunbound leak into Lisp.
9146
af008560
GM
91472012-02-07 Glenn Morris <rgm@gnu.org>
9148
dd605cc4
GM
9149 * image.c (Fimagemagick_types): Doc fix.
9150
af008560
GM
9151 * image.c (imagemagick-render-type): Change it from a lisp object
9152 to an integer. Move the doc here from the lisp manual.
9153 Treat all values not equal to 0 the same.
9154
1449fa1d
CY
91552012-02-06 Chong Yidong <cyd@gnu.org>
9156
9157 * doc.c (store_function_docstring): Avoid applying docstring of
9158 alias to base function (Bug#2603).
9159
3723ec07
AS
91602012-02-04 Andreas Schwab <schwab@linux-m68k.org>
9161
9162 * .gdbinit (pp1, pv1): Remove redundant defines.
9163 (pr): Use pp.
9164
79c1cc1e
CY
91652012-02-04 Chong Yidong <cyd@gnu.org>
9166
9167 * nsterm.m: Declare a global (Bug#10694).
9168
d7f29f8e
EZ
91692012-02-04 Eli Zaretskii <eliz@gnu.org>
9170
cae07000
SM
9171 * w32.c (get_emacs_configuration_options):
9172 Include --enable-checking, if specified, in the return value.
d7f29f8e 9173
3b95a6f9
MR
91742012-02-04 Martin Rudalics <rudalics@gmx.at>
9175
9176 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9177 after rounding frame sizes. (Bug#9723)
9178
d6fa96a6
EZ
91792012-02-04 Eli Zaretskii <eliz@gnu.org>
9180
9181 * keyboard.c (adjust_point_for_property): Don't position point
9182 before BEGV. (Bug#10696)
9183
df0b2940
PE
91842012-02-03 Paul Eggert <eggert@cs.ucla.edu>
9185
9186 Handle overflow when computing char display width (Bug#9496).
9187 * character.c (char_width): Return EMACS_INT, not int.
9188 (char_width, c_string_width): Check for overflow when
9189 computing the width; this is possible now that individual
9190 characters can have unbounded width. Problem introduced
9191 by merge from Emacs 23 on 2012-01-19.
9192
6bee44d6
MA
91932012-02-02 Michael Albinus <michael.albinus@gmx.de>
9194
9195 * dbusbind.c (Fdbus_register_method): Mention the return value
9196 :ignore in the docstring.
9197
44f92739
GM
91982012-02-02 Glenn Morris <rgm@gnu.org>
9199
1b9f60cc
GM
9200 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9201
44f92739
GM
9202 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9203 Unconditionally set to t. (Bug#10673)
9204 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9205 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9206 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9207
c5d3843c
KH
92082012-02-02 Kenichi Handa <handa@m17n.org>
9209
9210 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
9211 0, do not call append_composite_glyph.
9212
159462d4 92132012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
9214
9215 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9216 NULL (Bug#6988).
9217 (x_produce_glyphs): If the component of a composition is a null
9218 string, set it->pixel_width to 1 to avoid zero-width glyph.
9219
78cef877
EZ
92202012-02-01 Eli Zaretskii <eliz@gnu.org>
9221
9222 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9223 first 2 arguments are identical. This makes inserting large
9224 output from a subprocess an order of magnitude faster on
9225 MS-Windows, where all sbrk'ed memory is always contiguous.
9226
97897668
GM
92272012-01-31 Glenn Morris <rgm@gnu.org>
9228
9229 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 9230 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
9231 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9232
31fd3586
GM
92332012-01-29 Glenn Morris <rgm@gnu.org>
9234
9235 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9236
0e24a8b2
CY
92372012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
9238
9239 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9240
cc0adcb0
CY
92412012-01-28 Chong Yidong <cyd@gnu.org>
9242
9243 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9244
acc28cb9
CY
92452012-01-26 Chong Yidong <cyd@gnu.org>
9246
9c69cfb7
CY
9247 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9248
acc28cb9
CY
9249 * search.c (Fsearch_forward, Fsearch_backward): Document negative
9250 repeat counts (Bug#10507).
9251
48da7392
GM
92522012-01-26 Glenn Morris <rgm@gnu.org>
9253
9254 * lread.c (syms_of_lread): Doc fix.
9255
14af5f7f
CY
92562012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
9257
9258 * coding.c (encode_designation_at_bol): Change return value to
9259 EMACS_INT.
9260
0b21c100
CY
92612012-01-25 Chong Yidong <cyd@gnu.org>
9262
9263 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
9264
3c2907f7
CY
92652012-01-21 Chong Yidong <cyd@gnu.org>
9266
9267 * floatfns.c (Fcopysign): Make the second argument non-optional,
9268 since nil is not allowed anyway.
9269
959ad23f
AS
92702012-01-21 Andreas Schwab <schwab@linux-m68k.org>
9271
9272 * process.c (read_process_output): Use p instead of XPROCESS (proc).
9273 (send_process): Likewise.
9274
34a02f46
MR
92752012-01-19 Martin Rudalics <rudalics@gmx.at>
9276
9277 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
9278 (Vwindow_persistent_parameters): Do not use Qstate.
9279 Rewrite doc-strings.
34a02f46 9280
1259009a 92812012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
9282
9283 * character.c (char_width): New function.
70d4fdf6
GM
9284 (Fchar_width, c_string_width, lisp_string_width):
9285 Use char_width (Bug#9496).
25ed9e61 9286
6a6ee00d
MR
92872012-01-16 Martin Rudalics <rudalics@gmx.at>
9288
9289 * window.c (Vwindow_persistent_parameters): New variable.
9290 (Fset_window_configuration, save_window_save): Handle persistent
9291 window parameters.
9292
c85efaf7
EZ
92932012-01-14 Eli Zaretskii <eliz@gnu.org>
9294
9295 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9296 thrashing the stack of the thread. (Bug#9087)
9297
5944709e
PE
92982012-01-12 Paul Eggert <eggert@cs.ucla.edu>
9299
9300 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9301
e71f5d99
EZ
93022012-01-11 Eli Zaretskii <eliz@gnu.org>
9303
9304 * xdisp.c (rows_from_pos_range): Handle the case where the
9305 highlight ends on a newline. (Bug#10464)
9306 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9307 he end column for display of highlight that ends on a newline
9308 before a R2L line.
9309
ce316182
GM
93102012-01-11 Glenn Morris <rgm@gnu.org>
9311
9312 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9313 from load-path also when installation-directory is nil. (Bug#10208)
9314
5b43da69
GM
93152012-01-10 Glenn Morris <rgm@gnu.org>
9316
74cc8ff9
GM
9317 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9318
7d8d6e4e
GM
9319 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9320 Update template values to be closer to their typical values these days.
5b43da69 9321
a0db8d43
EZ
93222012-01-09 Eli Zaretskii <eliz@gnu.org>
9323
9324 * xdisp.c (rows_from_pos_range): Accept additional argument
9325 DISP_STRING, and accept any glyph in a row whose object is that
9326 string as eligible for mouse highlight. Fixes mouse highlight of
9327 display strings from overlays. (Bug#10464)
9328
9a0115ab 93292012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 9330
b9110d6a 9331 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
9332 * fileio.c (auto_saving_dir_umask): New static var.
9333 (Fmake_directory_internal): Use it.
9334 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9335 creating the directory. The old code temporarily assigns
9336 too-generous permissions to the directory.
9337 (do_auto_save_eh): Clear it.
b9110d6a 9338 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
9339 that the var is always cleared.
9340
6c1bd3f3
EZ
93412012-01-07 Eli Zaretskii <eliz@gnu.org>
9342
9343 * search.c (scan_buffer): Pass character positions to
9344 know_region_cache, not byte positions. (Bug#6540)
9345
069d2b50
L
93462012-01-07 LynX <_LynX@bk.ru> (tiny change)
9347
9348 * w32.c (sys_rename): Report EXDEV when rename of a directory
9349 fails because the target is on another logical disk. (Bug#10284)
9350
75bf0d33
DB
93512012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9352
9353 * xterm.c (x_embed_request_focus): New function.
9354
9355 * xterm.h: Add prototype.
9356
9357 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9358
1c6e5a32
GM
93592012-01-05 Glenn Morris <rgm@gnu.org>
9360
9361 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9362
651e947e
EZ
93632012-01-01 Eli Zaretskii <eliz@gnu.org>
9364
9365 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9366 Load gnutls_transport_set_lowat only if GnuTLS version is below
9367 2.11.1.
9368 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9369 GnuTLS versions below 2.11.1.
9370
3778cdd8
AL
93712011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9372
9373 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9374 to the doc string advising against its use for altering the way
9375 windows are scrolled.
9376
0e5317f7
KH
93772011-12-28 Kenichi Handa <handa@m17n.org>
9378
9379 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9380 coding-system ASCII compatible only when it does not produce BOM
9381 on encoding (Bug#10383).
9382
93d5ca1f
JD
93832011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9384
9385 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9386 can scroll.
9387 (create_and_show_popup_menu): Always use menu_position_func for
9388 Gtk3 (Bug#10361).
9389
ca22b785
AS
93902011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9391
9392 * callint.c (Fcall_interactively): Don't truncate prompt string.
9393
d048e1e6
EZ
93942011-12-23 Eli Zaretskii <eliz@gnu.org>
9395
9396 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9397 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 9398 resumed from there (after widening). (Bug#10360)
d048e1e6 9399
5ccaba1f
JD
94002011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9401
9402 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9403
204ee57f
JD
94042011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9405
b81d40f0
JB
9406 * nsterm.m (x_free_frame_resources):
9407 Release f->output_data.ns->miniimage.
204ee57f
JD
9408 (ns_index_color): Fix indentation. Do not retain
9409 color_table->colors[i].
9410
9411 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9412 before returning.
9413
9414 * nsfns.m (x_set_background_color): Assign return value from
9415 ns_index_color to face-background instead of NSColor*.
9416 (ns_implicitly_set_icon_type): Fix indentation.
9417 Change assignment in for loop to comparison.
9418
9419 * emacs.c (ns_pool): New variable.
9420 (main): Assign ns_pool.
9421 (Fkill_emacs): Call ns_release_autorelease_pool.
9422
9423 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9424 autorelease fdesc, release fdAttrs and tdict.
9425 (ns_get_covering_families): Release charset.
9426 (ns_findfonts): Release NSFontDescriptor created with new.
9427 (ns_uni_to_glyphs): Fix indentation.
9428 (setString): Release attrStr before assigning new value.
9429
c803b2b7
JD
94302011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9431
678f4426
JD
9432 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9433 and NS_IMPL_COCOA.
9434 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9435 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9436
cd394be1 94372011-12-18 David Reitter <reitter@cmu.edu>
678f4426 9438
5fecd5fc
JD
9439 * nsterm.m (ns_term_init): Subscribe for notifications
9440 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9441 to method trackingNotification in EmacsMenu.
9442
9443 * nsmenu.m (trackingMenu): New variable.
3771cb17 9444 (trackingNotification): New method (from Aquamacs).
5fecd5fc 9445 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 9446 from Aquamacs (Bug#7030).
678f4426
JD
9447
94482011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 9449
c803b2b7
JD
9450 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9451 (symbol_to_nsstring): Fix indentation.
9452 (ns_symbol_to_pb): New function.
cae07000
SM
9453 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9454 (Fns_rotate_cut_buffers_internal): Remove.
9455 (Fns_store_selection_internal): Rename from
c803b2b7
JD
9456 Fns_store_cut_buffer_internal.
9457 (ns_get_foreign_selection, Fx_own_selection_internal)
9458 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
9459 (Fns_get_selection_internal, Fns_store_selection_internal):
9460 Use ns_symbol_to_pb and check if return value is nil.
9461 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9462 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
9463 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9464 renamed to Sns_store_selection_internal.
9465 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9466 and remove this function.
9467 (ns_handle_selection_clear): Remove, never used.
9468 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9469 here.
9470
e1b01a3a
KB
94712011-12-17 Ken Brown <kbrown@cornell.edu>
9472
9473 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9474 GID is unknown (Bug#10257).
9475
2adb6e85
PE
94762011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9477
9478 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9479 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9480 which caused a build failure on GNU/Linux IA-64. This problem was
9481 introduced by my 2011-10-07 patch.
9482
d1d7b339
JL
94832011-12-15 Juri Linkov <juri@jurta.org>
9484
9485 * image.c (imagemagick_error): New function. (Bug#10112)
9486 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9487 Use `imagemagick_error' where ImageMagick functions return
9488 `MagickFalse'.
9489 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9490 proper order.
9491
100d5755
KH
94922011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9493
9494 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9495 fill background (Bug#8992).
9496
454592a6
MR
94972011-12-13 Martin Rudalics <rudalics@gmx.at>
9498
9499 * window.c (Vwindow_combination_resize)
9500 (Vwindow_combination_limit): Use t instead of non-nil in
9501 doc-strings.
61d4b438
MR
9502 (Vrecenter_redisplay): Add first sentence of doc-string on
9503 separate line.
53524d93 9504 (Frecenter): Fix doc-string typo.
454592a6 9505
3633e3aa
KH
95062011-12-11 Kenichi Handa <handa@m17n.org>
9507
9508 * coding.c (Funencodable_char_position): Pay attention to the
9509 buffer text relocation (Bug#9389).
9510
7b9d523a 95112011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 9512
7b9d523a
JD
9513 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9514 gtk_init (Bug#10100).
9515
b73189c6
EZ
95162011-12-10 Eli Zaretskii <eliz@gnu.org>
9517
9518 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9519 IT->string is nil. (Bug#10263)
9520
f7dfe5d6
JD
95212011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9522
83faebb4
JD
9523 * nsterm.h (x_free_frame_resources): Declare.
9524
f7dfe5d6
JD
9525 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9526 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9527
9528 * nsterm.h (ns_get_defaults_value): Declare.
9529
9530 * nsterm.m (ns_default): Call ns_get_defaults_value.
9531
7cd4e72c
EZ
95322011-12-09 Eli Zaretskii <eliz@gnu.org>
9533
9534 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9535 (Bug#10170)
9536
b34d7317
YM
95372011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9538
9539 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9540 that where the value of an _OBJC_* symbol points to is in the .bss
9541 section (Bug#10240).
9542
76470ad1
KH
95432011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9544
9545 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 9546 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 9547
745fff94
KH
95482011-12-08 Kenichi Handa <handa@m17n.org>
9549
9550 * ftfont.c (get_adstyle_property): Fix previous change
9551 (Bug#10233).
9552
6e44397c
JB
95532011-12-07 Juanma Barranquero <lekktu@gmail.com>
9554
9555 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9556 dirs from the default value of EMACSLOADPATH (bug#10208).
9557
7efa6272
GM
95582011-12-07 Glenn Morris <rgm@gnu.org>
9559
9560 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9561 installation and source directories as well. (Bug#10208)
9562
f6fc4d87
CY
95632011-12-06 Chong Yidong <cyd@gnu.org>
9564
9565 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9566
2bf26180
GM
95672011-12-06 Glenn Morris <rgm@gnu.org>
9568
9569 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9570 as an error, not just -1. (Bug#10217)
9571
3a6ad4f0
CY
95722011-12-05 Chong Yidong <cyd@gnu.org>
9573
9574 * keyboard.c (process_special_events): New function.
9575 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9576
75a3b399
PE
95772011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9578
9579 * coding.c (encode_designation_at_bol): Don't use uninitialized
9580 local variable (Bug#9318).
9581
c3c9e25e
KH
95822011-12-05 Kenichi Handa <handa@m17n.org>
9583
9584 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9585 return Qnil (Bug#8046, Bug#10193).
9586
5eb05ea3
KH
95872011-12-05 Kenichi Handa <handa@m17n.org>
9588
9589 * coding.c (encode_designation_at_bol): New args charbuf_end and
9590 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
9591 (coding_set_source): Return how many bytes coding->source was
9592 relocated.
9593 (coding_set_destination): Return how many bytes
9594 coding->destination was relocated.
9595 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 9596 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
9597
95982011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9599
9600 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9601 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9602 macro (Bug#9318).
9603
96042011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9605
9606 The following changes are to fix Bug#9318.
9607
a79703f5 9608 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
9609 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9610 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 9611 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 9612
7dbda6df
JB
96132011-12-05 Juanma Barranquero <lekktu@gmail.com>
9614
9615 * lisp.h (process_quit_flag): Fix external declaration.
9616
6d5eb5b0
SM
96172011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9618
9619 Don't macro-inline non-performance-critical code.
9620 * eval.c (process_quit_flag): New function.
9621 * lisp.h (QUIT): Use it.
9622
a0c3fad0
JD
96232011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9624
9625 * nsfns.m (get_geometry_from_preferences): New function.
9626 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9627
6c07aac2
AS
96282011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9629
9630 * emacs.c (Qkill_emacs): Define.
9631 (syms_of_emacs): Initialize it.
9632 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9633 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
9634 (quit_throw_to_read_char): Add parameter `from_signal'.
9635 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
9636 * lisp.h (QUIT): Call Fkill_emacs if requested.
9637
c052ead4
JD
96382011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9639
9640 * widget.c (update_wm_hints): Return if wmshell is null.
9641 (widget_update_wm_size_hints): New function.
9642
9643 * widget.h (widget_update_wm_size_hints): Declare.
9644
9645 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9646 widget_update_wm_size_hints (Bug#10104).
9647
9e49252b
EZ
96482011-12-03 Eli Zaretskii <eliz@gnu.org>
9649
9650 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9651 before a newline, prepare the bidi iterator for consuming the
9652 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 9653 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 9654
02b16839
JL
96552011-12-02 Juri Linkov <juri@jurta.org>
9656
9657 * search.c (Fword_search_regexp): New Lisp function created from
9658 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9659 (Fword_search_backward, Fword_search_forward)
9660 (Fword_search_backward_lax, Fword_search_forward_lax):
9661 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9662 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9663
0068070e
SM
96642011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9665
9666 * fileio.c (Finsert_file_contents): Move after-change-function call
9667 to before the "handled:" label, since all "goto handled" appear in
9668 cases where the *-change-functions have already been properly called
9669 (bug#10117).
9670
3360a3fc
AS
96712011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9672
9673 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9674 waiting for input. (Bug#10169)
9675
73d6c093
EZ
96762011-11-30 Eli Zaretskii <eliz@gnu.org>
9677
9678 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9679 verifies glyph row's hash code--we have just reallocated the
9680 glyphs, so their contents can be complete garbage. (Bug#10164)
9681
febe6bea
JB
96822011-11-30 Juanma Barranquero <lekktu@gmail.com>
9683
9684 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9685
801a4313
EZ
96862011-11-30 Eli Zaretskii <eliz@gnu.org>
9687
9688 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9689 attributes are tested _before_ calling verify_row_hash, to protect
9690 against GCC re-ordering of the tests. (Bug#10164)
9691
2b56b87e
JD
96922011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9693
9694 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9695
9696 * xterm.c (handle_one_xevent): Only set async_visible and friends
9697 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 9698 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
9699 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9700
dbf31225
PE
97012011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9702
9703 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9704 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9705 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9706 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9707 All uses changed to use GCPRO1 etc.
9708 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9709 Revert to old implementation (i.e., before 2011-03-11).
9710
1305621b
YM
97112011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9712
9713 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9714 of scroll runs so as to avoid assigning disabled bogus rows and
9715 unnecessary graphics copy operations.
9716
8c9afb46
EZ
97172011-11-27 Eli Zaretskii <eliz@gnu.org>
9718
9719 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9720 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9721 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9722 (malloc, free, realloc, calloc): Redirect to e_* only when
9723 compiling Emacs.
9724
9725 * lisp.h (GCTYPEBITS): Move before first use.
9726 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9727 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9728 this macro definition.
9729
9730 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9731 _MSC_VER.
9732
54e9e3bf
JD
97332011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9734
6d5eb5b0
SM
9735 * gtkutil.c (xg_create_frame_widgets):
9736 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
9737 present with Gtk+ 2.0.
9738
83aca1cb
PE
97392011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9740
9741 * fileio.c (Finsert_file_contents): Undo previous change; see
9742 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9743
5b76caa4
PE
97442011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9745
9746 Rename locals to avoid shadowing.
9747 * fileio.c (Finsert_file_contents):
9748 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9749 * process.c (wait_reading_process_output):
9750 Rename inner 'proc' to 'p' to avoid shadowing.
9751 Indent for consistency with usual Emacs style.
9752
8c535114
EZ
97532011-11-25 Eli Zaretskii <eliz@gnu.org>
9754
9755 * xdisp.c (redisplay_window): If cursor row is not fully visible
9756 after recentering, and scroll-conservatively is set to a large
9757 number, scroll window by a few more lines to make the cursor fully
9758 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
9759 (start_display): Don't move to the next line if the display should
9760 start at a newline that is part of a display vector or an overlay
9761 string. (Bug#10119)
8c535114 9762
fa4fdb5c
JL
97632011-11-24 Juri Linkov <juri@jurta.org>
9764
9765 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9766 after the `MagickPingImage' call. (Bug#10112)
9767
90ec88df
CY
97682011-11-23 Chong Yidong <cyd@gnu.org>
9769
9770 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9771
56e2e794
MR
97722011-11-23 Martin Rudalics <rudalics@gmx.at>
9773
9774 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9775 making another buffer current. (Bug#10114)
9776
b6e64c41
GM
97772011-11-23 Glenn Morris <rgm@gnu.org>
9778
9779 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9780
6b21de18
CY
97812011-11-23 Chong Yidong <cyd@gnu.org>
9782
9783 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9784 using it (Bug#5984).
9785
b12cd789
EZ
97862011-11-22 Eli Zaretskii <eliz@gnu.org>
9787
9788 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9789 and header-lines, as they don't have one computed for them.
9790 (Bug#10098)
9791
9792 * .gdbinit (prow): Make displayed values more self-explaining.
9793 Add row's hash code.
9794
261b6fd4
LMI
97952011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9796
9797 * process.c (wait_reading_process_output): Fix asynchrounous
9798 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 9799 (wait_reading_process_output): Add comment and URL.
261b6fd4 9800
e7cfd277
JD
98012011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9802
9803 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9804
a9b9b7f5
CY
98052011-11-21 Chong Yidong <cyd@gnu.org>
9806
9807 * window.c (Fnext_window, Fprevious_window): Doc fix.
9808
b0d15b4f
SM
98092011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9810
9811 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9812
fe7a3057
JB
98132011-11-20 Juanma Barranquero <lekktu@gmail.com>
9814
9815 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9816
d2999b1a
MR
98172011-11-20 Martin Rudalics <rudalics@gmx.at>
9818
9819 * window.c (Fset_window_combination_limit): Rename argument
9820 STATUS to LIMIT.
9821 (Vwindow_combination_limit): Remove "status" from doc-string.
9822
d5ff9cd0
AS
98232011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9824
9825 * m/ibms390.h: Remove.
9826 * m/ibms390x.h: Don't include "ibms390.h".
9827
a5bb9bd3
SM
98282011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9829
9830 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9831 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9832
cd1181db
JB
98332011-11-20 Juanma Barranquero <lekktu@gmail.com>
9834
9835 * casetab.c (Fset_case_table):
9836 * charset.c (Fcharset_after): Fix typos.
9837
615a3b8d 98382011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 9839
17e845af
PE
9840 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9841 Otherwise, valgrind does not work on some platforms.
9842 Problem reported by Andreas Schwab in
6a0bf43d
PE
9843 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9844 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9845 is set, removing the need for VIRT_ADDRESS_VARIES.
9846 (PURE_P): Use a more-efficient implementation that needs just one
9847 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9848 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9849 to 4 (xorl, subq, cmpq, setbe).
9850 * alloc.c (pure): Always extern now, since that's the
9851 VIRT_ADDR_VARIES behavior.
9852 (PURE_POINTER_P): Use a single comparison, not two, for
9853 consistency with the new puresize.h.
9854 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9855 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9856 Remove VIRT_ADDR_VARIES no longer needed.
9857
f8fe6f96
EZ
98582011-11-19 Eli Zaretskii <eliz@gnu.org>
9859
9860 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9861 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9862 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9863 behave as if the cursor position were at the window margin.
9864
9865 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9866 and the cursor position is out of bounds, behave as if the cursor
9867 position were at the window margin. (Bug#10075)
9868
df05a53c
CY
98692011-11-18 Chong Yidong <cyd@gnu.org>
9870
9871 * window.c (Fwindow_combination_limit): Make first argument
9872 non-optional, since it is meaningless for live windows like the
9873 selected window.
61ccba97 9874
2071918e
DA
98752011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9876
9877 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9878
b50a28de
SM
98792011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9880
9881 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9882 (graft_intervals_into_buffer): Simplify.
9883
015137db
EZ
98842011-11-18 Eli Zaretskii <eliz@gnu.org>
9885
9886 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9887 hash values of the two rows.
9888 (copy_row_except_pointers): Preserve the used[] arrays and the
9889 hash values of the two rows. (Bug#10035)
68c95424 9890 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
9891
9892 * xdisp.c (row_hash): New function, body extracted from
9893 compute_line_metrics.
9894 (compute_line_metrics): Call row_hash, instead of computing the
9895 hash code inline.
9896
9897 * dispnew.c (verify_row_hash): Call row_hash for computing the
9898 hash code of a row, instead of duplicating code from xdisp.c.
9899
9900 * dispextern.h (row_hash): Add prototype.
9901
a2addb04
TH
99022011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9903
9904 * frame.c (delete_frame): Don't delete the terminal when the last
9905 X frame is closed if emacs is built with GTK toolkit.
9906
df85d315
JB
99072011-11-17 Juanma Barranquero <lekktu@gmail.com>
9908
9909 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9910
a0c2d0ae
MR
99112011-11-17 Martin Rudalics <rudalics@gmx.at>
9912
9913 * window.c (Vwindow_splits): Rename to
9914 Vwindow_combination_resize. Suggested by Juri Linkov.
9915 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9916 of Vwindow_splits.
9917
58179cce
JB
99182011-11-16 Juanma Barranquero <lekktu@gmail.com>
9919
7877f373
JB
9920 * nsfns.m (Fns_font_name):
9921 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 9922
b6f67890
MR
99232011-11-16 Martin Rudalics <rudalics@gmx.at>
9924
9925 * window.h (window): Rename slot "nest" to "combination_limit".
9926 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9927 (Fset_window_nest): Rename to Fset_window_combination_limit.
9928 (Vwindow_nest): Rename to Vwindow_combination_limit.
9929 (recombine_windows, make_parent_window, make_window)
9930 (Fsplit_window_internal, saved_window)
9931 (Fset_window_configuration, save_window_save): Rename all
9932 occurrences of window_nest to window_combination_limit.
9933
c7015153
JB
99342011-11-15 Juanma Barranquero <lekktu@gmail.com>
9935
9936 * image.c (imagemagick_load_image): Fix typo.
9937
322ad6ec
EZ
99382011-11-14 Eli Zaretskii <eliz@gnu.org>
9939
9940 * xdisp.c (display_line): Move the call to
9941 highlight_trailing_whitespace before the call to
9942 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
9943 faces of all the glyphs to compute ROW's hash value.
9944 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 9945
f067b8ec
JB
99462011-11-14 Juanma Barranquero <lekktu@gmail.com>
9947
9948 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9949 just return (bug#10044).
9950
1e5b2111
EZ
99512011-11-12 Eli Zaretskii <eliz@gnu.org>
9952
7ef3cbd5
EZ
9953 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9954 with user-defined heap size. Bump the default size of the temacs
9955 heap to 27MB, to avoid memory warning when running temacs.
9956 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9957
1e5b2111
EZ
9958 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9959 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
9960 (verify_row_hash) [XASSERTS]: New function.
9961 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9962 that the hash value of glyph rows is correct.
1e5b2111 9963
89d61221
MR
99642011-11-12 Martin Rudalics <rudalics@gmx.at>
9965
9966 * window.h (window): Remove splits slot.
9967 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9968 (Fdelete_other_windows_internal, make_parent_window)
9969 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9970 (Fset_window_configuration, save_window_save): Don't deal with
9971 split status of windows.
9972 (saved_window): Remove splits slot.
9973 (Vwindow_splits): Rewrite doc-string.
9974
97f18cc8
JD
99752011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9976
9977 * xfns.c (unwind_create_frame):
9978 * nsfns.m (unwind_create_frame):
9979 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9980 Vframe_list (Bug#9999).
9981
22a648b4
DA
99822011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9983
0b381c7e 9984 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 9985
659afede
KH
99862011-11-11 Kenichi Handa <handa@m17n.org>
9987
9988 * callproc.c (Fcall_process): Set the member dst_multibyte of
9989 process_coding.
9990
9ac0394b
KH
99912011-11-11 Johan Bockgård <bojohan@gnu.org>
9992
9993 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9994 avoid a crash (bug#9496).
9995
2fbdc249
CY
99962011-11-09 Chong Yidong <cyd@gnu.org>
9997
9998 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9999 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10000
ac6b1f81
PE
100012011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10002
10003 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10004
09db192c
PE
100052011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10006
10007 Avoid some portability problems by eschewing 'extern inline' functions.
10008 The trivial performance wins aren't worth the portability hassles; see
10009 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10010 et seq.
10011 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10012 (window_box_width, window_box_left, window_box_left_offset)
10013 (window_box_right, window_box_right_offset): Undo previous change,
10014 by removing the "extern"s.
10015 * intervals.c (adjust_intervals_for_insertion)
10016 (adjust_intervals_for_deletion): Undo previous change,
10017 making these static again.
10018 (offset_intervals, temp_set_point_both, temp_set_point)
10019 (copy_intervals_to_string): No longer inline.
10020 * xdisp.c (window_text_bottom_y, window_box_width)
10021 (window_box_height, window_box_left_offset)
10022 (window_box_right_offset, window_box_left, window_box_right)
10023 (window_box): No longer inline.
10024
105216ed
CY
100252011-11-08 Chong Yidong <cyd@gnu.org>
10026
10027 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
10028 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
10029 Signal an error if not a live window.
105216ed
CY
10030 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
10031 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
10032
ae9e237f
JB
100332011-11-07 Juanma Barranquero <lekktu@gmail.com>
10034
10035 * lisp.h (syms_of_abbrev): Remove declaration.
10036 Reported by CHENG Gao <chenggao@royau.me>.
10037
c7aa8333
EZ
100382011-11-07 Eli Zaretskii <eliz@gnu.org>
10039
10040 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10041 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
10042 of temacs in GUI mode.
10043
be7f5545
MR
100442011-11-07 Martin Rudalics <rudalics@gmx.at>
10045
10046 * window.h: Declare delete_all_child_windows instead of
10047 delete_all_subwindows.
10048 * window.c (Fwindow_nest, Fset_window_nest)
10049 (Fset_window_new_total, Fset_window_new_normal)
10050 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10051 (delete_all_subwindows): Rename to delete_all_child_windows.
10052 (Fdelete_other_windows_internal, Fset_window_configuration):
10053 Call delete_all_child_windows instead of delete_all_subwindows.
10054 * frame.c (delete_frame): Call delete_all_child_windows instead
10055 of delete_all_subwindows.
10056
ca78dc43
PE
100572011-11-07 Paul Eggert <eggert@cs.ucla.edu>
10058
10059 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10060 This is also needed for porting to any host where GC_MARK_STACK is
10061 not GC_MAKE_GCPROS_NOOPS.
10062 (which_symbols): Use it.
10063
a0241d01
KH
100642011-11-07 Kenichi Handa <handa@m17n.org>
10065
10066 * coding.c (coding_set_destination): Check coding->src_pos only
10067 when coding->src_object is a buffer (bug#9910).
10068
10069 * process.c (send_process): Set the member src_multibyte of coding
10070 to 0 (bug#9911) when sending a unibyte text.
10071
10072 * callproc.c (Fcall_process): Set the member src_multibyte of
10073 process_coding to 0 (bug#9912).
10074
a64bfdfa 100752011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
10076
10077 * xmenu.c (cleanup_widget_value_tree): New function.
10078 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10079 calling free_menubar_widget_value_tree directly (Bug#9830).
10080
cb41b32a
PE
100812011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10082
10083 Fix some portability problems with 'inline'.
10084 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10085 (window_box_width, window_box_left, window_box_left_offset)
10086 (window_box_right, window_box_right_offset): Declare extern.
10087 Otherwise, these inline functions do not conform to C99 and
10088 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
10089 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10090 * intervals.c (adjust_intervals_for_insertion)
10091 (adjust_intervals_for_deletion): Now extern, because otherwise the
10092 extern inline functions 'offset_intervals' couldn't refer to it.
10093 (static_offset_intervals): Remove.
10094 (offset_intervals): Rewrite using the old contents of
10095 static_offset_intervals. The old version didn't conform to C99
10096 because an extern inline function contained a reference to an
10097 identifier with static linkage.
10098
b7041366
AS
100992011-11-06 Andreas Schwab <schwab@linux-m68k.org>
10100
10101 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10102 GC.
10103
88a37c4d
EZ
101042011-11-06 Eli Zaretskii <eliz@gnu.org>
10105
10106 * xdisp.c (init_iterator, reseat_to_string): Don't set the
10107 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
10108 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10109 return Qleft_to_right.
10110
49745b39
CY
101112011-11-06 Chong Yidong <cyd@gnu.org>
10112
10113 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
10114 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
10115 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
10116 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
10117 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
10118 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
10119 (Fwindow_vscroll): Doc fix.
10120 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
10121 argument, since it makes no sense to pass a live window and for
10122 consistency with window-child.
10123
1f05cd82
CS
101242011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
10125
10126 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
10127 support MSVC.
10128
22610910
JR
101292011-11-05 Jason Rumney <jasonr@gnu.org>
10130
10131 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
10132 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
10133 fonts (Bug#6029).
10134 (add_font_entity_to_list): Fix logic errors in mixed boolean and
10135 bitwise arithmetic preventing use of unicode-sip and non-truetype
10136 opentype fonts.
10137
a06776b2
EZ
101382011-11-05 Eli Zaretskii <eliz@gnu.org>
10139
3ad924ba
EZ
10140 * s/ms-w32.h (fstat, stat, utime): Move redirections to
10141 "emacs"-only part.
10142
a06776b2
EZ
10143 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
10144 initialization code to keep similarity to xfns.c after changes
10145 from 2011-11-05.
10146
c9e7db78
JD
101472011-11-05 Jan Djärv <jan.h.d@swipnet.se>
10148
a97f8f3f
JD
10149 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
10150 (unwind_create_frame): New function (Bug#9943).
10151 (Fx_create_frame): Restructure code to be more similar to the one in
10152 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
10153 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
10154 Move terminal->reference_count++ just before making the frame official
10155 (Bug#9943).
10156
10157 * nsterm.m (x_free_frame_resources): New function.
10158 (x_destroy_window): Move code to x_free_frame_resources.
10159
c9e7db78 10160 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
10161 (Fx_create_frame, x_create_tip_frame):
10162 Move terminal->reference_count++ just before making the frame
75f1671a 10163 official. Move initialization of image_cache_refcount and
c9e7db78
JD
10164 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
10165
a6fc3b5c
EZ
101662011-11-05 Eli Zaretskii <eliz@gnu.org>
10167
10168 Support MSVC build with newer versions of Visual Studio.
10169 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
10170 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
10171 nt/gmake.defs.
10172
10173 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10174 which are not supported by MSVC.
10175 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10176 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10177 bitfields.
10178 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10179 types in bitfields.
10180 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10181
10182 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10183
58179cce 101842011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
10185
10186 Support MSVC build with newer versions of Visual Studio.
10187 * w32.c: Don't include w32api.h for MSVC.
10188 (init_environment) [_MSC_VER]: Call sys_access, not _access.
10189
10190 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10191 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10192 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10193 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10194 e_* cousins.
10195 (alloca) [_MSC_VER]: Define to _alloca.
10196
10197 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10198
10199 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10200
a58c13ed
EZ
102012011-11-04 Eli Zaretskii <eliz@gnu.org>
10202
10203 * xdisp.c (note_mouse_highlight): If either of
10204 previous/next-single-property-change returns nil, treat that as
10205 the beginning or the end of the buffer. (Bug#9955)
10206
fe0b6370
JD
102072011-11-04 Jan Djärv <jan.h.d@swipnet.se>
10208
a58c13ed 10209 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
10210 label is not null (Bug#9951).
10211 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10212 may be NULL.
10213
89bd5ee1
EZ
102142011-11-04 Eli Zaretskii <eliz@gnu.org>
10215
10216 * window.c (Fwindow_body_size): Mention in the doc string that the
10217 return value is in frame's canonical units. (Bug#9949)
10218
84c3edb9
EZ
102192011-11-03 Eli Zaretskii <eliz@gnu.org>
10220
4e2fb5c7
EZ
10221 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
10222
84c3edb9 10223 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 10224 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 10225 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 10226
bc17a887
EZ
102272011-11-01 Eli Zaretskii <eliz@gnu.org>
10228
10229 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10230 Don't stop backward scan on the continuation glyph, even though
10231 its CHARPOS is positive.
6d5eb5b0
SM
10232 (mouse_face_from_buffer_pos, note_mouse_highlight):
10233 Rename cover_string to disp_string.
bc17a887 10234
4ee88440
MR
102352011-11-01 Martin Rudalics <rudalics@gmx.at>
10236
10237 * window.c (temp_output_buffer_show): Don't use
10238 Vtemp_buffer_show_specifiers.
10239 (Vtemp_buffer_show_specifiers): Remove unused variable.
10240
c2ff3c02
EZ
102412011-10-30 Eli Zaretskii <eliz@gnu.org>
10242
10243 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10244 past the beginning of the current glyph matrix.
10245
58179cce 102462011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
10247
10248 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10249 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10250 HAVE_GTK3 (Bug#9869).
b77a6a7f 10251
3b574623
JD
10252 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10253 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10254
b77a6a7f
JD
10255 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10256
10257 * xterm.c: Declare x_handle_net_wm_state to return int.
10258 (handle_one_xevent): Check if we are iconified but don't have
10259 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
10260 (get_current_wm_state): Return non-zero if not hidden,
10261 check for _NET_WM_STATE_HIDDEN (Bug#9893).
10262 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
10263 (x_handle_net_wm_state): Return what get_current_wm_state returns.
10264 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
10265
196e41e4
PE
102662011-10-29 Paul Eggert <eggert@cs.ucla.edu>
10267
10268 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
10269 so that this new function doesn't get optimized away by a
10270 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
10271
021f2e1a
AS
102722011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10273
10274 * frame.h (MOUSE_HL_INFO): Remove excess parens.
10275
8b058d44
EZ
102762011-10-29 Eli Zaretskii <eliz@gnu.org>
10277
10278 Fix the `xbytecode' command.
10279 * .gdbinit (xprintbytestr): New command.
b50a28de 10280 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
10281 (xbytecode): Print the byte-code string as well.
10282
4452fb80
EZ
102832011-10-29 Kim Storm <storm@cua.dk>
10284
8b058d44
EZ
10285 * alloc.c (which_symbols): New function.
10286
21b72067
AS
102872011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10288
10289 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
10290 line. (Bug#9903)
10291
83ed7b5c
GM
102922011-10-29 Glenn Morris <rgm@gnu.org>
10293
10294 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10295 Not clear what it was for, and it causes various bugs. (Bug#9839)
10296
5a7a728b
EZ
102972011-10-28 Eli Zaretskii <eliz@gnu.org>
10298
10299 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10300 possible random value that matches one of those tested as
10301 condition to clear the mouse face.
10302
d3d0842f
CY
103032011-10-28 Chong Yidong <cyd@gnu.org>
10304
10305 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10306
31b39d13
DN
103072011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
10308
10309 * window.c (make_window): Initialize phys_cursor_on_p.
10310
9aba6043
SM
103112011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
10312
10313 * lisp.h (struct Lisp_Symbol): Update comments.
10314
c20992f4
JB
103152011-10-28 Juanma Barranquero <lekktu@gmail.com>
10316
10317 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10318
db4f02f2
EZ
103192011-10-28 Eli Zaretskii <eliz@gnu.org>
10320
10321 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
10322 <oslsachem@gmail.com> for helping to debug this.
10323
10324 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10325 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10326 (g_b_init_get_glyph_outline_w): New static variables.
10327 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10328 (GetGlyphOutlineW_Proc): New typedefs.
10329 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
10330 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10331 New functions.
10332 (w32font_open_internal, compute_metrics):
10333 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
10334 instead of calling the "wide" APIs directly.
10335
10336 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10337
10338 * w32.h (syms_of_w32font): Add prototype.
10339
87e68db4
JB
103402011-10-27 Juanma Barranquero <lekktu@gmail.com>
10341
10342 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10343 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10344 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10345 (Fmove_to_window_line): Doc fix.
10346
435c1d67
CY
103472011-10-27 Chong Yidong <cyd@gnu.org>
10348
10349 * process.c (make_process): Set gnutls_state to NULL.
10350
10351 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10352 non-NULL, regardless of GNUTLS_INITSTAGE.
10353 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10354 an error. Set process slots as soon as we allocate them.
10355
10356 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10357
9c6c6f49
CY
103582011-10-27 Chong Yidong <cyd@gnu.org>
10359
9aba6043
SM
10360 * gnutls.c (emacs_gnutls_deinit): New function.
10361 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
10362 (Fgnutls_deinit, Fgnutls_boot): Use it.
10363
10364 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10365 (deactivate_process): Call emacs_gnutls_deinit.
10366
657d08d3
JB
103672011-10-27 Juanma Barranquero <lekktu@gmail.com>
10368
10369 * image.c (x_create_x_image_and_pixmap):
10370 * w32.c (sys_rename, w32_delayed_load):
10371 * w32font.c (fill_in_logfont):
10372 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10373
5430d399
JB
103742011-10-26 Juanma Barranquero <lekktu@gmail.com>
10375
10376 * w32fns.c (w32_default_color_map): New function,
10377 extracted from Fw32_default_color_map.
a7ef684b 10378 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 10379
fe0055fa
PE
103802011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10381
10382 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10383
e6346438
SM
103842011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10385
10386 * keyboard.c (test_undefined): New function (bug#9751).
10387 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10388
e112cc37
ET
103892011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10390
10391 * sysdep.c (init_sys_modes): Fix the check for the controlling
10392 terminal (Bug#6649).
10393
7b5d6677
EZ
103942011-10-20 Eli Zaretskii <eliz@gnu.org>
10395
10396 * dispextern.h (struct bidi_it): New member next_en_type.
10397
10398 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10399 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10400 current character, check also for next_en_type being WEAK_EN.
10401 (bidi_resolve_weak): Don't enter the expensive loop if the current
10402 position is before next_en_pos. Record the bidi type of the first
10403 non-ET, non-BN character we find, in addition to its position.
10404 (bidi_level_of_next_char): Invalidate next_en_type when
10405 next_en_pos is over-stepped.
10406
7da0b018
PE
104072011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10408
10409 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10410 * editfns.c: Rewrite current-time-zone so that it invokes
10411 the equivalent of (format-time-string "%Z") to get the time zone name.
10412 This fixes a bug when the time zone name contains characters that
10413 need converting from the system time locale to Emacs internal format.
10414 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10415 that patch fixed format-time-string to do the conversion, but
10416 I forgot to fix current-time-zone.
10417 (format_time_string): New function, containing most of
10418 what Fformat_time_string used to contain.
10419 (Fformat_time_string): Rewrite in terms of format_time_string.
10420 This doesn't change this function's behavior.
10421 (current-time-zone): Rewrite to use format_time_string.
10422 This fixes the bug reported by Michael Schierl in
10423 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10424 Jason Rumney's 2007-06-07 change worked around this bug, but
10425 didn't fix it.
10426 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10427
8547b010
EZ
104282011-10-19 Eli Zaretskii <eliz@gnu.org>
10429
10430 * xdisp.c (start_display): If the character at POS is displayed
10431 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
10432 (try_window_reusing_current_matrix): If a line ends in a display
10433 vector or the next line starts in a display vector, continue
10434 redrawing the window even though the character position of
10435 start_row was reached.
8547b010
EZ
10436 (Bug#9771, part 2)
10437
4e948d15
CY
104382011-10-18 Chong Yidong <cyd@gnu.org>
10439
10440 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10441 with nobreak-char-display too.
10442
4787455f
EZ
104432011-10-18 Eli Zaretskii <eliz@gnu.org>
10444
10445 Fix part 3 of bug#9771.
10446 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10447 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10448 non-neutral characters if the current character is a paragraph
10449 separator (a.k.a. Newline). This avoids running the same
10450 expensive loop twice, once when we consume the preceding newline
10451 and the other time when the line actually needs to be displayed.
10452 Avoid the loop when we see neutrals on the base embedding level
10453 following a character whose directionality is the same as the
10454 paragraph's. This avoids running the expensive loop when a line
10455 ends in a long sequence of neutrals, like control characters.
10456 Add assertion against STRONG_AL type. Slightly rearrange code
10457 that determines the type of a neutral given the first non-neutral
10458 that follows it.
10459 (bidi_level_of_next_char): Set next_en_pos to zero when
10460 invalidating its info.
10461
2c91f553
EZ
104622011-10-17 Eli Zaretskii <eliz@gnu.org>
10463
10464 * xdisp.c (push_display_prop): Determine whether to record string
10465 or buffer position by IT->string, not by IT->method. Allow
10466 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
10467 (move_it_vertically_backward): Don't look for character position
10468 immediately after the newline when in a continuation line.
10469 (Bug#9771, part 1)
2c91f553 10470
c7b08b0d
MR
104712011-10-15 Martin Rudalics <rudalics@gmx.at>
10472
10473 * window.c (coordinates_in_window): Rewrite and delabelize
10474 vertical border check. (Bug#5357) (Bug#9618)
10475
6b02f655
SM
104762011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10477
10478 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10479 errors in XSetWindowBorder (bug#9310).
10480
81d40c92
DA
104812011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10482
10483 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10484 avoid crash when xmalloc overrun checking is enabled.
10485
d4172c3b
EZ
104862011-10-13 Eli Zaretskii <eliz@gnu.org>
10487
10488 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10489 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10490 cursor motion with <left> and <right> arrow keys.
10491
10492 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10493 some callers set that themselves.
10494
b00eea75
EZ
104952011-10-12 Eli Zaretskii <eliz@gnu.org>
10496
10497 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10498 display string and the previous row comes from the same string and
10499 is empty. (Bug#9739) (Bug#9738)
10500
8fe012c4
SM
105012011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10502
10503 * doc.c (get_doc_string): Encode file name (bug#9735).
10504
0074aef2
EZ
105052011-10-12 Eli Zaretskii <eliz@gnu.org>
10506
79beb178
EZ
10507 * bidi.c (bidi_level_of_next_char):
10508 * xdisp.c (get_visually_first_element): Remove old incorrect
10509 comments regarding the Unicode Line Separator character.
10510
0074aef2
EZ
10511 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10512
6e4b3fbe
DA
105132011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10514
10515 * alloc.c (Fgc_status): Do not access beyond zombies array
10516 boundary if nzombies > MAX_ZOMBIES.
10517 * alloc.c (dump_zombies): Add missing format specifier.
10518
0324f3af
PE
105192011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10520
b5525cac
PE
10521 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10522 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10523
0324f3af
PE
10524 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10525 Some packages use them to denote characters with modifiers.
10526
e9b5f888
AS
105272011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10528
10529 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10530 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10531 matching a pp-number. Rename parameter var to var1.
10532
127827c0
SM
105332011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10534
10535 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10536
c8fd3bd0
GM
105372011-10-08 Glenn Morris <rgm@gnu.org>
10538
10539 * callint.c (Fcall_interactively): Give a more explicit error for the
10540 'c' case with a non-character input. (Bug#8479)
10541
352ec8ff
EZ
105422011-10-08 Eli Zaretskii <eliz@gnu.org>
10543
03669ccb
EZ
10544 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10545 lines.
7061c986
EZ
10546 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10547 lines that are hscrolled on the left.
03669ccb 10548
352ec8ff
EZ
10549 * dispnew.c (buffer_posn_from_coords): Account for a possible
10550 presence of header-line. (Bug#4426)
10551
a66cfb1c
SM
105522011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10553
6b02f655
SM
10554 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10555 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 10556
7c5ee88e
PE
105572011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10558
10559 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10560 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10561 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10562 this makes Emacs dump core during garbage collection on rare
10563 occasions. sizeof is obviously inferior to offsetof here, so
10564 stick with offsetof.
10565 (GC_POINTER_ALIGNMENT): New macro.
10566 (mark_memory): Omit 3rd (offset) arg; caller changed.
10567 Don't assume EMACS_INT alignment is the same as pointer alignment.
10568
df1bbe5b
SM
105692011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10570
10571 * keyboard.c (read_key_sequence_remapped): New var.
10572 (read_key_sequence): Compute remapping in the right buffer.
10573 (command_loop_1): Use read_key_sequence's remapping directly.
10574
51553db6
SM
105752011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10576
32c1fffd
SM
10577 * dired.c (file_name_completion): Don't expand file name.
10578 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10579 before checking file name handler.
10580
51553db6
SM
10581 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10582 they've been requested explicitly (bug#9591).
10583
b6bd1599 105842011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
10585
10586 * keymap.c (Fsingle_key_description): Use make_specified_string
10587 instead of build_string to build string from push_key_description.
10588 (Bug#5193)
10589
f701dc2a
PE
105902011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10591
4222c55d
PE
10592 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10593 This fixes a Y2038 bug on 64-bit hosts.
10594 * buffer.c (reset_buffer):
10595 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10596 (Fclear_buffer_auto_save_failure):
10597 Use 0, not -1, to represent an unset failure time, since time_t
10598 might not be signed.
10599
f701dc2a
PE
10600 Remove dependency on glibc malloc internals.
10601 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10602 Move back here from lisp.h, but with their new implementations.
10603 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10604 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10605 * charset.c (charset_table_init): New static var.
10606 (syms_of_charset): Use it instead of xmalloc. This removes a
10607 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10608 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10609 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10610 Move back to alloc.c.
10611 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10612 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10613
9ceebf39
JD
106142011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10615
10616 * nsterm.m (windowDidResize): Call x_set_window_size only when
10617 ns_in_resize is true. Otherwise set pixelwidth/height and
10618 call change_frame_size (Bug#9628).
10619
cb993c58
PE
106202011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10621
3930c88b
PE
10622 Port --enable-checking=all to Fedora 14 x86-64.
10623 * charset.c (syms_of_charset): Also account for glibc malloc's
10624 internal overhead when calculating the initial malloc maximum.
10625
cb993c58
PE
10626 Port --enable-checking=all to Fedora 14 x86.
10627 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10628 Move to lisp.h.
10629 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10630 (overrun_check_realloc, overrun_check_free):
10631 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10632 That way, xmalloc returns a properly-aligned pointer even if
10633 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10634 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10635 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10636 into account when calculating the initial malloc maximum.
10637 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10638 Move here from alloc.c, so that charset.c can use it too.
10639 Properly align; the old code wasn't right for common 32-bit hosts
10640 when configured with --enable-checking=all.
10641 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10642 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10643
31bed486
EZ
106442011-09-29 Eli Zaretskii <eliz@gnu.org>
10645
04c70788 10646 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
10647 use EDOM.
10648
fbcaa2f3
EZ
106492011-09-28 Eli Zaretskii <eliz@gnu.org>
10650
10651 * xdisp.c (compute_display_string_end): If there's no display
10652 string at CHARPOS, return -1.
10653
10654 * bidi.c (bidi_fetch_char): When compute_display_string_end
10655 returns a negative value, treat the character as a normal
10656 character not covered by a display string. (Bug#9624)
10657
a239d4e9
JB
106582011-09-28 Juanma Barranquero <lekktu@gmail.com>
10659
10660 * lread.c (Fread_from_string): Fix typo in docstring.
10661
88652fd5
EZ
106622011-09-27 Eli Zaretskii <eliz@gnu.org>
10663
10664 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10665 newline, reseat the iterator instead of bidi-iterating there one
10666 character at a time. (Bug#9610)
32c1fffd
SM
10667 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10668 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 10669
ed497dd4
AS
106702011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10671
10672 * lread.c (readevalloop): Use correct code for NBSP.
10673 (read1): Likewise. (Bug#9608)
10674
b2bf61aa
MA
106752011-09-25 Michael Albinus <michael.albinus@gmx.de>
10676
10677 * dbusbind.c (Fdbus_register_signal): When service is not
10678 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10679
32bbb17c
GM
106802011-09-25 Glenn Morris <rgm@gnu.org>
10681
10682 * buffer.c (truncate-lines): Doc fix.
10683
94e0933e
CY
106842011-09-24 Chong Yidong <cyd@stupidchicken.com>
10685
10686 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10687 (Fset_window_next_buffers): Doc fix.
10688
cddde921
GM
106892011-09-24 Glenn Morris <rgm@gnu.org>
10690
10691 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10692
1260aef1
PE
106932011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10694
25b4bfa0
PE
10695 Fix minor problems found by static checking.
10696 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
10697 * indent.c (Fvertical_motion): Fix == vs = typo.
10698
e3cbd34b
EZ
106992011-09-24 Eli Zaretskii <eliz@gnu.org>
10700
a66cfb1c
SM
10701 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10702 Default value is now t. Doc fix.
6bf7006f 10703
e3cbd34b 10704 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 10705 logic when moving up, not only when moving down. Fix the
e3cbd34b 10706 confusing name and values of the it_overshoot_expected variable;
32c1fffd 10707 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
10708
10709 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10710 CHARPOS is covered by a display string which includes newlines.
10711 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10712 is covered by a display string with embedded newlines.
10713
a3de0cbd
MA
107142011-09-24 Michael Albinus <michael.albinus@gmx.de>
10715
10716 * dbusbind.c (Fdbus_register_signal): Add match rule to
10717 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
10718 (Fdbus_register_method, Vdbus_registered_objects_table):
10719 Fix docstring.
a3de0cbd 10720
b260039d
JM
107212011-09-24 Jim Meyering <meyering@redhat.com>
10722
32c1fffd 10723 do not ignore write error for any output size
b260039d
JM
10724 The previous change was incomplete.
10725 While it makes emacs --batch detect the vast majority of stdout
10726 write failures, errors were still ignored whenever the output size is
10727 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10728 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10729 && echo FAIL: ignored write error
10730 FAIL: ignored write error
10731 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10732 && echo FAIL: ignored write error
10733 FAIL: ignored write error
10734 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10735
8eca8a7c
AS
107362011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10737
10738 * emacs.c (Fkill_emacs): In noninteractive mode exit
10739 non-successfully if a write error occurred on stdout. (Bug#9574)
10740
3341db62
EZ
107412011-09-21 Eli Zaretskii <eliz@gnu.org>
10742
10743 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10744 the xassert test.
10745
10746 * dispextern.h (struct it): Update the comment documenting what
10747 can it->OBJECT be.
10748
8c203dbf
EZ
107492011-09-20 Eli Zaretskii <eliz@gnu.org>
10750
10751 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10752 a display string, extend search for cursor position to end of row.
10753 (find_row_edges): If the row ends in a newline from a display
10754 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10755 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
10756 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10757 non-empty line. Fixes confusing cursor motion with arrow keys at
10758 the beginning of a line that starts with whitespace.
8c203dbf 10759
a4824228
LMI
107602011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10761
10762 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10763 (bug#9493).
10764
33ed493b
CY
107652011-09-18 Chong Yidong <cyd@stupidchicken.com>
10766
10767 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10768 boolean (Bug#9154).
10769
56cd55c8
EZ
107702011-09-18 Eli Zaretskii <eliz@gnu.org>
10771
10772 * xdisp.c (display_line): Record maximum and minimum buffer
10773 positions even if no glyphs were produced (e.g., by a zero-width
10774 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10775 buffer positions that will be removed from the glyph row because
10776 they don't fit.
c02dcedf
EZ
10777 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10778 column is beyond frame width: don't subtract 1 "pixel" when
10779 computing width of the stretch.
3e62b7e0
EZ
10780 (reseat_at_next_visible_line_start): Undo the change made on
10781 2011-09-17 that saved paragraph information and restored it after
10782 the call to `reseat'. (Bug#9545)
56cd55c8 10783
5ed99d36 107842011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
10785
10786 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10787 and turn window cursor on if cleared (Bug#9415).
10788
5ed99d36 107892011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
10790
10791 * search.c (boyer_moore): Take unibyte characters from pattern
10792 literally. (Bug#9458)
10793
9bade7b2
EZ
107942011-09-18 Eli Zaretskii <eliz@gnu.org>
10795
10796 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10797
e5e9d610
PE
107982011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10799
87e4427a
PE
10800 Fix minor problem found by static checking.
10801 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10802 initialized, to pacify gcc -Wuninitialized.
10803
e5e9d610
PE
10804 * fileio.c: Report proper errno when syscall falls.
10805 (Finsert_file_contents): Save and restore errno,
10806 so that report_file_error outputs the correct diagnostic.
10807 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10808
a1674f0b
EZ
108092011-09-18 Eli Zaretskii <eliz@gnu.org>
10810
10811 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10812
fbfb6dd4
EZ
108132011-09-17 Eli Zaretskii <eliz@gnu.org>
10814
10815 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10816 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10817
bb187662
EZ
108182011-09-17 Eli Zaretskii <eliz@gnu.org>
10819
1137e8b8 10820 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 10821 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
10822
10823 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10824 (bidi_find_paragraph_start): Search back for paragraph beginning
10825 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10826 (bidi_move_to_visually_next): Only trigger paragraph-related
10827 computations when the last character is a newline or at EOB, not
10828 just any NEUTRAL_B. (Bug#9470)
10829
bb187662
EZ
10830 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10831 truncated lines if point is covered by a display string. (Bug#9524)
10832
2e621251
PE
108332011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10834
10835 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10836 (cons_to_x_long): New function.
10837 (lisp_data_to_selection_data): Use it. Correct the test for
10838 short-versus-long data; it was negated. Break out of vector
10839 loop, for efficiency, when a long datum is discovered.
10840
91a15bc6
SM
108412011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10842
10843 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10844
b41c3a35
EZ
108452011-09-16 Eli Zaretskii <eliz@gnu.org>
10846
10847 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10848 GCC PR/17406) by declaring this function with external scope.
10849
7812ba2d
PE
108502011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10851
10852 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10853 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10854
cf7edc2a
AS
108552011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10856
10857 * editfns.c (Fformat): Correctly handle text properties on "%%".
10858
bd01620e
EZ
108592011-09-15 Eli Zaretskii <eliz@gnu.org>
10860
10861 * xterm.c (x_draw_composite_glyph_string_foreground):
10862 * w32term.c (x_draw_composite_glyph_string_foreground):
10863 * term.c (encode_terminal_code):
10864 * composite.c (composition_update_it, get_composition_id):
10865 * xdisp.c (get_next_display_element)
10866 (fill_composite_glyph_string): Add comments about special meaning
10867 of TAB characters in a composition.
10868
a02719a3
PE
108692011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10870
10871 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
10872 This occurs when processing a multibyte format.
10873 Problem reported by Wolfgang Jenker.
a02719a3 10874
72589a3c
JB
108752011-09-15 Johan Bockgård <bojohan@gnu.org>
10876
10877 * xdisp.c (try_cursor_movement): Only check for exact match if
10878 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10879
1c14176c
PE
108802011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10881
10882 Remove unused external symbols.
10883 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10884 * xdisp.c (calc_pixel_width_or_height): Now static.
10885 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10886 * indent.c (check_display_width):
10887 * w32term.c: Fix comment to match code.
10888 * xterm.c, xterm.h (x_catching_errors): Remove.
10889
d2eea5b5
PE
108902011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10891
10892 * xselect.c: Use signed conversions more consistently (Bug#9498).
10893 (selection_data_to_lisp_data): Assume incoming selection data are
10894 signed integers, not unsigned. This is to be consistent with
10895 outgoing selection data, which was modified to use signed integers
10896 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10897 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10898 expects long, not unsigned long.
10899
46888499
EZ
109002011-09-14 Eli Zaretskii <eliz@gnu.org>
10901
10902 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10903 computation of loop end. Reported by Johan Bockgård
10904 <bojohan@gnu.org>.
10905
ef8ef9fb
CY
109062011-09-13 Chong Yidong <cyd@stupidchicken.com>
10907
10908 * frame.c (Fother_visible_frames_p): Function deleted.
10909
fa819fed
EZ
109102011-09-12 Eli Zaretskii <eliz@gnu.org>
10911
10912 * indent.c (compute_motion): Process display vector front to back
10913 rather than the other way around. (Bug#2496)
10914
2ba8e008
SM
109152011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10916
10917 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10918
20f53c69
CY
109192011-09-11 Chong Yidong <cyd@stupidchicken.com>
10920
10921 * minibuf.c (Fread_from_minibuffer): Doc fix.
10922
d562d7a4
EZ
109232011-09-11 Eli Zaretskii <eliz@gnu.org>
10924
10925 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10926 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10927
1c4d7f3d
LMI
109282011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10929
10930 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10931 value for non-existent files.
10932
b885bf36
EZ
109332011-09-11 Eli Zaretskii <eliz@gnu.org>
10934
10935 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10936 set its "size" to -1. This will set the modtime_size field of
10937 the corresponding buffer to -1, which is what
10938 verify-visited-file-modtime expects for files that do not exist.
10939 (Bug#9139)
10940
6612f0bf
PE
109412011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10942
10943 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10944 here ...
10945 * lisp.h: ... from here. push_key_description is no longer
10946 defined in keyboard.c, so its declaration should not be in
10947 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10948 logically belongs with push_key_description.
10949
dfb3f755
PE
109502011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10951
10952 * buffer.h: Include <sys/types.h> instead of <time.h>.
10953 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10954 Problem reported by Herbert J. Skuhra.
10955
3134906c
LMI
109562011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10957
10958 * xml.c (parse_region): Make the parsing work for
10959 non-comment-starting XML files again (bug#9144).
10960
8d903f4e
AS
109612011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10962
10963 * image.c (gif_load): Fix calculation of bottom and right corner.
10964 (Bug#9468)
10965
80ad64f4
EZ
109662011-09-10 Eli Zaretskii <eliz@gnu.org>
10967
10968 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10969 redisplay in small windows.
10970
208a048d
EZ
109712011-09-09 Eli Zaretskii <eliz@gnu.org>
10972
10973 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10974
9b1c252e
MR
109752011-09-08 Martin Rudalics <rudalics@gmx.at>
10976
10977 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10978 Operate on live windows only.
10979
2949f33b
JB
109802011-09-08 Juanma Barranquero <lekktu@gmail.com>
10981
10982 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10983
e08dcafd
EZ
109842011-09-07 Eli Zaretskii <eliz@gnu.org>
10985
10986 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10987 only under bidi iteration.
10988
115b96bd
JD
109892011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10990
10991 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10992
c8199d0f
PE
109932011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10994
10995 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10996 Without this fix, the command to link temacs failed due to an
10997 undefined symbol __builtin_isnan. This is because
10998 /usr/include/iso/math_c99.h #defines isnan(x) to
10999 __builtin_isnan(x), but the bundled gcc, which identifies itself
11000 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11001 a __builtin_isnan.
11002 * floatfns.c (isnan): #undef, and then #define to a clone of
11003 what's in data.c.
11004 (Fisnan): Always define, since it's always available now.
11005 (syms_of_floatfns): Always define isnan at the Lisp level.
11006
e39b275c 110072011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
11008
11009 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11010
b2db44d9 110112011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 11012
f4af5137 11013 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
11014 The previous code assumed that file offsets (off_t values) fit in
11015 EMACS_INT variables, which is not true on typical 32-bit hosts.
11016 The code messed up by falsely reporting buffer overflow in cases
11017 such as (insert-file-contents "big" nil 1 2) into an empty buffer
11018 when "big" contains more than 2**29 bytes, even though this
11019 inserts just one byte and does not overflow the buffer.
11020 (Finsert_file_contents): Store file offsets as off_t
11021 values, not as EMACS_INT values. Check for overflow when
11022 converting between EMACS_INT and off_t. When checking for
11023 buffer overflow or for overlap, take the offsets into account.
11024 Don't use EMACS_INT for small values where int suffices.
11025 When checking for overlap, fix a typo: ZV was used where
11026 ZV_BYTE was intended.
11027 (Fwrite_region): Don't assume off_t fits into 'long'.
11028 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
11029
ecfc0a49
MA
110302011-09-05 Michael Albinus <michael.albinus@gmx.de>
11031
11032 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
11033
6511acf2 110342011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 11035
0999621a 11036 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
11037
11038 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 11039 (esprintf, exprintf, evxprintf): New functions.
62f19c19 11040 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 11041 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
11042 (modify_event_symbol): Do not assume that the length of
11043 name_alist_or_stem is safe to alloca and fits in int.
11044 (Fexecute_extended_command): Likewise for function name and binding.
11045 (Frecursion_depth): Wrap around reliably on integer overflow.
11046 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11047 since some callers pass EMACS_INT values.
11048 (Fsingle_key_description): Don't crash if symbol name contains more
11049 than MAX_ALLOCA bytes.
11050 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11051 (get_minibuffer): Arg is now EMACS_INT, not int.
11052 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 11053 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
11054 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11055
2be7d702
PE
11056 * dbusbind.c (signature_cat): New function.
11057 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
11058 Do not overrun buffer; instead, report string overflow.
11059
9d1df220
PE
11060 * dispnew.c (add_window_display_history): Don't overrun buffer.
11061 Truncate instead; this is OK since it's just a log.
11062
33ef5c64
PE
11063 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11064 even if the time zone offset is outlandishly large.
11065 Don't mishandle offset == INT_MIN.
11066
66c6fdd5
PE
11067 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11068 when creating daemon; the previous buffer-overflow check was incorrect.
11069
d749b01b
PE
11070 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11071 which has the guts of the old verror function.
11072
b5cd1905
PE
11073 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11074 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11075
6e1a67fb
PE
11076 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11077 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 11078 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 11079 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
11080 length of string rather than counting it via multiple sprintfs;
11081 that's simpler and more reliable.
c21721cc
PE
11082 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11083 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11084 sprintf, in case result does not fit in int.
11085
c57b67fc
PE
11086 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11087 (fontset_from_font): Print it.
11088
8a401434
PE
11089 * frame.c (tty_frame_count): Now printmax_t, not int.
11090 (make_terminal_frame, set_term_frame_name): Print it.
11091 (x_report_frame_params): In X, window IDs are unsigned long,
11092 not signed long, so print them as unsigned.
11093 (validate_x_resource_name): Check for implausibly long names,
11094 and don't assume name length fits in 'int'.
11095 (x_get_resource_string): Don't blindly alloca invocation name;
11096 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
11097 not fit in int.
11098
6e1a67fb
PE
11099 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11100 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
11101 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11102
0df02bf3
PE
11103 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11104 Use esprintf, not sprintf, in case result does not fit in int.
11105
48e30793
PE
11106 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11107 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11108 it as a large positive number.
11109 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
11110 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11111
a66ff6d8
PE
11112 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
11113 in case result does not fit in int.
11114
aca216ff
PE
11115 * print.c (float_to_string): Detect width overflow more reliably.
11116 (print_object): Make sprintf buffer a bit bigger, to avoid potential
11117 buffer overrun. Don't assume list length fits in 'int'. Treat
11118 print length of 0 as 0, not as infinity; to be consistent with other
11119 uses of print length in this function. Don't overflow print length
11120 index. Don't assume hash table size fits in 'long', or that
11121 vectorlike size fits in 'unsigned long'.
11122
31c286f7
PE
11123 * process.c (make_process): Use printmax_t, not int, to format
11124 process-name gensyms.
11125
55e5faa1
PE
11126 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
11127
80f2e268
PE
11128 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
11129 to avoid potential buffer overrun.
11130
670741ab
PE
11131 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
11132 if X resource line is longer than 512 bytes.
11133
b7163a50
PE
11134 * xfns.c (x_window): Make sprintf buffer a bit bigger
11135 to avoid potential buffer overrun.
11136
ae58ff1f
PE
11137 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
11138
c43c8a6a
PE
11139 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
11140
3f8236f4
PE
111412011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11142
53e9fe90 11143 Integer overflow fixes for scrolling, etc.
6511acf2
PE
11144 Without these, Emacs silently mishandles large integers sometimes.
11145 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
11146 it were "C-u 1 M-x recenter" on a typical 64-bit host.
11147
6511acf2
PE
11148 * xdisp.c (try_window_id): Check Emacs fixnum range before
11149 converting to 'int'.
806add1d 11150
6511acf2 11151 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
11152 Check that an Emacs fixnum is in range before assigning it to 'int'.
11153 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
11154 values converted from Emacs fixnums.
11155 (Frecenter): Don't wrap around a line count if it is out of 'int'
11156 range; instead, treat it as an extreme value.
11157 (Fset_window_configuration, compare_window_configurations):
11158 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
11159
6511acf2
PE
11160 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
11161 that can exceed INT_MAX. Check that EMACS_INT value is in range
11162 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
11163 (match_limit): Don't assume that a fixnum can fit in 'int'.
11164
6511acf2 11165 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
11166 exceed INT_MAX.
11167
6511acf2 11168 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
11169 (Fvertical_motion): Don't wrap around LINES values that don't fit
11170 in 'int'. Instead, treat them as extreme values. This is good
11171 enough for windows, which can't have more than INT_MAX lines anyway.
11172
fcb901a7
LMI
111732011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11174
0f2f6b6d
LMI
11175 * Require libxml/parser.h to avoid compilation warning.
11176
fcb901a7
LMI
11177 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11178
11179 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11180 since this reportedly can destroy thread storage.
11181
6e20a0d4
CY
111822011-08-30 Chong Yidong <cyd@stupidchicken.com>
11183
11184 * syntax.c (find_defun_start): Update all cache variables if
11185 exiting early (Bug#9401).
11186
148ae00e
EZ
111872011-08-30 Eli Zaretskii <eliz@gnu.org>
11188
f6cfbd8f
EZ
11189 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11190
148ae00e
EZ
11191 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11192 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
11193 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
11194
11195 * term.c (tty_append_glyph): New function.
11196 (produce_stretch_glyph): Static function and its prototype deleted.
11197
a66cfb1c
SM
11198 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11199 Add prototypes.
148ae00e 11200
c4a07a4c
PE
112012011-08-29 Paul Eggert <eggert@cs.ucla.edu>
11202
11203 * image.c (parse_image_spec): Check for nonnegative, not for positive,
11204 when checking :margin (Bug#9390).
11205 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 11206 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
11207 so that the name doesn't mislead. All uses changed.
11208
6bc8cd65
JB
112092011-08-28 Johan Bockgård <bojohan@gnu.org>
11210
11211 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11212 set_tty_hooks.
11213
dca4927e
EZ
112142011-08-27 Eli Zaretskii <eliz@gnu.org>
11215
11216 * xdisp.c (move_it_to): Don't bail out early when reaching
11217 position beyond to_charpos, if we are scanning backwards.
11218 (move_it_vertically_backward): When DY == 0, make sure we get to
11219 the first character in the line after the newline.
11220
f2cad773
PE
112212011-08-27 Paul Eggert <eggert@cs.ucla.edu>
11222
11223 * ccl.c: Improve and simplify overflow checking (Bug#9196).
11224 (ccl_driver): Do not generate an out-of-range pointer.
11225 (Fccl_execute_on_string): Remove unnecessary check for
11226 integer overflow, noted by Stefan Monnier in
11227 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11228 Remove a FIXME that didn't need fixing.
11229 Simplify the newly-introduced buffer reallocation code.
11230
0cae2cdb
JB
112312011-08-27 Juanma Barranquero <lekktu@gmail.com>
11232
11233 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11234
5fc295a4 112352011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 11236
70c60eb2 11237 Integer and memory overflow issues (Bug#9196).
726e0ab1 11238
d31850da
PE
11239 * doc.c (get_doc_string): Rework so that
11240 get_doc_string_buffer_size is the actual buffer size, rather than
11241 being 1 less than the actual buffer size; this makes xpalloc more
11242 convenient.
11243
a69fbedb
PE
11244 * image.c (x_allocate_bitmap_record, cache_image):
11245 * xselect.c (Fx_register_dnd_atom):
11246 Simplify previous changes by using xpalloc.
11247
fe5c5d37
PE
11248 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11249 since either will do and ptrdiff_t is convenient with xpalloc.
11250
0065d054
PE
11251 * charset.c (charset_table_size)
11252 (struct charset_sort_data.priority): Now ptrdiff_t.
11253 (charset_compare): Don't overflow if priorities differ greatly.
11254 (Fsort_charsets): Don't assume list length fits in int.
11255 Check for size-calculation overflow when allocating sort data.
11256 (syms_of_charset): Allocate an initial charset table that is
11257 just under 64 KiB, to avoid problems with glibc malloc and mmap.
11258
11259 * cmds.c (internal_self_insert): Check for size-calculation overflow.
11260
11261 * composite.h (struct composition.glyph_len): Now int, not unsigned.
11262 The actual value is always <= INT_MAX, and leaving it unsigned made
11263 overflow checking harder.
11264
11265 * dispextern.h (struct glyph_matrix.rows_allocated)
11266 (struct face_cache.size): Now ptrdiff_t, for convenience in use
11267 with xpalloc. The values are still always <= INT_MAX.
11268
11269 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
11270
11271 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
11272 (SAFE_NALLOCA): New macro.
11273
11274 * region-cache.c (struct boundary.pos, find_cache_boundary)
11275 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
11276 (set_cache_region, invalidate_region_cache)
11277 (revalidate_region_cache, know_region_cache, region_cache_forward)
11278 (region_cache_backward, pp_cache):
11279 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
11280 so that ptrdiff_t * can be passed to xpalloc.
11281 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
11282 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
11283 (pp_cache): Don't assume cache_len fits in int.
11284 * region-cache.h: Adjust extern decls to match.
11285
11286 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
11287 EMACS_INT, since either will do, for xpalloc.
11288
11289 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
11290 (xnmalloc, xnrealloc, xpalloc): New functions.
11291
726e0ab1
PE
11292 * bidi.c (bidi_shelve_header_size): New constant.
11293 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11294 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11295
51f30bc5 11296 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
11297 * buffer.c (overlays_at, overlays_in, record_overlay_string)
11298 (overlay_strings):
11299 Don't update size of array until after memory allocation succeeds,
11300 because xmalloc/xrealloc may not return.
0065d054
PE
11301 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11302 now that we have proper integer overflow checking.
11303 (record_overlay_string, overlay_strings): Catch overflows when
11304 calculating size of overlay_str_buf.
726e0ab1 11305
0065d054
PE
11306 * callproc.c (Fcall_process): Check for size overflow when
11307 calculating size of args2.
11308 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11309 Normally we prefer signed values, but sticking with ptrdiff_t would
11310 require adding more-complicated checks.
726e0ab1
PE
11311
11312 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11313 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11314 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 11315 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
11316
11317 * character.c (Fstring): Check for size-calculation overflow.
11318
11319 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11320 unnecessary integer overflow. Check for size overflow.
11321 (encode_coding_object): Don't update size until xmalloc succeeds.
11322
11323 * composite.c (get_composition_id): Check for overflow in glyph
11324 length calculations.
11325
11326 Integer and memory overflow fixes for display code.
11327 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11328 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11329 (scrolling_window): Check for overflow in size calculations.
11330 (line_draw_cost, realloc_glyph_pool, add_row_entry):
11331 Don't assume glyph table len fits in int.
11332 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11333 (row_table_size): Now ptrdiff_t, not int.
11334 (scrolling_window): Avoid overflow in size calculations.
11335 Don't update size until allocation succeeds.
11336 * fns.c (concat): Check for overflow in size calculations.
11337 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11338 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11339 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11340
11341 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11342 (get_doc_string): Check for size calculation overflow.
11343 Don't update size until allocation succeeds.
11344 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11345 EMACS_INT, where ptrdiff_t will do.
11346 (Fsubstitute_command_keys): Check for string overflow.
11347
11348 * editfns.c (set_time_zone_rule): Don't assume environment length
11349 fits in int.
11350 (message_length): Now ptrdiff_t, not int.
11351 (Fmessage_box): Don't update size until allocation succeeds.
11352 Don't assume message length fits in int.
11353 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11354
0065d054
PE
11355 * emacs.c (main): Do not reallocate argv, since there is a null at
11356 the end that can be overwritten, and this way there's no need to
11357 worry about size-calculation overflow.
11358 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
11359
11360 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11361 alloc succeeds.
11362 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11363
11364 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11365 (x_set_scroll_bar_width, x_figure_window_size):
11366 Check for integer overflow.
11367 (x_set_alpha): Do not assume XINT fits in int.
11368
11369 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11370 This is for the members text_lines, text_cols, total_lines, total_cols,
11371 where the system imposes an 'int' limit.
11372
11373 * fringe.c (Fdefine_fringe_bitmap):
11374 Don't update size until alloc works.
11375
11376 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11377 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11378
11379 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11380 Check for size-calculation overflow.
11381 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11382 do, as we prefer signed integers.
11383 (id_to_widget.max_size, id_to_widget.used)
11384 (xg_store_widget_in_map, xg_remove_widget_from_map)
11385 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11386 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11387 Use and return ptrdiff_t, not int.
11388 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11389 * gtkutil.h: Change prototypes to match the above.
11390
11391 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11392 are duplicate now that they've been promoted to lisp.h.
11393 (x_allocate_bitmap_record, x_alloc_image_color)
11394 (make_image_cache, cache_image, xpm_load):
11395 Don't update size until alloc is done.
11396 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11397 (x_detect_edges):
3256efce 11398 Check for size calculation overflow.
726e0ab1
PE
11399 (ct_colors_allocated_max): New constant.
11400 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11401 overflow.
3256efce 11402
726e0ab1
PE
11403 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11404 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11405 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11406 Use ptrdiff_t, not int, to count maps.
11407 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
11408 calculations. Don't update size until allocation succeeds.
11409 Redo calculations to avoid overflow.
726e0ab1
PE
11410 * keyboard.h: Change prototypes to match the above.
11411
11412 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11413 to count maps.
11414 (current_minor_maps): Check for size calculation overflow.
11415 * keymap.h: Change prototypes to match the above.
11416
11417 * lread.c (read1, init_obarray): Don't update size until alloc done.
11418
11419 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11420 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11421
726e0ab1
PE
11422 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11423 Now ptrdiff_t, not int.
11424 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11425 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11426
11427 * process.c (Fnetwork_interface_list): Check for overflow
11428 in size calculation.
11429
11430 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11431
11432 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11433 overflow. Don't bother calling xmalloc when xrealloc will do.
11434
11435 * search.c (Freplace_match): Check for size calculation overflow.
11436 (Fset_match_data): Don't assume list lengths fit in 'int'.
11437
11438 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11439 for command line length. Do not attempt to address one before the
11440 beginning of an array, as that's not portable.
11441
11442 * term.c (max_frame_lines): Remove; unused.
11443 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11444 not int.
11445 (encode_terminal_code, calculate_costs): Check for size
11446 calculation overflow.
11447 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11448 table lengths and related sizes. Don't update size until alloc
11449 done. Redo calculations to avoid overflow.
11450 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11451
11452 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11453 subtracting pointers.
11454 (gobble_line): Check for overflow more carefully. Don't update size
11455 until alloc done.
11456
11457 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11458 Don't update size until alloc done.
11459 Redo size calculations to avoid overflow.
11460 Check for size calculation overflow.
0065d054 11461 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
11462
11463 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11464 Use ptrdiff_t, not int, for sizes.
11465 (store_mode_line_noprop_char): Don't update size until alloc done.
11466
0065d054
PE
11467 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11468 Use ptrdiff_t, not int, for sizes.
11469 (Finternal_make_lisp_face, cache_face):
11470 Check for size calculation overflow.
11471 (cache_face): Treat size calculation overflows as if they were
11472 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
11473
11474 * xfns.c (x_encode_text, x_set_name_internal)
11475 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11476 sizes, since they can exceed INT_MAX in size. Check for size
11477 calculation overflow.
11478
0065d054
PE
11479 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11480 (xg_select): Check for size calculation overflow.
726e0ab1
PE
11481 Don't update size until alloc done.
11482
0065d054 11483 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 11484 as sprintf is limited to int lengths.
1d526e2f 11485
252c5ee1
PE
11486 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11487 (X_LONG_MIN): New macros.
864d7ce7
PE
11488 Use them to make the following changes clearer.
11489 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11490 This change doesn't affect the value now, but it may help remind
11491 future maintainers not to raise the value too much later.
11492 (SELECTION_QUANTUM): Remove, replacing with ...
11493 (selection_quantum): ... new function, which avoids overflow.
11494 All uses changed.
11495 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11496 assumption that selection length fits in 'int'.
11497 (x_reply_selection_request, x_handle_selection_request)
11498 (x_get_window_property, receive_incremental_selection)
11499 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11500 (lisp_data_to_selection_data, clean_local_selection_data):
11501 Use ptrdiff_t, not int, to record length of selection.
11502 (x_reply_selection_request, x_get_window_property)
11503 (receive_incremental_selection, x_property_data_to_lisp):
11504 Redo calculations to avoid overflow.
11505 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 11506 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
11507 something.
11508 (x_get_window_property, receive_incremental_selection)
11509 (lisp_data_to_selection_data, x_property_data_to_lisp):
11510 Check for size-calculation overflow.
11511 (x_get_window_property, receive_incremental_selection)
11512 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11513 Don't store size until memory allocation succeeds.
11514 (x_get_window_property): Plug memory leak on memory exhaustion.
11515 Don't double-block input; malloc is safe here. Don't assume 2**34
11516 - 4 fits in unsigned long. Add an xassert to check
11517 XGetWindowProperty overflow. Be more careful about overflow
11518 calculations, and distinguish size from memory overflow better.
11519 (receive_incremental_selection): When tracing, don't assume
11520 unsigned int is less than INT_MAX.
11521 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11522 harmful) conversions of unsigned short to int.
11523 (lisp_data_to_selection_data): Don't assume that integers
11524 in the range -65535 through -1 fit in an X unsigned short.
11525 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11526 result parameters unless successful. Rely on cons_to_unsigned
11527 to report problems with elements; the old code wasn't right anyway.
11528 (x_check_property_data): Check for int overflow; we cannot use
11529 a wider type due to X limits.
11530 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11531
726e0ab1 11532 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 11533
0065d054
PE
11534 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11535 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
11536 (x_color_cells): Don't store size until memory allocation succeeds.
11537 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 11538 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
11539 (x_term_init): Don't assume length fits in int (sprintf is limited
11540 to int size).
bc18e09d 11541
ebfa62c0
PE
11542 Use ptrdiff_t for composition IDs.
11543 * character.c (lisp_string_width):
11544 * composite.c (composition_table_size, n_compositions)
11545 (get_composition_id, composition_gstring_from_id):
11546 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11547 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11548 * window.c (Frecenter):
11549 Use ptrdiff_t, not int, for composition IDs.
11550 * composite.c (get_composition_id): Check for integer overflow.
11551 * composite.h: Adjust prototypes to match the above changes.
11552
d3411f89
PE
11553 Use ptrdiff_t for hash table indexes.
11554 * category.c (hash_get_category_set):
11555 * ccl.c (ccl_driver):
11556 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11557 * coding.c (coding_system_charset_list, detect_coding_system):
11558 * coding.h (struct coding_system.id):
11559 * composite.c (get_composition_id, gstring_lookup_cache):
11560 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11561 * image.c (xpm_get_color_table_h):
11562 * lisp.h (hash_lookup, hash_put):
11563 * minibuf.c (Ftest_completion):
11564 Use ptrdiff_t for hash table indexes, not int (which is too
11565 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11566 32-bit --with-wide-int hosts).
11567
e097a6fa
PE
11568 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11569 Add a FIXME comment about memory leaks.
11570 (syms_of_charset): Don't assume xmalloc returns.
11571
5637687f
PE
11572 Don't assume that stated character widths fit in int.
11573 * character.c (Fchar_width, c_string_width, lisp_string_width):
11574 * character.h (CHAR_WIDTH):
11575 * indent.c (MULTIBYTE_BYTES_WIDTH):
11576 Use sanitize_char_width to avoid undefined and/or bad behavior
11577 with outlandish widths.
a66cfb1c 11578 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
11579 now that we have two such functions. All uses changed.
11580 (sanitize_char_width): New inline function.
11581
a2271ba2
PE
11582 Don't assume that tab-width fits in int.
11583 * character.h (sanitize_width): New inline function.
11584 (SANE_TAB_WIDTH): New macro.
11585 (ASCII_CHAR_WIDTH): Use it.
11586 * indent.c (sane_tab_width): Remove. All uses replaced by
11587 SANE_TAB_WIDTH (current_buffer).
11588 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11589
18c52557
PE
11590 * fileio.c: Integer overflow issues with file modes.
11591 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11592
caeeedc1
PE
11593 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11594 Remove unreachable code.
11595 (read_hex, load_charset_map_from_file): Check for integer overflow.
11596
6df6ae42 11597 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
11598 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11599 (x_send_scroll_bar_event): Likewise. Check that the size does not
11600 exceed limits imposed by XClientMessageEvent, as well as the usual
11601 ptrdiff_t and size_t limits.
11602
b13995db
PE
11603 * keyboard.c: Overflow, signedness and related fixes.
11604 (make_lispy_movement): Use same integer type in forward decl
11605 that is used in the definition.
11606 (read_key_sequence, keyremap_step):
11607 Change bufsize argument back to int, undoing my 2011-03-30 change.
11608 We prefer signed types, and int is wide enough here.
11609 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11610 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11611 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11612 length, not size_t. Use ptrdiff_t for index, not int.
11613 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11614 possibility of integer overflow.
11615
13464394
PE
11616 Overflow, signedness and related fixes for images.
11617
11618 * dispextern.h (struct it.stack[0].u.image.image_id)
11619 (struct_it.image_id, struct image.id, struct image_cache.size)
11620 (struct image_cache.used, struct image_cache.ref_count):
11621 * gtkutil.c (update_frame_tool_bar):
11622 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11623 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11624 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11625 * nsmenu.m (update_frame_tool_bar):
11626 * xdisp.c (calc_pixel_width_or_height):
11627 * xfns.c (image_cache_refcount):
11628 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11629 on typical 64-bit hosts.
11630
11631 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11632 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11633 Omit unnecessary casts to int.
11634 (parse_image_spec): Check that integers fall into 'int' range
11635 when the callers expect that.
11636 (image_ascent): Redo ascent calculation to avoid int overflow.
11637 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11638 (lookup_image): Remove unnecessary tests.
11639 (xbm_image_p): Locals are now of int, not EMACS_INT,
11640 since parse_image_check makes sure they fit into int.
11641 (png_load, gif_load, svg_load_image):
11642 Prefer int to unsigned where either will do.
11643 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
11644 old tiff_error_handler and tiff_warning_handler.
11645 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
11646 stack buffer overflows. It uses only the features of vsnprintf
11647 that are common to both POSIX and native Microsoft.
11648 (tiff_error_handler, tiff_warning_handler): Use it.
11649 (tiff_load, gif_load, imagemagick_load_image):
11650 Don't assume :index value fits in 'int'.
11651 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11652 (imagemagick_load_image): Check that crop parameters fit into
11653 the integer types that MagickCropImage accepts. Don't assume
11654 Vimagemagick_render_type has a nonnegative value. Don't assume
11655 size_t fits in 'long'.
11656 (gs_load): Use printmax_t to print the widest integers possible.
11657 Check for integer overflow when computing image height and width.
11658
c11821d4
EZ
116592011-08-26 Eli Zaretskii <eliz@gnu.org>
11660
11661 * xdisp.c (redisplay_window): Don't force window start if point
11662 will be invisible in the resulting window. (Bug#9324)
11663
0c95fcf7
EZ
116642011-08-25 Eli Zaretskii <eliz@gnu.org>
11665
11666 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11667 the display spec is of the form `(space ...)'.
11668 (handle_display_spec): Return the value returned by
11669 handle_single_display_spec, not just 1 or zero.
11670 (handle_single_display_spec): If the display spec is of the form
11671 `(space ...)', and specifies display in the text area, return 2
11672 rather than 1.
fee65a97 11673 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
11674 accurately, and prefer exact match for point under bidi.
11675 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
11676
11677 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11678 into disp_prop; all users changed.
11679
11680 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11681 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11682 for the text covered by the display property.
11683
e4ed06f1
CY
116842011-08-25 Chong Yidong <cyd@stupidchicken.com>
11685
11686 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11687 Change return value to nil.
11688 (Frecord_buffer): Delete unused function.
11689
f67cdd7f
EZ
116902011-08-24 Eli Zaretskii <eliz@gnu.org>
11691
5980d4c6
EZ
11692 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11693 buffers, return left-to-right.
8610fe8b
EZ
11694 (set_cursor_from_row): Consider candidate row a win if its glyph
11695 represents a newline and point is on that newline. Fixes cursor
11696 positioning on the newline at EOL of R2L text within L2R
11697 paragraph, and vice versa.
11698 (try_cursor_movement): Check continued rows, in addition to
11699 continuation rows. Fixes unwarranted scroll when point enters a
11700 continued line of R2L text within an L2R paragraph, or vice versa.
11701 (cursor_row_p): Consider the case of point being equal to
11702 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11703 from the end of a short line to the beginning of a continued line
11704 of R2L text within L2R paragraph.
11705 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11706 composed characters.
5980d4c6 11707
f67cdd7f
EZ
11708 * bidi.c (bidi_check_type): Use xassert.
11709 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11710 members.
11711
bca633fb
EZ
117122011-08-23 Eli Zaretskii <eliz@gnu.org>
11713
11714 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11715 a character.
11716
4a5885a7
CY
117172011-08-23 Chong Yidong <cyd@stupidchicken.com>
11718
11719 * nsfont.m (ns_otf_to_script): Fix typo.
11720
0902a04e
KH
117212011-08-22 Kenichi Handa <handa@m17n.org>
11722
11723 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11724 extra slot even if the purpose is char-code-property-table.
11725
1a2e6670
EZ
117262011-08-23 Eli Zaretskii <eliz@gnu.org>
11727
8ddde651
EZ
11728 * xdisp.c (redisplay_window): When computing centering_position,
11729 account for the height of the header line. (Bug#8874)
11730
425cc014
EZ
11731 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11732 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11733 candidate is selected by the mouse, and that candidate has a
11734 composed character under the mouse.
11735
1a2e6670
EZ
11736 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11737 coordinates reported by pos-visible-in-window-p for a composed
11738 character in column zero.
11739
8b76d6f8
SM
117402011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11741
11742 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11743
dac347dd
EZ
117442011-08-22 Eli Zaretskii <eliz@gnu.org>
11745
11746 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11747 consider it a hit if to_charpos is anywhere in the range of the
11748 composed buffer positions.
11749
e013fb34
CY
117502011-08-22 Chong Yidong <cyd@stupidchicken.com>
11751
11752 * image.c (gif_load): Don't assume that each subimage has the same
11753 dimensions as the base image. Handle disposal method that is
11754 "undefined" by the gif spec (Bug#9335).
11755
bd1ba3e8
CY
117562011-08-20 Chong Yidong <cyd@stupidchicken.com>
11757
11758 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 11759 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 11760
54a1215b
EZ
117612011-08-19 Eli Zaretskii <eliz@gnu.org>
11762
823564e5
EZ
11763 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11764 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11765 from an Org mode buffer to a Speedbar frame.
11766
54a1215b
EZ
11767 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11768 a composition, take its buffer position from IT->cmp_it.charpos.
11769 Fixes cursor positioning at the beginning of a line that begins
11770 with a composed character.
11771
9778ebcc
EZ
117722011-08-18 Eli Zaretskii <eliz@gnu.org>
11773
0be6ee06
EZ
11774 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11775 character bidirectional type, use STRONG_L instead. Fixes crashes
11776 in a buffer produced by `describe-categories'.
11777
9778ebcc
EZ
11778 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11779 members before the level stack, so they would be saved and
11780 restored when copying iterator state. Fixes incorrect reordering
11781 around TABs covered by display properties.
11782
156bffbe
AS
117832011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11784
6b02f655 11785 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 11786
72ad093b
CY
117872011-08-17 Chong Yidong <cyd@stupidchicken.com>
11788
11789 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
11790 (internal_condition_case_2, internal_condition_case_n):
11791 Remove unnecessary aborts (Bug#9081).
72ad093b 11792
35774242
EZ
117932011-08-17 Eli Zaretskii <eliz@gnu.org>
11794
11795 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11796 has no `load' handler, try opening the file locally. (Bug#9311)
11797
db76dd85
KB
117982011-08-16 Ken Brown <kbrown@cornell.edu>
11799
11800 * gmalloc.c: Expand comment.
11801
b215eee5
EZ
118022011-08-16 Eli Zaretskii <eliz@gnu.org>
11803
11804 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11805 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11806
a4579d33
KB
118072011-08-16 Ken Brown <kbrown@cornell.edu>
11808
11809 Fix memory allocation problems in Cygwin build (Bug#9273).
11810
11811 * unexcw.c ( __malloc_initialized): Declare external variable.
11812 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11813
8b76d6f8
SM
11814 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11815 New variables.
a4579d33
KB
11816 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11817 dumped emacs.
11818 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11819 in the static heap.
11820 [CYGWIN] (special_realloc): New function.
11821 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11822 requests to realloc storage in the static heap.
11823
3ebec551
PE
118242011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11825
11826 * bidi.c (bidi_initialize): Remove unused local.
11827
9fd8be00
EZ
118282011-08-15 Eli Zaretskii <eliz@gnu.org>
11829
6b02f655
SM
11830 * bidimirror.h:
11831 * biditype.h: Remove file.
11832 * makefile.w32-in ($(BLD)/bidi.$(O)):
11833 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
11834
11835 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11836
11837 * chartab.c: Improve commentary for the uniprop_table API.
11838
32413314
EZ
11839 * bidi.c (bidi_paragraph_init): Support zero value of
11840 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
11841 (bidi_initialize): Use uniprop_table instead of including
11842 biditype.h and bidimirror.h.
32413314 11843
9fd8be00
EZ
11844 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11845 coordinates of the iterator when restoring from ppos_it.
11846 (Bug#9296)
11847
5cf2b69b
KH
118482011-08-14 Kenichi Handa <handa@m17n.org>
11849
11850 * process.c (create_process): Call setup_process_coding_systems
72ad093b 11851 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 11852
daf17d00
EZ
118532011-08-14 Eli Zaretskii <eliz@gnu.org>
11854
11855 * xdisp.c (move_it_in_display_line_to): Don't invoke
11856 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11857 ppos_it. Fixes vertical cursor motion when line beginning is
11858 covered by an image. (Bug#9296)
11859
08e3161a
JD
118602011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11861
11862 * nsterm.h (ns_run_ascript): Declare.
11863 (NSAPP_DATA2_RUNASSCRIPT): Define.
11864
11865 * nsfns.m (as_script, as_result, as_status): New static variables.
11866 (ns_run_ascript): New function.
5e617bc2 11867 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
11868 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11869 the event loop. Get status from as_status (Bug#7276).
11870
11871 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11872 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11873 the event loop (Bug#7276).
11874
a3720aa2
AS
118752011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11876
11877 * gnutls.c (QCgnutls_bootprop_priority)
11878 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11879 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11880 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11881 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11882 (QCgnutls_bootprop_verify_hostname_error)
11883 (QCgnutls_bootprop_callbacks_verify): Rename from
11884 Qgnutls_bootprop_..., all uses changed.
11885
11886 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11887 uses changed.
11888
0a0d27fb
PE
118892011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11890
19d5c50c
PE
11891 * xfaces.c (Qframe_set_background_mode): Now static.
11892 * dispextern.h (Qframe_set_background_mode): Remove decl.
11893
0a0d27fb
PE
11894 * process.c (Fnetwork_interface_info): Declare local only if needed.
11895
377538cb
JD
118962011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11897
11898 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11899 (Fnetwork_interface_list): Allocate in increments of bytes instead
11900 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11901 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11902 sockaddr.
11903 (struct ifflag_def): notrailers is smart on OSX.
11904 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11905 Get hardware address with getifaddrs if available.
11906
08fff70c
EZ
119072011-08-12 Eli Zaretskii <eliz@gnu.org>
11908
11909 * xdisp.c (iterate_out_of_display_property): xassert that
11910 IT->position is set to within IT->object's boundaries. Break from
11911 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
11912 when IT->position is set up wrongly due to some bug.
11913 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
11914 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11915 entry. Force push_it to save on the stack the current
11916 buffer/string position, to be restored by pop_it. Fix flags in
11917 the iterator structure wrt the object coming from a display
11918 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11919 properties. (Bug#9284)
11920
7be1c708 119212011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 11922
7be1c708
CY
11923 * fontset.c (fontset_get_font_group): Add proper type checks.
11924 (Bug#9172)
aac0c6e3 11925
7be1c708 119262011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 11927
7be1c708
CY
11928 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11929 and LC_VERSION_MIN_MACOSX.
11930 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11931 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 11932
97bb72a6
EZ
119332011-08-08 Eli Zaretskii <eliz@gnu.org>
11934
11935 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
11936 no-display-properties-and-no-overlays under bidi display.
11937 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 11938 properties and overlays.
97bb72a6 11939
d5617611
CY
119402011-08-08 Chong Yidong <cyd@stupidchicken.com>
11941
37e11a63
CY
11942 * editfns.c (Fset_time_zone_rule): Document relationship with the
11943 setenv function.
11944
d5617611
CY
11945 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11946 the font entity extracted from the cache (Bug#8109).
11947
58872834
CY
119482011-08-07 Chong Yidong <cyd@stupidchicken.com>
11949
11950 * composite.c (autocmp_chars): Don't reset point. That is done by
11951 restore_point_unwind (Bug#5984).
11952
75bfc667
JL
119532011-08-07 Juri Linkov <juri@jurta.org>
11954
11955 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11956 to show the arg `TIME' instead of `TIMEVAL'.
11957
d1410150
EZ
119582011-08-06 Eli Zaretskii <eliz@gnu.org>
11959
11960 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11961 display property strides EOL and includes a newline, as in
11962 longlines-mode. (Bug#9254)
75b771e4
EZ
11963 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11964 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
11965
11966 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11967 is non-zero, even if the data buffer is NULL. Fixes a crash in
11968 vertical-motion with longlines-mode. (Bug#9254)
11969
35928349
EZ
119702011-08-05 Eli Zaretskii <eliz@gnu.org>
11971
ec7cc85b
EZ
11972 * bidi.c <bidi_cache_total_alloc>: Now static.
11973 (bidi_initialize): Initialize bidi_cache_total_alloc.
11974
8b76d6f8 11975 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
11976 cache. (Bug#9221)
11977
11978 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11979 amount allocated this far in `bidi_cache_total_alloc'.
11980 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11981 non-zero, only free the data buffer without restoring the cache
11982 contents. All callers changed.
11983
11984 * dispextern.h (bidi_unshelve_cache): Update prototype.
11985
11986 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11987 (move_it_in_display_line, move_it_to)
11988 (move_it_vertically_backward, move_it_by_lines): Replace the call
11989 to xfree to an equivalent call to bidi_unshelve_cache.
11990 (move_it_in_display_line_to): Fix logic of returning
412b6358 11991 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 11992
e2e2423b
EZ
119932011-08-05 Eli Zaretskii <eliz@gnu.org>
11994
11995 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11996 came from a string character with a `cursor' property. (Bug#9229)
11997
ae9e757a
JD
119982011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11999
12000 * Makefile.in (LIB_PTHREAD): New variable.
12001 (LIBES): Add LIB_PTHREAD (Bug#9216).
12002
12003 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12004 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12005
213bd7f2
AS
120062011-08-04 Andreas Schwab <schwab@linux-m68k.org>
12007
6b02f655 12008 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 12009
99aaf75f
JD
120102011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12011
12012 * xterm.c (x_find_topmost_parent): New function.
12013 (x_set_frame_alpha): Find topmost parent window with
12014 x_find_topmost_parent and set the property there also (bug#9181).
12015 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12016
c74e9d86
PE
120172011-08-04 Paul Eggert <eggert@cs.ucla.edu>
12018
12019 * callproc.c (Fcall_process): Avoid vfork clobbering
12020 the local vars buffer, coding_systems, current_dir.
12021
640c8776
SM
120222011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
12023
12024 * keymap.c (Fmake_composed_keymap): Move to subr.el.
12025
f26d0e4c
PE
120262011-08-03 Paul Eggert <eggert@cs.ucla.edu>
12027
8a10d76c
PE
12028 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
12029 so that it is not optimized away.
12030
f26d0e4c
PE
12031 * xdisp.c (compute_display_string_pos): Remove unused local.
12032
55439c61
EZ
120332011-08-02 Eli Zaretskii <eliz@gnu.org>
12034
12035 Fix slow cursor motion and scrolling in large buffers with
12036 selective display, like Org Mode buffers. (Bug#9218)
12037
12038 * dispextern.h (struct bidi_it): New member disp_prop_p.
12039
12040 * xdisp.c: Remove one-slot cache of display string positions.
12041 (compute_display_string_pos): Accept an additional argument
5e617bc2 12042 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
12043 for a display string or property. If found, set DISP_PROP_P
12044 non-zero.
12045
12046 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
12047 DISP_PROP_P, and pass it to compute_display_string_pos.
12048 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
12049 non-zero. All callers of bidi_fetch_char changed.
12050
fb33fa43
SM
120512011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
12052
12053 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12054
b099e063
DM
120552010-12-03 Don March <don@ohspite.net>
12056
12057 * keymap.c (Fdefine_key): Fix non-prefix key error message when
12058 last character M-[char] is translated to ESC [char] (bug#7541).
12059
5cc7f7af
KH
120602011-08-02 Kenichi Handa <handa@m17n.org>
12061
d0fffa3f 12062 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
12063
12064 * chartab.c (uniprop_table): Make it non-static.
12065
525d5e6e
EZ
120662011-08-01 Eli Zaretskii <eliz@gnu.org>
12067
12068 * xdisp.c (forward_to_next_line_start): Accept additional argument
12069 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12070 on the newline.
12071 (reseat_at_next_visible_line_start): Use the bidi iterator state
12072 returned by forward_to_next_line_start to restore the state of
12073 it->bidi_it after backing up to previous newline. (Bug#9212)
12074
31011111
AS
120752011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12076
12077 * regex.c (re_comp): Protoize.
12078 (re_exec): Fix return type.
12079 (regexec): Fix type of `ret'. (Bug#9203)
12080
476371c4
PE
120812011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12082
e5d76069
PE
12083 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12084 This is needed if max-image-size is a floating-point number.
12085
9a79b20c
AS
120862011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12087
12088 * print.c (print_object): Print empty symbol as ##.
12089
12090 * lread.c (read1): Read ## as empty symbol.
12091
d8c2fa78
AA
120922011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12093
12094 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12095 setting frame foreground color (Bug#9175).
12096 (x_set_background_color): Likewise.
12097
ffe57a7a
AA
12098 * nsmenu.m (-setText): Size tooltip dimensions precisely to
12099 contents (Bug#9176).
12100 (EmacsTooltip -init): Remove bezels and add shadows to
12101 tooltip windows.
12102
bf3492a5
AA
12103 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12104 or scroll bar (Bug#8470).
12105
d55e9c53
AA
12106 * nsfont.m (nsfont_open): Remove assignment to voffset and
12107 unnecessary vars hshink, expand, hd, full_height, min_height.
12108 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12109
12110 * nsterm.h (nsfont_info): Remove voffset field.
12111
d8c2fa78 121122011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
12113
12114 Implement strike-through and overline on NextStep (Bug#8863).
12115
12116 * nsfont.m (nsfont_open): Use underline position provided by font,
12117 instead of hard-coded value of 2.
12118 (nsfont_draw): Call ns_draw_text_decoration instead.
12119
12120 * nsterm.h: Add declaration for ns_draw_text_decoration.
12121
12122 * nsterm.m (ns_draw_text_decoration): New function for drawing
12123 underline, overline, and strike-through.
12124 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
12125 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 12126 accommodate underlining, etc.
4843aac3 12127
4cc60b9b
EZ
121282011-07-28 Eli Zaretskii <eliz@gnu.org>
12129
bc7ece87
EZ
12130 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
12131 default.
4cc60b9b 12132
476371c4
PE
121332011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12134
66606eea
PE
12135 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
12136 Without this fix, if a signal arrives just after memory fills up,
12137 'malloc' might be invoked reentrantly.
12138
476371c4
PE
12139 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
12140 In other words, assume that every image size is allowed, on non-X
12141 hosts. This assumption is probably wrong, but it lets Emacs compile.
12142
f3fcc40d
AS
121432011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12144
12145 * regex.c (re_iswctype): Convert return values to boolean.
12146
350c992f
EZ
121472011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
12148
12149 * xdisp.c (compute_display_string_pos): Don't use cached display
12150 string position if the buffer had its restriction changed.
12151 (Bug#9184)
12152
5266b4bb
PE
121532011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12154
12155 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12156
2573a837 121572011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 12158
41f55ccd 12159 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 12160
39e378da
PE
12161 * bidi.c: Integer size and overflow fixes.
12162 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
12163 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
12164 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12165 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
12166 (bidi_find_other_level_edge):
12167 Use ptrdiff_t instead of EMACS_INT where either will do.
12168 This works better on 32-bit hosts configured --with-wide-int.
12169 (bidi_cache_ensure_space): Check for size-calculation overflow.
12170 Use % rather than repeated addition, for better worst-case speed.
12171 Don't set bidi_cache_size until after xrealloc returns, because it
12172 might not return.
12173 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
12174 (bidi_cache_ensure_space): Also check that the bidi cache size
12175 does not exceed that of the largest Lisp string or buffer. See Eli
12176 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 12177
5e927815
PE
12178 * alloc.c (__malloc_size_t): Remove.
12179 All uses replaced by size_t. See Andreas Schwab's note
12180 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12181
ca4aa935
PE
12182 * image.c: Improve checking for integer overflow.
12183 (check_image_size): Assume that f is nonnull, since
12184 it is always nonnull in practice. This is one less thing to
12185 worry about when checking for integer overflow later.
12186 (x_check_image_size): New function, which checks for integer
12187 overflow issues inside X.
12188 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12189 This removes the need for a memory_full check.
12190 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12191 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12192 (xbm_read_bitmap_data): Change locals back to 'int', since
12193 their values must fit in 'int'.
12194 (xpm_load_image, png_load, tiff_load):
12195 Invoke x_create_x_image_and_pixmap earlier,
12196 to avoid much needless work if the image is too large.
12197 (tiff_load): Treat overly large images as if
12198 x_create_x_image_and_pixmap failed, not as malloc failures.
12199 (gs_load): Use x_check_image_size.
12200
5f8f9cc2
PE
12201 * gtkutil.c: Omit integer casts.
12202 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12203 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12204
5adf60bc
PE
12205 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12206
c8907a93
PE
12207 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12208 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12209 would wrongly return t on a 64-bit host.
12210
e3c25c68
PE
12211 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12212 The plain *_OVERFLOW macros run afoul of GCC bug 49705
12213 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12214 and therefore cause GCC to emit a bogus diagnostic in some cases.
12215
3f791afe
PE
12216 * image.c: Integer signedness and overflow and related fixes.
12217 This is not an exhaustive set of fixes, but it's time to
12218 record what I've got.
12219 (lookup_pixel_color, check_image_size): Remove redundant decls.
12220 (check_image_size): Don't assume that arbitrary EMACS_INT values
12221 fit in 'int', or that arbitrary 'double' values fit in 'int'.
12222 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12223 (tiff_load, imagemagick_load_image):
12224 Check for overflow in size calculations.
12225 (x_create_x_image_and_pixmap): Remove unnecessary test for
12226 xmalloc returning NULL; that can't happen.
12227 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12228 (xpm_color_bucket): Use better integer hashing function.
12229 (xpm_cache_color): Don't possibly over-allocate memory.
12230 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12231 (gif_memory_source):
12232 Use ptrdiff_t, not int or size_t, to record sizes.
12233 (png_load): Don't assume values greater than 2**31 fit in 'int'.
12234 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12235 either works, as we prefer signed integers.
12236 (tiff_read_from_memory, tiff_write_from_memory):
12237 Return tsize_t, not size_t, since that's what the TIFF API wants.
12238 (tiff_read_from_memory): Don't fail simply because the read would
12239 go past EOF; instead, return a short read.
12240 (tiff_load): Omit no-longer-needed casts.
12241 (Fimagemagick_types): Don't assume size fits into 'int'.
12242
3cc5a532
PE
12243 Improve hashing quality when configured --with-wide-int.
12244 * fns.c (hash_string): New function, taken from sxhash_string.
12245 Do not discard information about ASCII character case; this
12246 discarding is no longer needed.
12247 (sxhash-string): Use it. Change sig to match it. Caller changed.
12248 * lisp.h: Declare it.
12249 * lread.c (hash_string): Remove, since we now use fns.c's version.
12250 The fns.c version returns a wider integer if --with-wide-int is
12251 specified, so this should help the quality of the hashing a bit.
12252
b312a492
PE
12253 * emacs.c: Integer overflow minor fix.
12254 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
12255 Define only if GNU_LINUX.
12256 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12257
dfd153ae
PE
12258 * dispnew.c: Integer signedness and overflow fixes.
12259 Remove unnecessary forward decls, that were a maintenance hassle.
12260 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12261 All uses changed.
12262 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
12263 (scrolling_window): Use ptrdiff_t, not int, for byte count.
12264 (prepare_desired_row, line_draw_cost):
12265 Use int, not unsigned, where either works.
12266 (save_current_matrix, restore_current_matrix):
12267 Use ptrdiff_t, not size_t, where either works.
12268 (init_display): Check for overflow more accurately, and without
12269 relying on undefined behavior.
12270
a81d11a3
PE
12271 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
12272 Remove, replacing with the new symbols in lisp.h. All uses changed.
12273 * fileio.c (make_temp_name):
12274 * filelock.c (lock_file_1, lock_file):
12275 * xdisp.c (message_dolog):
12276 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
12277 Use pMd etc. instead.
12278 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
12279 replacing the pWIDE etc. symbols removed from editfns.c.
12280
3300e6fd
PE
12281 * keyboard.h (num_input_events): Now uintmax_t.
12282 This is (very slightly) less likely to mess up due to wraparound.
12283 All uses changed.
12284
fd05c7e9
PE
12285 * buffer.c: Integer signedness fixes.
12286 (alloc_buffer_text, enlarge_buffer_text):
12287 Use ptrdiff_t rather than size_t when either will do, as we prefer
12288 signed integers.
12289
903fe15d
PE
12290 * alloc.c: Integer signedness and overflow fixes.
12291 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
12292 (__malloc_size_t): Default to size_t, not to int.
12293 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12294 (Fgarbage_collect, mark_object_loop_halt, mark_object):
12295 Prefer ptrdiff_t to size_t when either would do, as we prefer
12296 signed integers.
12297 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12298 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12299 Now const. Initialize with values that are in range even if char
12300 is signed.
12301 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12302 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
12303 These functions do the right thing with sizes > 2**32.
12304 (check_depth): Now ptrdiff_t, not int.
12305 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12306 Adjust to new way of storing sizes. Check for size overflow bugs
12307 in rest of code.
12308 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
12309 slightly wrong anyway, as it missed one instance of
12310 XMALLOC_OVERRUN_CHECK_OVERHEAD.
12311 (refill_memory_reserve): Omit needless cast to size_t.
12312 (mark_object_loop_halt): Mark as externally visible.
12313
ac82cc6a
PE
12314 * xselect.c: Integer signedness and overflow fixes.
12315 (Fx_register_dnd_atom, x_handle_dnd_message):
12316 Use ptrdiff_t, not size_t, since we prefer signed.
12317 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12318 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12319 x_dnd_atoms_size and x_dnd_atoms_length.
12320
c2d1e36d
PE
12321 * doprnt.c: Prefer signed to unsigned when either works.
12322 * eval.c (verror):
12323 * doprnt.c (doprnt):
12324 * lisp.h (doprnt):
12325 * xdisp.c (vmessage):
12326 Use ptrdiff_t, not size_t, when using or implementing doprnt,
12327 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12328 prefer signed arithmetic to avoid comparison confusion.
12329 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12330 but is a bit tricky.
12331
0e926e56
PE
12332 Assume freestanding C89 headers, string.h, stdlib.h.
12333 * data.c, doprnt.c, floatfns.c, print.c:
12334 Include float.h unconditionally.
12335 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12336 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12337 * regex.c: Likewise for stddef.h, string.h.
12338 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12339 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12340 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12341 (STDC_HEADERS): Remove obsolete defines.
12342 * sysdep.c: Include limits.h unconditionally.
12343
9cfdb3ec
PE
12344 Assume support for memcmp, memcpy, memmove, memset.
12345 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12346 * regex.c (memcmp, memcpy):
12347 Remove; we assume C89 now.
12348
12349 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12350 (__malloc_safe_bcopy): Remove; no longer needed.
12351
cf950e6b 12352 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
12353 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12354 well either way, and we prefer signed to unsigned.
12355
dbf38e02
LMI
123562011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12357
12358 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12359 closes the connection while we're reading (bug#9182).
12360
d6f0886c 123612011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 12362
d6f0886c
JD
12363 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12364 are specified (Bug#9168).
24e0f6b1 12365
2eb1f9e6
PE
123662011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12367
12368 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12369 Found by GCC static checking and --with-wide-int on a 32-bit host.
12370
22381272 123712011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
12372
12373 * xdisp.c (compute_display_string_pos): Fix logic of caching
12374 previous display string position. Initialize cached_prev_pos to
12375 -1. Fixes slow-down at the beginning of a buffer.
12376
f25e39b4
EZ
123772011-07-24 Eli Zaretskii <eliz@gnu.org>
12378
12379 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12380 for attrs[LFACE_FONTSET_INDEX].
12381
04c4b52e
PE
123822011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12383
12384 * xml.c (parse_region): Remove unused local
12385 that was recently introduced.
12386
c1734fbd
EZ
123872011-07-23 Eli Zaretskii <eliz@gnu.org>
12388
be18c5a5
EZ
12389 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12390 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12391
c1734fbd
EZ
12392 * xdisp.c (move_it_in_display_line_to): Record the best matching
12393 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
12394 exit if none of the characters scanned was an exact match.
12395 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
12396 when exact match is impossible due to invisible text, and the
12397 lines are truncated.
12398
a258d627
JD
123992011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12400
12401 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12402 for OSX >= 10.7.
12403
b6d5a689
EZ
124042011-07-22 Eli Zaretskii <eliz@gnu.org>
12405
0f74f785
EZ
12406 Fix a significant slow-down of cursor motion with C-n, C-p,
12407 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12408 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 12409 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
12410 (next_element_from_buffer): Call compute_stop_pos_backwards to
12411 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
12412 base_level_stop.
12413 (reseat): Don't look for prev_stop, as that could mean a very long
12414 run.
12415 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12416 <cached_disp_overlay_modiff>: Cache for last found display string
12417 position.
551918c1 12418 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
12419 about the same buffer in the same area of character positions, and
12420 the buffer wasn't changed since the time the display string
12421 position was cached.
551918c1 12422
b2d0c91a
EZ
124232011-07-22 Eli Zaretskii <eliz@gnu.org>
12424
12425 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12426 is an integer, which is important for empty lines. (Bug#9149)
12427
043604ee
CY
124282011-07-22 Chong Yidong <cyd@stupidchicken.com>
12429
12430 * frame.c (Fmodify_frame_parameters): In tty case, update the
12431 default face if necessary (Bug#4238).
12432
da4adb04
CY
124332011-07-21 Chong Yidong <cyd@stupidchicken.com>
12434
12435 * editfns.c (Fstring_to_char): No need to explain what a character
12436 is in the docstring (Bug#6576).
12437
9abd0532
LMI
124382011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12439
12440 * xml.c (parse_region): Make sure we always return a tree.
12441
36881d16
HK
124422011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12443
12444 * xml.c (parse_region): If a document contains only comments,
12445 return that, too.
12446
1e98674d
LMI
124472011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12448
12449 * xml.c (make_dom): Return comments, too.
12450
590bd467
PE
124512011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12452
12453 Port to OpenBSD.
12454 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12455 and the surrounding thread.
12456 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12457 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12458 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12459 timer goes off.
12460 * s/openbsd.h (BROKEN_SIGIO): Define.
12461 * unexelf.c (unexec) [__OpenBSD__]:
12462 Don't update the .mdebug section of the Alpha COFF symbol table.
12463
f41628b2
LMI
124642011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12465
12466 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12467 (bug#8460).
12468
b59b67c5
PE
124692011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12470
15e3a074
PE
12471 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12472 This fixes some race conditions on the permissions of any newly
12473 created file.
12474
41bed37d
PE
12475 * alloc.c (valid_pointer_p): Use pipe, not open.
12476 This fixes some permissions issues when debugging.
12477
b59b67c5
PE
12478 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12479 If fchown fails to set both uid and gid, try to set just gid,
12480 as that is sometimes allowed. Adjust the file's mode to eliminate
12481 setuid or setgid bits that are inappropriate if fchown fails.
12482
925a6be7
SM
124832011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12484
12485 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12486 to compare Lisp_Objects.
12487 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12488 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12489 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12490
52968808
AS
124912011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12492
0a6a104b
AS
12493 * lread.c (read_integer): Unread even EOF character.
12494 (read1): Likewise. Properly record start position of symbol.
12495
52968808
AS
12496 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12497 symbol character follows.
12498
9e381cdd
PE
124992011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12500
12501 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12502 This works around a problem with the previous change to Fcopy_file.
12503 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12504 and without this change, GCC might complain about discarding
12505 fchown's return value.
12506
b5641435
JB
125072011-07-16 Juanma Barranquero <lekktu@gmail.com>
12508
12509 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12510
a8031457
PE
125112011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12512
12513 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12514
dd889327
LMI
125152011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12516
750c33f7
LMI
12517 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12518 it's used from the C level.
12519
dd889327
LMI
12520 * process.c: Use the same condition for POLL_FOR_INPUT in both
12521 keyboard.c and process.c (bug#1858).
12522
87e86684
LM
125232011-07-09 Lawrence Mitchell <wence@gmx.li>
12524
12525 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12526 (Fgnutls_boot): Use it.
12527
64348f40
AS
125282011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12529
12530 * doc.c (Fsubstitute_command_keys): Revert last change.
12531
1d698799
LMI
125322011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12533
f863868c
LMI
12534 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12535 quotes the next character, and doesn't affect other longer
12536 sequences (bug#8935).
12537
1d698799
LMI
12538 * lread.c (syms_of_lread): Clarify that is isn't only
12539 `eval-buffer' and `eval-defun' that's affected by
12540 `lexical-binding' (bug#8460).
12541
aa4b6df6
EZ
125422011-07-15 Eli Zaretskii <eliz@gnu.org>
12543
12544 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 12545 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 12546
5d856da6
PE
125472011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12548
ad6042bb
PE
12549 Fix minor problems found by static checking.
12550 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12551 (elsz): Now a signed constant, not a size_t var. We prefer signed
12552 types to unsigned, to avoid integer comparison confusion. Without
12553 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12554 "cannot optimize loop, the loop counter may overflow", a symptom
12555 of the confusion.
f00bbb22 12556 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
12557 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12558
6468f31c
LMI
125592011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12560
49080b10
LMI
12561 * search.c (Fre_search_backward): Mention `case-fold-search' in
12562 all the re_search_* functions (bug#8138).
12563
6468f31c
LMI
12564 * keyboard.c (Fopen_dribble_file): Document when the file is
12565 closed (bug#8056).
12566
c965adc5
EZ
125672011-07-14 Eli Zaretskii <eliz@gnu.org>
12568
df9733bf
EZ
12569 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12570 bidi_cache_idx.
12571
0bb23927
EZ
12572 Support bidi reordering of display and overlay strings.
12573 * xdisp.c (compute_display_string_pos)
12574 (compute_display_string_end): Accept additional argument STRING.
12575 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12576 (reseat_to_string): Initialize bidi_it->string.s and
12577 bidi_it->string.schars.
12578 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
12579 NULL (avoids a crash in bidi_paragraph_init).
12580 Initialize itb.string.lstring.
0bb23927
EZ
12581 (init_iterator): Call bidi_init_it only of a valid
12582 buffer position was specified. Initialize paragraph_embedding to
12583 L2R.
12584 (reseat_to_string): Initialize the bidi iterator.
12585 (display_string): If we need to ignore text properties of
12586 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12587 original value of -1 will not work with bidi.)
12588 (compute_display_string_pos): First arg is now struct
12589 `text_pos *'; all callers changed. Support display properties on
12590 Lisp strings.
12591 (compute_display_string_end): Support display properties on Lisp
12592 strings.
12593 (init_iterator, reseat_1, reseat_to_string): Initialize the
12594 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12595 when iterating on a string not from display properties).
640c8776
SM
12596 (compute_display_string_pos, compute_display_string_end):
12597 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
12598 arrow keys.
12599 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
12600 base_level_stop; instead, set base_level_stop to BEGV.
12601 Fixes crashes in vertical-motion.
0bb23927
EZ
12602 (next_element_from_buffer): Improve commentary for when
12603 the iterator is before prev_stop.
12604 (init_iterator): Initialize bidi_p from the default value of
12605 bidi-display-reordering, not from buffer-local value. Use the
12606 buffer-local value only if initializing for buffer iteration.
12607 (handle_invisible_prop): Support invisible properties on strings
12608 that are being bidi-reordered.
12609 (set_iterator_to_next): Support bidi reordering of C strings and
12610 Lisp strings.
12611 (next_element_from_string): Support bidi reordering of Lisp
12612 strings.
12613 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
12614 (display_string): Support display of R2L glyph rows.
12615 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
12616 (init_iterator): Don't initialize it->bidi_p for strings
12617 here.
12618 (reseat_to_string): Initialize it->bidi_p for strings here.
12619 (next_element_from_string, next_element_from_c_string)
12620 (next_element_from_buffer): Add xassert's for correspondence
12621 between IT's object being iterated and it->bidi_it.string
12622 structure.
12623 (face_before_or_after_it_pos): Support bidi iteration.
12624 (next_element_from_c_string): Handle the case of the first string
12625 character that is not the first one in the visual order.
12626 (get_visually_first_element): New function, refactored from common
12627 parts of next_element_from_buffer, next_element_from_string, and
12628 next_element_from_c_string.
12629 (tool_bar_lines_needed, redisplay_tool_bar)
12630 (display_menu_bar): Force left-to-right direction. Add a FIXME
12631 comment for making that be controlled by a user option.
12632 (push_it, pop_it): Save and restore the state of the
12633 bidi iterator. Save and restore the bidi_p flag.
12634 (pop_it): Iterate out of display property for string iteration as
12635 well.
12636 (iterate_out_of_display_property): Support iteration over strings.
12637 (handle_single_display_spec): Set up it->bidi_it for iteration
12638 over a display string, and call bidi_init_it.
12639 (handle_single_display_spec, next_overlay_string)
12640 (get_overlay_strings_1, push_display_prop): Set up the bidi
12641 iterator for displaying display or overlay strings.
12642 (forward_to_next_line_start): Don't use the shortcut if
12643 bidi-iterating.
12644 (back_to_previous_visible_line_start): If handle_display_prop
12645 pushed the iterator stack, restore the internal state of the bidi
12646 iterator by calling bidi_pop_it same number of times.
12647 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12648 and we are bidi-iterating, don't decrement the iterator position;
12649 instead, set the first_elt flag in the bidi iterator, to produce
12650 the same effect.
12651 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12652 (push_display_prop): xassert that we are iterating a buffer.
12653 (push_it, pop_it): Save and restore paragraph_embedding member.
12654 (handle_single_display_spec, next_overlay_string)
12655 (get_overlay_strings_1, reseat_1, reseat_to_string)
12656 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12657 correctly. Don't assume unibyte strings are not bidi-reordered.
12658 (compute_display_string_pos)
12659 (compute_display_string_end): Fix handling the case of C string.
12660 (push_it, pop_it): Save and restore from_disp_prop_p.
12661 (handle_single_display_spec, push_display_prop): Set the
12662 from_disp_prop_p flag.
12663 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12664 (pop_it): Call iterate_out_of_display_property only if we are
12665 popping after iteration over a string that came from a display
12666 property. Fix a typo in popping stretch info. Add an assertion
12667 for verifying that the iterator position is in sync with the bidi
12668 iterator.
12669 (handle_single_display_spec, get_overlay_strings_1)
12670 (push_display_prop): Fix initialization of paragraph direction for
12671 string when that of the parent object is not yet determined.
12672 (reseat_1): Call bidi_init_it to resync the bidi
12673 iterator with IT's position. (Bug#7616)
12674 (find_row_edges): If ROW->start.pos gives position
12675 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12676 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12677 Reset the from_disp_prop_p flag.
12678 (SAVE_IT, RESTORE_IT): New macros.
12679 (pos_visible_p, face_before_or_after_it_pos)
12680 (back_to_previous_visible_line_start)
12681 (move_it_in_display_line_to, move_it_in_display_line)
12682 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12683 (try_scrolling, redisplay_window, display_line): Use them when
12684 saving a temporary copy of the iterator and restoring it back.
12685 (back_to_previous_visible_line_start, reseat_1)
12686 (init_iterator): Empty the bidi cache "stack".
12687 (move_it_in_display_line_to): If iterator ended up at
12688 EOL, but we never saw any buffer positions smaller than
12689 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12690 motion in bidi-reordered lines.
12691 (move_it_in_display_line_to): Record prev_method and prev_pos
12692 immediately before the call to set_iterator_to_next. Fixes cursor
12693 motion in bidi-reordered lines with stretch glyphs and strings
12694 displayed in margins. (Bug#8133) (Bug#8867)
12695 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12696 TO_CHARPOS.
640c8776
SM
12697 (pos_visible_p): Support positions in bidi-reordered lines.
12698 Save and restore bidi cache.
0bb23927
EZ
12699
12700 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12701 (bidi_paragraph_info): Delete unused struct.
12702 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12703 (bidi_cache_start): New variable.
12704 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12705 to zero.
12706 (bidi_cache_fetch_state, bidi_cache_search)
12707 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12708 (bidi_cache_find, bidi_peek_at_next_level)
12709 (bidi_level_of_next_char, bidi_find_other_level_edge)
12710 (bidi_move_to_visually_next): Compare cache index with
12711 bidi_cache_start rather than with zero.
12712 (bidi_fetch_char): Accept new argument STRING; all callers
12713 changed. Support iteration over a string. Support strings with
12714 display properties. Support unibyte strings. Fix the type of
12715 `len' according to what STRING_CHAR_AND_LENGTH expects.
12716 (bidi_paragraph_init, bidi_resolve_explicit_1)
12717 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
12718 (bidi_level_of_next_char, bidi_move_to_visually_next):
12719 Support iteration over a string.
0bb23927
EZ
12720 (bidi_set_sor_type, bidi_resolve_explicit_1)
12721 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12722 can now be zero (for strings); special values 0 and -1 were
12723 changed to -1 and -2, respectively.
12724 (bidi_char_at_pos): New function.
12725 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12726 Call it instead of FETCH_MULTIBYTE_CHAR.
12727 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12728 initialized to valid values.
12729 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12730 values.
12731 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12732 the test for valid cached positions. Fix the logic for looking up
12733 the sentinel state in the cache. GCPRO the Lisp string we are
12734 iterating.
12735 (bidi_push_it, bidi_pop_it): New functions.
12736 (bidi_initialize): Initialize the bidi cache start stack pointer.
12737 (bidi_cache_ensure_space): New function, refactored from part of
12738 bidi_cache_iterator_state. Don't assume the required size is just
12739 one BIDI_CACHE_CHUNK away.
12740 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12741 (bidi_count_bytes, bidi_char_at_pos): New functions.
12742 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12743 always valid if bidi_cache_idx is valid.
12744 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12745 is valid if it's going to be used.
12746 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12747 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
12748 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12749 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
12750 (bidi_find_other_level_edge, bidi_cache_start_stack):
12751 All variables related to cache indices are now EMACS_INT.
c965adc5 12752
0bb23927
EZ
12753 * dispextern.h (struct bidi_string_data): New structure.
12754 (struct bidi_it): New member `string'. Make flag members be 1-bit
12755 fields, and put them last in the struct.
640c8776
SM
12756 (compute_display_string_pos, compute_display_string_end):
12757 Update prototypes.
0bb23927
EZ
12758 (bidi_push_it, bidi_pop_it): Add prototypes.
12759 (struct iterator_stack_entry): New members bidi_p,
12760 paragraph_embedding, and from_disp_prop_p.
12761 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
12762 (bidi_shelve_cache, bidi_unshelve_cache):
12763 Declare prototypes.
0bb23927
EZ
12764
12765 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12766 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12767 and vector-like objects.
12768
12769 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12770 cache around display iteration.
12771
12772 * window.c (Fwindow_end, window_scroll_pixel_based)
12773 (displayed_window_lines, Frecenter): Save and restore the bidi
12774 cache around display iteration.
12775
3bbd2265
LMI
127762011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12777
12778 * editfns.c (Fdelete_region): Clarify the use of the named
12779 parameters (bug#6788).
12780
adc47434
MR
127812011-07-14 Martin Rudalics <rudalics@gmx.at>
12782
12783 * indent.c (Fvertical_motion): Set and restore w->pointm when
12784 saving and restoring the window's buffer (Bug#9006).
12785
837c31f8
LMI
127862011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12787
12788 * editfns.c (Fstring_to_char): Clarify just what is returned
12789 (bug#6576). Text by Eli Zaretskii.
12790
ac389d0c
JB
127912011-07-13 Juanma Barranquero <lekktu@gmail.com>
12792
12793 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12794
0be0ce47
EZ
127952011-07-13 Eli Zaretskii <eliz@gnu.org>
12796
12797 * buffer.c (mmap_find): Fix a typo.
12798
cd18e7e3
JB
127992011-07-13 Johan Bockgård <bojohan@gnu.org>
12800
12801 Fix execution of x selection hooks.
12802 * xselect.c (Qx_lost_selection_functions)
12803 (Qx_sent_selection_functions): New vars.
12804 (syms_of_xselect): DEFSYM them.
12805 (x_handle_selection_request): Pass Qx_sent_selection_functions
12806 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12807 (x_handle_selection_clear,x_clear_frame_selections):
12808 Pass Qx_lost_selection_functions rather than
12809 Vx_lost_selection_functions to Frun_hook_with_args.
12810
47ea7f44
PE
128112011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12812
ac389d0c 12813 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
12814 The old code sometimes used this field without initializing it.
12815
47ea7f44
PE
12816 * alloc.c (gc_sweep): Don't read past end of array.
12817 In theory, the old code could also have corrupted Emacs internals,
12818 though it'd be very unlikely.
12819
bc985c87
AS
128202011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12821
12822 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 12823 argument. (Bug#4026)
bc985c87 12824
0cf34688
LMI
128252011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12826
b3dadd76
LMI
12827 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12828 key" (bug#4257).
12829
0cf34688
LMI
12830 * window.c (Fset_window_start): Doc fix (bug#4199).
12831 (Fset_window_hscroll): Ditto.
12832
270768cd
PE
128332011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12834
077e3dda 12835 Fix minor new problems caught by GCC 4.6.1.
270768cd 12836 * term.c (init_tty): Remove unused local.
490011a6 12837 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 12838 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 12839 not used otherwise.
270768cd 12840
b1f58454
CY
128412011-07-12 Chong Yidong <cyd@stupidchicken.com>
12842
12843 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12844
22b9578d
LMI
128452011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12846
6e70ab07
LMI
12847 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12848 are the mini-buffer and the echo area (bug#3320).
12849
22b9578d
LMI
12850 * term.c (init_tty): Remove support for supdup, c10 and perq
12851 terminals, which are no longer supported (bug#1482).
12852
8974cc9f
JB
128532011-07-10 Johan Bockgård <bojohan@gnu.org>
12854
12855 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12856
a560d974
JD
128572011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12858
12859 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12860 for non-popups (Bug#3642).
12861
1dae0f0a
AS
128622011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12863
268c2c36 12864 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 12865 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
12866 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12867 * cm.c (losecursor): Likewise.
1dae0f0a
AS
12868 * data.c (fmod): Likewise.
12869 * dispnew.c (swap_glyphs_in_rows): Likewise.
12870 * emacs.c (memory_warning_signal): Likewise.
12871 * floatfns.c (float_error): Likewise.
12872 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12873 (otf_open, font_otf_capability, generate_otf_features)
12874 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12875 Likewise.
12876 * image.c (pbm_read_file): Likewise.
12877 * indent.c (string_display_width): Likewise.
12878 * intervals.c (check_for_interval, search_for_interval)
12879 (inc_interval_count, count_intervals, root_interval)
12880 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12881 * lread.c (defalias): Likewise.
268c2c36 12882 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
12883 * regex.c (set_image_of_range_1, set_image_of_range)
12884 (regex_grow_registers): Likewise.
12885 * sysdep.c (strerror): Likewise.
12886 * termcap.c (valid_filename_p, tprint, main): Likewise.
12887 * tparam.c (main): Likewise.
12888 * unexhp9k800.c (run_time_remap, save_data_space)
12889 (update_file_ptrs, read_header, write_header, calculate_checksum)
12890 (copy_file, copy_rest, display_header): Likewise.
12891 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12892 Likewise.
12893 * xdisp.c (check_it): Likewise.
12894 * xfaces.c (register_color, unregister_color, unregister_colors):
12895 Likewise.
12896 * xfns.c (print_fontset_result): Likewise.
12897 * xrdb.c (member, fatal, main): Likewise.
12898
99033785
PE
128992011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12900
12901 Fix minor problems found by static checking (Bug#9031).
12902 * chartab.c (char_table_set_range, map_sub_char_table):
12903 Remove unused locals.
12904 (uniprop_table): Now static.
12905 * composite.c (_work_char): Remove unused static var.
12906
9cb2ac56
JB
129072011-07-09 Juanma Barranquero <lekktu@gmail.com>
12908
12909 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12910
f25661f0
JD
129112011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12912
12913 * gtkutil.c (qttip_cb): Remove code without function.
12914
8278c4fe
EZ
129152011-07-09 Eli Zaretskii <eliz@gnu.org>
12916
12917 * w32.c (pthread_sigmask): New stub.
12918
1692ae2d 129192011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 12920
8a6ebd58 12921 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
12922 sigprocmask is portable only for single-threaded applications, and
12923 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
12924 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12925 (LIBES): Use it.
12926 * callproc.c (Fcall_process):
12927 * process.c (create_process):
12928 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12929 Use pthread_sigmask, not sigprocmask.
123403e4 12930
1b854618
JD
129312011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12932
12933 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12934 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12935 wrong (Bug#8591).
12936
3fe4b549
JD
129372011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12938
0ce7e563
JD
12939 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12940 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12941 (xg_hide_tooltip): Fix comment.
12942
3fe4b549
JD
12943 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12944 in registerServicesMenuSendTypes.
12945 (validRequestorForSendType): Don't check ns_return_types.
12946
12947 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12948 ns_return_type.
12949
5df75e47
JR
129502011-07-08 Jason Rumney <jasonr@gnu.org>
12951
22610910
JR
12952 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12953 SH_SHOW for hidden windows (Bug#5482).
12954
5df75e47
JR
12955 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12956 frame struct members of non-existent frames (Bug#6284).
12957
699c10bd
JD
129582011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12959
4393663b
JD
12960 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12961 variable firstTime not needed on OSX >= 10.6.
12962 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12963 >= 10.5. Use setKnobProportion, setDoubleValue.
12964
12965 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12966 (MAC_OS_X_VERSION_10_5): Define if not defined.
12967 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12968 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12969 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12970
12971 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 12972 cString and lossyCString on OSX >= 10.4.
4393663b 12973
58179cce 12974 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
12975 sizeToFit on OSX >= 10.2.
12976
12977 * nsimage.m (allocInitFromFile): Don't use deprecated method
12978 bestRepresentationForDevice on OSX >= 10.6.
12979
12980 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12981 to avoid warning.
12982
12983 * emacs.c: Declare unexec_init_emacs_zone.
12984
a63e0781
JD
12985 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12986
699c10bd
JD
12987 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12988
12989 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12990 on svcsMenu (Bug#8842).
12991
12992 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12993 ns_return_types.
12994 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12995
12996 * nsterm.m (QUTF8_STRING): Declare.
12997 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12998 (validRequestorForSendType): Return type is (id).
12999 Change indexOfObjectIdenticalTo to indexOfObject.
13000 Check if we have local selection before returning self (Bug#8842).
13001 (writeSelectionToPasteboard): Put local selection into paste board
13002 if we have a local selection (Bug#8842).
13003 (syms_of_nsterm): DEFSYM QUTF8_STRING.
13004
13005 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13006 (ns_get_local_selection): Declare.
13007
54e10184
LMI
130082011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
13009
9888ff71
LMI
13010 * keymap.c (describe_map_tree): Don't insert a double newline at
13011 the end of the buffer (bug#1169) and return whether we inserted
13012 something.
13013
54e10184
LMI
13014 * callint.c (Fcall_interactively): Change "reading args" to
13015 "providing args" to try to clarify what it does (bug#1010).
13016
15fa4783
KH
130172011-07-07 Kenichi Handa <handa@m17n.org>
13018
13019 * composite.c (composition_compute_stop_pos): Ignore a static
13020 composition starting before CHARPOS (Bug#8915).
13021
13022 * xdisp.c (handle_composition_prop): Likewise.
13023
a8815b00
EZ
130242011-07-07 Eli Zaretskii <eliz@gnu.org>
13025
13026 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13027 (Bug#9015)
13028
ef7b981d 130292011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
13030
13031 * character.h (unicode_category_t): New enum type.
13032
13033 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13034 (Qchar_code_property_table): New variable.
13035 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13036 (UNIPROP_COMPRESSED_FORM_P): New macros.
13037 (char_table_ascii): Uncompress the compressed values.
13038 (sub_char_table_ref): New arg is_uniprop. Callers changed.
13039 Uncompress the compressed values.
ac389d0c 13040 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
13041 (char_table_ref_and_range): Uncompress the compressed values.
13042 (sub_char_table_set): New arg is_uniprop. Callers changed.
13043 Uncompress the compressed values.
13044 (sub_char_table_set_range): Args changed. Callers changed.
13045 (char_table_set_range): Adjuted for the above change.
13046 (map_sub_char_table): Delete args default_val and parent. Add arg
13047 top. Give decoded values to a Lisp function.
640c8776 13048 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
13049 values to a Lisp function. Gcpro more variables.
13050 (uniprop_table_uncompress)
13051 (uniprop_decode_value_run_length): New functions.
13052 (uniprop_decoder, uniprop_decoder_count): New variables.
13053 (uniprop_get_decoder, uniprop_encode_value_character)
13054 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13055 New functions.
13056 (uniprop_encoder, uniprop_encoder_count): New variables.
13057 (uniprop_get_encoder, uniprop_table)
13058 (Funicode_property_table_internal, Fget_unicode_property_internal)
13059 (Fput_unicode_property_internal): New functions.
13060 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13061 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 13062 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
13063 char-code-property-alist.
13064
640c8776 13065 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
13066 Vunicode_category_table.
13067
640c8776 13068 * font.c (font_range): Adjust for the change of
c805dec0
KH
13069 Vunicode_category_table.
13070
76b397fb
DN
130712011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13072
13073 * m/iris4d.h: Remove file, move contents ...
13074 * s/irix6-5.h: ... here.
13075
22b4128e
PE
130762011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13077
13078 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
13079 * alloc.c (mark_buffer):
13080 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13081 (clone_per_buffer_values): Don't assume that
22b4128e
PE
13082 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13083 This isn't true in general, and it's particularly not true
13084 if Emacs is configured with --with-wide-int.
13085 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13086 New macros, used in the buffer.c change.
13087
869795d6
JD
130882011-07-05 Jan Djärv <jan.h.d@swipnet.se>
13089
13090 * xsettings.c: Use both GConf and GSettings if both are available.
13091 (store_config_changed_event): Add comment.
13092 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13093 (store_tool_bar_style_changed): New functions.
5e617bc2 13094 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
13095 (struct xsettings): Move font inside HAVE_XFT.
13096 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 13097 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 13098 Move inside HAVE_XFT.
640c8776 13099 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
13100 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13101 also.
13102 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 13103 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 13104 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
13105 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13106 (parse_settings): Move check for font inside HAVE_XFT.
13107 (read_settings, apply_xft_settings): Add comment.
13108 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
13109 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
13110 call store_font_name_changed.
13111 (xft_settings_event): Add comment.
13112 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
13113 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
13114 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
13115 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
13116 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
13117 (xsettings_get_system_font, xsettings_get_system_normal_font):
13118 Add comment.
869795d6 13119
d8ed26bd
PE
131202011-07-05 Paul Eggert <eggert@cs.ucla.edu>
13121
13122 Random fixes. E.g., (random) never returned negative values.
13123 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
13124 subseconds part to the entropy, as that's a bit more random.
13125 Prefer signed to unsigned, since the signedness doesn't matter and
13126 in general we prefer signed. When given a limit, use a
13127 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
13128 latter isn't right if USE_2_TAGS_FOR_INTS.
13129 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
13130 not 0..VALMASK. Don't discard "excess" bits that random () returns.
13131
cabf1cac
SM
131322011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
13133
13134 * textprop.c (text_property_stickiness):
13135 Obey Vtext_property_default_nonsticky.
13136 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
13137 * w32fns.c (syms_of_w32fns):
13138 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
13139
6e9b2be9
PE
131402011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13141
13142 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
13143 This is more efficient than Ffile_directory_p and avoids a minor race.
13144
90186c68
LMI
131452011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
13146
7c301272
LMI
13147 * buffer.c (Foverlay_put): Say what the return value is
13148 (bug#7835).
13149
c4f2d8d4
LMI
13150 * fileio.c (barf_or_query_if_file_exists): Check first if the file
13151 is a directory before asking whether to use the file name
13152 (bug#7564).
ad637907
LMI
13153 (barf_or_query_if_file_exists): Make the "File is a directory"
13154 error be more correct.
c4f2d8d4 13155
90186c68
LMI
13156 * fns.c (Frequire): Remove the mention of the .gz files, since
13157 that's installation-specific, but keep the mention of
13158 `get-load-suffixes'.
13159
da64016e
PE
131602011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13161
13162 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
13163 Report string overflow if the output is too long.
13164
7d47b580
JB
131652011-07-04 Juanma Barranquero <lekktu@gmail.com>
13166
a555cb87
JB
13167 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
13168 (syms_of_gnutls): Remove duplicate DEFSYM for
13169 Qgnutls_bootprop_verify_hostname_error, an error for
13170 Qgnutls_bootprop_verify_error (which is no longer used).
13171
7d47b580
JB
13172 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13173 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
13174 Also (re)move comments that are misplaced or no longer relevant.
13175
1e49bfab
LMI
131762011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13177
13178 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13179
1485f4c0
CY
131802011-07-03 Chong Yidong <cyd@stupidchicken.com>
13181
13182 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13183 and background color parameters if they have been changed.
13184
a9ab721e
LMI
131852011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13186
13187 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13188
cf7cff57
PE
131892011-07-03 Paul Eggert <eggert@cs.ucla.edu>
13190
2e13213d
PE
13191 * xsettings.c (SYSTEM_FONT): Define only when used.
13192 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13193
cf7cff57
PE
13194 * keymap.c (access_keymap_1): Now static.
13195
7a8e04f7
CY
131962011-07-02 Chong Yidong <cyd@stupidchicken.com>
13197
13198 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13199 leave any prefix arg for the up event (Bug#1586).
13200
61352f62
LMI
132012011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
13202
69bb1ef7
LMI
13203 * lread.c (syms_of_lread): Mention single symbols defined by
13204 `defvar' or `defconst' (bug#7154).
13205
61352f62 13206 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 13207 (Frequire): Mention get-load-suffixes.
61352f62 13208
28545e04
MR
132092011-07-02 Martin Rudalics <rudalics@gmx.at>
13210
13211 * window.h (window): Remove clone_number slot.
13212 * window.c (Fwindow_clone_number, Fset_window_clone_number):
13213 Remove.
13214 (make_parent_window, make_window, saved_window)
13215 (Fset_window_configuration, save_window_save): Don't deal with
13216 clone numbers.
13217 * buffer.c (Qclone_number): Remove declaration.
13218 (sort_overlays, overlay_strings): Don't deal with clone numbers.
13219
3349e122
SM
132202011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
13221
13222 Add multiple inheritance to keymaps.
13223 * keymap.c (Fmake_composed_keymap): New function.
13224 (Fset_keymap_parent): Simplify.
13225 (fix_submap_inheritance): Remove.
13226 (access_keymap_1): New function extracted from access_keymap to handle
13227 embedded parents and handle lists of maps.
13228 (access_keymap): Use it.
13229 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13230 (Fcopy_keymap): Handle embedded parents.
13231 (Fcommand_remapping, define_as_prefix): Simplify.
13232 (Fkey_binding): Simplify.
13233 (syms_of_keymap): Move minibuffer-local-completion-map,
13234 minibuffer-local-filename-completion-map,
13235 minibuffer-local-must-match-map, and
13236 minibuffer-local-filename-must-match-map to Elisp.
13237 (syms_of_keymap): Defsubr make-composed-keymap.
13238 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13239 (parse_menu_item): Trivial simplification.
13240
3279eb87
GM
132412011-07-01 Glenn Morris <rgm@gnu.org>
13242
13243 * Makefile.in (SETTINGS_LIBS): Fix typo.
13244
39cb9e56 132452011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
13246
13247 * coding.c (Fencode_coding_string): Record the last coding system
13248 used, as the function doc string says (bug#8738).
13249
0949d2b6
JD
132502011-07-01 Jan Djärv <jan.h.d@swipnet.se>
13251
13252 * xsettings.c (store_monospaced_changed): Take new font as arg and
13253 check for change against current_mono_font.
13254 (EMACS_TYPE_SETTINGS): Remove this and related defines.
13255 (emacs_settings_constructor, emacs_settings_get_property)
13256 (emacs_settings_set_property, emacs_settings_class_init)
13257 (emacs_settings_init, gsettings_obj): Remove.
13258 (something_changedCB): New function for HAVE_GSETTINGS.
13259 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13260 with value as argument.
13261 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
13262 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 13263 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
13264 "changed".
13265
13266 * xgselect.c: Add defined (HAVE_GSETTINGS).
13267 (xgselect_initialize): Ditto.
13268
13269 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
13270 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
13271 xg_select.
13272
bbc6b304
PE
132732011-07-01 Paul Eggert <eggert@cs.ucla.edu>
13274
13275 * eval.c (struct backtrace): Simplify and port the data structure.
13276 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
13277 signed bit field, as this assumption is not portable and it makes
13278 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
13279 "char debug_on_exit : 1" as this is not portable either; instead,
13280 use the portable "unsigned int debug_on_exit : 1". Remove unused
13281 member evalargs. Remove obsolete comments about cc bombing out.
13282
9851bfc5
JD
132832011-06-30 Jan Djärv <jan.h.d@swipnet.se>
13284
51bb811f 13285 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
13286 Let HAVE_GSETTINGS override HAVE_GCONF.
13287 (store_monospaced_changed): New function.
13288 (EMACS_SETTINGS): A new type derived from GObject to handle
13289 GSettings notifications.
13290 (emacs_settings_constructor, emacs_settings_get_property)
13291 (emacs_settings_set_property, emacs_settings_class_init):
13292 New functions.
13293 (gsettings_client, gsettings_obj): New variables.
13294 (GSETTINGS_SCHEMA): New define.
13295 (something_changedCB): Call store_monospaced_changed.
13296 (init_gsettings): New function.
13297 (xsettings_initialize): Call init_gsettings.
13298 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13299 to NULL.
13300
640c8776 13301 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
13302 GCONF_CFLAGS/LIBS.
13303
5386012d
MR
133042011-06-29 Martin Rudalics <rudalics@gmx.at>
13305
13306 * window.c (resize_root_window, grow_mini_window)
13307 (shrink_mini_window): Rename Qresize_root_window to
13308 Qwindow_resize_root_window and Qresize_root_window_vertically to
13309 Qwindow_resize_root_window_vertically.
13310
f13e0b08
PE
133112011-06-28 Paul Eggert <eggert@cs.ucla.edu>
13312
13313 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13314
94515237
JB
133152011-06-27 Juanma Barranquero <lekktu@gmail.com>
13316
13317 * makefile.w32-in: Redesign dependencies so they reflect more
13318 clearly which files are directly included by each source file,
13319 and not through other includes.
13320
e43b6e43
MR
133212011-06-27 Martin Rudalics <rudalics@gmx.at>
13322
13323 * buffer.c (Qclone_number): Declare static and DEFSYM it.
13324 (sort_overlays, overlay_strings): When an overlay's clone number
13325 matches the window's clone number process the overlay even if
13326 the overlay's window property doesn't match the current window.
13327
d68443dc
MR
13328 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13329 (Fwindow_hchild): Rename to Fwindow_left_child.
13330 (Fwindow_next): Rename to Fwindow_next_sibling.
13331 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
13332 (resize_window_check): Rename to window_resize_check.
13333 (resize_window_apply): Rename to window_resize_apply.
13334 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13335 (Fdelete_other_windows_internal, resize_frame_windows)
13336 (Fsplit_window_internal, Fdelete_window_internal)
13337 (grow_mini_window, shrink_mini_window)
13338 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 13339
c7e73be5
JD
133402011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13341
13342 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13343 (emacs_fixed_set_min_size): Remove.
13344 (emacs_fixed_new): Take frame as argument.
13345
13346 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13347 (_EmacsFixedPrivate): Remove minwidth/height.
13348 Add struct frame *f.
13349 (emacs_fixed_init): Initialize priv->f.
13350 (get_parent_class, emacs_fixed_set_min_size): Remove.
13351 (emacs_fixed_new): Set priv->f to argument.
13352 (emacs_fixed_get_preferred_width)
13353 (emacs_fixed_get_preferred_height): Use min_width/height from
13354 frames size_hint to set minimum and natural (Bug#8919).
13355 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13356 and use min_width/height from frames size_hint to set
13357 min_width/height (Bug#8919).
13358
13359 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
13360 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13361 Fix indentation.
c7e73be5 13362
cf99dcf8
EZ
133632011-06-26 Eli Zaretskii <eliz@gnu.org>
13364
13365 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13366 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13367 called at ZV.
13368
029529ac
CY
133692011-06-26 Chong Yidong <cyd@stupidchicken.com>
13370
13371 * process.c (wait_reading_process_output): Bypass select if
13372 waiting for a cell while ignoring keyboard input, and input is
13373 pending. Suggested by Jan Djärv (Bug#8869).
13374
7a7ef429
PE
133752011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13376
13377 Use gnulib's dup2 module instead of rolling our own.
13378 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13379
11fdef7d 133802011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
13381
13382 * dispnew.c (scrolling_window): Before scrolling, turn off a
13383 mouse-highlight in the window being scrolled.
13384
cd3520a4
JB
133852011-06-24 Juanma Barranquero <lekktu@gmail.com>
13386
13387 Move DEFSYM to lisp.h and use everywhere.
13388
13389 * character.h (DEFSYM): Move declaration...
13390 * lisp.h (DEFSYM): ...here.
13391
13392 * gnutls.c:
13393 * minibuf.c:
13394 * w32menu.c:
13395 * w32proc.c:
13396 * w32select.c: Don't include character.h.
13397
13398 * alloc.c (syms_of_alloc):
13399 * buffer.c (syms_of_buffer):
13400 * bytecode.c (syms_of_bytecode):
13401 * callint.c (syms_of_callint):
13402 * casefiddle.c (syms_of_casefiddle):
13403 * casetab.c (init_casetab_once):
13404 * category.c (init_category_once, syms_of_category):
13405 * ccl.c (syms_of_ccl):
13406 * cmds.c (syms_of_cmds):
13407 * composite.c (syms_of_composite):
13408 * dbusbind.c (syms_of_dbusbind):
13409 * dired.c (syms_of_dired):
13410 * dispnew.c (syms_of_display):
13411 * doc.c (syms_of_doc):
13412 * editfns.c (syms_of_editfns):
13413 * emacs.c (syms_of_emacs):
13414 * eval.c (syms_of_eval):
13415 * fileio.c (syms_of_fileio):
13416 * fns.c (syms_of_fns):
13417 * frame.c (syms_of_frame):
13418 * fringe.c (syms_of_fringe):
13419 * insdel.c (syms_of_insdel):
13420 * keymap.c (syms_of_keymap):
13421 * lread.c (init_obarray, syms_of_lread):
13422 * macros.c (syms_of_macros):
13423 * msdos.c (syms_of_msdos):
13424 * print.c (syms_of_print):
13425 * process.c (syms_of_process):
13426 * search.c (syms_of_search):
13427 * sound.c (syms_of_sound):
13428 * syntax.c (init_syntax_once, syms_of_syntax):
13429 * terminal.c (syms_of_terminal):
13430 * textprop.c (syms_of_textprop):
13431 * undo.c (syms_of_undo):
13432 * w32.c (globals_of_w32):
13433 * window.c (syms_of_window):
13434 * xdisp.c (syms_of_xdisp):
13435 * xfaces.c (syms_of_xfaces):
13436 * xfns.c (syms_of_xfns):
13437 * xmenu.c (syms_of_xmenu):
13438 * xsettings.c (syms_of_xsettings):
13439 * xterm.c (syms_of_xterm): Use DEFSYM.
13440
4228cf16
TZ
134412011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13442
cd3520a4 13443 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 13444
7fcccf1e
PE
134452011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13446
7efb4e0e
PE
13447 Integer and buffer overflow fixes (Bug#8873).
13448
ff5844ad
PE
13449 * print.c (printchar, strout): Check for string overflow.
13450 (PRINTPREPARE, printchar, strout):
13451 Don't set size unless allocation succeeds.
13452
90532f02
PE
13453 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13454 for sizes. Check for string overflow more accurately.
13455 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13456
6d84508d
PE
13457 * macros.c: Integer and buffer overflow fixes.
13458 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13459 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13460 Use ptrdiff_t, not int, for sizes.
13461 Don't increment bufsize until after realloc succeeds.
13462 Check for size-calculation overflow.
13463 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13464
437b2cb4
PE
13465 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13466
8b9ac8b4
PE
13467 * lread.c: Integer overflow fixes.
13468 (read_integer): Radix is now EMACS_INT, not int,
13469 to improve quality of diagnostics for out-of-range radices.
13470 Calculate buffer size correctly for out-of-range radices.
13471 (read1): Check for integer overflow in radices, and in
13472 read-circle numbers.
82cb60d3
PE
13473 (read_escape): Avoid int overflow.
13474 (Fload, openp, read_buffer_size, read1)
13475 (substitute_object_recurse, read_vector, read_list, map_obarray):
13476 Use ptrdiff_t, not int, for sizes.
13477 (read1): Use EMACS_INT, not int, for sizes.
20270765 13478 Check for size overflow.
8b9ac8b4 13479
7fcccf1e
PE
13480 * image.c (cache_image): Check for size arithmetic overflow.
13481
bfbbd7e7
PE
13482 * lread.c: Integer overflow issues.
13483 (saved_doc_string_size, saved_doc_string_length)
13484 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13485 Now ptrdiff_t, not int.
13486 (read1): Don't assume doc string length fits in int. Check for
13487 out-of-range doc string lengths.
13488 (read_list): Don't assume file position fits in int.
39019e54 13489 (read_escape): Check for hex character overflow.
bfbbd7e7 13490
4e323265
LL
134912011-06-22 Leo Liu <sdl.web@gmail.com>
13492
13493 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13494 Move to minibuffer.el.
13495
85fece3e
PE
134962011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13497
20b84ce9 13498 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
13499 The following patches are for when GLYPH_DEBUG && !XASSERT.
13500 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13501 * dispnew.c (flush_stdout):
13502 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13503 Mark as externally visible.
13504 * dispnew.c (check_window_matrix_pointers): Now static.
13505 * dispnew.c (window_to_frame_vpos):
13506 * xfns.c (unwind_create_frame):
13507 * xterm.c (x_check_font): Remove unused local.
13508 * scroll.c (CHECK_BOUNDS):
13509 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13510 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13511 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13512 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13513 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13514 Now static.
13515 (debug_method_add): Use va_list and vsprintf rather than relying
13516 on undefined behavior with wrong number of arguments.
13517 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13518 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13519 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13520 since we're not interested in debugging glyphs with old libraries.
13521 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13522 GCC 4.6.0's static checking.
13523
0766b489
PE
135242011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13525
31fd4b32
PE
13526 Integer overflow and signedness fixes (Bug#8873).
13527 A few related buffer overrun fixes, too.
13528
b79e8648
PE
13529 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13530
0766b489
PE
13531 * dispextern.h (struct face.stipple):
13532 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13533 (x_bitmap_mask, x_allocate_bitmap_record)
13534 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13535 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13536 (x_create_bitmap_from_xpm_data):
13537 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13538 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13539 (.bitmaps_last):
13540 * xfaces.c (load_pixmap):
13541 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13542 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13543 (.bitmaps_last, struct x_output.icon_bitmap):
13544 Use ptrdiff_t, not int, for bitmap indexes.
13545 (x_allocate_bitmap_record): Check for size overflow.
13546 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13547
b081724f
PE
13548 Use ptrdiff_t, not int, for overlay counts.
13549 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13550 * editfns.c (overlays_around, get_pos_property):
13551 * textprop.c (get_char_property_and_overlay):
13552 * xdisp.c (next_overlay_change, note_mouse_highlight):
13553 * xfaces.c (face_at_buffer_position):
21514da7
PE
13554 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13555 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13556 (Fnext_overlay_change, Fprevious_overlay_change)
13557 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 13558 Use ptrdiff_t, not int, for sizes.
21514da7 13559 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 13560
3de73e5e
PE
13561 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13562
2606c57b
PE
13563 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13564 (x_session_initialize): Do not assume string length fits in int.
13565
aaafe47a
PE
13566 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13567 This is unlikely, but can occur if DPI is outlandish.
13568
2674ddc8 13569 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
13570 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13571
28154962
PE
13572 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13573 * xrdb.c (magic_file_p, search_magic_path):
13574 Omit last arg SUFFIX; it was always 0. All callers changed.
13575 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13576
7de51af5
PE
13577 * xfont.c (xfont_match): Avoid need for strlen.
13578
25ed6cc3
PE
13579 * xfns.c: Don't assume strlen fits in int.
13580 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13581
4eab31dd
PE
13582 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13583 not unsigned long, as we prefer signed integers. All callers changed.
13584 Detect integer overflow in repeat count.
13585 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 13586 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 13587
171e2a58
PE
13588 * termcap.c: Don't assume sizes fit in int and never overflow.
13589 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13590 (gobble_line): Check for size-calculation overflow.
13591
ad39faca 13592 * minibuf.c (Fread_buffer):
6e5bb2dc 13593 * lread.c (intern, intern_c_string):
74ca2eb3
PE
13594 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13595 Don't assume string length fits in int.
13596
52c61c22 13597 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
13598 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13599
b5b8c9e5
PE
13600 * font.c: Don't assume string length fits in int.
13601 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13602 Use ptrdiff_t, not int.
ccd6111c
PE
13603 (font_intern_prop): Don't assume string length fits in int.
13604 Don't assume integer property fits in fixnum.
13605 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 13606
882f0d81 13607 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 13608 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
13609 Reformulate so as not to need the command string.
13610 Invoke gzip -cd rather than gunzip, as it's more portable.
13611 (lock_info_type, lock_file_1, lock_file):
13612 Don't assume pid_t and time_t fit in unsigned long.
13613 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13614 (current_lock_owner): Prefer signed type for sizes.
13615 Use memcpy, not strncpy, where memcpy is what is really wanted.
13616 Don't assume (via atoi) that time_t and pid_t fit in int.
13617 Check for time_t and/or pid_t out of range, e.g., via a network share.
13618 Don't alloca where an auto var works fine.
13619
93f4cf88
PE
13620 * fileio.c: Fix some integer overflow issues.
13621 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13622 Don't assume string length fits in int.
13623 (directory_file_name): Don't assume string length fits in long.
13624 (make_temp_name): Don't assume pid fits in int, or that its print
13625 length is less than 20.
13626
f3e92b69
PE
13627 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13628
1bfdaf10
PE
13629 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13630
35016e9a
PE
13631 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13632
3d1e65a1
PE
13633 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13634 We prefer signed integers, even for size calculations.
13635
0b963a93
PE
13636 * emacs.c: Don't assume string length fits in 'int'.
13637 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13638 (main): Don't invoke strlen when not needed.
13639
573f4b54
PE
13640 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13641 (XD_DEBUG_MESSAGE): Don't waste a byte.
13642
989f33ba
PE
13643 * callproc.c (getenv_internal_1, getenv_internal)
13644 (Fgetenv_internal):
965d34eb
PE
13645 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13646
e4d29b33
PE
13647 * lread.c (invalid_syntax): Omit length argument.
13648 All uses changed. This doesn't fix a bug, but it simplifies the
13649 code away from its former Hollerith-constant appearance, and it's
13650 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 13651 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 13652
eb49b136
PE
13653 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13654 This didn't break anything, but it didn't help either.
13655 It's confusing to put a bogus integer in a place where the actual
13656 value does not matter.
9f62aeb1 13657 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 13658 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 13659
15375a22
PE
13660 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13661 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13662 implementation.
b61cc01c
PE
13663 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13664 We prefer signed types, and the value cannot exceed the EMACS_INT
13665 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
13666 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13667 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13668 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 13669
53b2623d
PE
13670 * indent.c (sane_tab_width): New function.
13671 (current_column, scan_for_column, Findent_to, position_indentation)
13672 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 13673 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 13674
51cab52b 13675 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 13676
f2ed8a70
PE
13677 * lisp.h (lint_assume): New macro.
13678 * composite.c (composition_gstring_put_cache):
13679 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13680
abe80cc6
PE
13681 * editfns.c, insdel.c:
13682 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 13683
b02c740e
PE
13684 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13685
ebc96716
PE
13686 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13687
b4e50fa0 13688 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 13689 Use much-faster test for byte-length change.
311d5d7c 13690 Don't assume string byte-length fits in 'int'.
a4cf38e4 13691 Check that character arg fits in 'int'.
85461888 13692 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 13693
c0c1ee9f
PE
13694 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13695
a498d7f4
PE
13696 * fns.c (concat): Catch string overflow earlier.
13697 Do not rely on integer wraparound.
13698
51cab52b
PE
13699 * dispextern.h (struct it.overlay_strings_charpos)
13700 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
13701 * xdisp.c (forward_to_next_line_start)
13702 (back_to_previous_visible_line_start)
13703 (reseat_at_next_visible_line_start, next_element_from_buffer):
13704 Don't arbitrarily truncate the value of 'selective' to int.
13705
76031fad
PE
13706 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13707
5eb55db9
PE
13708 * composite.c: Don't truncate sizes to 'int'.
13709 (composition_gstring_p, composition_reseat_it)
13710 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
13711 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13712 not EMACS_UINT, for indexes.
5eb55db9 13713
0703a717
PE
13714 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13715
d6202519
PE
13716 * buffer.c: Include <verify.h>.
13717 (struct sortvec.priority, struct sortstr.priority):
8961a454 13718 Now EMACS_INT, not int.
c20998a7 13719 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
13720 (struct sortstr.size, record_overlay_string)
13721 (struct sortstrlist.size, struct sortlist.used):
13722 Don't truncate size to int.
13723 (record_overlay_string): Check for size-calculation overflow.
d6202519 13724 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 13725
d5a19415
JM
137262011-06-22 Jim Meyering <meyering@redhat.com>
13727
029529ac 13728 Don't leak an XBM-image-sized buffer
d5a19415
JM
13729 * image.c (xbm_load): Free the image buffer after using it.
13730
a9041e6c
PE
137312011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13732
13733 Port to Sun C.
13734 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13735 that Sun C diagnosed.
13736 * fns.c (secure_hash): Fix pointer signedness issue.
13737 * intervals.c (static_offset_intervals): New function.
13738 (offset_intervals): Use it.
13739
7f3f739f
LL
137402011-06-21 Leo Liu <sdl.web@gmail.com>
13741
13742 * deps.mk (fns.o):
13743 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13744 sha512.h.
13745
13746 * fns.c (secure_hash): Rename from crypto_hash_function and change
13747 the first arg to accept symbols.
5b66d427 13748 (Fsecure_hash): New primitive.
7f3f739f
LL
13749 (syms_of_fns): New symbols.
13750
76147d94
DD
137512011-06-20 Deniz Dogan <deniz@dogan.se>
13752
13753 * process.c (Fset_process_buffer): Clarify return value in
13754 docstring.
13755
7d7d0045
CY
137562011-06-18 Chong Yidong <cyd@stupidchicken.com>
13757
13758 * dispnew.c (add_window_display_history): Use BVAR.
13759
13760 * xdisp.c (debug_method_add): Use BVAR.
13761 (check_window_end, dump_glyph_matrix, dump_glyph)
13762 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13763
13764 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13765 Likewise.
13766
13767 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13768 check till after the cache is created in init_frame_faces.
13769
ff2bc410
SM
137702011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13771
13772 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13773
28177add
PE
137742011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13775
dd3482fe
PE
13776 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13777 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13778 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13779
393d71f3 13780 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
13781 * fileio.c (Finsert_file_contents):
13782 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13783 Remove the old (too-loose) buffer overflow checks.
13784 They weren't needed, since make_gap checks for buffer overflow.
13785 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13786 The old code merely checked for Emacs fixnum overflow, and relied
13787 on undefined (wraparound) behavior. The new code avoids undefined
13788 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13789
2e6813b0 13790 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
13791 Tune. Don't use wider integers than needed. Don't use alloca.
13792 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 13793
599a9e4f
PE
13794 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13795
99561444
PE
13796 * insdel.c, lisp.h (buffer_overflow): New function.
13797 (insert_from_buffer_1, replace_range, replace_range_2):
13798 * insdel.c (make_gap_larger):
13799 * editfns.c (Finsert_char):
13800 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13801
28177add
PE
13802 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13803
e69dafad
PE
138042011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13805
4baa020d 13806 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 13807
b1c46f02
PE
13808 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13809 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13810
e69dafad
PE
13811 * fileio.c: Don't assume EMACS_INT fits in off_t.
13812 (emacs_lseek): New static function.
13813 (Finsert_file_contents, Fwrite_region): Use it.
13814 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13815
566684ea
PE
13816 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13817
e6966cd6
PE
13818 * fns.c: Don't overflow int when computing a list length.
13819 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13820 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13821 truncation on 64-bit hosts. Check for QUIT every
13822 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13823 faster and is responsive enough.
13824 (Flength): Report an error instead of overflowing an integer.
13825 (Fsafe_length): Return a float if the value is not representable
13826 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 13827 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 13828 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 13829
dd0b0efb
PE
13830 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13831 (header_size, word_size): New constants.
13832 (allocate_vectorlike): Don't check size overflow here.
13833 (allocate_vector): Check it here instead, since this is the only
13834 caller of allocate_vectorlike that could cause overflow.
13835 Check that the new vector's length is representable as a fixnum.
13836
86fe5cfe
PE
13837 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13838 The previous code was bogus. For example, next_almost_prime (32)
13839 returned 39, which is undesirable as it is a multiple of 3; and
13840 next_almost_prime (24) returned 25, which is a multiple of 5 so
13841 why was the code bothering to check for multiples of 7?
13842
80e88859
PE
13843 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13844
4a2f0ad6
PE
13845 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13846
f66c7cf8
PE
13847 Variadic C functions now count arguments with ptrdiff_t.
13848 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13849 Back then I didn't know that the Emacs coding style prefers signed int.
13850 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
13851 were being counted with int, which may truncate counts on 64-bit
13852 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
13853 * lisp.h (struct Lisp_Subr.function.aMANY)
13854 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13855 Arg counts are now ptrdiff_t, not size_t.
13856 All variadic functions and their callers changed accordingly.
13857 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13858 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13859 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13860 * callint.c (Fcall_interactively): Check arg count for overflow,
13861 to avoid potential buffer overrun. Use signed char, not 'int',
13862 for 'varies' array, so that we needn't bother to check its size
13863 calculation for overflow.
13864 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13865 * eval.c (apply_lambda):
13866 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13867 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13868 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13869
a1759b76
PE
13870 * callint.c (Fcall_interactively): Don't use index var as event count.
13871
d96be9fc
PE
13872 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13873 * mem-limits.h (SIZE): Remove; no longer used.
13874
a690a978 13875 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 13876
578c21e6
PE
13877 Remove unnecessary casts.
13878 * xterm.c (x_term_init):
13879 * xfns.c (x_set_border_pixel):
13880 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13881 These aren't needed now that we assume ANSI C.
13882
96f53c6c
PE
13883 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13884 It's more likely to cause problems (due to unsigned overflow)
13885 than to cure them.
13886
83c77d31
PE
13887 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13888
ee2079f1
PE
13889 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13890
6da65536
PE
13891 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13892
7147c4a4
PE
13893 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13894
193e32d9
PE
13895 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13896
e5533da6
PE
13897 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13898
9910e595
PE
13899 GLYPH_CODE_FACE returns EMACS_INT, not int.
13900 * dispextern.h (merge_faces):
13901 * xfaces.c (merge_faces):
01103c44
PE
13902 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13903 Don't assume EMACS_INT fits in int.
9910e595 13904
2638320e
PE
13905 * character.h (CHAR_VALID_P): Remove unused parameter.
13906 * fontset.c, lisp.h, xdisp.c: All uses changed.
13907
045eb8d9
PE
13908 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13909
c1f134b5
PE
13910 * fns.c (concat): Minor tuning based on overflow analysis.
13911 This doesn't fix any bugs. Use int to hold character, instead
13912 of constantly refetching from Emacs object. Use XFASTINT, not
13913 XINT, for value known to be a character. Don't bother comparing
13914 a single byte to 0400, as it's always less.
13915
395fcb93 13916 * floatfns.c (Fexpt):
327eeec8
PE
13917 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13918
abbd3d23
PE
13919 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13920 for characters.
13921
684a03ef
PE
13922 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13923
0fed43f3
PE
13924 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13925 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13926 incorrectly succeed when S was a string, because 4294967386 was
13927 truncated before it was used.
13928
8fd02eb7
PE
13929 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13930 Otherwise, an out-of-range integer could cause undefined behavior
13931 on a 64-bit host.
13932
f8c86b69
PE
13933 * composite.c: Use int, not EMACS_INT, for characters.
13934 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13935 EMACS_INT, for values that are known to be in character range.
13936 This doesn't fix any bugs but is the usual style inside Emacs and
13937 may generate better code on 32-bit machines.
13938
34206dd2
PE
13939 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13940 This is for reasons similar to the recent CHAR_STRING fix.
13941 * charset.c (Fencode_char): Check that character arg is actually
13942 a character. Pass an int to ENCODE_CHAR.
13943 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13944 wider than 'int', as a compile-time check to prevent future regressions
13945 in this area.
13946
c5958d4c 13947 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
13948
13949 Make sure a 64-bit char is never passed to CHAR_STRING.
13950 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13951 by silently ignoring the top 32 bits, allowing some values
13952 that were far too large to be valid characters.
13953 * character.h: Include <verify.h>.
13954 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13955 arguments are no wider than unsigned, as a compile-time check
13956 to prevent future regressions in this area.
13957 * data.c (Faset):
01103c44 13958 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
13959 (Fsubst_char_in_region):
13960 * fns.c (concat):
13961 * xdisp.c (decode_mode_spec_coding):
13962 Adjust to CHAR_STRING's new requirement.
13963 * editfns.c (Finsert_char, Fsubst_char_in_region):
13964 * fns.c (concat): Check that character args are actually
13965 characters. Without this test, these functions did the wrong
13966 thing with wildly out-of-range values on 64-bit hosts.
13967
d37ca623
PE
13968 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13969 These casts should not be needed on 32-bit hosts, either.
13970 * keyboard.c (read_char):
13971 * lread.c (Fload): Remove casts to unsigned.
13972
ea204efb
PE
13973 * lisp.h (UNSIGNED_CMP): New macro.
13974 This fixes comparison bugs on 64-bit hosts.
13975 (ASCII_CHAR_P): Use it.
13976 * casefiddle.c (casify_object):
01103c44 13977 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
13978 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13979 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13980 * dispextern.h (FACE_FROM_ID):
13981 * keyboard.c (read_char): Use UNSIGNED_CMP.
13982
41cb286c
PE
13983 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13984 not to EMACS_INT, to avoid GCC warning.
13985
4a1b9832
PE
13986 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13987
55daad71
PE
13988 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13989 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13990 isn't needed on 32-bit machines.
8f95c75c 13991
01103c44
PE
13992 * buffer.c (Fgenerate_new_buffer_name):
13993 Use EMACS_INT for count, not int.
0ceccced 13994 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
13995
13996 * data.c (Qcompiled_function): Now static.
13997
c6f072e7
PE
13998 * window.c (window_body_lines): Now static.
13999
20ce5912
PE
14000 * image.c (gif_load): Rename local to avoid shadowing.
14001
9c4c5f81
PE
14002 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14003 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14004 * alloc.c (make_save_value): Integer argument is now of type
14005 ptrdiff_t, not int.
14006 (mark_object): Use ptrdiff_t, not int.
14007 * lisp.h (pD): New macro.
14008 * print.c (print_object): Use it.
14009
c0c5c8ae
PE
14010 * alloc.c: Use EMACS_INT, not int, to count objects.
14011 (total_conses, total_markers, total_symbols, total_vector_size)
14012 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
14013 (total_free_floats, total_floats, total_free_intervals)
14014 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
14015 Now EMACS_INT, not int. All uses changed.
14016 (Fgarbage_collect): Compute overall total using a double, so that
14017 integer overflow is less likely to be a problem. Check for overflow
14018 when converting back to an integer.
5a25e253
PE
14019 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14020 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14021 These were 'int' variables that could overflow on 64-bit hosts;
14022 they were never used, so remove them instead of repairing them.
211a0b2a 14023 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
14024 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14025 Previously, this ceilinged at INT_MAX, but that doesn't work on
14026 64-bit machines.
e46bb31a 14027 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 14028
c78baabf 14029 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 14030 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
14031 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
14032 when a (possibly-narrower) signed value would do just as well.
14033 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 14034
c9d624c6
PE
14035 * alloc.c: Catch some string size overflows that we were missing.
14036 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14037 for convenience in STRING_BYTES_MAX.
14038 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14039 The definition here is exact; the one in lisp.h was approximate.
14040 (allocate_string_data): Check for string overflow. This catches
14041 some instances we weren't catching before. Also, it catches
14042 size_t overflow on (unusual) hosts where SIZE_MAX <= min
14043 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14044 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 14045
c9d624c6
PE
14046 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14047 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 14048 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 14049
353032ce
PE
14050 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14051
2bccce07
PE
14052 * alloc.c (Fmake_string): Check for out-of-range init.
14053
0ac30604
SM
140542011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14055
14056 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14057
c195f2de
JD
140582011-06-14 Jan Djärv <jan.h.d@swipnet.se>
14059
14060 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14061 xg_get_default_scrollbar_width.
14062
14063 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14064 (int_gtk_range_get_value): Move to the scroll bar part of the file.
14065 (style_changed_cb): Call update_theme_scrollbar_width and call
14066 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14067 all frames (Bug#8505).
14068 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14069 Call gtk_window_set_resizable if HAVE_GTK3.
14070 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14071 and height if HAVE_GTK3 (Bug#8505).
14072 (scroll_bar_width_for_theme): New variable.
14073 (update_theme_scrollbar_width): New function.
14074 (xg_get_default_scrollbar_width): Move code to
14075 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14076 (xg_initialize): Call update_theme_scrollbar_width.
14077
14078 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14079
14080 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14081
e10ac9f1
MR
140822011-06-12 Martin Rudalics <rudalics@gmx.at>
14083
14084 * frame.c (make_frame): Call other_buffer_safely instead of
14085 other_buffer.
14086
14087 * window.c (temp_output_buffer_show): Call display_buffer with
14088 second argument Vtemp_buffer_show_specifiers and reset latter
14089 immediately after the call.
14090 (Vtemp_buffer_show_specifiers): New variable.
14091 (auto_window_vscroll_p, next_screen_context_lines)
14092 (Vscroll_preserve_screen_position): Remove leading asterisks from
14093 doc-strings.
14094
2d3c217e 140952011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 14096
7b7f97e8 14097 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
14098 * buffer.c (Qclone_number): Remove for now, as it's unused.
14099 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14100 (record_buffer): Remove unused local.
14101 * frame.c (other_visible_frames, frame_buffer_list): Now static.
14102 (set_frame_buffer_list): Remove; unused.
14103 * frame.h (other_visible_frames): Remove decl.
14104 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14105 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14106 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14107 if HAVE_GPM.
14108 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14109 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
14110 Define only if HAVE_GPM.
14111 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
14112 (update_hints_inhibit): Remove; never set. All uses removed.
14113 * widgetprv.h (emacsFrameClassRec): Remove decl.
14114 * window.c (delete_deletable_window): Now returns void, since it
14115 wasn't returning anything.
14116 (compare_window_configurations): Remove unused locals.
14117 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
14118 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
14119 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
14120 the same widths as pointers. This follows up on the 2011-05-06 patch.
14121 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
14122 * xterm.h: Likewise.
14123 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
14124
1384b89e
JB
141252011-06-12 Juanma Barranquero <lekktu@gmail.com>
14126
14127 * makefile.w32-in: Update dependencies.
14128 (LISP_H): Add lib/intprops.h.
14129
1100a63c
CY
141302011-06-11 Chong Yidong <cyd@stupidchicken.com>
14131
14132 * image.c (gif_load): Add animation frame delay to the metadata.
14133 (syms_of_image): Use DEFSYM. New symbol `delay'.
14134
6198ccd0
MR
141352011-06-11 Martin Rudalics <rudalics@gmx.at>
14136
14137 * window.c (delete_deletable_window): Re-add.
14138 (Fset_window_configuration): Rewrite to handle dead buffers and
14139 consequently deletable windows.
14140 (window_tree, Fwindow_tree): Remove. Supply functionality in
14141 window.el.
14142 (compare_window_configurations): Simplify code.
14143
b6e3633c
AS
141442011-06-11 Andreas Schwab <schwab@linux-m68k.org>
14145
1ab0dee5
AS
14146 * image.c (imagemagick_load_image): Fix type mismatch.
14147 (Fimagemagick_types): Likewise.
14148
b6e3633c
AS
14149 * window.h (replace_buffer_in_windows): Declare.
14150
9397e56f
MR
141512011-06-11 Martin Rudalics <rudalics@gmx.at>
14152
14153 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
14154 Qclone_number. Remove external declaration of Qdelete_window.
14155 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
14156 code.
640c8776
SM
14157 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
14158 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
14159 (Fother_buffer): Rewrite doc-string. Major rewrite for new
14160 buffer list implementation.
14161 (other_buffer_safely): New function.
14162 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
14163 calls to replace_buffer_in_windows and
14164 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
14165 if allowed.
14166 (record_buffer): Inhibit quitting and rewrite using quittable
14167 functions. Run Qbuffer_list_update_hook if allowed.
14168 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
14169 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
14170 Move switch-to-buffer to window.el.
9397e56f
MR
14171 (bury-buffer): Move to window.el.
14172 (Vbuffer_list_update_hook): New variable.
14173
14174 * lisp.h (other_buffer_safely): Add prototype in buffer.c
14175 section.
14176
14177 * window.h (resize_frame_windows): Move up in code.
14178 (Fwindow_frame): Remove EXFUN.
14179 (replace_buffer_in_all_windows): Remove prototype.
14180 (replace_buffer_in_windows_safely): Add prototype.
14181
14182 * window.c: Declare Qdelete_window static again. Move down
14183 declaration of select_count.
14184 (Fnext_window, Fprevious_window): Rewrite doc-strings.
14185 (Fother_window): Move to window.el.
14186 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14187 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14188 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14189 window.el.
14190 (replace_buffer_in_windows): Implement by calling
14191 Qreplace_buffer_in_windows.
14192 (replace_buffer_in_all_windows): Remove with some functionality
14193 moved into replace_buffer_in_windows_safely.
14194 (replace_buffer_in_windows_safely): New function.
14195 (select_window_norecord, select_frame_norecord): Move in front
14196 of run_window_configuration_change_hook. Remove now obsolete
14197 declarations.
640c8776
SM
14198 (Fset_window_buffer): Rewrite doc-string.
14199 Call Qrecord_window_buffer.
9397e56f
MR
14200 (keys_of_window): Move binding for other-window to window.el.
14201
b50691aa
CY
142022011-06-11 Chong Yidong <cyd@stupidchicken.com>
14203
14204 * dispextern.h (struct image): Replace data member, whose int_val
14205 and ptr_val fields were not used by anything, with a single
14206 lisp_val object.
14207
14208 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14209 (gif_clear_image, gif_load, imagemagick_load_image)
14210 (gs_clear_image, gs_load): Callers changed.
14211
3f754b86
PE
142122011-06-10 Paul Eggert <eggert@cs.ucla.edu>
14213
cca69397
PE
14214 * buffer.h: Include <time.h>, for time_t.
14215 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
14216
109e28d0
PE
14217 Fix minor problems found by static checking.
14218
60737f02
PE
14219 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14220
4b66faf3
PE
14221 Make identifiers static if they are not used in other modules.
14222 * data.c (Qcompiled_function, Qframe, Qvector):
14223 * image.c (QimageMagick, Qsvg):
14224 * minibuf.c (Qmetadata):
14225 * window.c (resize_window_check, resize_root_window): Now static.
14226 * window.h (resize_window_check, resize_root_window): Remove decls.
14227
109e28d0
PE
14228 * window.c (window_deletion_count, delete_deletable_window):
14229 Remove; unused.
46a4ce9e
PE
14230 (window_body_lines): Now static.
14231 (Fdelete_other_windows_internal): Mark vars as initialized.
14232 Make sure 'resize_failed' is initialized.
14233 (run_window_configuration_change_hook): Rename local to avoid shadowing.
14234 (resize_window_apply): Remove unused local.
14235 * window.h (delete_deletable_window): Remove decl.
14236
109e28d0 14237 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
14238 (imagemagick_load_image): Fix pointer signedness problem by changing
14239 last arg from unsigned char * to char *. All uses changed.
14240 Also, fix a local for similar reasons.
14241 Remove unused locals. Remove locals to avoid shadowing.
14242 (fn_rsvg_handle_free): Remove; unused.
14243 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 14244 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 14245
3f754b86
PE
14246 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14247
2547adb1
CY
142482011-06-10 Chong Yidong <cyd@stupidchicken.com>
14249
14250 * image.c (gif_load): Fix omitted cast error introduced by
14251 2011-06-06 change.
14252
2c8e37d4
MR
142532011-06-10 Martin Rudalics <rudalics@gmx.at>
14254
14255 * window.h (resize_proportionally, orig_total_lines)
14256 (orig_top_line): Remove from window structure.
14257 (set_window_height, set_window_width, change_window_heights)
14258 (Fdelete_window): Remove prototypes.
14259 (resize_frame_windows): Remove duplicate declaration.
14260
440a42e3
EZ
142612011-06-10 Eli Zaretskii <eliz@gnu.org>
14262
14263 * window.h (resize_frame_windows, resize_window_check)
14264 (delete_deletable_window, resize_root_window)
14265 (resize_frame_windows): Declare prototypes.
14266
14267 * window.c (resize_window_apply): Make definition be "static" to
14268 match the prototype.
14269
562dd5e9
MR
142702011-06-10 Martin Rudalics <rudalics@gmx.at>
14271
14272 * window.c: Remove declarations of Qwindow_size_fixed,
14273 window_min_size_1, window_min_size_2, window_min_size,
14274 size_window, window_fixed_size_p, enlarge_window, delete_window.
14275 Remove static from declaration of Qdelete_window, it's
14276 temporarily needed by Fbury_buffer.
14277 (replace_window): Don't assign orig_top_line and
14278 orig_total_lines.
14279 (Fdelete_window, delete_window): Remove. Window deletion is
14280 handled by window.el.
640c8776
SM
14281 (window_loop): Remove DELETE_OTHER_WINDOWS case.
14282 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
14283 (Fdelete_other_windows): Remove. Deleting other windows is
14284 handled by window.el.
14285 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
14286 handled in window.el.
14287 (window_min_size_2, window_min_size_1, window_min_size): Remove.
14288 Window minimum sizes are handled in window.el.
14289 (shrink_windows, size_window, set_window_height)
14290 (set_window_width, change_window_heights, window_height)
14291 (window_width, CURBEG, CURSIZE, enlarge_window)
14292 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
14293 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
14294 handled in window.el.
14295 (make_dummy_parent): Rename to make_parent_window and give it a
14296 second argument horflag.
14297 (make_window): Don't set resize_proportionally any more.
14298 (Fsplit_window): Remove. Windows are split in window.el.
14299 (save_restore_action, save_restore_orig_size)
14300 (shrink_window_lowest_first, save_restore_orig_size): Remove.
14301 Resize mini windows in window.el.
14302 (grow_mini_window, shrink_mini_window): Implement by calling
14303 Qresize_root_window_vertically, resize_window_check and
14304 resize_window_apply.
640c8776
SM
14305 (saved_window, Fset_window_configuration, save_window_save):
14306 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
14307 resize_proportionally.
14308 (window_min_height, window_min_width): Move to window.el.
14309 (keys_of_window): Move bindings for delete-other-windows,
14310 split-window, delete-window and enlarge-window to window.el.
14311
14312 * buffer.c: Temporarily extern Qdelete_window.
14313 (Fbury_buffer): Temporarily call Qdelete_window instead of
14314 Fdelete_window (Fbury_buffer will move to window.el soon).
14315
14316 * frame.c (set_menu_bar_lines_1): Remove code handling
14317 orig_top_line and orig_total_lines.
14318
14319 * dispnew.c (adjust_frame_glyphs_initially): Don't use
14320 set_window_height but set heights directly.
14321 (change_frame_size_1): Use resize_frame_windows.
14322
14323 * xdisp.c (init_xdisp): Don't use set_window_height but set
14324 heights directly.
14325
640c8776
SM
14326 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14327 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
14328 run_window_configuration_change_hook.
14329
14330 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14331 instead of change_window_heights and run
14332 run_window_configuration_change_hook.
14333
1a13852e
MR
143342011-06-09 Martin Rudalics <rudalics@gmx.at>
14335
14336 * window.c (replace_window): Rename second argument REPLACEMENT to
14337 NEW. New third argument SETFLAG. Rewrite.
14338 (delete_window, make_dummy_parent): Call replace_window with
14339 third argument 1.
14340 (window_list_1): Move down in code.
14341 (run_window_configuration_change_hook): Move set_buffer part
14342 before select_frame_norecord part in order to unwind correctly.
14343 Rename count1 to count.
14344 (recombine_windows, delete_deletable_window, resize_root_window)
14345 (Fdelete_other_windows_internal)
14346 (Frun_window_configuration_change_hook, make_parent_window)
14347 (resize_window_check, resize_window_apply, Fresize_window_apply)
14348 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
14349 (Fdelete_window_internal, Fresize_mini_window_internal):
14350 New functions.
1a13852e
MR
14351 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14352
f3d1777e
MR
143532011-06-08 Martin Rudalics <rudalics@gmx.at>
14354
496e208e
MR
14355 * window.h (window): Add some new members to window structure -
14356 normal_lines, normal_cols, new_total, new_normal, clone_number,
14357 splits, nest, prev_buffers, next_buffers.
14358 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 14359 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 14360
f3d1777e
MR
14361 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14362 Remove.
496e208e
MR
14363 (make_dummy_parent): Set new members of windows structure.
14364 (make_window): Move down in code. Handle new members of window
14365 structure.
14366 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14367 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14368 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14369 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
14370 (Fset_window_next_buffers, Fset_window_clone_number):
14371 New functions.
496e208e
MR
14372 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14373 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14374 Doc-string fixes.
14375 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14376 Argument WINDOW can be now internal window too.
14377 (Fwindow_use_time): Move up in code.
14378 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14379 Rewrite doc-string.
14380 (Fset_window_configuration, saved_window)
14381 (Fcurrent_window_configuration, save_window_save): Handle new
14382 members of window structure.
b9e809c2
MR
14383 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14384 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14385 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14386 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14387 Qget_mru_window, Qresize_root_window,
14388 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14389 Qauto_buffer_name; staticpro them.
f3d1777e 14390
abde8f8c
MR
143912011-06-07 Martin Rudalics <rudalics@gmx.at>
14392
14393 * window.c (Fwindow_total_size, Fwindow_left_column)
14394 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14395 (Fwindow_list_1): New functions.
14396 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
14397 (Fwindow_width, Fscroll_left, Fscroll_right):
14398 Use window_body_cols instead of window_box_text_cols.
14399 (delete_window, Fset_window_configuration):
14400 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
14401 (delete_all_subwindows): Take a window as argument and not a
14402 structure. Rewrite.
190b47e6
MR
14403 (window_loop): Remove handling of GET_LRU_WINDOW and
14404 GET_LARGEST_WINDOW.
14405 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
14406
14407 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
14408 window_box_text_cols. delete_all_subwindows now takes a
14409 Lisp_Object as argument.
abde8f8c 14410
640c8776
SM
14411 * indent.c (compute_motion, Fcompute_motion):
14412 Use window_body_cols instead of window_box_text_cols.
abde8f8c 14413
fa8a67e6
MR
14414 * frame.c (delete_frame): Call delete_all_subwindows with root
14415 window as argument.
14416
a54e3482
DC
144172011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14418
14419 * fns.c (Fputhash): Document return value.
14420
60002bf5
CY
144212011-06-06 Chong Yidong <cyd@stupidchicken.com>
14422
14423 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14424
0c671da6 144252011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 14426
b862a52a 14427 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 14428
be44ca6c
PE
14429 Check for overflow when converting integer to cons and back.
14430 * charset.c (Fdefine_charset_internal, Fdecode_char):
14431 Use cons_to_unsigned to catch overflow.
14432 (Fencode_char): Use INTEGER_TO_CONS.
14433 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14434 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14435 * data.c (long_to_cons, cons_to_long): Remove.
14436 (cons_to_unsigned, cons_to_signed): New functions.
14437 These signal an error for invalid or out-of-range values.
14438 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14439 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14440 * font.c (Ffont_variation_glyphs):
14441 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14442 * lisp.h: Include <intprops.h>.
14443 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14444 (cons_to_signed, cons_to_unsigned): New decls.
14445 (long_to_cons, cons_to_long): Remove decls.
14446 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14447 (Fprimitive_undo): Use CONS_TO_INTEGER.
14448 * xfns.c (Fx_window_property): Likewise.
14449 * xselect.c: Include <limits.h>.
14450 (x_own_selection, selection_data_to_lisp_data):
14451 Use INTEGER_TO_CONS.
14452 (x_handle_selection_request, x_handle_selection_clear)
14453 (x_get_foreign_selection, Fx_disown_selection_internal)
14454 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14455 (lisp_data_to_selection_data): Use cons_to_unsigned.
14456 (x_fill_property_data): Use cons_to_signed.
14457 Report values out of range.
14458
d1f3d2af
PE
14459 Check for buffer and string overflow more precisely.
14460 * buffer.h (BUF_BYTES_MAX): New macro.
14461 * lisp.h (STRING_BYTES_MAX): New macro.
14462 * alloc.c (Fmake_string):
14463 * character.c (string_escape_byte8):
14464 * coding.c (coding_alloc_by_realloc):
14465 * doprnt.c (doprnt):
14466 * editfns.c (Fformat):
14467 * eval.c (verror):
14468 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14469 since they may not be the same number.
14470 * editfns.c (Finsert_char):
14471 * fileio.c (Finsert_file_contents):
14472 Likewise for BUF_BYTES_MAX.
14473
dd52fcea
PE
14474 * image.c: Use ptrdiff_t, not int, for sizes.
14475 (slurp_file): Switch from int to ptrdiff_t.
14476 All uses changed.
14477 (slurp_file): Check that file size fits in both size_t (for
14478 malloc) and ptrdiff_t (for sanity and safety).
14479
7f9bbdbb
PE
14480 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14481 if b->modtime has its maximal value.
14482
dfe18f82
PE
14483 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14484
84acfcf0
PE
14485 Don't assume time_t can fit into int.
14486 * buffer.h (struct buffer.modtime): Now time_t, not int.
14487 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14488 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14489
ccd9a01a
PE
14490 Minor fixes for signed vs unsigned integers.
14491 * character.h (MAYBE_UNIFY_CHAR):
14492 * charset.c (maybe_unify_char):
14493 * keyboard.c (read_char, reorder_modifiers):
14494 XINT -> XFASTINT, since the integer must be nonnegative.
14495 * ftfont.c (ftfont_spec_pattern):
14496 * keymap.c (access_keymap, silly_event_symbol_error):
14497 XUINT -> XFASTINT, since the integer must be nonnegative.
14498 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14499 since it makes no difference and we prefer signed.
14500 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14501 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14502 nonnegative.
14503
d6d100dd
SM
145042011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14505
14506 * window.h (Fwindow_frame): Declare.
14507
2b6148e4
PE
145082011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14509
14510 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14511 (SPARE_MEMORY): Always define.
14512 (LARGE_REQUEST): Remove.
14513 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14514
f230ecc9
MR
145152011-06-06 Martin Rudalics <rudalics@gmx.at>
14516
727e958e
MR
14517 * lisp.h: Move EXFUNS for Fframe_root_window,
14518 Fframe_first_window and Fset_frame_selected_window to window.h.
14519
14520 * window.h: Move EXFUNS for Fframe_root_window,
14521 Fframe_first_window and Fset_frame_selected_window here from
14522 lisp.h.
14523
14524 * frame.c (Fwindow_frame, Fframe_first_window)
14525 (Fframe_root_window, Fframe_selected_window)
14526 (Fset_frame_selected_window): Move to window.c.
14527 (Factive_minibuffer_window): Move to minibuf.c.
14528 (Fother_visible_frames_p): New function.
14529
14530 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14531
f230ecc9
MR
14532 * window.c (decode_window, decode_any_window): Move up in code.
14533 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14534 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
14535 (Fwindow_buffer): Move up and rewrite doc-string.
14536 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14537 (Fwindow_prev): New functions.
727e958e
MR
14538 (Fwindow_frame): Move here from frame.c. Accept any window as
14539 argument.
14540 (Fframe_root_window, Fframe_first_window)
14541 (Fframe_selected_window): Move here from frame.c. Accept frame
14542 or arbitrary window as argument. Update doc-strings.
14543 (Fminibuffer_window): Move up in code.
14544 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
14545 (Fset_frame_selected_window): Move here from frame.c.
14546 Marginal rewrite.
727e958e
MR
14547 (Fselected_window, select_window, Fselect_window): Move up in
14548 code. Minor doc-string fixes.
f230ecc9 14549
4d09bcf6
PE
145502011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14551
14552 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14553 Do not assume that spare memory exists; that assumption is valid
14554 only if SYSTEM_MALLOC.
14555 (LARGE_REQUEST): New macro, so that the issue of large requests
14556 is separated from the issue of spare memory.
14557
810928a2
AS
145582011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14559
172418ad
AS
14560 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14561 format. (Bug#8806)
14562
43f862f7
AS
14563 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14564
810928a2
AS
14565 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14566 before statements.
14567
a059fe24
JD
145682011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14569
14570 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14571
14572 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14573
14574 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14575 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14576
989bf368
JB
145772011-06-05 Juanma Barranquero <lekktu@gmail.com>
14578
14579 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14580
4b80f674
CY
145812011-06-04 Chong Yidong <cyd@stupidchicken.com>
14582
14583 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14584 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
14585 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14586 New error handlers.
4b80f674
CY
14587 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14588 Obey Vx_select_enable_clipboard_manager. Catch errors in
14589 x_clipboard_manager_save (Bug#8779).
14590 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 14591 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 14592
99a33b77 145932011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
14594
14595 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14596
99a33b77 145972011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
14598
14599 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14600 in the current matrix if keep_current_p is non-zero.
14601
8264569d
EZ
146022011-06-04 Eli Zaretskii <eliz@gnu.org>
14603
14604 * bidi.c (bidi_level_of_next_char): Fix last change.
14605
57f97249
EZ
146062011-06-03 Eli Zaretskii <eliz@gnu.org>
14607
fec2107c 14608 Support bidi reordering of text covered by display properties.
57f97249 14609
fec2107c
EZ
14610 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14611 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14612 (bidi_cache_search, bidi_cache_iterator_state)
14613 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
14614 (bidi_level_of_next_char, bidi_move_to_visually_next):
14615 Support character positions inside a run of characters covered by a
fec2107c
EZ
14616 display string.
14617 (bidi_paragraph_init, bidi_resolve_explicit_1)
14618 (bidi_level_of_next_char): Call bidi_fetch_char and
14619 bidi_fetch_char_advance instead of FETCH_CHAR and
14620 FETCH_CHAR_ADVANCE.
14621 (bidi_init_it): Initialize new members.
14622 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14623 definitions.
14624 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14625 instead of using explicit *_CHAR codes.
d6d100dd
SM
14626 (bidi_resolve_explicit, bidi_resolve_weak):
14627 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
14628 bidirectional text is supported only in multibyte buffers.
14629 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14630 it to initialize the frame_window_p member of struct bidi_it.
14631 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14632 (bidi_resolve_explicit, bidi_resolve_weak)
14633 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14634 bidi_it->nchars is non-positive.
14635 (bidi_level_of_next_char): Don't try to lookup the cache for the
14636 next/previous character if nothing is cached there yet, or if we
14637 were just reseat()'ed to a new position.
c40e2fb2 14638
0e14fe90
EZ
14639 * xdisp.c (set_cursor_from_row): Set start and stop points
14640 according to the row's direction when priming the loop that looks
14641 for the glyph on which to display cursor.
14642 (single_display_spec_intangible_p): Function deleted.
14643 (display_prop_intangible_p): Reimplement to call
14644 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
14645 Accept 3 additional arguments needed by handle_display_spec.
14646 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
14647 values: lists, `(when COND...)' forms, etc.
14648 (single_display_spec_string_p): Support property values that are
14649 lists with the argument STRING its top-level element.
14650 (display_prop_string_p): Fix the condition for processing a
14651 property that is a list to be consistent with handle_display_spec.
fec2107c 14652 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
14653 last portion of handle_display_prop.
14654 (compute_display_string_pos): Accept additional argument
14655 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14656 value of a `display' property is a "replacing spec".
14657 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14658 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14659 the display property, but just return a value indicating whether
14660 the display property will replace the characters it covers.
14661 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14662 frame_window_p members of struct bidi_it.
d6d100dd
SM
14663 (compute_display_string_pos, compute_display_string_end):
14664 New functions.
fec2107c
EZ
14665 (push_it): Accept second argument POSITION, where pop_it should
14666 jump to continue iteration.
14667 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 14668
fec2107c
EZ
14669 * keyboard.c (adjust_point_for_property): Adjust the call to
14670 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
14671
14672 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
14673 (bidi_init_it): Update prototypes.
14674 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
14675 (compute_display_string_pos, compute_display_string_end):
14676 Declare prototypes.
fec2107c
EZ
14677 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14678 EMACS_INT.
fc6f18ce 14679
40087514 146802011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 14681
57f53182
PE
14682 Malloc failure behavior now depends on size of allocation.
14683 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14684 * lisp.h: Change signatures accordingly.
14685 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14686 All callers changed. (Bug#8762)
14687
14688 * gnutls.c: Use Emacs's memory allocators.
14689 Without this change, the gnutls library would invoke malloc etc.
14690 directly, which causes problems on non-SYNC_INPUT hosts, and which
14691 runs afoul of improving memory_full behavior. (Bug#8761)
14692 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14693 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14694 xfree instead of the default malloc, realloc, free.
14695 (Fgnutls_boot): No need to check for memory allocation failure,
14696 since xmalloc does that for us.
14697
ac32cd99 14698 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
14699 * category.c (hash_get_category_set):
14700 * ccl.c (ccl_driver):
14701 * charset.c (Fdefine_charset_internal):
14702 * charset.h (struct charset.hash_index):
14703 * composite.c (get_composition_id, gstring_lookup_cache)
14704 (composition_gstring_put_cache):
14705 * composite.h (struct composition.hash_index):
14706 * dispextern.h (struct image.hash):
14707 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14708 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14709 (hashfn_equal, hashfn_user_defined, make_hash_table)
14710 (maybe_resize_hash_table, hash_lookup, hash_put)
14711 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14712 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14713 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14714 * image.c (make_image, search_image_cache, lookup_image)
14715 (xpm_put_color_table_h):
14716 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 14717 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 14718 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 14719 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
14720 * alloc.c (allocate_vectorlike):
14721 Check for overflow in vector size calculations.
14722 * ccl.c (ccl_driver):
14723 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
14724 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14725 need to be updated by these changes.
40087514
PE
14726 * fns.c (make_hash_table, maybe_resize_hash_table):
14727 Check for integer overflow with large hash tables.
0de4bb68
PE
14728 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14729 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14730 (SXHASH_REDUCE): New macro.
14731 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14732 Use it instead of discarding useful hash info with large hash values.
14733 (sxhash_float): New function.
14734 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14735 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
14736 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14737 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
14738 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14739 Adjust signatures to match updated version of code.
14740 (consing_since_gc): Now EMACS_INT, since a single hash table can
14741 use more than INT_MAX bytes.
14742
698d32e2
DN
147432011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14744
14745 Make it possible to build with GCC-4.6+ -O2 -flto.
14746
14747 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14748
fd6fa53f
SM
147492011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14750
14751 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14752 Call minibuffer-inactive-mode.
14753
864db017
JB
147542011-05-31 Juanma Barranquero <lekktu@gmail.com>
14755
14756 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14757 Update dependencies.
14758
2ad0baf4
DN
147592011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14760
14761 * data.c (init_data): Remove code for UTS, this system is not
14762 supported anymore.
14763
4fcc2638
DN
147642011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14765
14766 Don't force ./temacs to start in terminal mode.
14767
14768 * frame.c (make_initial_frame): Initialize faces in all cases, not
14769 only when CANNOT_DUMP is defined.
14770 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14771
c56e0fd5
DN
147722011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14773
14774 * dispnew.c (add_window_display_history): Use const for the string
14775 pointer. Remove declaration, not needed.
14776
333d54da 147772011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 14778
55d4c1b2 14779 Use 'inline', not 'INLINE'.
333d54da 14780 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
14781 * alloc.c, fontset.c (INLINE): Remove.
14782 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14783 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14784 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14785 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14786 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14787
738db178
DN
147882011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14789
14790 Make it possible to run ./temacs.
14791
14792 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14793 syms_of_callproc does the same thing. Remove test for
14794 "initialized", do it in the caller.
14795 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14796
620c53a6
SM
147972011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14798
14799 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14800 (read_minibuf): Use get_minibuffer.
14801 (syms_of_minibuf): Use DEFSYM.
14802 (Qmetadata): New var.
14803 * data.c (Qbuffer): Don't make it static.
14804 (syms_of_data): Use DEFSYM.
14805
e003a292
PE
148062011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14807
14808 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14809 (CCL_CODE_MIN): New macro.
14810
ed008a6d
PE
148112011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14812
3687c2ef
PE
14813 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14814
ed008a6d
PE
14815 * eval.c (Qdebug): Now static.
14816 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14817 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14818 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14819
d66c4c7c
CY
148202011-05-29 Chong Yidong <cyd@stupidchicken.com>
14821
14822 * image.c: Various fixes to ImageMagick code comments.
14823 (Fimagemagick_types): Doc fix.
14824
5fbc2025
PE
148252011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14826
0196f88a
PE
14827 Minor fixes prompted by GCC 4.6.0 warnings.
14828
14829 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14830
5fbc2025
PE
14831 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14832 (x_clipboard_manager_save_all): Move extern decl to ...
14833 * xterm.h: ... here, so that it can be checked for consistency.
14834
1dd3c2d9
CY
148352011-05-29 Chong Yidong <cyd@stupidchicken.com>
14836
14837 * xselect.c (x_clipboard_manager_save_frame)
14838 (x_clipboard_manager_save_all): New functions.
14839 (Fx_clipboard_manager_save): Lisp function deleted.
14840
14841 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14842 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14843
14844 * xterm.h: Update prototype.
14845
5ba6571d
WX
148462011-05-28 William Xu <william.xwl@gmail.com>
14847
14848 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14849 exiting (Bug#8239).
14850
3eaff834
JM
148512011-05-28 Jim Meyering <meyering@redhat.com>
14852
e1900994 14853 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
14854 * fns.c (to_uchar): Define.
14855 (crypto_hash_function): Use it to convert some newly-signed
14856 variables to unsigned, to avoid sign-extension bugs. For example,
14857 without this change, (md5 "truc") would evaluate to
14858 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14859 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 14860 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 14861
0f6990a7
PE
148622011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14863
14864 Integer overflow fixes.
c8a9ca5a 14865
08686060
PE
14866 * dbusbind.c: Serial number integer overflow fixes.
14867 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
14868 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14869 to hold a serial number that is too large for a fixnum.
14870 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14871 Check for serial numbers out of range. Decode any serial number
59568bf0 14872 that was so large that it became a float. (Bug#8722)
08686060 14873
2d1fc3c7
PE
14874 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14875 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14876 Use XFASTINT rather than XUINT when numbers are nonnegative.
14877 (xd_append_arg, Fdbus_method_return_internal):
14878 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14879 arguments, check that Lisp number is nonnegative, rather than
59568bf0 14880 silently wrapping negative numbers around. (Bug#8722)
30217ff0 14881 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 14882 (Bug#8722)
2d1fc3c7 14883
c8a9ca5a
PE
14884 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14885
519e1d69
PE
14886 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14887
6df6ae42 14888 ccl: Add integer overflow checks.
30569699
PE
14889 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14890 (IN_INT_RANGE): New macros.
14891 (ccl_driver): Use them to check for integer overflow when
14892 decoding a CCL program. Many of the new checks are whether XINT (x)
14893 fits in int; it doesn't always, on 64-bit hosts. The new version
14894 doesn't catch all possible integer overflows, but it's an
847044ea 14895 improvement. (Bug#8719)
30569699 14896
c11285dc
PE
14897 * alloc.c (make_event_array): Use XINT, not XUINT.
14898 There's no need for unsigned here.
14899
fdccd48e
PE
14900 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14901 This follows up to the 2011-05-06 change that substituted uintptr_t
14902 for EMACS_INT. This case wasn't caught back then.
14903
37910ab2
PE
14904 Rework Fformat to avoid integer overflow issues.
14905 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14906 now (part of C89). Include <verify.h>.
14907 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14908 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14909 (Fformat): Avoid the prepass trying to compute sizes; it was only
14910 approximate and thus did not catch overflow reliably. Instead, walk
14911 through the format just once, formatting and computing sizes as we go,
14912 checking for integer overflow at every step, and allocating a larger
14913 buffer as needed. Keep track separately whether the format is
14914 multibyte. Keep only the most-recently calculated precision, rather
14915 than them all. Record whether each argument has been converted to
14916 string. Use EMACS_INT, not int, for byte and char and arg counts.
14917 Support field widths and precisions larger than INT_MAX. Avoid
14918 sprintf's undefined behavior with conversion specifications such as %#d
14919 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14920 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14921 formatting out-of-range floating point numbers with int
9173deec 14922 formats. (Bug#8668)
37910ab2 14923
2e6578fb
PE
14924 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14925
0ae6bdee
PE
14926 * data.c: Avoid integer truncation in expressions involving floats.
14927 * data.c: Include <intprops.h>.
14928 (arith_driver): When there's an integer overflow in an expression
14929 involving floating point, convert the integers to floating point
14930 so that the resulting value does not suffer from catastrophic
14931 integer truncation. For example, on a 64-bit host (* 4
14932 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14933 Do not rely on undefined behavior after integer overflow.
14934
de883a70
PE
14935 merge count_size_as_multibyte, parse_str_to_multibyte
14936 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 14937 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
14938 Check for integer overflow.
14939 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14940 since it's now a duplicate of the other. This is more of
14941 a character than a buffer op, so better that it's in character.c.
14942 * fns.c, print.c: Adjust to above changes.
14943
2ff916cb
PE
149442011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14945
14946 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14947
f1b54466
PE
149482011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14949
fb1ac845
PE
14950 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14951 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14952 (x_clipboard_manager_save): Now static.
14953 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14954
f1b54466
PE
14955 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14956 (crypto_hash_function): Now static.
14957 Fix pointer signedness problems. Avoid unnecessary initializations.
14958
a9f737ee
CY
149592011-05-27 Chong Yidong <cyd@stupidchicken.com>
14960
14961 * termhooks.h (Vselection_alist): Make it terminal-local.
14962
14963 * terminal.c (create_terminal): Initialize it.
14964
14965 * xselect.c: Support for clipboard managers.
14966 (Vselection_alist): Move to termhooks.h as terminal-local var.
14967 (LOCAL_SELECTION): New macro.
14968 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14969 (symbol_to_x_atom): Remove gratuitous arg.
14970 (x_handle_selection_request, lisp_data_to_selection_data)
14971 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
14972 (x_own_selection, x_get_local_selection, x_convert_selection):
14973 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
14974 (some_frame_on_display): Delete unused function.
14975 (Fx_own_selection_internal, Fx_get_selection_internal)
14976 (Fx_disown_selection_internal, Fx_selection_owner_p)
14977 (Fx_selection_exists_p): New optional frame arg.
14978 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14979 (x_handle_selection_clear): Don't treat other terminals with the
14980 same keyboard specially. Use the terminal-local Vselection_alist.
14981 (x_clear_frame_selections): Use Frun_hook_with_args.
14982
14983 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14984
14985 * xterm.h: Add support for those atoms.
14986
e067f0c1
CY
149872011-05-26 Chong Yidong <cyd@stupidchicken.com>
14988
14989 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14990 (converted_selections, conversion_fail_tag): New global variables.
14991 (x_selection_request_lisp_error): Free the above.
14992 (x_get_local_selection): Remove unnecessary code.
14993 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
14994 of converted selections stored in converted_selections.
14995 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
14996 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14997 (x_convert_selection): New function.
14998 (x_handle_selection_event): Simplify.
14999 (x_get_foreign_selection): Don't ignore incoming requests while
15000 waiting for an answer; this will fail when we implement
15001 SAVE_TARGETS, and seems unnecessary anyway.
15002 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15003 (Vx_sent_selection_functions): Doc fix.
15004
0f4aebc0
LL
150052011-05-26 Leo Liu <sdl.web@gmail.com>
15006
15007 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
15008
e61124cd
YM
150092011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15010
15011 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15012
15013 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15014 for fringe update if it has periodic bitmap.
ac389d0c 15015 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
15016 and fringe_bitmap_periodic_p.
15017
15018 * fringe.c (get_fringe_bitmap_data): New function.
15019 (draw_fringe_bitmap_1, update_window_fringes): Use it.
15020 (update_window_fringes): Record periodicity of fringe bitmap in glyph
15021 row. Mark glyph row for fringe update if periodicity changed.
15022
15023 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15024 for fringe update unless it has periodic bitmap.
15025
f16d9837
KH
150262011-05-25 Kenichi Handa <handa@m17n.org>
15027
15028 * xdisp.c (get_next_display_element): Set correct it->face_id for
15029 a static composition.
15030
e1b90ef6
LL
150312011-05-24 Leo Liu <sdl.web@gmail.com>
15032
15033 * deps.mk (fns.o):
15034 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15035
15036 * fns.c (crypto_hash_function, Fsha1): New function.
15037 (Fmd5): Use crypto_hash_function.
15038 (syms_of_fns): Add Ssha1.
15039
7400048f
PE
150402011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15041
15042 * gnutls.c: Remove unused macros.
15043 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15044 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15045 Remove macros that are defined and never used.
15046 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15047
abb71cf4
CY
150482011-05-22 Chong Yidong <cyd@stupidchicken.com>
15049
15050 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15051 (Fx_get_selection_internal): Minor cleanup.
15052 (Fx_own_selection_internal): Rename arguments for consistency with
15053 select.el.
15054
6307db39
PE
150552011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15056
15057 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15058
f3d4e0a4
CY
150592011-05-22 Chong Yidong <cyd@stupidchicken.com>
15060
15061 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15062
4d8ade89
YM
150632011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15064
15065 * dispnew.c (scrolling_window): Don't exclude the case that the
15066 last enabled row in the desired matrix touches the bottom boundary.
15067
32078c8d
GM
150682011-05-21 Glenn Morris <rgm@gnu.org>
15069
15070 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
15071 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15072 and add some more files.
32078c8d 15073
7285dc67
EZ
150742011-05-20 Eli Zaretskii <eliz@gnu.org>
15075
15076 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15077 report_file_error introduced by the change from 2011-05-07.
15078
89d1bd22
PE
150792011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15080
15081 * systime.h (Time): Define only if emacs is defined.
15082 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15083 where the include path doesn't have X11/X.h by default. See
15084 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15085
cd394be1 150862011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
15087
15088 * composite.c (find_automatic_composition): Fix previous change.
15089
b9704ad9
GM
150902011-05-20 Glenn Morris <rgm@gnu.org>
15091
15092 * lisp.mk: New file, split from Makefile.in.
15093 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15094 (shortlisp): Remove.
15095 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15096
4a720484
GM
150972011-05-19 Glenn Morris <rgm@gnu.org>
15098
15099 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15100 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15101 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15102 (lisp): Set the order to that of loadup.el.
15103 (shortlisp): Make it a copy of $lisp.
15104 (SOME_MACHINE_LISP): Remove.
15105 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15106 Use just $shortlisp, not $SOME_MACHINE_LISP too.
15107
a28d4396
KH
151082011-05-18 Kenichi Handa <handa@m17n.org>
15109
15110 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
15111 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
15112 (find_automatic_composition): Mostly rewrite for efficiency.
15113
a2b1fa8e
JB
151142011-05-18 Juanma Barranquero <lekktu@gmail.com>
15115
15116 * makefile.w32-in: Update dependencies.
15117
8e1f5610
CS
151182011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
15119
15120 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 15121 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 15122
7025ee00 151232011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 15124
cdfa6eab
PE
15125 Fix some integer overflow issues, such as string length overflow.
15126
06d6db33
PE
15127 * insdel.c (count_size_as_multibyte): Check for string overflow.
15128
2b4560a8
PE
15129 * character.c (lisp_string_width): Check for string overflow.
15130 Use EMACS_INT, not int, for string indexes and lengths; in
15131 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
15132 the resulting string length overflows an EMACS_INT; instead,
15133 report a string overflow if no precision given. When checking for
15134 precision exhaustion, use a check that cannot possibly have
15135 integer overflow. (Bug#8675)
15136 * character.h (lisp_string_width): Adjust to new signature.
15137
cb93f9be
PE
15138 * alloc.c (string_overflow): New function.
15139 (Fmake_string): Use it. This doesn't change behavior, but saves
15140 a few bytes and will simplify future changes.
15141 * character.c (string_escape_byte8): Likewise.
15142 * lisp.h (string_overflow): New decl.
15143
1a1f3366
PE
15144 Fixups, following up to the user-interface timestamp change.
15145 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
15146 for UI timestamps, instead of unsigned long.
9fbd6841
PE
15147 * msdos.c (mouse_get_pos): Likewise.
15148 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
15149 * w32gui.h (Time): Define by including "systime.h" rather than by
15150 declaring it ourselves. (Bug#8664)
15151
d4e3e4d3
PE
15152 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
15153 * image.c (clear_image_cache): Likewise.
15154
f6a24d19
PE
15155 * term.c (term_mouse_position): Don't assume time_t wraparound.
15156
08dc5ae6
PE
15157 Be more systematic about user-interface timestamps.
15158 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
15159 and sometimes 'EMACS_UINT', to represent these timestamps.
15160 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
15161 This makes the code easier to follow, and makes it easier to catch
15162 integer overflow bugs such as Bug#8664.
15163 * frame.c (Fmouse_position, Fmouse_pixel_position):
15164 Use Time, not unsigned long, for user-interface timestamps.
15165 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
15166 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
15167 * keyboard.h (last_event_timestamp): Likewise.
15168 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15169 * menu.h (xmenu_show): Likewise.
15170 * term.c (term_mouse_position): Likewise.
15171 * termhooks.h (struct input_event.timestamp): Likewise.
15172 (struct terminal.mouse_position_hook): Likewise.
15173 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15174 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15175 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
15176 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15177 what it was before.
15178 * menu.h, termhooks.h: Include "systime.h", for Time.
15179
8e55734a
PE
15180 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15181 Don't assume that the difference between two unsigned long values
15182 can fit into an integer. At this point, we know button_down_time
15183 <= event->timestamp, so the difference must be nonnegative, so
15184 there's no need to cast the result if double-click-time is
15185 nonnegative, as it should be; check that it's nonnegative, just in
15186 case. This bug is triggered when events are more than 2**31 ms
86db42d2 15187 apart (about 25 days). (Bug#8664)
8e55734a 15188
841f1b75 15189 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 15190 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 15191
3e26f69c
PE
15192 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15193 that always fit in int. Use a sentinel instead of a counter, to
15194 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
15195 * frame.h (struct frame): Use int for menu_bar_items_used
15196 instead of EMACS_INT, since it always fits in int.
3e26f69c 15197
5cc152c0
PE
15198 * menu.c (grow_menu_items): Check for int overflow.
15199
d89eb65e
PE
15200 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15201
5235bd3e
PE
15202 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15203 Before, the code was not consistent. These values cannot exceed
15204 2**31 - 1 so there's no need to make them unsigned.
15205 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15206 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15207 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15208 as modifiers.
15209 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15210
bc827e23
PE
15211 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15212 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15213 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15214 presumably because the widths might not match.
15215
78eb494e
PE
15216 * window.c (size_window): Avoid needless test at loop start.
15217
04f2d78b
CB
152182011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
15219
15220 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15221
d2fc7e3d 152222011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
15223
15224 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15225
d2fc7e3d 152262011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
15227
15228 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15229 `width' to `bar_area_x' and `bar_area_width', respectively.
15230 (x_scroll_run): Take account of fringe background extension.
15231
04f2d78b
CB
15232 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15233 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
15234 `bar_area_width', respectively.
15235 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15236 background extension.
15237
79b70037
GM
152382011-05-10 Jim Meyering <meyering@redhat.com>
15239
15240 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15241
2f142cc5
JB
152422011-05-10 Juanma Barranquero <lekktu@gmail.com>
15243
15244 * image.c (Finit_image_library): Return t for built-in image types,
15245 like pbm and xbm. (Bug#8640)
15246
57679c86
AS
152472011-05-09 Andreas Schwab <schwab@linux-m68k.org>
15248
15249 * w32menu.c (set_frame_menubar): Fix submenu allocation.
15250
888c9e86
EZ
152512011-05-07 Eli Zaretskii <eliz@gnu.org>
15252
b0512a1d
EZ
15253 * w32console.c (Fset_screen_color): Doc fix.
15254 (Fget_screen_color): New function.
15255 (syms_of_ntterm): Defsubr it.
15256
7285dc67
EZ
15257 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15258 unlink the temporary file if Fcall_process didn't create it in the
15259 first place.
15260 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15261 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
15262 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
15263 cue to call_process_cleanup not to close that handle.
15264
4d3fcc8e
BK
152652011-05-07 Ben Key <bkey76@gmail.com>
15266
15267 * makefile.w32-in: The bootstrap-temacs rule now makes use of
15268 one of two shell specific rules, either bootstrap-temacs-CMD or
15269 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
15270 to the previous implementation of the bootstrap-temacs rule.
15271 The bootstrap-temacs-CMD rule is similar to the previous
15272 implementation of the bootstrap-temacs rule except that it
15273 makes use of the ESC_CFLAGS variable instead of the CFLAGS
15274 variable.
15275
15276 These changes, along with some changes to nt/configure.bat,
15277 nt/gmake.defs, and nt/nmake.defs, are required to extend my
15278 earlier fix to add support for --cflags and --ldflags options
15279 that include quotes so that it works whether make uses cmd or
15280 sh as the shell.
15281
b4289b64
MA
152822011-05-06 Michael Albinus <michael.albinus@gmx.de>
15283
15284 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
15285 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
15286 is a constant.
15287 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
15288 a string. Handle both cases.
15289 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
15290 (Fdbus_register_method): Use Qinvalid_function.
15291
af4c0e28
JB
152922011-05-06 Juanma Barranquero <lekktu@gmail.com>
15293
15294 * makefile.w32-in: Update dependencies.
15295 (LISP_H): Add inttypes.h and stdin.h.
15296 (PROCESS_H): Add unistd.h.
15297
c51453d9
EZ
152982011-05-06 Eli Zaretskii <eliz@gnu.org>
15299
15300 * lread.c: Include limits.h (fixes the MS-Windows build broken by
15301 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15302
8ff0ac3c 153032011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 15304
4c4b566b
PE
15305 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15306
aab2b9b5
PE
15307 * term.c (vfatal): Remove stray call to va_end.
15308 It's not needed and the C Standard doesn't allow it here anyway.
15309
c378da0b
PE
15310 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15311 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
15312
288b08c7
PE
15313 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15314 bytes.
15315
e3601888
PE
15316 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15317
db6c0e74
PE
15318 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15319
dd5963ea
PE
15320 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15321
88c9450f
PE
15322 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15323
2f9442b8
PE
15324 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15325
c032b5f8
PE
15326 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15327 * charset.c (Fdefine_charset_internal): Don't initialize
15328 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 15329 32-bit int (Bug#8600).
a108c10b
PE
15330
15331 * lread.c (read_integer): Be more consistent with string-to-number.
15332 Use string_to_number to do the actual conversion; this avoids
15333 rounding errors and fixes some other screwups. Without this fix,
15334 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15335 (digit_to_number): Move earlier, for benefit of read_integer.
15336 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 15337 not a digit in any supported base. (Bug#8602)
a108c10b 15338
ad5f9eea
PE
15339 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15340
aec1708a
PE
15341 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15342 to match comment at start of function. This also removes a
15343 GCC warning about overflow in a 32+64-bit port.
15344
47be4ab5
PE
15345 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15346
371cac43
PE
15347 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15348 Reported by Stefan Monnier in
15349 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
15350 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15351 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 15352
d01a7826
PE
15353 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15354 (EMACS_UINTPTR): Likewise, with uintptr_t.
15355
7fd47d5c
PE
15356 * lisp.h: Prefer 64-bit EMACS_INT if available.
15357 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15358 on 32-bit hosts that have 64-bit int, so that they can access
15359 large files.
122b0c86
PE
15360 However, temporarily disable this change unless the temporary
15361 symbol WIDE_EMACS_INT is defined.
7fd47d5c 15362
8727937b
PE
15363 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15364
8ac068ac
PE
15365 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15366 This removes an assumption that EMACS_INT and long are the same
15367 width as pointers. The assumption is true for Emacs porting targets
15368 now, but we want to make other targets possible.
15369 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15370 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15371 In the rest of the code, change types of integers that hold casted
15372 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15373 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15374 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15375 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15376 No need to cast type when ORing.
15377 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15378 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15379 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15380 assume EMACS_INT is the same width as char *.
15381 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15382 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15383 Remove no-longer-needed casts.
15384 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15385 (xg_tool_bar_help_callback, xg_make_tool_item):
15386 Use EMACS_INTPTR to hold an integer
15387 that will be cast to void *; this can avoid a GCC warning
15388 if EMACS_INT is not the same width as void *.
15389 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15390 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15391 (current_message_1, set_message_1):
15392 Use a local to convert to proper width without a cast.
15393 * xmenu.c (dialog_selection_callback): Likewise.
15394
ede49d71
PE
15395 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15396 Also, don't assume VALBITS / RAND_BITS is less than 5,
15397 and don't rely on undefined behavior when shifting a 1 left into
15398 the sign bit.
15399 * lisp.h (get_random): Change signature to match.
15400
2f30ecd0
PE
15401 * lread.c (hash_string): Use size_t, not int, for hash computation.
15402 Normally we prefer signed values; but hashing is special, because
15403 it's better to use unsigned division on hash table sizes so that
15404 the remainder is nonnegative. Also, size_t is the natural width
15405 for hashing into memory. The previous code used 'int', which doesn't
15406 retain enough info to hash well into very large tables.
15407 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15408
2a866e7b
PE
15409 * dbusbind.c: Don't possibly lose pointer info when converting.
15410 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15411 Use XPNTR rather than XHASH, so that the high-order bits of
15412 the pointer aren't lost when converting through void *.
15413
51639eac
PE
15414 * eval.c (Fautoload): Don't double-shift a pointer.
15415
92394119
PE
15416 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15417
dbdb9a7c
JB
154182011-05-06 Juanma Barranquero <lekktu@gmail.com>
15419
15420 * gnutls.c (DEF_GNUTLS_FN):
15421 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15422
db7a0b4f
AS
154232011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15424
15425 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15426 marker. (Bug#8610)
15427
cd394be1 154282011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
15429
15430 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15431 New version that can reserve upto 2GB of heap space.
15432
f7ff1b0f 154332011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
15434
15435 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15436
639c109b
TZ
154372011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15438
15439 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15440 `gnutls_certificate_set_x509_key_file'.
15441
d2127135
JB
154422011-05-05 Juanma Barranquero <lekktu@gmail.com>
15443
15444 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15445 Update dependencies.
15446
e968f4f3
JB
154472011-05-04 Juanma Barranquero <lekktu@gmail.com>
15448
15449 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15450 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15451 Remove unused parameter `fildes'.
15452 * process.c (read_process_output, send_process): Don't pass it.
15453
84d358f0
JB
154542011-05-04 Juanma Barranquero <lekktu@gmail.com>
15455
15456 Fix previous change: the library cache is defined in w32.c.
15457 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15458 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15459
0898ca10
JB
154602011-05-04 Juanma Barranquero <lekktu@gmail.com>
15461
15462 Implement dynamic loading of GnuTLS on Windows.
15463
15464 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15465 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15466 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15467 Declare.
15468
15469 * gnutls.c (Qgnutls_dll): Define.
15470 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15471 (gnutls_*): Declare function pointers.
15472 (init_gnutls_functions): New function to initialize function pointers.
15473 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15474 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15475 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15476 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15477 (emacs_gnutls_write, emacs_gnutls_read)
15478 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15479 (Fgnutls_available_p): New function.
15480 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15481 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15482 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15483
15484 * image.c: Include w32.h.
15485 (Vimage_type_cache): Delete.
15486 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15487 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15488 (w32_delayed_load): Move to w32.c.
15489
15490 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15491
15492 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15493 (w32_delayed_load): Move from image.c. When loading a library, record
15494 its filename in the :loaded-from property of the library id.
15495 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15496 Initialize and staticpro them.
15497 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15498
15499 * process.c: Include lisp.h before w32.h, not after.
15500 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15501 instead of gnutls_record_check_pending.
15502
15503 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15504
ff4de4aa
TZ
155052011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15506
15507 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15508 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15509 as passed in.
15510
abe95abb
JD
155112011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15512
15513 * xterm.c (x_set_frame_alpha): Do not set property on anything
15514 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15515
e16e55d4
JB
155162011-05-02 Juanma Barranquero <lekktu@gmail.com>
15517
15518 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15519
bafcf6a5
JB
155202011-05-02 Juanma Barranquero <lekktu@gmail.com>
15521
15522 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15523 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15524 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15525 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15526 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15527 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15528 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15529 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15530 (Qgnutls_bootprop_callbacks_verify): Make static.
15531
e7a6747f
AS
155322011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15533
19ed11ba
AS
15534 * callproc.c: Indentation fixup.
15535
e7a6747f 15536 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
15537 (wait_for_termination, interruptible_wait_for_termination):
15538 Move after wait_for_termination_1.
e7a6747f 15539
1ef14cb4
LMI
155402011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15541
15542 * sysdep.c (interruptible_wait_for_termination): New function
15543 which is like wait_for_termination, but allows keyboard
15544 interruptions.
15545
15546 * callproc.c (Fcall_process): Add (:file "file") as an option for
15547 the STDOUT buffer.
15548 (Fcall_process_region): Ditto.
15549
330d880c
EZ
155502011-04-30 Eli Zaretskii <eliz@gnu.org>
15551
8db90b73
EZ
15552 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15553 rather than `XVECTOR (FOO)->size'.
15554
330d880c
EZ
15555 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15556 inttypes.h, as a gnulib replacement is used if it not available in
15557 system headers.
15558
15cbd324
EZ
155592011-04-21 Eli Zaretskii <eliz@gnu.org>
15560
15561 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15562 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15563 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15564
15565 * coding.c (coding_alloc_by_realloc): Error out if destination
15566 will grow beyond MOST_POSITIVE_FIXNUM.
15567 (decode_coding_emacs_mule): Abort if there isn't enough place in
15568 charbuf for the composition carryover bytes. Reserve an extra
15569 space for up to 2 characters produced in a loop.
15570 (decode_coding_iso_2022): Abort if there isn't enough place in
15571 charbuf for the composition carryover bytes.
15572
155732011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 15574
ae940cca
EZ
15575 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15576 aborting when %lld or %lll format is passed.
15577 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15578 %llo or %llx format is passed. (Bug#8545)
15579
03ab8921
EZ
15580 * window.c (window_scroll_line_based): Use a marker instead of
15581 simple variables to record original value of point. (Bug#7952)
15582
afda1437
EZ
15583 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15584 produced by %s or %c overflows available buffer space. (Bug#8545)
15585
f76dee0c
PE
155862011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15587
15588 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 15589 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 15590
fdc5744d
JB
155912011-04-28 Juanma Barranquero <lekktu@gmail.com>
15592
15593 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15594
638f053a
JB
155952011-04-28 Juanma Barranquero <lekktu@gmail.com>
15596
15597 * keyboard.c (Qdelayed_warnings_hook): Define.
15598 (command_loop_1): Run `delayed-warnings-hook'
15599 if Vdelayed_warnings_list is non-nil.
15600 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15601 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15602
d178f871
EZ
156032011-04-28 Eli Zaretskii <eliz@gnu.org>
15604
15605 * doprnt.c (doprnt): Don't return value smaller than the buffer
15606 size if the message was truncated. (Bug#8545).
15607
b124fd93
JB
156082011-04-28 Juanma Barranquero <lekktu@gmail.com>
15609
15610 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15611 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15612
e810457d
PE
156132011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15614
15615 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15616
ea51cceb
JB
156172011-04-27 Juanma Barranquero <lekktu@gmail.com>
15618
15619 * makefile.w32-in: Update dependencies.
15620
94dcfacf
EZ
156212011-04-27 Eli Zaretskii <eliz@gnu.org>
15622
15623 Improve `doprnt' and its usage. (Bug#8545)
15624 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15625 `format_end'. Remove support for %l as a conversion specifier.
15626 Don't use xrealloc. Improve diagnostics when the %l size modifier
15627 is used. Update the commentary.
15628
15629 * eval.c (verror): Simplify calculation of size_t.
15630
15631 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15632 messages.
15633
f61f41d7
PE
156342011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15635
15636 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15637 change.
15638
96fb4434
PE
156392011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15640
15641 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15642 This makes this file independent of the recent pseudovector change.
15643
671875da 156442011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 15645
69e9b5a3
PE
15646 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15647
b5f869a7 15648 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 15649 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 15650 Remove unused local.
c8926152 15651 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 15652
841a1577 15653 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
15654 GCC 4.6.0 optimizes based on type-based alias analysis.
15655 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
15656 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15657 != &v->size, and therefore "v->size = 1; b->size = 2; return
15658 v->size;" must therefore return 1. This assumption is incorrect
15659 for Emacs, since it type-puns struct Lisp_Vector * with many other
15660 types. To fix this problem, this patch adds a new type struct
f904488f 15661 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
15662 and pseudovectors, and helps optimizing compilers not get fooled
15663 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15664 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
15665 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15666 the size member.
eab3844f
PE
15667 (XSETPVECTYPE): Rewrite in terms of new macro.
15668 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15669 This is a bit clearer, and further avoids the possibility of
15670 undesirable aliasing.
15671 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 15672 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
15673 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15674 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
15675 (ASIZE): Now uses header.size rather than size.
15676 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
15677 to avoid the hassle of writing XVECTOR (foo)->header.size.
15678 (struct vectorlike_header): New type.
eab3844f
PE
15679 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15680 object, to help avoid aliasing.
15681 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15682 (SUBRP): Likewise, since Lisp_Subr is a special case.
15683 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15684 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15685 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 15686 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
15687 changed to be "header.size" and "header.next".
15688 * buffer.h (struct buffer): Likewise.
15689 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15690 * frame.h (struct frame): Likewise.
15691 * process.h (struct Lisp_Process): Likewise.
15692 * termhooks.h (struct terminal): Likewise.
15693 * window.c (struct save_window_data, struct saved_window): Likewise.
15694 * window.h (struct window): Likewise.
15695 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15696 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15697 * buffer.c (init_buffer_once): Likewise.
15698 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15699 special case.
15700 * process.c (Fformat_network_address): Use local var for size,
15701 for brevity.
15702
0df1eac5
PE
15703 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15704
847ab9d1 15705 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
15706 * data.c (atof): Remove decl; no longer used or needed.
15707 (digit_to_number): Move to lread.c.
15708 (Fstring_to_number): Use new string_to_number function, to be
15709 consistent with how the Lisp reader treats infinities and NaNs.
15710 Do not assume that floating-point numbers represent EMACS_INT
15711 without losing information; this is not true on most 64-bit hosts.
15712 Avoid double-rounding errors, by insisting on integers when
15713 parsing non-base-10 numbers, as the documentation specifies.
15714 * lisp.h (string_to_number): New decl, replacing ...
15715 (isfloat_string): Remove.
bc0a5c13 15716 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 15717 (read1): Do not accept +. and -. as integers; this
452f4150
PE
15718 appears to have been a coding error. Similarly, do not accept
15719 strings like +-1e0 as floating point numbers. Do not report
15720 overflow for integer overflows unless the base is not 10 which
15721 means we have no simple and reliable way to continue.
15722 Break out the floating-point parsing into a new
15723 function string_to_number, so that Fstring_to_number parses
15724 floating point numbers consistently with the Lisp reader.
04f2d78b 15725 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
15726 (E_CHAR, EXP_INT): Remove, replacing with ...
15727 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15728 (string_to_number): New function, replacing isfloat_string.
15729 This function checks for valid syntax and produces the resulting
15730 Lisp float number too. Rework it so that string-to-number
bc0a5c13 15731 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
15732 so that overflow for non-base-10 numbers is reported only when
15733 there's no portable and simple way to convert to floating point.
452f4150 15734
67769ffc
PE
15735 * textprop.c (set_text_properties_1): Rewrite for clarity,
15736 and to avoid GCC warning about integer overflow.
15737
c20db43f
PE
15738 * intervals.h (struct interval): Use EMACS_INT for members
15739 where EMACS_UINT might cause problems. See
15740 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15741 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15742 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15743 All uses changed.
37aa2f85
PE
15744 (offset_intervals): Tell GCC not to worry about length overflow
15745 when negating a negative length.
c20db43f 15746
2538aa2f
PE
15747 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15748 (overrun_check_free): Likewise.
15749
f2d3008d
PE
15750 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15751 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15752 word size.
15753
ec8df744
PE
15754 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15755 (gnutls_make_error): Rename local to avoid shadowing.
15756 (gnutls_emacs_global_deinit): ifdef out; not used.
15757 (Fgnutls_boot): Use const for pointer to readonly storage.
15758 Comment out unused local. Fix pointer signedness problems.
15759
640ee02d
PE
15760 * lread.c (openp): Don't stuff size_t into an 'int'.
15761 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15762 about possible signed overflow.
15763
6048fb2a
PE
15764 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15765 (GDK_KEY_g): Don't define if already defined.
15766 (xg_prepare_tooltip): Avoid pointer signedness problem.
15767 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15768
fa3c87e1
PE
15769 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15770 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15771
2172544b
PE
15772 * xfns.c (Fx_window_property): Simplify a bit,
15773 to make a bit faster and to avoid GCC 4.6.0 warning.
15774 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15775
9b821a21
PE
15776 * fns.c (internal_equal): Don't assume size_t fits in int.
15777
3c616cfa
PE
15778 * alloc.c (compact_small_strings): Tighten assertion a little.
15779
c2982e87
PE
15780 Replace pEd with more-general pI, and fix some printf arg casts.
15781 * lisp.h (pI): New macro, generalizing old pEd macro to other
15782 conversion specifiers. For example, use "...%"pI"d..." rather
15783 than "...%"pEd"...".
15784 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 15785 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
15786 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15787 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15788 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15789 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15790 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15791 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15792 64-bit hosts.
15793 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15794 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15795 * print.c (safe_debug_print, print_object): Likewise.
15796 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15797 to int.
6f04d126
PE
15798 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15799 avoiding the 0 flag, which is not portable.
c2982e87
PE
15800 * process.c (Fmake_network_process): Use pI to avoid cast.
15801 * region-cache.c (pp_cache): Likewise.
15802 * xdisp.c (decode_mode_spec): Likewise.
15803 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15804 behavior on 64-bit hosts with printf arg.
6f04d126 15805 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
15806 (x_stop_queuing_selection_requests): Likewise.
15807 (x_get_window_property): Don't truncate byte count to an 'int'
15808 when tracing.
0b432f21 15809
5e073ec7
PE
15810 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15811 here, since it parses constructs like leading '-' and spaces,
15812 which are not wanted; and it overflows with large numbers.
15813 Instead, simply match F[0-9]+, which is what is wanted anyway.
15814
36372bf9
PE
15815 * alloc.c: Remove unportable assumptions about struct layout.
15816 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15817 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15818 (allocate_vectorlike, make_pure_vector): Use the new macros,
15819 plus offsetof, to remove unportable assumptions about struct layout.
15820 These assumptions hold on all porting targets that I know of, but
15821 they are not guaranteed, they're easy to remove, and removing them
15822 makes further changes easier.
15823
0b432f21
PE
15824 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15825 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
15826 (string_overrun_cookie): Now const. Use initializers that
15827 don't formally overflow signed char, to avoid warnings.
000098c1
PE
15828 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15829 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
15830 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15831 multiple of sizeof (EMACS_INT); it need not be, if
15832 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 15833 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 15834
895009e1
JB
158352011-04-26 Juanma Barranquero <lekktu@gmail.com>
15836
15837 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15838
6a7a1b0b
TZ
158392011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15840
15841 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 15842 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
15843 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15844
841a1577 158452011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
15846
15847 * lisp.h (Qdebug): List symbol.
895009e1 15848 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
15849 * keyboard.c (debug-on-event): New variable.
15850 (handle_user_signal): Break into debugger when debug-on-event
15851 matches the current signal symbol.
15852
f2d3ba6f
DN
158532011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15854
15855 * alloc.c (check_sblock, check_string_bytes)
15856 (check_string_free_list): Convert to standard C.
15857
42ce4c63
TZ
158582011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15859
15860 * w32.c (emacs_gnutls_push): Fix typo.
15861
825cd63c
EZ
158622011-04-25 Eli Zaretskii <eliz@gnu.org>
15863
fb11d64d
EZ
15864 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15865 "cast to pointer from integer of different size".
15866
825cd63c
EZ
15867 Improve doprnt and its use in verror. (Bug#8545)
15868 * doprnt.c (doprnt): Document the set of format control sequences
15869 supported by the function. Use SAFE_ALLOCA instead of always
15870 using `alloca'.
15871
15872 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15873 is one byte too soon. Don't use xrealloc; instead xfree and
15874 xmalloc anew.
15875
e061a11b
TZ
158762011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15877
15878 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15879 callbacks stage.
15880
15881 * gnutls.c: Renamed global_initialized to
15882 gnutls_global_initialized. Added internals for the
15883 :verify-hostname-error, :verify-error, and :verify-flags
15884 parameters of `gnutls-boot' and documented those parameters in the
15885 docstring. Start callback support.
9173deec
JB
15886 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15887 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15888 on error. Return error code.
e061a11b
TZ
15889 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15890 (emacs_gnutls_read): Likewise.
15891 (Fgnutls_boot): Return handshake error code.
15892 (emacs_gnutls_handle_error): New function.
15893 (wsaerror_to_errno): Likewise.
15894
15895 * w32.h (emacs_gnutls_pull): Add prototype.
15896 (emacs_gnutls_push): Likewise.
15897
15898 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15899 (emacs_gnutls_push): Likewise.
15900
159012011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15902
15903 * process.c (wait_reading_process_output): Check if GnuTLS
15904 buffered some data internally if no FDs are set for TLS
15905 connections.
15906
15907 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15908 (LIBS): Link to USER_LIBS.
15909 ($(BLD)/gnutls.$(0)): New target.
15910
fa6996bc
EZ
159112011-04-24 Eli Zaretskii <eliz@gnu.org>
15912
eb35682e
EZ
15913 * xdisp.c (handle_single_display_spec): Rename the
15914 display_replaced_before_p argument into display_replaced_p, to
15915 make it consistent with the commentary. Fix typos in the
15916 commentary.
15917
e2ad650c
EZ
15918 * textprop.c (syms_of_textprop): Remove dead code.
15919 (copy_text_properties): Delete obsolete commentary about an
15920 interface that was deleted long ago. Fix typos in the description
15921 of arguments.
15922
1b2de274
EZ
15923 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15924 to changes in oldXMenu/XMenu.h from 2011-04-16.
15925 <menu_help_message, prev_menu_help_message>: Constify.
15926 (IT_menu_make_room): menu->help_text is now `const char **';
15927 adjust.
15928
15929 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15930 to changes in oldXMenu/XMenu.h from 2011-04-16.
15931 (struct XMenu): Declare `help_text' `const char **'.
15932
15933 * xfaces.c <Qunspecified>: Make extern again.
15934
15935 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 15936 required by POSIX.
1b2de274 15937
762b15be
EZ
15938 * doc.c (get_doc_string): Improve the format passed to `error'.
15939
15940 * doprnt.c (doprnt): Improve commentary.
15941
15942 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15943
15944 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15945 them with etags.
15946
f1052e5d
EZ
15947 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15948 changes in globals.h immediately force recompilation.
762b15be
EZ
15949 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15950 $(CURDIR)/s/ms-w32.h.
15951 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 15952
fa6996bc
EZ
15953 * character.c (Fchar_direction): Function deleted.
15954 (syms_of_character): Don't defsubr it.
15955 <char-direction-table>: Deleted.
15956
e6c3da20
EZ
159572011-04-23 Eli Zaretskii <eliz@gnu.org>
15958
15959 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15960 * doprnt.c: Include limits.h.
15961 (SIZE_MAX): New macro.
04f2d78b
CB
15962 (doprnt): Return a size_t value. 2nd arg is now size_t.
15963 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
15964 Improve overflow protection. Support `l' modifier for integer
15965 conversions. Support %l conversion. Don't assume an EMACS_INT
15966 argument for integer conversions and for %c.
15967
15968 * lisp.h (doprnt): Restore prototype.
15969
15970 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15971 $(SRC)/character.h.
15972
15973 * Makefile.in (base_obj): Add back doprnt.o.
15974
15975 * deps.mk (doprnt.o): Add back prerequisites.
15976 (callint.o): Depend on character.h.
15977
15978 * eval.c (internal_lisp_condition_case): Include the handler
15979 representation in the error message.
15980 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15981 when breaking from the loop.
15982
15983 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15984
15985 * callint.c (Fcall_interactively): When displaying error message
15986 about invalid control letter, pass the character's codepoint, not
15987 a pointer to its multibyte form. Improve display of the character
15988 in octal and display also its hex code.
15989
15990 * character.c (char_string): Use %x to display the (unsigned)
15991 codepoint of an invalid character, to avoid displaying a bogus
15992 negative value.
15993
15994 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15995 `error', not SYMBOL_NAME itself.
15996
15997 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15998 character arguments to `error'.
15999
16000 * charset.c (check_iso_charset_parameter): Fix incorrect argument
16001 to `error' in error message about FINAL_CHAR argument. Make sure
16002 FINAL_CHAR is a character, and use %c when it is passed as
16003 argument to `error'.
16004
4ffd0d6b 160052011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
16006
16007 * s/ms-w32.h (localtime): Redirect to sys_localtime.
16008
16009 * w32.c: Include <time.h>.
16010 (sys_localtime): New function.
16011
4ffd0d6b 160122011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
16013
16014 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16015
4ffd0d6b 16016 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 16017
4ffd0d6b 160182011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 16019
4ffd0d6b
GM
16020 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16021 zombies (Bug#8467).
aac0c6e3 16022
04c56954
EZ
160232011-04-19 Eli Zaretskii <eliz@gnu.org>
16024
16025 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16026 gl_state.e_property when gl_state.object is Qt.
16027
16028 * insdel.c (make_gap_larger): Remove limitation of buffer size
16029 to <= INT_MAX.
16030
16a43933
CY
160312011-04-18 Chong Yidong <cyd@stupidchicken.com>
16032
16033 * xdisp.c (lookup_glyphless_char_display)
16034 (produce_glyphless_glyph): Handle cons cell entry in
16035 glyphless-char-display.
16036 (Vglyphless_char_display): Document it.
16037
16038 * term.c (produce_glyphless_glyph): Handle cons cell entry in
16039 glyphless-char-display.
16040
4581706e
CY
160412011-04-17 Chong Yidong <cyd@stupidchicken.com>
16042
16043 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16044
16045 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16046
16047 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16048 definition for no-X builds.
16049
4887c6e2 160502011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 16051
fd35b6f9
PE
16052 Static checks with GCC 4.6.0 and non-default toolkits.
16053
5c1ccb01
PE
16054 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16055
006c5daa
PE
16056 * process.c (keyboard_bit_set): Define only if SIGIO.
16057 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16058 (send_process): Repair possible setjmp clobbering.
16059
efc736d3
PE
16060 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16061
4e2fe2e6
PE
16062 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16063
f97334a2
PE
16064 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16065
4e75f29d
PE
16066 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16067 Define only if needed.
16068
90efadd1
PE
16069 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16070 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 16071 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 16072
3c647824
PE
16073 * dispextern.h (struct redisplay_interface): Rename param
16074 to avoid shadowing.
e264f262 16075 * termhooks.h (struct terminal): Likewise.
761383f4 16076 * xterm.c (xembed_send_message): Likewise.
3c647824 16077
b58c5c4a
PE
16078 * insdel.c (make_gap_smaller): Define only if
16079 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16080
cad59032
PE
16081 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16082 it.
16083
c339dc2e
PE
16084 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16085 so that we aren't warned about unused symbols.
16086
91a3e27b
PE
16087 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16088
399c71d3 16089 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 16090
8ffc96f5
PE
16091 * xfns.c (x_real_positions): Mark locals as initialized.
16092
eef9bc79
PE
16093 * xmenu.c (xmenu_show): Don't use uninitialized vars.
16094
098db9dd
PE
16095 * xterm.c: Fix problems found by static analysis with other toolkits.
16096 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
16097 (x_dispatch_event): Declare static if USE_GTK, and
16098 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 16099 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 16100 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
16101 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16102 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 16103
eb18f6cc
PE
16104 * xmenu.c (menu_help_callback): Pointer type fixes.
16105 Use const pointers when pointing at readonly data. Avoid pointer
16106 signedness clashes.
16107 (FALSE): Remove unused macro.
16108 (update_frame_menubar): Remove unused decl.
16109
1fe72bf8
PE
16110 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
16111
60d9e1db
PE
16112 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
16113 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
16114 (single_menu_item): Rename local to avoid shadowing.
16115
39261c26
PE
16116 * keyboard.c (make_lispy_event): Remove unused local var.
16117
018c5e19
PE
16118 * frame.c, frame.h (x_get_resource_string): Bring this back, but
16119 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
16120
63d2b86e
PE
16121 * bitmaps: Change bitmaps from unsigned char back to the X11
16122 compatible char. Avoid the old compiler warnings about
16123 out-of-range initializers by using, for example, '\xab' rather
16124 than 0xab.
16125
aefd87e1
PE
16126 * xgselect.c (xgselect_initialize): Check vs interface
16127 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
16128
bf501fb9
PE
16129 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
16130
e9829fdf
PE
16131 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
16132 to read-only memory.
16133
1086c095
PE
16134 * fns.c (vector): Remove; this old hack is no longer needed.
16135
2baccd04 16136 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 16137 Remove unused var.
dde42981 16138 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 16139
72391843 16140 * xrdb.c (x_load_resources): Omit unused local.
3565b346 16141
436c16df 16142 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 16143 (x_window): Rename locals to avoid shadowing.
dc5ddd85 16144 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 16145
92bb796d 16146 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 16147 (x_term_init): Remove local to avoid shadowing.
92bb796d 16148
764430a3 16149 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
16150
16151 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
16152 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
16153
d1dfb56c
EZ
161542011-04-16 Eli Zaretskii <eliz@gnu.org>
16155
c4354cb4
EZ
16156 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
16157
d1dfb56c
EZ
16158 Fix regex.c, syntax.c and friends for buffers > 2GB.
16159 * syntax.h (struct gl_state_s): Declare character position members
16160 EMACS_INT.
16161
16162 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
16163
04f2d78b
CB
16164 * textprop.c (verify_interval_modification, interval_of):
16165 Declare arguments EMACS_INT.
d1dfb56c
EZ
16166
16167 * intervals.c (adjust_intervals_for_insertion): Declare arguments
16168 EMACS_INT.
16169
16170 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
16171
16172 * indent.c (Fvertical_motion): Local variable it_start is now
16173 EMACS_INT.
16174
16175 * regex.c (re_match, re_match_2, re_match_2_internal)
16176 (bcmp_translate, regcomp, regexec, print_double_string)
16177 (group_in_compile_stack, re_search, re_search_2, regex_compile)
16178 (re_compile_pattern, re_exec): Declare arguments and local
16179 variables `size_t' and `ssize_t' and return values `regoff_t', as
16180 appropriate.
16181 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16182 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16183 <compile_stack_type>: `size' and `avail' are now `size_t'.
16184
16185 * regex.h <regoff_t>: Use ssize_t, not int.
16186 (re_search, re_search_2, re_match, re_match_2): Arguments that
16187 specify buffer/string position and length are now ssize_t and
16188 size_t. Return type is regoff_t.
16189
613052cd
BK
161902011-04-16 Ben Key <bkey76@gmail.com>
16191
16192 * nsfont.m: Fixed bugs in ns_get_family and
16193 ns_descriptor_to_entity that were caused by using free to
16194 deallocate memory blocks that were allocated by xmalloc (via
16195 xstrdup). This caused Emacs to crash when compiled with
16196 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16197 --enable-checking=xmallocoverrun). xfree is now used to
16198 deallocate these memory blocks.
16199
4170f62f 162002011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 16201
71b41406
PE
16202 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16203
9587a89d
PE
16204 emacs_write: Accept and return EMACS_INT for sizes.
16205 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16206 et seq.
16207 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16208 Accept and return EMACS_INT.
16209 (emacs_gnutls_write): Return the number of bytes written on
16210 partial writes.
16211 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
16212 (emacs_read, emacs_write): Remove check for negative size, as the
16213 Emacs source code has been audited now.
9587a89d
PE
16214 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16215 (emacs_read, emacs_write): Use it.
273a5f82
PE
16216 * process.c (send_process): Adjust to the new signatures of
16217 emacs_write and emacs_gnutls_write. Do not attempt to store
16218 a byte offset into an 'int'; it might overflow.
9587a89d 16219 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 16220
3e047f51
PE
16221 * sound.c: Don't assume sizes fit in 'int'.
16222 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 16223 Return EMACS_INT, not int.
3e047f51 16224 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
16225 Accept EMACS_INT, not int.
16226 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
16227 record read return values.
16228
cc39a9db
BK
162292011-04-15 Ben Key <bkey76@gmail.com>
16230
c9d0ec6d
JB
16231 * keyboard.c (Qundefined): Don't declare static since it is used
16232 in nsfns.m.
16233 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16234 static since they are used in nsfont.m.
cc39a9db 16235
6c60eb9f
SM
162362011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
16237
16238 * process.c (Qprocessp): Don't declare static.
16239 * lisp.h (Qprocessp): Declare again.
16240
7990b61a
JB
162412011-04-15 Juanma Barranquero <lekktu@gmail.com>
16242
16243 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16244
5d4cb038
PE
162452011-04-14 Paul Eggert <eggert@cs.ucla.edu>
16246
8bd7b830 16247 Improve C-level modularity by making more things 'static'.
cd64ea1d 16248
e3b27b31
PE
16249 Don't publish debugger-only interfaces to other modules.
16250 * lisp.h (safe_debug_print, debug_output_compilation_hack):
16251 (verify_bytepos, count_markers): Move decls to the only modules
16252 that need them.
16253 * region-cache.h (pp_cache): Likewise.
16254 * window.h (check_all_windows): Likewise.
16255 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16256
5d4cb038
PE
16257 * sysdep.c (croak): Now static, if
16258 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16259 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
16260
16261 * alloc.c (refill_memory_reserve): Now static if
16262 !defined REL_ALLOC || defined SYSTEM_MALLOC.
16263 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 16264
e87b6180
PE
16265 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
16266 Define only if USE_LUCID.
16267
ac64929e
PE
16268 * xrdb.c (x_customization_string, x_rm_string): Now static.
16269
6f37259d
PE
16270 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
16271 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
16272
1683e3ab
PE
16273 * xdisp.c (draw_row_with_mouse_face): Now static.
16274 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
16275
de9c2632
PE
16276 * window.h (check_all_windows): Mark externally visible.
16277
2b96acb7
PE
16278 * window.c (window_deletion_count): Now static.
16279
16280 * undo.c: Make symbols static if they're not exported.
16281 (last_undo_buffer, last_boundary_position, pending_boundary):
16282 Now static.
16283
50436f33
PE
16284 * textprop.c (interval_insert_behind_hooks): Now static.
16285 (interval_insert_in_front_hooks): Likewise.
16286
64520e5c
PE
16287 * term.c: Make symbols static if they're not exported.
16288 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
16289 (max_frame_lines, tty_set_terminal_modes):
16290 (tty_reset_terminal_modes, tty_turn_off_highlight):
16291 (get_tty_terminal): Now static.
16292 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
16293 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 16294 HAVE_WINDOW_SYSTEM.
64520e5c
PE
16295 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16296 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16297
1fa53021
PE
16298 * sysdep.c: Make symbols static if they're not exported.
16299 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16300 Now static.
16301 (sigprocmask_set, full_mask): Remove; unused.
16302 (wait_debugging): Mark as visible.
16303 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16304 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16305
d4b43b22
PE
16306 * syntax.c (syntax_temp): Define only if !__GNUC__.
16307
b7c513d0
PE
16308 * sound.c (current_sound_device, current_sound): Now static.
16309
989b29ad
PE
16310 * search.c (searchbufs, searchbuf_head): Now static.
16311
13a55a78
PE
16312 * scroll.c (scroll_cost): Remove; unused.
16313 * dispextern.h (scroll_cost): Remove decl.
16314
de68a1fc
PE
16315 * region-cache.h (pp_cache): Mark as externally visible.
16316
40ccffa6
PE
16317 * process.c: Make symbols static if they're not exported.
16318 (process_tick, update_tick, create_process, chan_process):
16319 (Vprocess_alist, proc_buffered_char, datagram_access):
16320 (fd_callback_data, send_process_frame, process_sent_to): Now static.
16321 (deactivate_process): Mark defn as static, as well as decl.
16322 * lisp.h (create_process): Remove decl.
16323 * process.h (chan_process, Vprocess_alist): Remove decls.
16324
ad64fc97
PE
16325 * print.c: Make symbols static if they're not exported.
16326 (print_depth, new_backquote_output, being_printed, print_buffer):
16327 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16328 (print_interval, print_number_index, initial_stderr_stream):
16329 Now static.
16330 * lisp.h (Fprinc): Remove decl.
16331 (debug_output_compilation_hack): Mark as externally visible.
16332
adddb265
PE
16333 * sysdep.c (croak): Move decl from here to syssignal.h.
16334 * syssignal.h (croak): Put it here, so the API can be checked when
16335 'croak' is called from dissociate_if_controlling_tty.
16336
1717ede2
PE
16337 * minibuf.c: Make symbols static if they're not exported.
16338 (minibuf_save_list, choose_minibuf_frame): Now static.
16339 * lisp.h (choose_minibuf_frame): Remove decl.
16340
fa5fb2bc
PE
16341 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16342
1e3890d1
PE
16343 * lread.c: Make symbols static if they're not exported.
16344 (read_objects, initial_obarray, oblookup_last_bucket_number):
16345 Now static.
16346 (make_symbol): Remove; unused.
16347 * lisp.h (initial_obarray, make_symbol): Remove decls.
16348
8a1414fa
PE
16349 * keyboard.c: Make symbols static if they're not exported.
16350 (single_kboard, recent_keys_index, total_keys, recent_keys):
16351 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16352 (this_single_command_key_start, echoing, last_auto_save):
16353 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16354 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16355 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16356 (Vlispy_mouse_stem, double_click_count):
16357 Now static.
16358 (force_auto_save_soon): Define only if SIGDANGER.
16359 (ignore_mouse_drag_p): Now static if
16360 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16361 (print_help): Remove; unused.
16362 (stop_character, last_timer_event): Mark as externally visible.
16363 * keyboard.h (ignore_mouse_drag_p): Declare only if
16364 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16365 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16366 * lisp.h (echoing): Remove decl.
16367 (force_auto_save_soon): Declare only if SIGDANGER.
16368 * xdisp.c (redisplay_window): Simplify code, to make it more
16369 obvious that ignore_mouse_drag_p is not accessed if !defined
16370 USE_GTK && !defined HAVE_NS.
16371
93ea6e8f
PE
16372 * intervals.c: Make symbols static if they're not exported.
16373 (merge_properties_sticky, merge_interval_right, delete_interval):
16374 Now static.
16375 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16376
77382fcc
PE
16377 * insdel.c: Make symbols static if they're not exported.
16378 However, leave prepare_to_modify_buffer alone. It's never
16379 called from outside this function, but that appears to be a bug.
16380 (combine_after_change_list, combine_after_change_buffer):
4889fc82 16381 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
16382 (adjust_after_replace_noundo): Remove; unused.
16383 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 16384 (signal_before_change): Remove decls.
77382fcc 16385
9306c32e
PE
16386 * indent.c (val_compute_motion, val_vmotion): Now static.
16387
cd44d2eb
PE
16388 * image.c: Make symbols static if they're not exported.
16389 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16390 if USE_GTK.
16391 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16392 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16393
ad9a7a06
PE
16394 * fringe.c (standard_bitmaps): Now static.
16395 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16396
81626931
PE
16397 * frame.c: Make symbols static if they're not exported.
16398 (x_report_frame_params, make_terminal_frame): Now static.
16399 (get_frame_param): Now static, unless HAVE_NS.
16400 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16401 (x_get_resource_string): Remove; not used.
16402 * frame.h (make_terminal_frame, x_report_frame_params):
16403 (x_get_resource_string); Remove decls.
16404 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16405 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16406
239f9db9
PE
16407 * font.c, fontset.c: Make symbols static if they're not exported.
16408 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16409 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16410 * font.c (font_close_object): Now static.
16411 * font.h (font_close_object): Remove.
16412 * fontset.c (FONTSET_OBJLIST): Remove.
16413 (free_realized_fontset) #if-0 the body, which does nothing.
16414 (face_suitable_for_char_p): #if-0, as it's never called.
16415 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
16416 * xfaces.c (face_at_string_position):
16417 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
16418 since 0 is always ASCII.
16419
dfcf3579
PE
16420 * fns.c (weak_hash_tables): Now static.
16421
5045092b
PE
16422 * fileio.c: Make symbols static if they're not exported.
16423 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16424 (Vwrite_region_annotation_buffers): Now static.
16425
57a96f5c
PE
16426 * eval.c: Make symbols static if they're not exported.
16427 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16428 * lisp.h (backtrace_list): Remove decl.
16429
35f08c38
PE
16430 * emacs.c: Make symbols static if they're not exported.
16431 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16432 (fatal_error_code, fatal_error_signal_hook, standard_args):
16433 Now static.
16434 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16435 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16436 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16437 * lisp.h (fatal_error_signal_hook): Remove decl.
16438 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16439
f44bd759
PE
16440 * editfns.c: Move a (normally-unused) function to its only use.
16441 * editfns.c, lisp.h (get_operating_system_release): Remove.
16442 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16443 worth the hassle of breaking this out.
16444
b532497d
PE
16445 * xterm.c: Make symbols static if they're not exported.
16446 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16447 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16448 (x_destroy_window, x_delete_display):
16449 Now static.
16450 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16451 (x_mouse_leave): Remove; unused.
16452 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16453 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16454 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16455 Remove decls.
16456 (x_mouse_leave): Declare only if WINDOWSNT.
16457 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16458 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16459 USE_X_TOOLKIT.
16460
1675728f
PE
16461 * ftxfont.c: Make symbols static if they're not exported.
16462 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16463 HAVE_FREETYPE.
16464 * font.h (ftxfont_driver): Likewise.
16465
e4cebfca
PE
16466 * xfns.c: Make symbols static if they're not exported.
16467 (x_last_font_name, x_display_info_for_name):
16468 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16469 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16470 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16471 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16472 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16473 (last_show_tip_args): Now static.
16474 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16475 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16476 (x_screen_planes): Remove; unused.
16477 * dispextern.h (x_screen_planes): Remove decl.
16478
5bf46f05
PE
16479 * dispnew.c: Make symbols static if they're not exported.
16480 * dispextern.h (redraw_garbaged_frames, scrolling):
16481 (increment_row_positions): Remove.
16482 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16483 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16484 Now static.
16485 (redraw_garbaged_frames): Remove; unused.
16486
435f4c28
PE
16487 * xfaces.c: Make symbols static if they're not exported.
16488 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16489 Remove decls.
16490 * xterm.h (defined_color): Remove decls.
16491 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16492 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16493 (menu_face_changed_default, defined_color, free_realized_face):
16494 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16495 (ascii_face_of_lisp_face): Remove; unused.
16496
8524aef3
PE
16497 * xdisp.c: Make symbols static if they're not exported.
16498 * dispextern.h (scratch_glyph_row, window_box_edges):
16499 (glyph_to_pixel_coords, set_cursor_from_row):
16500 (get_next_display_element, set_iterator_to_next):
16501 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16502 (show_mouse_face): Remove decls
16503 * frame.h (message_buf_print): Likewise.
16504 * lisp.h (pop_message, set_message, check_point_in_composition):
16505 Likewise.
16506 * xterm.h (set_vertical_scroll_bar): Likewise.
16507 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16508 (message_buf_print, scratch_glyph_row, displayed_buffer):
16509 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16510 (get_next_display_element, show_mouse_face, window_box_edges):
16511 (frame_to_window_pixel_xy, check_point_in_composition):
16512 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16513 (glyph_to_pixel_coords): Remove; unused.
16514
16390cd2
PE
16515 * dired.c (file_name_completion): Now static.
16516
16517 * dbusbind.c (xd_in_read_queued_messages): Now static.
16518
a25f4dfa
PE
16519 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16520 * data.c (circular_list_error): Remove.
16521
14a9c8df
PE
16522 * commands.h (last_point_position, last_point_position_buffer):
16523 (last_point_position_window): Remove decls.
16524 * keyboard.c: Make these variables static.
16525
04f2d78b
CB
16526 * coding.h (coding, code_convert_region, encode_coding_gap):
16527 Remove decls.
74ab6df5
PE
16528 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16529 (iso_code_class, detect_coding, code_convert_region): Now static.
16530 (encode_coding_gap): Remove; unused.
16531
38dfbee1
PE
16532 * chartab.c (chartab_chars, chartab_bits): Now static.
16533
a2cb4e63
PE
16534 * charset.h (charset_iso_8859_1): Remove decl.
16535 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16536 Now static.
16537
127198fd
PE
16538 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16539 * ccl.c (Vccl_program_table): Now static.
16540 (check_ccl_update): Remove; unused.
16541
d85b608f
PE
16542 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16543 * category.h: ... from here.
16544 * category.c (check_category_table, set_category_set): Now static.
16545
31cd66f3
PE
16546 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16547 * lisp.h: Remove these decls.
16548
c358e587
PE
16549 * buffer.c (buffer_count): Remove unused var.
16550
e78aecca
PE
16551 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16552 so that it's not optimized away.
16553 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16554 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16555 exported only to the debugger.
16556
e192d7d3 16557 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 16558 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 16559
92470028
PE
16560 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16561 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16562 was inaccessible from Lisp.
16563 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16564 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16565
244ed907
PE
16566 alloc.c: Import and export fewer symbols, and remove unused items.
16567 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16568 is defined.
16569 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16570 it's not optimized away by whole-program optimization.
16571 (message_enable_multibyte, free_misc): Remove.
16572 (catchlist, handlerlist, mark_backtrace):
16573 Declare only if BYTE_MARK_STACK.
16574 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16575 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16576 (message_enable_multibyte): Remove decl.
16577 (free_misc, interval_free_list, float_block, float_block_index):
16578 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16579 (cons_free_list, last_marked_index):
16580 Now static.
16581 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16582 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16583 (mark_backtrace): Define only if BYTE_MARK_STACK.
16584 * xdisp.c (message_enable_multibyte): Now static.
16585
61c2b50e 16586 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
16587 This makes it easier for human readers (and static analyzers)
16588 to see whether these variables are used from other modules.
16589 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16590 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16591 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16592 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16593 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16594 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16595 * xmenu.c, xselect.c:
16596 Declare Q* vars static if they are not used in other modules.
16597 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16598 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16599 Remove decls of unexported vars.
16600 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16601
95c82688
PE
16602 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16603
16a97296
PE
16604 Make Emacs functions such as Fatom 'static' by default.
16605 This makes it easier for human readers (and static analyzers)
16606 to see whether these functions can be called from other modules.
16607 DEFUN now defines a static function. To make the function external
16608 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
16609 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16610 (Finit_image_library):
16a97296
PE
16611 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16612 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16613 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16614 Remove decls, since these functions are now static.
16615 (Funintern, Fget_internal_run_time): New decls, since these functions
16616 were already external.
95c82688 16617
16a97296
PE
16618 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16619 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16620 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16621 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16622 * keyboard.c, keymap.c, lread.c:
16623 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16624 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16625 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16626 Mark functions with DEFUE instead of DEFUN,
16627 if they are used in other modules.
16628 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16629 decls for now-static functions.
16630 * buffer.h (Fdelete_overlay): Remove decl.
16631 * callproc.c (Fgetenv_internal): Mark as internal.
16632 * composite.c (Fremove_list_of_text_properties): Remove decl.
16633 (Fcomposition_get_gstring): New forward static decl.
16634 * composite.h (Fcomposite_get_gstring): Remove decl.
16635 * dired.c (Ffile_attributes): New forward static decl.
16636 * doc.c (Fdocumntation_property): New forward static decl.
16637 * eval.c (Ffetch_bytecode): New forward static decl.
16638 (Funintern): Remove extern decl; now in .h file where it belongs.
16639 * fileio.c (Fmake_symbolic_link): New forward static decl.
16640 * image.c (Finit_image_library): New forward static decl.
16641 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16642 * intervals.h (Fprevious_property_change):
16643 (Fremove_list_of_text_properties): Remove decls.
16644 * keyboard.c (Fthis_command_keys): Remove decl.
16645 (Fcommand_execute): New forward static decl.
16646 * keymap.c (Flookup_key): New forward static decl.
16647 (Fcopy_keymap): Now static.
16648 * keymap.h (Flookup_key): Remove decl.
16649 * process.c (Fget_process): New forward static decl.
16650 (Fprocess_datagram_address): Mark as internal.
16651 * syntax.c (Fsyntax_table_p): New forward static decl.
16652 (skip_chars): Remove duplicate decl.
16653 * textprop.c (Fprevious_property_change): New forward static decl.
16654 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16655 Now internal.
16656 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16657 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16658
785bbd42
PE
16659 * editfns.c (Fformat): Remove unreachable code.
16660
8b913b57
AS
166612011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16662
16663 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16664 change. (Bug#8496)
16665
a6744a35
EZ
166662011-04-13 Eli Zaretskii <eliz@gnu.org>
16667
16668 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16669 when at ZV. (Bug#8487)
16670
e7974947
AS
166712011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16672
baad03f0
AS
16673 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16674 (Bug#8437)
16675 * keyboard.c (parse_tool_bar_item): Likewise.
16676 * sound.c (sound_cleanup, alsa_close): Likewise.
16677 * termcap.c (tgetent): Likewise.
16678 * xfns.c (x_default_font_parameter): Likewise.
16679 * xsettings.c (read_and_apply_settings): Likewise.
16680
e7974947
AS
16681 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16682 (overrun_check_free): Protoize.
16683
28272684
PE
166842011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16685
16686 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16687 since callers should never pass a negative size.
16688 Change the signature to match that of plain 'read' and 'write'; see
16689 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16690 * lisp.h: Update prototypes of emacs_write and emacs_read.
16691
11997c76
EZ
166922011-04-11 Eli Zaretskii <eliz@gnu.org>
16693
16694 * xdisp.c (redisplay_window): Don't try to determine the character
16695 position of the scroll margin if the window start point w->startp
e896f03c 16696 is outside the buffer's accessible region. (Bug#8468)
11997c76 16697
8a2cbd72
EZ
166982011-04-10 Eli Zaretskii <eliz@gnu.org>
16699
16700 Fix write-region and its subroutines for buffers > 2GB.
16701 * fileio.c (a_write, e_write): Modify declaration of arguments and
16702 local variables to support buffers larger than 2GB.
16703 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16704
16705 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16706 argument, local variables, and return value.
16707
16708 * lisp.h: Update prototypes of emacs_write and emacs_read.
16709
16710 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16711
4073e537 167122011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 16713
1ebfdcb6
PE
16714 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16715
b2ded58d
PE
16716 Fix more problems found by GCC 4.6.0's static checks.
16717
7d66342c
PE
16718 * xdisp.c (vmessage): Use a better test for character truncation.
16719
bbf47d44
PE
16720 * charset.c (load_charset_map): <, not <=, for optimization,
16721 and to avoid potential problems with integer overflow.
9248994d 16722 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 16723 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 16724 * editfns.c (Fformat): Likewise.
1e69125e 16725 * syntax.c (skip_chars): Likewise.
3befa583 16726
e3019616
PE
16727 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16728 This also lets GCC 4.6.0 generate slightly better loop code.
16729
becfa255
PE
16730 * callint.c (Fcall_interactively): <, not <=, for optimization.
16731 (Fcall_interactively): Count the number of arguments produced,
16732 not the number of arguments given. This is simpler and lets GCC
16733 4.6.0 generate slightly better code.
16734
dae0cd48
PE
16735 * ftfont.c: Distingish more carefully between FcChar8 and char.
16736 The previous code passed unsigned char * to a functions like
16737 strlen and xstrcasecmp that expect char *, which does not
16738 conform to the C standard.
16739 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16740 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16741 char * when the C standard requires it.
16742
76032d70
PE
16743 * keyboard.c (read_char): Remove unused var.
16744
eb3f1cc8
PE
16745 * eval.c: Port to Windows vsnprintf (Bug#8435).
16746 Include <limits.h>.
16747 (SIZE_MAX): Define if the headers do not.
16748 (verror): Do not give up if vsnprintf returns a negative count.
16749 Instead, grow the buffer. This ports to Windows vsnprintf, which
16750 does not conform to C99. Problem reported by Eli Zaretskii.
16751 Also, simplify the allocation scheme, by avoiding the need for
16752 calling realloc, and removing the ALLOCATED variable.
16753
70476b54
PE
16754 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16755
12020a9e
PE
16756 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16757 But keep the doprint source code for now, as we might revamp it
16758 and use it again (Bug#8435).
ea6c7ae6
PE
16759 * lisp.h (doprnt): Remove.
16760 * Makefile.in (base_obj): Remove doprnt.o.
16761 * deps.mk (doprnt.o): Remove.
16762
5fdb398c
PE
16763 error: Print 32- and 64-bit integers portably (Bug#8435).
16764 Without this change, on typical 64-bit hosts error ("...%d...", N)
16765 was used to print both 32- and 64-bit integers N, which relied on
16766 undefined behavior.
61bdb816 16767 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
16768 * lisp.h (error, verror): Mark as printf-like functions.
16769 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16770 Report overflow in size calculations when allocating printf buffer.
16771 Do not truncate output string at its first null byte.
16772 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16773 Truncate the output at a character boundary, since vsnprintf does not
16774 do that.
16775 * charset.c (check_iso_charset_parameter): Convert internal
16776 character to string before calling 'error', since %c now has the
16777 printf meaning.
16778 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16779 overflow when computing char to be passed to 'error'. Do not
16780 pass Lisp_Object to 'error'; pass the integer instead.
16781 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16782 formatted with plain %d.
16783
b189fa66
PE
16784 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16785
bff87ef0
PE
16786 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16787
7e2cac20
PE
16788 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16789
ce4d90b5
PE
16790 * xterm.c (x_catch_errors): Remove duplicate declaration.
16791
266c9547
PE
16792 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16793
79c49ad2
PE
16794 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16795
368f4090
JM
167962011-04-10 Jim Meyering <meyering@redhat.com>
16797
16798 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16799 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16800 return ssize_t not "int", and use size_t as the buffer length.
16801 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16802 * gnutls.h: Update declarations.
16803 * process.c (read_process_output): Use ssize_t, to match.
16804 (send_process): Likewise.
16805
a32d4040
CY
168062011-04-09 Chong Yidong <cyd@stupidchicken.com>
16807
16808 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16809
8546720e 168102011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 16811
04f2d78b
CB
16812 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16813 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 16814
8546720e
GM
16815 * xterm.c (handle_one_xevent):
16816 * xmenu.c (create_and_show_popup_menu):
16817 * xselect.c (x_decline_selection_request)
16818 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 16819
0a2f5c1a 168202011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
16821
16822 Fix some uses of `int' instead of EMACS_INT.
16823 * search.c (string_match_1, fast_string_match)
16824 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16825 (scan_buffer, find_next_newline_no_quit)
16826 (find_before_next_newline, search_command, Freplace_match)
16827 (Fmatch_data): Make some `int' variables be EMACS_INT.
16828
16829 * xdisp.c (display_count_lines): 3rd argument and return value now
16830 EMACS_INT. All callers changed.
16831 (pint2hrstr): Last argument is now EMACS_INT.
16832
16833 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16834 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16835 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16836 (decode_coding_utf_16, decode_coding_emacs_mule)
16837 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16838 (decode_coding_ccl, decode_coding_charset)
16839 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16840 (decode_coding_iso_2022, decode_coding_emacs_mule)
16841 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16842 <char_offset, last_offset>: Declare EMACS_INT.
16843 (encode_coding_utf_8, encode_coding_utf_16)
16844 (encode_coding_emacs_mule, encode_invocation_designation)
16845 (encode_designation_at_bol, encode_coding_iso_2022)
16846 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16847 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16848 Declare EMACS_INT.
16849 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16850 (encode_invocation_designation): Last argument P_NCHARS is now
16851 EMACS_INT.
16852 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16853 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16854
16855 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16856 All users changed.
16857
16858 * ccl.c (Fccl_execute_on_string): Declare some variables
16859 EMACS_INT.
16860
8546720e 168612011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
16862
16863 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16864
4e19a977
CS
168652011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16866
16867 * process.c (Fformat_network_address): Doc fix.
16868
87302331
R
168692011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16870
ee7683eb 16871 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 16872
cbb59342
CY
168732011-04-08 Chong Yidong <cyd@stupidchicken.com>
16874
16875 * keyboard.c (read_char): Call Lisp function help-form-show,
16876 instead of using internal_with_output_to_temp_buffer.
16877 (Qhelp_form_show): New var.
e0d38eeb 16878 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
16879
16880 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16881
16882 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16883
e67a13ab
CY
168842011-04-06 Chong Yidong <cyd@stupidchicken.com>
16885
04f2d78b
CB
16886 * process.c (Flist_processes): Remove to Lisp.
16887 (list_processes_1): Delete.
e67a13ab 16888
973f782d
EZ
168892011-04-06 Eli Zaretskii <eliz@gnu.org>
16890
7c106b1e
EZ
16891 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16892
973f782d
EZ
16893 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16894
41cf7d1a 168952011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 16896
ca23cc88
PE
16897 Fix more problems found by GCC 4.6.0's static checks.
16898
f390e2d5
PE
16899 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16900
42eea0d0
PE
16901 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16902
b69769da 16903 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 16904
f9541e84
PE
16905 * xdisp.c (vmessage): Mark as a printf-like function.
16906
13841b55
PE
16907 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16908
c136c10f
PE
16909 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16910
5e2d4a30
PE
16911 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16912 printf-like functions.
16913 (tiff_load): Add casts to remove these marks before passing them
16914 to system-supplied API.
16915
583f48b9
PE
16916 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16917
b25d760e
PE
16918 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16919 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
16920 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16921 directly, rather than having caller test rule sign. This avoids
16922 some unnecessary tests.
16923 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16924 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16925 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 16926
bc7b6697 16927 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 16928 (xfont_open): Avoid unnecessary tests.
bc7b6697 16929
27ccc379
PE
16930 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16931
dcd5c89a
PE
16932 * composite.h, composite.c (composition_gstring_put_cache):
16933 Use EMACS_INT, not int, for length.
16934
b13a45c6
PE
16935 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16936 breaking out part of COMPOSITION_DECODE_RULE.
16937 (COMPOSITION_DECODE_RULE): Use it.
16938 * composite.c (get_composition_id): Remove unused local vars,
16939 by using the new macro.
16940
1e792e4d
PE
16941 * textprop.c (set_text_properties_1): Change while to do-while,
16942 since the condition is always true at first.
16943
dc6c6455 16944 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
16945 (interval_deletion_adjustment): Return unsigned value.
16946 All uses changed.
dc6c6455 16947
aba7731a
PE
16948 * process.c (list_processes_1, create_pty, read_process_output):
16949 (exec_sentinel): Remove vars that were set but not used.
afd4052b 16950 (create_pty): Remove unnecessary "volatile"s.
bc57d757 16951 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 16952 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 16953 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 16954
fdfc4bf3
PE
16955 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16956
fca8fe46 16957 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 16958 (update_syntax_table): Use unsigned instead of int.
fca8fe46 16959
06a0259a 16960 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 16961 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 16962 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 16963
e7b9e80f
PE
16964 * print.c (print_error_message): Avoid int overflow.
16965
56201685
PE
16966 * font.c (font_list_entities): Redo for clarity,
16967 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16968
78834453 16969 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 16970 (font_score): Avoid potential overflow in diff calculation.
78834453 16971
0bc0b309 16972 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 16973 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 16974
e610eaca
PE
16975 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16976
b895abce
PE
16977 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16978 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16979 can always succeed if overflow has undefined behavior.
16980
1f1d9321 16981 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 16982 (wordify): Omit three unnecessary tests.
1f1d9321 16983
c59478bc
PE
16984 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16985 All callers changed. This avoids the need for an unused var.
16986
79b73827
PE
16987 * casefiddle.c (casify_region): Remove var that is set but not used.
16988
a4db5dfe
PE
16989 * dired.c (file_name_completion): Remove var that is set but not used.
16990
43aae36e
PE
16991 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16992
2a47c44d 16993 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 16994 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 16995
a37c69bf
PE
16996 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16997 Check for integer overflow on size calculations.
16998
328ab8e7
PE
16999 * buffer.c (Fprevious_overlay_change): Remove var that is set
17000 but not used.
17001
e5a2a5cb
PE
17002 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17003 Remove vars that are set but not used.
8d84a6eb 17004 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 17005 (timer_check_2): Mark vars as initialized.
e5a2a5cb 17006
a60e5f68
PE
17007 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17008
f661cb61 17009 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 17010 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 17011
f0397f5a
PE
17012 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17013 that are set but not used.
17014
8664db06 17015 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 17016 if XCreateBitmapFromData fails (Bug#8410).
8664db06 17017
6abdaa4a
PE
17018 * xselect.c (x_get_local_selection, x_handle_property_notify):
17019 Remove vars that are set but not used.
17020
0ce7538d 17021 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 17022 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 17023
9ae848fc
PE
17024 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17025 Remove var that is set but not used.
0b918413
PE
17026 (scroll_bar_windows_size): Now size_t, not int.
17027 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
17028 Check for overflow.
9ae848fc 17029
a5a62657
PE
17030 * xfaces.c (realize_named_face): Remove vars that are set but not used.
17031 (map_tty_color) [!defined MSDOS]: Likewise.
17032
5c5cdd39
PE
17033 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17034
66ebf983
PE
17035 * coding.c: Remove vars that are set but not used.
17036 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17037 All callers changed.
17038 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17039 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17040 (decode_coding_charset): Remove vars that are set but not used.
17041
1be4d761
PE
17042 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17043 that is set but not used.
17044
47553fa8
PE
17045 * print.c (print_object): Remove var that is set but not used.
17046
1f7196bf 17047 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
17048 The gnulib version avoids calling malloc in the usual case,
17049 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17050 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17051 * filelock.c (current_lock_owner): Likewise.
17052 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17053 * sysdep.c: Include allocator.h, careadlinkat.h.
17054 (emacs_no_realloc_allocator): New static constant.
17055 (emacs_readlink): New function.
fdb61804
PE
17056 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17057 ../lib/careadlinkat.h.
d1fdcab7 17058
f84c17c7
SM
170592011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
17060
17061 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17062 first non-nil return value).
17063
ef3862ad
JD
170642011-04-03 Jan Djärv <jan.h.d@swipnet.se>
17065
17066 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17067 if not defined (Bug#8403).
17068
376a7006
JB
170692011-04-02 Juanma Barranquero <lekktu@gmail.com>
17070
17071 * xdisp.c (display_count_lines): Remove parameter `start',
17072 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17073 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17074 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17075 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17076 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17077 and thereabouts. All callers changed.
17078 (get_per_char_metric): Remove parameter `f', unused since
17079 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17080
6ca3801d
JM
170812011-04-02 Jim Meyering <meyering@redhat.com>
17082
17083 do not dereference NULL upon failed strdup
17084 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17085 (ns_get_family): Likewise.
17086
d8e2b5ba
JB
170872011-04-02 Juanma Barranquero <lekktu@gmail.com>
17088
17089 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17090
8c74fcbd
JD
170912011-04-02 Jan Djärv <jan.h.d@swipnet.se>
17092
17093 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17094 later (Bug#8403).
17095
7200d79c
SM
170962011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
17097
03408648 17098 Add lexical binding.
7200d79c 17099
03408648
SM
17100 * window.c (Ftemp_output_buffer_show): New fun.
17101 (Fsave_window_excursion):
17102 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17103
17104 * lread.c (lisp_file_lexically_bound_p): New function.
17105 (Fload): Bind Qlexical_binding.
17106 (readevalloop): Remove `evalfun' arg.
17107 Bind Qinternal_interpreter_environment.
17108 (Feval_buffer): Bind Qlexical_binding.
17109 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
17110 Mark as dynamic.
17111 (syms_of_lread): Declare `lexical-binding'.
17112
17113 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
17114
17115 * keyboard.c (eval_dyn): New fun.
17116 (menu_item_eval_property): Use it.
ca105506
SM
17117
17118 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 17119
03408648
SM
17120 * fns.c (concat, mapcar1): Accept byte-code-functions.
17121
17122 * eval.c (Fsetq): Handle lexical vars.
17123 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
17124 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
17125 (FletX, Flet): Obey lexical binding.
17126 (Fcommandp): Handle closures.
17127 (Feval): New `lexical' arg.
17128 (eval_sub): New function extracted from Feval. Use it almost
17129 everywhere where Feval was used. Look up vars in lexical env.
17130 Handle closures.
17131 (Ffunctionp): Move from subr.el.
17132 (Ffuncall): Handle closures.
17133 (apply_lambda): Remove `eval_flags'.
17134 (funcall_lambda): Handle closures and new byte-code-functions.
17135 (Fspecial_variable_p): New function.
17136 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
17137 but without exporting it to Lisp.
23aba0ea 17138
23aba0ea 17139 * doc.c (Fdocumentation, store_function_docstring):
03408648 17140 * data.c (Finteractive_form): Handle closures.
23aba0ea 17141
03408648
SM
17142 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
17143 interactive spec.
ba83908c 17144
04f2d78b
CB
17145 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
17146 New byte-codes.
03408648
SM
17147 (exec_byte_code): New function extracted from Fbyte_code to handle new
17148 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 17149
03408648 17150 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 17151
03408648 17152 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 17153
e2abce01
JB
171542011-03-31 Juanma Barranquero <lekktu@gmail.com>
17155
17156 * xdisp.c (redisplay_internal): Fix prototype.
17157
63696a73 171582011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 17159
63696a73 17160 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
17161 (try_scrolling): Use it when setting scroll_limit.
17162 Limit scrolling to 100 screen lines.
63696a73
EZ
17163 (redisplay_window): Even when falling back on "recentering",
17164 position point in the window according to scroll-conservatively,
17165 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
17166
17167 (try_scrolling): When point is above the window, allow searching
17168 as far as scroll_max, or one screenful, to compute vertical
17169 distance from PT to the scroll margin position. This prevents
17170 try_scrolling from unnecessarily failing when
17171 scroll-conservatively is set to a value slightly larger than the
17172 window height. Clean up the case of PT below the margin at bottom
17173 of window: scroll_max can no longer be INT_MAX. When aggressive
17174 scrolling is in use, don't let point enter the opposite scroll
17175 margin as result of the scroll.
17176 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
17177 threshold of 100 lines for never-recentering scrolling.
17178
e4cc2dfc
JB
171792011-03-31 Juanma Barranquero <lekktu@gmail.com>
17180
17181 * dispextern.h (move_it_by_lines):
17182 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17183 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
17184 (message_log_check_duplicate): Remove parameters `prev_bol' and
17185 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17186 (redisplay_internal): Remove parameter `preserve_echo_area',
17187 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
17188
17189 * indent.c (Fvertical_motion):
17190 * window.c (window_scroll_pixel_based, Frecenter):
17191 Don't pass `need_y_p' to `move_it_by_lines'.
17192
1c470562
SM
171932011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
17194
44f230aa
SM
17195 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17196 steal a few bits to be more compact.
17197 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17198 Remove unneeded casts.
17199
1c470562
SM
17200 * bytecode.c (Fbyte_code): CAR and CDR can GC.
17201
888adce9
ZK
172022011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
17203
17204 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17205 binding" message (bug#7967).
17206
f838ed7b
PE
172072011-03-30 Paul Eggert <eggert@cs.ucla.edu>
17208
77861b95
PE
17209 Fix more problems found by GCC 4.6.0's static checks.
17210
de6dbc14
PE
17211 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17212 Remove unused local var.
17213
f838ed7b
PE
17214 * editfns.c (Fmessage_box): Remove unused local var.
17215
792c7b2b
PE
17216 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17217 (note_mode_line_or_margin_highlight, note_mouse_highlight):
17218 Omit unused local vars.
c499e557 17219 * window.c (shrink_windows): Omit unused local var.
b01a1c29 17220 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
17221 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17222 Omit unused local var.
17223
ba0165e1
PE
17224 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17225 Don't assume string length fits in int.
32ad8845 17226 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 17227 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 17228
3c59b4c9
PE
17229 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17230 instead of alloca (Bug#8344).
17231
a3eed478 17232 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 17233 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 17234
eb4d412d
PE
17235 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17236
1658b401
PE
17237 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17238 concerns.
17239
17240 * term.c (produce_glyphless_glyph): Remove unnecessary test.
17241
17242 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 17243
9a2c6e05
PE
17244 * keyboard.c (syms_of_keyboard): Use the same style as later
17245 in this function when indexing through an array. This also
17246 works around GCC bug 48267.
17247
03d0a109
PE
17248 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17249
44f730c8
PE
17250 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17251
fe75f926
PE
17252 * chartab.c (sub_char_table_ref_and_range): Redo for slight
17253 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17254
ffa8c828
PE
17255 * keyboard.c, keyboard.h (num_input_events): Now size_t.
17256 This avoids undefined behavior on integer overflow, and is a bit
17257 more convenient anyway since it is compared to a size_t variable.
17258
c5101a77
PE
17259 Variadic C functions now count arguments with size_t, not int.
17260 This avoids an unnecessary limitation on 64-bit machines, which
17261 caused (substring ...) to crash on large vectors (Bug#8344).
17262 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
17263 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 17264 All variadic functions and their callers changed accordingly.
c5101a77
PE
17265 (struct gcpro.nvars): Now size_t, not int. All uses changed.
17266 * data.c (arith_driver, float_arith_driver): Likewise.
17267 * editfns.c (general_insert_function): Likewise.
17268 * eval.c (struct backtrace.nargs, interactive_p)
17269 (internal_condition_case_n, run_hook_with_args, apply_lambda)
17270 (funcall_lambda, mark_backtrace): Likewise.
17271 * fns.c (concat): Likewise.
17272 * frame.c (x_set_frame_parameters): Likewise.
17273 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
17274 0 if not found, not -1. All callers changed.
17275
dd3f25f7
PE
17276 * alloc.c (garbage_collect): Don't assume stack size fits in int.
17277 (stack_copy_size): Now size_t, not int.
17278 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
17279
461c2ab9
JB
172802011-03-28 Juanma Barranquero <lekktu@gmail.com>
17281
17282 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
17283 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17284 All callers changed.
17285
17286 * lisp.h (multibyte_char_to_unibyte):
17287 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
17288 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17289 * character.h (CHAR_TO_BYTE8):
17290 * cmds.c (internal_self_insert):
17291 * editfns.c (general_insert_function):
17292 * keymap.c (push_key_description):
17293 * search.c (Freplace_match):
17294 * xdisp.c (message_dolog, set_message_1): All callers changed.
17295
f6d62986
SM
172962011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
17297
17298 * keyboard.c (safe_run_hook_funcall): New function.
17299 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17300 don't set the hook to nil, but remove the offending function instead.
17301 (Qcommand_hook_internal): Remove, unused.
17302 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17303 Vcommand_hook_internal.
17304
17305 * eval.c (enum run_hooks_condition): Remove.
17306 (funcall_nil, funcall_not): New functions.
17307 (run_hook_with_args): Call each function through a `funcall' argument.
17308 Remove `cond' argument, now redundant.
17309 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17310 (Frun_hook_with_args_until_failure): Adjust accordingly.
17311 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17312
1db5b1ad
JB
173132011-03-28 Juanma Barranquero <lekktu@gmail.com>
17314
17315 * dispextern.h (string_buffer_position): Remove declaration.
17316
17317 * print.c (strout): Remove parameter `multibyte', unused since
17318 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
17319
17320 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17321 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17322 All callers changed.
17323
17324 * w32.c (_wsa_errlist): Use braces for struct initializers.
17325
17326 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17327 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17328 All callers changed.
17329 (string_buffer_position): Likewise. Also, make static (it's never
17330 used outside xdisp.c).
17331 (cursor_row_p): Remove parameter `w', unused since
17332 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
17333 (decode_mode_spec): Remove parameter `precision', introduced during
17334 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17335 All callers changed.
17336
5ffb62aa
JD
173372011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17338
17339 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17340
461c2ab9 173412011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
17342
17343 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17344 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17345 (ns_update_auto_hide_menu_bar): New functions.
17346 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17347 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17348 ns_constrain_all_frames.
17349 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17350 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17351
5c380ffb
JD
173522011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17353
17354 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17355
9af30bdf
GM
173562011-03-27 Glenn Morris <rgm@gnu.org>
17357
17358 * syssignal.h: Replace RETSIGTYPE with void.
17359 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17360 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17361 Replace SIGTYPE with void everywhere.
17362 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17363 * s/template.h (SIGTYPE): Remove commented out definition.
17364
e2abce01
JB
173652011-03-26 Eli Zaretskii <eliz@gnu.org>
17366
17367 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17368 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17369
f868cd8a
JB
173702011-03-26 Juanma Barranquero <lekktu@gmail.com>
17371
59eb0929
JB
17372 * w32.c (read_unc_volume): Use parameter `henum', instead of
17373 global variable `wget_enum_handle'.
17374
17375 * keymap.c (describe_vector): Remove parameters `indices' and
17376 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17377 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17378
f868cd8a
JB
17379 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17380
17381 * keyboard.c (timer_check): Remove parameter `do_it_now',
17382 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17383 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17384 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17385
17386 * keyboard.c (read_char):
17387 * w32menu.c (w32_menu_display_help):
17388 * xmenu.c (show_help_event, menu_help_callback):
17389 Adjust calls to `show_help_echo'.
17390
17391 * gtkutil.c (xg_maybe_add_timer):
17392 * keyboard.c (readable_events):
17393 * process.c (wait_reading_process_output):
17394 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17395
17396 * insdel.c (adjust_markers_gap_motion):
17397 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17398 (gap_left, gap_right): Don't call it.
17399
2ecf6fdb
CY
174002011-03-25 Chong Yidong <cyd@stupidchicken.com>
17401
17402 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17403 incurred during fontification.
17404
6b1f9ba4
JB
174052011-03-25 Juanma Barranquero <lekktu@gmail.com>
17406
17407 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17408 (DEFVAR_PER_BUFFER): Don't pass it.
17409
17410 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17411 (scrolling_window): Don't pass it.
17412
0f4a96b5
JB
174132011-03-25 Juanma Barranquero <lekktu@gmail.com>
17414
17415 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17416
17417 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17418 and `suffix'.
17419 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17420 of variables specific to SELinux and computation of `encoded_absname'.
17421
17422 * image.c (XPutPixel): Remove unused variable `height'.
17423
17424 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17425
17426 * unexw32.c (get_section_info): Remove unused variable `section'.
17427
17428 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17429 (system_process_attributes): Remove unused variable `sess'.
17430 (sys_read): Remove unused variable `err'.
17431
17432 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17433 (w32_wnd_proc): Remove unused variable `isdead'.
17434 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17435 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17436 (x_create_tip_frame): Remove unused variable `tem'.
17437
17438 * w32inevt.c (w32_console_read_socket):
17439 Remove unused variable `no_events'.
17440
17441 * w32term.c (x_draw_composite_glyph_string_foreground):
17442 Remove unused variable `width'.
17443
1149507c
JB
174442011-03-24 Juanma Barranquero <lekktu@gmail.com>
17445
17446 * w32term.c (x_set_glyph_string_clipping):
17447 Don't pass uninitialized region to CombineRgn.
17448
9c88f339
JB
174492011-03-23 Juanma Barranquero <lekktu@gmail.com>
17450
17451 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17452 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17453 (Fx_close_connection): Remove unused variable `i'.
17454
17455 * w32font.c (w32font_draw): Return number of glyphs.
17456 (w32font_open_internal): Remove unused variable `i'.
17457 (w32font_driver): Add missing initializer.
17458
17459 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17460 (fill_in_menu): Remove unused variable `items_added'.
17461
17462 * w32term.c (last_mouse_press_frame): Remove static global variable.
17463 (w32_clip_to_row): Remove unused variable `f'.
17464 (x_delete_terminal): Remove unused variable `i'.
17465
17466 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17467 (NOTHING): Remove unused static global variable.
17468 (uniscribe_check_otf): Remove unused variable `table'.
17469 (uniscribe_font_driver): Add missing initializers.
17470
dee091a3
JD
174712011-03-23 Julien Danjou <julien@danjou.info>
17472
17473 * term.c (Fsuspend_tty, Fresume_tty):
17474 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17475 * window.c (temp_output_buffer_show):
17476 * insdel.c (signal_before_change):
17477 * frame.c (Fhandle_switch_frame):
17478 * fileio.c (Fdo_auto_save):
17479 * emacs.c (Fkill_emacs):
17480 * editfns.c (save_excursion_restore):
17481 * cmds.c (internal_self_insert):
17482 * callint.c (Fcall_interactively):
17483 * buffer.c (Fkill_all_local_variables):
17484 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17485 Use Frun_hooks.
0f4a96b5 17486 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 17487 unconditionally since it does the check itself.
dee091a3 17488
2c520ab5 174892011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 17490
c9c49752
PE
17491 Fix more problems found by GCC 4.5.2's static checks.
17492
8abc3f12
PE
17493 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17494 the first time through the loop, since we know p0 < p1 then.
17495 This also avoids a gcc -Wstrict-overflow warning.
17496
a2d26660
PE
17497 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17498 leading to a memory leak, possible in functions like
17499 load_charset_map_from_file that can allocate an unbounded number
b12ef411 17500 of objects (Bug#8318).
a2d26660 17501
916c72e9
PE
17502 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17503 that could (at least in theory) be that large.
17504
19ab8a18
PE
17505 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17506 This is less likely to overflow, and avoids undefined behavior if
17507 overflow does occur. All callers changed. Use strtoul to scan
17508 for the unsigned long integer.
b7cbbd6f
PE
17509 (pint2hrstr): Simplify and tune code slightly.
17510 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 17511
f0641eff
PE
17512 * scroll.c (do_scrolling): Work around GCC bug 48228.
17513 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17514
7f650bb9
PE
17515 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17516 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
17517 (validate_x_resource_name): Simplify count usage.
17518 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 17519
37dd57d1
PE
17520 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17521 fail (Bug#8306).
81e56e61 17522
699979fc 17523 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 17524
401bf9b4
PE
17525 * process.c (Fmake_network_process): Use socklen_t, not int,
17526 where POSIX says socklen_t is required in portable programs.
17527 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 17528 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
17529 (Fmake_network_process, server_accept_connection):
17530 (wait_reading_process_output, read_process_output):
17531 Likewise.
17532
b93aacde
PE
17533 * process.c: Rename or move locals to avoid shadowing.
17534 (list_processes_1, Fmake_network_process):
17535 (read_process_output_error_handler, exec_sentinel_error_handler):
17536 Rename or move locals.
4dc343ee 17537 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 17538 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 17539 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 17540 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 17541 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 17542
af8a867c 17543 Make tparam.h and terminfo.c consistent.
44f230aa
SM
17544 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17545 Include tparam.h instead, since it declares them.
af8a867c
PE
17546 * cm.h (PC): Remove extern decl; tparam.h now does this.
17547 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17548 * terminfo.c: Include tparam.h, to check interfaces.
17549 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17550 (tparam): Adjust signature to match interface in tparam.h;
17551 this removes some undefined behavior. Check that outstring and len
17552 are zero, which they always are with Emacs.
17553 * tparam.h (PC, BC, UP): New extern decls.
17554
0248044d 17555 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 17556 (xftfont_open): Rename locals to avoid shadowing.
0248044d 17557
8ff096c1 17558 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
17559 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17560 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 17561 (ftfont_list): Remove unused local.
49eaafba
PE
17562 (get_adstyle_property, ftfont_pattern_entity):
17563 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17564 Rename locals to avoid shadowing.
8ff096c1 17565
e2be39f6
PE
17566 * xfont.c (xfont_list_family): Mark var as initialized.
17567
c9735e30
PE
17568 * xml.c (make_dom): Now static.
17569
8f5201ae
PE
17570 * composite.c (composition_compute_stop_pos): Rename local to
17571 avoid shadowing.
b246f932
PE
17572 (composition_reseat_it): Remove unused locals.
17573 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 17574 (composition_update_it): Mark var as initialized.
11b61122
PE
17575 (find_automatic_composition): Mark vars as initialized,
17576 with a FIXME (Bug#8290).
8f5201ae 17577
760fbc2c
PE
17578 character.h: Rename locals to avoid shadowing.
17579 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17580 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17581 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17582 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17583 to avoid shadowing.
17584
ff08eb85
PE
17585 * textprop.c (property_change_between_p): Remove; unused.
17586
fc7bf025
PE
17587 * intervals.c (interval_start_pos): Now static.
17588
235d7abc
PE
17589 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17590
44f230aa
SM
17591 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17592 Rename locals to avoid shadowing.
3e7d6594 17593
50060332
PE
17594 * sound.c (wav_play, au_play, Fplay_sound_internal):
17595 Fix pointer signedness.
d01f234b 17596 (alsa_choose_format): Remove unused local var.
c83b8872
PE
17597 (wav_play): Initialize a variable to 0, to prevent undefined
17598 behavior (Bug#8278).
50060332 17599
c4fc4e30
PE
17600 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17601
918436ed
PE
17602 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17603
c939f91b
PE
17604 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17605 clobbering (Bug#8298).
b9c7f648
PE
17606 * sysdep.c (sys_subshell): Likewise.
17607 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 17608
6bd8c144
PE
17609 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17610 This should get cleaned up, so that child_setup has the
17611 same signature on all platforms.
17612
7710357c 17613 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 17614 (relocate_fd): Rename locals to avoid shadowing.
7710357c 17615
c59da222
CY
176162011-03-22 Chong Yidong <cyd@stupidchicken.com>
17617
17618 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17619 not to be necessary, and produces flickering.
17620
66b87493
GM
176212011-03-20 Glenn Morris <rgm@gnu.org>
17622
17623 * config.in: Remove file.
17624
45b6f6d5
JB
176252011-03-20 Juanma Barranquero <lekktu@gmail.com>
17626
17627 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17628 are now in src/globals.h.
17629 (syms_of_minibuf): Remove spurious & from previous change.
17630
cd394be1 176312011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
17632
17633 * minibuf.c (completing-read-function): New variable.
17634 (completing-read-default): Rename from completing-read.
17635 (completing-read): Call completing-read-function.
17636
b14e3e21
CY
176372011-03-19 Juanma Barranquero <lekktu@gmail.com>
17638
17639 * xfaces.c (Fx_load_color_file):
17640 Read color file from absolute filename (bug#8250).
17641
f2b726e6
JB
176422011-03-19 Juanma Barranquero <lekktu@gmail.com>
17643
17644 * makefile.w32-in: Update dependencies.
17645
09f6ff02
EZ
176462011-03-17 Eli Zaretskii <eliz@gnu.org>
17647
17648 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17649
29a6015a
PE
176502011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17651
a3a6c54e
PE
17652 Fix more problems found by GCC 4.5.2's static checks.
17653
b766f867
PE
17654 * process.c (make_serial_process_unwind, send_process_trap):
17655 (sigchld_handler): Now static.
17656
be02381c
PE
17657 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17658 That way, the code declares only the vars that it needs.
17659 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17660 * s/cygwin.h (PTY_ITERATION): Likewise.
17661 * s/darwin.h (PTY_ITERATION): Likewise.
17662 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17663
57048744
PE
17664 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17665 * process.c (allocate_pty): Don't declare stb unless it's needed.
17666
7914961c 17667 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
17668 (CONSTANTLIM): Remove; unused.
17669 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17670 Define only if needed.
7914961c 17671
b3967b18
PE
17672 * unexelf.c (unexec): Name an expression,
17673 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
17674 Use a different way to cause a compilation error if anyone uses
17675 n rather than nn, a way that does not involve shadowing.
73366a00 17676 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 17677
29a6015a
PE
17678 * deps.mk (unexalpha.o): Remove; unused.
17679
43cfc33e 17680 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 17681 * unexec.h: New file.
ce701a33
PE
17682 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17683 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17684 Depend on unexec.h.
17685 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17686 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17687 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 17688 Change as necessary to match prototype in unexec.h.
ce701a33 17689
01f44d5a
PE
17690 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17691 shadowing.
4f63c6bb 17692 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 17693
a6670b0b
PE
17694 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17695 Rename locals to avoid shadowing.
17696
cef2010d 17697 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 17698 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 17699
d4d7173a
PE
17700 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17701
f08b802a
PE
17702 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17703 warning when compiling print.c.
17704
3ddb0639
PE
17705 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17706 instead of using an uninitialized var.
5ad03b97 17707 (font_sort_entities): Mark var as initialized.
3ddb0639 17708
170a2692
PE
17709 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17710
e663c700
PE
17711 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17712 pointers to constants.
89bc529a 17713 (font_parse_fcname): Remove unused vars.
7b81e2d0 17714 (font_delete_unmatched): Now static.
ea838e10 17715 (font_get_spec): Remove; unused.
13a547c6
PE
17716 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17717 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17718 Rename or move locals to avoid shadowing.
e663c700 17719
2a80c887 17720 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 17721 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 17722
1384fa33 17723 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 17724 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 17725
8b2c52e9
PE
17726 * alloc.c (mark_backtrace): Move decl from here ...
17727 * lisp.h: ... to here, so that it can be checked.
17728
475545b5 17729 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 17730 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
17731 (lisp_indirect_variable): Name an expression,
17732 to avoid gcc -Wbad-function-cast warning.
1faed8ae 17733 (Fdefvar): Rename locals to avoid shadowing.
475545b5 17734
b1349114 17735 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 17736 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 17737 Use const pointer when appropriate.
b1349114 17738
a2928364
PE
17739 * lisp.h (get_system_name, get_operating_system_release):
17740 Move decls here, to check interfaces.
17741 * process.c (get_operating_system_release): Move decl to lisp.h.
17742 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
17743 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17744 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17745 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
17746 (Fformat_time_string, Fencode_time, Finsert_char):
17747 (Ftranslate_region_internal, Fformat):
17748 Rename or remove local vars to avoid shadowing.
9710023e 17749 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 17750
a415e694
PE
17751 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17752 avoid shadowing.
17753
8ef4622d
PE
17754 * lisp.h (eassert): Check that the argument compiles, even if
17755 ENABLE_CHECKING is not defined.
17756
946f9a5b
PE
17757 * data.c (Findirect_variable): Name an expression, to avoid
17758 gcc -Wbad-function-cast warning.
112396d6 17759 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 17760 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
17761 (Fmake_variable_buffer_local, Fmake_local_variable):
17762 Mark variables as initialized.
52746918 17763 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 17764
e5aab7e7 17765 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
17766 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17767 Rename locals to avoid shadowing.
dff45157
PE
17768 (mark_stack): Move local variables into the #ifdef region where
17769 they're used.
7bc26fdb
PE
17770 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17771 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17772 needed otherwise.
17773 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17774 (GC_STRING_CHARS): Remove; not used.
d40d4be1 17775 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 17776
e5aab7e7
PE
17777 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17778 avoids undefined behavior in theory.
17779
4da60324
PE
17780 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17781
88043301
PE
17782 Use functions, not macros, for up- and down-casing (Bug#8254).
17783 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17784 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17785 to use the following functions instead of these macros.
17786 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17787 EMACS_INT, since callers assume the returned value fits in int.
17788 (upcase1): Likewise, for UPCASE_TABLE.
17789 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 17790 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 17791 the race-condition problem in the old DOWNCASE.
88043301 17792
19ed5445
PE
17793 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17794 Rename locals to avoid shadowing.
17795 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
17796 (regex_compile, re_search_2, re_match_2_internal):
17797 Remove unused local vars.
952db0d7
PE
17798 (FREE_VAR): Rewrite so as not to use empty "else",
17799 which gcc can warn about.
da053e48 17800 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
17801 (RETALLOC_IF): Define only if needed.
17802 (WORDCHAR_P): Likewise. This one is never needed, but is used
17803 only in a comment talking about a compiler bug, so put inside
17804 the #if 0 of that comment.
17805 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17806 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17807 Remove; unused.
19ed5445 17808
1f3561e4 17809 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
17810 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17811 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 17812
ded6f8f7
PE
17813 * search.c (simple_search): Remove unused var.
17814
dbd37a95
PE
17815 * dired.c (compile_pattern): Move decl from here ...
17816 * lisp.h: ... to here, so that it can be checked.
17817 (struct re_registers): New forward decl.
17818
7e47afad
PE
17819 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17820
85f24f61
PE
17821 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17822 All uses changed.
17823 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17824 Rename locals to avoid shadowing.
5671df8f 17825 (Fvertical_motion): Mark locals as initialized.
85f24f61 17826
181aa2be 17827 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 17828 (casify_region): Mark local as initialized.
181aa2be 17829
930d429c
PE
17830 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17831
7082eac6
PE
17832 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17833 New macros, so that the caller can use some names other than
17834 gcpro1, gcpro2, etc.
17835 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17836 of the new macros.
17837 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17838 argument, for consistency with GCPRO2_VAR, etc: it is now the
17839 prefix of the variable, not the variable itself. All uses
17840 changed.
38b2c076
PE
17841 * dired.c (directory_files_internal, file_name_completion):
17842 Rename locals to avoid shadowing.
17843
15206ed9
PE
17844 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17845 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17846 dired.c's scmp function, had undefined behavior.
17847 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17848 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17849 * buffer.h: ... to here, because these macros use current_buffer,
17850 and the new implementation with inline functions needs to have
17851 current_buffer in scope now, rather than later when the macros
17852 are used.
17853 (downcase, upcase1): New static inline functions.
17854 (DOWNCASE, UPCASE1): Reimplement using these functions.
17855 This avoids undefined behavior in expressions like
17856 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17857 from race conditions in accessing the global variables
17858 case_temp1 and case_temp2.
17859 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17860 * lisp.h (case_temp1, case_temp2): Remove their decls.
17861 * character.h (ASCII_CHAR_P): Move from here ...
17862 * lisp.h: ... to here, so that the inline functions mentioned
17863 above can use them.
17864
4a6bea26
PE
17865 * dired.c (directory_files_internal_unwind): Now static.
17866
f14b7e14
PE
17867 * fileio.c (file_name_as_directory, directory_file_name):
17868 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17869 Now static.
2893f146
PE
17870 (file_name_as_directory): Use const pointers when appropriate.
17871 (Fexpand_file_name): Likewise. In particular, newdir might
17872 point at constant storage, so make it a const pointer.
fd4ead52 17873 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
17874 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17875 signedness issues.
f839df0c
PE
17876 (Fset_file_times, Finsert_file_contents, auto_save_error):
17877 Rename locals to avoid shadowing.
f14b7e14 17878
5716756e 17879 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
17880 (Ftry_completion, Fall_completions): Rename or remove locals
17881 to avoid shadowing.
5716756e 17882
b4c3046a
PE
17883 * marker.c (bytepos_to_charpos): Remove; unused.
17884
b45db522
PE
17885 * lisp.h (verify_bytepos, count_markers): New decls,
17886 so that gcc does not warn that these functions aren't declared.
17887
85876d07
PE
17888 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17889 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 17890 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 17891 (copy_text): Remove unused local var.
85876d07 17892
03d78a21 17893 * filelock.c (within_one_second): Now static.
b3dd38ab 17894 (lock_file_1): Rename local to avoid shadowing.
03d78a21 17895
5df8f01b
PE
17896 * buffer.c (fix_overlays_before): Mark locals as initialized.
17897 (fix_start_end_in_overlays): Likewise. This function should be
17898 simplified by using pointers-to-pointers, but that's a different
17899 matter.
b1d876f1 17900 (switch_to_buffer_1): Now static.
8f54f30a
PE
17901 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17902 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 17903
a70072c9 17904 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 17905 Fix pointer signedness issue.
edced198
PE
17906 (sys_subshell): Mark local as volatile if checking for lint,
17907 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 17908 (MAXPATHLEN): Define only if needed.
a70072c9 17909
a0977c44
PE
17910 * process.c (serial_open, serial_configure): Move decls from here ...
17911 * systty.h: ... to here, so that they can be checked.
17912
a884fdcc
PE
17913 * fns.c (get_random, seed_random): Move extern decls from here ...
17914 * lisp.h: ... to here, so that they can be checked.
17915
604efe86 17916 * sysdep.c (reset_io): Now static.
b8950c94 17917 (wait_for_termination_signal): Remove; unused.
604efe86 17918
38fc62d9
PE
17919 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17920 (copy_keymap_item, append_key, push_text_char_description):
17921 Now static.
1004a21a 17922 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 17923 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
17924 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17925 (describe_map_tree):
17926 Rename locals to avoid shadowing.
38fc62d9 17927
2f2650da
PE
17928 * keyboard.c: Declare functions static if they are not used elsewhere.
17929 (echo_char, echo_dash, cmd_error, top_level_2):
17930 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
17931 (read_char, kbd_buffer_get_event, make_lispy_position):
17932 (make_lispy_event, make_lispy_movement, apply_modifiers):
17933 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17934 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17935 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 17936 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 17937 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 17938
a053e86c 17939 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
17940 (mark_kboards): Move decl here ...
17941 * alloc.c (mark_kboards): ... from here.
a053e86c 17942
4752793e
PE
17943 * lisp.h (force_auto_save_soon): New decl.
17944
74f10ca7 17945 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
17946 (DEFINE_DUMMY_FUNCTION): New macro.
17947 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17948 Use it.
c03cd23f
PE
17949 (main): Add casts to avoid warnings
17950 if GCC considers string literals to be constants.
74f10ca7 17951
022e70d4
PE
17952 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17953
59d6fe83
PE
17954 * dbusbind.c: Pointer signedness fixes.
17955 (xd_signature, xd_append_arg, xd_initialize):
17956 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17957 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17958 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17959 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17960
78320123
PE
17961 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17962 if GCC considers string literals to be constants.
49cebcca 17963 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 17964
35ac2a97
SM
179652011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17966
fb103ca9
SM
17967 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17968 (print_preprocess, print_object): New macro to fix last change.
17969
35ac2a97
SM
17970 * print.c (print_preprocess): Don't forget font objects.
17971
62973b41
JB
179722011-03-16 Juanma Barranquero <lekktu@gmail.com>
17973
17974 * emacs.c (USAGE3): Doc fixes.
17975
0e48bb22
AS
179762011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17977
17978 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17979 structure.
17980
7684e57b
JB
179812011-03-14 Juanma Barranquero <lekktu@gmail.com>
17982
17983 * lisp.h (VWindow_system, Qfile_name_history):
17984 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17985 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17986 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17987
17988 * w32select.c: Don't #include "keyboard.h".
c96bbc66 17989 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
17990
17991 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17992 * w32console.c (detect_input_pending, read_input_pending)
17993 (encode_terminal_code):
17994 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17995 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17996 (w32_system_caret_y, Qfile_name_history):
17997 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17998 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17999 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18000 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18001 * w32proc.c (Qlocal, report_file_error):
18002 * w32term.c (Vwindow_system, updating_frame):
18003 * w32uniscribe.c (initialized, uniscribe_font_driver):
18004 Remove unneeded extern declarations.
18005
2aa46d6c
CY
180062011-03-14 Chong Yidong <cyd@stupidchicken.com>
18007
c96bbc66 18008 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 18009
cffc6f3b
CY
180102011-03-13 Chong Yidong <cyd@stupidchicken.com>
18011
18012 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18013 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18014 These macros can no longer be used for assignment.
18015
44f230aa
SM
18016 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18017 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
18018 (record_buffer_markers, fetch_buffer_markers): New functions for
18019 recording and fetching special buffer markers.
18020 (set_buffer_internal_1, set_buffer_temp): Use them.
18021
18022 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18023
18024 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18025
18026 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18027 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
18028
18029 * xdisp.c (hscroll_window_tree):
18030 (reconsider_clip_changes): Use PT instead of BUF_PT.
18031
d251f04b
EZ
180322011-03-13 Eli Zaretskii <eliz@gnu.org>
18033
18034 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18035 $(EMACS_ROOT)/lib/intprops.h.
18036
f0c77cd1
PE
180372011-03-13 Paul Eggert <eggert@cs.ucla.edu>
18038
3eca4629
PE
18039 Fix more problems found by GCC 4.5.2's static checks.
18040
7c86ee98
PE
18041 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18042 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
18043 (xg_free_frame_widgets): Make it clear that a local variable is
18044 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
18045 (gdk_window_get_screen): Make it clear that this macro is needed
18046 only if USE_GTK_TOOLTIP.
1e5524e7
PE
18047 (int_gtk_range_get_value): New function, which avoids a diagnostic
18048 from gcc -Wbad-function-cast.
18049 (xg_set_toolkit_scroll_bar_thumb): Use it.
18050 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18051 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
18052 (get_utf8_string, xg_get_file_with_chooser):
18053 Rename locals to avoid shadowing.
18054 (create_dialog): Move locals to avoid shadowing.
7c86ee98 18055
41729b81
PE
18056 * xgselect.c (xg_select): Remove unused var.
18057
f0c77cd1
PE
18058 * image.c (four_corners_best): Mark locals as initialized.
18059 (gif_load): Initialize transparent_p to zero (Bug#8238).
18060 Mark another local as initialized.
ec6cf4c6 18061 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 18062
ce0ad53d 18063 * image.c (clear_image_cache): Now static.
d5d5a617 18064 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 18065 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
18066 (x_edge_detection): Remove unnecessary cast that
18067 gcc -Wbad-function-cast diagnoses.
2037898d 18068 (gif_load): Fix pointer signedness.
6ae141d6
PE
18069 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18070 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 18071
33383987 180722011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 18073
d32df629
PE
18074 Improve quality of tests for time stamp overflow.
18075 For example, without this patch (encode-time 0 0 0 1 1
18076 1152921504606846976) returns the obviously-bogus value (-948597
18077 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18078 reports time overflow. See
18079 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
18080 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18081 * editfns.c: Include limits.h and intprops.h.
18082 (TIME_T_MIN, TIME_T_MAX): New macros.
18083 (time_overflow): Move earlier, to before first use.
18084 (hi_time, lo_time): New functions, for an accurate test for
18085 out-of-range times.
18086 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18087 (Fget_internal_run_time): Don't assume time_t fits in int.
18088 (make_time): Use list2 instead of Fcons twice.
18089 (Fdecode_time): More accurate test for out-of-range times.
18090 (check_tm_member): New function.
18091 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
18092 (lisp_time_argument): Don't rely on undefined left-shift and
18093 right-shift behavior when checking for time stamp overflow.
8be6f318 18094
fe31d94c
PE
18095 * editfns.c (time_overflow): New function, refactoring common code.
18096 (Fformat_time_string, Fdecode_time, Fencode_time):
18097 (Fcurrent_time_string): Use it.
18098
8be6f318
PE
18099 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18100 * dired.c (make_time): Move to ...
18101 * editfns.c (make_time): ... here.
18102 * systime.h: Note the move.
18103
09d9db2c 181042011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 18105
126bc0dc
YM
18106 * fringe.c (update_window_fringes): Remove unused variables.
18107
c47cbdfd
YM
18108 * unexmacosx.c (copy_data_segment): Also copy __got section.
18109 (Bug#8223)
18110
7ac80be9
EZ
181112011-03-12 Eli Zaretskii <eliz@gnu.org>
18112
c96bbc66 18113 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
18114 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
18115 Constify `char *' arguments and their references according to
18116 prototypes in tparam.h.
18117
ecb0f94d 18118 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 18119
7ac80be9
EZ
18120 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
18121 Adapt all references accordingly.
18122
18123 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
18124
ef1fd07e
TT
181252011-03-11 Tom Tromey <tromey@redhat.com>
18126
18127 * buffer.c (syms_of_buffer): Remove obsolete comment.
18128
7ef4b50c
EZ
181292011-03-11 Eli Zaretskii <eliz@gnu.org>
18130
18131 * termhooks.h (encode_terminal_code): Declare prototype.
18132
18133 * msdos.c (encode_terminal_code): Don't declare prototype.
18134
18135 * term.c (encode_terminal_code): Now external again, used by
18136 w32console.c and msdos.c.
18137
44f230aa
SM
18138 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
18139 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 18140
4b1ec863 181412011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 18142
1714f52b 18143 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 18144
4b1ec863
PE
18145 * fringe.c (update_window_fringes): Mark locals as initialized
18146 (Bug#8227).
18147 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 18148
524c7aa6
PE
18149 * alloc.c (mark_fringe_data): Move decl from here ...
18150 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
18151 to check its interface.
18152 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
18153
a5c0af81 18154 * fontset.c (free_realized_fontset): Now static.
7519b8cd 18155 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 18156 (fontset_font): Mark local as initialized.
a9a06e0b 18157 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 18158
b4716021
PE
18159 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
18160
811e9bac 18161 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 18162 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
18163 (x_own_selection, Fx_disown_selection_internal): Rename locals
18164 to avoid shadowing.
18165 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 18166
7e3ab302
PE
18167 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
18168 so that the caller can use some name other than gcpro1.
18169 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
18170 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18171 (Fx_backspace_delete_keys_p):
18172 Use them to avoid shadowing, and rename vars to avoid shadowing.
18173 (x_decode_color, x_set_name, x_window): Now static.
6b437900 18174 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 18175 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
18176 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18177 Remove unused locals.
7e3ab302
PE
18178 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18179 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18180 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18181 macros.
f78faa98 18182
e2b13473
PE
18183 * xterm.h (x_mouse_leave): New decl.
18184
77f23912
PE
18185 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18186 Remove unused functions.
cdf4ba58
PE
18187 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18188 (x_calc_absolute_position): Now static.
7411c686 18189 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 18190 Don't declare local "event" unless it's used.
ed7bf3a5
PE
18191 (x_iconify_frame, x_free_frame_resources): Don't declare locals
18192 unless they are used.
38d0b34a
PE
18193 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18194 (x_fatal_error_signal): Remove; not used.
a6067996
PE
18195 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18196 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18197 (x_error_catcher, x_connection_closed, x_error_handler):
18198 (x_error_quitter, xembed_send_message, x_iconify_frame):
18199 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 18200 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 18201 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 18202
44f230aa
SM
18203 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18204 Rename or move locals to avoid shadowing.
6b463e58 18205 (tty_defined_color, merge_face_heights): Now static.
5967d051 18206 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
18207 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18208 does not deduce is never used uninitialized.
73719eba
PE
18209 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18210 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 18211
426994c3 18212 * terminal.c (store_terminal_param): Now static.
5489860b 18213
032f1620 18214 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 18215 (set_frame_menubar): Remove unused local.
d4323972 18216 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
18217 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18218 since they might point to immutable storage.
281585b0
PE
18219 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18220 since it's unused otherwise.
032f1620 18221
367c19e5 18222 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 18223 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
18224 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18225 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 18226 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
18227 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18228 does not deduce are never used uninitialized.
70739cbe 18229
07b48fa9
PE
18230 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18231
8868a238 18232 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
18233 * window.c (window_loop, size_window):
18234 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 18235
7e5cf297 18236 * window.c (display_buffer): Now static.
d6550a9f
PE
18237 (size_window): Mark variables that gcc -Wuninitialized
18238 does not deduce are never used uninitialized.
a586633d
PE
18239 * window.h (check_all_windows): New decl, to forestall
18240 gcc -Wmissing-prototypes diagnostic.
5b555da1 18241 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 18242
f6095868
PE
18243 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18244 shadowing.
18245 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
18246 Include <limits.h>.
18247 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18248 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
18249 (load_charset_map): Mark variables that gcc -Wuninitialized
18250 does not deduce are never used uninitialized.
53df7c11 18251 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 18252
f38b440c
PE
18253 * coding.c (coding_set_source, coding_set_destination):
18254 Use "else { /* comment */ }" rather than "else /* comment */;"
18255 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
18256 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18257 a block, when the outer 'i' will do.
18258 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18259 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18260 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18261 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
18262 (Fdecode_sjis_char, Fdefine_coding_system_internal):
18263 Rename locals to avoid shadowing.
18264 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
18265 * coding.c (emacs_mule_char, encode_invocation_designation):
18266 Now static, since they're not used elsewhere.
413bb2db 18267 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 18268 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
18269 (decode_coding_emacs_mule): Mark variables that gcc
18270 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
18271 (detect_coding_iso_2022): Initialize a local variable that might
18272 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 18273 this initialization is needed. (Bug#8211)
5f58e762
PE
18274 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
18275 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
18276 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
18277 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
18278 Remove unused macros.
f38b440c 18279
232b38b9 18280 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 18281 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 18282 * character.c (string_count_byte8): Likewise.
232b38b9 18283
fb90da1b
PE
18284 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
18285 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
18286
fb93dbc2
PE
18287 * chartab.c (copy_sub_char_table): Now static, since it's not used
18288 elsewhere.
5c156ace
PE
18289 (sub_char_table_ref_and_range, char_table_ref_and_range):
18290 Rename locals to avoid shadowing.
bbcd0949 18291 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 18292
7d3b3862 18293 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 18294 (BIDI_BOB): Remove unused macro.
7d3b3862 18295
6be7d3da
PE
18296 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18297 deduce are never used uninitialized.
c2ed9c8b 18298 * term.c (encode_terminal_code): Likewise.
6be7d3da 18299
75f8807f 18300 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 18301
50938595
PE
18302 * tparam.h: New file.
18303 * term.c, tparam.h: Include it.
18304 * deps.mk (term.o, tparam.o): Depend on tparam.h.
18305 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18306 Move these decls to tparam.h, and make them agree with what
18307 is actually in tparam.c. The previous trick of using incompatible
18308 decls in different modules does not conform to the C standard.
18309 All callers of tparam changed to use tparam's actual API.
18310 * tparam.c (tparam1, tparam, tgoto):
18311 Use const pointers where appropriate.
18312
fbceeba2
PE
18313 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18314 * cm.h (struct cm): Likewise.
18315 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18316 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18317 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18318 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18319 (turn_on_face, init_tty): Likewise.
18320 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 18321
7f3f1250
PE
18322 * term.c (term_mouse_position): Rename local to avoid shadowing.
18323
e6ca6543
PE
18324 * alloc.c (mark_ttys): Move decl from here ...
18325 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18326
c40f8d15
AS
183272011-03-11 Andreas Schwab <schwab@linux-m68k.org>
18328
18329 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18330
cfe0661d
JB
183312011-03-09 Juanma Barranquero <lekktu@gmail.com>
18332
18333 * search.c (compile_pattern_1): Remove argument regp, unused since
18334 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18335 (compile_pattern): Don't pass it.
18336
0afb4571
J
183372011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18338
18339 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18340 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18341 for ! HAVE_GTK3.
18342 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18343
18344 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18345
18346 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18347 gdk_window_get_screen, gdk_window_get_geometry,
18348 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18349 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18350 (xg_get_pixbuf_from_pixmap): New function.
18351 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18352 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18353 Call xg_get_pixbuf_from_pixmap instead of
18354 gdk_pixbuf_get_from_drawable.
18355 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18356 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18357 (xg_check_special_colors): Use GtkStyleContext and its functions
18358 for HAVE_GTK3.
18359 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18360 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18361 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
18362 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18363 Call gtk_widget_get_preferred_size.
0afb4571
J
18364 (xg_frame_resized): gdk_window_get_geometry only takes 5
18365 parameters.
44f230aa
SM
18366 (xg_win_to_widget, xg_event_is_for_menubar):
18367 Call gdk_x11_window_lookup_for_display.
0afb4571
J
18368 (xg_set_widget_bg): New function.
18369 (delete_cb): New function.
895009e1 18370 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 18371 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
18372 (xg_set_background_color): Call xg_set_widget_bg.
18373 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18374 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18375 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18376 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18377 if ! HAVE_GTK3.
18378 (update_frame_tool_bar): Call gtk_widget_hide.
18379 (xg_initialize): Use GDK_KEY_g.
18380
18381 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18382 if ! HAVE_GTK3
18383 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18384
18385 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18386 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18387 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18388
1c2cc4ef
JB
183892011-03-08 Juanma Barranquero <lekktu@gmail.com>
18390
18391 * w32xfns.c (select_palette): Check success of RealizePalette against
18392 GDI_ERROR, not zero.
18393
33383987 18394See ChangeLog.11 for earlier changes.
aac0c6e3
MR
18395
18396;; Local Variables:
18397;; coding: utf-8
aac0c6e3
MR
18398;; End:
18399
2f097256 18400 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
18401
18402 This file is part of GNU Emacs.
18403
18404 GNU Emacs is free software: you can redistribute it and/or modify
18405 it under the terms of the GNU General Public License as published by
18406 the Free Software Foundation, either version 3 of the License, or
18407 (at your option) any later version.
18408
18409 GNU Emacs is distributed in the hope that it will be useful,
18410 but WITHOUT ANY WARRANTY; without even the implied warranty of
18411 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18412 GNU General Public License for more details.
18413
18414 You should have received a copy of the GNU General Public License
18415 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.