Mark tiny change from author without assignment
[bpt/emacs.git] / src / ChangeLog
CommitLineData
090cf9db
SM
12012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
4
5 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
6 case for the special 0 coding-system.
7
8 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
9 (Fmake_overlay): Remove redundant tests.
64edc777 10 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 11
81550bf4
JB
122012-10-02 Juanma Barranquero <lekktu@gmail.com>
13
14 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
15 Update dependencies.
16
aa1ba90e
PE
172012-10-01 Paul Eggert <eggert@cs.ucla.edu>
18
19 Fix a malloc race condition involving strsignal.
20 A signal can arrive in the middle of a malloc, and Emacs's signal
21 handler can invoke strsignal, which can invoke malloc, which is
22 not portable. This race condition bug makes Emacs hang on GNU/Linux.
23 Fix it by altering the signal handler so that it does not invoke
24 strsignal.
25 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
26 * process.c (status_message): Use const pointer, in case strsignal
27 is #defined to safe_strsignal.
28 * sysdep.c (sys_siglist, init_signals): Always define and
29 initialize a substitute sys_siglist if the system does not define
30 one, even if HAVE_STRSIGNAL.
31 (safe_strsignal): Rename from strsignal. Always define,
32 using sys_siglist. Return a const pointer.
33 * syssignal.h (safe_strsignal): New decl.
34 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
35
ace917bd
EZ
362012-10-01 Eli Zaretskii <eliz@gnu.org>
37
38 * w32proc.c (timer_loop): Fix code that waits for timer
39 expiration, to avoid high CPU usage.
40
9eb71b9c
SM
412012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
42
43 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
44 (sweep_weak_table): Remove redundant prototypes.
45
b3317662
FP
462012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
47
48 * emacs.c: Move the inclusion of TERM_HEADER after including
49 windows.h on WINDOWSNT. This avoids compilation problems with
50 MSVC.
51
f0e5f225
EZ
522012-10-01 Eli Zaretskii <eliz@gnu.org>
53
2d7d1608
EZ
54 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
55 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
56 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
57 as the previous version used 'void *'.
58
59 * ralloc.c (ROUNDUP): Fix last change.
60 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
61 'size_t'.
62
f0e5f225
EZ
63 * w32proc.c <disable_itimers>: New static flag.
64 (init_timers): Initialize it to zero, after creating the critical
65 sections used by the timer threads.
66 (term_timers): Set to 1 before deleting the critical sections.
67 (getitimer, setitimer): If disable_itimers is non-zero, return an
68 error indication without doing anything. Reported by Fabrice
69 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
70 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
71 return results.
72 [!HAVE_SETITIMER]: Behave as the previous version that didn't
73 support timers.
f0e5f225
EZ
74
75 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
76 term_ntproc after all the other bookkeeping, to get timers working
77 as long as possible.
78
82ef37c1
PE
792012-10-01 Paul Eggert <eggert@cs.ucla.edu>
80
b3a4c387
PE
81 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
82 Suggested by Juri Linkov in
83 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
84
b0ab8123
PE
85 Prefer plain 'static' to 'static inline' (Bug#12541).
86 With static functions, modern compilers inline pretty well by
87 themselves; advice from programmers often hurts as much as it helps.
88 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
89 this change shrinks the text size of the Emacs executable by 1.1%
90 without affecting CPU significantly in my benchmark.
91 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
92 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
93 (mark_maybe_object, mark_maybe_pointer, bounded_number):
94 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
95 (bset_auto_fill_function, bset_auto_save_file_format)
96 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
97 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
98 (bset_cache_long_line_scans, bset_case_fold_search)
99 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
100 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
101 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
102 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
103 (bset_header_line_format, bset_indicate_buffer_boundaries)
104 (bset_indicate_empty_lines, bset_invisibility_spec)
105 (bset_left_fringe_width, bset_major_mode, bset_mark)
106 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
107 (bset_name, bset_overwrite_mode, bset_pt_marker)
108 (bset_right_fringe_width, bset_save_length)
109 (bset_scroll_bar_width, bset_scroll_down_aggressively)
110 (bset_scroll_up_aggressively, bset_selective_display)
111 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
112 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
113 (set_buffer_overlays_after):
114 * category.c (bset_category_table):
115 * charset.c (read_hex):
116 * coding.c (produce_composition, produce_charset)
117 (handle_composition_annotation, handle_charset_annotation)
118 (char_encodable_p):
119 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
120 (assign_row, set_frame_matrix_frame, make_current)
121 (add_row_entry):
122 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
123 * fns.c (maybe_resize_hash_table):
124 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
125 * gmalloc.c (register_heapinfo):
126 * image.c (lookup_image_type):
127 * intervals.c (set_interval_object, set_interval_left)
128 (set_interval_right, copy_interval_parent, rotate_right)
129 (rotate_left, balance_possible_root_interval):
130 * keyboard.c (kset_echo_string, kset_kbd_queue)
131 (kset_keyboard_translate_table, kset_last_prefix_arg)
132 (kset_last_repeatable_command, kset_local_function_key_map)
133 (kset_overriding_terminal_local_map, kset_real_last_command)
134 (kset_system_key_syms, clear_event, set_prop):
135 * lread.c (digit_to_number):
136 * marker.c (attach_marker, live_buffer, set_marker_internal):
137 * nsterm.m (ns_compute_glyph_string_overhangs):
138 * process.c (pset_buffer, pset_command)
139 (pset_decode_coding_system, pset_decoding_buf)
140 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
141 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
142 (pset_status, pset_tty_name, pset_type, pset_write_queue):
143 * syntax.c (bset_syntax_table, dec_bytepos):
144 * terminal.c (tset_param_alist):
145 * textprop.c (interval_has_some_properties)
146 (interval_has_some_properties_list):
147 * window.c (wset_combination_limit, wset_dedicated)
148 (wset_display_table, wset_hchild, wset_left_fringe_width)
149 (wset_left_margin_cols, wset_new_normal, wset_new_total)
150 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
151 (wset_right_fringe_width, wset_right_margin_cols)
152 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
153 (wset_vertical_scroll_bar_type, wset_window_parameters):
154 * xdisp.c (wset_base_line_number, wset_base_line_pos)
155 (wset_column_number_displayed, wset_region_showing)
156 (window_box_edges, run_window_scroll_functions)
157 (append_glyph_string_lists, prepend_glyph_string_lists)
158 (append_glyph_string, set_glyph_string_background_width)
159 (append_glyph, append_composite_glyph)
160 (take_vertical_position_into_account):
161 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
162 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
163 (lface_hash, lface_same_font_attributes_p, lookup_face):
164 * xml.c (libxml2_loaded_p):
165 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
166 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
167 Now 'static', not 'static inline'.
168
05584c31
PE
169 * bidi.c: Tune.
170 (bidi_copy_it): Do the whole copy with a single memcpy.
171 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
172
86ec63ba
PE
173 Revert the FOLLOW-SYMLINKS change for file-attributes.
174 Doing it right would require several changes to Tramp, and there's
175 not enough time to get that tested before the freeze today.
176 * dired.c (directory_files_internal, Ffile_attributes):
177 Undo last change.
178
82ef37c1
PE
179 * frame.c (x_report_frame_params): Port better to wider ints.
180 Do not assume that EMACS_UINT is the same width as uprintmax_t,
181 or that pointers can be printed in 15 decimal digits.
182 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
183
62aba0d4
FP
1842012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
185
186 Support x64 build on MS-Windows.
187 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
188 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
189 compatibility with x64.
5e4daaf3 190 (x_get_focus_frame): Add prototype.
62aba0d4
FP
191
192 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
193 defining an XRectangle structure.
194
195 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
196 arithmetics for compatibility with x64.
197
198 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
199 compatibility with x64.
200
201 * w32heap.h: Adjust prototypes and declarations.
202
203 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
204 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
205 DWORD, long, and unsigned long, for compatibility with x64.
206 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
207 (sbrk): Argument is now of type ptrdiff_t.
208
209 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
210 less than 0x0500.
211 (w32_msg_pump): Use WPARAM type for 'result'.
212
213 * w32.c (init_environment, get_emacs_configuration): Support AMD64
214 architecture.
215 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
216 compatibility with x64.
217
218 * vm-limit.c (lim_data): Now size_t.
219 (check_memory_limits): Adjust prototypes of real_morecore and
220 __morecore to receive argument of type ptrdiff_t. Use size_t for
221 five_percent and data_size.
222
223 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
224 variables, for compatibility with x64.
225 (rva_to_section, offset_to_section, relocate_offset)
226 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
227 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
228 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
229 for compatibility with x64.
230
231 * sysdep.c (STDERR_FILENO): Define if not already defined.
232
233 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
234 (__morecore): Argument type is now ptrdiff_t.
235 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
236 (relinquish): Use ptrdiff_t type for 'excess'.
237 (r_alloc_sbrk): Argument type is now ptrdiff_t.
238
239 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
240 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
241 instead of a literal number.
242
243 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
244 (min): Define only if not already defined.
245
246 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
247 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
248 hosts.
249
250 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
251 'bitmaps' is a pointer.
252
253 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
254
255 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
256
e7a2937b
PE
2572012-09-30 Paul Eggert <eggert@cs.ucla.edu>
258
259 file-attributes has a new optional arg FOLLOW-SYMLINKS.
260 * dired.c (directory_files_internal, Ffile_attributes):
261 New arg follow_symlinks. All uses changed.
262
b43d62ae
SM
2632012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
264
265 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
266
c06c382a
EZ
2672012-09-30 Eli Zaretskii <eliz@gnu.org>
268
269 Support atimers and CPU profiler via profile.c on MS-Windows.
270 * w32proc.c (sig_mask, crit_sig): New static variables.
271 (sys_signal): Support SIGALRM and SIGPROF.
272 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 273 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
274 sigfillset, and sigprocmask are no longer no-ops.
275 (sigismember): New function.
276 (struct itimer_data): New definition.
277 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
278 (crit_prof): New static variables.
279 (MAX_SINGLE_SLEEP): New definition.
280 (timer_loop, stop_timer_thread, term_timers, init_timers)
281 (start_timer_thread, getitimer, setitimer): New functions.
282 (alarm): No longer a no-op, calls setitimer.
283
284 * w32.c (term_ntproc): Call term_timers.
285 (init_ntproc): Make sure all signals are unblocked at startup, to
286 erase any traces of dumping. Call init_timers.
287
288 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
289 Windows-specific code to display the hourglass mouse pointer is no
290 longer used.
291 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
292 to hourglass timer expiration.
293 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
294 Remove, no longer used.
b43d62ae
SM
295 (w32_note_current_window, show_hourglass, hide_hourglass):
296 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
297 window systems.
298 (syms_of_w32fns): Don't initialize hourglass_timer.
299
300 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
301 WINDOWSNT as well.
302 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
303
304 * w32.h (init_timers, term_timers): Add prototypes.
305
95402d5f
KH
3062012-09-30 Kenichi Handa <handa@gnu.org>
307
308 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
309 to the buffer relocation which may be caused by ccl_driver.
310
dd946752
JD
3112012-09-30 Jan Djärv <jan.h.d@swipnet.se>
312
d7e642cc
JD
313 * xfns.c (Fx_file_dialog): Update comment.
314
315 * w32fns.c (Fx_file_dialog): Update comment.
316
317 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
318 Initialize panel name field if OSX >= 10.6.
319
320 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
321
dd946752
JD
322 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
323
324 * nsterm.m (NEW_STYLE_FS): New define.
325 (ns_fullscreen_hook, windowWillEnterFullScreen)
326 (windowDidEnterFullScreen, windowWillExitFullScreen)
327 (windowDidExitFullScreen, toggleFullScreen, handleFS)
328 (setFSValue): New functions.
329 (EmacsFSWindow): New implementation.
330 (canBecomeKeyWindow): New function for EmacsFSWindow.
331 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
332 (dealloc): Release nonfs_window if in fullscreen.
333 (updateFrameSize:): Call windowDidMove to update top/left.
334 (windowWillResize:toSize:): Check if frame is still maximized.
335 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
336 next_maximized, maximized_width, maximized_height and nonfs_window.
337 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
338 tbar_height.
339 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
340 fullscreen. Set maximized_width/height. Act on next_maximized.
341
342 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
343 (EmacsView): Add variables for fullscreen.
344 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
345 (EmacsFSWindow): New interface for fullscreen.
346
427730eb
JB
3472012-09-30 Juanma Barranquero <lekktu@gmail.com>
348
349 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
350
48de8b12
CY
3512012-09-30 Chong Yidong <cyd@gnu.org>
352
353 * fns.c (Frandom): Doc fix.
354
5938d519
MR
3552012-09-30 Martin Rudalics <rudalics@gmx.at>
356
357 * window.c (Vwindow_combination_limit): New default value.
358 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
359
cb5b0266
PE
3602012-09-30 Paul Eggert <eggert@cs.ucla.edu>
361
362 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
363 Suggested by Eli Zaretskii in
364 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
365
84f72efd
EZ
3662012-09-30 Eli Zaretskii <eliz@gnu.org>
367
368 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
369 HAVE_TIMER_SETTIME is defined.
370
9d4dcdc9
PE
3712012-09-30 Paul Eggert <eggert@cs.ucla.edu>
372
d89460ed
PE
373 Profiler improvements: more-accurate timers, overflow checks.
374 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
375 signal.h, setjmp.h. Include systime.h instead.
376 (saturated_add): New function.
377 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
378 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
379 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
380 New static vars.
84f72efd 381 (enum profiler_cpu_running): New enum.
d89460ed
PE
382 (profiler_cpu_running): Now of that enum type, not bool.
383 All uses changed to store the new value.
384 (handle_profiler_signal): Rename from sigprof_handler_1,
385 for consistency with other handlers. Do not check whether
386 cpu_log is a hash-table if garbage collecting, since it
387 doesn't matter in that case.
388 (deliver_profiler_signal): Rename from sigprof_handler,
389 for consistency with other handlers.
390 (setup_cpu_timer): New function, with much of what used to be in
391 Fprofiler_cpu_start. Check for out-of-range argument.
392 Prefer timer_settime if available, and prefer
393 thread cputime clocks, then process cputime clocks, then
394 monotonic clocks, to the old realtime clock. Use make_timeval
395 to round more-correctly when falling back to setitimer.
396 (Fprofiler_cpu_start): Use it.
397 (Fprofiler_cpu_stop): Prefer timer_settime if available.
398 Don't assume that passing NULL as the 2nd argument of setitimer
399 is the same as passing a pointer to all-zero storage.
400 Ignore SIGPROF afterwards.
401 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
402 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
403 non-fatal signal handlers. Ignore SIGPROF on startup.
404 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
405 in profiler.c, since sysdep.c now uses it.
406
9d4dcdc9
PE
407 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
408 Suggested by Eli Zaretskii in
409 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
410
8e5691a0
JB
4112012-09-29 Juanma Barranquero <lekktu@gmail.com>
412
413 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
414
e7c1b6ef
SM
4152012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
416
417 * lisp.h (struct backtrace): Remove indirection for `function' field.
418 * xdisp.c (redisplay_internal):
419 * profiler.c (record_backtrace, sigprof_handler_1):
420 * alloc.c (Fgarbage_collect):
421 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
422 (Fbacktrace_frame): Adjust accordingly.
423
e61d39cd 4242012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
425
426 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
427 (Frun_hook_with_args_until_failure): Doc fixes.
428
404043ea
EZ
4292012-09-28 Eli Zaretskii <eliz@gnu.org>
430
431 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
432 Qautomatic_redisplay and change the symbol name. All users changed.
433
704d3f45
TM
4342012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
435
436 * profiler.c (sigprof_handler): Fix race condition.
437
757140ff
GM
4382012-09-28 Glenn Morris <rgm@gnu.org>
439
440 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
441
a615a3ae
PE
4422012-09-27 Paul Eggert <eggert@cs.ucla.edu>
443
444 Check more robustly for timer_settime.
89d17fd0
PE
445 * Makefile.in (LIB_TIMER_TIME): New macro.
446 (LIBES): Add it.
a615a3ae
PE
447 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
448 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
449 call timer_settime.
450
3670daf7
TM
4512012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
452
453 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
454
6a586b7f
JB
4552012-09-26 Juanma Barranquero <lekktu@gmail.com>
456
457 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
458
41c8bfcf
PE
4592012-09-26 Paul Eggert <eggert@cs.ucla.edu>
460
461 * character.h (MAYBE_UNIFY_CHAR): Remove.
462 * charset.c, charset.h (maybe_unify_char): Now static.
463 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
464 Since this stuff is now private to charset.c, there's no need for
465 a public macro and no need to inline by hand.
466
3a880af4
SM
4672012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
468 Stefan Monnier <monnier@iro.umontreal.ca>
469 Juanma Barranquero <lekktu@gmail.com>
611b7507 470
3a880af4
SM
471 * profiler.c: New file.
472 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
473 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
474 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
475 * emacs.c (main): Call syms_of_profiler.
476 * alloc.c (Qautomatic_gc): New constant.
477 (MALLOC_PROBE): New macro.
478 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
479 (total_bytes_of_live_objects): New function.
480 (Fgarbage_collect): Use it. Record itself in backtrace_list.
481 Call malloc_probe for the memory profiler.
482 (syms_of_alloc): Define Qautomatic_gc.
483 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
484 race condition.
485 (struct backtrace): Move definition...
486 * lisp.h (struct backtrace): ..here.
487 (Qautomatic_gc, profiler_memory_running): Declare vars.
488 (malloc_probe, syms_of_profiler): Declare functions.
489 * xdisp.c (Qautomatic_redisplay): New constant.
490 (redisplay_internal): Record itself in backtrace_list.
491 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 492
5938d519 4932012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
4942012-09-25 Juanma Barranquero <lekktu@gmail.com>
495
496 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
497
e26fd2e4
PE
4982012-09-25 Paul Eggert <eggert@cs.ucla.edu>
499
500 Prefer POSIX timers if available.
501 They avoid a race if the timer is too close to the current time.
502 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
503 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 504 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 505
eedec3ee
EZ
5062012-09-25 Eli Zaretskii <eliz@gnu.org>
507
508 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
509 CHAR_STRING_ADVANCE.
510 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
511 STRING_CHAR_ADVANCE.
512
aa15c6bb
JB
5132012-09-25 Juanma Barranquero <lekktu@gmail.com>
514
515 Move Vlibrary_cache to emacs.c and reset before dumping.
516
517 * lisp.h (reset_image_types): Declare.
518 [WINDOWSNT] (Vlibrary_cache): Declare.
519
520 * image.c (reset_image_types): New function.
521
522 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
523 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
524 (Fdump_emacs): Reset Vlibrary_cache and image_types.
525
526 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
527 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
528
529 * w32.h (Vlibrary_cache): Do not declare.
530
54d629be
EZ
5312012-09-25 Eli Zaretskii <eliz@gnu.org>
532
16b22fef
EZ
533 * w32proc.c (sys_signal): Handle all signals defined by the
534 MS-Windows runtime, not just SIGCHLD. Actually install the signal
535 handlers for signals supported by Windows. Don't override
536 term_ntproc as the handler for SIGABRT.
537 (sigaction): Rewrite to call sys_signal instead of duplicating its
538 code.
539 (sys_kill): Improve commentary.
540
541 * w32.c (term_ntproc): Accept (and ignore) one argument, for
542 consistency with a signature of a signal handler. All callers
543 changed.
544 (init_ntproc): Accept an argument DUMPING. If dumping, don't
545 install term_ntproc as a signal handler for SIGABRT, as that
546 should be done by the dumped Emacs.
547
548 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
549
550 * w32select.c (term_w32select): Protect against repeated
551 invocation by setting clipboard_owner to NULL after calling
552 DestroyWindow.
553
554 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
555 and term_ntproc to their modified signatures.
556
54d629be
EZ
557 * character.c (char_string, string_char): Remove calls to
558 MAYBE_UNIFY_CHAR. See the discussion starting at
559 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
560 for the details.
561
59f7af81
CY
5622012-09-25 Chong Yidong <cyd@gnu.org>
563
564 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
565
22e8cf4a
SM
5662012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
567
568 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
569 when encountering an unknown bytecode.
570
578098f3
PE
5712012-09-24 Paul Eggert <eggert@cs.ucla.edu>
572
573 image.c, indent.c: Use bool for booleans.
574 * dispextern.h (struct image_type): Members valid_p, load, init
575 now return bool, not int. All uses changed.
576 * image.c: Omit unnecessary static decls.
577 (x_create_bitmap_mask, x_build_heuristic_mask):
578 Return void, not int, since callers don't care about the return value.
579 (x_create_bitmap_mask, define_image_type, valid_image_p)
580 (struct image_keyword, parse_image_spec, image_spec_value)
581 (check_image_size, image_background)
582 (image_background_transparent, x_clear_image_1)
583 (postprocess_image, lookup_image, x_check_image_size)
584 (x_create_x_image_and_pixmap, xbm_image_p)
585 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
586 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
587 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
588 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
589 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
590 (png_image_p, init_png_functions, png_load_body, png_load)
591 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
592 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
593 (init_gif_functions, gif_load, imagemagick_image_p)
594 (imagemagick_load_image, imagemagick_load, svg_image_p)
595 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
596 (gs_load):
597 * nsimage.m (ns_load_image):
598 * nsterm.m (ns_defined_color):
599 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
600 * xfns.c (x_defined_color):
601 * xterm.c (x_alloc_lighter_color_for_widget)
602 (x_alloc_nearest_color_1, x_alloc_nearest_color)
603 (x_alloc_lighter_color):
604 * indent.c (disptab_matches_widthtab, current_column)
605 (scan_for_column, string_display_width, indented_beyond_p)
606 (compute_motion, vmotion, Fvertical_motion):
607 Use bool for booleans.
608
a5f2b6ec
CY
6092012-09-24 Chong Yidong <cyd@gnu.org>
610
611 * chartab.c (Fset_char_table_default): Obsolete function removed.
612
18e27ea8
PE
6132012-09-23 Paul Eggert <eggert@cs.ucla.edu>
614
afea8a8a
PE
615 Move pid_t related decls out of lisp.h.
616 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
617 (interruptible_wait_for_termination):
618 Move these decls from lisp.h to syswait.h, since they use pid_t.
619 Needed on FreeBSD; see Herbert J. Skuhra in
620 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
621 * callproc.c: Include syswait.h.
622
18e27ea8
PE
623 gnutls.c, gtkutil.c: Use bool for boolean.
624 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
625 (emacs_gnutls_handle_error):
626 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
627 (xg_hide_tooltip, xg_create_frame_widgets)
628 (create_dialog, xg_uses_old_file_dialog)
629 (xg_get_file_with_chooser, xg_get_file_with_selection)
630 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
631 (xg_item_label_same_p, xg_update_menubar)
632 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
633 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
634 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
635 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
636 (update_frame_tool_bar, free_frame_tool_bar):
637 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
638 * nsmenu.m (ns_update_menubar):
639 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
640 * xfns.c (Fx_show_tip) [USE_GTK]:
641 Use bool for boolean.
642 * gtkutil.c (xg_update_frame_menubar):
643 * xmenu.c (update_frame_menubar):
644 Return void, not int, since caller ignores return value.
645 * gtkutil.c (xg_change_toolbar_position):
646 Return void, not 1.
647
af0e9f75
JB
6482012-09-23 Juanma Barranquero <lekktu@gmail.com>
649
650 * makefile.w32-in (BLOCKINPUT_H): Remove.
651 (SYSSIGNAL_H): New macro.
652 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
653 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
654 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
655 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
656 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
657 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
658 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
659 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
660 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
661 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
662 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
663 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
664 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
665 ($(BLD)/w32xfns.$(O)): Update dependencies.
666
5101529e
EZ
6672012-09-23 Eli Zaretskii <eliz@gnu.org>
668
669 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
670 fatal_error_backtrace.
671
672 * w32proc.c (sys_kill): Undo last change: don't do anything when
673 invoked to deliver SIGABRT to our own process. This is now
674 handled by emacs_raise.
675
2c3ee0ad
JB
6762012-09-23 Juanma Barranquero <lekktu@gmail.com>
677
678 * w32term.c (w32_read_socket): Remove leftover reference to
679 interrupt_input_pending.
680
62a1d661
PE
6812012-09-23 Paul Eggert <eggert@cs.ucla.edu>
682
683 Do not use SA_NODEFER.
684 Problem reported by Dani Moncayo in
685 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
686 * alloc.c (die):
687 * sysdep.c (emacs_abort): Do not reset signal handler.
688 * emacs.c (terminate_due_to_signal): Reset signal handler here.
689 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
690 wanted even on POSIXish hosts, and it doesn't work on Windows.
691
a0942b9a
JD
6922012-09-23 Jan Djärv <jan.h.d@swipnet.se>
693
694 * xterm.c (x_term_init): Call fixup_locale before and after calling
695 gtk_init (Bug#12392).
696
d07ff9db
CY
6972012-09-23 Chong Yidong <cyd@gnu.org>
698
699 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
700 Vdynamic_library_alist.
701
702 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
703 (Fgnutls_available_p): Caller changed.
704
705 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
706 (Flibxml_parse_xml_region): Likewise.
707
708 * dispextern.h (struct image_type): Remove arg from init function.
709
710 * image.c (Finit_image_library, lookup_image_type)
711 (define_image_type): Remove now-unneeded second arg.
712 (init_xpm_functions, init_png_functions, init_jpeg_functions)
713 (init_tiff_functions, init_gif_functions, init_svg_functions):
714 Arglist and w32_delayed_load calling convention changed.
715 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 716 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 717
4d7e6e51
PE
7182012-09-23 Paul Eggert <eggert@cs.ucla.edu>
719
720 Simplify and avoid signal-handling races (Bug#12471).
721 * alloc.c (die):
722 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
723 Avoid recursive loop if there's a fatal error in the function itself.
724 * atimer.c (pending_atimers):
725 * blockinput.h: Don't include "atimer.h"; no longer needed.
726 (interrupt_input_pending): Remove. All uses removed.
727 pending_signals now counts both atimers and ordinary interrupts.
728 This is less racy than having three separate pending-signal flags.
729 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
730 (input_blocked_p):
731 Rename from their upper-case counterparts BLOCK_INPUT,
732 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
733 INPUT_BLOCKED_P, and turn into functions. All uses changed.
734 This makes it easier to access volatile variables more accurately.
735 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
736 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
737 that's more reliable if the code is buggy and sets
738 interrupt_input_blocked to a negative value. All uses changed.
739 * atimer.c (deliver_alarm_signal):
740 Remove. No need to deliver this to the parent; any thread can
741 handle this signal now. All uses replaced by underlying handler.
742 * atimer.c (turn_on_atimers):
743 * dispnew.c (handle_window_change_signal):
744 * emacs.c (handle_danger_signal):
745 * keyboard.c (kbd_buffer_get_event):
746 Don't reestablish signal handler; not needed with sigaction.
747 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
748 (UNBLOCK_INPUT_TO):
749 Rework to avoid unnecessary accesses to volatile variables.
750 (UNBLOCK_INPUT_TO): Now a function.
751 (totally_unblock_input, unblock_input): New decls.
752 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
753 (init_data): Remove. Necessary stuff now done in init_signal.
754 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
755 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
756 (fatal_error_code): Remove; no longer needed.
757 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
758 it doesn't always backtrace. All uses changed. No need to reset
759 signal to default, since sigaction and/or die does that for us now.
760 Use emacs_raise (FOO), not kill (getpid (), FOO).
761 (main): Check more-accurately whether we're dumping.
762 Move fatal-error setup to sysdep.c
763 * floatfns.c: Do not include "syssignal.h"; no longer needed.
764 * gtkutil.c (xg_get_file_name, xg_get_font):
765 Remove no-longer-needed signal-mask manipulation.
766 * keyboard.c, process.c (POLL_FOR_INPUT):
767 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
768 * keyboard.c (read_avail_input): Remove.
769 All uses replaced by gobble_input.
770 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
771 (kbd_buffer_store_event_hold, gobble_input):
772 (record_asynch_buffer_change) [USABLE_SIGIO]:
773 (store_user_signal_events):
774 No need to mess with signal mask.
775 (gobble_input): If blocking input and there are terminals, simply
776 set pending_signals to 1 and return. All hooks changed to not
777 worry about whether input is blocked.
778 (process_pending_signals): Clear pending_signals before processing
779 them, in case a signal comes in while we're processing.
780 By convention callers now test pending_signals before calling us.
781 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
782 New functions, to support changes to blockinput.h.
783 (handle_input_available_signal): Now extern.
784 (reinvoke_input_signal): Remove. All uses replaced by
785 handle_async_input.
786 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
787 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
788 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
789 Clear sigmask reliably, even if Fsignal returns, which it can.
790 Omit unnecessary accesses to volatile var.
791 (quit_throw_to_read_char): No need to restore sigmask.
792 * keyboard.c (gobble_input, handle_user_signal):
793 * process.c (wait_reading_process_output):
794 Call signal-handling code rather than killing ourselves.
795 * lisp.h: Include <float.h>, for...
796 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
797 (pending_signals): Now volatile.
798 (syms_of_data): Now const if IEEE floating point.
799 (handle_input_available_signal) [USABLE_SIGIO]:
800 (terminate_due_to_signal, record_child_status_change): New decls.
801 * process.c (create_process): Avoid disaster if memory is exhausted
802 while we're processing a vfork, by tightening the critical section
803 around the vfork.
804 (send_process_frame, process_sent_to, handle_pipe_signal)
805 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
806 ignores SIGPIPE.
807 (send_process): No need for setjmp/longjmp any more, since the
808 SIGPIPE stuff is now gone. Instead, report an error if errno
809 is EPIPE.
810 (record_child_status_change): Now extern. PID and W are now args.
811 Return void, not bool. All callers changed.
812 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
813 Remove. All uses removed. This bug should be fixed now in a
814 different way.
815 (wait_for_termination_1): Use waitpid rather than sigsuspend,
816 and record the child status change directly. This avoids the
817 need to futz with the signal mask.
818 (process_fatal_action): Move here from emacs.c.
819 (emacs_sigaction_flags): New function, containing
820 much of what used to be in emacs_sigaction_init.
821 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
822 caught by emacs, to make races less likely.
823 (deliver_process_signal): Rename from handle_on_main_thread.
824 All uses changed.
825 (BACKTRACE_LIMIT_MAX): Now at top level.
826 (thread_backtrace_buffer, threadback_backtrace_pointers):
827 New static vars.
828 (deliver_thread_signal, deliver_fatal_thread_signal):
829 New functions, for more-accurate delivery of thread-specific signals.
830 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
831 (deliver_arith_signal): Handle in this thread, not
832 in the main thread, since it's triggered by this thread.
833 (maybe_fatal_sig): New function.
834 (init_signals): New arg DUMPING so that we can be more accurate
835 about whether we're dumping. Caller changed.
836 Treat thread-specific signals differently from process-general signals.
837 Block all signals while handling fatal error; that's safer.
838 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
839 on IEEE hosts.
840 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
841 Ignore SIGPIPE unless batch.
842 (emacs_backtrace): Output backtrace for the appropriate thread,
843 which is not necessarily the main thread.
844 * syssignal.h: Include <stdbool.h>.
845 (emacs_raise): New macro.
846 * xterm.c (x_connection_signal): Remove; no longer needed
847 now that we use sigaction.
848 (x_connection_closed): No need to mess with sigmask now.
849 (x_initialize): No need to reset SIGPIPE handler here, since
850 init_signals does this for us now.
851
8f4635e9
JD
8522012-09-23 Jan Djärv <jan.h.d@swipnet.se>
853
854 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 855 background rect may be larger (Bug#12245).
8f4635e9 856
3296976d
CY
8572012-09-23 Chong Yidong <cyd@gnu.org>
858
859 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
860
d41e491e
PE
8612012-09-22 Paul Eggert <eggert@cs.ucla.edu>
862
863 * .gdbinit: Just stop at fatal_error_backtrace.
864 See Stefan Monnier's request in
865 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
866 Remove no-longer-used query of system type.
867
c88b867f
CY
8682012-09-22 Chong Yidong <cyd@gnu.org>
869
870 * search.c (Freplace_match): Doc fix (Bug#12325).
871
872 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
873
874 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
875 (Fline_end_position): Doc fix.
876
877 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
878
bb4d86b4
CY
8792012-09-22 Chong Yidong <cyd@gnu.org>
880
881 * dispextern.h (struct image_type): Add new slot, storing a type
882 initialization function.
883
884 * image.c (define_image_type): Call the image initializer function
885 if it is defined. Arguments and return value changed.
886 (valid_image_p, make_image): Callers changed.
887 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
888 (gif_type, imagemagick_type, svg_type, gs_type):
889 Add initialization functions.
bb4d86b4
CY
890 (Finit_image_library): Call lookup_image_type.
891 (CHECK_LIB_AVAILABLE): Macro deleted.
892 (lookup_image_type): Call define_image_type here, rather than via
893 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
894 (syms_of_image): Move define_image_type calls for xbm_type and
895 pbm_type to lookup_image_type.
896
df9685f3
EZ
8972012-09-22 Eli Zaretskii <eliz@gnu.org>
898
899 * keyboard.c (timer_check_2): Move calculation of 'timers' and
900 'idle_timers' from here ...
901 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
902 lists, to avoid infloops when the timer does something stupid,
903 like reinvoke itself with the same or smaller time-out.
904 (Bug#12447)
905
8e17c9ba
MR
9062012-09-22 Martin Rudalics <rudalics@gmx.at>
907
908 * window.c (Fsplit_window_internal): Handle only Qt value of
909 Vwindow_combination_limit separately.
910 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
911 (Vwindow_combination_limit): New default value.
912 Rewrite doc-string.
8e17c9ba 913
589bd69b
EZ
9142012-09-22 Eli Zaretskii <eliz@gnu.org>
915
916 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
917 the new overlay string. (Bug#10159)
918
01108e3f
PE
9192012-09-22 Paul Eggert <eggert@cs.ucla.edu>
920
921 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
922 or that fprintf is async-signal-safe. POSIX doesn't require
923 either assumption.
924
82f8cd94
CY
9252012-09-22 Chong Yidong <cyd@gnu.org>
926
927 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
928 (Bug#8207).
929
3cccbd87
KH
9302012-09-22 Kenichi Handa <handa@gnu.org>
931
932 * composite.c (composition_reseat_it): Handle the case that a
933 grapheme cluster is not covered by a single font (Bug#12352).
934
09c01941
CY
9352012-09-21 Chong Yidong <cyd@gnu.org>
936
937 * image.c (define_image_type): Avoid adding duplicate types to
938 image_types (Bug#12463). Suggested by Jörg Walter.
939
acfa068f 9402012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
941
942 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
943 (print_load_command_name): Add case LC_DATA_IN_CODE.
944 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
945
acfa068f 9462012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
947
948 * eval.c (Frun_hook_with_args_until_success)
949 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
950
acfa068f 9512012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
952
953 * fileio.c (Ffile_selinux_context): Only call freecon when
954 lgetfilecon succeeded.
955 (Fset_file_selinux_context): Likewise. (Bug#12444)
956
acfa068f 9572012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
958
959 * xdisp.c (try_window_reusing_current_matrix): Under bidi
960 reordering, locate the cursor by calling set_cursor_from_row; if
961 that fails, clear the desired glyph matrix before returning a
962 failure indication to the caller. Fixes leaving garbled display
963 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
964 (compute_stop_pos_backwards): Fix a typo that caused crashes while
965 scrolling through multibyte text.
aa36e4d2 966
e99f70c8
SM
9672012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
968
969 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
970 calling mark_vectorlike since that's the one that marks the window.
971 (mark_discard_killed_buffers): Mark the final cdr.
972 * window.h (struct window): Move prev/next_buffers to the
973 non-standard fields.
974 * window.c (make_window): Initialize prev/next_buffers manually.
975
f75beb47
PE
9762012-09-20 Paul Eggert <eggert@cs.ucla.edu>
977
978 Omit unused arg EXPECTED from socket hooks.
979 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
980 * nsterm.m (ns_term_init):
981 * termhooks.h (struct terminal.read_socket_hook):
982 * w32inevt.c (w32_console_read_socket):
983 * w32term.c (w32_read_socket):
984 * xterm.c (XTread_socket):
985 Omit unused arg EXPECTED. All callers changed.
986 (store_user_signal_events): Return void, not int, since callers no
987 longer care about the return value. All uses changed.
988
b019b76a
JB
9892012-09-20 Juanma Barranquero <lekktu@gmail.com>
990
991 * w32gui.h (XParseGeometry): Do not declare.
992
05642592
PE
9932012-09-19 Paul Eggert <eggert@cs.ucla.edu>
994
e4bce92a
PE
995 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
996 Ignore 'expected'. See Eli Zaretskii in
997 <http://bugs.gnu.org/12471#8> (last line).
998
05642592
PE
999 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
1000 (XParseGeometry): Now static. Substitute extremal values for
1001 values that are out of range.
1002
e543ae91
JD
10032012-09-19 Jan Djärv <jan.h.d@swipnet.se>
1004
1005 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1006
1007 * nsfns.m (XParseGeometry): Remove.
1008 (Fx_create_frame): Call x_set_offset to correctly interpret
1009 top_pos in geometry.
1010
3a880af4 1011 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
1012 (Fx_parse_geometry): If there is a space in string, call
1013 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1014
45ba16c7
EZ
10152012-09-17 Eli Zaretskii <eliz@gnu.org>
1016
c8b9f1bc
EZ
1017 * search.c (scan_buffer): Use character positions in calls to
1018 region_cache_forward and region_cache_backward, not byte
1019 positions. (Bug#12196)
1020
b4c932a2
EZ
1021 * w32term.c (w32_read_socket): Set pending_signals to 1, like
1022 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
1023
45ba16c7
EZ
1024 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1025 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1026 emacs_blocked_malloc, now deleted.
1027
eeceac93
PE
10282012-09-17 Paul Eggert <eggert@cs.ucla.edu>
1029
1030 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1031 The workaround was for improving performance on Solaris 2.4, but
1032 is getting in the way now. Emacs will still work if someone is
1033 still running Solaris 2.4 in a museum somewhere; Sun dropped
1034 support for Solaris 2.4 in 2003.
1035 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1036 * process.c (create_process) [HAVE_WORKING_VFORK]:
1037 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1038 since Emacs no longer uses vfork on that platform.
1039
78f83752
GM
10402012-09-17 Glenn Morris <rgm@gnu.org>
1041
1042 * emacs.c: Use COPYRIGHT.
1043
634b8cac
PE
10442012-09-16 Paul Eggert <eggert@cs.ucla.edu>
1045
0caaedb1
PE
1046 Remove configure's --without-sync-input option (Bug#12450).
1047 When auditing signal-handling in preparation for cleaning it up,
1048 I found that SYNC_INPUT has race conditions and would be a real
1049 pain to fix. Since it's an undocumented and deprecated
1050 configure-time option, now seems like a good time to remove it.
1051 Also see <http://bugs.gnu.org/11080#16>.
1052 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1053 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1054 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1055 (malloc_hysteresis):
1056 (check_depth) [XMALLOC_OVERRUN_CHECK]:
1057 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1058 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1059 (dont_register_blocks, bytes_used_when_reconsidered)
1060 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1061 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1062 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1063 Remove. All uses removed.
1064 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1065 implementation, one that depends on whether the new macro
1066 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1067 is defined.
1068 * atimer.c (run_timers, handle_alarm_signal):
1069 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1070 (handle_async_input, process_pending_signals)
1071 (handle_input_available_signal, init_keyboard):
1072 * nsterm.m (ns_read_socket):
1073 * process.c (wait_reading_process_output):
1074 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1075 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1076 (emacs_write):
1077 * xterm.c (XTread_socket):
1078 Assume SYNC_INPUT.
1079 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1080 * eval.c (handling_signal): Remove. All uses removed.
1081 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1082 All uses replaced with the SYNC_INPUT version.
1083 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1084 Remove decls.
1085 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1086 Now static.
1087
634b8cac
PE
1088 * font.c (Ffont_shape_gstring): Remove unused local.
1089
83da1b55
GM
10902012-09-16 Glenn Morris <rgm@gnu.org>
1091
518650a5
GM
1092 * Makefile.in (clean): No longer run nextstep's clean.
1093
83da1b55
GM
1094 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1095 (ns_frag): Remove.
1096 (ns-app): Move here from ns.mk, and simplify.
1097 (clean): Simplify nextstep entry.
1098 * ns.mk: Remove file.
1099
85a43e2e
KH
11002012-09-17 Kenichi Handa <handa@gnu.org>
1101
1102 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1103 not covert the last few charactes.
1104
ba13e616 11052012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
1106
1107 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1108 here, but just check the validity of glyphs in the glyph-string.
1109
a8c729af
MR
11102012-09-16 Martin Rudalics <rudalics@gmx.at>
1111
3a880af4
SM
1112 * window.c (Fwindow_parameter, Fset_window_parameter):
1113 Accept any window as argument (Bug#12452).
a8c729af 1114
c077c059
JD
11152012-09-16 Jan Djärv <jan.h.d@swipnet.se>
1116
1117 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1118 to ns_term_init to avoid memory leak.
1119
1120 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
1121 explicit retain/release.
1122 (ns_term_init): Only allow one display. Initialize outerpool and
1123 ns_*_types.
1124
39a57ad0
PE
11252012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1126
1127 Port _setjmp fix to POSIXish hosts as well as Microsoft.
1128 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
1129 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
1130 the Microsoft problem in a different way, by altering ../nt/config.nt.
1131
7105c8cb
EZ
11322012-09-15 Eli Zaretskii <eliz@gnu.org>
1133
1134 * w32xfns.c:
1135 * w32uniscribe.c:
1136 * w32term.c:
1137 * w32select.c:
1138 * w32reg.c:
1139 * w32proc.c:
1140 * w32menu.c:
1141 * w32inevt.c:
1142 * w32heap.c:
1143 * w32font.c:
1144 * w32fns.c:
1145 * w32console.c:
1146 * w32.c:
1147 * w16select.c: Remove inclusion of setjmp.h, as it is now included
1148 by lisp.h. This completes removal of setjmp.h inclusion
1149 erroneously announced in the previous commit. (Bug#12446)
1150
1151 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
1152 more accurate.
1153
1154 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
1155 not defined as a macro. The latter happens on MS-Windows.
1156 (Bug#12446)
1157
0328b6de
PE
11582012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1159
1160 Port better to POSIX hosts lacking _setjmp (Bug#12446).
1161 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 1162 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
1163 only reason for the instance was because "lisp.h" was included.
1164 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
1165 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
1166 and _longjmp with the new symbols. Emacs already uses _setjmp if
1167 available, so this change affects only POSIXish hosts that have
1168 sigsetjmp but not _setjmp, such as some versions of Solaris and
1169 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
1170 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
1171 (png_load_body) [HAVE_PNG]:
1172 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
1173 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
1174 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
1175 since PNG requires jmp_buf. This is the only exception to the
1176 general rule that we now use sys_setjmp and sys_longjmp.
1177 This exception is OK since this code does not change the signal
1178 mask or longjmp out of a signal handler.
1179
2af03429
PE
11802012-09-14 Paul Eggert <eggert@cs.ucla.edu>
1181
1182 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1183 Include "syssignal.h", for 'main_thread'.
1184
2f294edf
DA
11852012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
1186
1187 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
1188 * insdel.c (replace_range, replace_range_2):
1189 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
1190 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1191 Remove redundant check before calling offset_intervals.
1192
6b533e9c
MR
11932012-09-14 Martin Rudalics <rudalics@gmx.at>
1194
1195 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1196 current buffer (Bug#12387).
1197
2a7931e3
JB
11982012-09-14 Juanma Barranquero <lekktu@gmail.com>
1199
1200 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1201
c18e885b
PE
12022012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1203
1204 Use a more backwards-compatible timer format (Bug#12430).
1205 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1206 vector element, not from the 4th, since PSECS is now at the end.
1207 (Fcurrent_idle_time): Doc fix.
1208
d59a1afb
DA
12092012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
1210
1211 Function to mark objects and remove killed buffers at once.
1212 * alloc.c (discard_killed_buffers): Rename to ...
1213 (mark_discard_killed buffers) ... new name. Add marking
1214 of remaining objects. Fix comment. Adjust users.
1215 (mark_object): Do not touch frame buffer lists here.
1216 * frame.c (delete_frame): Reset frame buffer lists here.
1217
5f0cb45a
PE
12182012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1219
8ea47e3a
PE
1220 Better workaround for GNOME bug when --enable-gcc-warnings.
1221 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1222 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
1223 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1224
4a4bbad2
PE
1225 Simplify SIGIO usage (Bug#12408).
1226 The code that dealt with SIGIO was crufty and confusing, e.g., it
1227 played tricks like "#undef SIGIO" but these tricks were not used
1228 consistently. Simplify mostly by not #undeffing standard symbols,
1229 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1230 or not as we please) rather than "defined SIGIO" (standard symbol
1231 that we probably shouldn't #undef).
1232 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1233 Modules that need it can include it.
1234 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1235 * dispextern.h (ignore_sigio): New decl.
1236 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1237 unconditionally, since it's now a no-op if !USABLE_SIGIO.
1238 * emacs.c (shut_down_emacs):
1239 * keyboard.c (kbd_buffer_store_event_hold):
1240 Use ignore_sigio rather than invoking 'signal' directly.
1241 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1242 for FIONREAD.
1243 (FIONREAD, SIGIO): Do not #undef.
1244 (tty_read_avail_input): Use #error rather than a syntax error.
1245 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1246 for I_PIPE, used by SETUP_SLAVE_PTY.
1247 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1248 * sysdep.c (croak): Remove; no longer needed. This bit of
1249 temporary code, with Fred N. Fish's comment that it's temporary,
1250 has been in Emacs since at least 1992!
1251 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1252 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1253 * syssignal.h (croak): Remove decl.
1254 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1255 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1256 now that we're termios-only.
1257 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1258 * term.c (dissociate_if_controlling_tty): Use #error rather than
1259 a run-time error.
1260
5f0cb45a
PE
1261 Work around GCC and GNOME bugs when --enable-gcc-warnings.
1262 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1263 to work around GNOME bug 683906.
1264 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1265 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1266 This works around GCC bug 54561.
1267
40bce90b
PE
12682012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1269
1270 More fixes for 'volatile' and setjmp/longjmp.
1271 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1272 * image.c (struct png_load_context) [HAVE_PNG]: New type.
1273 (png_load_body) [HAVE_PNG]:
1274 (jpeg_load_body) [HAVE_JPEG]:
1275 New function, with most of the old parent function's body.
1276 (png_load) [HAVE_PNG]:
1277 (jpeg_load) [HAVE_JPEG]:
1278 Invoke the new function, to avoid longjmp munging our locals.
1279 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
1280 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
1281 longjmp is passed 2, as the C standard doesn't guarantee this.
1282 Instead, store the failure code into mgr->failure_code.
1283
bfeae2cf
SM
12842012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1285
1286 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
1287 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
1288 (syms_of_keyboard): Remove support for unread-command-char.
1289
8099e36b
EZ
12902012-09-12 Eli Zaretskii <eliz@gnu.org>
1291
1292 * w32proc.c (sys_kill): If PID is our process ID and the signal is
1293 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
1294 violation. (Bug#12426)
1295
92547ff9
PE
12962012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1297
1298 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
1299
45b82ad0
SM
13002012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1301
1302 * eval.c: Add `inhibit-debugger'.
1303 (Qinhibit_debugger): New symbol.
1304 (call_debugger): Bind it instead of Qdebug_on_error.
1305 (maybe_call_debugger): Test Vinhibit_debugger.
1306 (syms_of_eval): Define inhibit-debugger.
1307 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1308 (syms_of_xdisp): Remove inhibit-debug-on-message.
1309
5779a1dc
PE
13102012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1311
50f2e553
PE
1312 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1313 If a nonvolatile local variable is written before a _longjmp to
1314 the frame containing the variable, and is read after the _longjmp,
1315 the value read is indeterminate. Some local variables of type
1316 'struct handler' and 'struct catchtag' are used in this way, so
1317 mark each of their slots as volatile if the slot can be set before
1318 _longjmp and read afterwards.
1319 * lisp.h (struct handler): var and chosen_clause are now volatile.
1320 (struct catchtag): val, next, and pdlcount are now volatile.
1321
ae1d87e2
PE
1322 * bidi.c (bidi_push_it, bidi_pop_it):
1323 * fns.c (copy_hash_table):
1324 * image.c (define_image_type):
1325 * keyboard.c (kbd_buffer_store_event_hold):
1326 * process.c (Fprocess_send_eof):
1327 * xfaces.c (x_create_gc) [HAVE_NS]:
1328 * xgselect.c (xg_select):
1329 Prefer assignment to memcpy when either will do.
1330
5779a1dc
PE
1331 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1332 Use pointer-to-a-pointer to simplify and avoid a NILP check each
1333 time an item is removed. No need to mark this function 'inline';
1334 the compiler knows better than we do.
1335
c4c9756b
JD
13362012-09-11 Jan Djärv <jan.h.d@swipnet.se>
1337
1338 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1339 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1340 to change_frame_size (Bug#12388).
1341 (windowDidResize:): Pass YES to updateFrameSize.
1342
1343 * nsterm.h: Add delay parameter to updateFrameSize.
1344
d73e321c
DA
13452012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1346
1347 Discard killed buffers from deleted window and frame objects.
1348 This reduces an amount of references to killed buffers and
1349 helps GC to reclaim them faster.
1350 * alloc.c (discard_killed_buffers): New function.
1351 (mark_object): Use it for deleted windows and frames.
1352 (mark_object): If symbol's value is set up for a killed buffer
1353 or deleted frame, restore it's global binding.
1354 * data.c (swap_in_global_binding): Add GC notice.
1355 (swap_in_symval_forwarding): Use convenient set_blv_where.
1356 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1357 * window.h: ... to here.
1358
e578f381
DA
13592012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1360
1361 Convenient macro to check whether the buffer is live.
1362 * buffer.h (BUFFER_LIVE_P): New macro.
1363 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1364 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1365
3057e615
YM
13662012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1367
1368 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1369 composition cases (Bug#12364).
1370
1371 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1372 overhang of succeeding glyphs overlapping box cursor.
1373
1374 * w32term.c (x_draw_glyph_string): Likewise.
1375
6fda35f2
PE
13762012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1377
c990426a
PE
1378 Simplify, document, and port floating-point (Bug#12381).
1379 The porting part of this patch fixes bugs on non-IEEE platforms
1380 with frexp, ldexp, logb.
1381 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1382 Now static.
1383 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1384 support, by removing commented-out code and briefly listing the
1385 C89 functions excluded. The commented-out stuff was confusing
1386 maintenance, e.g., we thought we needed cbrt but it was commented out.
1387 (logb): Remove decl; no longer needed.
1388 (isfinite): New macro, if not already supplied.
1389 (isnan): Don't replace any existing macro.
1390 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1391 are present on all C89 platforms.
1392 (Ffrexp): Do not special-case zero, as frexp does the right thing
1393 for that case.
1394 (Flogb): Do not use logb, as it doesn't have the desired meaning
1395 on hosts that use non-base-2 floating point. Instead, stick with
1396 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1397 frexp, to avoid getting an unspecified result.
1398
6fda35f2
PE
1399 * xdisp.c (Qinhibit_debug_on_message): Now static.
1400
16130a58
JD
14012012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1402
1403 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1404 NSBezierPath (Bug#12131).
1405
d105a573
CY
14062012-09-10 Chong Yidong <cyd@gnu.org>
1407
1408 * fns.c (Fdelq, Fdelete): Doc fix.
1409
ff55dfe8
PE
14102012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1411
1412 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1413 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1414
e7032e7c
SM
14152012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1416
1417 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1418 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1419 Use it.
1420
e9957956
EZ
14212012-09-09 Eli Zaretskii <eliz@gnu.org>
1422
aba05ce9
EZ
1423 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1424 left fringe if the window has a left margin. This avoids leaving
1425 traces of the cursor because its leftmost pixel is not drawn over.
1426
e9957956
EZ
1427 * dispnew.c (update_window_line): When the left margin area of a
1428 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1429 that screen line. (Bug#12277)
1430
f6196b87
PE
14312012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1432
1433 Assume C89 or later for math functions (Bug#12381).
1434 This simplifies the code, and makes it a bit smaller and faster,
1435 and (most important) makes it easier to clean up signal handling
1436 since we can stop worring about floating-point exceptions in
1437 library code. That was a problem before C89, but the problem
1438 went away many years ago on all practical Emacs targets.
1439 * data.c, image.c, lread.c, print.c:
1440 Don't include <math.h>; no longer needed.
1441 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1442 might be autoconfigured, as that never happens.
1443 * data.c (fmod):
1444 * doprnt.c (DBL_MAX_10_EXP):
1445 * print.c (DBL_DIG):
1446 Remove. C89 or later always defines these.
1447 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1448 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1449 (arith_error, domain_error, domain_error2):
1450 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1451 no longer needed -- we simply return what C returns. All uses removed.
1452 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1453 the wrapped code.
1454 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1455 Remove. All uses expanded, as these macros are no longer used
1456 more than once and are now more trouble than they're worth.
1457 (Ftan): Use tan, not sin / cos.
1458 (Flogb): Assume C89 frexp.
1459 (fmod_float): Assume C89 fmod.
1460 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1461 (init_floatfns): Remove. All uses removed.
1462
9d7f1863
JD
14632012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1464
1465 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1466 compositeToPoint for OSX < 10.6 (Bug#12390).
1467
eabf0404
PE
14682012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1469
1470 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1471 This produces more-accurate results.
1472
0b3b1d23
JD
14732012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1474
1475 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1476 changes (Bug#12088).
1477
6dcef6ec
CY
14782012-09-08 Chong Yidong <cyd@gnu.org>
1479
1480 * syntax.c (Fstring_to_syntax): Doc fix.
1481
aa7d57c5
JD
14822012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1483
1484 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1485 in the internal border.
1486 (x_set_window_size): Remove static variables and their usage.
1487 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
1488 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1489 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
1490 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1491 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1492 (ns_fix_rect_ibw): Remove.
1493 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1494 (ns_dumpglyphs_box_or_relief): Ditto.
1495 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1496 adjustment.
1497 (ns_dumpglyphs_image): Ditto.
fc0c31f8 1498 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
1499 border adjustment.
1500 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1501 their usage. Add fringe_extended_p and its use as in other terms.
1502 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1503 scroll bar was removed.
1504 (updateFrameSize): New function.
1505 (windowDidResize): Move code to updateFrameSize and call it.
1506
1507 * nsterm.h (EmacsView): Add updateFrameSize.
1508
1a5432bc
CY
15092012-09-07 Chong Yidong <cyd@gnu.org>
1510
b4f5313e
CY
1511 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1512
1a5432bc
CY
1513 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1514
1a4f1e9b
PE
15152012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1516
1517 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
1518 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1519 Problem introduced when merging patches. Noted by Eli Zaretskii in
1520 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
1521 * floatfns.c: Comment fix.
1522 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1523 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1524 and anyway the declaration is harmless even if SIGDANGER is not defined.
1525 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1526 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1527 source files not surprisingly expected syssignal.h to define, or
1528 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1529 Include <sys/ioctl.h>, for FIONREAD.
1530 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1531 This eliminates a problem whereby other files mysteriously had
1532 to include "syssignal.h" before including "systty.h" if they
1533 wanted to use "#ifdef SIGIO".
1534
bc8000ff
EZ
15352012-09-07 Eli Zaretskii <eliz@gnu.org>
1536
3e6d6928
EZ
1537 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1538
1539 * w32.c (sigemptyset): Empty the set.
1540 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1541
bc8000ff
EZ
1542 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1543
b4fa72f2
DA
15442012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1545
1546 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1547 (mark_object): Likewise for frame objects.
1548
30730c93
PE
15492012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1550
1551 * syssignal.h (handle_on_main_thread): Always declare,
1552 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1553 This ports to platforms without HAVE_PTHREAD.
1554
2fe28299
PE
15552012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1556
1557 Signal-handler cleanup (Bug#12327).
1558 Emacs's signal handlers were written in the old 4.2BSD style with
1559 sigblock and sigmask and so forth, and this led to some
1560 inefficiencies and confusion. Rewrite these to use
1561 pthread_sigmask etc. without copying signal sets around. Also,
1562 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1563 'signal', and instead use functions that do not attempt to take
1564 over the system name space. This patch causes Emacs's text
1565 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1566 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1567 Do not include <signal.h> or "syssignal.h", as these
1568 modules do not use signals.
1569 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1570 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1571 Do not include <signal.h>, as "syssignal.h" does that for us now.
1572 * atimer.c (sigmask_atimers): New function.
1573 (block_atimers, unblock_atimers): New functions,
1574 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1575 All uses replaced.
1576 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1577 no longer needed here.
1578 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 1579 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
1580 * sysdep.c (struct save_signal): New member 'action', replacing
1581 old member 'handler'.
1582 (save_signal_handlers, restore_signal_handlers):
1583 Use sigaction instead of 'signal' to save and restore.
1584 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1585 New function. All users of 'signal' modified to use set_sighandler
1586 if they're writeonly, and to use sys_signal if they're read+write.
1587 (emacs_sigaction_init, forwarded_signal): New functions.
1588 (sys_signal): Remove. All uses replaced by calls to sigaction
1589 and emacs_sigaction_init, or by direct calls to 'signal'.
1590 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1591 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1592 all uses replaced by pthread_sigmask etc. calls.
1593 * syssignal.h: Include <signal.h>.
1594 (emacs_sigaction_init, forwarded_signal): New decls.
1595 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1596 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1597 (sigmask, sys_sigmask): Remove; no longer needed.
1598 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1599 (sigblock, sigunblock, sigfree):
1600 (sigsetmask) [!defined sigsetmask]:
1601 Remove. All uses replaced by pthread_sigmask.
1602 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1603 no longer need to be replaced, and its typical old uses
1604 are now done via emacs_sigaction_init and sigaction.
1605 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1606 (sys_sigdel): Remove; unused.
1607 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1608
0216c128
EZ
16092012-09-06 Eli Zaretskii <eliz@gnu.org>
1610
1611 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1612 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1613
c752cfa9
DA
16142012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1615
1616 Explicitly mark buffer_defaults and buffer_local_symbols.
1617 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1618 mark_local_symbols here.
1619 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1620 since special buffers aren't marked here any more.
1621 (allocate_buffer): Chain new buffer with all_buffers here...
1622 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1623 not here.
1624 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1625 (syms_of_buffer): Remove staticpro of the above.
1626 (init_buffer_once): Set names for buffer_defaults and
1627 buffer_local_symbols.
1628
a864ef14
PE
16292012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1630
1631 Use bool for booleans in font-related modules.
1632 * font.c (font_intern_prop, font_style_to_value)
1633 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1634 (generate_otf_features, font_check_otf_features, font_check_otf)
1635 (font_match_p, font_list_entities, font_at):
1636 * fontset.c (fontset_id_valid_p, reorder_font_vector
1637 (fontset_find_font, Fset_fontset_font)
1638 (face_suitable_for_char_p) [0]:
1639 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1640 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1641 (m17n_flt_initialized, ftfont_shape_by_flt):
1642 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1643 * nsfont.m (nsfont_draw):
1644 * w32font.c (w32font_draw):
1645 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1646 Use bool for booleans.
1647 * font.h: Adjust to above API changes.
1648 (struct font, struct font_driver, struct font_driver_list):
1649 Use bool for booleans.
1650 (struct font): Remove useless member encoding_type.
1651 All users removed.
1652 * fontset.c, xftfont.c: Omit unnecessary static decls.
1653
0699fc18
DA
16542012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1655
1656 * alloc.c (mark_object): Revert window marking code
1657 since it's unsafe for the Fset_window_configuration.
1658
20ef56db
PE
16592012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1660
2fe28299 1661 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
1662 Be more systematic about preserving errno whenever a signal
1663 handler returns, even if it's not in the main thread. Do this by
1664 renaming signal handlers to distinguish between signal delivery
1665 and signal handling. All uses changed.
1666 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1667 * data.c (deliver_arith_signal): Rename from arith_error.
1668 * dispnew.c (deliver_window_change_signal): Rename from
1669 window_change_signal.
1670 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1671 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1672 * keyboard.c (deliver_input_available_signal): Rename from
1673 input_available_signal.
1674 (deliver_user_signal): Rename from handle_user_signal.
1675 (deliver_interrupt_signal): Rename from interrupt_signal.
1676 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1677 (deliver_child_signal): Rename from sigchld_handler.
1678 * atimer.c (handle_alarm_signal):
1679 * data.c (handle_arith_signal):
1680 * dispnew.c (handle_window_change_signal):
1681 * emacs.c (handle_fatal_signal, handle_danger_signal):
1682 * keyboard.c (handle_input_available_signal):
1683 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1684 * process.c (handle_pipe_signal, handle_child_signal):
1685 New functions, with the actual signal-handling code taken from the
1686 original respective signal handlers, sans the sporadic attempts to
1687 preserve errno, since that's now done by handle_on_main_thread.
1688 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1689 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1690 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1691 Move to sysdep.c.
1692 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1693 Move initialization of main_thread to sysdep.c's init_signals.
1694 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1695 our usage, and simplifies the mainline code.
1696 (record_child_status_change): New static function, as a helper
1697 for handle_child_signal, and with most of the old child handler's
1698 contents.
1699 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1700 (handle_child_signal): Use the above.
1701 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1702 Moved here from emacs.c.
1703 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1704 code moved here from emacs.c's main function.
1705 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
1706 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
1707 This lets callers save and restore errno properly.
20ef56db 1708
e3ccf108
DA
17092012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1710
1711 Remove redundant or unused things here and there.
1712 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1713 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1714 * editfns.c (Fcompare_buffer_substrings): Likewise.
1715 * frame.h (struct terminal, struct font_driver_list):
1716 Remove redundant declarations.
1717 * window.h (Qleft, Qright): Likewise.
1718
697e1e39
DA
17192012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1720
1721 Do not mark objects from deleted buffers, windows and frames.
1722 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1723 (mark_object): Likewise for windows and frames.
1724
c1ca42ca
DA
17252012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1726
1727 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1728 buffer_defaults and buffer_local_symbols as valid objects.
1729 Return special value to denote them.
1730
014d93be
PE
17312012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1732
f75d7a91
PE
1733 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1734 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1735 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1736 (file_name_absolute_p, Fsubstitute_in_file_name):
1737 (check_executable, check_writable, Ffile_accessible_directory_p)
1738 (Fset_file_selinux_context, Fdefault_file_modes)
1739 (Finsert_file_contents, choose_write_coding_system)
1740 (Fwrite_region, build_annotations, a_write, e_write)
1741 (Fdo_auto_save):
1742 * filelock.c (boot_time_initialized, get_boot_time)
1743 (get_boot_time_1, lock_file_1, within_one_second):
1744 * floatfns.c (in_float):
1745 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1746 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1747 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1748 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1749 * window.c (compare_window_configurations):
1750 Use bool for booleans.
1751 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1752 (Fdefault_file_modes): Now mode_t, not int, for modes.
1753 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1754 (internal_delete_file): Now returns void, not a (boolean) int,
1755 since nobody was looking at the return value.
1756 * lisp.h, window.h: Adjust to above API changes.
1757
014d93be
PE
1758 * xdisp.c (set_message): Simplify and reindent last change.
1759
776f29e1
JB
17602012-09-05 Juanma Barranquero <lekktu@gmail.com>
1761
1762 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1763
7f7e0167
LI
17642012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1765
1766 * eval.c (call_debugger): Make the function non-static so that we
1767 can call it from set_message.
1768
1769 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1770 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1771
cf29dd84
PE
17722012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1773
1774 Give more-useful info on a fatal error (Bug#12328).
1775 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1776 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1777 of doing the work ourselves.
1778 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1779 do most of the work.
1780 (fatal_error_backtrace): New function, taken from the guts
1781 of the old fatal_error_signal, but with a new option to output
1782 a backtrace.
1783 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1784 info about the signal than just its number.
1785 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1786 * sysdep.c: Include <execinfo.h>
1787 (emacs_backtrace): New function, taken partly from the previous
1788 code of the 'die' function.
1789 (emacs_abort): Call fatal_error_backtrace rather than abort.
1790
972debf2
SM
17912012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1792
1793 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1794 eager (load-time) macro-expansion.
1795 * lisp.mk (lisp): Add macroexp.
1796
1088b922
PE
17972012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1798
1799 Simplify redefinition of 'abort' (Bug#12316).
1800 Do not try to redefine the 'abort' function. Instead, redo
1801 the code so that it calls 'emacs_abort' rather than 'abort'.
1802 This removes the need for the NO_ABORT configure-time macro
1803 and makes it easier to change the abort code to do a backtrace.
1804 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1805 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1806 Remove; sysdep.c's emacs_abort now takes its place.
1807 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1808 'abort' changed to use 'emacs_abort'.
1809 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1810 (abort) [!defined abort]: Rename to ...
1811 (emacs_abort): ... new name.
1812 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1813 the place of the old 'abort' in emacs.c.
1814 * w32.c, w32fns.c (abort): Do not #undef.
1815 * w32.c (emacs_abort): Rename from w32_abort.
1816
30934d33
EZ
18172012-09-04 Eli Zaretskii <eliz@gnu.org>
1818
1819 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1820 offsets[j].dv, since the y axis of the screen coordinates points
1821 down, while the y axis of the font definition coordinates points
1822 up. This fixes display of Arabic diacritics such as KASRA and
1823 KASRATAN. (Bug#11860)
1824
af26b72c
PE
18252012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1826
1827 Be more systematic about _setjmp vs setjmp.
1828 * alloc.c (test_setjmp, mark_stack):
1829 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1830 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1831 (png_load, my_error_exit, jpeg_load):
1832 * process.c (send_process_trap, send_process):
1833 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1834 The underscored versions are up to 30x faster on some hosts.
1835 Formerly, the code used setjmp+longjmp sometimes and
1836 _setjmp+_longjmp at other times, with no particular reason to
1837 prefer setjmp+longjmp.
1838
26d4541d
PE
18392012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1840
d42f4f0f 1841 Fix minor problem found by static checking.
26d4541d 1842 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 1843
c5e28e39
MR
18442012-09-03 Martin Rudalics <rudalics@gmx.at>
1845
1846 * buffer.c (Fdelete_all_overlays): New function.
1847
3eab3ca9
CY
18482012-09-03 Chong Yidong <cyd@gnu.org>
1849
1850 * gtkutil.c: Add extern decl for Qxft.
1851
c04889f8
PE
18522012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1853
1882aa38
PE
1854 * emacs.c, eval.c: Use bool for boolean.
1855 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1856 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1857 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1858 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1859 (main, decode_env_path, Fdaemon_initialized):
1860 * eval.c (call_debugger, Finteractive_p, interactive_p):
1861 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1862 (maybe_call_debugger, Fbacktrace):
1863 * process.c (read_process_output, exec_sentinel):
1864 Use bool for booleans.
1865 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1866 All callers changed.
1867 * eval.c (interactive_p): Omit always-true boolean argument
1868 EXCLUDE_SUBRS_P. All callers changed.
1869 * dispextern.h, lisp.h: Reflect above API changes.
1870 * firstfile.c (dummy): Use the address of 'main', whose signature
1871 won't change, instead of the address of 'initialize', whose
1872 signature just changed from int to bool.
1873 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1874 * msdos.c (fatal_error_in_progress): ... from here.
1875 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1876 of incrementing it.
1877 (redisplay_internal, unwind_redisplay): Simply clear
1878 REDISPLAYING_P when unwinding, instead of saving its previous,
1879 always-false value and then restoring it.
1880
a411ac43
PE
1881 Clean up some extern decls.
1882 Mostly, this hoists extern decls out of .c files and into .h files.
1883 That way, we're more likely to catch errors if the interfaces change.
1884 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1885 declare xg_mark_data.
1886 * dispextern.h (x_frame_parm_handlers):
1887 * font.h (Qxft):
1888 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1889 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1890 (Qultra_bold, Qoblique, Qitalic):
1891 Move extern decl here from .c file.
1892 * alloc.c (xg_mark_data) [USE_GTK]:
1893 * doc.c (Qclosure):
1894 * eval.c (Qlexical_binding):
1895 * fns.c (time) [!HAVE_UNISTD_H]:
1896 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1897 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1898 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1899 * lread.c (Qinternal_interpreter_environment):
1900 * minibuf.c (Qbuffer):
1901 * process.c (QCfamily, QCfilter):
1902 * widget.c (free_frame_faces):
1903 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1904 * xfont.c (x_clear_errors):
1905 * xterm.c (x_frame_parm_handlers):
1906 Remove now-redundant extern decls.
1907 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1908 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1909 Now static.
1910 * xfaces.c: Remove unnecessary static decls.
1911 * xterm.c (updating_frame): Remove decl of nonexistent object.
1912
c04889f8
PE
1913 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1914 when building globals.h, as the objects that are not built on
1915 this host are not needed to compile C files on this host.
1916
8b339673
JD
19172012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1918
1919 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1920
1921 * frame.h: Add missing prototype for x_wm_set_size_hint.
1922
a08d4ba7
PE
19232012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1924
1925 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1926 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1927 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1928 (Fsubstitute_command_keys):
1929 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1930 (save_excursion_save, save_excursion_restore)
1931 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1932 (format_time_string, general_insert_function)
1933 (make_buffer_string, make_buffer_string_both)
1934 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1935 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1936 (copy_text, insert_1, insert_1_both, insert_from_string)
1937 (insert_from_string_before_markers, insert_from_string_1)
1938 (insert_from_buffer, insert_from_buffer_1, replace_range)
1939 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1940 (del_range_2, modify_region):
1941 * intervals.c (intervals_equal, balance_possible_root_interval)
1942 (adjust_intervals_for_insertion, merge_properties_sticky)
1943 (graft_intervals_into_buffer, lookup_char_property)
1944 (adjust_for_invis_intang, set_point_both)
1945 (get_property_and_range, compare_string_intervals)
1946 (set_intervals_multibyte_1, set_intervals_multibyte):
1947 * keyboard.c (decode_timer):
1948 Use bool for boolean.
1949 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1950 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1951
48c948de
CY
19522012-09-02 Chong Yidong <cyd@gnu.org>
1953
1954 * keymap.c (push_key_description): Print M-TAB as C-M-i
1955 (Bug#11758).
1956
6c49a40b
JB
19572012-09-02 Juanma Barranquero <lekktu@gmail.com>
1958
1959 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1960 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1961 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1962 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1963 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1964 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1965 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1966
4dfbd238
EZ
19672012-09-01 Eli Zaretskii <eliz@gnu.org>
1968
7e510e28
EZ
1969 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1970 more than one grapheme cluster passed to the shaper: compute the
1971 offset adjustment values separately for each cluster. (Bug#11860)
1972
4dfbd238
EZ
1973 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1974 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1975 about implicit conversions from integer to pointer.
1976
86571ae0
DC
19772012-09-01 Daniel Colascione <dancol@dancol.org>
1978
1979 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1980 system used too early.
1981
0e23ef9d
PE
19822012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1983
1984 Better seed support for (random).
1985 * emacs.c (main): Call init_random.
1986 * fns.c (Frandom): Set the seed from a string argument, if given.
1987 Remove long-obsolete Gentzel cruft.
1988 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1989 (init_random): New function.
1990
17a2cbbd
DC
19912012-09-01 Daniel Colascione <dancol@dancol.org>
1992
1993 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1994 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1995 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1996 x_wm_set_size_hint, x_query_colors, x_real_positions,
1997 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1998 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1999 all of which have been moved to common code.
2000
2001 * xfaces.c: Include TERM_HEADER instead of listing all possible
2002 window-system headers.
2003
2004 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2005 to match header.
2006
2007 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2008 directly accessing frame internals.
2009
f18cbb28 2010 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
2011 globals_of_w32font.
2012
2013 * process.c: Include TERM_HEADER instead of listing all possible
2014 window-system headers.
2015
3a880af4
SM
2016 * nsterm.h: Remove declarations now in frame.h.
2017 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
2018
2019 * menu.c: Include TERM_HEADER instead of listing all possible
2020 window-system headers.
2021
2022 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2023 window system.
2024
2025 * keyboard.c: Include TERM_HEADER instead of listing all possible
2026 window-system headers.
2027
2028 * image.c: Include TERM_HEADER instead of listing all possible
2029 window-system headers. Declare Vlibrary_cache when compiling for
2030 Windows.
2031
2032 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2033 window system declarations.
2034
2035 * frame.h: Move common functions here: set_frame_menubar,
2036 x_set_window_size, x_sync, x_get_focus_frame,
2037 x_set_mouse_position, x_set_mouse_pixel_position,
2038 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
2039 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
2040 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
2041 x_activate_menubar, x_real_positions, x_bitmap_icon,
2042 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
2043 and x_query_colors.
2044
2045 * frame.c: Include TERM_HEADER instead of listing all possible
2046 window-system headers.
2047
2048 * font.c: Include TERM_HEADER instead of listing all possible
2049 window-system headers.
2050
2051 * emacs.c: Include TERM_HEADER.
2052
f18cbb28
EZ
2053 * dispnew.c: Include TERM_HEADER instead of listing all possible
2054 window-system headers.
17a2cbbd 2055
f18cbb28 2056 * ccl.h: Include character.h.
17a2cbbd
DC
2057
2058 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2059 the current window system; include in list of objects to link into
2060 Emacs.
2061
c650a5de
DA
20622012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2063
2064 Remove mark_ttys function and fix tty_display_info initialization.
2065 * lisp.h (mark_ttys): Remove prototype.
2066 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2067 to mark_ttys because all possible values of 'top_frame' slot are
2068 the frames which are reachable from Vframe_list.
2069 * term.c (mark_ttys): Remove.
2070 (init_tty): Safely initialize 'top_frame' slot with Qnil.
2071
4e0f6479
DA
20722012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2073
2074 Change struct frame bitfields from unsigned char to unsigned.
2075 * frame.h (struct frame): Change type of 'display_preempted',
2076 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2077 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2078 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2079 bitfields from unsigned char to unsigned.
2080
8b96a52c
DA
20812012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2082
2083 Remove unused member of struct x_output and struct w32_output.
2084 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2085 * w32term.h (struct w32_output): Likewise.
2086
b4444c8a
JD
20872012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2088
2089 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2090 does not become zero (Bug#12234).
2091
b98521db
PE
20922012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2093
2094 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2095 for GCC 4.7.1 x86-64.
2096
31d02438
GM
20972012-08-30 Glenn Morris <rgm@gnu.org>
2098
2099 * lread.c (init_lread): For out-of-tree builds, only add the
2100 source directory's site-lisp dir to the load-path if it exists,
2101 consistent with in-tree builds. (Bug#12302)
2102
7f8941d8
JD
21032012-08-28 Jan Djärv <jan.h.d@swipnet.se>
2104
2105 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 2106 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
2107 (windowShouldClose:): Set window_closed.
2108 (dealloc): New member, free button_values.
fc0c31f8
JB
2109 (process_dialog:): Make member function. Remove window argument,
2110 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
2111 in button_values.
2112 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 2113 with tag. Remove return self, declare return value as void.
7f8941d8
JD
2114 (addString:row:): Remove return self, declare return value as void.
2115 (addSplit): Remove return self, declare return value as void.
2116 (clicked:): Remove return self, declare return value as void.
fc0c31f8 2117 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
2118 (initFromContents:isQuestion:): Adjust call to process_dialog.
2119 Code formatting change.
2120 (timeout_handler:): Set timer_fired to YES.
2121 (runDialogAt:): Set timer_fired to NO.
2122 Handle click on close button as quit.
2123
2124 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
2125 Add window_closed and button_values. Add void as return value for
2126 add(Button|String|Split). addButton takes int instead of Lisp_Object.
2127 Add process_dialog as new member.
2128
eada0861 21292012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 2130
eada0861
GM
2131 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
2132 is not one of the heaps we manage. (Bug#12242)
2133
21342012-08-28 Glenn Morris <rgm@gnu.org>
2135
2136 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
2137
457294dd
MR
21382012-08-28 Martin Rudalics <rudalics@gmx.at>
2139
2140 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
2141 auto-buffer-name window parameter. Install revision of reverted
2142 fix.
457294dd 2143
4f2daf31
DA
21442012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2145
2146 Do not allow to set major mode for a dead buffer.
2147 * buffer.c (Fset_buffer_major_mode): Signal an error
2148 if the buffer is dead.
2149 (Fother_buffer, other_buffer_safely): Remove redundant
2150 nested declaration.
2151
66322887
DA
21522012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2153
2154 Always use set_buffer_if_live to restore original buffer at unwind.
2155 * buffer.h (record_unwind_current_buffer): New function.
2156 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
2157 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
2158 * undo.c, window.c: Adjust users.
2159 * buffer.c (set_buffer_if_live): Fix comment.
2160
a3d794a1
DA
21612012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2162
2163 Fix usage of set_buffer_internal.
2164 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
2165 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
2166 * coding.c (decode_coding): Omit redundant test.
2167 * fileio.c (decide_coding_unwind): Likewise.
2168 * fns.c (secure_hash): Likewise.
2169 * insdel.c (modify_region): Likewise.
2170 * keyboard.c (command_loop_1): Likewise.
2171 * print.c (PRINTFINISH): Likewise.
2172 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
2173
59ea14cd
PE
21742012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2175
2176 * dispnew.c: Use bool for boolean.
2177 (frame_garbaged, display_completed, delayed_size_change)
2178 (fonts_changed_p, add_window_display_history)
2179 (add_frame_display_history, verify_row_hash)
2180 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
2181 (row_equal_p, realloc_glyph_pool)
2182 (allocate_matrices_for_frame_redisplay)
2183 (showing_window_margins_p)
2184 (adjust_frame_glyphs_for_frame_redisplay)
2185 (build_frame_matrix_from_leaf_window, make_current)
2186 (mirrored_line_dance, mirror_line_dance, update_frame)
2187 (update_window_tree, update_single_window)
2188 (check_current_matrix_flags, update_window, update_text_area)
2189 (update_window_line, set_window_update_flags, scrolling_window)
2190 (update_frame_1, scrolling, buffer_posn_from_coords)
2191 (do_pending_window_change, change_frame_size)
2192 (change_frame_size_1, sit_for):
2193 Use bool for boolean.
2194 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2195 and remove last int (actually boolean) argument, which was always 0.
2196 All callers changed.
2197 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2198 * dispextern.h (struct composition_it): Use bool for boolean.
2199 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2200 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2201 * dired.c (file_name_completion):
2202 Use bool for boolean. (This was missed in an earlier change.)
2203
95072a94
MR
22042012-08-27 Martin Rudalics <rudalics@gmx.at>
2205
2206 * window.c (Fset_window_configuration): Revert first part of
2207 last change.
2208
0f19feff
JD
22092012-08-27 Jan Djärv <jan.h.d@swipnet.se>
2210
2211 * nsterm.h (NSPanel): New class variable dialog_return.
2212
3a880af4
SM
2213 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2214 Initialize dialog_return.
0f19feff
JD
2215 (windowShouldClose:): Use stop instead of stopModalWithCode.
2216 (clicked:): Ditto, and also set dialog_return (Bug#12258).
2217 (timeout_handler:): Use stop instead of abortModal. Send a dummy
2218 event.
2219 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
2220 modal loop returns.
2221
f10fe38f
PE
22222012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2223
de1339b0
PE
2224 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2225 * composite.c (find_composition, composition_gstring_p)
2226 (composition_reseat_it, find_automatic_composition):
2227 * data.c (let_shadows_buffer_binding_p)
2228 (let_shadows_global_binding_p, set_internal, make_blv)
2229 (Fmake_variable_buffer_local, Fmake_local_variable)
2230 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2231 (cons_to_signed, arith_driver):
2232 * dbusbind.c (xd_in_read_queued_messages):
2233 * dired.c (directory_files_internal, file_name_completion):
2234 Use bool for booleans.
2235 * dired.c (file_name_completion):
2236 * process.h (fd_callback):
2237 Omit int (actually boolean) argument. It wasn't being used.
2238 All uses changed.
2239 * composite.h, lisp.h: Reflect above API changes.
2240
f10fe38f
PE
2241 * cmds.c, coding.c: Use bool for booleans.
2242 * cmds.c (move_point, Fself_insert_command):
2243 * coding.h (struct composition status, struct coding_system):
2244 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2245 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2246 (emacs_mule_char, decode_coding_emacs_mule)
2247 (encode_coding_emacs_mule, detect_coding_iso_2022)
2248 (decode_coding_iso_2022, encode_invocation_designation)
2249 (encode_designation_at_bol, encode_coding_iso_2022)
2250 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2251 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2252 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2253 (encode_coding_raw_text, detect_coding_charset)
2254 (decode_coding_charset, encode_coding_charset, detect_eol)
2255 (detect_coding, get_translation_table, produce_chars)
2256 (consume_chars, reused_workbuf_in_use)
2257 (make_conversion_work_buffer, code_conversion_save)
2258 (decode_coding_object, encode_coding_object)
2259 (detect_coding_system, char_encodable_p)
2260 (Funencodable_char_position, code_convert_region)
2261 (code_convert_string, code_convert_string_norecord)
2262 (Fset_coding_system_priority):
2263 * fileio.c (Finsert_file_contents):
2264 Use bool for booleans.
2265 * coding.h, lisp.h: Reflect above API changes.
2266 * coding.c: Remove unnecessary static function decls.
2267 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2268 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2269 not a boolean 'int', since callers never look at the return value.
2270 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2271 * coding.h (decoding_buffer_size, encoding_buffer_size)
2272 (emacs_mule_string_char): Remove unused extern decls.
2273 (struct iso_2022_spec, struct coding_system):
2274 Use 'unsigned int : 1' for boolean fields, since there's more than one.
2275 (struct emacs_mule_spec): Remove unused field 'full_support'.
2276 All initializations removed.
2277 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2278
5474c384
DA
22792012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2280
f10fe38f 2281 Fix spare memory change (Bug#12286).
5474c384
DA
2282 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
2283 (valid_lisp_object_p): Likewise.
2284
c4b6914d
MR
22852012-08-27 Martin Rudalics <rudalics@gmx.at>
2286
2287 * window.c (Fset_window_configuration): Record any window's old
2288 buffer if it's replaced (see Bug#8789). If the new current
2289 buffer doesn't appear in the selected window, go to its old
2290 point (Bug#12208).
2291
35aaa1ea
DA
22922012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2293
2294 Special MEM_TYPE_SPARE to denote reserved memory.
2295 * alloc.c (enum mem_type): New memory type.
2296 (refill_memory_reserve): Use new type for spare memory.
2297 This prevents live_cons_p and live_string_p from incorrect
2298 detection of uninitialized objects from spare memory as live.
2299
6af64513
PE
23002012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2301
8b2e00a3
PE
2302 Spelling fixes.
2303 * Makefile.in (.PHONY): versioclean -> versionclean.
2304
b52d6985
PE
2305 Remove unused external symbols.
2306 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2307 * window.c (Qwindow_valid_p, decode_valid_window):
2308 Now static, not extern.
2309 * data.c (Qinterval): Remove; unused.
2310 (syms_of_data): Do not define 'interval'.
2311 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2312 * window.h (decode_valid_window):
2313 Remove decls.
2314
d5172d4f
PE
2315 * character.c, charset.c, chartab.c: Use bool for booleans.
2316 * character.c (lisp_string_width, string_count_byte8)
2317 (string_escape_byte8):
2318 * charset.c (charset_map_loaded, load_charset_map, read_hex):
2319 (load_charset_map_from_file, map_charset_chars)
2320 (Fdefine_charset_internal, define_charset_internal)
2321 (Fdeclare_equiv_charset, find_charsets_in_text)
2322 (Ffind_charset_region, char_charset, Fiso_charset):
2323 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2324 (sub_char_table_set, sub_char_table_set_range)
2325 (char_table_set_range, optimize_sub_char_table)
2326 (map_sub_char_table):
2327 Use bool for boolean.
2328 * character.c (str_to_unibyte): Omit last boolean argument; it was
2329 always 0. All callers changed.
2330 * character.h, charset.h: Adjust to match previous changes.
2331 * character.h (char_printable_p): Remove decl of nonexistent function.
2332 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2333 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2334 are all boolean, so make them single-bit bitfields.
2335
6af64513
PE
2336 * lisp.h (ASET): Remove attempt to detect side effects.
2337 It was meant to be temporary and it often doesn't work,
2338 because when IDX has side effects the behavior of IDX==IDX
2339 is undefined. See Stefan Monnier in
2340 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2341
e1f29348
BR
23422012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2343
2344 * lisp.h (functionp): New function (extracted from Ffunctionp).
2345 (FUNCTIONP): Use it.
2346 * eval.c (Ffunctionp): Use it.
2347
17c05d74
PE
23482012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2349
0f46bc75
PE
2350 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2351 as that's faster and simpler than static storage. Don't bother
2352 with the g_main_context_query overhead if g_main_context_pending
2353 says no events are pending.
2354 (gfds, gfds_size): Remove these static vars.
2355 (xgselect_initialize): Remove; no longer needed.
2356 All uses and decls removed.
2357
ee4c0f69
PE
2358 * emacs.c (fatal_error_signal_hook): Remove.
2359 All uses removed. This leftover from old code was always 0.
2360
17c05d74
PE
2361 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2362 * casefiddle.c (casify_object, casify_region):
2363 * casetab.c (set_case_table):
2364 * category.c, category.h (word_boundary_p):
2365 * category.h (CHAR_HAS_CATEGORY):
2366 Use bool for booleans, instead of int.
2367
391ceac5
EZ
23682012-08-25 Eli Zaretskii <eliz@gnu.org>
2369
2370 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2371
2f221583
PE
23722012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2373
f4a681b0
PE
2374 On assertion failure, print backtrace if available.
2375 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2376 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2377 * Makefile.in (LIB_EXECINFO): New macro.
2378 (LIBES): Use it.
2379
2f221583
PE
2380 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2381 * bytecode.c (exec_byte_code):
2382 * callint.c (check_mark, Fcall_interactively):
2383 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2384 (getenv_internal, sync_process_alive, call_process_exited):
2385 * lisp.h (USE_SAFE_ALLOCA):
2386 Use bool for booleans, instead of int.
2387 * lisp.h, process.h: Adjust prototypes to match above changes.
2388 * callint.c (Fcall_interactively): Don't assume the mark's
2389 offset fits in 'int'.
2390
37ef52bb
PE
23912012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2392
2393 * buffer.c, buffer.h: Use bool for boolean.
2394 * buffer.c (reset_buffer_local_variables)
2395 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2396 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2397 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2398 (overlay_touches_p, overlay_strings, Foverlay_put)
2399 (report_overlay_modification, call_overlay_mod_hooks):
2400 (mmap_enlarge, mmap_set_vars):
2401 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2402 Use bool for booleans, instead of int.
2403 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2404 since the 1-or-0 return value is always ignored anyway.
2405 (mmap_initialized_p):
2406 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2407 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2408
2cc21167
PE
24092012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2410
2411 * bidi.c: Use bool for boolean.
2412 This is a bit more readable, and makes the text segment of bidi.o
2413 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2414 Presumably it's faster too.
2415 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2416 Now bool.
2417 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2418 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2419 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2420 (bidi_explicit_dir_char, bidi_level_of_next_char)
2421 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2422 Use bool for booleans, instead of int.
2423 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2424 (bidi_unshelve_cache): Adjust decls to match code.
2425
7db4ddf4
MR
24262012-08-23 Martin Rudalics <rudalics@gmx.at>
2427
2428 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2429 argument.
2430
b1bb8011
PE
24312012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2432
2433 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2434 * atimer.h: Include <stdbool.h>.
2435
ff687885
DN
24362012-08-22 Dan Nicolaescu <dann@gnu.org>
2437
2438 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2439 compile time tests instead of run time tests on systems that do
2440 not use them.
2441 (FRAME_MAC_P): Remove leftover from deleted code.
2442 * frame.c (syms_of_frame): Remove leftover from deleted code.
2443
4ce7a138
JD
24442012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2445
2446 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2447
d733ec6d
PE
24482012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2449
2450 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2451 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 2452 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
2453 (fontset_add): Return void, for FONTSET_ADD.
2454
d0d2d26f
PE
24552012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2456
fce31d69
PE
2457 * alloc.c: Use bool for booleans.
2458 (gc_in_progress, abort_on_gc)
2459 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2460 (dont_register_blocks) [GC_MALLOC_CHECK]:
2461 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2462 (check_string_bytes, make_specified_string, memory_full)
2463 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2464 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2465 (mark_stack, valid_pointer_p, make_pure_string)
2466 (Fgarbage_collect, survives_gc_p, gc_sweep):
2467 Use bool for booleans, instead of int.
2468 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2469 Remove unused local.
2470 * alloc.c (PURE_POINTER_P):
2471 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2472 * editfns.c (Fformat):
2473 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2474 (Fdo_auto_save):
2475 * fns.c (sweep_weak_table):
2476 * lisp.h (suppress_checking, push_message, survives_gc_p)
2477 (make_pure_string, gc_in_progress, abort_on_gc):
2478 * lread.c (readchar, read1):
2479 * print.c (Fprin1_to_string):
2480 * xdisp.c (push_message):
2481 Use bool for booleans affected directly or indirectly by
2482 alloc.c's changes.
2483
d0d2d26f
PE
2484 Make recently-introduced setters macros.
2485 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2486 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2487 (set_fontset_default, set_fontset_fallback): Rename from their
2488 upper-case counterparts, and make them functions rather than macros.
2489 This is more consistent with the other recently-introduced setters.
2490 These don't need to be inline, since they're local.
2491
d18e2bb6
JD
24922012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2493
2494 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2495 the loop (Bug#12247).
2496
1b9d9d16
PE
24972012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2498
2499 * lisp.h (vcopy): Use memcpy rather than our own loop.
2500 This fixes a performance regression introduced by the recent
2501 addition of vcopy. This means 'vcopy' will need to be modified
2502 for a copying collector, but that's OK. Also, tighten the
2503 checking in the assertion.
2504
b2f09701
EZ
25052012-08-21 Eli Zaretskii <eliz@gnu.org>
2506
2507 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2508 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2509 non-base glyph for the width of the base character, according to
e1f29348
BR
2510 what x_draw_composite_glyph_string_foreground expects.
2511 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
2512 expectations, to produce correct width of the composed character.
2513 Reverse the sign of the DU offset produced by ScriptPlace.
2514
9b994fed
PE
25152012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2516
2517 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2518
086ca913
DA
25192012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2520
2521 Avoid direct writes to contents member of struct Lisp_Vector.
2522 * lisp.h (vcopy): New function to copy data into vector.
2523 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2524 * fns.c (Ffillarray): Use ASET.
2525 * keyboard.c (timer_check_2): Use AREF and ASET.
2526 (append_tool_bar_item, Frecent_keys): Use vcopy.
2527 * lread.c (read_vector): Use ASET.
2528 * msdos.c (Frecent_doskeys): Use vcopy.
2529 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2530 (Finternal_merge_in_global_face): Use ASET and vcopy.
2531 * xfont.c (xfont_list_pattern): Likewise.
2532
5481664a
MR
25332012-08-21 Martin Rudalics <rudalics@gmx.at>
2534
2535 * window.c (Fwindow_point): For the selected window always return
2536 the position of its buffer's point.
2537 (Fset_window_point): For the selected window always go in its
2538 buffer to the specified position.
2539
6d470bdd
DA
25402012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2541
2542 Setter macros for fontsets.
2543 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2544 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2545 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2546 Adjust users.
2547
24564fe1
GM
25482012-08-20 Glenn Morris <rgm@gnu.org>
2549
2550 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2551 Don't assume that `ln -f' works.
2552
0a05a035
EZ
25532012-08-20 Eli Zaretskii <eliz@gnu.org>
2554
2555 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2556 and later about non-assignments with no effect. See discussion at
2557 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2558 details.
2559
e46f2325
DA
25602012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2561
2562 Inline setter functions for Lisp_Objects slots of struct specbinding.
2563 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2564 Adjust users.
2565
734fbd86
MR
25662012-08-20 Martin Rudalics <rudalics@gmx.at>
2567
2568 * window.c (select_window): Always make selected window's buffer
2569 current.
2570
f1a95992
DA
25712012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2572
2573 Use AREF and ASET for docstrings of category tables.
2574 * category.h (CATEGORY_DOCSTRING): Use AREF.
2575 (SET_CATEGORY_DOCSTRING): Use ASET.
2576 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2577
e83064be
DA
25782012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2579
2580 Inline setter functions for hash table members.
2581 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2582 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2583 (set_hash_key_and_value, set_hash_index, set_hash_next)
2584 (set_hash_hash): New functions.
2585 * charset.c, fns.c: Adjust users.
2586
4ce60d2e
DA
25872012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2588
2589 Inline getter and setter functions for per-buffer values.
2590 * buffer.h (per_buffer_default, set_per_buffer_default)
2591 (per_buffer_value, set_per_buffer_value): New functions.
2592 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2593 * buffer.c, data.c: Adjust users.
2594
c06c9690
JB
25952012-08-20 Juanma Barranquero <lekktu@gmail.com>
2596
2597 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2598
32bd4250
PE
25992012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2600
bad03192 2601 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
2602 as gnulib does this if the system doesn't.
2603 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
2604 Remove declaration. MS-Windows declares it on stdlib.h which is
2605 included by conf_post.h.
b69a6d22
PE
2606 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2607 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2608 * vm-limit.c: Include <unistd.h>, for 'environ'.
2609
22d7feb2
PE
2610 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2611 (start_of_data): Remove decl; mem-limits.h provides it.
2612
32bd4250
PE
2613 * xdisp.c (handle_invisible_prop): Make it a bit faster
2614 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2615
450809af
CY
26162012-08-19 Chong Yidong <cyd@gnu.org>
2617
2618 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2619 ends (Bug#3874).
2620
9e677988
AS
26212012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2622
6b1319ce
AS
2623 * .gdbinit: Use call instead of set when calling a function in the
2624 inferior.
2625
9e677988
AS
2626 * data.c (set_internal): Don't use set_blv_found.
2627 (Fkill_local_variable): Likewise.
2628
d7191076
AA
26292012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2630
2631 * nsfont.m (ns_ascii_average_width): Ensure the string
2632 ascii_printable is initialized with a null-terminated character
2633 array. Otherwise, it can contain undesired extra characters.
2634
e757f1c6
PE
26352012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2636
2637 port new setting code to Sun C 5.8 2005/10/13
2638 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2639 Return void, not Lisp_Object. Otherwise, the compiler
2640 complains about (A?B:C) where B is void and C is Lisp_Object
2641 when compiling CHAR_TABLE_SET, due to the recent change to
2642 the API of sub_char_table_set_contents.
2643
a999ce26
CY
26442012-08-18 Chong Yidong <cyd@gnu.org>
2645
2646 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2647 for the string case (Bug#3874).
2648
3f22b86f
PE
26492012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2650
39eb03f1
PE
2651 * buffer.h (BSET): Remove (Bug#12215).
2652 Replace all uses with calls to new setter functions.
2653 (bset_bidi_paragraph_direction, bset_case_canon_table)
2654 (bset_case_eqv_table, bset_directory, bset_display_count)
2655 (bset_display_time, bset_downcase_table)
2656 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2657 (bset_last_selected_window, bset_local_var_alist)
2658 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2659 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2660 (bset_width_table):
2661 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2662 (bset_auto_fill_function, bset_auto_save_file_format)
2663 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2664 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2665 (bset_cache_long_line_scans, bset_case_fold_search)
2666 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2667 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2668 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2669 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2670 (bset_header_line_format, bset_indicate_buffer_boundaries)
2671 (bset_indicate_empty_lines, bset_invisibility_spec)
2672 (bset_left_fringe_width, bset_major_mode, bset_mark)
2673 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2674 (bset_name, bset_overwrite_mode, bset_pt_marker)
2675 (bset_right_fringe_width, bset_save_length)
2676 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2677 (bset_scroll_up_aggressively, bset_selective_display)
2678 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2679 (bset_word_wrap, bset_zv_marker):
2680 * category.c (bset_category_table):
2681 * syntax.c (bset_syntax_table):
2682 New setter functions.
2683
6a09a33b
PE
2684 * process.h (PSET): Remove (Bug#12215).
2685 Replace all uses with calls to new setter functions.
2686 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2687 (PROCESS_INLINE): New macro.
2688 (pset_childp): New setter function.
2689 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2690 * process.c (PROCESS_INLINE):
2691 Define to EXTERN_INLINE, so that the corresponding functions
2692 are compiled into code.
2693 (pset_buffer, pset_command, pset_decode_coding_system)
2694 (pset_decoding_buf, pset_encode_coding_system)
2695 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2696 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2697 (pset_type, pset_write_queue): New setter functions.
2698
e8c17b81
PE
2699 * window.h (WSET): Remove (Bug#12215).
2700 Replace all uses with calls to new setter functions.
2701 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2702 (WINDOW_INLINE): New macro.
2703 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2704 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2705 (wset_total_lines, wset_vertical_scroll_bar)
2706 (wset_window_end_pos, wset_window_end_valid)
2707 (wset_window_end_vpos): New setter functions.
2708 * window.c (WINDOW_INLINE):
2709 Define to EXTERN_INLINE, so that the corresponding functions
2710 are compiled into code.
2711 (wset_combination_limit, wset_dedicated, wset_display_table)
2712 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2713 (wset_new_normal, wset_new_total, wset_next_buffers)
2714 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2715 (wset_prev_buffers, wset_right_fringe_width)
2716 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2717 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2718 (wset_window_parameters):
2719 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2720 (wset_column_number_displayed, wset_region_showing):
2721 New setter functions.
2722
3f22b86f
PE
2723 * termhooks.h (TSET): Remove (Bug#12215).
2724 Replace all uses with calls to new setter functions.
2725 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2726 (TERMHOOKS_INLINE): New macro.
2727 (tset_charset_list, tset_selection_alist): New setter functions.
2728 * terminal.c (TERMHOOKS_INLINE):
2729 Define to EXTERN_INLINE, so that the corresponding functions
2730 are compiled into code.
2731 (tset_param_alist): New setter function.
2732
742af32f
PE
27332012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2734
15dbb4d6
PE
2735 * keyboard.h (KSET): Remove (Bug#12215).
2736 Replace all uses with calls to new setter functions.
2737 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2738 (KEYBOARD_INLINE): New macro.
2739 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2740 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2741 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2742 New setter functions.
2743 * keyboard.c (KEYBOARD_INLINE):
2744 Define to EXTERN_INLINE, so that the corresponding functions
2745 are compiled into code.
2746 (kset_echo_string, kset_kbd_queue)
2747 (kset_keyboard_translate_table, kset_last_prefix_arg)
2748 (kset_last_repeatable_command, kset_local_function_key_map)
2749 (kset_overriding_terminal_local_map, kset_real_last_command)
2750 (kset_system_key_syms): New setter functions.
2751
f00af5b1
PE
2752 * frame.h (FSET): Remove (Bug#12215).
2753 Replace all uses with calls to new setter functions.
2754 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2755 (FRAME_INLINE): New macro.
2756 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2757 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2758 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2759 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2760 (fset_param_alist, fset_root_window, fset_scroll_bars)
2761 (fset_selected_window, fset_title, fset_tool_bar_items)
2762 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2763 * frame.c (FRAME_INLINE):
2764 Define to EXTERN_INLINE, so that the corresponding functions
2765 are compiled into code.
2766 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2767
0c94c8d6
PE
2768 A few more naming-convention fixes for getters and setters.
2769 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2770 and rename from buffer_overlays_set_before.
2771 (set_buffer_overlays_after): Move here from buffer.h, and rename
2772 from buffer_overlays_set_after.
2773 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2774 All uses changed.
2775 (set_buffer_intervals): Rename from buffer_set_intervals.
2776 * intervals.c (set_interval_object): Move here from intervals.h,
2777 and rename from interval_set_object.
2778 (set_interval_left): Move here from intervals.h, and rename from
2779 interval_set_left.
2780 (set_interval_right): Move here from intervals.h, and rename from
2781 interval_set_right.
2782 (copy_interval_parent): Move here from intervals.h, and rename from
2783 interval_copy_parent.
2784 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2785 (set_interval_plist): Rename from interval_set_plist.
2786 Return void, not Lisp_Object, since no caller uses the result.
2787 * lisp.h (string_intervals): Rename from string_get_intervals.
2788 (set_string_intervals): Rename from string_set_intervals.
2789
34dabdb7
PE
2790 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2791 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 2792 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
2793 All uses changed. See the end of
2794 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2795
742af32f
PE
2796 * lisp.h (CSET): Remove (Bug#12215).
2797 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2798 (set_char_table_purpose): New functions,
2799 replacing CSET. All uses changed. For example, replace
2800 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 2801 "set_char_table_parent (char_table, parent);".
742af32f
PE
2802 The old version was confusing because it used the same name
2803 'parent' for two different things.
2804
a04e2c62
DA
28052012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2806
2807 Functions to get and set Lisp_Object fields of buffer-local variables.
2808 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2809 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2810 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2811 * data.c, eval.c, frame.c: Adjust users.
2812
383dcbf9
CY
28132012-08-17 Chong Yidong <cyd@gnu.org>
2814
2815 * xfaces.c (merge_face_vectors): If the target font specfies a
2816 font spec, make the font's attributes take precedence over
2817 directly-specified attributes.
2818 (merge_face_ref): Recognize :font.
2819
44386687
DA
28202012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2821
2822 Do not use memcpy for copying intervals.
2823 * intervals.c (reproduce_interval): New function.
2824 (reproduce_tree, reproduce_tree_obj): Use it.
2825 (reproduce_tree_obj): Remove prototype.
2826
927c7216
PE
28272012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2828
2829 * lisp.h (duration_to_sec_usec): Remove unused decl.
2830
93044f7b
AA
28312012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2832
2833 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2834 to an allocated instance of NSString, not to the class itself.
2835
9851e4a5
JB
28362012-08-17 Juanma Barranquero <lekktu@gmail.com>
2837
2838 * makefile.w32-in (C_CTYPE_H): New macro.
2839 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2840 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2841 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2842
620f13b0
PE
28432012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2844
2845 Use ASCII tests for character types.
2846 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2847 * xfns.c, xterm.c:
2848 Don't include <ctype.h>; was not needed.
2849 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2850 * sysdep.c, xfaces.c:
2851 Include <c-ctype.h> instead of <ctype.h>.
2852 * nsterm.m: Include <c-ctype.h>.
2853 * charset.c (read_hex):
2854 * doc.c (Fsnarf_documentation):
2855 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2856 (DRIVE_LETTER) [DOS_NT]:
2857 (Ffile_name_directory, Fexpand_file_name)
2858 (Fsubstitute_in_file_name):
2859 * font.c (font_parse_xlfd, font_parse_fcname):
2860 * frame.c (x_set_font_backend):
2861 * gtkutil.c (xg_get_font):
2862 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2863 * nsimage.m (hexchar):
2864 * nsterm.m (ns_xlfd_to_fontname):
2865 * sysdep.c (system_process_attributes):
2866 * xfaces.c (hash_string_case_insensitive):
2867 Use C-locale tests instead of locale-specific tests for character
2868 types, since we want the ASCII interpretation here, not the
2869 interpretation suitable for whatever happens to be the current locale.
2870
52162052
MR
28712012-08-16 Martin Rudalics <rudalics@gmx.at>
2872
2873 Consistently check windows for validity/liveness
2874 (Bug#11984, Bug#12025, Bug#12026).
2875 * lisp.h (CHECK_VALID_WINDOW): New macro.
2876 * window.c (decode_window): Rename to decode_live_window.
2877 (decode_valid_window, Fwindow_valid_p): New functions.
2878 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2879 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2880 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2881 (Fwindow_prev_sibling, Fwindow_combination_limit)
2882 (Fset_window_combination_limit, Fwindow_use_time)
2883 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2884 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2885 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2886 (Fwindow_hscroll, Fset_window_hscroll)
2887 (Fwindow_redisplay_end_trigger)
2888 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2889 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2890 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2891 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2892 (Fwindow_end, Fset_window_point, Fset_window_start)
2893 (Fpos_visible_in_window_p, Fwindow_line_height)
2894 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2895 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2896 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2897 (Fset_window_parameter, Fwindow_display_table)
2898 (Fset_window_display_table, Fdelete_other_windows_internal)
2899 (Fset_window_buffer, Fset_window_new_total)
2900 (Fset_window_new_normal, Fdelete_window_internal)
2901 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2902 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2903 (Fwindow_scroll_bars): Check whether argument window is a valid or
2904 live window. Update doc-strings.
2905 (syms_of_window): New symbol Qwindow_valid_p.
2906 * keyboard.c (Fposn_at_x_y): Check whether argument
2907 frame_or_window denotes a valid window.
2908
2751c80f
DA
29092012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2910
2911 Fix previous char table change.
2912 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2913 * chartab.c (optimize_sub_char_table): Likewise.
2914
032a42c8
CY
29152012-08-16 Chong Yidong <cyd@gnu.org>
2916
a2d19368
CY
2917 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2918
032a42c8
CY
2919 * xfont.c (xfont_open):
2920 * xftfont.c (xftfont_open): Set the font's max_width field.
2921
2922 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2923 min_width to space_width and average_width to the average over
2924 printable ASCII characters.
2925 (ns_char_width): Code cleanup.
2926 (ns_ascii_average_width): New utility function.
2927
2928 * font.h (struct font): Update comments.
2929
a098c930
DA
29302012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2931
032a42c8 2932 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
2933 * lisp.h (CSET): New macro.
2934 (char_table_set_extras, char_table_set_contents)
2935 (sub_char_table_set_contents): New function.
2936 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2937 * syntax.c: Adjust users.
2938
8be3a09c
SM
29392012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2940
2941 * eval.c (eval_sub): Bind lexical-binding.
2942 * lread.c (Qlexical_binding): Make non-static.
2943
ac4845a6
JD
29442012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2945
ddee6515
JD
2946 * nsmenu.m (popupSession): Remove.
2947 (pop_down_menu): Remove endModalSession.
2948 (timeout_handler:): New method.
2949 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2950 Call runModalForWindow. Check timer_fired when it returns.
2951 If not set, cancel timer and break out of loop.
2952 Otherwise loop again, with a new timeout.
2953
2954 * nsterm.m: Include fcntl.h if present.
2955 (fd_entry, t_readfds, inNsSelect): Remove.
2956 (select_writefds, select_valid, select_timeout, selfds)
2957 (select_mutex, apploopnr): Add.
2958 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2959 Otherwise call kbd_buffer_store_event.
2960 (ns_send_appdefined): Remove release of fd_entry.
2961 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2962 Increment and decrement apploopnr.
2963 (ns_select): If no file descriptors, just do a NSTimer.
2964 Otherwise copy read/write masks and start select thread (fd_handler).
2965 Start main loop and wait for application defined event.
2966 Inform select thread to stop selecting after main loop is exited.
2967 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 2968 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
2969 (fd_handler:): Loop forever, wait for info from the main thread
2970 to either start or stop selecting. When select returns, send
2971 and appdefined event.
2972 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2973 If not call kbd_buffer_store_event.
2974
2975 * nsterm.h (EmacsApp): fd_handler takes id argument.
2976 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2977
ac4845a6
JD
2978 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2979
eb424fe3
EZ
29802012-08-15 Eli Zaretskii <eliz@gnu.org>
2981
2982 * region-cache.c (move_cache_gap): Update gap_len using the actual
2983 growth of the boundaries array. Do not change cache_len.
2984 (Bug#12196)
2985
4e6a86c6
DA
29862012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2987
2988 Generalize and cleanup font subsystem checks.
2989 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
2990 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2991 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 2992
5bf192ca
DA
29932012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2994
2995 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2996
f2045622
CY
29972012-08-15 Chong Yidong <cyd@gnu.org>
2998
8be3a09c
SM
2999 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
3000 When using the new font chooser, use gtk_font_chooser_get_font_desc to
3001 extract the font descriptor instead of just the font name.
3002 In that case, return a font spec instead of a string.
f2045622
CY
3003 (x_last_font_name): Move to this file from xfns.c.
3004
3005 * xfns.c (Fx_select_font): The return value can also be a font
3006 spec. Move x_last_font_name management to gtkutil.c.
3007
3008 * xfaces.c: Make font weight and style symbols non-static.
3009
7f6feb56
SM
30102012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
3011
3012 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3013 (bug#12117).
3014
fecbd8ff
SM
30152012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
3016
3017 * alloc.c (Fgarbage_collect): Use plural form consistently.
3018
9b8d5165
EZ
30192012-08-14 Eli Zaretskii <eliz@gnu.org>
3020
3021 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3022 iteration through the command loop. Fixes a problem whereby mouse
3023 movements are ignored until the first mouse click.
3024
f5d9e83a
PE
30252012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3026
3027 Use bool, not int, for Lisp booleans.
3028 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3029 makes Emacs a bit smaller and presumably a bit faster.
3030 * lisp.h: Include <stdbool.h>.
3031 (struct Lisp_Boolfwd, defvar_bool):
3032 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3033 * regex.c [!emacs]: Include <stdbool.h>.
3034 (false, true): Remove; <stdbool.h> does this for us now.
3035
55802e4a
CY
30362012-08-14 Chong Yidong <cyd@gnu.org>
3037
4abcdac8
CY
3038 * character.c (Fcharacterp): Doc fix (Bug#12076).
3039
3040 * data.c (Findirect_variable): Doc fix (Bug#11040).
3041
55802e4a
CY
3042 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
3043
3044 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 3045 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 3046
8e99d072
BR
30472012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3048
3049 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3050 (bug#12022).
3051
08908aca
MR
30522012-08-14 Martin Rudalics <rudalics@gmx.at>
3053
3054 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3055 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3056 * minibuf.c (choose_minibuf_frame, read_minibuf):
3057 * w32fns.c (x_create_tip_frame):
3058 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3059 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3060
56120d6f
PE
30612012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3062
3063 * intervals.c (offset_intervals): Remove obsolete comment.
3064
67b77c0b
AS
30652012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3066
3067 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3068
f48b82fd
GR
30692012-08-14 Gergely Risko <gergely@risko.hu>
3070
3071 * coding.c (decode_coding): Record buffer modification before
3072 disabling undo_list (Bug#11773).
3073
fd318b54
DA
30742012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3075
3076 Revert and cleanup some recent overlay changes.
3077 * buffer.h (enum overlay_type): Remove.
3078 (buffer_get_overlays, buffer_set_overlays): Likewise.
3079 (buffer_set_overlays_before, buffer_set_overlays_after):
3080 New function. Adjust users.
3081 (unchain_both): Add eassert.
3082
41a62dd9
DA
30832012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3084
3085 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3086
5884c324
PE
30872012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3088
3089 * gtkutil.c (xg_mark_data): Don't assume C99.
3090
ca06f160
JD
30912012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3092
3093 * gtkutil.c (xg_frame_tb_info): New struct.
3094 (TB_INFO_KEY): New define.
3095 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3096 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3097 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3098 if not present.
3099 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 3100 is up to date. Otherwise store new data.
ca06f160
JD
3101 (free_frame_tool_bar): Free xg_frame_tb_info if present.
3102
7864a3f7
DA
31032012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3104
3105 Use KSET for write access to Lisp_Object members of struct kboard.
3106 * keyboard.h (KSET): New macro.
3107 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3108 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3109 * xterm.c: Adjust users.
3110
4c31be61
DA
31112012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3112
3113 Use BSET for write access to Lisp_Object members of struct buffer.
3114 * buffer.h (BSET): New macro.
3115 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3116 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3117 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3118 * window.c, xdisp.c, xfns.c: Adjust users.
3119
14ae4239
BT
31202012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
3121
3122 * lread.c (syms_of_lread): Initialize Vlexical_binding.
3123
32bcadb4
JD
31242012-08-11 Jan Djärv <jan.h.d@swipnet.se>
3125
3d29b2ce 3126 * nsterm.m (not_in_argv): New function.
fc0c31f8 3127 (application:openFile, application:openTempFile:):
3d29b2ce
JD
3128 (application:openFileWithoutUI:, application:openFiles:): Open file
3129 if not_in_argv returns non-zero (bug#12171).
3130
32bcadb4 3131 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
3132 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
3133 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
3134 (xg_get_font_name): Use those functions/macros here.
3135 Reported by Frans Oilinki <moilinki@gmail.com>.
3136
9ff9402d 31372012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
3138
3139 * unexmacosx.c (copy_data_segment): Copy initialized data in
3140 statically linked libraries from input file rather than memory.
3141
db74a5fc
YM
3142 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
3143 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
3144 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
3145
25e65510
GM
31462012-08-10 Glenn Morris <rgm@gnu.org>
3147
3148 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
3149 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
3150
7961135c
DA
31512012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3152
3153 Fix last change to allow compilation with low optimization levels.
3154 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
3155 Reported by Jan Djärv <jan.h.d@swipnet.se>.
3156
42b3a444
DA
31572012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3158
3159 Use common inline syntax in intervals.h.
3160 * intervals.h (INTERVALS_INLINE): New macro.
3161 Change all users from LISP_INLINE.
3162
9fb0c957
DA
31632012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3164
3165 Define Qnone once for all platforms.
3166 * frame.c (Qnone): Define here.
3167 (syms_of_frame): DEFSYM it.
3168 * lisp.h (Qnone): New declaration.
3169 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
3170 * xfns.c: Remove duplication. Adjust users.
3171
65e8ee52
DA
31722012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3173
3174 Remove unused macros from intervals.h.
3175 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
3176 * intervals.c: Adjust comment.
3177
9b855fd6
EZ
31782012-08-10 Eli Zaretskii <eliz@gnu.org>
3179
3180 * w32fns.c <w32_unicode_gui>: New static variable.
3181 (globals_of_w32fns): Initialize it according to os_subtype.
3182 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3183 testing os_subtype.
3184
39cb9e56 31852012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
3186 Eli Zaretskii <eliz@gnu.org>
3187
3188 Fix bug #10299 with Unicode characters sent by customized
3189 keyboards created by MSKLC.
3190 * w32fns.c (INIT_WINDOW_CLASS): New macro.
3191 (w32_init_class): Use it to initialize the Emacs class with either
3192 ANSI or Unicode API calls.
3193 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3194 later.
3195 (w32_wnd_proc): If the character code sent by WM_CHAR or
3196 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3197 original message. Call DefWindowProcW on NT and later.
3198
9374581a
GM
31992012-08-10 Glenn Morris <rgm@gnu.org>
3200
4b94e8cf
GM
3201 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3202
9374581a
GM
3203 * lisp.h (DIRECTORY_SEP): Let configure set it.
3204
a2752828
DA
32052012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
3206
3207 Use TSET for write access to Lisp_Object slots of struct terminal.
3208 * termhooks.h (TSET): New macro.
3209 * coding.c, terminal.c, xselect.c: Adjust users.
3210
cc92c454
SM
32112012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
3212
3213 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
3214 the failing expression, include them in the error message.
3215 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3216 * lisp.h (internal_condition_case_n): Update declaration.
3217
4cb3e6b3
DA
32182012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3219
3220 Inline functions to examine and change buffer overlays.
3221 * buffer.c (unchain_both): New function.
3222 * buffer.h (buffer_get_overlays, buffer_set_overlays):
3223 (buffer_has_overlays): New function.
3224 (enum overlay_type): New enum.
3225 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3226 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3227
8707c1e5
DA
32282012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3229
3230 Inline functions to examine and change buffer intervals.
3231 * alloc.c (mark_interval_tree): Remove.
3232 (MARK_INTERVAL_TREE): Simplify.
3233 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
3234 * intervals.c (buffer_balance_intervals): New function.
3235 (graft_intervals_into_buffer): Adjust indentation.
3236 (set_intervals_multibyte): Simplify.
3237 * buffer.h (BUF_INTERVALS): Remove.
3238 (buffer_get_intervals, buffer_set_intervals): New function.
3239 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3240 * intervals.c, textprop.c: Adjust users.
3241
ad8c997f
DA
32422012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3243
3244 Inline functions to examine and change string intervals.
3245 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3246 (string_get_intervals, string_set_intervals): New function.
3247 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3248 * lread.c, print.c, textprop.c: Adjust users.
3249
32ac3a6b
GM
32502012-08-08 Glenn Morris <rgm@gnu.org>
3251
3252 * lisp.mk (lisp): Remove language/persian.elc.
3253
77c7bcb1
DA
32542012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3255
3256 Cleanup intervals.
3257 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3258 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
3259 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3260 Adjust comment. Move under #if 0.
77c7bcb1
DA
3261 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3262 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3263
9c08a8d4
DA
32642012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3265
3266 Check total length of intervals with eassert.
3267 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3268 * intervals.c: Change all users to eassert.
3269
26d16b35
EZ
32702012-08-07 Eli Zaretskii <eliz@gnu.org>
3271
14ae4239
BT
3272 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
3273 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
3274 INTERNAL_FIELD in Lisp_Cons.
3275
c644523b
DA
32762012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3277
3278 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
3279 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
3280 name since all xname users are fixed long time ago. Do not
3281 use INTERNAL_FIELD.
3282 (set_symbol_name, set_symbol_function, set_symbol_plist):
3283 (set_symbol_next, set_overlay_plist): New function.
3284 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
3285 (struct Lisp_Overlay): Likewise.
3286 (CVAR, MVAR, SVAR): Remove.
3287 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
3288 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
3289 * xterm.c: Adjust users.
3290 * .gdbinit: Change to use name field of struct Lisp_Symbol
3291 where appropriate.
3292
6a3d20cc
DA
32932012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3294
3295 Basic functions to set Lisp_Object and pointer slots of intervals.
3296 * intervals.h (interval_set_parent, interval_set_object):
3297 (interval_set_left, interval_set_right, interval_set_plist):
3298 (interval_copy_parent): New function.
3299 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
3300 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
3301 Adjust indentation.
6a3d20cc
DA
3302 (INTERVAL_SIZE): Remove. Adjust users.
3303 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3304
4d2b044c
DA
33052012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3306
3307 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3308 * process.h (PGET): Remove.
3309 (struct Lisp_Process): Do not use INTERNAL_FIELD.
3310 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3311
d3d50620
DA
33122012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3313
3314 Drop WGET and revert read access to Lisp_Objects slots of struct window.
3315 * window.h (WGET): Remove.
3316 (struct window): Do not use INTERNAL_FIELD.
3317 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3318 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3319 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3320 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3321 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3322 Adjust users.
3323
d10a51dc
CY
33242012-08-07 Chong Yidong <cyd@gnu.org>
3325
3326 * window.c (Fwindow_edges, Fwindow_pixel_edges)
3327 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3328 (Fdelete_window_internal): Signal an error if the window is not on
3329 a live frame (Bug#12025).
3330
e69b0960
DA
33312012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3332
3333 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3334 * frame.h (FGET): Remove.
3335 (struct frame): Do not use INTERNAL_FIELD.
3336 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3337 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3338 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3339 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3340
25a20a3a
JB
33412012-08-06 Juanma Barranquero <lekktu@gmail.com>
3342
3343 * w32.c: Silence compiler warnings.
3344 (map_w32_filename): Remove unused variable `is_fat'.
3345 (chase_symlinks): Add parentheses around expression.
3346
1c6f11f4
GM
33472012-08-06 Glenn Morris <rgm@gnu.org>
3348
1db4583a
GM
3349 * sysdep.c: Respect BROKEN_GETWD.
3350
1c6f11f4
GM
3351 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3352 Let configure handle it.
3353 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3354
2b90362b
DA
33552012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3356
3357 Use GCALIGNMENT where appropriate.
3358 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3359 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3360 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3361
5f50daf2
EZ
33622012-08-06 Eli Zaretskii <eliz@gnu.org>
3363
14ae4239
BT
3364 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3365 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 3366
cbcc7007
SM
33672012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3368
3369 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3370 that should be sufficient for everyone.
3371
4d365fa4
JD
33722012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3373
3374 * keyboard.c (timer_check_2): Add break so timer_check returns next
3375 timeout.
3376
dd86bd82
DA
33772012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3378
3379 Fix Windows build errors introduced after converting to WGET and WSET.
3380 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3381 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3382
054e1668
JD
33832012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3384
3385 * nsterm.m (ns_frame_rehighlight): Use FSET.
3386
3387 * nsmenu.m (ns_update_menubar): Use FSET.
3388
21238f11
DA
33892012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3390
3391 Separate read and write access to Lisp_Object slots of Lisp_Process.
3392 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3393 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3394
077288cf
DA
33952012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3396
3397 Separate read and write access to Lisp_Object slots of struct window.
3398 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3399 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3400 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3401 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3402 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3403 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3404 Adjust users.
3405
71688bd7
DA
34062012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3407
3408 Fix Windows build errors introduced after converting to FGET and FSET.
3409 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3410 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3411 (w32_judge_scroll_bars): Change to use FSET.
3412 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3413
f99bac93
DA
34142012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3415
3416 Fix replacement typo.
3417 * window.c (replace_window): Set root_window instead of
3418 selected_window. This fixes a total window subsystem
3419 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3420
8c2a0f2d
GM
34212012-08-06 Glenn Morris <rgm@gnu.org>
3422
3423 * lisp.mk (lisp): Add language/persian.elc.
3424
edd74c35
DA
34252012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3426
3427 Separate read and write access to Lisp_Object slots of struct frame.
3428 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3429 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3430 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3431 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3432 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3433
8671676c
AS
34342012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3435
3436 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3437
663e2b3f
DA
34382012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3439
3440 Generalize common compile-time constants.
3441 * lisp.h (header_size, bool_header_size, word_size): Now here.
3442 (struct Lisp_Vector): Add comment.
3443 (struct Lisp_Bool_Vector): Move up to define handy constants.
3444 (VECSIZE, PSEUDOVECSIZE): Simplify.
3445 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3446 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3447 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3448 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3449 * xfont.c, xmenu.c: Use word_size where appropriate.
3450
d32e47af
LM
34512012-08-05 Lawrence Mitchell <wence@gmx.li>
3452
3453 * search.c (Freplace_match): Treat \? in the replacement text
3454 literally (Bug#8161).
3455
e5d9c0d1
CY
34562012-08-05 Chong Yidong <cyd@gnu.org>
3457
3458 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3459 * frame.c (Vdelete_frame_functions):
3460 * emacs.c (Vkill_emacs_hook): Doc fix.
3461
8da0576b
EZ
34622012-08-04 Eli Zaretskii <eliz@gnu.org>
3463
3464 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3465 --with-x-toolkit=no builds.
3466 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3467
02676e5d
CY
34682012-08-04 Chong Yidong <cyd@gnu.org>
3469
3470 * syntax.c (Fmodify_syntax_entry): Doc fix.
3471
97147da9
EZ
34722012-08-04 Eli Zaretskii <eliz@gnu.org>
3473
76151e2c
EZ
3474 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3475 * w32.c (init_environment): Change the default values of many
3476 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
3477 them into environment when they were not already defined.
3478 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 3479 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
3480 (check_windows_init_file): Now external, not static.
3481 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
3482 called when Vload_path is already set up.
3483
3484 * w32.h (check_windows_init_file): Add prototype.
3485
3486 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3487 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3488 compatibility with Posix platforms.
3489 (main): Move the call to check_windows_init_file to here from
3490 w32.c.
3491 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3492 any, in the DEFALT argument into the root of the Emacs build or
3493 installation tree, as appropriate.
3494
3495 * callproc.c (init_callproc_1): Call decode_env_path instead of
3496 doing its equivalent by hand.
3497 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3498 the code that sets Vexec_path run on MS-Windows.
3499
3500 * lread.c (init_lread): Add comments to #ifdef's.
3501
97147da9
EZ
3502 * msdos.c (dos_set_window_size, IT_update_begin)
3503 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3504 instead of direct references.
3505
185ee146
PE
35062012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3507
3508 Export DEFAULT_REHASH_* to GDB.
3509 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3510 Now constants, not macros.
3511
8834c57a
PE
35122012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3513
98c6f1e3
PE
3514 Remove unnecessary casts involving pointers.
3515 These casts are no longer needed now that we assume C89 or later,
3516 since they involve casting to or from void *.
3517 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3518 (make_pure_float, make_pure_vector):
3519 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3520 * macros.c (Fstart_kbd_macro):
3521 * menu.c (find_and_return_menu_selection):
3522 * minibuf.c (read_minibuf_noninteractive):
3523 * sysdep.c (closedir):
3524 * xdisp.c (x_produce_glyphs):
3525 * xfaces.c (compare_fonts_by_sort_order):
3526 * xfns.c (x_real_positions, select_visual):
3527 * xselect.c (x_stop_queuing_selection_requests)
3528 (x_get_window_property, x_get_window_property_as_lisp_data):
3529 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3530 Remove unnecessary pointer casts.
3531 * alloc.c (record_xmalloc): New function.
3532 * lisp.h (record_xmalloc): New decl.
3533 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3534 more like a function. This is because the pointer cast is not
3535 needed. All uses changed.
3536 * print.c (print_string, print_error_message): Avoid length recalc.
3537
8834c57a
PE
3538 Improve fix for macroexp crash with debugging (Bug#12118).
3539 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3540 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3541 not supposed to be invoked from the garbage collector.
3542 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3543 (gc_aset): New function, which is like ASET but can be
3544 used in the garbage collector.
3545 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3546 (set_hash_index): Use it instead of ASET.
3547
6dad7178
EZ
35482012-08-03 Eli Zaretskii <eliz@gnu.org>
3549
3550 Support symlinks on latest versions of MS-Windows.
3551 * w32.c: Include winioctl.h and aclapi.h.
3552 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3553 (revert_to_self): Forward declarations of static functions.
3554 <static BOOL g_b_init_get_security_info>:
3555 <g_b_init_create_symbolic_link>: New static flags.
3556 (globals_of_w32): Initialize them to zero.
3557 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3558 (map_w32_filename): Improve commentary. Simplify switch.
3559 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3560 headers (most versions of MinGW w32api don't).
3561 (get_security_info, create_symbolic_link)
3562 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3563 New functions.
3564 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3565 in the argument file name.
3566 (sys_access): Call unc_volume_file_attributes only if
3567 GetFileAttributes fails with network-related error codes.
3568 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3569 have the required privileges.
14ae4239 3570 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
3571 get_file_security_desc.
3572 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
3573 with addition of handling of symlinks and support for 'lstat'.
3574 If possible, get file's attributes and security information by
6dad7178
EZ
3575 handle, not by name. Produce S_IFLNK bit for symlinks, when
3576 called from 'lstat'.
3577 (stat, lstat): New functions, call 'stat_worker'.
3578 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3579 symlinks when the underlying filesystem supports them.
3580
f162bcc3
PE
35812012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3582
79ea6c20
PE
3583 Fix macroexp crash on Windows with debugging (Bug#12118).
3584 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3585 checking subscripts; problem introduced with the recent
3586 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3587 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3588 since it's used in non-static inline functions now.
3589
c0ce93fd
PE
3590 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3591 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 3592
f162bcc3
PE
3593 Use C99-style 'extern inline' if available.
3594 * buffer.h (BUFFER_INLINE):
3595 * category.h (CATEGORY_INLINE):
3596 * character.h (CHARACTER_INLINE):
3597 * charset.h (CHARSET_INLINE):
3598 * composite.h (COMPOSITE_INLINE):
3599 * dispextern.h (DISPEXTERN_INLINE):
3600 * lisp.h (LISP_INLINE):
3601 * systime.h (SYSTIME_INLINE):
3602 New macro, replacing 'static inline' in this header.
3603 * buffer.h, category.h, character.h, charset.h, composite.h:
3604 * dispextern.h, lisp.h, systime.h:
3605 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3606 * alloc.c (LISP_INLINE):
3607 * buffer.c (BUFFER_INLINE):
3608 * category.c (CATEGORY_INLINE):
3609 * character.c (CHARACTER_INLINE):
3610 * charset.c (CHARSET_INLINE):
3611 * composite.c (COMPOSITE_INLINE):
3612 * dispnew.c (DISPEXTERN_INLINE):
3613 * sysdep.c (SYSTIME_INLINE):
3614 Define to EXTERN_INLINE, so that the corresponding functions
3615 are compiled into code.
3616 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3617 (INLINE_HEADER_END): New macros.
3618 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3619 since it's used in non-static inline functions now.
a8333d03 3620 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 3621
837b365b
GM
36222012-08-02 Glenn Morris <rgm@gnu.org>
3623
d66b744d
GM
3624 * s/: Remove empty directory.
3625
837b365b
GM
3626 * s/ms-w32.h: Move to ../nt/inc.
3627 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3628 Update for new ms-w32.h location.
3629
13294f95
PE
36302012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3631
3632 Port to Solaris 8.
3633 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3634
90df0db3
GM
36352012-08-02 Glenn Morris <rgm@gnu.org>
3636
3637 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3638 hard-coding the path separator.
3639
4939150c
PE
36402012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3641
3642 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3643 This how ASET and AREF are supposed to work, and makes
3644 it easier to think about future improvements. See
3645 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3646 * charset.h (set_charset_attr): New function.
3647 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3648 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3649 (aref_addr): New function. All uses of &AREF(...) changed.
3650 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3651 (set_hash_index): New functions. All lvalue-style uses of
3652 HASH_KEY etc. changed.
3653 * keyboard.c (set_prop): New function. All lvalue-style uses
3654 of PROP changed.
3655
947b2afd
AA
36562012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3657
3658 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3659 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3660 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3661 * nsfns.m (ns_set_name_as_filename): Likewise.
3662 * nsmenu.m (ns_update_menubar): Likewise.
3663 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3664
4f5d0325
EZ
36652012-08-01 Eli Zaretskii <eliz@gnu.org>
3666
2008beae
EZ
3667 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3668 Adapt to latest changes in field names of the corresponding Lisp
288479f6 3669 objects.
2008beae 3670
4f5d0325
EZ
3671 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3672
fe3cc771
GM
36732012-08-01 Glenn Morris <rgm@gnu.org>
3674
3675 * s/msdos.h: Remove file.
3676 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3677 * Makefile.in (S_FILE): Remove.
3678 (config_h): Remove S_FILE.
3679
c90acc54
JB
36802012-08-01 Juanma Barranquero <lekktu@gmail.com>
3681
3682 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3683 Remove; moved to nt/config.nt.
3684
d8a05828
DA
36852012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3686
3687 Use INTERNAL_FIELD for conses and overlays.
3688 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3689 Remove obsolete comment.
3690 (MVAR): New macro.
3691 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3692 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3693
8271d590
DA
36942012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3695
3696 Use INTERNAL_FIELD for symbols.
3697 * lisp.h (SVAR): New macro. Adjust users.
3698 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3699 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3700
3193acd2
DA
37012012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3702
3703 Use INTERNAL_FIELD for processes.
3704 * process.h (PVAR): New macro. Adjust style.
3705 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3706 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3707
3a45383a
DA
37082012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3709
3710 Use INTERNAL_FIELD for windows.
3711 * window.h (WVAR): New macro.
3712 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3713 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3714 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3715 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3716 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3717 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3718
c1dbc63c
PE
37192012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3720
3721 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3722
5c0c0e8a
GM
37232012-08-01 Glenn Morris <rgm@gnu.org>
3724
3725 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3726 Move to configure.ac.
3727
552a99b4
JB
37282012-08-01 Juanma Barranquero <lekktu@gmail.com>
3729
3730 * makefile.w32-in (CONFIG_H): Update dependencies.
3731 (CONF_POST_H): New macro.
3732
3733 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3734
8d8e2dfe
GM
37352012-07-31 Glenn Morris <rgm@gnu.org>
3736
bc96620a
GM
3737 * Makefile.in (S_FILE): No longer set by configure.
3738
476b1b2d
GM
3739 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3740 is available.
3741 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3742
b2c7a106
GM
3743 * process.h (NULL_DEVICE):
3744 * emacs.c (SEPCHAR):
3745 * editfns.c (USER_FULL_NAME): Let configure set them.
3746
d53d062a
GM
3747 * s/README, s/template.h: Remove files.
3748
4515017f
GM
3749 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3750
8d8e2dfe
GM
3751 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3752 Move to configure.ac.
3753
5b20b3cc
EZ
37542012-07-31 Eli Zaretskii <eliz@gnu.org>
3755
1e0afd9a
EZ
3756 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3757 resulting renaming of 'struct frame' members.
3758
5b20b3cc
EZ
3759 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3760
3761 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3762 after introduction of FVAR.
3763
f1310128
JD
37642012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3765
79e721e0
JD
3766 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3767
3768 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3769 instead of compositeToPoint.
3770 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3771
8d7c7eed 3772 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 3773
e34f7f79
DA
37742012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3775
3776 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3777 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 3778 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
3779 (BVAR): Change to use INTERNAL_FIELD.
3780 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3781 (KVAR): Change to use INTERNAL_FIELD.
3782 * frame.h (FVAR): New macro.
3783 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
3784 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3785 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3786 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
3787 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3788
c09bfb2f
DA
37892012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3790
3791 Miscellaneous fixes for non-default X toolkits.
3792 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3793 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3794 Move under #ifdef USE_LUCID.
3795 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3796 definition and usage to avoid warnings.
3797
14c114ae
JD
37982012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3799
3800 * nsterm.m (openFiles): Fix previous checkin.
3801
3bd21e82
PE
38022012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3803
3804 * indent.c (compute_motion): Remove unused local.
3805
c1529ded
GM
38062012-07-31 Glenn Morris <rgm@gnu.org>
3807
400d5621
GM
3808 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3809
268e2432
GM
3810 * conf_post.h [USG5_4]:
3811 Move remaining contents of s/usg5-4-common.h here.
3812 * s/usg5-4-common.h: Remove file.
3813
7552f3ee
GM
3814 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3815 * s/irix6-5.h: Remove file.
3816
6a381852
GM
3817 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3818 * s/darwin.h: Remove file.
3819
c1529ded
GM
3820 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3821 * s/hpux10-20.h: Remove file, which is now empty.
3822
b429a4ee
GM
38232012-07-30 Glenn Morris <rgm@gnu.org>
3824
3825 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3826 * Makefile.in (config_h): Add conf_post.h.
3827 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3828
adff3182
JD
38292012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3830
3831 * nsterm.m (ns_do_open_file): New variable.
b9031d69 3832 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
3833 (openFile, openTempFile, openFileWithoutUI, openFiles):
3834 Open files only if ns_do_open_file.
adff3182 3835
c32af1e4
PE
38362012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3837
7393bcbb
PE
3838 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3839 This no-op macro hasn't been needed for many years.
3840 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3841
c32af1e4
PE
3842 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3843 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3844 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3845 gdb_make_enums_visible.
3846 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3847 (DIRECTORY_SEP): Now a constant, not a macro.
3848
302fc036
EZ
38492012-07-30 Eli Zaretskii <eliz@gnu.org>
3850
3851 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3852 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3853
3854 * w32term.c <w32_keyboard_codepage>: Renamed from
3855 keyboard_codepage and now external. All users changed.
3856
3857 * w32term.h: Add declaration of w32_keyboard_codepage.
3858
3859 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3860 the codepage to translate keys to Unicode. If this argument is
3861 -1, use the value returned by GetConsoleCP. All callers changed.
3862
88fb40b4
PE
38632012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3864
0aee6912
PE
3865 Update .PHONY listings in makefiles.
3866 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3867 bootstrap-clean, distclean, maintainer-clean, versioclean,
3868 extraclean, frc.
3869
88fb40b4
PE
3870 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3871 This is a bit clearer. Fix some commentary typos.
3872
0a763bd1
GM
38732012-07-30 Glenn Morris <rgm@gnu.org>
3874
32bac6d6
GM
3875 * s/netbsd.h: Let configure include signal.h if needed.
3876 Remove file, which is now empty.
3877
b65e7c46
GM
3878 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3879 Let configure set them.
3880 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3881 No more need to undefine.
0a763bd1 3882
169304bd
AS
38832012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3884
3885 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3886 non-single-byte char when adding meta modifier. (Bug#12090)
3887
6cd7a139
DA
38882012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3889
3890 Convert safe_call to use variable number of arguments.
3891 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3892 (safe_call2): Fix comment.
3893 * lisp.h (safe_call): Adjust prototype.
3894 * coding.c (encode_coding_object): Change to use safe_call2.
3895 * xfaces.c (merge_face_heights): Change to use safe_call1.
3896
d34d6ffc
GM
38972012-07-30 Glenn Morris <rgm@gnu.org>
3898
7b8a48e4 3899 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 3900 does that unconditionally. Remove file, which is now empty.
7b8a48e4 3901
d34d6ffc
GM
3902 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3903 Remove empty files.
3904
03a660a6
PE
39052012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3906
3907 Export to GDB most of lisp.h's remaining object-like macros.
3908 * lisp.h (min, max): Move earlier, because they're used earlier now.
3909 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3910 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3911 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3912 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3913 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3914 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3915 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3916 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3917 Now constants, for GDB. They need not be macros.
3918 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3919 Now constants, for GDB, as well as macros, for static initializers.
3920 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3921 Move to after the definition of struct Lisp_Char_Table,
3922 since the former now needs that type defined.
3923 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3924 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3925 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3926 New enums, for gdb_make_enums_visible.
3927 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 3928 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
3929 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3930 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3931 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3932 enum maxargs, enum MAX_ALLOCA.
3933 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3934 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3935 no longer needed, now that they are done in lisp.h.
3936
e499d0ee
DA
39372012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3938
3939 Cleanup string bytes checking.
3940 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3941 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3942 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3943 (check_sblock, compact_small_strings): Simplify.
3944
d5040d2d
PE
39452012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3946
3947 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3948 These macros are confusing and no longer need to be defined, as
3949 the enum values now suffice. All uses replaced with definiens.
3950 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3951
7f259ae6
JB
39522012-07-29 Juanma Barranquero <lekktu@gmail.com>
3953
3954 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3955 ($(BLD)/w32console.$(O)): Update dependencies.
3956
7e63e0c3
DA
39572012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3958
3959 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3960 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3961 time. Adjust users.
3962 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3963
ffd817eb
JD
39642012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3965
3966 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3967 setting sitelisp (Bug#12010).
3968
417a7a0e
EZ
39692012-07-29 Eli Zaretskii <eliz@gnu.org>
3970
14ae4239 3971 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
3972
3973 * w32heap.c (cache_system_info):
3974 * w32.c (sys_rename):
3975 * w32proc.c (find_child_console, sys_kill): All users changed.
3976
387d4d92
PE
39772012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3978
3979 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3980
55a6cca6
EZ
39812012-07-29 Eli Zaretskii <eliz@gnu.org>
3982
3983 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3984
dbcf001c
DA
39852012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3986
3987 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
3988 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3989 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 3990
e2688e4a
DA
39912012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3992
3993 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3994 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3995 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3996 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3997 (replace_range, replace_range_2, del_range_2): Change to eassert.
3998 * marker.c (byte_char_debug_check): Adjust style.
3999
b46a6a83
PE
40002012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4001
4002 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4003 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4004 long-ago-commented-out code that talks about "WIN32".
4005 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4006 All uses changed.
4007
e32a5799
PE
40082012-07-28 Paul Eggert <eggert@cs.ucla.edu>
4009
4010 Use Gnulib stdalign module (Bug#9772, Bug#9960).
4011 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4012 Simplify by using alignof.
4013 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4014 * lisp.h: Include <stdalign.h>.
4015 (GCALIGNMENT): New macro and constant.
4016 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
4017 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4018 (stdalign): New macro, if not already defined.
4019
df81cd29
EZ
40202012-07-28 Eli Zaretskii <eliz@gnu.org>
4021
01bd1b0d
EZ
4022 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
4023 * w32inevt.c: Include w32inevt.h.
4024 (w32_read_console_input): New inline function, calls either
4025 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4026 w32_console_unicode_input.
4027 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4028 (w32_kbd_patch_key, key_event): Use the codepage returned by
4029 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4030 (key_event): use uChar.UnicodeChar only if
4031 w32_console_unicode_input is non-zero.
4032
4033 * w32console.c: Include w32heap.h.
4034 <w32_console_unicode_input>: New global variable.
4035 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4036 family of Windows, zero otherwise.
4037
4038 * w32inevt.h: Declare w32_console_unicode_input.
4039
df81cd29
EZ
4040 * xdisp.c (init_iterator): Don't reference tip_frame in a build
4041 --without-x. (Bug#11742)
4042
c20fdd9e
PE
40432012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4044
4045 Adjust GDB to reflect pvec_type changes (Bug#12036).
4046 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
4047 2012-07-04 changes to pseudovector representation.
4048 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 4049
32770973 40502012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
4051
4052 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4053 bus address.
4054 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4055
3438fe21
EZ
40562012-07-27 Eli Zaretskii <eliz@gnu.org>
4057
bcfbc9de
EZ
4058 * alloc.c (listn): Fix the order the arguments are consed onto the
4059 list.
4060
3438fe21
EZ
4061 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4062 enumeration constants, as PURE and HEAP are too general, and clash
4063 with other headers and sources, such as gmalloc.c and the
4064 MS-Windows system headers. All users changed.
4065
eeaea515
DA
40662012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4067
4068 Revert last save_excursion_save and save_excursion_restore changes.
4069 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4070 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4071
073c88c2
DA
40722012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4073
4074 Fix recently-introduced typos in Windows port.
4075 Reported by Martin Rudalics <rudalics@gmx.at>.
4076 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 4077 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 4078
4706125e
PE
40792012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4080
4081 Improve GDB symbol export (Bug#12036).
4082 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4083 arms of an 'if', not using conditional expressions; otherwise GDB
4084 complains about the types in the unevaluated arm when the argument
4085 is an integer literal.
4086 (xgetint): Simplify expression.
4087 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4088 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4089 Zaretskii in <http://bugs.gnu.org/12036#13>.
4090 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4091 needed now that we have gdb_make_enums_visible.
4092 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4093 (enum enum_USE_LSB_TAG):
4094 New enum types, packaging up enums that need to be exported to GDB.
4095
694b6c97
DA
40962012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4097
4098 Utility function to make a list from specified amount of objects.
4099 * lisp.h (enum constype): New datatype.
4100 (listn): New prototype.
4101 * alloc.c (listn): New function.
4102 (Fmemory_use_count, syms_of_alloc): Use it.
4103 * buffer.c (syms_of_buffer): Likewise.
4104 * callint.c (syms_of_callint): Likewise.
4105 * charset.c (define_charset_internal): Likewise.
4106 * coding.c (syms_of_coding): Likewise.
4107 * keymap.c (syms_of_keymap): Likewise.
4108 * search.c (syms_of_search): Likewise.
4109 * syntax.c (syms_of_syntax): Likewise.
4110 * w32.c (init_environment): Likewise.
4111 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4112 * xdisp.c (syms_of_xdisp): Likewise.
4113 * xfns.c (syms_of_xfns): Likewise.
4114
6195f384
DA
41152012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4116
4117 Fast save_excursion_save and save_excursion_restore.
4118 * lisp.h (struct Lisp_Excursion): New data type.
4119 (PVEC_EXCURSION): New pseudovector type.
4120 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
4121 to deal with it. Adjust comments.
4122 (init_marker, attach_marker): New prototype.
4123 (unchain_marker): Adjust prototype.
4124 * marker.c (attach_marker): Change to global.
4125 (init_marker): New function.
4126 * alloc.c (Fmake_marker, build_marker): Use it.
4127 (build_marker): More easserts.
4128 (mark_object): Handle struct Lisp_Excursion.
4129 * editfns.c (save_excursion_save, save_excursion_restore):
4130 Reimplement to use struct Lisp_Excursion. Add comments.
4131
5eceb8fb
PE
41322012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4133
4134 Fix export of symbols to GDB (Bug#12036).
4135 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
4136 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
4137 emacs.c, as this is a more-suitable home. Had this been done earlier
4138 the fix for 12036 would have avoided some of the problems noted in
4139 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
4140 would have been more obvious.
562157c8
PE
4141 * emacs.c: Do not include <verify.h>; no longer needed.
4142 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
4143 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
4144 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4145 Remove; now done in lisp.h.
4146 * lisp.h (PUBLISH_TO_GDB): New macro.
4147 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
4148 (DATA_SEG_BITS): Use it.
4149 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
4150 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
4151 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
4152 not be usable in #if. This simplifies things.
4153
d6749401
JB
41542012-07-26 Juanma Barranquero <lekktu@gmail.com>
4155
4156 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
4157
1781b9e9
PE
41582012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4159
d89518db 4160 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
4161 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
4162 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
4163 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
4164 Adjust to changes in lisp.h and emacs.c, by using
4165 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
4166 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
4167 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
4168 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
4169 instead of gdb_valbits.
4170 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
4171 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
4172 instead of gdb_array_mark_flag.
4173 (xboolvector): Get size from $->size, not $->header.size.
4174 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
4175 (xreload, hook-run, hookpost-run): Remove.
4176 * emacs.c: Include <verify.h>.
4177 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
4178 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
4179 Remove.
4180 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
4181 (gdb_USE_LSB_TAG): New enum constants.
4182 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4183 Also define these as enum constants, so they're visible to GDB.
4184 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4185 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4186 as constants, so they're visible to GDB.
4187 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4188 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4189 Now enum constants, not macros, so they're visible to GDB.
4190 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4191 more convenient now. All uses changed.
4192 (VALMASK) [USE_LSB_TAG]: Also define in this case.
4193 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4194
3628596a
DA
41952012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
4196
4197 Explicitly free restriction data that are not needed anymore.
4198 * editfns.c (save_restriction_restore): Free restriction data.
4199
7abaf5cc
SM
42002012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
4201
4202 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4203 add argument, tune behavior, and adjust all callers.
4204
71f88e00
PE
42052012-07-25 Paul Eggert <eggert@cs.ucla.edu>
4206
4207 Use typedef for EMACS_INT, EMACS_UINT.
4208 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4209 than macros. This simplifies debugging in the usual case, since
4210 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4211 and it allows expressions involving EMACS_INT casts.
4212 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4213
57ec3034
JD
42142012-07-25 Jan Djärv <jan.h.d@swipnet.se>
4215
4216 * nsterm.m (ns_read_socket): Return early if there is a modal
4217 window (Bug#12043).
4218
8137e7b3
MR
42192012-07-25 Martin Rudalics <rudalics@gmx.at>
4220
4221 * frame.c (Fredirect_frame_focus): In doc-string don't mention
4222 that FOCUS-FRAME can be omitted.
4223
04e9897c
DA
42242012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
4225
4226 Adjust buffer text indirection counters at the end of Fkill_buffer.
4227 * buffer.c (Fkill_buffer): Adjust indirection counters when the
4228 buffer is definitely dead. This should really fix an issue reported
4229 by Christoph Scholtes again. (Bug#12007).
4230 (init_buffer_once): Initialize indirection counters of
4231 buffer_defaults and buffer_local_symbols (for sanity and safety).
4232
8a0484e1
EZ
42332012-07-24 Eli Zaretskii <eliz@gnu.org>
4234
4235 * xdisp.c (init_iterator): Don't compute dimensions of truncation
4236 and continuation glyphs on tooltip frames, leave them at zero.
4237 Avoids continued lines in tooltips. (Bug#11832)
4238
fa691a83
DA
42392012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
4240
4241 Simplify copy_overlay.
04e9897c 4242 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
4243 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4244
436bc8e0
EZ
42452012-07-23 Eli Zaretskii <eliz@gnu.org>
4246
4247 * print.c (print_object): Don't crash when a frame's name is nil
4248 or invalid. (Bug#12025)
4249
4250 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4251 it signals an error when a tooltip frame is being created.
4252
d7a7fda3
DA
42532012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4254
4255 Cleanup miscellaneous objects allocation and initialization.
4256 * alloc.c (allocate_misc): Change to static. Add argument to
4257 specify the subtype. Adjust comment and users.
4258 (build_overlay): New function.
4259 * buffer.c (copy_overlays, Fmake_overlay): Use it.
4260 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4261 (allocate_misc): Remove prototype.
4262 (build_overlay): Add prototype.
4263
42642012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
4265
4266 Swap buffer text indirection counters in Fbuffer_swap_text.
4267 * buffer.c (Fbuffer_swap_text): Swap indirections too.
4268 This avoids crash reported by Christoph Scholtes at
4269 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4270
9d7fa573
JD
42712012-07-22 Jan Djärv <jan.h.d@swipnet.se>
4272
4273 * nsmenu.m (Popdown_data): New struct.
4274 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
4275 free Popdown_data.
4276 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
4277 (initWithContentRect): Make imgView and contentView non-static
4278 and autorelease them. Also autorelease img and matrix (Bug#12005).
4279 (dealloc): Remove (Bug#12005).
4280
0dd6d66d
DA
42812012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4282
4283 Adjust consing_since_gc when objects are explicitly freed.
4284 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
4285 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
4286 (free_cons, free_misc): Subtract object size from consing_since_gc.
4287
d36d71df
DA
42882012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4289
4290 Simplify and cleanup markers positioning code.
4291 * marker.c (attach_marker): More useful eassert.
4292 (live_buffer, set_marker_internal): New function.
4293 (Fset_marker, set_marker_restricted): Use set_marker_internal.
4294 (set_marker_both, set_marker_restricted_both): Use live_buffer.
4295
fb9ea40f
PE
42962012-07-22 Paul Eggert <eggert@cs.ucla.edu>
4297
4298 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
4299 as it's limited by the amount of memory, not by INT_MAX.
4300
2d5c5f7d
EZ
43012012-07-21 Eli Zaretskii <eliz@gnu.org>
4302
07fb592e
EZ
4303 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
4304 in special-event-map. See the discussion at
4305 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4306 for the reasons.
4307
37a9eac8 4308 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
4309 info.dwItemData. Fixes crashes on 64-bit Windows.
4310 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 4311
c4328746
JD
43122012-07-21 Jan Djärv <jan.h.d@swipnet.se>
4313
fc0c31f8 4314 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 4315 (conversationIdentifier): Return value is NSInteger.
784051c4 4316 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 4317
6e5d1c12
CY
43182012-07-21 Chong Yidong <cyd@gnu.org>
4319
4320 * window.c (decode_any_window): Signal an error if the window is
4321 on a dead frame (Bug#11984).
4322
9928463d
DA
43232012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4324
4325 Add indirection counting to speed up Fkill_buffer.
4326 * buffer.h (struct buffer): New member.
4327 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4328 (Fmake_indirect_buffer): Set indirection counter to -1, increment
4329 base buffer indirection counter.
4330 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4331 (Fkill_buffer): Adjust indirection counters as needed, don't walk
4332 through buffer list if indirection counter is 0.
4333
f8643a6b
DA
43342012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4335
4336 Extend the value returned by Fgarbage_collect with heap statistics.
4337 * alloc.c (Qheap): New symbol.
4338 (syms_of_alloc): DEFSYM it.
4339 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4340 (Fmemory_free): Remove.
4341 (syms_of_alloc): Don't defsubr it.
4342 * buffer.c (Fcompact_buffer): Remove.
4343 (syms_of_buffer): Don't defsubr it.
4344
dac616ff
DA
43452012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4346
4347 Make maybe_gc inline.
4348 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4349 * lisp.h (consing_since_gc, gc_relative_threshold)
4350 (memory_full_cons_threshold): Revert declaration.
4351 (maybe_gc): Remove prototype, define as inline.
4352 * alloc.c: Remove old commented-out code.
4353 (consing_since_gc, gc_relative_threshold)
4354 (memory_full_cons_threshold): Revert to global.
4355 (maybe_gc): Remove.
4356
d7ea76b4
DA
43572012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4358
4359 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4360 * lisp.h (build_unibyte_string): New function.
4361 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4362 * sysdep.c, w32fns.c, xfns.c: Use it.
4363 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4364 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4365 Adjust users accordingly.
4366 * font.h (font_open_by_name): Adjust prototype.
4367
765e61e3
DA
43682012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4369
4370 Cleanup calls to Fgarbage_collect.
4371 * lisp.h (maybe_gc): New prototype.
4372 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4373 Remove declarations.
4374 * alloc.c (maybe_gc): New function.
4375 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4376 Make them static.
4377 * bytecode.c (MAYBE_GC): Use maybe_gc.
4378 * eval.c (eval_sub, Ffuncall): Likewise.
4379 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4380 to avoid dependency from auto-save feature.
4381
52b852c7
PE
43822012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4383
4384 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4385 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4386 'for_each_per_buffer_object_at'.
4387 All uses changed. It's better to use upper-case for macros that
4388 cannot be implemented as functions, to give the reader a clue
4389 that they're special.
4390
5db81e33
SM
43912012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4392
4393 * alloc.c (Fgarbage_collect): Tweak docstring.
4394
5b835e1d
DA
43952012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4396
4397 Tweak the value returned from Fgarbage_collect again.
4398 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4399 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4400 Adjust documentation.
4401 (total_vector_bytes): Rename to total_vector_slots, adjust
4402 accounting.
4403 (total_free_vector_bytes): Rename to total_free_vector_slots,
4404 adjust accounting.
4405 (Qstring_bytes, Qvector_slots): New symbols.
4406 (syms_of_alloc): DEFSYM them.
4407
9cd47b72
DA
44082012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4409
4410 Buffer compaction primitive which may be used from Lisp.
4411 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4412 (syms_of_buffer): Register Fcompact_buffer.
4413 * alloc.c (Fgarbage_collect): Use compact_buffer.
4414 * buffer.h (compact_buffer): New prototype.
4415 (struct buffer_text): New member.
4416
d17337e5
DA
44172012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4418
4419 New macro to iterate over all buffers, miscellaneous cleanups.
4420 * lisp.h (all_buffers): Remove declaration.
4421 * buffer.h (all_buffers): Add declaration, with comment.
4422 (for_each_buffer): New macro.
4423 * alloc.c (Fgarbage_collect, mark_object): Use it.
4424 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4425 (init_buffer): Likewise.
4426 * data.c (Fset_default): Likewise.
4427 * coding.c (code_conversion_restore): Remove redundant check
4428 for dead buffer.
4429 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4430
60cfd278
AS
44312012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4432
4433 Fix bug that created negative-length intervals.
4434 * intervals.c (merge_interval_right, merge_interval_left):
4435 Do not zero out this interval if it is absorbed by its children,
4436 as this interval's total length doesn't change in that case. See
4437 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4438
d06714cb
PE
44392012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4440
83713154
PE
4441 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4442 when invoking (make-bool-vector N t) and N is a positive
4443 multiple of 8 -- the last 8 bits were mistakenly cleared.
4444
d06714cb
PE
4445 Remove some struct layout assumptions in bool vectors.
4446 * alloc.c (bool_header_size): New constant.
4447 (header_size, word_size): Move earlier, as they're now used earlier.
4448 Use 'word_size' in a few more places, where it's appropriate.
4449 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4450 padding before the data member of a bool vector.
4451 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4452 than doing the check by hand with an abort ().
4453
464d5a5e
SM
44542012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4455
5fbc0409
SM
4456 * eval.c (Fdefvar): Don't check constants since we only set the var if
4457 it's not yet defined anyway (bug#11904).
4458
464d5a5e
SM
4459 * lisp.h (last_undo_boundary): Declare new var.
4460 * keyboard.c (command_loop_1): Set it.
4461 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4462 were auto-added by the command loop (bug#11774).
4463
8dc2e44a
AS
44642012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4465
4466 * w32font.c (Qsymbol): Remove local definition.
4467 (syms_of_w32font): Don't DEFSYM it.
4468
169925ec
DA
44692012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4470
4471 Fix sweep_vectors to handle large bool vectors correctly.
4472 * alloc.c (sweep_vectors): Account total_vector_bytes for
4473 bool vectors larger than VBLOCK_BYTES_MAX.
4474
5fbfb018
CY
44752012-07-18 Chong Yidong <cyd@gnu.org>
4476
4477 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4478 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4479
3ab6e069
DA
44802012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4481
4482 Return more descriptive data from Fgarbage_collect.
4483 Suggested by Stefan Monnier in
4484 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4485 * alloc.c (bounded_number): New function.
4486 (total_buffers, total_vectors): New variable.
4487 (total_string_size): Rename to total_string_bytes, adjust users.
4488 (total_vector_size): Rename to total_vector_bytes, adjust users.
4489 (sweep_vectors): Account total_vectors and total_vector_bytes.
4490 (Fgarbage_collect): New return value. Adjust documentation.
4491 (gc_sweep): Account total_buffers.
4492 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4493 (VECTOR_SIZE): Remove.
4494 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4495 (Qinterval, Qmisc): New symbols.
4496 (syms_of_data): Initialize them.
4497 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4498 (Qcons, Qbuffer): New declarations.
4499
6d02fe5b
PE
45002012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4501
4502 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4503 Round up, not down. Improve doc.
4504
b7ffe040
DA
45052012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4506
4507 Restore old code in allocate_string_data to avoid Faset breakage.
4508 Reported by Julien Danjou <julien@danjou.info> in
4509 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4510 * alloc.c (allocate_string_data): Restore old code with minor
4511 adjustments, fix comment to explain this subtle issue.
4512
4dc7c8d5
SM
45132012-07-17 Eli Zaretskii <eliz@gnu.org>
4514
4515 Remove FILE_SYSTEM_CASE.
4516 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4517
4518 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4519 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4520 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4521 call-process-region passes it through expand-file-name.
4522
4523 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4524
45252012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4526
4527 Fix crash when creating indirect buffer (Bug#11917)
4528 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4529 Don't handle unbound variables specially if non-zero.
4530 (Fbuffer_local_variables): Pass zero.
4531 (clone_per_buffer_values): Pass non-zero.
4532
45332012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4534
4535 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4536 to make the loop interruptible.
4537
45382012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4539
4540 * gnutls.c (emacs_gnutls_handshake): Only retry if
4541 GNUTLS_E_INTERRUPTED.
4542
cce7fefc
DA
45432012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4544
4545 Cleanup and convert miscellaneous checks to eassert.
4546 * alloc.c (mark_interval): Fix comment, partially rephrase
4547 old comment from intervals.h (see below).
4548 * intervals.c (find_interval, adjust_intervals_for_insertion)
4549 (delete_interval, adjust_intervals_for_deletion)
4550 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4551 Convert to eassert.
4552 (adjust_intervals_for_insertion, make_new_interval):
4553 Remove obsolete and unused code.
4554 * intervals.h (struct interval): Remove obsolete comment.
4555 * textprotp.c (erase_properties): Remove unused code.
4556 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4557 (Fremove_list_of_text_properties): Convert to eassert.
4558
9ea10cc3
CY
45592012-07-17 Chong Yidong <cyd@gnu.org>
4560
4561 * editfns.c (Finsert_char): Doc fix.
4562
3900d5de
DA
45632012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4564
4565 Fix previous change to make Fmemory_free always accurate.
4566 * alloc.c (make_interval): Update total_free_intervals.
4567 (make_float): Likewise for total_free_floats.
4568 (free_cons, Fcons): Likewise for total_free_conses.
4569 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4570 Likewise for total_free_vector_bytes.
4571 (Fmake_symbol): Likewise for total_free_symbols.
4572 (bytes_free): Remove.
4573
7098646f
DA
45742012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4575
4576 Simple free memory accounting feature.
4577 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4578 (sweep_vectors): Accumulate size of free vectors.
4579 (Fgarbage_collect): Setup bytes_free.
4580 (Fmemory_free): New function.
4581 (syms_of_alloc): Register it.
4582
22657b40
DA
45832012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4584
4585 Cleanup overlays checking.
4586 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4587 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4588 eassert and OVERLAYP.
4589 (sort_overlays): Change to use OVERLAYP.
4590
ddfc8813
RK
45912012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4592
4593 * editfns.c (Finsert_char): Make it interactive, and make the
4594 second arg optional. Copy interactive spec and docstring from
4595 ucs-insert.
4596
7c26cf3c
PE
45972012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4598
4599 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4600 Unlike the other wrapped functions, fabs has an unspecified
4601 effect on errno.
4602
5d127af9
JD
46032012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4604
4605 * nsterm.m (keyDown): Interpret flags without left/right bits
4606 as the left key (Bug#11670).
4607
6a0dd1d7
DA
46082012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4609
4610 Remove empty and useless init functions.
4611 * lisp.h (init_character_once, init_fns, init_image)
4612 (init_filelock, init_sound): Remove prototype.
4613 * character.c (init_character_once): Remove.
4614 * filelock.c (init_filelock): Likewise.
4615 * fns.c (init_fns): Likewise.
4616 * image.c (init_image): Likewise.
4617 * sound.c (init_sound): Likewise.
4618 * emacs.c (main): Adjust accordingly.
4619
7a6136fd
DA
46202012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4621
4622 * gtkutil.h: Tiny cleanups.
4623 (use_old_gtk_file_dialog): Remove useless declaration.
4624 (xg_uses_old_file_dialog): Add suggested const attribute.
4625
ce811ad9
EZ
46262012-07-15 Eli Zaretskii <eliz@gnu.org>
4627
4628 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4629 (bidi_paragraph_init): Use it to limit search forward for a strong
4630 directional character in abnormally large paragraphs full of
4631 neutral or weak characters. (Bug#11943)
4632
c9adfeaa
SF
46332012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4634
4635 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4636 the toolbar (Bug#9451).
4637 (xg_make_tool_item): Give the widget event box a transparent
4638 background.
4639
fff62aa9
DA
46402012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4641
4642 Cleanup basic allocation variables and functions.
4643 * alloc.c (ignore_warnings, init_intervals, init_float)
4644 (init_cons, init_symbol, init_marker): Remove.
4645 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4646 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4647 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4648 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4649 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4650 (staticidx, init_alloc_once, init_strings, free_ablock):
4651 Remove redundant initialization.
4652 * fns.c (init_weak_hash_tables): Remove.
4653 * lisp.h (init_weak_hash_tables): Remove prototype.
4654
9730daca
DA
46552012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4656
4657 Use zero_vector where appropriate.
4658 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4659 accordingly.
4660 * lisp.h (zero_vector): New declaration.
4661 * font.c (null_vector): Remove.
4662 (syms_of_font): Remove initialization and staticpro.
4663 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4664 * keymap.c (Faccessible_keymaps): Likewise.
4665
2e2d2a13
LL
46662012-07-15 Leo Liu <sdl.web@gmail.com>
4667
4668 * fringe.c: Fix typo in comments.
4669
cd276f6e
LL
46702012-07-14 Leo Liu <sdl.web@gmail.com>
4671
4672 * fringe.c: Add a new bitmap exclamation-mark.
4673
5a1131d9
EZ
46742012-07-14 Eli Zaretskii <eliz@gnu.org>
4675
4676 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4677
4678 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4679 (HAVE_MENUS): Don't define, defined by editing config.in with
4680 msdos/sed2v2.inp.
4681 (GMALLOC_INHIBIT_VALLOC): Don't define.
4682 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4683
22e983b7
JB
46842012-07-14 Juanma Barranquero <lekktu@gmail.com>
4685
4686 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4687
5b3f250f
GM
46882012-07-14 Glenn Morris <rgm@gnu.org>
4689
4690 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4691 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4692 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4693
33d63ff4
GM
46942012-07-13 Glenn Morris <rgm@gnu.org>
4695
5b633342
GM
4696 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4697
33d63ff4
GM
4698 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4699 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4700
b55b9f85
JD
47012012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4702
0dc8cf50
JD
4703 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4704 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4705 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4706 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4707 where appropriate.
4708 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4709 as boolean expression.
4710 (x_set_window_size): Remove unused variable toolbar.
4711 (ns_get_color_default, ns_mod_to_lisp): Remove.
4712 (ns_mouse_position): Remove unused variables xchar and ychar.
4713 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4714 (ns_set_vertical_scroll_bar): Remove unused variable count.
4715 (ns_delete_terminal): Remove unused variable i.
4716 (ns_term_init): Remove unused variables r, g and b.
4717 (mouseDown): Remove unused variable window.
4718 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4719 (initFrameFromEmacs): Remove unused variable vbextra.
4720 (mouseEntered): Remove unused variables p and dpyinfo.
4721 (mouseExited): Remove unused variables p and r.
4722 (ns_define_frame_cursor, ns_clear_frame_area)
4723 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4724 (menuDown): Assign [sender tag] to variable and cast the variable.
4725
4726 * nsterm.h (menuDown): Add id as type to argument sender.
4727 (ns_display_info_for_name): Add Lisp_Object argument.
4728 (ns_term_init): Add Lisp_Object argument.
4729 (ns_map_event_to_object): Add void argument.
4730 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4731 prototype with arguments and only declare if __OBJC__.
4732 (nxatoms_of_nsselect): Add void argument.
4733 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4734 (ns_alloc_autorelease_pool): Add void argument.
4735 (ns_release_autorelease_pool): Add void* argument.
4736 (ns_get_defaults_value): Add const char* argument.
4737
4738 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4739 (initFromContents): Use SSDATA where appropriate.
4740 (ns_update_menubar): Add braces to ambigous if-else.
4741 (initWithTitle): Put () around assignment in if statement.
4742 (ns_menu_show): Remove unused variables window and keymap.
4743 (update_frame_tool_bar): Remove unused variable selected_p.
4744 (initWithContentRect): Remove unused variable this_cmd_name.
4745
4746 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4747 appropriate.
4748 (setXBMColor): Remove unused variable len.
4749 (setPixmapData): Put () around assignment in loop statement.
4750
4751 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4752 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4753 where appropriate.
4754 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4755 around assignment in loop statement.
4756 (nsfont_open): Remove unused variable i.
4757 (nsfont_open): Remove unused variable len.
4758 (nsfont_draw): Remove unused variable cs.
4759
4760 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4761 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4762 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4763 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4764 (Fns_font_name, Fns_perform_service)
4765 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4766 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4767 (ns_set_name): Remove unused variable view.
4768 (x_set_menu_bar_lines): Remove unused variable olines.
4769 (x_set_tool_bar_lines): Remove unused variable root_window.
4770 (Fns_list_colors): Put () around assignment in while statement.
4771 (Fns_perform_service): Remove unused variable len.
4772 (Fns_display_usable_bounds): Remove unused variable top.
4773 (syms_of_nsfns): Remove unused variable i.
4774
b55b9f85
JD
4775 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4776 memcpy (Bug#11907).
4777
ed9265fc 47782012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
4779
4780 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4781 and free it with DestroyExceptionInfo (Bug#11558).
4782
ef099b57
JB
47832012-07-13 Juanma Barranquero <lekktu@gmail.com>
4784
4785 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4786 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4787 Set here, not in nt/config.nt.
4788
ea814a5d
EZ
47892012-07-13 Eli Zaretskii <eliz@gnu.org>
4790
4791 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4792 cursor overflow into the last glyph on display line when the right
4793 fringe is off. (Bug#11832)
4794
1a952767
PE
47952012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4796
4797 * xdisp.c (produce_special_glyphs): Now static.
4798 * dispextern.h (produce_special_glyphs): Remove decl.
4799
983188fd
GM
48002012-07-13 Glenn Morris <rgm@gnu.org>
4801
8d7c7eed 4802 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
4803 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4804
983188fd
GM
4805 * s/usg5-4-common.h (USG, USG5):
4806 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4807 * s/sol2-6.h (SOLARIS2):
4808 * s/irix6-5.h (IRIX6_5):
4809 * s/hpux10-20.h (USG, USG5, HPUX):
4810 * s/gnu-linux.h (USG, GNU_LINUX):
4811 * s/freebsd.h (BSD_SYSTEM):
4812 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4813 * s/cygwin.h (CYGWIN):
4814 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4815 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4816
d1e68667 48172012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
4818
4819 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 4820
6de0e799
GM
48212012-07-13 Glenn Morris <rgm@gnu.org>
4822
739ae010
GM
4823 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4824
dbee5793
GM
4825 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4826
6de0e799
GM
4827 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4828 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4829
b82da769
GM
48302012-07-12 Glenn Morris <rgm@gnu.org>
4831
4fae5a7a 4832 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
4833
4834 * process.c (init_process_emacs): Rename from init_process.
4835 The old name is also the name of a Mach system call.
4836 * lisp.h, emacs.c: Update for this name change.
4837 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4838 longer needed.
4839
5a979817
EZ
48402012-07-12 Eli Zaretskii <eliz@gnu.org>
4841
4842 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4843 memmove call that removes glyphs covered by the left truncation
4844 glyph. Improve commentary.
4845 (display_line): Fix display of continuation glyphs on GUI frames
4846 when the right fringe is turned off and variable-size fonts are
4847 used in the window. Move the code that appends a stretch glyph to
4848 produce_special_glyphs, so that it could be used for truncation
4849 and continuation glyphs alike.
4850 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4851 glyph of a suitably computed width, to align the special glyphs at
4852 the window margin. Code moved from display_line. (Bug#11832)
4853
3e91a053
GM
48542012-07-12 Glenn Morris <rgm@gnu.org>
4855
ba9e4b84
GM
4856 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4857
4858 * s/gnu-linux.h, s/hpux10-20.h:
4859 Do not unconditionally define HAVE_XRMSETDATABASE.
4860
3e91a053
GM
4861 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4862
b300b1f4
PE
48632012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4864
4865 Fix typos that broke OS X build.
4866 Reported by Randal L. Schwartz in
4867 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4868 * nsterm.m (ns_timeout): Add missing local decl.
4869 (ns_get_color): snprintf -> sprintf, to fix typo.
4870
6e777848
GM
48712012-07-12 Glenn Morris <rgm@gnu.org>
4872
3f922c37
GM
4873 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4874 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4875 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4876 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4877
0ab7b23a
GM
4878 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4879 Move PTY_OPEN to configure.
4880
6e777848
GM
4881 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4882 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4883 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4884
4a7edc24
DA
48852012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4886
4887 Use empty_unibyte_string where applicable.
4888 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4889 * lread.c (read1): Likewise.
4890 * xsettings.c (syms_of_xsettings): Likewise.
4891
308aab79
GM
48922012-07-12 Glenn Morris <rgm@gnu.org>
4893
42bd1719
GM
4894 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4895 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
4896 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4897 * s/hpux10-20.h (RUN_TIME_REMAP):
4898 * s/bsd-common.h (TABDLY): Move to configure.
4899
4900 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4901
4902 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4903
ea0bbd17 4904 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 4905 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
4906
4907 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 4908
308aab79
GM
4909 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4910 * s/template.h: Move NARROWPROTO to configure.
4911
ee1cf5cf
GM
49122012-07-11 Glenn Morris <rgm@gnu.org>
4913
30fe9bf4
GM
4914 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4915 unused since 2011-01-17 change to systty.h.
4916
ee1cf5cf
GM
4917 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4918 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4919 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4920
63e47e07
PE
49212012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4922
4923 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4924
c43fb4c3
GM
49252012-07-11 Glenn Morris <rgm@gnu.org>
4926
4927 * s/darwin.h, s/gnu-linux.h, s/template.h:
4928 Move INTERRUPT_INPUT to configure.
4929
e8df9267
DA
49302012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4931
4932 Minor adjustments to interning code.
4933 * lisp.h (intern, intern_c_string): Redefine as static inline
4934 wrappers for intern_1 and intern_c_string_1, respectively.
4935 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
4936 * lread.c (intern_1, intern_c_string_1, oblookup):
4937 Simplify Vobarray checking.
e8df9267
DA
4938 * font.c (font_intern_prop): Likewise. Adjust comment.
4939 * w32font.c (intern_font_name): Likewise.
4940
34348bd4
AS
49412012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4942
d96a1e0c
AS
4943 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4944
34348bd4
AS
4945 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4946 of Fcar/Fcdr if possible.
4947 * font.c (check_otf_features): Likewise.
4948 * fontset.c (Fnew_fontset): Likewise.
4949 * gnutls.c (Fgnutls_boot): Likewise.
4950 * minibuf.c (read_minibuf): Likewise.
4951 * msdos.c (IT_set_frame_parameters): Likewise.
4952 * xmenu.c (Fx_popup_dialog): Likewise.
4953 * w32menu.c (Fx_popup_dialog): Likewise.
4954
c8add24e
GM
49552012-07-11 Glenn Morris <rgm@gnu.org>
4956
4b575b3c
GM
4957 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4958 since nothing has defined it on these platforms.
4959
09f4e3b0
GM
4960 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4961 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4962
172bedef
GM
4963 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4964 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4965 Move CLASH_DETECTION to configure.
4966
249685df
GM
4967 * s/gnu.h: Remove file, which is now empty.
4968
c8add24e
GM
4969 * s/gnu.h, s/gnu-linux.h:
4970 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4971
b41253a3
JW
49722012-07-11 John Wiegley <johnw@newartisans.com>
4973
4974 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4975 function attribute, so we only use it if it exists in the
4976 compiler.
4977
d923b542
DA
49782012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4979
4980 Avoid call to strlen in fast_c_string_match_ignore_case.
4981 * search.c (fast_c_string_match_ignore_case): Change to use
4982 length argument. Adjust users accordingly.
4983 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4984
5ebbef1d
PE
49852012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4986
bb352260
PE
4987 Assume mkdir, rmdir.
4988 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4989 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4990
57054ddd
PE
4991 Assume rename.
4992 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4993
b747d3f7
PE
4994 Assume perror.
4995 * s/hpux10-20.h (HAVE_PERROR): Remove.
4996 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4997 Remove dummy definition, as this problem was obsolete long ago.
4998
5ebbef1d
PE
4999 Assume strerror.
5000 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5001
984e7f30
DA
50022012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5003
5004 Avoid calls to strlen in font processing functions.
5005 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
5006 (font_open_by_name): Change to use length argument.
5007 Adjust users accordingly.
d923b542
DA
5008 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5009 Adjust prototypes.
5010 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5011 Change to return ptrdiff_t.
984e7f30
DA
5012 (xfont_list_pattern, xfont_match): Use length returned by
5013 xfont_decode_coding_xlfd.
5014 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5015
20e94fdd
GM
50162012-07-11 Glenn Morris <rgm@gnu.org>
5017
9d596af3
GM
5018 * s/darwin.h, s/freebsd.h, s/netbsd.h:
5019 Move DONT_REOPEN_PTY to configure.
5020
20e94fdd
GM
5021 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5022 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5023
e99a530f
PE
50242012-07-10 Paul Eggert <eggert@cs.ucla.edu>
5025
22ffb973
PE
5026 Remove "#define unix" that is no longer needed (Bug#11905).
5027 * s/aix4-2.h (unix): Remove; no longer needed.
5028
e9a9ae03
PE
5029 EMACS_TIME simplification (Bug#11875).
5030 This replaces macros (which typically do not work in GDB)
5031 with functions, typedefs and enums, making the code easier to debug.
5032 The functional style also makes code easier to read and maintain.
5033 * systime.h: Include <sys/time.h> on all hosts, not just if
5034 WINDOWSNT, since 'struct timeval' is needed in general.
5035 (EMACS_TIME): Now a typedef, not a macro.
5036 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5037 not macros.
5038 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
5039 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
5040 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
5041 (EMACS_TIME_LE): Now functions, not macros.
5042 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
5043 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
5044 which are not functions. All uses rewritten to use:
5045 (make_emacs_time): New function.
5046 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5047 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5048 not functions. All uses rewritten to use the following, respectively:
5049 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5050 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 5051 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
5052 * fileio.c (Fcopy_file):
5053 * xterm.c (XTflash): Get the current time closer to when it's used.
5054 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5055
ffacb126
PE
5056 * bytecode.c (targets): Suppress -Woverride-init warnings.
5057
e99a530f
PE
5058 Simplify by avoiding confusing use of strncpy etc.
5059 * doc.c (Fsnarf_documentation):
5060 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5061 * frame.c (Fmake_terminal_frame):
5062 * gtkutil.c (get_utf8_string):
5063 * lread.c (openp):
5064 * nsmenu.m (ns_update_menubar):
5065 * regex.c (regerror):
5066 Prefer memcpy to strncpy and strncat when either will do.
5067 * fileio.c (Fsubstitute_in_file_name):
5068 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5069 (menu_separator_name_p):
5070 * nsmenu.m (ns_update_menubar):
5071 Prefer memcmp to strncmp when either will do.
5072 * nsterm.m: Include <ftoastr.h>.
5073 (ns_get_color):
5074 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5075 Prefer snprintf to strncpy.
5076 * nsterm.m (ns_term_init):
5077 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5078 * nsterm.m (ns_term_init):
5079 Avoid the need for strncpy, by using build_string or
5080 make_unibyte_string directly. Use dtoastr, not snprintf.
5081 * process.c (Fmake_network_process): Diagnose service names that
5082 are too long, rather than silently truncating them or creating
5083 non-null-terminated names.
5084 (Fnetwork_interface_info): Likewise, for interface names.
5085 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5086 Prefer sprintf to strncat.
5087 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5088 Prefer vsnprintf to vsprintf + strncpy.
5089
c59592b3
GM
50902012-07-10 Glenn Morris <rgm@gnu.org>
5091
5092 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5093 Clarify fallback case.
5094
7d7bbefd
DA
50952012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5096
5097 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5098 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5099 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 5100 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
5101 where argument type is known to be a Lisp_Cons.
5102
3a4c8000
TT
51032012-07-10 Tom Tromey <tromey@redhat.com>
5104
5105 * bytecode.c (BYTE_CODE_THREADED): New macro.
5106 (BYTE_CODES): New macro. Replaces all old byte-code defines.
5107 (enum byte_code_op): New type.
5108 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5109 (exec_byte_code): Use them. Use token threading when applicable.
5110
2a0213a6
DA
51112012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5112
5113 Optimize pure C strings initialization.
5114 * lisp.h (make_pure_string): Fix prototype.
5115 (build_pure_c_string): New function, defined as static inline. This
5116 provides a better opportunity to optimize away calls to strlen when
5117 the function is called with compile-time constant argument.
5118 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
5119 argument, adjust users accordingly. Use build_pure_c_string where
5120 appropriate.
5121 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
5122 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
5123 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
5124
cb1caeaf
DA
51252012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5126
5127 Avoid calls to strlen in miscellaneous functions.
5128 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
5129 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
5130 * lread.c (openp): Likewise.
5131
c293e30c
DA
51322012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5133
5134 Avoid calls to strlen in path processing functions.
5135 * fileio.c (file_name_as_directory): Add comment. Change to add
5136 srclen argument and return the length of result. Adjust users
5137 accordingly.
5138 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
5139 swap 1st and 2nd arguments to obey the common convention.
5140 Adjust users accordingly.
c293e30c
DA
5141 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
5142
9e059e3f
GM
51432012-07-10 Glenn Morris <rgm@gnu.org>
5144
d02eb359
GM
5145 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
5146 Move PENDING_OUTPUT_COUNT definition to configure.
5147
882cf227
GM
5148 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
5149 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
5150 * s/gnu.h (DATA_START): Move definitions to configure.
5151
af6e839f
GM
5152 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
5153 We include usg5-4-common.h, which defines them both.
5154
40289a12
GM
5155 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
5156 O_RDONLY already includes it).
5157
9e059e3f
GM
5158 Stop ns builds setting the EMACSLOADPATH environment variable.
5159 * nsterm.m (ns_load_path): Rename from ns_init_paths.
5160 Now it does not set EMACSLOADPATH, just returns the load-path string.
5161 * nsterm.h: Update accordingly.
5162 * lread.c [HAVE_NS]: Include nsterm.h.
5163 (init_lread) [HAVE_NS]: Use ns_load_path.
5164 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
5165
7c4e8ec0
GM
51662012-07-09 Glenn Morris <rgm@gnu.org>
5167
d4f600ff
GM
5168 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
5169 since the included bsd-common.h does so.
5170
cbb31951
GM
5171 Stop ns builds setting the EMACSPATH environment variable.
5172 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
5173 (ns_init_paths): Do not set EMACSPATH.
5174 * nsterm.h (ns_exec_path): Add it.
5175 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
5176 Use ns_exec_path.
5177
7c4e8ec0
GM
5178 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
5179
26bccfae
PE
51802012-07-09 Paul Eggert <eggert@cs.ucla.edu>
5181
a0bee46f
PE
5182 * process.c (wait_reading_process_output): 'waitchannels' was unset
5183 when read_kbd || !NILP (wait_for_cell); fix this.
5184
5994c183
PE
5185 Add GCC-style 'const' attribute to functions that can use it.
5186 * character.h (char_resolve_modifier_mask):
5187 * keyboard.h (make_ctrl_char):
5188 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5189 (init_character_once, next_almost_prime, init_fns, init_image)
5190 (flush_pending_output, init_sound):
5191 * mem-limits.h (start_of_data):
5192 * menu.h (finish_menu_items):
5193 Add ATTRIBUTE_CONST.
5194 * emacs.c (DEFINE_DUMMY_FUNCTION):
5195 Declare the dummy function with ATTRIBUTE_CONST.
5196 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5197 Add decls with ATTRIBUTE_CONST.
5198
26bccfae
PE
5199 Minor improvements to make_formatted_string.
5200 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5201 where int is good enough, as vsprintf returns an int.
5202 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5203
a8290ec3
DA
52042012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5205
5206 Use make_formatted_string to avoid double length calculation.
5207 * lisp.h (make_formatted_string): New prototype.
5208 * alloc.c (make_formatted_string): New function.
5209 * buffer.c (Fgenerate_new_buffer_name): Use it.
5210 * dbus.c (syms_of_dbusbind): Likewise.
5211 * editfns.c (Fcurrent_time_zone): Likewise.
5212 * filelock.c (get_boot_time): Likewise.
5213 * frame.c (make_terminal_frame, set_term_frame_name)
5214 (x_report_frame_params): Likewise.
5215 * image.c (gs_load): Likewise.
5216 * minibuf.c (get_minibuffer): Likewise.
5217 * msdos.c (dos_set_window_size): Likewise.
5218 * process.c (make_process): Likewise.
5219 * xdisp.c (ensure_echo_area_buffers): Likewise.
5220 * xsettings.c (apply_xft_settings): Likewise.
5221
d01ba2f1
GM
52222012-07-09 Glenn Morris <rgm@gnu.org>
5223
5224 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5225 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5226 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5227 * nsterm.h (ns_etc_directory): Add it.
5228 * callproc.c [HAVE_NS]: Include nsterm.h.
5229 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5230
f1f924b6
DA
52312012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5232
5233 Move marker debugging code under MARKER_DEBUG.
5234 * marker.c (MARKER_DEBUG): Move marker debugging code under
5235 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5236 for bootstrap with --enable-checking (~3x slowdown reported
5237 by Juanma Barranquero <lekktu@gmail.com>).
5238 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5239
ab531b66
PE
52402012-07-08 Paul Eggert <eggert@cs.ucla.edu>
5241
5242 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5243 See <http://bugs.gnu.org/11825#29>.
5244
c4b3bc8a
EZ
52452012-07-08 Eli Zaretskii <eliz@gnu.org>
5246
5247 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5248 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
5249 (display_line): Add commentary about displaying truncation glyphs
5250 on GUI frames.
5251 (produce_special_glyphs): Move here from term.c.
5252
5253 * term.c (produce_special_glyphs): Move to xdisp.c.
5254
5255 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5256 section.
c4b3bc8a 5257
b676b881
AS
52582012-07-07 Andreas Schwab <schwab@linux-m68k.org>
5259
f17c5273
AS
5260 * xdisp.c (display_line): Avoid warning about implicit declaration
5261 of FRAME_FONT.
5262
298819b9
AS
5263 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5264
b676b881
AS
5265 * lisp.h: Remove empty conditional.
5266
6045c4fd
PE
52672012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5268
b3350bf9
PE
5269 * lread.c (load_path_check): Now static.
5270
6045c4fd
PE
5271 Fix some minor --with-ns problems found by static checking.
5272 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
5273 (x_set_font) [!HAVE_X_WINDOWS]:
5274 * image.c (xpm_load_image) [HAVE_NS]:
5275 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
5276 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
5277 Remove unused local.
5278 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
5279 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
5280 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
5281 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
5282 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
5283 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
5284 Fix pointer signedness problem.
5285 * xfaces.c (FRAME_X_FONT_TABLE):
5286 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
5287
929e7845
GM
52882012-07-07 Glenn Morris <rgm@gnu.org>
5289
5290 * lread.c (load_path_check): New function, split from init_lread.
5291 (init_lread): Reorganize. Motivation:
5292 If EMACSLOADPATH is set, check/warn about that rather than the
5293 defaults, which we are not going to use. Hence we can remove
5294 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
5295 Don't warn if site-lisp directories are missing.
5296 If not installed, start from a blank load-path, since
5297 PATH_LOADSEARCH refers to the eventual installation directories.
5298
58dd0aa4
EZ
52992012-07-07 Eli Zaretskii <eliz@gnu.org>
5300
5301 Support truncation and continuation glyphs on GUI frames, when
5302 fringes are disabled. (Bug#11832)
5303 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
5304 continuation glyphs even if on GUI frames.
5305 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
5306 or both, are absent.
5307 (start_display, move_it_in_display_line_to): Handle the case of a
5308 GUI frame without a fringe to display continuation or truncation
5309 glyphs.
5310 (insert_left_trunc_glyphs): Support GUI frames: make sure
5311 truncation glyphs overwrite enough glyphs from the current line to
5312 have sufficient space in pixels.
5313 (display_line): Support truncation and continuation glyphs on GUI
5314 frames. If some spare pixels are left on the line after inserting
5315 the truncation glyphs, fill that space with a stretch glyph of a
5316 suitably computed width.
5317
5318 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5319 produce_glyphs, to support GUI sessions.
5320
31571fd7
PE
53212012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5322
5a16b9bc
PE
5323 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5324
f3047c75
PE
5325 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5326
31571fd7
PE
5327 Do not require float-time's arg to fit in time_t (Bug#11825).
5328 This works better on hosts where time_t is unsigned, and where
5329 float-time is applied to the (negative) difference between two times.
5330 * editfns.c (decode_time_components): Last arg is now double *,
5331 not int *, and means to store all the result as a double, without
5332 worrying about whether the seconds part fits in time_t.
5333 All callers changed.
5334 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5335 All callers changed.
5336 (Ffloat_time): Do not fail merely because the specified time falls
5337 outside of time_t range.
5338
4516fbef
GM
53392012-07-07 Glenn Morris <rgm@gnu.org>
5340
5341 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5342 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5343 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5344
07adc2c6
JB
53452012-07-07 Juanma Barranquero <lekktu@gmail.com>
5346
5347 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5348 Update dependencies.
5349
5350 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5351
fd573f31
PE
53522012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5353
fee5959d
PE
5354 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5355 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5356 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5357 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5358 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5359 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5360
fd573f31
PE
5361 * xfont.c (compare_font_names): Redo to omit the need for casts.
5362
ddadbc0e
AS
53632012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5364
fca8d6b6
AS
5365 * xfns.c (Fx_change_window_property): Doc fix.
5366 * w32fns.c (Fx_change_window_property): Doc fix.
5367
ddadbc0e
AS
5368 * w32fns.c (Fx_window_property): Accept the same arguments as the
5369 X Windows version. Doc fix.
5370 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5371
ed9265fc 53722012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
5373 Eli Zaretskii <eliz@gnu.org>
5374
5375 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5376 Windows-specific code from nt/config.nt moved here.
5377 Obsolete settings removed.
5378
216ee680
PE
53792012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5380
5381 * process.c: Avoid unnecessary calls to gettime.
5382 (wait_reading_process_output): Don't get the time of day
5383 when gobbling data immediately and not waiting, as there's no need
5384 for it in that case. This removes a FIXME.
5385
bdd091e4
JD
53862012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5387
5388 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5389 is defined (Bug#11768).
5390
9d44f8ce
DA
53912012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5392
5393 Fix marker debugging code.
5394 * marker.c (byte_char_debug_check): Do not perform the check
5395 if buffer is not multibyte.
090bd7cb
JB
5396 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5397 Call byte_char_debug_check with correct arguments.
9d44f8ce 5398
90fc4786
DA
53992012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5400
5401 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
5402 * marker.c (byte_char_debug_check, count_markers):
5403 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
5404 (byte_debug_flag): Remove.
5405 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5406 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5407
7b7ae965
DA
54082012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5409
4e57b342
DA
5410 Avoid code repetition in marker-related functions.
5411 * marker.c (attach_marker): New function.
5412 (Fset_marker, set_marker_restricted, set_marker_both)
5413 (set_marker_restricted_both): Use it.
5414 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5415 Consistently rename charno to charpos.
5416 (marker_position): Add eassert.
5417 (marker_byte_position): Convert to eassert.
5418
54192012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5420
5421 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 5422 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 5423 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 5424
657924ff
DA
54252012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5426
5427 Introduce fast path for the widely used marker operation.
5428 * alloc.c (build_marker): New function.
5429 * lisp.h (build_marker): New prototype.
5430 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5431 * composite.c (autocmp_chars): Likewise.
5432 * editfns.c (buildmark): Remove.
5433 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5434 (save_restriction_save): Use build_marker.
5435 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5436 * window.c (save_window_save): Likewise.
5437
041a49a6
DA
54382012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5439
5440 Do not use Fdelete_overlay in delete_all_overlays
5441 to avoid redundant calls to unchain_overlay.
5442 * buffer.c (drop_overlay): New function.
5443 (delete_all_overlays, Fdelete_overlay): Use it.
5444 * minibuf.c (get_minibuffer): Fix comment.
5445
7dca65a4
PE
54462012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5447
5448 Port to OpenBSD 5.1 amd64.
5449 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5450 This is needed for OpenBSD, and should be harmless on all BSD systems.
5451 Also, include <sys/sysctl.h>, as it should be available on all
5452 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5453 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5454 use p_pid member, not kp_proc.pid.
5455
8eb876e2
GM
54562012-07-06 Glenn Morris <rgm@gnu.org>
5457
5458 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5459
38182d90
PE
54602012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5461
5462 More xmalloc and related cleanup.
5463 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5464 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5465 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5466 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5467 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5468 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5469 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5470 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5471 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5472 * xterm.c:
5473 Omit needless casts involving void * pointers and allocation.
5474 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5475 as the former is more robust if P's type is changed.
5476 Prefer xzalloc to xmalloc + memset 0.
5477 Simplify malloc-or-realloc to realloc.
5478 Don't worry about xmalloc returning a null pointer.
5479 Prefer xstrdup to xmalloc + strcpy.
5480 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5481 growing it.
5482 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5483 alloca of a constant.
5484
6dd5a677
EZ
54852012-07-05 Eli Zaretskii <eliz@gnu.org>
5486
5487 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5488 hscroll is larger than the line width. Fixes long and futile
5489 looping inside extend_face_to_end_of_line (on a TTY) producing
5490 glyphs that are not needed and thrown away.
5491
6b312f0f
DA
54922012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5493
5494 * marker.c (set_marker_restricted_both): Simplify by using
5495 clip_to_bounds.
5496
f520ef9b
PE
54972012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5498
5499 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5500
383b7c95
JD
55012012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5502
5503 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5504 not defined (Bug#11768).
5505 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5506 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5507 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5508 followed by gtk_box_set_homogeneous (Bug#11768).
5509 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
5510 (update_theme_scrollbar_width, xg_create_scroll_bar):
5511 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
5512 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5513 (is_box_type): New function (Bug#11768).
5514 (xg_tool_item_stale_p): Call is_box_type.
5293d758 5515 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
5516 with default display (Bug#11768).
5517
d6e7bf45
EZ
55182012-07-05 Eli Zaretskii <eliz@gnu.org>
5519
5520 * xdisp.c (window_hscroll_limited): New function.
5521 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5522 coordinates when window's hscroll is set to insanely large
5523 values. (Bug#11857)
5524
431391ec
JB
55252012-07-05 Juanma Barranquero <lekktu@gmail.com>
5526
5527 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5528 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5529
23f86fce
DA
55302012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5531
5532 Cleanup xmalloc.
5533 * lisp.h (xzalloc): New prototype. Omit needless casts.
5534 * alloc.c (xzalloc): New function. Omit needless casts.
5535 * charset.c: Omit needless casts. Convert all calls to
5536 xmalloc with following memset to xzalloc.
5537 * dispnew.c: Likewise.
5538 * fringe.c: Likewise.
5539 * image.c: Likewise.
5540 * sound.c: Likewise.
5541 * term.c: Likewise.
5542 * w32fns.c: Likewise.
5543 * w32font.c: Likewise.
5544 * w32term.c: Likewise.
5545 * xfaces.c: Likewise.
5546 * xfns.c: Likewise.
5547 * xterm.c: Likewise.
5548 * atimer.c: Omit needless casts.
5549 * buffer.c: Likewise.
5550 * callproc.c: Likewise.
5551 * ccl.c: Likewise.
5552 * coding.c: Likewise.
5553 * composite.c: Likewise.
5554 * doc.c: Likewise.
5555 * doprnt.c: Likewise.
5556 * editfns.c: Likewise.
5557 * emacs.c: Likewise.
5558 * eval.c: Likewise.
5559 * filelock.c: Likewise.
5560 * fns.c: Likewise.
5561 * gtkutil.c: Likewise.
5562 * keyboard.c: Likewise.
5563 * lisp.h: Likewise.
5564 * lread.c: Likewise.
5565 * minibuf.c: Likewise.
5566 * msdos.c: Likewise.
5567 * print.c: Likewise.
5568 * process.c: Likewise.
5569 * region-cache.c: Likewise.
5570 * search.c: Likewise.
5571 * sysdep.c: Likewise.
5572 * termcap.c: Likewise.
5573 * terminal.c: Likewise.
5574 * tparam.c: Likewise.
5575 * w16select.c: Likewise.
5576 * w32.c: Likewise.
5577 * w32reg.c: Likewise.
5578 * w32select.c: Likewise.
5579 * w32uniscribe.c: Likewise.
5580 * widget.c: Likewise.
5581 * xdisp.c: Likewise.
5582 * xmenu.c: Likewise.
5583 * xrdb.c: Likewise.
5584 * xselect.c: Likewise.
5585
0497dc44
PE
55862012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5587
5588 * fileio.c (time_error_value): Check the right error number.
5589 Problem reported by Troels Nielsen in
5590 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5591
356e7178
PE
55922012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5593
4e71fd89
PE
5594 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5595 This should be fixed in a better way; see Eli Zaretskii in
5596 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5597 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5598
f0941253
PE
5599 * fileio.c (time_error_value): Rename from special_mtime.
5600 The old name's problems were noted by Eli Zaretskii in
5601 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5602
065c9eb4
PE
5603 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5604 This variable's comment says Emacs needs at least one GDB-visible
5605 symbol of type enum pvec_type, to work around GDB problems.
5606 The symbol's value doesn't matter.
5607
356e7178
PE
5608 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5609 that causes compilation to fail on pre-C99 compilers.
5610
ed9265fc 56112012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
5612
5613 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5614 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5615
3884d954
DA
56162012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5617
d209e2fb 5618 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
5619 headers for buffer_defaults and buffer_local_symbols.
5620 Reported by Juanma Barranquero <lekktu@gmail.com>.
5621
ee28be33
SM
56222012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5623
5624 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5625 * lisp.h (enum pvec_type): Use fewer bits.
5626 (PSEUDOVECTOR_SIZE_BITS): New constant.
5627 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5628 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5629 change in pvec_type.
5630 (PSEUDOVECTOR_TYPEP): New macro.
5631 (TYPED_PSEUDOVECTORP): Use it.
5632 * fns.c (internal_equal): Adapt code to extract pvectype.
5633 * emacs.c (gdb_pvec_type): Update type.
5634 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5635 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5636 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5637 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5638 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5639 abusing vector->header.next.nbytes.
5640 (live_vector_p): Use PVEC_TYPE.
5641 (mark_object): Adapt code to extract pvectype. Use switch.
5642
c7f2cd7f
PE
56432012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5644
5645 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5646 Tighten new eassert a bit.
5647
8ce70ed2
DA
56482012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5649
5650 Fix compilation with --enable-gcc-warnings and -O1
5651 optimization level.
5652 * doprnt.c (doprnt): Change type of tem to int, initialize
5653 to avoid compiler warning. Add eassert.
5654 * search.c (simple_search): Initialize match_byte to avoid
5655 compiler warning. Add eassert.
5656
dea7f1e5
PE
56572012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5658
24a212eb
PE
5659 Avoid weird behavior with large horizontal scrolls.
5660 Without this change, for example, large hscroll values would
5661 mess up Emacs's display on Fedora 15 x86, presumably due to
5662 overflows in int calculations in the display code.
5663 Also, if buffers had long lines, Emacs would freeze.
5664 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5665 (set_window_hscroll): New function, containing the old guts of
5666 Fset_window_hscroll. Return the clipped value.
5667 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5668 This avoids the need to check against PTRDIFF_MAX.
5669
dea7f1e5
PE
5670 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5671
76046526
DA
56722012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5673
5674 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5675
39adff0d
PE
56762012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5677
63807d47
PE
5678 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5679 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5680 since GCC 4.4.6 issues a bogus warning for them.
5681
39adff0d
PE
5682 Fix bugs in file timestamp newness comparisons.
5683 * fileio.c (Ffile_newer_than_file_p):
5684 * lread.c (Fload): Use full timestamp resolution of files,
5685 not just the 1-second resolution, so that files that are only
5686 slightly newer still count as newer.
5687 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5688 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5689
dbeed9a6
PE
56902012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5691
5692 * fileio.c: Improve handling of file time marker. (Bug#11852)
5693 (special_mtime): New function.
5694 (Finsert_file_contents, Fverify_visited_file_modtime):
5695 Use it to set special mtime values consistently.
5696
636334d6
AS
56972012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5698
5699 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5700 marker for non-existing file. (Bug#11852)
5701
e2017fe2
GM
57022012-07-03 Glenn Morris <rgm@gnu.org>
5703
5704 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5705 and did not make it into globals.h).
5706
404dbd37
TT
57072012-07-03 Tom Tromey <tromey@redhat.com>
5708
5709 * window.c (Fset_window_margins, Fset_window_fringes)
5710 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5711 * textprop.c (Fprevious_property_change): No longer static.
5712 * syntax.c (Fsyntax_table_p): No longer static.
5713 * process.c (Fget_process, Fprocess_datagram_address): No longer
5714 static.
5715 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5716 * keyboard.c (Fcommand_execute): No longer static.
5717 Remove EXFUN.
5718 * insdel.c (Fcombine_after_change_execute): No longer static.
5719 * image.c (Finit_image_library): No longer static.
5720 * fileio.c (Fmake_symbolic_link): No longer static.
5721 * eval.c (Ffetch_bytecode): No longer static.
5722 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
5723 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5724 No longer static.
404dbd37
TT
5725 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5726 static.
5727 * dired.c (Ffile_attributes): No longer static.
5728 * composite.c (Fcomposition_get_gstring): No longer static.
5729 * callproc.c (Fgetenv_internal): No longer static.
5730
5731 * ccl.h: Remove EXFUNs.
5732 * buffer.h: Remove EXFUNs.
5733 * dispextern.h: Remove EXFUNs.
5734 * intervals.h: Remove EXFUNs.
5735 * fontset.h: Remove EXFUN.
5736 * font.h: Remove EXFUNs.
5737 * dosfns.c (system_process_attributes): Remove EXFUN.
5738 * keymap.h: Remove EXFUNs.
5739 * lisp.h: Remove EXFUNs.
5740 * w32term.h: Remove EXFUNs.
5741 * window.h: Remove EXFUNs.
5742 * xsettings.h: Remove EXFUN.
5743 * xterm.h: Remove EXFUN.
5744
8e4fd1e1
GM
57452012-07-03 Glenn Morris <rgm@gnu.org>
5746
5747 * lisp.h (Frandom): Make it visible to C.
5748 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5749 buffer for invisible buffers. (Bug#1229)
5750
ca95b3eb
DA
57512012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5752
5753 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5754 values which aren't power of 2.
14ae4239
BT
5755 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5756 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
5757 accordingly.
5758
7555c33f
SM
57592012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5760
5761 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5762
5763 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5764
d12e8f5a
DA
57652012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5766
5767 * alloc.c (allocate_vector_block): Remove redundant
5768 calls to mallopt if DOUG_LEA_MALLOC is defined.
5769 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5770 avoid calls to mallopt if zero_vector is returned.
5771
296094c3
DA
57722012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5773
5774 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5775 is enabled, avoid dereferencing NULL current_sblock if
5776 running undumped.
5777
36429c89
DA
57782012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5779
5780 Cleanup basic buffer management.
5781 * buffer.h (struct buffer): Change layout to use generic vector
5782 marking code. Fix some comments. Change type of 'clip_changed'
5783 to bitfield. Remove unused #ifndef old.
5784 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5785 (GET_OVERLAYS_AT): Fix indentation.
5786 (for_each_per_buffer_object_at): New macro.
5787 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5788 (Fbuffer_local_variables): Use it.
5789 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5790 * alloc.c (allocate_buffer): Adjust to match new layout of
5791 struct buffer. Fix comment.
5792 (mark_overlay): New function.
5793 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5794 Lisp area of struct buffer.
5795 (mark_object): Use it. Adjust marking of misc objects
5796 and related comments.
5797
3b3e4cac
PE
57982012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5799
5800 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5801 wrapper that is not needed because the wrapped code is a no-op (zero
5802 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5803 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5804
cf5c0175
DA
58052012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5806
5807 * alloc.c (mark_buffer): Simplify. Remove prototype.
5808 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 5809 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
5810 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5811 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 5812
ca26824c
GM
58132012-06-30 Glenn Morris <rgm@gnu.org>
5814
2e4c5312
GM
5815 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5816
ca26824c
GM
5817 * epaths.in (PATH_SITELOADSEARCH): New.
5818 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5819 This is rather than relying on --enable-locallisppath elements
5820 having "site-lisp" in their names. (Bug#10208#25, 11658)
5821
0d23c240
EZ
58222012-06-30 Eli Zaretskii <eliz@gnu.org>
5823
c9240d7a
EZ
5824 * w32proc.c (sys_select): Accept and ignore one more argument.
5825
5826 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5827
0d23c240 5828 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 5829 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
5830
5831 * sysdep.c: Don't include dos.h and dosfns.h.
5832
5833 * process.c (sys_select):
5834 * msdos.c (sys_select): Accept one more argument and ignore it.
5835
5836 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5837 adapt data types and code to that.
5838
5839 * dosfns.c:
5840 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5841 which clashes with the gnulib function of the same name.
5842
af5a5a98
AS
58432012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5844
c5e4379c
AS
5845 * font.c (font_style_to_value, font_style_symbolic)
5846 (font_prop_validate_style): Add type checks for values in
5847 font_style_table.
5848
af5a5a98
AS
5849 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5850 argument.
5851 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5852 uses.
5853
8d38f461
EZ
58542012-06-29 Eli Zaretskii <eliz@gnu.org>
5855
2e5a6631
EZ
5856 * xdisp.c (try_window_id): Undo last change.
5857
8d38f461
EZ
5858 * w32.c (getwd): Adjust commentary about startup_dir.
5859 (init_environment): Always call sys_access, even in non-MSVC
5860 builds. Don't chdir to the directory of the Emacs executable.
5861 This undoes code from 1997 which was justified by the need to
5862 "avoid conflicts when removing and renaming directories". But its
5863 downside was that every relative file name was being interpreted
5864 relative to the directory of the Emacs executable, which can never
5865 be TRT. In particular, it broke sys_access when called with
5866 relative file names.
5867 (sys_access): Map GetLastError to errno.
5868
2af3565e
DA
58692012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5870
5871 * window.h (struct window): Change type of 'fringes_outside_margins'
5872 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 5873 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
5874 Adjust comment.
5875 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5876 to ptrdiff_t.
5877
c8d3a25c 58782012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 5879
c8d3a25c
GM
5880 * gnutls.c (emacs_gnutls_handshake):
5881 Add QUIT to make the loop interruptible.
57570cd3 5882
c8d3a25c 58832012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 5884
c8d3a25c
GM
5885 * charset.c (init_charset): Make lack of etc/charsets fatal.
5886
3e984ee8
DA
58872012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5888
5889 * editfns.c (region_limit): Fix type mismatch.
5890
ef884f23
DA
58912012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5892
5893 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5894 undefined. Convert from xassert to eassert.
5895 * nsmenu.m: Convert from xassert to eassert.
5896 * nsterm.m: Likewise.
5897
7d7e0027
SM
58982012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5899
5900 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5901
aa754e6a
PE
59022012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5903
5904 Avoid integer overflow on scroll-left and scroll-right.
5905 * window.c (HSCROLL_MAX): New macro.
5906 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5907 overflow when requested scroll falls outside ptrdiff_t range.
5908
80b00b08
DA
59092012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5910
5911 * window.h (struct window): Change type of 'hscroll',
5912 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5913 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5914 Adjust users accordingly.
5915 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5916 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5917 from EMACS_INT to ptrdiff_t.
5918 (make_window): Omit redundant initialization.
5919
62b2bcf6
JB
59202012-06-28 Juanma Barranquero <lekktu@gmail.com>
5921
5922 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5923
45942c7d
DA
59242012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5925
5926 * window.h (struct window): Change type of 'use_time' and
5927 'sequence_number' from Lisp_Object to int.
5928 * frame.c (make_frame): Adjust users accordingly.
5929 * print.c (print_object): Likewise.
5930 * window.c (select_window, Fwindow_use_time, make_parent_window)
5931 (make_window): Likewise.
5932
e509cfa6
DA
59332012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5934
5935 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5936 enabled with --enable-checking=[all,glyphs] configure option.
5937 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5938 adjust comments accordingly.
5939 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5940 undefined, adjust comments accordingly.
5941 * image.c: Likewise.
5942 * scroll.c: Likewise.
5943 * w32fns.c: Likewise.
5944 * w32term.c: Likewise.
5945 * xdisp.c: Likewise.
5946 * xfaces.c: Likewise.
5947 * xfns.c: Likewise.
5948 * xterm.c: Likewise.
5949
a54e2c05
DA
59502012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5951
5952 Generalize run-time debugging checks.
5953 * dispextern.h (XASSERTS): Remove.
5954 * fontset.c (xassert): Remove.
5955 Convert from xassert to eassert.
5956 * alloc.c: Convert from xassert to eassert.
5957 * bidi.c: Likewise.
5958 * dispnew.c: Likewise.
5959 * fns.c: Likewise.
5960 * fringe.c: Likewise.
5961 * ftfont.c: Likewise.
5962 * gtkutil.c: Likewise.
5963 * image.c: Likewise.
5964 * keyboard.c: Likewise.
5965 * menu.c: Likewise.
5966 * process.c: Likewise.
5967 * scroll.c: Likewise.
5968 * sound.c: Likewise.
5969 * term.c: Likewise.
5970 * w32console.c: Likewise.
5971 * w32fns.c: Likewise.
5972 * w32term.c: Likewise.
5973 * window.c: Likewise.
5974 * xdisp.c: Likewise.
5975 * xfaces.c: Likewise.
5976 * xfns.c: Likewise.
5977 * xselect.c: Likewise.
5978 * xterm.c: Likewise.
5979
1ec4b7b2
SM
59802012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5981
5982 * fns.c (maybe_resize_hash_table): Output message when growing the
5983 purify-hashtable.
5984
2014308a
DA
59852012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5986
5987 * alloc.c (allocate_string_data): Remove dead code.
5988 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5989 avoid GCC warning about unused macro.
5990
246155eb
DA
59912012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5992
5993 * alloc.c (allocate_string): Omit intervals initialization.
5994 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5995 as in make_pure_string and make_pure_c_string.
5996
43184b7b
DA
59972012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5998
d209e2fb 5999 * alloc.c (allocate_string): Fix last change.
43184b7b 6000
3fe6dd74
DA
60012012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6002
d209e2fb 6003 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
6004 to memset, add explicit initialization where appropriate.
6005
1ba6038a
GM
60062012-06-27 Glenn Morris <rgm@gnu.org>
6007
6008 * lisp.mk (lisp): Remove paths.elc.
6009
c89926a5
CY
60102012-06-27 Chong Yidong <cyd@gnu.org>
6011
6012 * doc.c (Fsubstitute_command_keys): Fix punctuation.
6013
ed6b3510
JW
60142012-06-26 John Wiegley <johnw@newartisans.com>
6015
1ec4b7b2 6016 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
6017 on Mac OS X Lion: __mod_init_func and __mod_term_func.
6018
ed6b3510
JW
6019 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6020 when building with Clang.
6021
8edd4a2b
SM
60222012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
6023
6024 * eval.c (Fapply): Allow calling it with a single argument.
6025
f6f62d1b
EZ
60262012-06-26 Eli Zaretskii <eliz@gnu.org>
6027
6028 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6029 _stricmp and _strnicmp.
6030 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6031
62efea5e
DA
60322012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6033
6034 * alloc.c (allocate_window): Zero out non-Lisp part of newly
6035 allocated window.
6036 (allocate_process): Likewise for new process.
8edd4a2b 6037 (allocate_terminal): Change to use offsetof.
62efea5e
DA
6038 (allocate_frame): Likewise.
6039 * frame.c (make_frame): Omit redundant initialization.
6040 * window.c (make_parent_window): Use memset.
6041 (make_window): Omit redundant initialization.
6042 * process.c (make_process): Omit redundant initialization.
6043 * terminal.c (create_terminal): Likewise.
6044
42997f4d
DA
60452012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6046
6047 * term.c (delete_tty): Remove redundant call to memset.
6048
1130ecfc
DA
60492012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6050
6051 * alloc.c: Remove build_string.
6052 * lisp.h: Define build_string as static inline. This provides
6053 a better opportunity to optimize away calls to strlen when the
6054 function is called with compile-time constant argument.
6055 * image.c (imagemagick_error): Convert to build_string.
6056 * w32proc.c (sys_spawnve): Likewise.
6057 * xterm.c (x_term_init): Likewise.
6058
cf38a720
PE
60592012-06-26 Paul Eggert <eggert@cs.ucla.edu>
6060
99027bdd
PE
6061 Use sprintf return value instead of invoking strlen on result.
6062 In the old days this wasn't portable, since some sprintf
6063 implementations returned char *. But they died out years ago and
6064 Emacs already assumes sprintf returns int.
6065 Similarly for float_to_string.
6066 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6067 * ccl.c (ccl_driver):
6068 * character.c (string_escape_byte8):
6069 * data.c (Fnumber_to_string):
6070 * doprnt.c (doprnt):
6071 * print.c (print_object):
6072 * xdisp.c (message_dolog):
6073 * xfns.c (syms_of_xfns):
6074 Use sprintf or float_to_string result to avoid need to call strlen.
6075 * data.c (Fnumber_to_string):
6076 Use make_unibyte_string, since the string must be ASCII.
6077 * lisp.h, print.c (float_to_string): Now returns int length.
6078 * term.c (produce_glyphless_glyph):
6079 Use sprintf result rather than recomputing it.
6080
cf38a720
PE
6081 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6082 * Makefile.in (ALL_CFLAGS):
6083 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6084 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6085
3511c784
DA
60862012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6087
0a08eb21 6088 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
6089 strcasecmp if available.
6090 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6091
fb7da12e
AS
60922012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6093
6094 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6095 Avoid comma operator.
6096 * menu.c (push_submenu_start, push_submenu_end)
6097 (push_left_right_boundary, push_menu_pane): Likewise.
6098 * msdos.c (dos_rawgetc): Likewise.
6099
afa2ffd8
DA
61002012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6101
6102 * xfns.c (xic_create_fontsetname): Remove redundant calls
6103 to memset.
6104
b3b4476b
PE
61052012-06-25 Paul Eggert <eggert@cs.ucla.edu>
6106
4495ff38
PE
6107 * gtkutil.c (get_utf8_string): Remove redundant assignment.
6108 sprintf already null-terminates its output.
6109
b3b4476b
PE
6110 * xfns.c (x_window): Remove redundant cast.
6111
b00876c9
DA
61122012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6113
6114 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6115 `const char *' to `char *' to avoid compiler warning.
6116
d188e26b
PE
61172012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6118
885d1d74
PE
6119 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6120 instead of truncating it to 63 (admittedly a generous limit).
6121
d188e26b
PE
6122 * process.c: Fix spelling and caps in comments.
6123
e2f560b1
DN
61242012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
6125
e86db54b 6126 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
6127 * sysdep.c (setpgrp): Remove definition, not used in this file.
6128
7583a3a1
JB
61292012-06-24 Juanma Barranquero <lekktu@gmail.com>
6130
6131 * makefile.w32-in: Update dependencies.
6132
696056c2
EZ
61332012-06-24 Eli Zaretskii <eliz@gnu.org>
6134
6135 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
6136 (SYSTIME_H): Add nt/inc/sys/time.h.
6137
6138 * systime.h [WINDOWSNT]: Include sys/time.h.
6139
6140 * s/ms-w32.h (struct timespec): Definition moved from
6141 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
6142
845ca893
PE
61432012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6144
6145 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
6146 * buffer.h (buffer_slot_type_mismatch):
6147 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6148 * eval.c (unwind_to_catch):
6149 * image.c (my_png_error, my_error_exit):
6150 * keyboard.c (quit_throw_to_read_char, user_error)
6151 (Fexit_recursive_edit, Fabort_recursive_edit):
6152 * lisp.h (die, args_out_of_range, args_out_of_range_3)
6153 (wrong_type_argument, buffer_overflow, __executable_start)
6154 (memory_full, buffer_memory_full, string_overflow, Fthrow)
6155 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
6156 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
6157 (fatal):
6158 (child_setup) [!DOS_NT]:
6159 * lread.c (end_of_file_error, invalid_syntax):
6160 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6161 * puresize.h (pure_write_error):
6162 * search.c (matcher_overflow):
6163 * sound.c (sound_perror, alsa_sound_perror):
6164 * sysdep.c, syssignal.h (croak):
6165 * term.c (maybe_fatal, vfatal):
6166 * textprop.c (text_read_only):
6167 * undo.c (user_error):
6168 * unexmacosx.c (unexec_error):
6169 * xterm.c (x_ins_del_lines, x_delete_glyphs):
6170 Use _Noreturn rather than NO_RETURN.
6171 No need for separate decl merely because of _Noreturn.
6172 * sound.c (sound_warning, parse_sound):
6173 Remove unnecessary forward decls.
6174
f1dd8073
PE
61752012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6176
6177 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
6178 * lisp.h (WAIT_READING_MAX): New macro.
6179 * dispnew.c (Fsleep_for, sit_for):
6180 * keyboard.c (kbd_buffer_get_event):
6181 * process.c (Faccept_process_output):
6182 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6183 This improves on the previous patch, which introduced a bug
6184 when time_t is unsigned and as wide as intmax_t.
6185 See <http://bugs.gnu.org/9000#51>.
6186
b82c1755
EZ
61872012-06-23 Eli Zaretskii <eliz@gnu.org>
6188
6189 * dispnew.c (sit_for, Fsleep_for):
6190 * keyboard.c (kbd_buffer_get_event):
6191 * process.c (Faccept_process_output): Avoid compiler warnings when
6192 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6193
ca300656
JB
61942012-06-23 Juanma Barranquero <lekktu@gmail.com>
6195
049ec95b
JB
6196 * makefile.w32-in: Update dependencies.
6197
ca300656
JB
6198 * w32.c (ltime): Add return type and declare static.
6199 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6200
db7b8d06
PE
62012012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6202
6203 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6204 Privately reported by Herbert J. Skuhra.
6205 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6206 All uses changed.
6207 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6208 not make_lisp_timeval, when the argument is of type EMACS_TIME.
6209
0bd8297f
EZ
62102012-06-23 Eli Zaretskii <eliz@gnu.org>
6211
96512555
EZ
6212 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6213 last argument of make_unibyte_string.
6214
0bd8297f
EZ
6215 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6216 language ID in the event parameters.
6217
6218 * w32term.c (w32_read_socket): Put the new keyboard codepage into
6219 event.code, not the obscure "character set ID".
6220
63def6b6
CY
62212012-06-23 Chong Yidong <cyd@gnu.org>
6222
6223 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6224
e8a02204
EZ
62252012-06-23 Eli Zaretskii <eliz@gnu.org>
6226
388cdec0
EZ
6227 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6228 * w32.c (fdutimens): New function.
6229
6230 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6231
6232 * s/ms-w32.h (pselect): Redirect to sys_select.
6233
6234 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6235
e8a02204
EZ
6236 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6237 in the logic of incrementing and decrementing the value of
6238 use_relocatable_buffers.
6239
d054f3fb
PE
62402012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6241
6242 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6243 Privately reported by Herbert J. Skuhra.
6244 [__FreeBSD__]: Remove "*/" typo after "#include".
6245 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6246 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6247 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6248 Don't assume EMACS_TIME and struct timeval are the same type.
6249
d35af63c
PE
62502012-06-22 Paul Eggert <eggert@cs.ucla.edu>
6251
6252 Support higher-resolution time stamps (Bug#9000).
6253 The time stamps are only nanosecond-resolution at the C level,
6254 since that's the best that any real-world system supports now.
6255 But they are picosecond-resolution at the Lisp level, as that's
6256 easy, and leaves room for future OS improvements.
6257
6258 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6259 (LIBES): Use it.
6260
6261 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6262 Don't get current time unless it's needed.
6263
6264 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6265 now provides it if it's absent.
6266 (start_atimer): Port to higher-res time stamps.
6267 Check for time stamp overflow. Don't get current time more
6268 often than is needed.
6269
6270 * buffer.h (struct buffer): Buffer modtime now has high resolution.
6271 Include systime.h, not time.h.
6272 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
6273
6274 * dired.c: Include stat-time.h.
6275 (Ffile-attributes): File times now have higher resolution.
6276
6277 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
6278 (struct image): Timestamp now has higher resolution.
6279
6280 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
6281 has at least microseconds now. All uses removed.
6282 (update_frame, update_single_window, update_window, update_frame_1)
6283 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 6284 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
6285
6286 * editfns.c (time_overflow): Now extern.
6287 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
6288 (float-time, Fformat_time_string, Fcurrent_time_string)
6289 (Fcurrent_time_zone): Accept and generate higher-resolution
6290 time stamps.
6291 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
6292 (decode_time_components, lisp_seconds_argument): New functions.
6293 (make_time): Now static.
6294 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
6295 Report an error if the time is invalid, rather than having the caller
6296 do that.
6297
6298 * fileio.c: Include <stat-time.h>
6299 (Fcopy_file): Copy higher-resolution time stamps.
6300 Prefer to set the time stamp via a file descriptor if that works.
6301 (Fset_file_times, Finsert_file_contents, Fwrite_region)
6302 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
6303 (Fvisited_file_modtime, Fset_visited_file_modtime):
6304 Support higher-resolution time stamps.
6305
6306 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6307
6308 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6309
6310 * image.c (prepare_image_for_display, clear_image_cache)
6311 (lookup_image): Port to higer-resolution time stamps.
6312
6313 * keyboard.c (start_polling, bind_polling_period):
6314 Check for time stamp overflow.
6315 (read_char, kbd_buffer_get_event, timer_start_idle)
6316 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6317 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6318 Port to higher-resolution time stamps. Do not assume time_t is signed.
6319 (decode_timer): New function. Timers are now vectors of length 9,
6320 not 8, to accommodate the picosecond component.
6321 (timer_check_2): Use it.
6322
6323 * nsterm.m (select_timeout, timeval_subtract): Remove.
6324 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6325 as they're a bit more accurate and handle overflow better.
6326 (ns_select): Change prototype to be compatible with pselect.
6327 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6328 * nsterm.h (ns_select): Adjust prototype.
6329
6330 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6331 us-resolution time stamps.
6332 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6333
6334 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6335
6336 * lisp.h (time_overflow): New decl.
6337 (wait_reading_process_output): First arg is now intmax_t, not int,
6338 to accommodate larger waits.
6339
6340 * process.h (struct Lisp_Process.read_output_delay):
6341 Now counts nanoseconds, not microseconds.
6342 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6343 EMACS_HAS_USECS.
6344 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6345 (wait_reading_process_output):
6346 Port to ns-resolution time stamps.
6347 (Faccept_process_output, wait_reading_process_output):
6348 Check for time stamp overflow. Do not assume time_t is signed.
6349 (select_wrapper): Remove; we now use pselect.
6350 (Fprocess_attributes): Now generates ns-resolution time stamps.
6351
6352 * sysdep.c: Include utimens.h. Don't include utime.h
6353 or worry about struct utimbuf; gnulib does that for us now.
6354 (gettimeofday): Remove; gnulib provides a substitute.
6355 (make_timeval): New function.
6356 (set_file_times): Now sets ns-resolution time stamps.
6357 New arg FD; all uses changed.
6358 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6359 (system_process_attributes):
6360 Now returns ns-resolution time stamp. All uses changed.
6361 Check for time stamp overflow.
6362
6363 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6364 provides a substitute now.
6365
6366 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6367 since it guarantees struct timespec.
6368 (EMACS_TIME): Now struct timespec, so that we can support
6369 ns-resolution time stamps.
6370 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6371 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6372 (EMACS_USECS): Remove.
6373 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6374 so multiply the arg by 1000 before storing it.
6375 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6376 New macros.
6377 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6378 Port to ns-resolution time stamps.
6379 (EMACS_TIME_NEG_P): Remove; replaced by....
6380 (EMACS_TIME_SIGN): New macro.
6381 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6382 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6383 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6384 (make_timeval, make_lisp_time, decode_time_components): New decls.
6385 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6386 that it mishandled time_t overflow. You can't compare by subtracting!
6387 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6388 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6389
6390 * term.c: Include <sys/time.h>.
6391 (timeval_to_Time): New function, for proper overflow wraparound.
6392 (term_mouse_position, term_mouse_click): Use it.
6393
6394 * undo.c (record_first_change): Support higher-resolution time stamps
6395 in the undo buffer.
6396 (Fprimitive_undo): Use them when restoring time stamps.
6397
6398 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6399 (w32_get_internal_run_time):
6400 Port to higher-resolution Emacs time stamps.
6401 (ltime): Now accepts single 64-bit integer, as that's more convenient
6402 for callers.
6403
6404 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6405
6406 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6407 for compatibility with pselect. Support ns-resolution time stamps.
6408
6409 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6410
6411 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6412 Check for time stamp overflow, and support ns-resolution time stamps.
6413
6414 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6415 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6416 (timeval_subtract): Remove; no longer needed.
6417 (XTflash, XTring_bell, x_wait_for_event):
6418 Port to ns-resolution time stamps. Don't assume time_t is signed.
6419
b6a92dfe
CY
64202012-06-22 Chong Yidong <cyd@gnu.org>
6421
6422 * xdisp.c (x_consider_frame_title): Revert last change.
6423
d251c37c
EZ
64242012-06-22 Eli Zaretskii <eliz@gnu.org>
6425
6426 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6427 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6428 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6429 staticidx goes up to 1597 out of 1600 = 0x640.)
6430
f10deafb
PE
64312012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6432
6433 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6434 Otherwise, the umask might be mistakenly 0 while handling input signals.
6435
ec6de1e2
SM
64362012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6437
6438 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6439
28be1ada
DA
64402012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6441
6442 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6443 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6444 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6445 access to `contents' member of Lisp_Vector objects with AREF and ASET
6446 where appropriate.
6447
c6bf3022
CY
64482012-06-19 Chong Yidong <cyd@gnu.org>
6449
6450 * frame.c (delete_frame): When selecting a frame on a different
6451 text terminal, do not alter the terminal's top-frame.
6452
6453 * xdisp.c (format_mode_line_unwind_data): Record the target
6454 frame's selected window and its terminal's top-frame.
6455 (unwind_format_mode_line): Restore them.
6456 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6457 Callers changed.
6458 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6459 since tty frames can be explicitly named.
6460 (prepare_menu_bars): Likewise.
6461
6462 * term.c (Ftty_top_frame): New function.
6463
defd4196
PE
64642012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6465
6466 Port byte-code-meter to modern targets.
6467 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6468 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 6469 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
6470 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6471 (METER_1, METER_2): Simplify.
6472
1053a871
SM
64732012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6474
6475 * data.c (Fdefalias): Return `symbol' (bug#11686).
6476
b7e8d081
MR
64772012-06-18 Martin Rudalics <rudalics@gmx.at>
6478
6479 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
6480 gets killed during executing of this function (Bug#11665).
6481 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
6482 (Vkill_buffer_query_functions): In doc-string say that functions
6483 run by this hook should not change the current buffer.
6484
7ea2b339
PE
64852012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6486
6487 Fix recently-introduced process.c problems found by static checking.
6488 * process.c (write_queue_push, write_queue_pop, send_process):
6489 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6490 (write_queue_pop): Fix pointer signedness problem.
6491 (send_process): Remove unused local.
6492
96a313a1
CY
64932012-06-17 Chong Yidong <cyd@gnu.org>
6494
6495 * xdisp.c (redisplay_internal): No need to redisplay terminal
6496 frames that are not on top.
6497
20ca2e94
TN
64982012-06-17 Troels Nielsen <bn.troels@gmail.com>
6499
6500 * process.c (make_process): Initialize write_queue.
6501 (write_queue_push, write_queue_pop): New functions.
6502 (send_process): Use them to maintain correct ordering of process
6503 writes (Bug#10815).
6504
9a900ca9
PE
65052012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6506
310fbfa8
PE
6507 * lisp.h (eassert): Assume C89 or later.
6508 This removes the need for CHECK.
6509 (CHECK): Remove. Its comments about always evaluating its
6510 argument were confusing, as 'eassert' typically does not evaluate
6511 its argument.
6512
27bb1ca4
PE
6513 * coding.c (produce_chars): Use ptrdiff_t, not int.
6514
9a900ca9
PE
6515 * xterm.c (x_draw_underwave): Check for integer overflow.
6516 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6517
41b7f8bc 65182012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
6519
6520 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6521 referenced (Bug#11583).
6522
9b0e3eba
AA
65232012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6524
6525 Implement wave-style variant of underlining.
6526 * dispextern.h (face_underline_type): New enum.
6527 (face): Add field for underline type.
6528 * nsterm.m (ns_draw_underwave): New function.
6529 (ns_draw_text_decoration): Use it.
6530 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6531 New functions.
6532 (x_draw_glyph_string): Use them.
6533 * xfaces.c (Qline, Qwave): New Lisp objects.
6534 (check_lface_attrs, merge_face_ref)
1053a871
SM
6535 (Finternal_set_lisp_face_attribute, realize_x_face):
6536 Handle wave-style underline face attributes.
9b0e3eba
AA
6537 * xterm.c (x_draw_underwave): New function.
6538 (x_draw_glyph_string): Use it.
6539
0fb52f11
JB
65402012-06-16 Juanma Barranquero <lekktu@gmail.com>
6541
6542 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6543 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6544 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6545 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6546 ($(BLD)/w32select.$(O)): Update dependencies.
6547
e5560ff7
AS
65482012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6549
6550 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6551 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6552 * character.c (_fetch_multibyte_char_p): Remove.
6553 * alloc.c: Include "character.h" before "buffer.h".
6554 * bidi.c: Likewise.
6555 * buffer.c: Likewise.
6556 * bytecode.c: Likewise.
6557 * callint.c: Likewise.
6558 * callproc.c: Likewise.
6559 * casefiddle.c: Likewise.
6560 * casetab.c: Likewise.
6561 * category.c: Likewise.
6562 * cmds.c: Likewise.
6563 * coding.c: Likewise.
6564 * composite.c: Likewise.
6565 * dired.c: Likewise.
6566 * dispnew.c: Likewise.
6567 * doc.c: Likewise.
6568 * dosfns.c: Likewise.
6569 * editfns.c: Likewise.
6570 * emacs.c: Likewise.
6571 * fileio.c: Likewise.
6572 * filelock.c: Likewise.
6573 * font.c: Likewise.
6574 * fontset.c: Likewise.
6575 * fringe.c: Likewise.
6576 * indent.c: Likewise.
6577 * insdel.c: Likewise.
6578 * intervals.c: Likewise.
6579 * keyboard.c: Likewise.
6580 * keymap.c: Likewise.
6581 * lread.c: Likewise.
6582 * macros.c: Likewise.
6583 * marker.c: Likewise.
6584 * minibuf.c: Likewise.
6585 * nsfns.m: Likewise.
6586 * nsmenu.m: Likewise.
6587 * print.c: Likewise.
6588 * process.c: Likewise.
6589 * regex.c: Likewise.
6590 * region-cache.c: Likewise.
6591 * search.c: Likewise.
6592 * syntax.c: Likewise.
6593 * term.c: Likewise.
6594 * textprop.c: Likewise.
6595 * undo.c: Likewise.
6596 * unexsol.c: Likewise.
6597 * w16select.c: Likewise.
6598 * w32fns.c: Likewise.
6599 * w32menu.c: Likewise.
6600 * window.c: Likewise.
6601 * xdisp.c: Likewise.
6602 * xfns.c: Likewise.
6603 * xmenu.c: Likewise.
6604 * xml.c: Likewise.
6605 * xselect.c: Likewise.
6606
2f07e6af
EZ
66072012-06-16 Eli Zaretskii <eliz@gnu.org>
6608
1053a871
SM
6609 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6610 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 6611 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
6612 row.
6613 (handle_face_prop): Use chunk-relative overlay string index when
6614 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
6615 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6616 the rightmost. (Bug#11720)
2f07e6af 6617
29b83cec
AS
66182012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6619
6620 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6621 (CATEGORY_MEMBER): Enforce 1/0 value.
6622 * category.c (_temp_category_set): Remove.
6623
4c5501e9
EZ
66242012-06-16 Eli Zaretskii <eliz@gnu.org>
6625
6626 * window.c (Fdelete_other_windows_internal)
6627 (Fdelete_window_internal): Don't access frame's mouse highlight
6628 info of the initial frame. (Bug#11677)
6629
2b570124
PE
66302012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6631
e93864f9
PE
6632 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6633 Assume USE_2_TAGS_FOR_INTS.
6634 (xreload): Adjust $tagmask width to match recent lisp.h change.
6635
2b570124
PE
6636 Simplify lisp.h in minor ways that should not affect code.
6637 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6638 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6639 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6640 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6641 (INTTYPEBITS): New macro, for clarity.
6642 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
6643 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6644 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
6645 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6646 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6647
81755f69
JB
66482012-06-13 Juanma Barranquero <lekktu@gmail.com>
6649
6650 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6651
16192a57
GM
66522012-06-13 Glenn Morris <rgm@gnu.org>
6653
6654 * s/bsd-common.h (BSD4_3):
6655 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6656
646b5f55
AS
66572012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6658
6659 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6660 instead of union.
6661 (XLI, XIL): Define.
1053a871
SM
6662 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6663 Use them.
6664 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 6665 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 6666 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
6667 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6668 * frame.c (delete_frame): Remove outdated comment.
6669 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6670 USE_LISP_UNION_TYPE.
6671 (Fw32_unregister_hot_key): Likewise.
6672 (Fw32_toggle_lock_key): Likewise.
6673 * w32menu.c (add_menu_item): Likewise.
6674 (w32_menu_display_help): Use XIL instead of checking
6675 USE_LISP_UNION_TYPE.
6676 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6677 (init_heap): Likewise.
6678 * w32term.c (w32_read_socket): Update comment.
6679
1d3823c9
GM
66802012-06-13 Glenn Morris <rgm@gnu.org>
6681
c62ff706
GM
6682 * s/usg5-4-common.h, src/s/unixware.h:
6683 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6684
1d3823c9
GM
6685 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6686
bfe3e0a2
PE
66872012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6688
6689 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6690 * alloc.c (make_number) [!defined make_number]:
6691 Remove, as lisp.h always defines this now.
6692 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6693 (roundup_size): Verify that it is a power of 2.
6694 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6695 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6696 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6697 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6698 USE_LSB_TAG now is always defined to be either 0 or 1.
6699 All uses changed.
6700 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6701 code works fine either way, and efficiency is not a concern here,
6702 as the union type is for debugging, not for production.
6703 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6704 Use an inline function on all platforms when using the union type,
6705 since this is simpler and 'static inline' can be used portably
6706 within Emacs now.
6707 (LISP_INITIALLY_ZERO): New macro.
6708 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6709 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6710
45fa9c0f
GM
67112012-06-12 Glenn Morris <rgm@gnu.org>
6712
b4492cba
GM
6713 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6714
6715 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 6716
45fa9c0f
GM
6717 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6718 Move BROKEN_SIGIO to configure.
6719
6720 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6721 Move NO_TERMIO to configure.
6722
0e25d334
CY
67232012-06-12 Chong Yidong <cyd@gnu.org>
6724
6725 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6726 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6727 MagickExportImagePixels is undefined.
6728
43682bb6
PE
67292012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6730
6731 * image.c (imagemagick_load_image): Remove unused label.
6732
a9be7d2b
GM
67332012-06-11 Glenn Morris <rgm@gnu.org>
6734
6735 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6736 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6737 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6738 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6739
3017f87f
SM
67402012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6741
6742 * alloc.c (make_byte_code): New function.
6743 (Fmake_byte_code): Use it. Don't purify here.
6744 * lread.c (read1): Use it as well to avoid extra allocation.
6745
1b9b4cf4
CY
67462012-06-11 Chong Yidong <cyd@gnu.org>
6747
6748 * image.c (imagemagick_load_image): Implement transparency.
6749
95988fcf
AS
67502012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6751
6752 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6753 account for preceding backslashes. (Bug#11663)
6754
cd4eb164
CY
67552012-06-09 Chong Yidong <cyd@gnu.org>
6756
6757 * term.c: Support italics in capable terminals (Bug#9652).
6758 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6759 (turn_on_face): Output using TS_enter_italic_mode if available.
6760 Don't handle unused blinking and alt-charset cases.
6761 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6762 and tty_alt_charset_p cases.
6763 (tty_capable_p, init_tty): Support italics.
6764
6765 * termchar.h (struct tty_display_info): Add field for italics.
6766 Remove unused blink field.
6767
6768 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6769 Handle slant.
6770
6771 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6772 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6773 tty_alt_charset_p. Add tty_italic_p.
6774
ff88beb8
MA
67752012-06-09 Michael Albinus <michael.albinus@gmx.de>
6776
6777 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6778 dbus_type_is_basic if available.
6779 (xd_extract_signed, xd_extract_unsigned): Rename from
6780 extract_signed and extract_unsigned, respectively. Adapt callers.
6781
44286096
CY
67822012-06-09 Chong Yidong <cyd@gnu.org>
6783
1682701f
CY
6784 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6785
44286096
CY
6786 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6787 case (Bug#9752).
6788
d86feb17
PE
67892012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6790
6791 * xdisp.c (vmessage): Treat frame message as multibyte.
6792 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6793 would generate the diagnostic "Making \302\247 buffer-local while
6794 let-bound!".
6795
d5c20fe8
EZ
67962012-06-08 Eli Zaretskii <eliz@gnu.org>
6797
6798 * dispnew.c (showing_window_margins_p): Undo last change, which
6799 was done due to an inadvertent commit.
6800 (adjust_frame_glyphs_for_frame_redisplay): Do call
6801 showing_window_margins_p.
6802
513749ee
SM
68032012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6804
6805 * eval.c (Fmake_var_non_special): New primitive.
6806 (syms_of_eval): Defsubr it.
6807 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6808
d4a8f5c1
JB
68092012-06-08 Juanma Barranquero <lekktu@gmail.com>
6810
6811 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6812 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6813
8bbbc977
EZ
68142012-06-08 Eli Zaretskii <eliz@gnu.org>
6815
6816 * alloc.c (allocate_vectorlike): Fix last change.
6817
f3372c87
DA
68182012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6819
6820 Block-based vector allocation of small vectors.
6821 * lisp.h (struct vectorlike_header): New field `nbytes',
6822 adjust comment accordingly.
6823 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 6824 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
6825 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6826 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6827 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6828 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6829 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6830 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6831 (roundup_size): New constant.
6832 (struct vector_block): New data type.
6833 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 6834 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
6835 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6836 (sweep_vectors): New functions.
6837 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 6838 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
6839 or equal to VBLOCK_BYTES_MAX.
6840 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6841 (init_alloc_once): Add call to init_vectors.
6842
4f18a4ed
SM
68432012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6844
6845 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6846
86f158bc
PE
68472012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6848
6849 * doprnt.c (doprnt): Truncate multibyte char correctly.
6850 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6851 would mishandle a string argument "Xc" if X was a multibyte
6852 character of length 2: it would truncate after X's first byte
6853 rather than including all of X.
6854
c5cfcbe0
CY
68552012-06-06 Chong Yidong <cyd@gnu.org>
6856
6857 * buffer.c (word_wrap): Doc fix.
6858
c05cf390
PE
68592012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6860
6861 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6862
0c3461de
GM
68632012-06-03 Glenn Morris <rgm@gnu.org>
6864
6865 * xdisp.c (tool-bar-style): Doc fix.
6866
c71232db
UM
68672012-06-03 Ulrich Müller <ulm@gentoo.org>
6868
6869 * Makefile.in (PAXCTL): Define.
6870 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6871 binary via PaX flags if the paxctl utility is available.
6872 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6873 Restore PaX flags to their default. (Bug#11398)
6874
383f7350
CY
68752012-06-03 Chong Yidong <cyd@gnu.org>
6876
6877 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6878 buffer (Bug#11226).
6879
5f2c76c6
CY
68802012-06-03 Chong Yidong <cyd@gnu.org>
6881
6882 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6883 (note_mode_line_or_margin_highlight): If there is no help echo,
6884 use mode-line-default-help-echo. Handle the case where the mouse
6885 position is past the end of the mode line string.
6886
6887 * buffer.c (buffer_local_value_1): New function, split from
6888 Fbuffer_local_value; can return Qunbound.
6889 (Fbuffer_local_value): Use it.
6890 (Vmode_line_format): Docstring tweaks.
6891
773d47f6
PE
68922012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6893
6894 * sysdep.c (system_process_attributes): Improve comment.
6895
f2d6a3df
SM
68962012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6897
6898 * keyboard.c: Export real-this-command to Elisp.
6899 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6900 and DEFVAR it. Update all users.
6901
63810350
PE
69022012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6903
7bd5c1f4
PE
6904 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6905
63810350
PE
6906 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6907 Convert pctcpu and pctmem to Lisp float properly.
6908 Let the compiler fold better, as 100.0/0x8000 is exact.
6909
a2821611
AS
69102012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6911
6912 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6913 cons_block.
6914
5fceba1d
PE
69152012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6916
6917 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6918
c98ff5dd
DA
69192012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6920
6921 For a 'struct window', replace some Lisp_Object fields to
6922 bitfields where appropriate, remove unused fields.
6923 * window.h (struct window): Remove unused 'last_mark_x' and
6924 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6925 change it's type from Lisp_Object to bitfield.
6926 Change type of 'force_start', 'optional_new_start',
6927 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 6928 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 6929
ca34e0be
PE
69302012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6931
6932 Pacify gcc -Wdouble-precision when using Xaw.
6933 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6934 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6935 Use 'float' consistently, rather than 'float' in most places
6936 and 'double' in a couple of places.
6937
efc00ab1 69382012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
6939
6940 * xdisp.c (handle_stop): Detect whether we have overlay strings
6941 loaded by testing it->current.overlay_string_index to be
6942 non-negative, instead of checking whether n_overlay_strings is
6943 positive. (Bug#11587)
6944
efc00ab1 69452012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
6946
6947 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6948
6949 * doc.c (Fsubstitute_command_keys): Doc fix.
6950
efc00ab1 69512012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
6952
6953 * search.c (search_buffer): Remove calls to
6954 r_alloc_inhibit_buffer_relocation, as it is now called by
6955 maybe_unify_char, which was the cause of relocation of buffer text
6956 in bug#11519.
6957
efc00ab1 69582012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
6959
6960 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6961 for the duration of call to load_charset, to avoid problems with
6962 callers of maybe_unify_char that access buffer text through C
6963 pointers.
6964
6965 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6966 decrement the inhibition flag, instead of just setting or
6967 resetting it.
6968
ba93a187
PE
69692012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6970
6971 Remove obsolete '#define static' cruft.
6972 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6973 This #undef was "temporary" in 2000; it is no longer needed
6974 now that '#define static' has gone away.
6975 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6976 (gray_bitmap_bits): Remove; no longer needed.
6977 All uses replaced with definiens.
6978 * xterm.c: Include "bitmaps/gray.xbm".
6979
9e4bf381
PE
69802012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6981
6982 Clean up __executable_start, monstartup when --enable-profiling.
6983 The following changes affect the code only when profiling.
6984 * dispnew.c (__executable_start): Rename from safe_bcopy.
6985 Define only on platforms that need it.
6986 * emacs.c: Include <sys/gmon.h> when profiling.
6987 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6988 (__executable_start): Remove decl, since lisp.h does it now.
6989 (safe_bcopy): Remove decl; no longer has that name.
6990 (main): Coalesce #if into single bit of code, for simplicity.
6991 Cast pointers to uintptr_t, since standard libraries want integers
6992 and not pointers.
6993 * lisp.h (__executable_start): New decl.
6994
32d72c2f
GM
69952012-05-31 Glenn Morris <rgm@gnu.org>
6996
6997 * image.c (Fimagemagick_types): Doc fix.
6998
baac5bc7
JM
69992012-05-30 Jim Meyering <meyering@redhat.com>
7000
7001 * callproc.c (Fcall_process_region): Include directory component
7002 in mkstemp error message (Bug#11586).
7003
72cb32cf
PE
70042012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7005
7006 * alloc.c, lisp.h (make_pure_vector): Now static.
7007
61b108cc
SM
70082012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
7009
7010 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7011 Move to byte-run.el.
7012 (Fautoload): Do the hash-doc more carefully.
7013 * data.c (Fdefalias): Purify definition, except for keymaps.
7014 (Qdefun): Move from eval.c.
7015 * lisp.h (Qdefun): Remove.
7016 * lread.c (read1): Tiny simplification.
7017
471fe23d
TN
70182012-05-29 Troels Nielsen <bn.troels@gmail.com>
7019
934f3f58 7020 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
7021 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7022 Bug#9642, but explicitly check that the buffer the overlay would
7023 be moved to is live and rearrange lines to make sure that errors
7024 will not put the overlay in an inconsistent state.
7025 (Fdelete_overlay): Cosmetics.
7026
85d0efd1
EZ
70272012-05-28 Eli Zaretskii <eliz@gnu.org>
7028
7029 * w32term.c (my_bring_window_to_top): New function.
7030 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
7031 could be different from the original one.
7032 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
7033 (Bug#11513)
7034
7035 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7036 by calling BringWindowToTop.
7037
7038 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
7039 (WM_EMACS_END): Increase by one.
7040
da92a98c
PE
70412012-05-28 Paul Eggert <eggert@cs.ucla.edu>
7042
7043 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
7044 This avoids undefined behavior that might cause the eassert
7045 to not catch an out-of-range value.
7046
74d1f848
JB
70472012-05-28 Juanma Barranquero <lekktu@gmail.com>
7048
7049 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7050 Update dependencies.
7051
9e1a06fc
EZ
70522012-05-27 Eli Zaretskii <eliz@gnu.org>
7053
7054 * bidi.c (bidi_mirror_char): Fix last change.
7055
f3dd7312
AS
70562012-05-27 Andreas Schwab <schwab@linux-m68k.org>
7057
7058 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7059 when referring to sectname field in printf format.
7060
81899c91
PE
70612012-05-27 Paul Eggert <eggert@cs.ucla.edu>
7062
57b81a9f
PE
7063 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7064 Only r_alloc_inhibit_buffer_relocation needed to be added;
7065 the others were already declared.
7066
81899c91
PE
7067 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7068 before checking whether it's out of range. Put the check inside
7069 eassert. See
7070 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7071
33017faf 70722012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
7073
7074 * callproc.c (Fcall_process): Restore a line that was accidentally
7075 commented out in the 2011-02-13 change (bug#11547).
7076
33017faf 70772012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
7078
7079 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7080 defined on ralloc.c.
7081
7082 * buffer.c [REL_ALLOC]: Remove prototypes of
7083 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7084 they are now on lisp.h.
7085
7086 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7087
7088 * search.c (search_buffer): Use it to inhibit relocation of buffer
7089 text while re_search_2 is doing its job, because re_search_2 is
7090 passed C pointers to buffer text. (Bug#11519)
7091
23415acf
EZ
7092 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7093 Update value to 24.
7094
44e27368
EZ
7095 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7096 state after an additional call to move_it_in_display_line_to, keep
7097 the values of it->max_ascent and it->max_descent found for the
7098 entire line.
7099 (pos_visible_p): Revert the comparison against bottom_y to what it
7100 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7101 (Bug#11464)
7102
c1892f11
PE
71032012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7104
7105 Fix coding-related core dumps with gcc -ftrapv.
7106 The code was computing A - B, where A and B are pointers, and B is
7107 random garbage. This can lead to core dumps on platforms that
7108 have special pointer registers, and it also leads to core dumps on
7109 x86-64 when compiled with gcc -ftrapv. The fix is to compute
7110 A - B only when B is initialized properly.
7111 * coding.c (coding_set_source, coding_set_destination): Return void.
7112 (coding_change_source, coding_change_destinations): New functions,
7113 with the old behaviors of coding_set_source and coding_set_destination.
7114 All callers that need an offset changed to use these new functions.
7115
eb7afdad
GM
71162012-05-26 Glenn Morris <rgm@gnu.org>
7117
7118 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
7119
f12fdf02
EZ
71202012-05-26 Eli Zaretskii <eliz@gnu.org>
7121
53a63be6 7122 Extend mouse support on W32 text-mode console.
61b108cc
SM
7123 * xdisp.c (draw_row_with_mouse_face):
7124 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 7125
eb3f6f01 7126 * w32console.c: Include window.h.
61b108cc
SM
7127 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
7128 New functions.
eb3f6f01
EZ
7129 (initialize_w32_display): Initialize mouse-highlight data.
7130
53a63be6
EZ
7131 * w32inevt.c: Include termchar.h and window.h.
7132 (do_mouse_event): Support mouse-autoselect-window. When the mouse
7133 moves, call note_mouse_highlight. If help_echo changed, call
7134 gen_help_event to produce help-echo message in the echo area.
7135 Call clear_mouse_face if mouse_face_hidden is set in the mouse
7136 highlight info.
7137
4cfd81f6
PE
71382012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7139
7140 * lread.c (read1): Simplify slightly to avoid an overflow warning
7141 with GCC 4.7.0 on x86-64.
7142
4446092a
EZ
71432012-05-26 Eli Zaretskii <eliz@gnu.org>
7144
7145 * bidi.c (bidi_mirror_char): Revert last change: an int is
7146 definitely wide enough here.
7147
42b2a986 71482012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 7149
42b2a986 7150 Fix integer width and related bugs (Bug#9874).
eb106a49 7151 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
7152 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
7153 (string_bytes, check_sblock, allocate_string_data):
7154 (compact_small_strings, Fmake_bool_vector, make_string)
7155 (make_unibyte_string, make_multibyte_string)
7156 (make_string_from_bytes, make_specified_string)
7157 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
7158 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
7159 (mark_vectorlike):
7160 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7161 (allocate_pseudovector):
7162 Use int, not EMACS_INT, where int is wide enough.
7163 (inhibit_garbage_collection, Fgarbage_collect):
7164 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7165 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
7166 int might not be wide enough.
7167 (bidi_cache_search, bidi_cache_find, bidi_init_it)
7168 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
7169 (bidi_at_paragraph_end, bidi_find_paragraph_start)
7170 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7171 (bidi_level_of_next_char, bidi_move_to_visually_next):
7172 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7173 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
7174 (Fkill_buffer, Fset_buffer_major_mode)
7175 (advance_to_char_boundary, Fbuffer_swap_text)
7176 (Fset_buffer_multibyte, overlays_at, overlays_in)
7177 (overlay_touches_p, struct sortvec, record_overlay_string)
7178 (overlay_strings, recenter_overlay_lists)
7179 (adjust_overlays_for_insert, adjust_overlays_for_delete)
7180 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
7181 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
7182 (Foverlay_recenter, last_overlay_modification_hooks_used)
7183 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7184 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
7185 (validate_region): Omit unnecessary test for b <= e,
7186 since that's guaranteed by the previous test.
d311d28c
PE
7187 (adjust_overlays_for_delete): Avoid pos + length overflow.
7188 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7189 (report_overlay_modification):
7190 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7191 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7192 Omit pointer cast, which isn't needed anyway, and doesn't work
7193 after the EMACS_INT -> ptrdiff_t change.
02481186 7194 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
7195 * buffer.h: Adjust decls to match defn changes elsewhere.
7196 (struct buffer_text, struct buffer):
7197 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7198 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
7199 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7200 not int, to avoid needless 32-bit limit on 64-bit hosts.
7201 (exec_byte_code): Use tighter memory-full test, one that checks
7202 for alloca overflow. Don't compute the address of the object just
7203 before an array, as that's not portable. Use EMACS_INT, not
7204 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
7205 * callint.c (Fcall_interactively):
7206 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7207 * callproc.c (call_process_kill, Fcall_process):
7208 Don't assume pid_t fits into an Emacs fixnum.
7209 (call_process_cleanup, Fcall_process, child_setup):
7210 Don't assume pid_t fits into int.
7211 (call_process_cleanup, Fcall_process, delete_temp_file)
7212 (Fcall_process_region):
7213 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7214 (Fcall_process): Simplify handling of volatile integers.
7215 Use int, not EMACS_INT, where int will do.
7216 * casefiddle.c (casify_object, casify_region, operate_on_word)
7217 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7218 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7219 (casify_object): Avoid integer overflow when overallocating buffer.
7220 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 7221 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
7222 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7223 * category.h (CATEGORYP): Don't assume arg is nonnegative.
7224 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7225 integers are now checked earlier. All uses replaced with XINT.
7226 (ccl_driver):
7227 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7228 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
7229 (ccl_driver, Fregister_code_conversion_map):
7230 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
7231 (resolve_symbol_ccl_program): Check that vector header is in range.
7232 Always copy the vector, so that we can check its contents reliably
7233 now rather than having to recheck each instruction as it's being
7234 executed. Check that vector words fit in 'int'.
7235 (ccl_get_compiled_code, Fregister_ccl_program)
7236 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7237 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7238 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7239 contents are in range.
7240 (Fccl_execute_on_string): Check that status is in range.
7241 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7242 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7243 Accept and return EMACS_INT, not int, because callers can pass values
7244 out of 'int' range.
7245 (c_string_width, strwidth, lisp_string_width, chars_in_text)
7246 (multibyte_chars_in_text, parse_str_as_multibyte)
7247 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7248 (str_as_unibyte, str_to_unibyte, string_count_byte8)
7249 (string_escape_byte8, Fget_byte):
7250 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 7251 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
7252 avoid mishandling large integers.
7253 * character.h: Adjust decls to match defn changes elsewhere.
7254 * charset.c (load_charset_map_from_file, find_charsets_in_text)
7255 (Ffind_charset_region):
7256 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7257 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7258 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 7259 Don't assume fixnum fits in int.
d311d28c
PE
7260 (load_charset_map_from_vector, Fmap_charset_chars):
7261 Remove now-unnecessary CHECK_NATNUMs.
7262 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
7263 Don't rely on undefined behavior with signed left shift overflow.
7264 Don't assume unsigned int fits into fixnum, or that fixnum fits
7265 into unsigned int. Don't require max_code to be a valid fixnum;
7266 that's not true for gb10830 4-byte on a 32-bit host. Allow
7267 invalid_code to be a cons, for the same reason. Require code_offset
7268 to be a character. Avoid int overflow if max_char is close
7269 to INT_MAX.
7270 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7271 this is intended anyway and avoids some undefined behavior.
7272 (load_charset_map): Pass unsigned, not int, as 2nd arg of
7273 INDEX_TO_CODE_POINT, as that's what it expects.
7274 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
7275 * charset.h (DECODE_CHAR): Return int, not unsigned;
7276 this is what was intended anyway, and it avoids undefined behavior.
7277 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
7278 integer-overflow issues.
7279 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
7280 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
7281 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
7282 * chartab.c (Fmake_char_table, Fset_char_table_range)
7283 (uniprop_get_decoder, uniprop_get_encoder):
7284 Don't assume fixnum fits in int.
7285 * cmds.c (move_point): New function, that does the gist of
7286 Fforward_char and Fbackward_char, but does so while checking
7287 for integer overflow more accurately.
c96e5d6a 7288 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
7289 (Fforward_line, Fend_of_line, internal_self_insert)
7290 (internal_self_insert):
7291 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7292 Fix a FIXME, by checking for integer overflow when calculating
7293 target_clm and actual_clm.
7294 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 7295 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
7296 (ASSURE_DESTINATION, coding_alloc_by_realloc)
7297 (coding_alloc_by_making_gap, alloc_destination)
7298 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
7299 (encode_coding_utf_16, detect_coding_emacs_mule)
7300 (decode_coding_emacs_mule, encode_coding_emacs_mule)
7301 (detect_coding_iso_2022, decode_coding_iso_2022)
7302 (encode_invocation_designation, encode_designation_at_bol)
7303 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7304 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7305 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7306 (encode_coding_ccl, encode_coding_raw_text)
7307 (detect_coding_charset, decode_coding_charset)
7308 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7309 (produce_composition, produce_charset, produce_annotation)
7310 (decode_coding, handle_composition_annotation)
7311 (handle_charset_annotation, consume_chars, decode_coding_gap)
7312 (decode_coding_object, encode_coding_object, detect_coding_system)
7313 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7314 (code_convert_region, code_convert_string)
8f50130c
PE
7315 (Fdefine_coding_system_internal)
7316 (coding_set_source, coding_set_destination):
d311d28c
PE
7317 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7318 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7319 (Fdefine_coding_system_internal):
7320 Don't assume fixnums fit in int.
7321 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 7322 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
7323 (Funencodable_char_position, Fcheck_coding_systems_region)
7324 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 7325 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 7326 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 7327 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 7328 Don't access memory outside of the args array.
d311d28c 7329 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
7330 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7331 result of ENCODE_CHAR.
d311d28c
PE
7332 * coding.h: Adjust decls to match defn changes elsewhere.
7333 (struct coding_system):
7334 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7335 * composite.c (get_composition_id, find_composition)
7336 (run_composition_function, update_compositions)
7337 (compose_text, composition_gstring_put_cache)
7338 (composition_gstring_p, composition_gstring_width)
7339 (fill_gstring_header, fill_gstring_body, autocmp_chars)
7340 (composition_compute_stop_pos, composition_reseat_it)
7341 (composition_update_it, struct position_record)
7342 (find_automatic_composition, composition_adjust_point)
7343 (Fcomposition_get_gstring, Ffind_composition_internal):
7344 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7345 (update_compositions):
7346 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7347 * composite.h: Adjust decls to match defn changes elsewhere.
7348 (struct composition):
7349 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7350 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7351 Do not attempt to compute the address of the object just before a
7352 buffer; this is not portable.
7353 (Faref, Faset):
7354 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7355 (Faset): Use int, not EMACS_INT, where int is wide enough.
7356 (Fstring_to_number): Don't assume fixnums fit in int.
7357 (Frem): Don't assume arg is nonnegative.
7358 * dbusbind.c (xd_append_arg): Check for integers out of range.
7359 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 7360 (extract_signed, extract_unsigned): New functions.
243e0530
PE
7361 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7362 (xd_get_connection_references): Return ptrdiff_t, not int.
7363 All uses changed.
7364 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7365 (xd_read_message_1):
7366 Use int, not unsigned, where the dbus API uses int.
7367 (Fdbus_message_internal): Don't overflow mtype.
7368 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
7369 * dired.c (directory_files_internal, file_name_completion, scmp)
7370 (file_name_completion_stat):
7371 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7372 (file_name_completion): Don't overflow matchcount.
7373 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7374 * dispextern.h: Adjust decls to match defn changes elsewhere.
7375 (struct text_pos, struct glyph, struct bidi_saved_info)
7376 (struct bidi_string_data, struct bidi_it, struct composition_it)
7377 (struct it):
7378 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7379 (struct display_pos, struct composition_it, struct it):
7380 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7381 * dispnew.c (increment_matrix_positions)
7382 (increment_row_positions, mode_line_string)
7383 (marginal_area_string):
7384 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 7385 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
7386 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7387 (duration_to_sec_usec): New function, to check for overflow better.
7388 (Fsleep_for, sit_for): Use it.
7389 * doc.c (get_doc_string, store_function_docstring):
7390 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7391 (get_doc_string, Fsnarf_documentation):
7392 Use int, not EMACS_INT, where int is wide enough.
7393 (get_doc_string):
7394 Use SAFE_ALLOCA, not alloca.
7395 Check for overflow when converting EMACS_INT to off_t.
7396 * doprnt.c (doprnt):
7397 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7398 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7399 Don't assume uid_t fits into fixnum.
7400 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7401 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7402 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7403 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7404 (general_insert_function)
7405 (Finsert_char, make_buffer_string, make_buffer_string_both)
7406 (update_buffer_properties, Fbuffer_substring)
7407 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7408 (Fsubst_char_in_region, check_translation)
7409 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7410 (transpose_markers, Ftranspose_regions):
7411 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7412 (clip_to_bounds): Move to lisp.h as an inline function).
7413 (Fconstrain_to_field): Don't assume integers are nonnegative.
7414 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7415 (Fsubst_char_in_region, Fsave_restriction):
7416 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7417 (Femacs_pid): Don't assume pid_t fits into fixnum.
7418 (lo_time): Use int, not EMACS_INT, when int suffices.
7419 (lisp_time_argument): Check for usec out of range.
7420 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
7421 (Fuser_login_name, Fuser_full_name): Signal an error
7422 if a uid argument is out of range, rather than relying on
7423 undefined behavior.
c8d5c857
PE
7424 (Fformat_time_string): Remove now-unnecessary check.
7425 lisp_time_argument checks for out-of-range usec now.
243e0530 7426 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
7427 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7428 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7429 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7430 (init_cmdargs, Fdump_emacs):
7431 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7432 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7433 the bottom (typically) 32 bits of the fixnum.
7434 * eval.c (specpdl_size, call_debugger):
7435 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7436 (when_entered_debugger, Fbacktrace_debug):
7437 Don't assume fixnum can fit in int.
7438 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7439 the object just before a buffer; this is not portable.
7440 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7441 (grow_specpdl, unbind_to):
7442 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7443 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7444 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 7445 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
7446 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7447 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7448 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7449 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7450 (a_write, e_write):
7451 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7452 (Fcopy_file, non_regular_nbytes, read_non_regular)
7453 (Finsert_file_contents):
7454 Use int, not EMACS_INT, where int is wide enough.
7455 (READ_BUF_SIZE): Verify that it fits in int.
7456 (Finsert_file_contents): Check that counts are in proper range,
7457 rather than assuming fixnums fit into ptrdiff_t etc.
7458 Don't assume fixnums fit into int.
125b3835 7459 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
7460 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7461 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
7462 (string_char_to_byte, string_byte_to_char)
7463 (string_make_multibyte, string_to_multibyte)
7464 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7465 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7466 (substring_both, Fdelete, internal_equal, Ffillarray)
7467 (Fclear_string, mapcar1)
7468 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7469 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7470 (larger_vector, make_hash_table, maybe_resize_hash_table)
7471 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7472 (Fmaphash, secure_hash):
7473 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7474 (concat): Check for string index and length overflow.
7475 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7476 (Frequire):
7477 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7478 (larger_vector): New API (vec, incr_min, size_max) replaces old
7479 one (vec, new_size, init). This catches size overflow.
7480 INIT was removed because it was always Qnil.
7481 All callers changed.
7482 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7483 the upper bound on a hash table index size.
7484 (make_hash_table, maybe_resize_hash_table): Use it.
7485 (secure_hash): Computer start_byte and end_byte only after
7486 they're known to be in ptrdiff_t range.
7487 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7488 (Ffont_get_glyphs, Ffont_at):
7489 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7490 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7491 (Flist_fonts, Fopen_font):
7492 Don't assume fixnum can fit in int.
7493 (check_gstring): Don't assume index can fit in int.
7494 (font_match_p): Check that fixnum is a character, not a nonnegative
7495 fixnum, since the later code needs to stuff it into an int.
7496 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7497 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7498 conversion overflow issues.
7499 (Fopen_font): Check for integer out of range.
7500 (Ffont_get_glyphs): Don't assume index can fit in int.
7501 * font.h: Adjust decls to match defn changes elsewhere.
7502 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7503 integer overflow.
7504 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7505 printmax_t, where ptrdiff_t is wide enough.
7506 (Finternal_char_font):
7507 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7508 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7509 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7510 (Fset_frame_position, x_set_frame_parameters)
7511 (x_set_line_spacing, x_set_border_width)
7512 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7513 Check that fixnums are in proper range for system types.
7514 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7515 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7516 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7517 Use SAFE_ALLOCA_LISP, not alloca.
7518 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7519 intptr_t is wide enough.
7520 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7521 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7522 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7523 Check for fixnum out of range.
7524 * ftfont.c (ftfont_list): Don't assume index fits in int.
7525 Check that fixnums are in proper range for system types.
7526 (ftfont_shape_by_flt):
7527 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
7528 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7529 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7530 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7531 Check that fixnums are in proper range for system types.
7532 * gnutls.h: Adjust decls to match defn changes elsewhere.
7533 * gtkutil.c (xg_dialog_run):
7534 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7535 (update_frame_tool_bar):
7536 Check that fixnums are in proper range for system types.
7537 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 7538 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
7539 * indent.c (last_known_column, last_known_column_point):
7540 (current_column_bol_cache):
7541 (skip_invisible, current_column, check_display_width):
7542 (check_display_width, scan_for_column, current_column_1)
7543 (Findent_to, Fcurrent_indentation, position_indentation)
7544 (indented_beyond_p, Fmove_to_column, compute_motion):
7545 (Fcompute_motion, Fvertical_motion):
7546 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7547 (last_known_column_modified): Use EMACS_INT, not int.
7548 (check_display_width):
7549 (Fcompute_motion):
7550 Check that fixnums and floats are in proper range for system types.
7551 (compute_motion): Don't assume index or fixnum fits in int.
7552 (compute_motion, Fcompute_motion):
7553 Use int, not EMACS_INT, when it is wide enough.
7554 (vmotion): Omit local var start_hpos that is always 0; that way
7555 we don't need to worry about overflow in expressions involving it.
7556 * indent.h: Adjust decls to match defn changes elsewhere.
7557 (struct position):
7558 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7559 Use int, not EMACS_INT, where int is wide enough.
7560 Remove unused members ovstring_chars_done and tab_offset;
7561 all uses removed.
7562 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7563 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7564 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7565 (make_gap, copy_text, insert, insert_and_inherit)
7566 (insert_before_markers, insert_before_markers_and_inherit)
7567 (insert_1, count_combining_before, count_combining_after)
7568 (insert_1_both, insert_from_string)
7569 (insert_from_string_before_markers, insert_from_string_1)
7570 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7571 (adjust_after_replace, adjust_after_insert, replace_range)
7572 (replace_range_2, del_range, del_range_1, del_range_byte)
7573 (del_range_both, del_range_2, modify_region)
7574 (prepare_to_modify_buffer, signal_before_change)
7575 (signal_after_change, Fcombine_after_change_execute):
7576 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7577 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7578 (balance_an_interval, split_interval_right, split_interval_left)
7579 (find_interval, next_interval, update_interval)
7580 (adjust_intervals_for_insertion, delete_node, delete_interval)
7581 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7582 (static_offset_intervals, offset_intervals)
7583 (merge_interval_right, merge_interval_left, make_new_interval)
7584 (graft_intervals_into_buffer, temp_set_point_both)
7585 (temp_set_point, set_point, adjust_for_invis_intang)
7586 (set_point_both, move_if_not_intangible, get_property_and_range)
7587 (get_local_map, copy_intervals, copy_intervals_to_string)
7588 (compare_string_intervals, set_intervals_multibyte_1):
7589 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7590 * intervals.h: Adjust decls to match defn changes elsewhere.
7591 (struct interval):
7592 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7593 * keyboard.c (this_command_key_count, this_single_command_key_start)
7594 (before_command_key_count, before_command_echo_length, echo_now)
7595 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7596 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7597 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7598 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7599 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7600 (last_non_minibuf_size, last_point_position, echo_truncate)
7601 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7602 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7603 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7604 (stuff_buffered_input):
7605 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7606 (last_auto_save, command_loop_1, read_char):
7607 Use EMACS_INT, not int, to avoid integer overflow.
7608 (record_char): Avoid overflow in total_keys computation.
7609 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7610 * keyboard.h: Adjust decls to match defn changes elsewhere.
7611 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7612 (Fkey_description, Fdescribe_vector, Flookup_key):
7613 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7614 (click_position): New function, to check that positions are in range.
7615 (Fcurrent_active_maps):
7616 (describe_command):
7617 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7618 (Faccessible_keymaps, Fkey_description):
7619 (preferred_sequence_p):
7620 Don't assume fixnum can fit into int.
7621 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7622 Check for integer overflow in size calculations.
7623 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7624 avoid mishandling large integers.
7625 * lisp.h: Adjust decls to match defn changes elsewhere.
7626 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7627 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7628 (struct Lisp_Marker):
7629 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7630 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
7631 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7632 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7633 All callers changed.
7634 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7635 Assume the arg has valid form, since it always does.
7636 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7637 unsigned integer system type.
7638 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7639 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7640 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7641 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7642 (duration_to_sec_usec): New decl.
7643 * lread.c (read_from_string_index, read_from_string_index_byte)
7644 (read_from_string_limit, readchar, unreadchar, openp)
7645 (read_internal_start, read1, oblookup):
7646 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7647 (Fload, readevalloop, Feval_buffer, Feval_region):
7648 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7649 (openp): Check for out-of-range argument to 'access'.
7650 (read1): Use int, not EMACS_INT, where int is wide enough.
7651 Don't assume fixnum fits into int.
6efdadfd 7652 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
7653 (read_filtered_event): Use duration_to_sec_usec
7654 to do proper overflow checking on durations.
d311d28c
PE
7655 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7656 in size calculation.
7657 (Fexecute_kbd_macro):
7658 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7659 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7660 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7661 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7662 (set_marker_both, set_marker_restricted_both, marker_position)
7663 (marker_byte_position, Fbuffer_has_markers_at):
7664 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7665 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 7666 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
7667 It now merely ensures that the menu is large enough, without
7668 necessarily growing it, as this avoids some integer overflow issues.
7669 All callers changed.
7670 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7671 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7672 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7673 Use SAFE_ALLOCA_LISP, not alloca.
7674 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7675 to EMACS_INT. Check that fixnums are in proper range for system types.
7676 * minibuf.c (minibuf_prompt_width, string_to_object)
7677 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7678 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7679 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7680 (get_minibuffer, read_minibuf_unwind):
7681 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7682 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7683 this simplifies overflow checking. All callers changed.
7684 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7685 (Ftest_completion):
7686 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7687 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7688 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7689 Check that fixnums are in proper range for system types.
7690 (Fx_create_frame, Fx_show_tip):
7691 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7692 * nsfont.m (ns_findfonts, nsfont_list_family):
7693 Don't assume fixnum fits in long.
7694 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7695 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7696 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7697 wide enough.
17fdb222 7698 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
7699 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7700 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7701 (PRINTDECLARE, PRINTPREPARE):
7702 (strout, print_string):
7703 (print, print_preprocess, print_check_string_charset_prop)
7704 (print_object):
7705 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7706 (PRINTDECLARE):
7707 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7708 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7709 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 7710 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 7711 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
7712 (print_error_message): Use SAFE_ALLOCA, not alloca.
7713 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
7714 (print_depth, new_backquote_output, print_number_index):
7715 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
7716 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7717 (Fset_process_window_size, Fformat_network_address)
7718 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 7719 (sigchld_handler):
d311d28c 7720 Check that fixnums are in proper range for system types.
d44287d4 7721 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
7722 Check for process-ids out of pid_t range rather than relying on
7723 undefined behavior.
e4d81efc 7724 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
7725 (Fformat_network_address, read_process_output, send_process)
7726 (Fprocess_send_region, status_notify):
7727 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7728 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7729 (wait_reading_process_output, read_process_output, exec_sentinel):
7730 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7731 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7732 (Faccept_process_output): Use duration_to_sec_usec to do proper
7733 overflow checking on durations.
dde14581
PE
7734 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7735 Don't assume pid_t fits in int.
02481186
PE
7736 * process.h (struct Lisp_Process): Members tick and update_tick
7737 are now of type EMACS_INT, not int.
b62b53e8
PE
7738 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7739 configured --with-wide-int.
d311d28c
PE
7740 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7741 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7742 * search.c (looking_at_1, string_match_1):
7743 (fast_string_match, fast_c_string_match_ignore_case)
7744 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7745 (scan_newline, find_before_next_newline, search_command)
7746 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7747 (set_search_regs, wordify):
7748 (Freplace_match):
7749 (Fmatch_data):
7750 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7751 (string_match_1, search_buffer, set_search_regs):
7752 (Fmatch_data):
7753 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7754 (wordify): Check for overflow in size calculation.
7755 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7756 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7757 Check that fixnums are in proper range for system types.
7758 * sound.c (struct sound_device)
7759 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7760 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7761 (Fplay_sound_internal):
7762 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 7763 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
7764 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7765 (Fparse_partial_sexp):
7766 Don't assume fixnums can fit in int.
7767 (struct lisp_parse_state, find_start_pos, find_start_value)
7768 (find_start_value_byte, find_start_begv)
7769 (update_syntax_table, char_quoted, dec_bytepos)
7770 (find_defun_start, prev_char_comend_first, back_comment):
7771 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7772 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7773 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7774 (Finternal_describe_syntax_value): Check that match_lisp is a
7775 character, not an integer, since the code stuffs it into int.
7776 (scan_words, scan_sexps_forward):
7777 Check that fixnums are in proper range for system types.
7778 (Fforward_word):
7779 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7780 (scan_sexps_forward):
7781 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7782 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7783 * syntax.h: Adjust decls to match defn changes elsewhere.
7784 (struct gl_state_s):
7785 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
7786 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7787 MOST_POSITIVE_FIXNUM.
d311d28c
PE
7788 * sysdep.c (wait_for_termination_1, wait_for_termination)
7789 (interruptible_wait_for_termination, mkdir):
7790 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7791 (emacs_read, emacs_write):
7792 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
7793 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7794 and double all fit in int.
d311d28c
PE
7795 * term.c (set_tty_color_mode):
7796 Check that fixnums are in proper range for system types.
7797 * termhooks.h (struct input_event):
7798 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7799 * textprop.c (validate_interval_range, interval_of)
7800 (Fadd_text_properties, set_text_properties_1)
7801 (Fremove_text_properties, Fremove_list_of_text_properties)
7802 (Ftext_property_any, Ftext_property_not_all)
7803 (copy_text_properties, text_property_list, extend_property_ranges)
7804 (verify_interval_modification):
7805 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7806 (Fnext_single_char_property_change)
7807 (Fprevious_single_char_property_change):
7808 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
7809 (copy_text_properties):
7810 Check for integer overflow in index calculation.
d311d28c
PE
7811 * undo.c (last_boundary_position, record_point, record_insert)
7812 (record_delete, record_marker_adjustment, record_change)
7813 (record_property_change):
7814 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7815 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7816 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7817 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7818 (Fx_hide_tip, Fx_file_dialog):
7819 * w32menu.c (set_frame_menubar):
7820 Use ptrdiff_t, not int, for consistency with rest of code.
7821 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7822 (select_window, Fdelete_other_windows_internal)
7823 (window_scroll_pixel_based, window_scroll_line_based)
7824 (Frecenter, Fset_window_configuration):
7825 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7826 (Fset_window_hscroll, run_window_configuration_change_hook)
7827 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 7828 (Fscroll_other_window, Frecenter):
d311d28c
PE
7829 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7830 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7831 Don't assume fixnum fits in int.
7832 (Fset_window_scroll_bars):
7833 Check that fixnums are in proper range for system types.
7834 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7835 (string_pos, c_string_pos, number_of_chars, init_iterator)
7836 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7837 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7838 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
7839 (face_before_or_after_it_pos, handle_invisible_prop)
7840 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
7841 (display_prop_intangible_p, string_buffer_position_lim)
7842 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7843 (get_overlay_strings_1, get_overlay_strings)
7844 (iterate_out_of_display_property, forward_to_next_line_start)
7845 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7846 (get_next_display_element, set_iterator_to_next)
7847 (get_visually_first_element, compute_stop_pos_backwards)
7848 (handle_stop_backwards, next_element_from_buffer)
7849 (move_it_in_display_line_to, move_it_in_display_line)
7850 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7851 (add_to_log, message_dolog, message_log_check_duplicate)
7852 (message2, message2_nolog, message3, message3_nolog
7853 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7854 (current_message_1, truncate_echo_area, truncate_message_1)
7855 (set_message, set_message_1, store_mode_line_noprop)
7856 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7857 (text_outside_line_unchanged_p, check_point_in_composition)
7858 (reconsider_clip_changes)
7859 (redisplay_internal, set_cursor_from_row, try_scrolling)
7860 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7861 (redisplay_window, find_last_unchanged_at_beg_row)
7862 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7863 (trailing_whitespace_p, find_row_edges, display_line)
7864 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7865 (display_mode_element, store_mode_line_string)
7866 (pint2str, pint2hrstr, decode_mode_spec)
7867 (display_count_lines, display_string, draw_glyphs)
7868 (x_produce_glyphs, x_insert_glyphs)
7869 (rows_from_pos_range, mouse_face_from_buffer_pos)
7870 (fast_find_string_pos, mouse_face_from_string_pos)
7871 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7872 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7873 (safe_call, init_from_display_pos, handle_fontified_prop)
7874 (handle_single_display_spec, load_overlay_strings)
7875 (with_echo_area_buffer, setup_echo_area_for_printing)
7876 (display_echo_area, echo_area_display)
7877 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7878 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
7879 (redisplay_window, dump_glyph_row, display_mode_line)
7880 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 7881 (handle_display_spec, display_prop_string_p):
d311d28c
PE
7882 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7883 (handle_single_display_spec, build_desired_tool_bar_string)
7884 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7885 (get_specified_cursor_type):
7886 Check that fixnums are in proper range for system types.
7887 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7888 (Flookup_image_map):
7889 Don't assume fixnums fit in int.
7890 (compare_overlay_entries):
7891 Avoid mishandling comparisons due to subtraction overflow.
7892 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7893 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7894 (handle_tool_bar_click):
7895 Use int, not unsigned, since we prefer signed and the signedness
7896 doesn't matter here.
7897 (get_next_display_element, next_element_from_display_vector):
7898 Use int, not EMACS_INT, when int is wide enough.
7899 (start_hourglass): Use duration_to_sec_usec to do proper
7900 overflow checking on durations.
7901 * xfaces.c (Fbitmap_spec_p):
7902 Check that fixnums are in proper range for system types.
7903 (compare_fonts_by_sort_order):
7904 Avoid mishandling comparisons due to subtraction overflow.
7905 (Fx_family_fonts, realize_basic_faces):
7906 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7907 (Fx_family_fonts):
7908 Don't assume fixnum fits in int.
7909 Use SAFE_ALLOCA_LISP, not alloca.
7910 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7911 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7912 (face_at_buffer_position, face_for_overlay_string)
7913 (face_at_string_position):
7914 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7915 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7916 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7917 (Fx_show_tip):
7918 Check that fixnums are in proper range for system types.
7919 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7920 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7921 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7922 (Fx_change_window_property): Don't assume fixnums fit in int.
7923 * xfont.c (xfont_chars_supported):
7924 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7925 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7926 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7927 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7928 * xml.c (parse_region):
7929 * xrdb.c (magic_file_p):
7930 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7931 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7932 (x_get_local_selection, x_reply_selection_request)
7933 (x_handle_selection_request, wait_for_property_change):
7934 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7935 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7936 short is wide enough.
7937 (x_send_client_event): Don't assume fixnum fits in int.
7938 * xterm.c (x_x_to_emacs_modifiers):
7939 Don't assume EMACS_INT overflows nicely into int.
7940 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7941 may come from Lisp.
7942 (handle_one_xevent): NATNUMP can eval its arg twice.
7943 (x_connection_closed):
7944 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7945 * xterm.h: Adjust decls to match defn changes elsewhere.
7946 (struct scroll_bar): Use struct vectorlike_header
7947 rather than rolling our own approximation.
7948 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7949
c6574eb5
GM
79502012-05-25 Glenn Morris <rgm@gnu.org>
7951
7952 * lisp.mk (lisp): Update for more files being compiled now.
7953
e8d32c7e
SM
79542012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7955
48def666
SM
7956 * lread.c: Remove `read_pure' which makes no difference.
7957 (read_pure): Remove var.
7958 (unreadpure): Remove function.
7959 (readevalloop): Don't call read_list with -1 flag.
7960 (read1, read_vector): Don't test read_pure any more.
7961 (read_list): Simplify.
7962
e8d32c7e
SM
7963 * fileio.c, character.h: Minor style tweaks.
7964
4b2addb7
DA
79652012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7966
7967 * window.h (clip_changed): Remove useless declaration.
7968
584461b2
JB
79692012-05-22 Juanma Barranquero <lekktu@gmail.com>
7970
7971 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7972 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7973
34374650
PE
79742012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7975
7976 Remove src/m/*.
7977 This directory predates autoconf and is no longer needed nowadays.
7978 Move its few remaining bits of functionality to where they're needed.
7979 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7980 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7981 * m/template.h: Remove.
7982 * Makefile.in (M_FILE): Remove. All uses removed.
7983 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7984 * lisp.h (USE_LSB_TAG):
7985 * mem-limits.h (EXCEEDS_LISP_PTR):
7986 Use VAL_MAX, not VALBITS, in #if.
7987 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7988 (EMACS_UINT): Define unconditionally now.
7989 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7990 (BITS_PER_EMACS_INT): New constants, replacing
7991 what used to be in config.h, but not useful in #if.
7992 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7993 define them any more.
7994 (VAL_MAX): New macro.
7995 (VALMASK): Use it.
7996 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7997 BITS_PER_EMACS_INT, in #if.
7998 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7999 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
8000 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8001 * s/ms-w32.h (DATA_START):
8002 Move here from removed file m/intel386.h.
8003 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8004 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8005
261cb4bb
PE
80062012-05-21 Paul Eggert <eggert@cs.ucla.edu>
8007
8008 Assume C89 or later.
8009 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8010 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8011 (xrealloc):
8012 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8013 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8014 * textprop.c, tparam.c (NULL): Remove.
8015 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8016 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8017 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
8018 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8019 * xterm.c (input_signal_count): Assume volatile works.
8020
ff23cd9f
KB
80212012-05-21 Ken Brown <kbrown@cornell.edu>
8022
8023 * xgselect.c (xg_select): Fix first argument in call to 'select'
8024 (bug#11508).
8025
1b170bc6
KB
80262012-05-20 Ken Brown <kbrown@cornell.edu>
8027
8028 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 8029 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 8030
b2f4d39f
KB
80312012-05-19 Ken Brown <kbrown@cornell.edu>
8032
8033 * xfns.c (x_in_use): Remove `static' qualifier.
8034 * xterm.h (x_in_use): Declare.
8035 * xgselect.c: Include xterm.h.
8036 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8037 and `display_arg' (bug#9754).
8038
003fdae2
PE
80392012-05-19 Paul Eggert <eggert@cs.ucla.edu>
8040
9232a6d9
PE
8041 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
8042
003fdae2
PE
8043 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
8044 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8045
784b56e2
EZ
80462012-05-18 Eli Zaretskii <eliz@gnu.org>
8047
8048 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8049
8050 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 8051 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
8052
8053 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8054 reference to image_cache->refcount.
8055 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8056
a0a79cde
JL
80572012-05-17 Juri Linkov <juri@jurta.org>
8058
8059 * search.c (Fword_search_regexp, Fword_search_backward)
8060 (Fword_search_forward, Fword_search_backward_lax)
8061 (Fword_search_forward_lax): Move functions to isearch.el
8062 (bug#10145, bug#11381).
8063
b0572523
PE
80642012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8065
8066 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8067
9660f5fc
SM
80682012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8069
8070 * lread.c (init_obarray): Declare Qt and Qnil as special.
8071
4374de83
GM
80722012-05-14 Glenn Morris <rgm@gnu.org>
8073
8074 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 8075 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 8076
dc44c39a
PE
80772012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8078
078c97cb
PE
8079 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8080
dc44c39a
PE
8081 * unexaix.c: Port to more-recent AIX compilers.
8082 (report_error, report_error_1, make_hdr, copy_sym)
8083 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8084 Make arguments const char *, not char *, to avoid violations of C
8085 standard and to fix some AIX warnings reported by Gilles Pion.
8086
e18afed7 80872012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
8088
8089 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8090 already have overlays loaded.
8091 (handle_single_display_spec): Before returning without displaying
8092 fringe bitmap, synchronize the bidi iterator with the main display
8093 iterator, by calling iterate_out_of_display_property.
8094 (iterate_out_of_display_property): Detect buffer iteration by
8095 testing that it->string is a Lisp string.
8096 (get_next_display_element): When the current object is exhausted,
8097 and there's something on it->stack, call set_iterator_to_next to
8098 proceed with what's on the stack, instead of returning zero.
8099 (set_iterator_to_next): If called at the end of a Lisp string,
8100 proceed to consider_string_end without incrementing string
8101 position. Don't increment display vector index past the end of
8102 the display vector. (Bug#11417)
c8fb9dc6
EZ
8103 (pos_visible_p): Don't report a position visible when move_it_to
8104 stopped at the last line of window, which happens to be scanned
8105 backwards by the bidi iteration. (Bug#11464)
ac268e67 8106
e18afed7 81072012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
8108
8109 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8110 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
8111 are on a TTY, and thus unable to display on the fringes.
8112 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
8113 so we need to signal to the caller that this is a "replacing"
8114 display spec. This fixes display when the spec is invalid or we
8115 are on a TTY.
8116
e18afed7 81172012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
8118
8119 * unexaix.c (make_hdr): Fix typo in prototype.
8120 This bug broke the build on AIX. Problem reported by Gilles Pion.
8121
9d0a235a
MA
81222012-05-14 Michael Albinus <michael.albinus@gmx.de>
8123
8124 * keyboard.c (kbd_buffer_get_event): Read special events also in
8125 batch mode. (Bug#11415)
8126
9e6b06ed
GM
81272012-05-12 Glenn Morris <rgm@gnu.org>
8128
8129 * ns.mk: Update for ns_appbindir no longer having trailing "/".
8130
c1a1d7a3
EZ
81312012-05-12 Eli Zaretskii <eliz@gnu.org>
8132
8133 * lisp.mk (lisp): Add newcomment.elc.
8134
3fe7cdc8
GM
81352012-05-12 Glenn Morris <rgm@gnu.org>
8136
8137 * Makefile.in (MKDIR_P): New, set by configure.
8138 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
8139
53f7d2c0
PE
81402012-05-11 Paul Eggert <eggert@cs.ucla.edu>
8141
8142 Remove unused function hourglass_started.
8143 * dispextern.h (hourglass_started):
8144 * w32fns.c (hourglass_started):
8145 * xdisp.c (hourglass_started): Remove.
8146
75aafb17
JB
81472012-05-10 Juanma Barranquero <lekktu@gmail.com>
8148
8149 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
8150 Update dependencies.
8151
12959e8e
PE
81522012-05-10 Paul Eggert <eggert@cs.ucla.edu>
8153
97107e2e
PE
8154 * xgselect.c (xg_select): Put maxfds+1 into a var.
8155 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
8156
12959e8e
PE
8157 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
8158
836d29b3
DA
81592012-05-10 Dave Abrahams <dave@boostpro.com>
8160
8161 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
8162 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
8163
5cb67954
MA
81642012-05-09 Michael Albinus <michael.albinus@gmx.de>
8165
8166 * dbusbind.c (xd_registered_buses): New internal Lisp object.
8167 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
8168 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
8169 Initialize xd_registered_buses.
8170
3478ec45
PE
81712012-05-09 Paul Eggert <eggert@cs.ucla.edu>
8172
b263a6b0
PE
8173 Untag more efficiently if USE_LSB_TAG.
8174 This is based on a proposal by YAMAMOTO Mitsuharu in
8175 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
8176 For an admittedly artificial (nth 8000 longlist) benchmark on
8177 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
8178 Emacs's overall text size by 1%.
8179 * lisp.h (XUNTAG): New macro.
8180 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
8181 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
8182 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8183 * eval.c (Fautoload):
8184 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8185 * frame.h (XFRAME): Use XUNTAG.
8186
3478ec45
PE
8187 Port recent dbusbind.c changes to 32-bit --with-wide-int.
8188 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8189 Remove unportable assumptions about print widths of types like
8190 dbus_uint32_t.
8191 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8192 intptr_t when converting between pointer and integer, to avoid GCC
8193 warnings about wrong width.
8194
666b903b 81952012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
8196
8197 * w32proc.c (new_child): Force Windows to reserve only 64KB of
8198 stack for each reader_thread, instead of defaulting to 8MB
8199 determined by the linker. This avoids failures in creating
8200 subprocesses on Windows 7, see the discussion in this thread:
8201 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8202
b120cc17
JC
82032012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
8204
8205 Fix up display of the *Minibuf-0* buffer in the mini window.
8206 * keyboard.c (read_char): Don't clear the echo area if there's no
8207 message to clear.
8208 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 8209 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 8210
9a4b36f8
MA
82112012-05-07 Michael Albinus <michael.albinus@gmx.de>
8212
8213 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8214 batch mode.
8215
e5f9458f
CY
82162012-05-06 Chong Yidong <cyd@gnu.org>
8217
8218 * lisp.mk (lisp): Update.
8219
eceeb5fc 82202012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
8221
8222 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8223
71873e2b
SM
82242012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
8225
8226 * data.c (PUT_ERROR): New macro.
8227 (syms_of_data): Use it. Add new error type `user-error'.
8228 * undo.c (user_error): New function.
8229 (Fprimitive_undo): Use it.
8230 * print.c (print_error_message): Adjust print style for `user-error'.
8231 * keyboard.c (user_error): New function.
8232 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8233
ab0fa4e4
PE
82342012-05-03 Paul Eggert <eggert@cs.ucla.edu>
8235
8236 Do not limit current-time-string to years 1000..9999.
8237 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8238 (Fcurrent_time_string): Support any year that is supported by the
8239 underlying localtime representation. Don't use asctime, as it
8240 has undefined behavior for years outside the range -999..9999.
8241
7ed806a7
PE
82422012-05-02 Paul Eggert <eggert@cs.ucla.edu>
8243
8244 Fix race conditions involving setenv, gmtime, localtime, asctime.
8245 Without this fix, interrupts could mess up code that uses these
8246 nonreentrant functions, since setting TZ invalidates existing
8247 tm_zone or tzname values, and since most of these functions return
8248 pointers to static storage.
8249 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8250 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8251 Grow the critical sections to include not just invoking
8252 localtime/gmtime, but also accessing these functions' results
8253 including their tm_zone values if any, and any related TZ setting.
8254 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
8255 so that the struct tm is saved in the critical section.
8256 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
8257 motivated by the fact that memory allocation needs to be outside
8258 the critical section.
8259
0c16dfed
DA
82602012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
8261
8262 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8263 with RESET_INTERVAL.
8264
8265 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8266 Remove duplicated buffer name initialization.
8267
3f83ace8
JM
82682012-05-02 Jim Meyering <jim@meyering.net>
8269
8270 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8271
c7b8541e
JM
8272 * xfns.c (x_window): Use xstrdup (Bug#11375).
8273
90207a15 82742012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
8275
8276 * xdisp.c (pos_visible_p): If already at a newline from the
8277 display string before the 'while' loop, don't walk back the glyphs
8278 from it3.glyph_row. Solves assertion violation when the display
8279 string begins with a newline (egg.el). (Bug#11367)
8280
b593d6a9
AH
82812012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
8282
8283 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
8284 Move to simple.el.
8285
4737362e
GM
82862012-05-01 Glenn Morris <rgm@gnu.org>
8287
99cf43f9
GM
8288 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
8289 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
8290 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
8291 All were removed before 23.1.
8292
9311dcff
GM
8293 * dispnew.c: Remove HAVE_LIBNCURSES test;
8294 it is always true on relevant platforms.
8295
4d5c6349
GM
8296 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
8297 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
8298
4737362e
GM
8299 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
8300
74dd3a6b
AS
83012012-04-30 Andreas Schwab <schwab@linux-m68k.org>
8302
8303 * .gdbinit (xpr): Remove checks for no longer existing misc types.
8304 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8305 Remove.
8306
13c379ee
PE
83072012-04-28 Paul Eggert <eggert@cs.ucla.edu>
8308
8309 Do not avoid creating empty evaporating overlays (Bug#9642).
8310 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8311 That is, do not delete an evaporating overlay if it becomes
8312 empty after its bounds are adjusted to fit within its buffer.
8313 This fix caused other problems, and I'm reverting it until we get
8314 to the bottom of them.
8315
a8e7d6d7 83162012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
8317
8318 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8319
a8e7d6d7 83202012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
8321
8322 * xdisp.c (pos_visible_p): If the window start position is beyond
8323 ZV, start the display from buffer beginning. Prevents assertion
8324 violation in init_iterator when the minibuffer window is scrolled
8325 via the scroll bar.
8326
8327 * window.c (window_scroll_pixel_based): Likewise.
8328
a8e7d6d7 83292012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
8330
8331 * keymap.c (where_is_internal): Doc fix (Bug#10872).
8332
a8e7d6d7 83332012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
8334
8335 * fileio.c (Fcopy_file, Fset_file_selinux_context):
8336 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
8337
a8e7d6d7 83382012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 8339
b593d6a9
AH
8340 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8341 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 8342
1c6900d9
EZ
83432012-04-26 Eli Zaretskii <eliz@gnu.org>
8344
4c3fa1d9
EZ
8345 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8346 display element, check also the underlying string or buffer
8347 character. (Bug#11341)
8348
1c6900d9
EZ
8349 * w32menu.c: Include w32heap.h.
8350 (add_menu_item): If the call to AppendMenuW (via
8351 unicode_append_menu) fails, disable Unicode menus only if we are
8352 running on Windows 9X/Me.
8353
42bf8205
AS
83542012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8355
8356 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8357 (xgetint): Add missing shift for LSB tags.
8358
b1bac16e
MR
83592012-04-24 Martin Rudalics <rudalics@gmx.at>
8360
8361 * keyboard.c (read_char): Don't wipe echo area for select window
8362 events: These might get delayed via `mouse-autoselect-window'
8363 (Bug#11304).
8364
d69621cc
JB
83652012-04-24 Juanma Barranquero <lekktu@gmail.com>
8366
8367 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8368 manipulation of :loaded-from data.
8369
02fd101b
JB
83702012-04-23 Juanma Barranquero <lekktu@gmail.com>
8371
8372 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8373 now a cons (bug#11311).
8374
888bec30
PE
83752012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8376
89a438bd
PE
8377 Do not create empty overlays with the evaporate property (Bug#9642).
8378 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8379 if it becomes empty after its bounds are adjusted to fit within
8380 its buffer. Without this fix, in a nonempty buffer (let ((o
8381 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8382 yields an empty overlay that has the evaporate property, which is
8383 not supposed to happen.
8384
1068fe4d
PE
8385 Fix minor GTK3 problems found by static checking.
8386 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8387 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8388 (struct _EmacsFixedClass, emacs_fixed_get_type):
8389 Move decls here from emacsgtkfixed.h, since they needn't be public.
8390 (emacs_fixed_get_type): Now static.
8391 (emacs_fixed_class_init): Omit unused local.
8392 (emacs_fixed_child_type): Remove; unused.
8393 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8394 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8395 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8396 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8397 (EMACS_FIXED_GET_CLASS): Remove; unused.
8398 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8399
888bec30
PE
8400 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8401 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8402
de85e130
PE
84032012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8404
d0baac98 8405 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 8406 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
8407 (__malloc_size_t, __malloc_ptrdiff_t):
8408 Remove. All uses removed, replaced by the definiens if needed,
8409 since we can assume C89 or better now.
8410 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8411 (protect_malloc_state, align, get_contiguous_space)
8412 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8413 (malloc_atfork_handler_child, malloc_enable_thread)
8414 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8415 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8416 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8417 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8418 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8419 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8420 Define using prototypes, not old style.
8421 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8422 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8423 (align): Don't assume that signed integer overflow wraps around.
8424 Omit unused local var.
8425 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8426 (_free_internal_nolock, memalign, mallochook, reallochook):
8427 Omit no-longer-needed casts.
8428 (valloc): Use getpagesize, not __getpagesize.
8429 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8430 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8431
de85e130
PE
8432 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8433
dcbf5805
MA
84342012-04-22 Michael Albinus <michael.albinus@gmx.de>
8435
8436 Move functions from C to Lisp. Make non-blocking method calls
8437 the default. Implement further D-Bus standard interfaces.
8438
8439 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8440 (QCdbus_request_name_allow_replacement)
8441 (QCdbus_request_name_replace_existing)
8442 (QCdbus_request_name_do_not_queue)
8443 (QCdbus_request_name_reply_primary_owner)
8444 (QCdbus_request_name_reply_in_queue)
8445 (QCdbus_request_name_reply_exists)
8446 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8447 (QCdbus_registered_serial, QCdbus_registered_method)
8448 (QCdbus_registered_signal): New Lisp objects.
8449 (XD_DEBUG_MESSAGE): Use sizeof.
8450 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8451 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8452 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8453 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8454 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8455 (xd_signature, xd_append_arg): Allow float for integer types.
8456 (xd_get_connection_references): New function.
b593d6a9
AH
8457 (xd_get_connection_address): Rename from xd_initialize.
8458 Return cached address.
dcbf5805
MA
8459 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8460 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8461 level.
8462 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 8463 Return number of refcounts.
dcbf5805
MA
8464 (Fdbus_get_unique_name): Make stronger parameter check.
8465 (Fdbus_message_internal): New defun.
8466 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8467 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8468 (Fdbus_send_signal, Fdbus_register_service)
8469 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8470 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8471 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8472 (Vdbus_compiled_version, Vdbus_runtime_version)
8473 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8474 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8475 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
8476 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8477 Adapt docstring.
dcbf5805 8478
52828e02
PE
84792012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8480
da05bc4c
PE
8481 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8482 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8483 Do not assume ptrdiff_t is the same width as 'int'.
8484
52828e02
PE
8485 * alloc.c: Handle unusual debugging option combinations.
8486 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8487 since the two debugging options are incompatible.
8488 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8489 is defined.
8490 (mem_init, mem_insert, mem_insert_fixup):
8491 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8492 (NEED_MEM_INSERT): Remove; no longer needed.
8493
f01769f9
LL
84942012-04-22 Leo Liu <sdl.web@gmail.com>
8495
8496 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8497
5790543d
PE
84982012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8499
8500 * sysdep.c [__FreeBSD__]: Minor cleanups.
8501 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8502 Use Emacs indenting style more consistently. Avoid some casts.
8503 Use 'double' consistently rather than mixing 'float' and 'double'.
8504
b91b7e4d
EW
85052012-04-21 Eduard Wiebe <usenet@pusto.de>
8506
b593d6a9
AH
8507 * sysdep.c (list_system_processes, system_process_attributes):
8508 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 8509
6114eb15
AS
85102012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8511
8512 * lisp.mk (lisp): Update.
8513
2f38dff7
PE
85142012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8515
8516 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8517 It is never used otherwise.
8518
4ae29f89
SM
85192012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8520
8521 * print.c (print_preprocess): Only check print_depth if print-circle
8522 is nil.
8523 (print_object): Check for cycles even when print-circle is nil and
8524 print-gensym is t, but only check print_depth if print-circle is nil.
8525
f30d612a
CY
85262012-04-20 Chong Yidong <cyd@gnu.org>
8527
8528 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8529 set the status to "failed" and ensure that sentinel is run.
8530
c07a4c0b 85312012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
8532
8533 * process.c (Fset_process_inherit_coding_system_flag)
8534 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 8535 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 8536
c07a4c0b 85372012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
8538
8539 * xdisp.c (string_buffer_position_lim): Limit starting position to
8540 BEGV.
8541 (set_cursor_from_row): If called for a mode-line or header-line
8542 row, return zero immediately.
8543 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
8544 farther than the first row after the header line, if any.
8545 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
8546 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8547
c07a4c0b 85482012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8549
4ae29f89
SM
8550 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8551 (bug#11238).
ad3a2b41 8552
c07a4c0b 85532012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 85542012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
8555
8556 configure: new option --enable-gcc-warnings (Bug#11207)
8557 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8558 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8559 (ALL_CFLAGS): Use new macros rather than old.
8560 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8561 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8562 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8563 -Wunused-result, -Wunused-variable. This should go away once
8564 the Emacs and Gnulib regex code is merged.
8565 (xmalloc, xrealloc): Now static.
8566
aba027e8
PE
85672012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8568
8569 * dired.c (Fsystem_groups): Remove unused local.
8570
e5a36063
GM
85712012-04-17 Glenn Morris <rgm@gnu.org>
8572
8573 * dired.c (Fsystem_users): Doc fix.
8574
316411f0
DA
85752012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8576
8577 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8578 (syms_of_dired): Add them.
8579
9426aba4
PE
85802012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8581
b62a57be
PE
8582 Fix minor alloc.c problems found by static checking.
8583 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8584 New extern decls, to avoid calling undeclared functions.
8585 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8586 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8587 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8588 (NEED_MEM_INSERT): New macro.
8589 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 8590 Remove one incorrect comment and fix another.
b62a57be 8591
3539f31f
PE
8592 Fix minor ralloc.c problems found by static checking.
8593 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8594 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8595 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8596 (r_alloc_sbrk): Now static.
8597
a041960a
PE
8598 Improve ralloc.c interface checking.
8599 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8600 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8601 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8602 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8603 [REL_ALLOC]: ... to here, to check interface.
8604 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8605 Remove decls. This fixes an "It stinks!".
8606
9426aba4
PE
8607 * alloc.c (which_symbols): Fix alignment issue / type clash.
8608
d55c12ed
AS
86092012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8610
8611 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8612 (struct Lisp_Misc_Any): Likewise.
8613 (struct Lisp_Free): Likewise.
8614 * alloc.c (union aligned_Lisp_Symbol): Define.
8615 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8616 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8617 (union aligned_Lisp_Misc): Define.
8618 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8619 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 8620 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 8621
b948ce8b
PE
86222012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8623
8624 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8625 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8626 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8627 * s/netbsd.h, s/sol2-6.h:
8628 Remove definition of GC_MARK_STACK, since the default now works.
8629 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8630 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8631 no longer the default.
8632 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8633
35dc09a1 86342012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8635
35dc09a1
GM
8636 * lread.c (lisp_file_lexically_bound_p):
8637 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 8638
35dc09a1
GM
86392012-04-14 Eli Zaretskii <eliz@gnu.org>
8640
8641 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8642 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8643
86442012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8645
8646 * nsterm.m (constrainFrameRect): Always constrain when there is only
8647 one screen (Bug#10962).
8648
bcd86815
KB
86492012-04-13 Ken Brown <kbrown@cornell.edu>
8650
8651 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8652
c25df26e
RT
86532012-04-13 Reuben Thomas <rrt@sc3d.org>
8654
8655 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8656
0fc59f1e
DC
86572012-04-11 Daniel Colascione <dancol@dancol.org>
8658
8659 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8660 against is gone. It's better to use vfork now so that when Cygwin
8661 gains a new, working vfork, we use it automatically (bug#10398).
8662
de8c03dc
SM
86632012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8664
8665 * window.c (save_window_save): Obey window-point-insertion-type.
8666
2f097256
GM
86672012-04-11 Glenn Morris <rgm@gnu.org>
8668
8669 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8670
453b951e
SM
86712012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8672
8673 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8674
75f1671a 86752012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
8676
8677 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8678 (force_quit_count): New var.
8679 (handle_interrupt): Use it.
8680
2a8ce227
JB
86812012-04-10 Juanma Barranquero <lekktu@gmail.com>
8682
8683 * w32.c (w32_delayed_load): Record the full path of the library
8684 being loaded (bug#10424).
8685
935396c0
GM
86862012-04-09 Glenn Morris <rgm@gnu.org>
8687
05920a43
GM
8688 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8689 not just in the obarray, before snarfing them. (Bug#11036)
8690
935396c0
GM
8691 * Makefile.in ($(leimdir)/leim-list.el):
8692 Pass EMACS rather than BUILT_EMACS.
8693
a18ecafa
TZ
86942012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8695
8696 * process.c (make_process):
8697 * process.h: Add integer `gnutls_handshakes_tried' member to
8698 process struct.
8699
6bbef4e5
JC
8700 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8701 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
8702
8703 * gnutls.c (gnutls_log_function2i): Convenience log function.
8704 (emacs_gnutls_read): Use new log functions,
8705 `gnutls_handshakes_tried' process member, and
8706 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8707 attempts per process (connection).
8708
b4d3bc10
CY
87092012-04-09 Chong Yidong <cyd@gnu.org>
8710
8711 * eval.c (Fuser_variable_p, user_variable_p_eh)
8712 (lisp_indirect_variable): Functions deleted.
8713 (Fdefvar): Caller changed.
8714
8715 * callint.c (Finteractive, Fcall_interactively):
8716 * minibuf.c (Fread_variable): Callers changed.
8717
70f4d973
EZ
87182012-04-09 Eli Zaretskii <eliz@gnu.org>
8719
8720 * xdisp.c (set_cursor_from_row): If the display string appears in
8721 the buffer at position that is closer to point than the position
8722 after the display string, display the cursor on the first glyph of
8723 the display string. Fixes cursor display when a 'display' text
8724 property immediately follows invisible text. (Bug#11094)
8725
cb3c2e3e
PE
87262012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8727
8728 composite.c: use 'double' consistently
8729 * composite.c (get_composition_id): Use 'double' consistently
8730 instead of converting 'float' to 'double' and vice versa; this is
8731 easier to understand and avoids a GCC warning.
8732
fd06db5d
GM
87332012-04-09 Glenn Morris <rgm@gnu.org>
8734
50fe702a
GM
8735 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8736 preparation for dumping it with emacs. (Bug#4789)
8737 (leimdir): New variable.
8738 ($(leimdir)/leim-list.el): New rule.
8739 (emacs$(EXEEXT)): Depend on leim-list.el.
8740
fd06db5d
GM
8741 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8742 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8743 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8744
55c131ee
AS
87452012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8746
8747 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8748 proper alignment.
8749
9209588f
JB
87502012-04-07 Juanma Barranquero <lekktu@gmail.com>
8751
8752 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8753 Remove unused local variable.
8754
e3fb2efb
PE
87552012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8756
8757 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8758 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8759 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8760 objects, as mark_maybe_pointer will catch them otherwise.
8761 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8762 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8763
b5385551
PE
87642012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8765
8766 Fix typo that broke non-Windows builds.
8767 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8768
9078ead6
EZ
87692012-04-07 Eli Zaretskii <eliz@gnu.org>
8770
8771 Support building on MS-Windows with libxml2.
8772
8773 * makefile.w32-in (OBJ2): Add xml.$(O).
8774 (GLOBAL_SOURCES): Add xml.c.
8775 ($(BLD)/xml.$(O)): New dependency list.
8776
8777 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8778 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8779 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8780 [!WINDOWSNT]: New macros.
8781 (init_libxml2_functions, libxml2_loaded_p): New functions.
8782 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8783 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8784 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8785 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8786 linked in).
6bbef4e5
JC
8787 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8788 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
8789 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8790
8791 * emacs.c: Don't include libxml/parser.h.
8792 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8793 xmlCleanupParser directly.
8794
8795 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8796
3811fdf3
EZ
87972012-04-07 Eli Zaretskii <eliz@gnu.org>
8798
8799 * indent.c (Fvertical_motion): If there is a display string at
8800 point, use it.vpos to compute how many lines to backtrack after
8801 move_it_to point. (Bug#11133)
8802
2f8e16b2
EZ
88032012-04-06 Eli Zaretskii <eliz@gnu.org>
8804
8805 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8806 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8807 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8808 macros related to unification of CJK characters. For the details,
8809 see the discussion following the message here:
8810 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8811
3d439cd1
CY
88122012-04-04 Chong Yidong <cyd@gnu.org>
8813
8814 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8815
8bc53d00
EZ
88162012-04-01 Eli Zaretskii <eliz@gnu.org>
8817
8818 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8819 instead of alloca. (Bug#11138)
8820
3b0512a3
AS
88212012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8822
8823 * w32menu.c (is_simple_dialog): Properly check lisp types.
8824 (Bug#11141)
8825
8427ddd2
EZ
88262012-03-31 Eli Zaretskii <eliz@gnu.org>
8827
979022ef
EZ
8828 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8829 position we get to after a call to move_it_to fails the
8830 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8831 only if we wind up in a string from display property. (Bug#11063)
8832
a6b1c7cc
EZ
8833 * window.c (Fdelete_other_windows_internal): Invalidate the row
8834 and column information about mouse highlight, so that redisplay
8835 restores it after reallocating the glyph matrices. (Bug#7464)
8836
8427ddd2
EZ
8837 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8838 string comes from a `display' text property, use the buffer
8839 position of that property as if we actually saw that position in
8840 the row's glyphs.
697ba24b
EZ
8841 (move_it_by_lines): Remove the assertion that
8842 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8843 violated when there's a before-string at the beginning of a line.
8844 (Bug#11063)
8427ddd2 8845
65a0a738
EZ
88462012-03-30 Eli Zaretskii <eliz@gnu.org>
8847
8848 * xdisp.c (append_space_for_newline): If the default face was
8849 remapped, use the remapped face for the appended newline.
8850 (extend_face_to_end_of_line): Use the remapped default face for
8851 extending the face to the end of the line.
8852 (display_line): Call extend_face_to_end_of_line when the default
8853 face was remapped. (Bug#11068)
8854
581355cc
EZ
88552012-03-29 Eli Zaretskii <eliz@gnu.org>
8856
8857 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8858
e8fc049f
SM
88592012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8860
8861 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8862
4fb9a543
GM
88632012-03-27 Glenn Morris <rgm@gnu.org>
8864
8865 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8866 Doc fixes.
8867
679910f1
KH
88682012-03-26 Kenichi Handa <handa@m17n.org>
8869
8870 * dispextern.h (struct glyph): Fix previous change. Change the
8871 bit length of glyphless.ch to 25 (Bug#11082).
8872
90d49b7f
CY
88732012-03-26 Chong Yidong <cyd@gnu.org>
8874
8875 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8876 (command_loop_1): Use it; inhibit selection update for
8877 handle-select-window too (Bug#8996).
8878
f514f6f0
FP
88792012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8880
e8fc049f 8881 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 8882
bf43fa51
KH
88832012-03-25 Kenichi Handa <handa@m17n.org>
8884
8885 * dispextern.h (struct glyph): Change the bit length of
8886 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8887
8a0c01dd
EZ
88882012-03-24 Eli Zaretskii <eliz@gnu.org>
8889
8890 * s/ms-w32.h (tzname): Include time.h before redirecting to
8891 _tzname. Fixes the MSVC build. (Bug#9960)
8892
7d1c3a76
AS
88932012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8894
8ed79523
AS
8895 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8896 characters.
8897
7d1c3a76
AS
8898 * xterm.c (XTread_socket): Only modify handling_signal if
8899 !SYNC_INPUT. (Bug#11080)
8900
e99a9b8b
EZ
89012012-03-23 Eli Zaretskii <eliz@gnu.org>
8902
8903 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8904 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8905 when fetching a multibyte character consumes more bytes than
8906 CHAR_BYTES returns, due to unification of CJK characters in
8907 string_char. (Bug#11073)
8908
5063c0e1
TN
89092012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8910
8911 * process.c (wait_reading_process_output): Handle pty disconnect
8912 by refraining from sending oneself a SIGCHLD (bug#10933).
8913
9f851fbd
CY
89142012-03-22 Chong Yidong <cyd@gnu.org>
8915
8916 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8917
5063c0e1 8918 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
8919 Mark string as coming from a prefix property.
8920 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8921 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8922
fb5b8aca
CY
89232012-03-21 Chong Yidong <cyd@gnu.org>
8924
8925 * xfaces.c (Vface_remapping_alist): Doc fix.
8926
62356a1b
EZ
89272012-03-20 Eli Zaretskii <eliz@gnu.org>
8928
8929 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
8930 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8931 Doc fixes.
62356a1b 8932
025de85b
CY
89332012-03-20 Chong Yidong <cyd@gnu.org>
8934
8935 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8936 to reflect default non-nil value of redisplay-dont-pause.
8937
4827f94e
KH
89382012-03-19 Kenichi Handa <handa@m17n.org>
8939
8940 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8941 it fit in a valid range (Bug#11003).
8942
e50a24a2
EZ
89432012-03-18 Eli Zaretskii <eliz@gnu.org>
8944
8945 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8946 that is not from display property, accept the row as a "cursor
8947 row" if one of the string's character has a non-nil `cursor'
8948 property. Fixes cursor positioning when there are newlines in
8949 overlay strings, e.g. in icomplete.el. (Bug#11035)
8950
9af5ed87
PE
89512012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8952
8953 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8954
d1f55f16
CY
89552012-03-12 Chong Yidong <cyd@gnu.org>
8956
8957 * eval.c (inhibit_lisp_code): Rename from
8958 inhibit_window_configuration_change_hook; move from window.c.
8959
8960 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8961 * window.c (run_window_configuration_change_hook)
8962 (syms_of_window): Callers changed.
8963
66c5eebd
CY
89642012-03-11 Chong Yidong <cyd@gnu.org>
8965
413df973
CY
8966 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8967
66c5eebd
CY
8968 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8969
1de11f56
CY
89702012-03-10 Chong Yidong <cyd@gnu.org>
8971
8972 * frame.c (other_visible_frames): Don't assume the selected frame
8973 is visible (Bug#10955).
8974
cae07000
SM
89752012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8976
8977 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8978
89c94350
JD
89792012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8980
8981 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8982 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8983 zero (Bug#10954).
8984
999dd333
GM
89852012-03-03 Glenn Morris <rgm@gnu.org>
8986
01a6dcc8 8987 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 8988
de0100f2
EZ
89892012-03-02 Eli Zaretskii <eliz@gnu.org>
8990
8991 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8992 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
8993 (redisplay_window, next_element_from_string): Fix typos in
8994 comments.
3e441275
EZ
8995 (redisplay_window): Pass to move_it_vertically the margin in
8996 pixels, not in screen lines.
de0100f2 8997
96a72ee9
GM
89982012-03-02 Glenn Morris <rgm@gnu.org>
8999
9000 * buffer.c (buffer-list-update-hook): Doc fix.
9001
312508d7
EZ
90022012-02-29 Eli Zaretskii <eliz@gnu.org>
9003
9004 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9005 push_it before setting up the iterator for the first overlay
9006 string, even if we have an empty string loaded.
9007 (next_overlay_string): If there's an empty string on the iterator
9008 stack, pop the stack. (Bug#10903)
9009
27f3c637
PE
90102012-02-25 Paul Eggert <eggert@cs.ucla.edu>
9011
9012 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9013 Suggested by Stefan Monnier in
9014 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9015 * alloc.c (widen_to_Lisp_Object): New static function.
9016 (mark_memory): Also mark Lisp_Objects by fetching pointer words
9017 and widening them to Lisp_Objects. This would work even if
9018 USE_LSB_TAG is defined and wide integers are used, which might
9019 happen in a future version of Emacs.
9020
3c9dfce6
CY
90212012-02-25 Chong Yidong <cyd@gnu.org>
9022
fa74b241
CY
9023 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9024 Doc fix.
9025
3c9dfce6
CY
9026 * xselect.c (Fx_selection_exists_p): Doc fix.
9027 (x_clipboard_manager_save_all): Print an informative message
9028 before saving to clipboard manager.
9029
9486df08
CY
90302012-02-24 Chong Yidong <cyd@gnu.org>
9031
9032 * keyboard.c (process_special_events): Handle all X selection
9033 requests in kbd_buffer, not just the next one (Bug#8869).
9034
f01d3321
CY
90352012-02-23 Chong Yidong <cyd@gnu.org>
9036
9037 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9038 call when setting menu-bar-lines and tool-bar-lines parameters.
9039 (unwind_create_frame_1): New helper function.
9040
9041 * window.c (inhibit_window_configuration_change_hook): New var.
9042 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 9043 (syms_of_window): Initialize it.
f01d3321 9044
86b847b6
CY
90452012-02-22 Chong Yidong <cyd@gnu.org>
9046
9047 * xterm.c (x_draw_image_relief): Add missing type check for
9048 Vtool_bar_button_margin (Bug#10743).
9049
a59225b1
CY
90502012-02-21 Chong Yidong <cyd@gnu.org>
9051
9052 * fileio.c (Vfile_name_handler_alist): Doc fix.
9053
9054 * buffer.c (Fget_file_buffer): Protect against invalid file
9055 handler return value.
9056
310f5bd4
PE
90572012-02-20 Paul Eggert <eggert@cs.ucla.edu>
9058
cb3a28cc
PE
9059 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9060 when computing $valmask.
9061
310f5bd4
PE
9062 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9063 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9064 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9065 It's useless in that case, and it can cause problems on hosts
9066 that allocate halves of EMACS_INT values separately.
9067 Reported by Dan Horák. Diagnosed by Andreas Schwab in
9068 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9069 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9070 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
9071 it avoids undefined behavior on hosts where shifting right by more
9072 than the word width has undefined behavior.
9073
2375c96a
CY
90742012-02-19 Chong Yidong <cyd@gnu.org>
9075
9076 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9077 (Funhandled_file_name_directory, Ffile_name_as_directory)
9078 (Fdirectory_file_name, Fexpand_file_name)
9079 (Fsubstitute_in_file_name): Protect against invalid file handler
9080 return values (Bug#10845).
9081
3eb49e71
EZ
90822012-02-18 Eli Zaretskii <eliz@gnu.org>
9083
9084 * .gdbinit (pitx): Fix incorrect references to fields of the
9085 iterator stack.
9086
7b926f3f
CY
90872012-02-17 Chong Yidong <cyd@gnu.org>
9088
9089 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9090
11273115
PE
90912012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9092
9093 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9094 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9095
c3a70e2b
CY
90962012-02-15 Chong Yidong <cyd@gnu.org>
9097
9098 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9099 marked as special. Also, starting docstrings with * is obsolete.
9100
0ca43699
AS
91012012-02-13 Andreas Schwab <schwab@linux-m68k.org>
9102
9103 * gnutls.c (emacs_gnutls_write): Fix last change.
9104
2e8f3c56
LI
91052012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
9106
9107 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9108 send_process.
9109
af70074f
SM
91102012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
9111
9112 * keymap.c (Fsingle_key_description): Handle char ranges.
9113
95986d52
CY
91142012-02-12 Chong Yidong <cyd@gnu.org>
9115
afd83bd1
CY
9116 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9117 as that creates a dangerous corner case.
9118
95986d52
CY
9119 * window.c (Fdelete_window_internal): Invalidate the mouse
9120 highlight (Bug#9904).
9121
bd7da63e
GM
91222012-02-12 Glenn Morris <rgm@gnu.org>
9123
9124 * xselect.c (Fx_own_selection_internal)
9125 (Fx_get_selection_internal, Fx_disown_selection_internal)
9126 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
9127 * nsselect.m (Fx_own_selection_internal)
9128 (Fx_disown_selection_internal, Fx_selection_exists_p)
9129 (Fx_selection_owner_p, Fx_get_selection_internal):
9130 Sync docs and argument specs with the xselect.c versions.
9131
77abcbc2
LI
91322012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
9133
9134 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
9135
90b671e2
EZ
91362012-02-11 Eli Zaretskii <eliz@gnu.org>
9137
1c0ca0b7
EZ
9138 * w32select.c (Fx_selection_exists_p): Sync doc string and
9139 argument list with xselect.c. (Bug#10783)
9140
9141 * w16select.c (Fx_selection_exists_p): Sync doc string and
9142 argument list with xselect.c. (Bug#10783)
90b671e2 9143
49241268
GM
91442012-02-10 Glenn Morris <rgm@gnu.org>
9145
9146 * fns.c (Fsecure_hash): Doc fix.
9147
f998bbe7 91482012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
9149
9150 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
9151
0992bd9c
CY
91522012-02-07 Chong Yidong <cyd@gnu.org>
9153
9154 * buffer.c (Fbuffer_local_variables)
9155 (buffer_lisp_local_variables): Handle unbound vars correctly;
9156 don't let Qunbound leak into Lisp.
9157
af008560
GM
91582012-02-07 Glenn Morris <rgm@gnu.org>
9159
dd605cc4
GM
9160 * image.c (Fimagemagick_types): Doc fix.
9161
af008560
GM
9162 * image.c (imagemagick-render-type): Change it from a lisp object
9163 to an integer. Move the doc here from the lisp manual.
9164 Treat all values not equal to 0 the same.
9165
1449fa1d
CY
91662012-02-06 Chong Yidong <cyd@gnu.org>
9167
9168 * doc.c (store_function_docstring): Avoid applying docstring of
9169 alias to base function (Bug#2603).
9170
3723ec07
AS
91712012-02-04 Andreas Schwab <schwab@linux-m68k.org>
9172
9173 * .gdbinit (pp1, pv1): Remove redundant defines.
9174 (pr): Use pp.
9175
79c1cc1e
CY
91762012-02-04 Chong Yidong <cyd@gnu.org>
9177
9178 * nsterm.m: Declare a global (Bug#10694).
9179
d7f29f8e
EZ
91802012-02-04 Eli Zaretskii <eliz@gnu.org>
9181
cae07000
SM
9182 * w32.c (get_emacs_configuration_options):
9183 Include --enable-checking, if specified, in the return value.
d7f29f8e 9184
3b95a6f9
MR
91852012-02-04 Martin Rudalics <rudalics@gmx.at>
9186
9187 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9188 after rounding frame sizes. (Bug#9723)
9189
d6fa96a6
EZ
91902012-02-04 Eli Zaretskii <eliz@gnu.org>
9191
9192 * keyboard.c (adjust_point_for_property): Don't position point
9193 before BEGV. (Bug#10696)
9194
df0b2940
PE
91952012-02-03 Paul Eggert <eggert@cs.ucla.edu>
9196
9197 Handle overflow when computing char display width (Bug#9496).
9198 * character.c (char_width): Return EMACS_INT, not int.
9199 (char_width, c_string_width): Check for overflow when
9200 computing the width; this is possible now that individual
9201 characters can have unbounded width. Problem introduced
9202 by merge from Emacs 23 on 2012-01-19.
9203
6bee44d6
MA
92042012-02-02 Michael Albinus <michael.albinus@gmx.de>
9205
9206 * dbusbind.c (Fdbus_register_method): Mention the return value
9207 :ignore in the docstring.
9208
44f92739
GM
92092012-02-02 Glenn Morris <rgm@gnu.org>
9210
1b9f60cc
GM
9211 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9212
44f92739
GM
9213 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9214 Unconditionally set to t. (Bug#10673)
9215 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9216 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9217 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9218
c5d3843c
KH
92192012-02-02 Kenichi Handa <handa@m17n.org>
9220
9221 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
9222 0, do not call append_composite_glyph.
9223
159462d4 92242012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
9225
9226 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9227 NULL (Bug#6988).
9228 (x_produce_glyphs): If the component of a composition is a null
9229 string, set it->pixel_width to 1 to avoid zero-width glyph.
9230
78cef877
EZ
92312012-02-01 Eli Zaretskii <eliz@gnu.org>
9232
9233 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9234 first 2 arguments are identical. This makes inserting large
9235 output from a subprocess an order of magnitude faster on
9236 MS-Windows, where all sbrk'ed memory is always contiguous.
9237
97897668
GM
92382012-01-31 Glenn Morris <rgm@gnu.org>
9239
9240 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 9241 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
9242 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9243
31fd3586
GM
92442012-01-29 Glenn Morris <rgm@gnu.org>
9245
9246 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9247
0e24a8b2
CY
92482012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
9249
9250 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9251
cc0adcb0
CY
92522012-01-28 Chong Yidong <cyd@gnu.org>
9253
9254 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9255
acc28cb9
CY
92562012-01-26 Chong Yidong <cyd@gnu.org>
9257
9c69cfb7
CY
9258 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9259
acc28cb9
CY
9260 * search.c (Fsearch_forward, Fsearch_backward): Document negative
9261 repeat counts (Bug#10507).
9262
48da7392
GM
92632012-01-26 Glenn Morris <rgm@gnu.org>
9264
9265 * lread.c (syms_of_lread): Doc fix.
9266
14af5f7f
CY
92672012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
9268
9269 * coding.c (encode_designation_at_bol): Change return value to
9270 EMACS_INT.
9271
0b21c100
CY
92722012-01-25 Chong Yidong <cyd@gnu.org>
9273
9274 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
9275
3c2907f7
CY
92762012-01-21 Chong Yidong <cyd@gnu.org>
9277
9278 * floatfns.c (Fcopysign): Make the second argument non-optional,
9279 since nil is not allowed anyway.
9280
959ad23f
AS
92812012-01-21 Andreas Schwab <schwab@linux-m68k.org>
9282
9283 * process.c (read_process_output): Use p instead of XPROCESS (proc).
9284 (send_process): Likewise.
9285
34a02f46
MR
92862012-01-19 Martin Rudalics <rudalics@gmx.at>
9287
9288 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
9289 (Vwindow_persistent_parameters): Do not use Qstate.
9290 Rewrite doc-strings.
34a02f46 9291
1259009a 92922012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
9293
9294 * character.c (char_width): New function.
70d4fdf6
GM
9295 (Fchar_width, c_string_width, lisp_string_width):
9296 Use char_width (Bug#9496).
25ed9e61 9297
6a6ee00d
MR
92982012-01-16 Martin Rudalics <rudalics@gmx.at>
9299
9300 * window.c (Vwindow_persistent_parameters): New variable.
9301 (Fset_window_configuration, save_window_save): Handle persistent
9302 window parameters.
9303
c85efaf7
EZ
93042012-01-14 Eli Zaretskii <eliz@gnu.org>
9305
9306 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9307 thrashing the stack of the thread. (Bug#9087)
9308
5944709e
PE
93092012-01-12 Paul Eggert <eggert@cs.ucla.edu>
9310
9311 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9312
e71f5d99
EZ
93132012-01-11 Eli Zaretskii <eliz@gnu.org>
9314
9315 * xdisp.c (rows_from_pos_range): Handle the case where the
9316 highlight ends on a newline. (Bug#10464)
9317 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9318 he end column for display of highlight that ends on a newline
9319 before a R2L line.
9320
ce316182
GM
93212012-01-11 Glenn Morris <rgm@gnu.org>
9322
9323 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9324 from load-path also when installation-directory is nil. (Bug#10208)
9325
5b43da69
GM
93262012-01-10 Glenn Morris <rgm@gnu.org>
9327
74cc8ff9
GM
9328 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9329
7d8d6e4e
GM
9330 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9331 Update template values to be closer to their typical values these days.
5b43da69 9332
a0db8d43
EZ
93332012-01-09 Eli Zaretskii <eliz@gnu.org>
9334
9335 * xdisp.c (rows_from_pos_range): Accept additional argument
9336 DISP_STRING, and accept any glyph in a row whose object is that
9337 string as eligible for mouse highlight. Fixes mouse highlight of
9338 display strings from overlays. (Bug#10464)
9339
9a0115ab 93402012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 9341
b9110d6a 9342 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
9343 * fileio.c (auto_saving_dir_umask): New static var.
9344 (Fmake_directory_internal): Use it.
9345 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9346 creating the directory. The old code temporarily assigns
9347 too-generous permissions to the directory.
9348 (do_auto_save_eh): Clear it.
b9110d6a 9349 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
9350 that the var is always cleared.
9351
6c1bd3f3
EZ
93522012-01-07 Eli Zaretskii <eliz@gnu.org>
9353
9354 * search.c (scan_buffer): Pass character positions to
9355 know_region_cache, not byte positions. (Bug#6540)
9356
069d2b50
L
93572012-01-07 LynX <_LynX@bk.ru> (tiny change)
9358
9359 * w32.c (sys_rename): Report EXDEV when rename of a directory
9360 fails because the target is on another logical disk. (Bug#10284)
9361
75bf0d33
DB
93622012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9363
9364 * xterm.c (x_embed_request_focus): New function.
9365
9366 * xterm.h: Add prototype.
9367
9368 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9369
1c6e5a32
GM
93702012-01-05 Glenn Morris <rgm@gnu.org>
9371
9372 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9373
651e947e
EZ
93742012-01-01 Eli Zaretskii <eliz@gnu.org>
9375
9376 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9377 Load gnutls_transport_set_lowat only if GnuTLS version is below
9378 2.11.1.
9379 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9380 GnuTLS versions below 2.11.1.
9381
3778cdd8
AL
93822011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9383
9384 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9385 to the doc string advising against its use for altering the way
9386 windows are scrolled.
9387
0e5317f7
KH
93882011-12-28 Kenichi Handa <handa@m17n.org>
9389
9390 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9391 coding-system ASCII compatible only when it does not produce BOM
9392 on encoding (Bug#10383).
9393
93d5ca1f
JD
93942011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9395
9396 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9397 can scroll.
9398 (create_and_show_popup_menu): Always use menu_position_func for
9399 Gtk3 (Bug#10361).
9400
ca22b785
AS
94012011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9402
9403 * callint.c (Fcall_interactively): Don't truncate prompt string.
9404
d048e1e6
EZ
94052011-12-23 Eli Zaretskii <eliz@gnu.org>
9406
9407 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9408 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 9409 resumed from there (after widening). (Bug#10360)
d048e1e6 9410
5ccaba1f
JD
94112011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9412
9413 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9414
204ee57f
JD
94152011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9416
b81d40f0
JB
9417 * nsterm.m (x_free_frame_resources):
9418 Release f->output_data.ns->miniimage.
204ee57f
JD
9419 (ns_index_color): Fix indentation. Do not retain
9420 color_table->colors[i].
9421
9422 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9423 before returning.
9424
9425 * nsfns.m (x_set_background_color): Assign return value from
9426 ns_index_color to face-background instead of NSColor*.
9427 (ns_implicitly_set_icon_type): Fix indentation.
9428 Change assignment in for loop to comparison.
9429
9430 * emacs.c (ns_pool): New variable.
9431 (main): Assign ns_pool.
9432 (Fkill_emacs): Call ns_release_autorelease_pool.
9433
9434 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9435 autorelease fdesc, release fdAttrs and tdict.
9436 (ns_get_covering_families): Release charset.
9437 (ns_findfonts): Release NSFontDescriptor created with new.
9438 (ns_uni_to_glyphs): Fix indentation.
9439 (setString): Release attrStr before assigning new value.
9440
c803b2b7
JD
94412011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9442
678f4426
JD
9443 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9444 and NS_IMPL_COCOA.
9445 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9446 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9447
cd394be1 94482011-12-18 David Reitter <reitter@cmu.edu>
678f4426 9449
5fecd5fc
JD
9450 * nsterm.m (ns_term_init): Subscribe for notifications
9451 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9452 to method trackingNotification in EmacsMenu.
9453
9454 * nsmenu.m (trackingMenu): New variable.
3771cb17 9455 (trackingNotification): New method (from Aquamacs).
5fecd5fc 9456 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 9457 from Aquamacs (Bug#7030).
678f4426
JD
9458
94592011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 9460
c803b2b7
JD
9461 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9462 (symbol_to_nsstring): Fix indentation.
9463 (ns_symbol_to_pb): New function.
cae07000
SM
9464 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9465 (Fns_rotate_cut_buffers_internal): Remove.
9466 (Fns_store_selection_internal): Rename from
c803b2b7
JD
9467 Fns_store_cut_buffer_internal.
9468 (ns_get_foreign_selection, Fx_own_selection_internal)
9469 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
9470 (Fns_get_selection_internal, Fns_store_selection_internal):
9471 Use ns_symbol_to_pb and check if return value is nil.
9472 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9473 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
9474 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9475 renamed to Sns_store_selection_internal.
9476 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9477 and remove this function.
9478 (ns_handle_selection_clear): Remove, never used.
9479 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9480 here.
9481
e1b01a3a
KB
94822011-12-17 Ken Brown <kbrown@cornell.edu>
9483
9484 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9485 GID is unknown (Bug#10257).
9486
2adb6e85
PE
94872011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9488
9489 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9490 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9491 which caused a build failure on GNU/Linux IA-64. This problem was
9492 introduced by my 2011-10-07 patch.
9493
d1d7b339
JL
94942011-12-15 Juri Linkov <juri@jurta.org>
9495
9496 * image.c (imagemagick_error): New function. (Bug#10112)
9497 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9498 Use `imagemagick_error' where ImageMagick functions return
9499 `MagickFalse'.
9500 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9501 proper order.
9502
100d5755
KH
95032011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9504
9505 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9506 fill background (Bug#8992).
9507
454592a6
MR
95082011-12-13 Martin Rudalics <rudalics@gmx.at>
9509
9510 * window.c (Vwindow_combination_resize)
9511 (Vwindow_combination_limit): Use t instead of non-nil in
9512 doc-strings.
61d4b438
MR
9513 (Vrecenter_redisplay): Add first sentence of doc-string on
9514 separate line.
53524d93 9515 (Frecenter): Fix doc-string typo.
454592a6 9516
3633e3aa
KH
95172011-12-11 Kenichi Handa <handa@m17n.org>
9518
9519 * coding.c (Funencodable_char_position): Pay attention to the
9520 buffer text relocation (Bug#9389).
9521
7b9d523a 95222011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 9523
7b9d523a
JD
9524 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9525 gtk_init (Bug#10100).
9526
b73189c6
EZ
95272011-12-10 Eli Zaretskii <eliz@gnu.org>
9528
9529 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9530 IT->string is nil. (Bug#10263)
9531
f7dfe5d6
JD
95322011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9533
83faebb4
JD
9534 * nsterm.h (x_free_frame_resources): Declare.
9535
f7dfe5d6
JD
9536 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9537 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9538
9539 * nsterm.h (ns_get_defaults_value): Declare.
9540
9541 * nsterm.m (ns_default): Call ns_get_defaults_value.
9542
7cd4e72c
EZ
95432011-12-09 Eli Zaretskii <eliz@gnu.org>
9544
9545 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9546 (Bug#10170)
9547
b34d7317
YM
95482011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9549
9550 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9551 that where the value of an _OBJC_* symbol points to is in the .bss
9552 section (Bug#10240).
9553
76470ad1
KH
95542011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9555
9556 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 9557 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 9558
745fff94
KH
95592011-12-08 Kenichi Handa <handa@m17n.org>
9560
9561 * ftfont.c (get_adstyle_property): Fix previous change
9562 (Bug#10233).
9563
6e44397c
JB
95642011-12-07 Juanma Barranquero <lekktu@gmail.com>
9565
9566 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9567 dirs from the default value of EMACSLOADPATH (bug#10208).
9568
7efa6272
GM
95692011-12-07 Glenn Morris <rgm@gnu.org>
9570
9571 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9572 installation and source directories as well. (Bug#10208)
9573
f6fc4d87
CY
95742011-12-06 Chong Yidong <cyd@gnu.org>
9575
9576 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9577
2bf26180
GM
95782011-12-06 Glenn Morris <rgm@gnu.org>
9579
9580 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9581 as an error, not just -1. (Bug#10217)
9582
3a6ad4f0
CY
95832011-12-05 Chong Yidong <cyd@gnu.org>
9584
9585 * keyboard.c (process_special_events): New function.
9586 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9587
75a3b399
PE
95882011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9589
9590 * coding.c (encode_designation_at_bol): Don't use uninitialized
9591 local variable (Bug#9318).
9592
c3c9e25e
KH
95932011-12-05 Kenichi Handa <handa@m17n.org>
9594
9595 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9596 return Qnil (Bug#8046, Bug#10193).
9597
5eb05ea3
KH
95982011-12-05 Kenichi Handa <handa@m17n.org>
9599
9600 * coding.c (encode_designation_at_bol): New args charbuf_end and
9601 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
9602 (coding_set_source): Return how many bytes coding->source was
9603 relocated.
9604 (coding_set_destination): Return how many bytes
9605 coding->destination was relocated.
9606 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 9607 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
9608
96092011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9610
9611 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9612 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9613 macro (Bug#9318).
9614
96152011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9616
9617 The following changes are to fix Bug#9318.
9618
a79703f5 9619 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
9620 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9621 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 9622 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 9623
7dbda6df
JB
96242011-12-05 Juanma Barranquero <lekktu@gmail.com>
9625
9626 * lisp.h (process_quit_flag): Fix external declaration.
9627
6d5eb5b0
SM
96282011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9629
9630 Don't macro-inline non-performance-critical code.
9631 * eval.c (process_quit_flag): New function.
9632 * lisp.h (QUIT): Use it.
9633
a0c3fad0
JD
96342011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9635
9636 * nsfns.m (get_geometry_from_preferences): New function.
9637 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9638
6c07aac2
AS
96392011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9640
9641 * emacs.c (Qkill_emacs): Define.
9642 (syms_of_emacs): Initialize it.
9643 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9644 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
9645 (quit_throw_to_read_char): Add parameter `from_signal'.
9646 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
9647 * lisp.h (QUIT): Call Fkill_emacs if requested.
9648
c052ead4
JD
96492011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9650
9651 * widget.c (update_wm_hints): Return if wmshell is null.
9652 (widget_update_wm_size_hints): New function.
9653
9654 * widget.h (widget_update_wm_size_hints): Declare.
9655
9656 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9657 widget_update_wm_size_hints (Bug#10104).
9658
9e49252b
EZ
96592011-12-03 Eli Zaretskii <eliz@gnu.org>
9660
9661 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9662 before a newline, prepare the bidi iterator for consuming the
9663 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 9664 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 9665
02b16839
JL
96662011-12-02 Juri Linkov <juri@jurta.org>
9667
9668 * search.c (Fword_search_regexp): New Lisp function created from
9669 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9670 (Fword_search_backward, Fword_search_forward)
9671 (Fword_search_backward_lax, Fword_search_forward_lax):
9672 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9673 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9674
0068070e
SM
96752011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9676
9677 * fileio.c (Finsert_file_contents): Move after-change-function call
9678 to before the "handled:" label, since all "goto handled" appear in
9679 cases where the *-change-functions have already been properly called
9680 (bug#10117).
9681
3360a3fc
AS
96822011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9683
9684 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9685 waiting for input. (Bug#10169)
9686
73d6c093
EZ
96872011-11-30 Eli Zaretskii <eliz@gnu.org>
9688
9689 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9690 verifies glyph row's hash code--we have just reallocated the
9691 glyphs, so their contents can be complete garbage. (Bug#10164)
9692
febe6bea
JB
96932011-11-30 Juanma Barranquero <lekktu@gmail.com>
9694
9695 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9696
801a4313
EZ
96972011-11-30 Eli Zaretskii <eliz@gnu.org>
9698
9699 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9700 attributes are tested _before_ calling verify_row_hash, to protect
9701 against GCC re-ordering of the tests. (Bug#10164)
9702
2b56b87e
JD
97032011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9704
9705 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9706
9707 * xterm.c (handle_one_xevent): Only set async_visible and friends
9708 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 9709 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
9710 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9711
dbf31225
PE
97122011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9713
9714 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9715 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9716 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9717 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9718 All uses changed to use GCPRO1 etc.
9719 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9720 Revert to old implementation (i.e., before 2011-03-11).
9721
1305621b
YM
97222011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9723
9724 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9725 of scroll runs so as to avoid assigning disabled bogus rows and
9726 unnecessary graphics copy operations.
9727
8c9afb46
EZ
97282011-11-27 Eli Zaretskii <eliz@gnu.org>
9729
9730 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9731 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9732 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9733 (malloc, free, realloc, calloc): Redirect to e_* only when
9734 compiling Emacs.
9735
9736 * lisp.h (GCTYPEBITS): Move before first use.
9737 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9738 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9739 this macro definition.
9740
9741 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9742 _MSC_VER.
9743
54e9e3bf
JD
97442011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9745
6d5eb5b0
SM
9746 * gtkutil.c (xg_create_frame_widgets):
9747 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
9748 present with Gtk+ 2.0.
9749
83aca1cb
PE
97502011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9751
9752 * fileio.c (Finsert_file_contents): Undo previous change; see
9753 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9754
5b76caa4
PE
97552011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9756
9757 Rename locals to avoid shadowing.
9758 * fileio.c (Finsert_file_contents):
9759 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9760 * process.c (wait_reading_process_output):
9761 Rename inner 'proc' to 'p' to avoid shadowing.
9762 Indent for consistency with usual Emacs style.
9763
8c535114
EZ
97642011-11-25 Eli Zaretskii <eliz@gnu.org>
9765
9766 * xdisp.c (redisplay_window): If cursor row is not fully visible
9767 after recentering, and scroll-conservatively is set to a large
9768 number, scroll window by a few more lines to make the cursor fully
9769 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
9770 (start_display): Don't move to the next line if the display should
9771 start at a newline that is part of a display vector or an overlay
9772 string. (Bug#10119)
8c535114 9773
fa4fdb5c
JL
97742011-11-24 Juri Linkov <juri@jurta.org>
9775
9776 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9777 after the `MagickPingImage' call. (Bug#10112)
9778
90ec88df
CY
97792011-11-23 Chong Yidong <cyd@gnu.org>
9780
9781 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9782
56e2e794
MR
97832011-11-23 Martin Rudalics <rudalics@gmx.at>
9784
9785 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9786 making another buffer current. (Bug#10114)
9787
b6e64c41
GM
97882011-11-23 Glenn Morris <rgm@gnu.org>
9789
9790 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9791
6b21de18
CY
97922011-11-23 Chong Yidong <cyd@gnu.org>
9793
9794 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9795 using it (Bug#5984).
9796
b12cd789
EZ
97972011-11-22 Eli Zaretskii <eliz@gnu.org>
9798
9799 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9800 and header-lines, as they don't have one computed for them.
9801 (Bug#10098)
9802
9803 * .gdbinit (prow): Make displayed values more self-explaining.
9804 Add row's hash code.
9805
261b6fd4
LMI
98062011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9807
9808 * process.c (wait_reading_process_output): Fix asynchrounous
9809 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 9810 (wait_reading_process_output): Add comment and URL.
261b6fd4 9811
e7cfd277
JD
98122011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9813
9814 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9815
a9b9b7f5
CY
98162011-11-21 Chong Yidong <cyd@gnu.org>
9817
9818 * window.c (Fnext_window, Fprevious_window): Doc fix.
9819
b0d15b4f
SM
98202011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9821
9822 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9823
fe7a3057
JB
98242011-11-20 Juanma Barranquero <lekktu@gmail.com>
9825
9826 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9827
d2999b1a
MR
98282011-11-20 Martin Rudalics <rudalics@gmx.at>
9829
9830 * window.c (Fset_window_combination_limit): Rename argument
9831 STATUS to LIMIT.
9832 (Vwindow_combination_limit): Remove "status" from doc-string.
9833
d5ff9cd0
AS
98342011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9835
9836 * m/ibms390.h: Remove.
9837 * m/ibms390x.h: Don't include "ibms390.h".
9838
a5bb9bd3
SM
98392011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9840
9841 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9842 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9843
cd1181db
JB
98442011-11-20 Juanma Barranquero <lekktu@gmail.com>
9845
9846 * casetab.c (Fset_case_table):
9847 * charset.c (Fcharset_after): Fix typos.
9848
615a3b8d 98492011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 9850
17e845af
PE
9851 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9852 Otherwise, valgrind does not work on some platforms.
9853 Problem reported by Andreas Schwab in
6a0bf43d
PE
9854 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9855 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9856 is set, removing the need for VIRT_ADDRESS_VARIES.
9857 (PURE_P): Use a more-efficient implementation that needs just one
9858 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9859 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9860 to 4 (xorl, subq, cmpq, setbe).
9861 * alloc.c (pure): Always extern now, since that's the
9862 VIRT_ADDR_VARIES behavior.
9863 (PURE_POINTER_P): Use a single comparison, not two, for
9864 consistency with the new puresize.h.
9865 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9866 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9867 Remove VIRT_ADDR_VARIES no longer needed.
9868
f8fe6f96
EZ
98692011-11-19 Eli Zaretskii <eliz@gnu.org>
9870
9871 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9872 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9873 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9874 behave as if the cursor position were at the window margin.
9875
9876 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9877 and the cursor position is out of bounds, behave as if the cursor
9878 position were at the window margin. (Bug#10075)
9879
df05a53c
CY
98802011-11-18 Chong Yidong <cyd@gnu.org>
9881
9882 * window.c (Fwindow_combination_limit): Make first argument
9883 non-optional, since it is meaningless for live windows like the
9884 selected window.
61ccba97 9885
2071918e
DA
98862011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9887
9888 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9889
b50a28de
SM
98902011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9891
9892 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9893 (graft_intervals_into_buffer): Simplify.
9894
015137db
EZ
98952011-11-18 Eli Zaretskii <eliz@gnu.org>
9896
9897 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9898 hash values of the two rows.
9899 (copy_row_except_pointers): Preserve the used[] arrays and the
9900 hash values of the two rows. (Bug#10035)
68c95424 9901 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
9902
9903 * xdisp.c (row_hash): New function, body extracted from
9904 compute_line_metrics.
9905 (compute_line_metrics): Call row_hash, instead of computing the
9906 hash code inline.
9907
9908 * dispnew.c (verify_row_hash): Call row_hash for computing the
9909 hash code of a row, instead of duplicating code from xdisp.c.
9910
9911 * dispextern.h (row_hash): Add prototype.
9912
a2addb04
TH
99132011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9914
9915 * frame.c (delete_frame): Don't delete the terminal when the last
9916 X frame is closed if emacs is built with GTK toolkit.
9917
df85d315
JB
99182011-11-17 Juanma Barranquero <lekktu@gmail.com>
9919
9920 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9921
a0c2d0ae
MR
99222011-11-17 Martin Rudalics <rudalics@gmx.at>
9923
9924 * window.c (Vwindow_splits): Rename to
9925 Vwindow_combination_resize. Suggested by Juri Linkov.
9926 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9927 of Vwindow_splits.
9928
58179cce
JB
99292011-11-16 Juanma Barranquero <lekktu@gmail.com>
9930
7877f373
JB
9931 * nsfns.m (Fns_font_name):
9932 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 9933
b6f67890
MR
99342011-11-16 Martin Rudalics <rudalics@gmx.at>
9935
9936 * window.h (window): Rename slot "nest" to "combination_limit".
9937 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9938 (Fset_window_nest): Rename to Fset_window_combination_limit.
9939 (Vwindow_nest): Rename to Vwindow_combination_limit.
9940 (recombine_windows, make_parent_window, make_window)
9941 (Fsplit_window_internal, saved_window)
9942 (Fset_window_configuration, save_window_save): Rename all
9943 occurrences of window_nest to window_combination_limit.
9944
c7015153
JB
99452011-11-15 Juanma Barranquero <lekktu@gmail.com>
9946
9947 * image.c (imagemagick_load_image): Fix typo.
9948
322ad6ec
EZ
99492011-11-14 Eli Zaretskii <eliz@gnu.org>
9950
9951 * xdisp.c (display_line): Move the call to
9952 highlight_trailing_whitespace before the call to
9953 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
9954 faces of all the glyphs to compute ROW's hash value.
9955 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 9956
f067b8ec
JB
99572011-11-14 Juanma Barranquero <lekktu@gmail.com>
9958
9959 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9960 just return (bug#10044).
9961
1e5b2111
EZ
99622011-11-12 Eli Zaretskii <eliz@gnu.org>
9963
7ef3cbd5
EZ
9964 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9965 with user-defined heap size. Bump the default size of the temacs
9966 heap to 27MB, to avoid memory warning when running temacs.
9967 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9968
1e5b2111
EZ
9969 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9970 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
9971 (verify_row_hash) [XASSERTS]: New function.
9972 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9973 that the hash value of glyph rows is correct.
1e5b2111 9974
89d61221
MR
99752011-11-12 Martin Rudalics <rudalics@gmx.at>
9976
9977 * window.h (window): Remove splits slot.
9978 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9979 (Fdelete_other_windows_internal, make_parent_window)
9980 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9981 (Fset_window_configuration, save_window_save): Don't deal with
9982 split status of windows.
9983 (saved_window): Remove splits slot.
9984 (Vwindow_splits): Rewrite doc-string.
9985
97f18cc8
JD
99862011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9987
9988 * xfns.c (unwind_create_frame):
9989 * nsfns.m (unwind_create_frame):
9990 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9991 Vframe_list (Bug#9999).
9992
22a648b4
DA
99932011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9994
0b381c7e 9995 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 9996
659afede
KH
99972011-11-11 Kenichi Handa <handa@m17n.org>
9998
9999 * callproc.c (Fcall_process): Set the member dst_multibyte of
10000 process_coding.
10001
9ac0394b
KH
100022011-11-11 Johan Bockgård <bojohan@gnu.org>
10003
10004 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10005 avoid a crash (bug#9496).
10006
2fbdc249
CY
100072011-11-09 Chong Yidong <cyd@gnu.org>
10008
10009 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10010 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10011
ac6b1f81
PE
100122011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10013
10014 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10015
09db192c
PE
100162011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10017
10018 Avoid some portability problems by eschewing 'extern inline' functions.
10019 The trivial performance wins aren't worth the portability hassles; see
10020 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10021 et seq.
10022 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10023 (window_box_width, window_box_left, window_box_left_offset)
10024 (window_box_right, window_box_right_offset): Undo previous change,
10025 by removing the "extern"s.
10026 * intervals.c (adjust_intervals_for_insertion)
10027 (adjust_intervals_for_deletion): Undo previous change,
10028 making these static again.
10029 (offset_intervals, temp_set_point_both, temp_set_point)
10030 (copy_intervals_to_string): No longer inline.
10031 * xdisp.c (window_text_bottom_y, window_box_width)
10032 (window_box_height, window_box_left_offset)
10033 (window_box_right_offset, window_box_left, window_box_right)
10034 (window_box): No longer inline.
10035
105216ed
CY
100362011-11-08 Chong Yidong <cyd@gnu.org>
10037
10038 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
10039 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
10040 Signal an error if not a live window.
105216ed
CY
10041 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
10042 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
10043
ae9e237f
JB
100442011-11-07 Juanma Barranquero <lekktu@gmail.com>
10045
10046 * lisp.h (syms_of_abbrev): Remove declaration.
10047 Reported by CHENG Gao <chenggao@royau.me>.
10048
c7aa8333
EZ
100492011-11-07 Eli Zaretskii <eliz@gnu.org>
10050
10051 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10052 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
10053 of temacs in GUI mode.
10054
be7f5545
MR
100552011-11-07 Martin Rudalics <rudalics@gmx.at>
10056
10057 * window.h: Declare delete_all_child_windows instead of
10058 delete_all_subwindows.
10059 * window.c (Fwindow_nest, Fset_window_nest)
10060 (Fset_window_new_total, Fset_window_new_normal)
10061 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10062 (delete_all_subwindows): Rename to delete_all_child_windows.
10063 (Fdelete_other_windows_internal, Fset_window_configuration):
10064 Call delete_all_child_windows instead of delete_all_subwindows.
10065 * frame.c (delete_frame): Call delete_all_child_windows instead
10066 of delete_all_subwindows.
10067
ca78dc43
PE
100682011-11-07 Paul Eggert <eggert@cs.ucla.edu>
10069
10070 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10071 This is also needed for porting to any host where GC_MARK_STACK is
10072 not GC_MAKE_GCPROS_NOOPS.
10073 (which_symbols): Use it.
10074
a0241d01
KH
100752011-11-07 Kenichi Handa <handa@m17n.org>
10076
10077 * coding.c (coding_set_destination): Check coding->src_pos only
10078 when coding->src_object is a buffer (bug#9910).
10079
10080 * process.c (send_process): Set the member src_multibyte of coding
10081 to 0 (bug#9911) when sending a unibyte text.
10082
10083 * callproc.c (Fcall_process): Set the member src_multibyte of
10084 process_coding to 0 (bug#9912).
10085
a64bfdfa 100862011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
10087
10088 * xmenu.c (cleanup_widget_value_tree): New function.
10089 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10090 calling free_menubar_widget_value_tree directly (Bug#9830).
10091
cb41b32a
PE
100922011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10093
10094 Fix some portability problems with 'inline'.
10095 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10096 (window_box_width, window_box_left, window_box_left_offset)
10097 (window_box_right, window_box_right_offset): Declare extern.
10098 Otherwise, these inline functions do not conform to C99 and
10099 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
10100 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10101 * intervals.c (adjust_intervals_for_insertion)
10102 (adjust_intervals_for_deletion): Now extern, because otherwise the
10103 extern inline functions 'offset_intervals' couldn't refer to it.
10104 (static_offset_intervals): Remove.
10105 (offset_intervals): Rewrite using the old contents of
10106 static_offset_intervals. The old version didn't conform to C99
10107 because an extern inline function contained a reference to an
10108 identifier with static linkage.
10109
b7041366
AS
101102011-11-06 Andreas Schwab <schwab@linux-m68k.org>
10111
10112 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10113 GC.
10114
88a37c4d
EZ
101152011-11-06 Eli Zaretskii <eliz@gnu.org>
10116
10117 * xdisp.c (init_iterator, reseat_to_string): Don't set the
10118 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
10119 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10120 return Qleft_to_right.
10121
49745b39
CY
101222011-11-06 Chong Yidong <cyd@gnu.org>
10123
10124 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
10125 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
10126 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
10127 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
10128 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
10129 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
10130 (Fwindow_vscroll): Doc fix.
10131 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
10132 argument, since it makes no sense to pass a live window and for
10133 consistency with window-child.
10134
1f05cd82
CS
101352011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
10136
10137 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
10138 support MSVC.
10139
22610910
JR
101402011-11-05 Jason Rumney <jasonr@gnu.org>
10141
10142 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
10143 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
10144 fonts (Bug#6029).
10145 (add_font_entity_to_list): Fix logic errors in mixed boolean and
10146 bitwise arithmetic preventing use of unicode-sip and non-truetype
10147 opentype fonts.
10148
a06776b2
EZ
101492011-11-05 Eli Zaretskii <eliz@gnu.org>
10150
3ad924ba
EZ
10151 * s/ms-w32.h (fstat, stat, utime): Move redirections to
10152 "emacs"-only part.
10153
a06776b2
EZ
10154 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
10155 initialization code to keep similarity to xfns.c after changes
10156 from 2011-11-05.
10157
c9e7db78
JD
101582011-11-05 Jan Djärv <jan.h.d@swipnet.se>
10159
a97f8f3f
JD
10160 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
10161 (unwind_create_frame): New function (Bug#9943).
10162 (Fx_create_frame): Restructure code to be more similar to the one in
10163 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
10164 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
10165 Move terminal->reference_count++ just before making the frame official
10166 (Bug#9943).
10167
10168 * nsterm.m (x_free_frame_resources): New function.
10169 (x_destroy_window): Move code to x_free_frame_resources.
10170
c9e7db78 10171 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
10172 (Fx_create_frame, x_create_tip_frame):
10173 Move terminal->reference_count++ just before making the frame
75f1671a 10174 official. Move initialization of image_cache_refcount and
c9e7db78
JD
10175 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
10176
a6fc3b5c
EZ
101772011-11-05 Eli Zaretskii <eliz@gnu.org>
10178
10179 Support MSVC build with newer versions of Visual Studio.
10180 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
10181 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
10182 nt/gmake.defs.
10183
10184 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10185 which are not supported by MSVC.
10186 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10187 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10188 bitfields.
10189 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10190 types in bitfields.
10191 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10192
10193 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10194
58179cce 101952011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
10196
10197 Support MSVC build with newer versions of Visual Studio.
10198 * w32.c: Don't include w32api.h for MSVC.
10199 (init_environment) [_MSC_VER]: Call sys_access, not _access.
10200
10201 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10202 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10203 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10204 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10205 e_* cousins.
10206 (alloca) [_MSC_VER]: Define to _alloca.
10207
10208 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10209
10210 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10211
a58c13ed
EZ
102122011-11-04 Eli Zaretskii <eliz@gnu.org>
10213
10214 * xdisp.c (note_mouse_highlight): If either of
10215 previous/next-single-property-change returns nil, treat that as
10216 the beginning or the end of the buffer. (Bug#9955)
10217
fe0b6370
JD
102182011-11-04 Jan Djärv <jan.h.d@swipnet.se>
10219
a58c13ed 10220 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
10221 label is not null (Bug#9951).
10222 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10223 may be NULL.
10224
89bd5ee1
EZ
102252011-11-04 Eli Zaretskii <eliz@gnu.org>
10226
10227 * window.c (Fwindow_body_size): Mention in the doc string that the
10228 return value is in frame's canonical units. (Bug#9949)
10229
84c3edb9
EZ
102302011-11-03 Eli Zaretskii <eliz@gnu.org>
10231
4e2fb5c7
EZ
10232 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
10233
84c3edb9 10234 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 10235 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 10236 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 10237
bc17a887
EZ
102382011-11-01 Eli Zaretskii <eliz@gnu.org>
10239
10240 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10241 Don't stop backward scan on the continuation glyph, even though
10242 its CHARPOS is positive.
6d5eb5b0
SM
10243 (mouse_face_from_buffer_pos, note_mouse_highlight):
10244 Rename cover_string to disp_string.
bc17a887 10245
4ee88440
MR
102462011-11-01 Martin Rudalics <rudalics@gmx.at>
10247
10248 * window.c (temp_output_buffer_show): Don't use
10249 Vtemp_buffer_show_specifiers.
10250 (Vtemp_buffer_show_specifiers): Remove unused variable.
10251
c2ff3c02
EZ
102522011-10-30 Eli Zaretskii <eliz@gnu.org>
10253
10254 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10255 past the beginning of the current glyph matrix.
10256
58179cce 102572011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
10258
10259 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10260 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10261 HAVE_GTK3 (Bug#9869).
b77a6a7f 10262
3b574623
JD
10263 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10264 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10265
b77a6a7f
JD
10266 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10267
10268 * xterm.c: Declare x_handle_net_wm_state to return int.
10269 (handle_one_xevent): Check if we are iconified but don't have
10270 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
10271 (get_current_wm_state): Return non-zero if not hidden,
10272 check for _NET_WM_STATE_HIDDEN (Bug#9893).
10273 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
10274 (x_handle_net_wm_state): Return what get_current_wm_state returns.
10275 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
10276
196e41e4
PE
102772011-10-29 Paul Eggert <eggert@cs.ucla.edu>
10278
10279 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
10280 so that this new function doesn't get optimized away by a
10281 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
10282
021f2e1a
AS
102832011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10284
10285 * frame.h (MOUSE_HL_INFO): Remove excess parens.
10286
8b058d44
EZ
102872011-10-29 Eli Zaretskii <eliz@gnu.org>
10288
10289 Fix the `xbytecode' command.
10290 * .gdbinit (xprintbytestr): New command.
b50a28de 10291 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
10292 (xbytecode): Print the byte-code string as well.
10293
4452fb80
EZ
102942011-10-29 Kim Storm <storm@cua.dk>
10295
8b058d44
EZ
10296 * alloc.c (which_symbols): New function.
10297
21b72067
AS
102982011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10299
10300 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
10301 line. (Bug#9903)
10302
83ed7b5c
GM
103032011-10-29 Glenn Morris <rgm@gnu.org>
10304
10305 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10306 Not clear what it was for, and it causes various bugs. (Bug#9839)
10307
5a7a728b
EZ
103082011-10-28 Eli Zaretskii <eliz@gnu.org>
10309
10310 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10311 possible random value that matches one of those tested as
10312 condition to clear the mouse face.
10313
d3d0842f
CY
103142011-10-28 Chong Yidong <cyd@gnu.org>
10315
10316 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10317
31b39d13
DN
103182011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
10319
10320 * window.c (make_window): Initialize phys_cursor_on_p.
10321
9aba6043
SM
103222011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
10323
10324 * lisp.h (struct Lisp_Symbol): Update comments.
10325
c20992f4
JB
103262011-10-28 Juanma Barranquero <lekktu@gmail.com>
10327
10328 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10329
db4f02f2
EZ
103302011-10-28 Eli Zaretskii <eliz@gnu.org>
10331
10332 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
10333 <oslsachem@gmail.com> for helping to debug this.
10334
10335 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10336 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10337 (g_b_init_get_glyph_outline_w): New static variables.
10338 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10339 (GetGlyphOutlineW_Proc): New typedefs.
10340 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
10341 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10342 New functions.
10343 (w32font_open_internal, compute_metrics):
10344 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
10345 instead of calling the "wide" APIs directly.
10346
10347 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10348
10349 * w32.h (syms_of_w32font): Add prototype.
10350
87e68db4
JB
103512011-10-27 Juanma Barranquero <lekktu@gmail.com>
10352
10353 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10354 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10355 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10356 (Fmove_to_window_line): Doc fix.
10357
435c1d67
CY
103582011-10-27 Chong Yidong <cyd@gnu.org>
10359
10360 * process.c (make_process): Set gnutls_state to NULL.
10361
10362 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10363 non-NULL, regardless of GNUTLS_INITSTAGE.
10364 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10365 an error. Set process slots as soon as we allocate them.
10366
10367 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10368
9c6c6f49
CY
103692011-10-27 Chong Yidong <cyd@gnu.org>
10370
9aba6043
SM
10371 * gnutls.c (emacs_gnutls_deinit): New function.
10372 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
10373 (Fgnutls_deinit, Fgnutls_boot): Use it.
10374
10375 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10376 (deactivate_process): Call emacs_gnutls_deinit.
10377
657d08d3
JB
103782011-10-27 Juanma Barranquero <lekktu@gmail.com>
10379
10380 * image.c (x_create_x_image_and_pixmap):
10381 * w32.c (sys_rename, w32_delayed_load):
10382 * w32font.c (fill_in_logfont):
10383 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10384
5430d399
JB
103852011-10-26 Juanma Barranquero <lekktu@gmail.com>
10386
10387 * w32fns.c (w32_default_color_map): New function,
10388 extracted from Fw32_default_color_map.
a7ef684b 10389 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 10390
fe0055fa
PE
103912011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10392
10393 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10394
e6346438
SM
103952011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10396
10397 * keyboard.c (test_undefined): New function (bug#9751).
10398 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10399
e112cc37
ET
104002011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10401
10402 * sysdep.c (init_sys_modes): Fix the check for the controlling
10403 terminal (Bug#6649).
10404
7b5d6677
EZ
104052011-10-20 Eli Zaretskii <eliz@gnu.org>
10406
10407 * dispextern.h (struct bidi_it): New member next_en_type.
10408
10409 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10410 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10411 current character, check also for next_en_type being WEAK_EN.
10412 (bidi_resolve_weak): Don't enter the expensive loop if the current
10413 position is before next_en_pos. Record the bidi type of the first
10414 non-ET, non-BN character we find, in addition to its position.
10415 (bidi_level_of_next_char): Invalidate next_en_type when
10416 next_en_pos is over-stepped.
10417
7da0b018
PE
104182011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10419
10420 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10421 * editfns.c: Rewrite current-time-zone so that it invokes
10422 the equivalent of (format-time-string "%Z") to get the time zone name.
10423 This fixes a bug when the time zone name contains characters that
10424 need converting from the system time locale to Emacs internal format.
10425 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10426 that patch fixed format-time-string to do the conversion, but
10427 I forgot to fix current-time-zone.
10428 (format_time_string): New function, containing most of
10429 what Fformat_time_string used to contain.
10430 (Fformat_time_string): Rewrite in terms of format_time_string.
10431 This doesn't change this function's behavior.
10432 (current-time-zone): Rewrite to use format_time_string.
10433 This fixes the bug reported by Michael Schierl in
10434 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10435 Jason Rumney's 2007-06-07 change worked around this bug, but
10436 didn't fix it.
10437 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10438
8547b010
EZ
104392011-10-19 Eli Zaretskii <eliz@gnu.org>
10440
10441 * xdisp.c (start_display): If the character at POS is displayed
10442 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
10443 (try_window_reusing_current_matrix): If a line ends in a display
10444 vector or the next line starts in a display vector, continue
10445 redrawing the window even though the character position of
10446 start_row was reached.
8547b010
EZ
10447 (Bug#9771, part 2)
10448
4e948d15
CY
104492011-10-18 Chong Yidong <cyd@gnu.org>
10450
10451 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10452 with nobreak-char-display too.
10453
4787455f
EZ
104542011-10-18 Eli Zaretskii <eliz@gnu.org>
10455
10456 Fix part 3 of bug#9771.
10457 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10458 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10459 non-neutral characters if the current character is a paragraph
10460 separator (a.k.a. Newline). This avoids running the same
10461 expensive loop twice, once when we consume the preceding newline
10462 and the other time when the line actually needs to be displayed.
10463 Avoid the loop when we see neutrals on the base embedding level
10464 following a character whose directionality is the same as the
10465 paragraph's. This avoids running the expensive loop when a line
10466 ends in a long sequence of neutrals, like control characters.
10467 Add assertion against STRONG_AL type. Slightly rearrange code
10468 that determines the type of a neutral given the first non-neutral
10469 that follows it.
10470 (bidi_level_of_next_char): Set next_en_pos to zero when
10471 invalidating its info.
10472
2c91f553
EZ
104732011-10-17 Eli Zaretskii <eliz@gnu.org>
10474
10475 * xdisp.c (push_display_prop): Determine whether to record string
10476 or buffer position by IT->string, not by IT->method. Allow
10477 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
10478 (move_it_vertically_backward): Don't look for character position
10479 immediately after the newline when in a continuation line.
10480 (Bug#9771, part 1)
2c91f553 10481
c7b08b0d
MR
104822011-10-15 Martin Rudalics <rudalics@gmx.at>
10483
10484 * window.c (coordinates_in_window): Rewrite and delabelize
10485 vertical border check. (Bug#5357) (Bug#9618)
10486
6b02f655
SM
104872011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10488
10489 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10490 errors in XSetWindowBorder (bug#9310).
10491
81d40c92
DA
104922011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10493
10494 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10495 avoid crash when xmalloc overrun checking is enabled.
10496
d4172c3b
EZ
104972011-10-13 Eli Zaretskii <eliz@gnu.org>
10498
10499 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10500 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10501 cursor motion with <left> and <right> arrow keys.
10502
10503 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10504 some callers set that themselves.
10505
b00eea75
EZ
105062011-10-12 Eli Zaretskii <eliz@gnu.org>
10507
10508 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10509 display string and the previous row comes from the same string and
10510 is empty. (Bug#9739) (Bug#9738)
10511
8fe012c4
SM
105122011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10513
10514 * doc.c (get_doc_string): Encode file name (bug#9735).
10515
0074aef2
EZ
105162011-10-12 Eli Zaretskii <eliz@gnu.org>
10517
79beb178
EZ
10518 * bidi.c (bidi_level_of_next_char):
10519 * xdisp.c (get_visually_first_element): Remove old incorrect
10520 comments regarding the Unicode Line Separator character.
10521
0074aef2
EZ
10522 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10523
6e4b3fbe
DA
105242011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10525
10526 * alloc.c (Fgc_status): Do not access beyond zombies array
10527 boundary if nzombies > MAX_ZOMBIES.
10528 * alloc.c (dump_zombies): Add missing format specifier.
10529
0324f3af
PE
105302011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10531
b5525cac
PE
10532 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10533 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10534
0324f3af
PE
10535 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10536 Some packages use them to denote characters with modifiers.
10537
e9b5f888
AS
105382011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10539
10540 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10541 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10542 matching a pp-number. Rename parameter var to var1.
10543
127827c0
SM
105442011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10545
10546 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10547
c8fd3bd0
GM
105482011-10-08 Glenn Morris <rgm@gnu.org>
10549
10550 * callint.c (Fcall_interactively): Give a more explicit error for the
10551 'c' case with a non-character input. (Bug#8479)
10552
352ec8ff
EZ
105532011-10-08 Eli Zaretskii <eliz@gnu.org>
10554
03669ccb
EZ
10555 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10556 lines.
7061c986
EZ
10557 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10558 lines that are hscrolled on the left.
03669ccb 10559
352ec8ff
EZ
10560 * dispnew.c (buffer_posn_from_coords): Account for a possible
10561 presence of header-line. (Bug#4426)
10562
a66cfb1c
SM
105632011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10564
6b02f655
SM
10565 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10566 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 10567
7c5ee88e
PE
105682011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10569
10570 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10571 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10572 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10573 this makes Emacs dump core during garbage collection on rare
10574 occasions. sizeof is obviously inferior to offsetof here, so
10575 stick with offsetof.
10576 (GC_POINTER_ALIGNMENT): New macro.
10577 (mark_memory): Omit 3rd (offset) arg; caller changed.
10578 Don't assume EMACS_INT alignment is the same as pointer alignment.
10579
df1bbe5b
SM
105802011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10581
10582 * keyboard.c (read_key_sequence_remapped): New var.
10583 (read_key_sequence): Compute remapping in the right buffer.
10584 (command_loop_1): Use read_key_sequence's remapping directly.
10585
51553db6
SM
105862011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10587
32c1fffd
SM
10588 * dired.c (file_name_completion): Don't expand file name.
10589 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10590 before checking file name handler.
10591
51553db6
SM
10592 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10593 they've been requested explicitly (bug#9591).
10594
b6bd1599 105952011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
10596
10597 * keymap.c (Fsingle_key_description): Use make_specified_string
10598 instead of build_string to build string from push_key_description.
10599 (Bug#5193)
10600
f701dc2a
PE
106012011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10602
4222c55d
PE
10603 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10604 This fixes a Y2038 bug on 64-bit hosts.
10605 * buffer.c (reset_buffer):
10606 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10607 (Fclear_buffer_auto_save_failure):
10608 Use 0, not -1, to represent an unset failure time, since time_t
10609 might not be signed.
10610
f701dc2a
PE
10611 Remove dependency on glibc malloc internals.
10612 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10613 Move back here from lisp.h, but with their new implementations.
10614 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10615 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10616 * charset.c (charset_table_init): New static var.
10617 (syms_of_charset): Use it instead of xmalloc. This removes a
10618 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10619 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10620 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10621 Move back to alloc.c.
10622 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10623 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10624
9ceebf39
JD
106252011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10626
10627 * nsterm.m (windowDidResize): Call x_set_window_size only when
10628 ns_in_resize is true. Otherwise set pixelwidth/height and
10629 call change_frame_size (Bug#9628).
10630
cb993c58
PE
106312011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10632
3930c88b
PE
10633 Port --enable-checking=all to Fedora 14 x86-64.
10634 * charset.c (syms_of_charset): Also account for glibc malloc's
10635 internal overhead when calculating the initial malloc maximum.
10636
cb993c58
PE
10637 Port --enable-checking=all to Fedora 14 x86.
10638 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10639 Move to lisp.h.
10640 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10641 (overrun_check_realloc, overrun_check_free):
10642 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10643 That way, xmalloc returns a properly-aligned pointer even if
10644 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10645 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10646 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10647 into account when calculating the initial malloc maximum.
10648 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10649 Move here from alloc.c, so that charset.c can use it too.
10650 Properly align; the old code wasn't right for common 32-bit hosts
10651 when configured with --enable-checking=all.
10652 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10653 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10654
31bed486
EZ
106552011-09-29 Eli Zaretskii <eliz@gnu.org>
10656
04c70788 10657 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
10658 use EDOM.
10659
fbcaa2f3
EZ
106602011-09-28 Eli Zaretskii <eliz@gnu.org>
10661
10662 * xdisp.c (compute_display_string_end): If there's no display
10663 string at CHARPOS, return -1.
10664
10665 * bidi.c (bidi_fetch_char): When compute_display_string_end
10666 returns a negative value, treat the character as a normal
10667 character not covered by a display string. (Bug#9624)
10668
a239d4e9
JB
106692011-09-28 Juanma Barranquero <lekktu@gmail.com>
10670
10671 * lread.c (Fread_from_string): Fix typo in docstring.
10672
88652fd5
EZ
106732011-09-27 Eli Zaretskii <eliz@gnu.org>
10674
10675 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10676 newline, reseat the iterator instead of bidi-iterating there one
10677 character at a time. (Bug#9610)
32c1fffd
SM
10678 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10679 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 10680
ed497dd4
AS
106812011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10682
10683 * lread.c (readevalloop): Use correct code for NBSP.
10684 (read1): Likewise. (Bug#9608)
10685
b2bf61aa
MA
106862011-09-25 Michael Albinus <michael.albinus@gmx.de>
10687
10688 * dbusbind.c (Fdbus_register_signal): When service is not
10689 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10690
32bbb17c
GM
106912011-09-25 Glenn Morris <rgm@gnu.org>
10692
10693 * buffer.c (truncate-lines): Doc fix.
10694
94e0933e
CY
106952011-09-24 Chong Yidong <cyd@stupidchicken.com>
10696
10697 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10698 (Fset_window_next_buffers): Doc fix.
10699
cddde921
GM
107002011-09-24 Glenn Morris <rgm@gnu.org>
10701
10702 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10703
1260aef1
PE
107042011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10705
25b4bfa0
PE
10706 Fix minor problems found by static checking.
10707 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
10708 * indent.c (Fvertical_motion): Fix == vs = typo.
10709
e3cbd34b
EZ
107102011-09-24 Eli Zaretskii <eliz@gnu.org>
10711
a66cfb1c
SM
10712 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10713 Default value is now t. Doc fix.
6bf7006f 10714
e3cbd34b 10715 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 10716 logic when moving up, not only when moving down. Fix the
e3cbd34b 10717 confusing name and values of the it_overshoot_expected variable;
32c1fffd 10718 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
10719
10720 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10721 CHARPOS is covered by a display string which includes newlines.
10722 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10723 is covered by a display string with embedded newlines.
10724
a3de0cbd
MA
107252011-09-24 Michael Albinus <michael.albinus@gmx.de>
10726
10727 * dbusbind.c (Fdbus_register_signal): Add match rule to
10728 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
10729 (Fdbus_register_method, Vdbus_registered_objects_table):
10730 Fix docstring.
a3de0cbd 10731
b260039d
JM
107322011-09-24 Jim Meyering <meyering@redhat.com>
10733
32c1fffd 10734 do not ignore write error for any output size
b260039d
JM
10735 The previous change was incomplete.
10736 While it makes emacs --batch detect the vast majority of stdout
10737 write failures, errors were still ignored whenever the output size is
10738 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10739 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10740 && echo FAIL: ignored write error
10741 FAIL: ignored write error
10742 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10743 && echo FAIL: ignored write error
10744 FAIL: ignored write error
10745 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10746
8eca8a7c
AS
107472011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10748
10749 * emacs.c (Fkill_emacs): In noninteractive mode exit
10750 non-successfully if a write error occurred on stdout. (Bug#9574)
10751
3341db62
EZ
107522011-09-21 Eli Zaretskii <eliz@gnu.org>
10753
10754 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10755 the xassert test.
10756
10757 * dispextern.h (struct it): Update the comment documenting what
10758 can it->OBJECT be.
10759
8c203dbf
EZ
107602011-09-20 Eli Zaretskii <eliz@gnu.org>
10761
10762 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10763 a display string, extend search for cursor position to end of row.
10764 (find_row_edges): If the row ends in a newline from a display
10765 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10766 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
10767 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10768 non-empty line. Fixes confusing cursor motion with arrow keys at
10769 the beginning of a line that starts with whitespace.
8c203dbf 10770
a4824228
LMI
107712011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10772
10773 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10774 (bug#9493).
10775
33ed493b
CY
107762011-09-18 Chong Yidong <cyd@stupidchicken.com>
10777
10778 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10779 boolean (Bug#9154).
10780
56cd55c8
EZ
107812011-09-18 Eli Zaretskii <eliz@gnu.org>
10782
10783 * xdisp.c (display_line): Record maximum and minimum buffer
10784 positions even if no glyphs were produced (e.g., by a zero-width
10785 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10786 buffer positions that will be removed from the glyph row because
10787 they don't fit.
c02dcedf
EZ
10788 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10789 column is beyond frame width: don't subtract 1 "pixel" when
10790 computing width of the stretch.
3e62b7e0
EZ
10791 (reseat_at_next_visible_line_start): Undo the change made on
10792 2011-09-17 that saved paragraph information and restored it after
10793 the call to `reseat'. (Bug#9545)
56cd55c8 10794
5ed99d36 107952011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
10796
10797 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10798 and turn window cursor on if cleared (Bug#9415).
10799
5ed99d36 108002011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
10801
10802 * search.c (boyer_moore): Take unibyte characters from pattern
10803 literally. (Bug#9458)
10804
9bade7b2
EZ
108052011-09-18 Eli Zaretskii <eliz@gnu.org>
10806
10807 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10808
e5e9d610
PE
108092011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10810
87e4427a
PE
10811 Fix minor problem found by static checking.
10812 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10813 initialized, to pacify gcc -Wuninitialized.
10814
e5e9d610
PE
10815 * fileio.c: Report proper errno when syscall falls.
10816 (Finsert_file_contents): Save and restore errno,
10817 so that report_file_error outputs the correct diagnostic.
10818 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10819
a1674f0b
EZ
108202011-09-18 Eli Zaretskii <eliz@gnu.org>
10821
10822 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10823
fbfb6dd4
EZ
108242011-09-17 Eli Zaretskii <eliz@gnu.org>
10825
10826 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10827 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10828
bb187662
EZ
108292011-09-17 Eli Zaretskii <eliz@gnu.org>
10830
1137e8b8 10831 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 10832 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
10833
10834 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10835 (bidi_find_paragraph_start): Search back for paragraph beginning
10836 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10837 (bidi_move_to_visually_next): Only trigger paragraph-related
10838 computations when the last character is a newline or at EOB, not
10839 just any NEUTRAL_B. (Bug#9470)
10840
bb187662
EZ
10841 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10842 truncated lines if point is covered by a display string. (Bug#9524)
10843
2e621251
PE
108442011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10845
10846 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10847 (cons_to_x_long): New function.
10848 (lisp_data_to_selection_data): Use it. Correct the test for
10849 short-versus-long data; it was negated. Break out of vector
10850 loop, for efficiency, when a long datum is discovered.
10851
91a15bc6
SM
108522011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10853
10854 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10855
b41c3a35
EZ
108562011-09-16 Eli Zaretskii <eliz@gnu.org>
10857
10858 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10859 GCC PR/17406) by declaring this function with external scope.
10860
7812ba2d
PE
108612011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10862
10863 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10864 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10865
cf7edc2a
AS
108662011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10867
10868 * editfns.c (Fformat): Correctly handle text properties on "%%".
10869
bd01620e
EZ
108702011-09-15 Eli Zaretskii <eliz@gnu.org>
10871
10872 * xterm.c (x_draw_composite_glyph_string_foreground):
10873 * w32term.c (x_draw_composite_glyph_string_foreground):
10874 * term.c (encode_terminal_code):
10875 * composite.c (composition_update_it, get_composition_id):
10876 * xdisp.c (get_next_display_element)
10877 (fill_composite_glyph_string): Add comments about special meaning
10878 of TAB characters in a composition.
10879
a02719a3
PE
108802011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10881
10882 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
10883 This occurs when processing a multibyte format.
10884 Problem reported by Wolfgang Jenker.
a02719a3 10885
72589a3c
JB
108862011-09-15 Johan Bockgård <bojohan@gnu.org>
10887
10888 * xdisp.c (try_cursor_movement): Only check for exact match if
10889 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10890
1c14176c
PE
108912011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10892
10893 Remove unused external symbols.
10894 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10895 * xdisp.c (calc_pixel_width_or_height): Now static.
10896 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10897 * indent.c (check_display_width):
10898 * w32term.c: Fix comment to match code.
10899 * xterm.c, xterm.h (x_catching_errors): Remove.
10900
d2eea5b5
PE
109012011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10902
10903 * xselect.c: Use signed conversions more consistently (Bug#9498).
10904 (selection_data_to_lisp_data): Assume incoming selection data are
10905 signed integers, not unsigned. This is to be consistent with
10906 outgoing selection data, which was modified to use signed integers
10907 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10908 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10909 expects long, not unsigned long.
10910
46888499
EZ
109112011-09-14 Eli Zaretskii <eliz@gnu.org>
10912
10913 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10914 computation of loop end. Reported by Johan Bockgård
10915 <bojohan@gnu.org>.
10916
ef8ef9fb
CY
109172011-09-13 Chong Yidong <cyd@stupidchicken.com>
10918
10919 * frame.c (Fother_visible_frames_p): Function deleted.
10920
fa819fed
EZ
109212011-09-12 Eli Zaretskii <eliz@gnu.org>
10922
10923 * indent.c (compute_motion): Process display vector front to back
10924 rather than the other way around. (Bug#2496)
10925
2ba8e008
SM
109262011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10927
10928 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10929
20f53c69
CY
109302011-09-11 Chong Yidong <cyd@stupidchicken.com>
10931
10932 * minibuf.c (Fread_from_minibuffer): Doc fix.
10933
d562d7a4
EZ
109342011-09-11 Eli Zaretskii <eliz@gnu.org>
10935
10936 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10937 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10938
1c4d7f3d
LMI
109392011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10940
10941 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10942 value for non-existent files.
10943
b885bf36
EZ
109442011-09-11 Eli Zaretskii <eliz@gnu.org>
10945
10946 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10947 set its "size" to -1. This will set the modtime_size field of
10948 the corresponding buffer to -1, which is what
10949 verify-visited-file-modtime expects for files that do not exist.
10950 (Bug#9139)
10951
6612f0bf
PE
109522011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10953
10954 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10955 here ...
10956 * lisp.h: ... from here. push_key_description is no longer
10957 defined in keyboard.c, so its declaration should not be in
10958 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10959 logically belongs with push_key_description.
10960
dfb3f755
PE
109612011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10962
10963 * buffer.h: Include <sys/types.h> instead of <time.h>.
10964 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10965 Problem reported by Herbert J. Skuhra.
10966
3134906c
LMI
109672011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10968
10969 * xml.c (parse_region): Make the parsing work for
10970 non-comment-starting XML files again (bug#9144).
10971
8d903f4e
AS
109722011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10973
10974 * image.c (gif_load): Fix calculation of bottom and right corner.
10975 (Bug#9468)
10976
80ad64f4
EZ
109772011-09-10 Eli Zaretskii <eliz@gnu.org>
10978
10979 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10980 redisplay in small windows.
10981
208a048d
EZ
109822011-09-09 Eli Zaretskii <eliz@gnu.org>
10983
10984 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10985
9b1c252e
MR
109862011-09-08 Martin Rudalics <rudalics@gmx.at>
10987
10988 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10989 Operate on live windows only.
10990
2949f33b
JB
109912011-09-08 Juanma Barranquero <lekktu@gmail.com>
10992
10993 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10994
e08dcafd
EZ
109952011-09-07 Eli Zaretskii <eliz@gnu.org>
10996
10997 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10998 only under bidi iteration.
10999
115b96bd
JD
110002011-09-07 Jan Djärv <jan.h.d@swipnet.se>
11001
11002 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11003
c8199d0f
PE
110042011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11005
11006 isnan: Fix porting problem to Solaris 10 with bundled gcc.
11007 Without this fix, the command to link temacs failed due to an
11008 undefined symbol __builtin_isnan. This is because
11009 /usr/include/iso/math_c99.h #defines isnan(x) to
11010 __builtin_isnan(x), but the bundled gcc, which identifies itself
11011 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11012 a __builtin_isnan.
11013 * floatfns.c (isnan): #undef, and then #define to a clone of
11014 what's in data.c.
11015 (Fisnan): Always define, since it's always available now.
11016 (syms_of_floatfns): Always define isnan at the Lisp level.
11017
e39b275c 110182011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
11019
11020 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11021
b2db44d9 110222011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 11023
f4af5137 11024 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
11025 The previous code assumed that file offsets (off_t values) fit in
11026 EMACS_INT variables, which is not true on typical 32-bit hosts.
11027 The code messed up by falsely reporting buffer overflow in cases
11028 such as (insert-file-contents "big" nil 1 2) into an empty buffer
11029 when "big" contains more than 2**29 bytes, even though this
11030 inserts just one byte and does not overflow the buffer.
11031 (Finsert_file_contents): Store file offsets as off_t
11032 values, not as EMACS_INT values. Check for overflow when
11033 converting between EMACS_INT and off_t. When checking for
11034 buffer overflow or for overlap, take the offsets into account.
11035 Don't use EMACS_INT for small values where int suffices.
11036 When checking for overlap, fix a typo: ZV was used where
11037 ZV_BYTE was intended.
11038 (Fwrite_region): Don't assume off_t fits into 'long'.
11039 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
11040
ecfc0a49
MA
110412011-09-05 Michael Albinus <michael.albinus@gmx.de>
11042
11043 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
11044
6511acf2 110452011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 11046
0999621a 11047 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
11048
11049 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 11050 (esprintf, exprintf, evxprintf): New functions.
62f19c19 11051 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 11052 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
11053 (modify_event_symbol): Do not assume that the length of
11054 name_alist_or_stem is safe to alloca and fits in int.
11055 (Fexecute_extended_command): Likewise for function name and binding.
11056 (Frecursion_depth): Wrap around reliably on integer overflow.
11057 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11058 since some callers pass EMACS_INT values.
11059 (Fsingle_key_description): Don't crash if symbol name contains more
11060 than MAX_ALLOCA bytes.
11061 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11062 (get_minibuffer): Arg is now EMACS_INT, not int.
11063 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 11064 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
11065 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11066
2be7d702
PE
11067 * dbusbind.c (signature_cat): New function.
11068 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
11069 Do not overrun buffer; instead, report string overflow.
11070
9d1df220
PE
11071 * dispnew.c (add_window_display_history): Don't overrun buffer.
11072 Truncate instead; this is OK since it's just a log.
11073
33ef5c64
PE
11074 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11075 even if the time zone offset is outlandishly large.
11076 Don't mishandle offset == INT_MIN.
11077
66c6fdd5
PE
11078 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11079 when creating daemon; the previous buffer-overflow check was incorrect.
11080
d749b01b
PE
11081 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11082 which has the guts of the old verror function.
11083
b5cd1905
PE
11084 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11085 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11086
6e1a67fb
PE
11087 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11088 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 11089 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 11090 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
11091 length of string rather than counting it via multiple sprintfs;
11092 that's simpler and more reliable.
c21721cc
PE
11093 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11094 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11095 sprintf, in case result does not fit in int.
11096
c57b67fc
PE
11097 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11098 (fontset_from_font): Print it.
11099
8a401434
PE
11100 * frame.c (tty_frame_count): Now printmax_t, not int.
11101 (make_terminal_frame, set_term_frame_name): Print it.
11102 (x_report_frame_params): In X, window IDs are unsigned long,
11103 not signed long, so print them as unsigned.
11104 (validate_x_resource_name): Check for implausibly long names,
11105 and don't assume name length fits in 'int'.
11106 (x_get_resource_string): Don't blindly alloca invocation name;
11107 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
11108 not fit in int.
11109
6e1a67fb
PE
11110 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11111 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
11112 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11113
0df02bf3
PE
11114 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11115 Use esprintf, not sprintf, in case result does not fit in int.
11116
48e30793
PE
11117 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11118 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11119 it as a large positive number.
11120 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
11121 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11122
a66ff6d8
PE
11123 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
11124 in case result does not fit in int.
11125
aca216ff
PE
11126 * print.c (float_to_string): Detect width overflow more reliably.
11127 (print_object): Make sprintf buffer a bit bigger, to avoid potential
11128 buffer overrun. Don't assume list length fits in 'int'. Treat
11129 print length of 0 as 0, not as infinity; to be consistent with other
11130 uses of print length in this function. Don't overflow print length
11131 index. Don't assume hash table size fits in 'long', or that
11132 vectorlike size fits in 'unsigned long'.
11133
31c286f7
PE
11134 * process.c (make_process): Use printmax_t, not int, to format
11135 process-name gensyms.
11136
55e5faa1
PE
11137 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
11138
80f2e268
PE
11139 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
11140 to avoid potential buffer overrun.
11141
670741ab
PE
11142 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
11143 if X resource line is longer than 512 bytes.
11144
b7163a50
PE
11145 * xfns.c (x_window): Make sprintf buffer a bit bigger
11146 to avoid potential buffer overrun.
11147
ae58ff1f
PE
11148 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
11149
c43c8a6a
PE
11150 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
11151
3f8236f4
PE
111522011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11153
53e9fe90 11154 Integer overflow fixes for scrolling, etc.
6511acf2
PE
11155 Without these, Emacs silently mishandles large integers sometimes.
11156 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
11157 it were "C-u 1 M-x recenter" on a typical 64-bit host.
11158
6511acf2
PE
11159 * xdisp.c (try_window_id): Check Emacs fixnum range before
11160 converting to 'int'.
806add1d 11161
6511acf2 11162 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
11163 Check that an Emacs fixnum is in range before assigning it to 'int'.
11164 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
11165 values converted from Emacs fixnums.
11166 (Frecenter): Don't wrap around a line count if it is out of 'int'
11167 range; instead, treat it as an extreme value.
11168 (Fset_window_configuration, compare_window_configurations):
11169 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
11170
6511acf2
PE
11171 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
11172 that can exceed INT_MAX. Check that EMACS_INT value is in range
11173 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
11174 (match_limit): Don't assume that a fixnum can fit in 'int'.
11175
6511acf2 11176 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
11177 exceed INT_MAX.
11178
6511acf2 11179 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
11180 (Fvertical_motion): Don't wrap around LINES values that don't fit
11181 in 'int'. Instead, treat them as extreme values. This is good
11182 enough for windows, which can't have more than INT_MAX lines anyway.
11183
fcb901a7
LMI
111842011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11185
0f2f6b6d
LMI
11186 * Require libxml/parser.h to avoid compilation warning.
11187
fcb901a7
LMI
11188 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11189
11190 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11191 since this reportedly can destroy thread storage.
11192
6e20a0d4
CY
111932011-08-30 Chong Yidong <cyd@stupidchicken.com>
11194
11195 * syntax.c (find_defun_start): Update all cache variables if
11196 exiting early (Bug#9401).
11197
148ae00e
EZ
111982011-08-30 Eli Zaretskii <eliz@gnu.org>
11199
f6cfbd8f
EZ
11200 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11201
148ae00e
EZ
11202 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11203 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
11204 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
11205
11206 * term.c (tty_append_glyph): New function.
11207 (produce_stretch_glyph): Static function and its prototype deleted.
11208
a66cfb1c
SM
11209 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11210 Add prototypes.
148ae00e 11211
c4a07a4c
PE
112122011-08-29 Paul Eggert <eggert@cs.ucla.edu>
11213
11214 * image.c (parse_image_spec): Check for nonnegative, not for positive,
11215 when checking :margin (Bug#9390).
11216 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 11217 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
11218 so that the name doesn't mislead. All uses changed.
11219
6bc8cd65
JB
112202011-08-28 Johan Bockgård <bojohan@gnu.org>
11221
11222 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11223 set_tty_hooks.
11224
dca4927e
EZ
112252011-08-27 Eli Zaretskii <eliz@gnu.org>
11226
11227 * xdisp.c (move_it_to): Don't bail out early when reaching
11228 position beyond to_charpos, if we are scanning backwards.
11229 (move_it_vertically_backward): When DY == 0, make sure we get to
11230 the first character in the line after the newline.
11231
f2cad773
PE
112322011-08-27 Paul Eggert <eggert@cs.ucla.edu>
11233
11234 * ccl.c: Improve and simplify overflow checking (Bug#9196).
11235 (ccl_driver): Do not generate an out-of-range pointer.
11236 (Fccl_execute_on_string): Remove unnecessary check for
11237 integer overflow, noted by Stefan Monnier in
11238 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11239 Remove a FIXME that didn't need fixing.
11240 Simplify the newly-introduced buffer reallocation code.
11241
0cae2cdb
JB
112422011-08-27 Juanma Barranquero <lekktu@gmail.com>
11243
11244 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11245
5fc295a4 112462011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 11247
70c60eb2 11248 Integer and memory overflow issues (Bug#9196).
726e0ab1 11249
d31850da
PE
11250 * doc.c (get_doc_string): Rework so that
11251 get_doc_string_buffer_size is the actual buffer size, rather than
11252 being 1 less than the actual buffer size; this makes xpalloc more
11253 convenient.
11254
a69fbedb
PE
11255 * image.c (x_allocate_bitmap_record, cache_image):
11256 * xselect.c (Fx_register_dnd_atom):
11257 Simplify previous changes by using xpalloc.
11258
fe5c5d37
PE
11259 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11260 since either will do and ptrdiff_t is convenient with xpalloc.
11261
0065d054
PE
11262 * charset.c (charset_table_size)
11263 (struct charset_sort_data.priority): Now ptrdiff_t.
11264 (charset_compare): Don't overflow if priorities differ greatly.
11265 (Fsort_charsets): Don't assume list length fits in int.
11266 Check for size-calculation overflow when allocating sort data.
11267 (syms_of_charset): Allocate an initial charset table that is
11268 just under 64 KiB, to avoid problems with glibc malloc and mmap.
11269
11270 * cmds.c (internal_self_insert): Check for size-calculation overflow.
11271
11272 * composite.h (struct composition.glyph_len): Now int, not unsigned.
11273 The actual value is always <= INT_MAX, and leaving it unsigned made
11274 overflow checking harder.
11275
11276 * dispextern.h (struct glyph_matrix.rows_allocated)
11277 (struct face_cache.size): Now ptrdiff_t, for convenience in use
11278 with xpalloc. The values are still always <= INT_MAX.
11279
11280 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
11281
11282 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
11283 (SAFE_NALLOCA): New macro.
11284
11285 * region-cache.c (struct boundary.pos, find_cache_boundary)
11286 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
11287 (set_cache_region, invalidate_region_cache)
11288 (revalidate_region_cache, know_region_cache, region_cache_forward)
11289 (region_cache_backward, pp_cache):
11290 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
11291 so that ptrdiff_t * can be passed to xpalloc.
11292 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
11293 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
11294 (pp_cache): Don't assume cache_len fits in int.
11295 * region-cache.h: Adjust extern decls to match.
11296
11297 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
11298 EMACS_INT, since either will do, for xpalloc.
11299
11300 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
11301 (xnmalloc, xnrealloc, xpalloc): New functions.
11302
726e0ab1
PE
11303 * bidi.c (bidi_shelve_header_size): New constant.
11304 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11305 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11306
51f30bc5 11307 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
11308 * buffer.c (overlays_at, overlays_in, record_overlay_string)
11309 (overlay_strings):
11310 Don't update size of array until after memory allocation succeeds,
11311 because xmalloc/xrealloc may not return.
0065d054
PE
11312 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11313 now that we have proper integer overflow checking.
11314 (record_overlay_string, overlay_strings): Catch overflows when
11315 calculating size of overlay_str_buf.
726e0ab1 11316
0065d054
PE
11317 * callproc.c (Fcall_process): Check for size overflow when
11318 calculating size of args2.
11319 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11320 Normally we prefer signed values, but sticking with ptrdiff_t would
11321 require adding more-complicated checks.
726e0ab1
PE
11322
11323 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11324 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11325 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 11326 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
11327
11328 * character.c (Fstring): Check for size-calculation overflow.
11329
11330 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11331 unnecessary integer overflow. Check for size overflow.
11332 (encode_coding_object): Don't update size until xmalloc succeeds.
11333
11334 * composite.c (get_composition_id): Check for overflow in glyph
11335 length calculations.
11336
11337 Integer and memory overflow fixes for display code.
11338 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11339 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11340 (scrolling_window): Check for overflow in size calculations.
11341 (line_draw_cost, realloc_glyph_pool, add_row_entry):
11342 Don't assume glyph table len fits in int.
11343 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11344 (row_table_size): Now ptrdiff_t, not int.
11345 (scrolling_window): Avoid overflow in size calculations.
11346 Don't update size until allocation succeeds.
11347 * fns.c (concat): Check for overflow in size calculations.
11348 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11349 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11350 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11351
11352 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11353 (get_doc_string): Check for size calculation overflow.
11354 Don't update size until allocation succeeds.
11355 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11356 EMACS_INT, where ptrdiff_t will do.
11357 (Fsubstitute_command_keys): Check for string overflow.
11358
11359 * editfns.c (set_time_zone_rule): Don't assume environment length
11360 fits in int.
11361 (message_length): Now ptrdiff_t, not int.
11362 (Fmessage_box): Don't update size until allocation succeeds.
11363 Don't assume message length fits in int.
11364 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11365
0065d054
PE
11366 * emacs.c (main): Do not reallocate argv, since there is a null at
11367 the end that can be overwritten, and this way there's no need to
11368 worry about size-calculation overflow.
11369 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
11370
11371 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11372 alloc succeeds.
11373 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11374
11375 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11376 (x_set_scroll_bar_width, x_figure_window_size):
11377 Check for integer overflow.
11378 (x_set_alpha): Do not assume XINT fits in int.
11379
11380 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11381 This is for the members text_lines, text_cols, total_lines, total_cols,
11382 where the system imposes an 'int' limit.
11383
11384 * fringe.c (Fdefine_fringe_bitmap):
11385 Don't update size until alloc works.
11386
11387 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11388 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11389
11390 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11391 Check for size-calculation overflow.
11392 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11393 do, as we prefer signed integers.
11394 (id_to_widget.max_size, id_to_widget.used)
11395 (xg_store_widget_in_map, xg_remove_widget_from_map)
11396 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11397 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11398 Use and return ptrdiff_t, not int.
11399 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11400 * gtkutil.h: Change prototypes to match the above.
11401
11402 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11403 are duplicate now that they've been promoted to lisp.h.
11404 (x_allocate_bitmap_record, x_alloc_image_color)
11405 (make_image_cache, cache_image, xpm_load):
11406 Don't update size until alloc is done.
11407 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11408 (x_detect_edges):
3256efce 11409 Check for size calculation overflow.
726e0ab1
PE
11410 (ct_colors_allocated_max): New constant.
11411 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11412 overflow.
3256efce 11413
726e0ab1
PE
11414 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11415 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11416 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11417 Use ptrdiff_t, not int, to count maps.
11418 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
11419 calculations. Don't update size until allocation succeeds.
11420 Redo calculations to avoid overflow.
726e0ab1
PE
11421 * keyboard.h: Change prototypes to match the above.
11422
11423 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11424 to count maps.
11425 (current_minor_maps): Check for size calculation overflow.
11426 * keymap.h: Change prototypes to match the above.
11427
11428 * lread.c (read1, init_obarray): Don't update size until alloc done.
11429
11430 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11431 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11432
726e0ab1
PE
11433 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11434 Now ptrdiff_t, not int.
11435 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11436 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11437
11438 * process.c (Fnetwork_interface_list): Check for overflow
11439 in size calculation.
11440
11441 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11442
11443 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11444 overflow. Don't bother calling xmalloc when xrealloc will do.
11445
11446 * search.c (Freplace_match): Check for size calculation overflow.
11447 (Fset_match_data): Don't assume list lengths fit in 'int'.
11448
11449 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11450 for command line length. Do not attempt to address one before the
11451 beginning of an array, as that's not portable.
11452
11453 * term.c (max_frame_lines): Remove; unused.
11454 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11455 not int.
11456 (encode_terminal_code, calculate_costs): Check for size
11457 calculation overflow.
11458 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11459 table lengths and related sizes. Don't update size until alloc
11460 done. Redo calculations to avoid overflow.
11461 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11462
11463 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11464 subtracting pointers.
11465 (gobble_line): Check for overflow more carefully. Don't update size
11466 until alloc done.
11467
11468 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11469 Don't update size until alloc done.
11470 Redo size calculations to avoid overflow.
11471 Check for size calculation overflow.
0065d054 11472 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
11473
11474 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11475 Use ptrdiff_t, not int, for sizes.
11476 (store_mode_line_noprop_char): Don't update size until alloc done.
11477
0065d054
PE
11478 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11479 Use ptrdiff_t, not int, for sizes.
11480 (Finternal_make_lisp_face, cache_face):
11481 Check for size calculation overflow.
11482 (cache_face): Treat size calculation overflows as if they were
11483 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
11484
11485 * xfns.c (x_encode_text, x_set_name_internal)
11486 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11487 sizes, since they can exceed INT_MAX in size. Check for size
11488 calculation overflow.
11489
0065d054
PE
11490 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11491 (xg_select): Check for size calculation overflow.
726e0ab1
PE
11492 Don't update size until alloc done.
11493
0065d054 11494 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 11495 as sprintf is limited to int lengths.
1d526e2f 11496
252c5ee1
PE
11497 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11498 (X_LONG_MIN): New macros.
864d7ce7
PE
11499 Use them to make the following changes clearer.
11500 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11501 This change doesn't affect the value now, but it may help remind
11502 future maintainers not to raise the value too much later.
11503 (SELECTION_QUANTUM): Remove, replacing with ...
11504 (selection_quantum): ... new function, which avoids overflow.
11505 All uses changed.
11506 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11507 assumption that selection length fits in 'int'.
11508 (x_reply_selection_request, x_handle_selection_request)
11509 (x_get_window_property, receive_incremental_selection)
11510 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11511 (lisp_data_to_selection_data, clean_local_selection_data):
11512 Use ptrdiff_t, not int, to record length of selection.
11513 (x_reply_selection_request, x_get_window_property)
11514 (receive_incremental_selection, x_property_data_to_lisp):
11515 Redo calculations to avoid overflow.
11516 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 11517 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
11518 something.
11519 (x_get_window_property, receive_incremental_selection)
11520 (lisp_data_to_selection_data, x_property_data_to_lisp):
11521 Check for size-calculation overflow.
11522 (x_get_window_property, receive_incremental_selection)
11523 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11524 Don't store size until memory allocation succeeds.
11525 (x_get_window_property): Plug memory leak on memory exhaustion.
11526 Don't double-block input; malloc is safe here. Don't assume 2**34
11527 - 4 fits in unsigned long. Add an xassert to check
11528 XGetWindowProperty overflow. Be more careful about overflow
11529 calculations, and distinguish size from memory overflow better.
11530 (receive_incremental_selection): When tracing, don't assume
11531 unsigned int is less than INT_MAX.
11532 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11533 harmful) conversions of unsigned short to int.
11534 (lisp_data_to_selection_data): Don't assume that integers
11535 in the range -65535 through -1 fit in an X unsigned short.
11536 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11537 result parameters unless successful. Rely on cons_to_unsigned
11538 to report problems with elements; the old code wasn't right anyway.
11539 (x_check_property_data): Check for int overflow; we cannot use
11540 a wider type due to X limits.
11541 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11542
726e0ab1 11543 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 11544
0065d054
PE
11545 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11546 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
11547 (x_color_cells): Don't store size until memory allocation succeeds.
11548 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 11549 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
11550 (x_term_init): Don't assume length fits in int (sprintf is limited
11551 to int size).
bc18e09d 11552
ebfa62c0
PE
11553 Use ptrdiff_t for composition IDs.
11554 * character.c (lisp_string_width):
11555 * composite.c (composition_table_size, n_compositions)
11556 (get_composition_id, composition_gstring_from_id):
11557 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11558 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11559 * window.c (Frecenter):
11560 Use ptrdiff_t, not int, for composition IDs.
11561 * composite.c (get_composition_id): Check for integer overflow.
11562 * composite.h: Adjust prototypes to match the above changes.
11563
d3411f89
PE
11564 Use ptrdiff_t for hash table indexes.
11565 * category.c (hash_get_category_set):
11566 * ccl.c (ccl_driver):
11567 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11568 * coding.c (coding_system_charset_list, detect_coding_system):
11569 * coding.h (struct coding_system.id):
11570 * composite.c (get_composition_id, gstring_lookup_cache):
11571 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11572 * image.c (xpm_get_color_table_h):
11573 * lisp.h (hash_lookup, hash_put):
11574 * minibuf.c (Ftest_completion):
11575 Use ptrdiff_t for hash table indexes, not int (which is too
11576 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11577 32-bit --with-wide-int hosts).
11578
e097a6fa
PE
11579 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11580 Add a FIXME comment about memory leaks.
11581 (syms_of_charset): Don't assume xmalloc returns.
11582
5637687f
PE
11583 Don't assume that stated character widths fit in int.
11584 * character.c (Fchar_width, c_string_width, lisp_string_width):
11585 * character.h (CHAR_WIDTH):
11586 * indent.c (MULTIBYTE_BYTES_WIDTH):
11587 Use sanitize_char_width to avoid undefined and/or bad behavior
11588 with outlandish widths.
a66cfb1c 11589 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
11590 now that we have two such functions. All uses changed.
11591 (sanitize_char_width): New inline function.
11592
a2271ba2
PE
11593 Don't assume that tab-width fits in int.
11594 * character.h (sanitize_width): New inline function.
11595 (SANE_TAB_WIDTH): New macro.
11596 (ASCII_CHAR_WIDTH): Use it.
11597 * indent.c (sane_tab_width): Remove. All uses replaced by
11598 SANE_TAB_WIDTH (current_buffer).
11599 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11600
18c52557
PE
11601 * fileio.c: Integer overflow issues with file modes.
11602 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11603
caeeedc1
PE
11604 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11605 Remove unreachable code.
11606 (read_hex, load_charset_map_from_file): Check for integer overflow.
11607
6df6ae42 11608 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
11609 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11610 (x_send_scroll_bar_event): Likewise. Check that the size does not
11611 exceed limits imposed by XClientMessageEvent, as well as the usual
11612 ptrdiff_t and size_t limits.
11613
b13995db
PE
11614 * keyboard.c: Overflow, signedness and related fixes.
11615 (make_lispy_movement): Use same integer type in forward decl
11616 that is used in the definition.
11617 (read_key_sequence, keyremap_step):
11618 Change bufsize argument back to int, undoing my 2011-03-30 change.
11619 We prefer signed types, and int is wide enough here.
11620 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11621 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11622 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11623 length, not size_t. Use ptrdiff_t for index, not int.
11624 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11625 possibility of integer overflow.
11626
13464394
PE
11627 Overflow, signedness and related fixes for images.
11628
11629 * dispextern.h (struct it.stack[0].u.image.image_id)
11630 (struct_it.image_id, struct image.id, struct image_cache.size)
11631 (struct image_cache.used, struct image_cache.ref_count):
11632 * gtkutil.c (update_frame_tool_bar):
11633 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11634 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11635 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11636 * nsmenu.m (update_frame_tool_bar):
11637 * xdisp.c (calc_pixel_width_or_height):
11638 * xfns.c (image_cache_refcount):
11639 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11640 on typical 64-bit hosts.
11641
11642 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11643 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11644 Omit unnecessary casts to int.
11645 (parse_image_spec): Check that integers fall into 'int' range
11646 when the callers expect that.
11647 (image_ascent): Redo ascent calculation to avoid int overflow.
11648 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11649 (lookup_image): Remove unnecessary tests.
11650 (xbm_image_p): Locals are now of int, not EMACS_INT,
11651 since parse_image_check makes sure they fit into int.
11652 (png_load, gif_load, svg_load_image):
11653 Prefer int to unsigned where either will do.
11654 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
11655 old tiff_error_handler and tiff_warning_handler.
11656 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
11657 stack buffer overflows. It uses only the features of vsnprintf
11658 that are common to both POSIX and native Microsoft.
11659 (tiff_error_handler, tiff_warning_handler): Use it.
11660 (tiff_load, gif_load, imagemagick_load_image):
11661 Don't assume :index value fits in 'int'.
11662 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11663 (imagemagick_load_image): Check that crop parameters fit into
11664 the integer types that MagickCropImage accepts. Don't assume
11665 Vimagemagick_render_type has a nonnegative value. Don't assume
11666 size_t fits in 'long'.
11667 (gs_load): Use printmax_t to print the widest integers possible.
11668 Check for integer overflow when computing image height and width.
11669
c11821d4
EZ
116702011-08-26 Eli Zaretskii <eliz@gnu.org>
11671
11672 * xdisp.c (redisplay_window): Don't force window start if point
11673 will be invisible in the resulting window. (Bug#9324)
11674
0c95fcf7
EZ
116752011-08-25 Eli Zaretskii <eliz@gnu.org>
11676
11677 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11678 the display spec is of the form `(space ...)'.
11679 (handle_display_spec): Return the value returned by
11680 handle_single_display_spec, not just 1 or zero.
11681 (handle_single_display_spec): If the display spec is of the form
11682 `(space ...)', and specifies display in the text area, return 2
11683 rather than 1.
fee65a97 11684 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
11685 accurately, and prefer exact match for point under bidi.
11686 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
11687
11688 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11689 into disp_prop; all users changed.
11690
11691 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11692 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11693 for the text covered by the display property.
11694
e4ed06f1
CY
116952011-08-25 Chong Yidong <cyd@stupidchicken.com>
11696
11697 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11698 Change return value to nil.
11699 (Frecord_buffer): Delete unused function.
11700
f67cdd7f
EZ
117012011-08-24 Eli Zaretskii <eliz@gnu.org>
11702
5980d4c6
EZ
11703 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11704 buffers, return left-to-right.
8610fe8b
EZ
11705 (set_cursor_from_row): Consider candidate row a win if its glyph
11706 represents a newline and point is on that newline. Fixes cursor
11707 positioning on the newline at EOL of R2L text within L2R
11708 paragraph, and vice versa.
11709 (try_cursor_movement): Check continued rows, in addition to
11710 continuation rows. Fixes unwarranted scroll when point enters a
11711 continued line of R2L text within an L2R paragraph, or vice versa.
11712 (cursor_row_p): Consider the case of point being equal to
11713 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11714 from the end of a short line to the beginning of a continued line
11715 of R2L text within L2R paragraph.
11716 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11717 composed characters.
5980d4c6 11718
f67cdd7f
EZ
11719 * bidi.c (bidi_check_type): Use xassert.
11720 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11721 members.
11722
bca633fb
EZ
117232011-08-23 Eli Zaretskii <eliz@gnu.org>
11724
11725 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11726 a character.
11727
4a5885a7
CY
117282011-08-23 Chong Yidong <cyd@stupidchicken.com>
11729
11730 * nsfont.m (ns_otf_to_script): Fix typo.
11731
0902a04e
KH
117322011-08-22 Kenichi Handa <handa@m17n.org>
11733
11734 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11735 extra slot even if the purpose is char-code-property-table.
11736
1a2e6670
EZ
117372011-08-23 Eli Zaretskii <eliz@gnu.org>
11738
8ddde651
EZ
11739 * xdisp.c (redisplay_window): When computing centering_position,
11740 account for the height of the header line. (Bug#8874)
11741
425cc014
EZ
11742 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11743 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11744 candidate is selected by the mouse, and that candidate has a
11745 composed character under the mouse.
11746
1a2e6670
EZ
11747 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11748 coordinates reported by pos-visible-in-window-p for a composed
11749 character in column zero.
11750
8b76d6f8
SM
117512011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11752
11753 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11754
dac347dd
EZ
117552011-08-22 Eli Zaretskii <eliz@gnu.org>
11756
11757 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11758 consider it a hit if to_charpos is anywhere in the range of the
11759 composed buffer positions.
11760
e013fb34
CY
117612011-08-22 Chong Yidong <cyd@stupidchicken.com>
11762
11763 * image.c (gif_load): Don't assume that each subimage has the same
11764 dimensions as the base image. Handle disposal method that is
11765 "undefined" by the gif spec (Bug#9335).
11766
bd1ba3e8
CY
117672011-08-20 Chong Yidong <cyd@stupidchicken.com>
11768
11769 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 11770 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 11771
54a1215b
EZ
117722011-08-19 Eli Zaretskii <eliz@gnu.org>
11773
823564e5
EZ
11774 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11775 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11776 from an Org mode buffer to a Speedbar frame.
11777
54a1215b
EZ
11778 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11779 a composition, take its buffer position from IT->cmp_it.charpos.
11780 Fixes cursor positioning at the beginning of a line that begins
11781 with a composed character.
11782
9778ebcc
EZ
117832011-08-18 Eli Zaretskii <eliz@gnu.org>
11784
0be6ee06
EZ
11785 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11786 character bidirectional type, use STRONG_L instead. Fixes crashes
11787 in a buffer produced by `describe-categories'.
11788
9778ebcc
EZ
11789 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11790 members before the level stack, so they would be saved and
11791 restored when copying iterator state. Fixes incorrect reordering
11792 around TABs covered by display properties.
11793
156bffbe
AS
117942011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11795
6b02f655 11796 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 11797
72ad093b
CY
117982011-08-17 Chong Yidong <cyd@stupidchicken.com>
11799
11800 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
11801 (internal_condition_case_2, internal_condition_case_n):
11802 Remove unnecessary aborts (Bug#9081).
72ad093b 11803
35774242
EZ
118042011-08-17 Eli Zaretskii <eliz@gnu.org>
11805
11806 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11807 has no `load' handler, try opening the file locally. (Bug#9311)
11808
db76dd85
KB
118092011-08-16 Ken Brown <kbrown@cornell.edu>
11810
11811 * gmalloc.c: Expand comment.
11812
b215eee5
EZ
118132011-08-16 Eli Zaretskii <eliz@gnu.org>
11814
11815 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11816 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11817
a4579d33
KB
118182011-08-16 Ken Brown <kbrown@cornell.edu>
11819
11820 Fix memory allocation problems in Cygwin build (Bug#9273).
11821
11822 * unexcw.c ( __malloc_initialized): Declare external variable.
11823 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11824
8b76d6f8
SM
11825 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11826 New variables.
a4579d33
KB
11827 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11828 dumped emacs.
11829 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11830 in the static heap.
11831 [CYGWIN] (special_realloc): New function.
11832 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11833 requests to realloc storage in the static heap.
11834
3ebec551
PE
118352011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11836
11837 * bidi.c (bidi_initialize): Remove unused local.
11838
9fd8be00
EZ
118392011-08-15 Eli Zaretskii <eliz@gnu.org>
11840
6b02f655
SM
11841 * bidimirror.h:
11842 * biditype.h: Remove file.
11843 * makefile.w32-in ($(BLD)/bidi.$(O)):
11844 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
11845
11846 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11847
11848 * chartab.c: Improve commentary for the uniprop_table API.
11849
32413314
EZ
11850 * bidi.c (bidi_paragraph_init): Support zero value of
11851 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
11852 (bidi_initialize): Use uniprop_table instead of including
11853 biditype.h and bidimirror.h.
32413314 11854
9fd8be00
EZ
11855 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11856 coordinates of the iterator when restoring from ppos_it.
11857 (Bug#9296)
11858
5cf2b69b
KH
118592011-08-14 Kenichi Handa <handa@m17n.org>
11860
11861 * process.c (create_process): Call setup_process_coding_systems
72ad093b 11862 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 11863
daf17d00
EZ
118642011-08-14 Eli Zaretskii <eliz@gnu.org>
11865
11866 * xdisp.c (move_it_in_display_line_to): Don't invoke
11867 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11868 ppos_it. Fixes vertical cursor motion when line beginning is
11869 covered by an image. (Bug#9296)
11870
08e3161a
JD
118712011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11872
11873 * nsterm.h (ns_run_ascript): Declare.
11874 (NSAPP_DATA2_RUNASSCRIPT): Define.
11875
11876 * nsfns.m (as_script, as_result, as_status): New static variables.
11877 (ns_run_ascript): New function.
5e617bc2 11878 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
11879 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11880 the event loop. Get status from as_status (Bug#7276).
11881
11882 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11883 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11884 the event loop (Bug#7276).
11885
a3720aa2
AS
118862011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11887
11888 * gnutls.c (QCgnutls_bootprop_priority)
11889 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11890 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11891 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11892 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11893 (QCgnutls_bootprop_verify_hostname_error)
11894 (QCgnutls_bootprop_callbacks_verify): Rename from
11895 Qgnutls_bootprop_..., all uses changed.
11896
11897 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11898 uses changed.
11899
0a0d27fb
PE
119002011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11901
19d5c50c
PE
11902 * xfaces.c (Qframe_set_background_mode): Now static.
11903 * dispextern.h (Qframe_set_background_mode): Remove decl.
11904
0a0d27fb
PE
11905 * process.c (Fnetwork_interface_info): Declare local only if needed.
11906
377538cb
JD
119072011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11908
11909 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11910 (Fnetwork_interface_list): Allocate in increments of bytes instead
11911 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11912 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11913 sockaddr.
11914 (struct ifflag_def): notrailers is smart on OSX.
11915 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11916 Get hardware address with getifaddrs if available.
11917
08fff70c
EZ
119182011-08-12 Eli Zaretskii <eliz@gnu.org>
11919
11920 * xdisp.c (iterate_out_of_display_property): xassert that
11921 IT->position is set to within IT->object's boundaries. Break from
11922 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
11923 when IT->position is set up wrongly due to some bug.
11924 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
11925 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11926 entry. Force push_it to save on the stack the current
11927 buffer/string position, to be restored by pop_it. Fix flags in
11928 the iterator structure wrt the object coming from a display
11929 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11930 properties. (Bug#9284)
11931
7be1c708 119322011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 11933
7be1c708
CY
11934 * fontset.c (fontset_get_font_group): Add proper type checks.
11935 (Bug#9172)
aac0c6e3 11936
7be1c708 119372011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 11938
7be1c708
CY
11939 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11940 and LC_VERSION_MIN_MACOSX.
11941 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11942 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 11943
97bb72a6
EZ
119442011-08-08 Eli Zaretskii <eliz@gnu.org>
11945
11946 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
11947 no-display-properties-and-no-overlays under bidi display.
11948 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 11949 properties and overlays.
97bb72a6 11950
d5617611
CY
119512011-08-08 Chong Yidong <cyd@stupidchicken.com>
11952
37e11a63
CY
11953 * editfns.c (Fset_time_zone_rule): Document relationship with the
11954 setenv function.
11955
d5617611
CY
11956 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11957 the font entity extracted from the cache (Bug#8109).
11958
58872834
CY
119592011-08-07 Chong Yidong <cyd@stupidchicken.com>
11960
11961 * composite.c (autocmp_chars): Don't reset point. That is done by
11962 restore_point_unwind (Bug#5984).
11963
75bfc667
JL
119642011-08-07 Juri Linkov <juri@jurta.org>
11965
11966 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11967 to show the arg `TIME' instead of `TIMEVAL'.
11968
d1410150
EZ
119692011-08-06 Eli Zaretskii <eliz@gnu.org>
11970
11971 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11972 display property strides EOL and includes a newline, as in
11973 longlines-mode. (Bug#9254)
75b771e4
EZ
11974 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11975 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
11976
11977 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11978 is non-zero, even if the data buffer is NULL. Fixes a crash in
11979 vertical-motion with longlines-mode. (Bug#9254)
11980
35928349
EZ
119812011-08-05 Eli Zaretskii <eliz@gnu.org>
11982
ec7cc85b
EZ
11983 * bidi.c <bidi_cache_total_alloc>: Now static.
11984 (bidi_initialize): Initialize bidi_cache_total_alloc.
11985
8b76d6f8 11986 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
11987 cache. (Bug#9221)
11988
11989 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11990 amount allocated this far in `bidi_cache_total_alloc'.
11991 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11992 non-zero, only free the data buffer without restoring the cache
11993 contents. All callers changed.
11994
11995 * dispextern.h (bidi_unshelve_cache): Update prototype.
11996
11997 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11998 (move_it_in_display_line, move_it_to)
11999 (move_it_vertically_backward, move_it_by_lines): Replace the call
12000 to xfree to an equivalent call to bidi_unshelve_cache.
12001 (move_it_in_display_line_to): Fix logic of returning
412b6358 12002 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 12003
e2e2423b
EZ
120042011-08-05 Eli Zaretskii <eliz@gnu.org>
12005
12006 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12007 came from a string character with a `cursor' property. (Bug#9229)
12008
ae9e757a
JD
120092011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12010
12011 * Makefile.in (LIB_PTHREAD): New variable.
12012 (LIBES): Add LIB_PTHREAD (Bug#9216).
12013
12014 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12015 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12016
213bd7f2
AS
120172011-08-04 Andreas Schwab <schwab@linux-m68k.org>
12018
6b02f655 12019 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 12020
99aaf75f
JD
120212011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12022
12023 * xterm.c (x_find_topmost_parent): New function.
12024 (x_set_frame_alpha): Find topmost parent window with
12025 x_find_topmost_parent and set the property there also (bug#9181).
12026 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12027
c74e9d86
PE
120282011-08-04 Paul Eggert <eggert@cs.ucla.edu>
12029
12030 * callproc.c (Fcall_process): Avoid vfork clobbering
12031 the local vars buffer, coding_systems, current_dir.
12032
640c8776
SM
120332011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
12034
12035 * keymap.c (Fmake_composed_keymap): Move to subr.el.
12036
f26d0e4c
PE
120372011-08-03 Paul Eggert <eggert@cs.ucla.edu>
12038
8a10d76c
PE
12039 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
12040 so that it is not optimized away.
12041
f26d0e4c
PE
12042 * xdisp.c (compute_display_string_pos): Remove unused local.
12043
55439c61
EZ
120442011-08-02 Eli Zaretskii <eliz@gnu.org>
12045
12046 Fix slow cursor motion and scrolling in large buffers with
12047 selective display, like Org Mode buffers. (Bug#9218)
12048
12049 * dispextern.h (struct bidi_it): New member disp_prop_p.
12050
12051 * xdisp.c: Remove one-slot cache of display string positions.
12052 (compute_display_string_pos): Accept an additional argument
5e617bc2 12053 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
12054 for a display string or property. If found, set DISP_PROP_P
12055 non-zero.
12056
12057 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
12058 DISP_PROP_P, and pass it to compute_display_string_pos.
12059 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
12060 non-zero. All callers of bidi_fetch_char changed.
12061
fb33fa43
SM
120622011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
12063
12064 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12065
b099e063
DM
120662010-12-03 Don March <don@ohspite.net>
12067
12068 * keymap.c (Fdefine_key): Fix non-prefix key error message when
12069 last character M-[char] is translated to ESC [char] (bug#7541).
12070
5cc7f7af
KH
120712011-08-02 Kenichi Handa <handa@m17n.org>
12072
d0fffa3f 12073 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
12074
12075 * chartab.c (uniprop_table): Make it non-static.
12076
525d5e6e
EZ
120772011-08-01 Eli Zaretskii <eliz@gnu.org>
12078
12079 * xdisp.c (forward_to_next_line_start): Accept additional argument
12080 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12081 on the newline.
12082 (reseat_at_next_visible_line_start): Use the bidi iterator state
12083 returned by forward_to_next_line_start to restore the state of
12084 it->bidi_it after backing up to previous newline. (Bug#9212)
12085
31011111
AS
120862011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12087
12088 * regex.c (re_comp): Protoize.
12089 (re_exec): Fix return type.
12090 (regexec): Fix type of `ret'. (Bug#9203)
12091
476371c4
PE
120922011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12093
e5d76069
PE
12094 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12095 This is needed if max-image-size is a floating-point number.
12096
9a79b20c
AS
120972011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12098
12099 * print.c (print_object): Print empty symbol as ##.
12100
12101 * lread.c (read1): Read ## as empty symbol.
12102
d8c2fa78
AA
121032011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12104
12105 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12106 setting frame foreground color (Bug#9175).
12107 (x_set_background_color): Likewise.
12108
ffe57a7a
AA
12109 * nsmenu.m (-setText): Size tooltip dimensions precisely to
12110 contents (Bug#9176).
12111 (EmacsTooltip -init): Remove bezels and add shadows to
12112 tooltip windows.
12113
bf3492a5
AA
12114 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12115 or scroll bar (Bug#8470).
12116
d55e9c53
AA
12117 * nsfont.m (nsfont_open): Remove assignment to voffset and
12118 unnecessary vars hshink, expand, hd, full_height, min_height.
12119 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12120
12121 * nsterm.h (nsfont_info): Remove voffset field.
12122
d8c2fa78 121232011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
12124
12125 Implement strike-through and overline on NextStep (Bug#8863).
12126
12127 * nsfont.m (nsfont_open): Use underline position provided by font,
12128 instead of hard-coded value of 2.
12129 (nsfont_draw): Call ns_draw_text_decoration instead.
12130
12131 * nsterm.h: Add declaration for ns_draw_text_decoration.
12132
12133 * nsterm.m (ns_draw_text_decoration): New function for drawing
12134 underline, overline, and strike-through.
12135 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
12136 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 12137 accommodate underlining, etc.
4843aac3 12138
4cc60b9b
EZ
121392011-07-28 Eli Zaretskii <eliz@gnu.org>
12140
bc7ece87
EZ
12141 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
12142 default.
4cc60b9b 12143
476371c4
PE
121442011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12145
66606eea
PE
12146 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
12147 Without this fix, if a signal arrives just after memory fills up,
12148 'malloc' might be invoked reentrantly.
12149
476371c4
PE
12150 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
12151 In other words, assume that every image size is allowed, on non-X
12152 hosts. This assumption is probably wrong, but it lets Emacs compile.
12153
f3fcc40d
AS
121542011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12155
12156 * regex.c (re_iswctype): Convert return values to boolean.
12157
350c992f
EZ
121582011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
12159
12160 * xdisp.c (compute_display_string_pos): Don't use cached display
12161 string position if the buffer had its restriction changed.
12162 (Bug#9184)
12163
5266b4bb
PE
121642011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12165
12166 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12167
2573a837 121682011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 12169
41f55ccd 12170 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 12171
39e378da
PE
12172 * bidi.c: Integer size and overflow fixes.
12173 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
12174 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
12175 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12176 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
12177 (bidi_find_other_level_edge):
12178 Use ptrdiff_t instead of EMACS_INT where either will do.
12179 This works better on 32-bit hosts configured --with-wide-int.
12180 (bidi_cache_ensure_space): Check for size-calculation overflow.
12181 Use % rather than repeated addition, for better worst-case speed.
12182 Don't set bidi_cache_size until after xrealloc returns, because it
12183 might not return.
12184 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
12185 (bidi_cache_ensure_space): Also check that the bidi cache size
12186 does not exceed that of the largest Lisp string or buffer. See Eli
12187 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 12188
5e927815
PE
12189 * alloc.c (__malloc_size_t): Remove.
12190 All uses replaced by size_t. See Andreas Schwab's note
12191 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12192
ca4aa935
PE
12193 * image.c: Improve checking for integer overflow.
12194 (check_image_size): Assume that f is nonnull, since
12195 it is always nonnull in practice. This is one less thing to
12196 worry about when checking for integer overflow later.
12197 (x_check_image_size): New function, which checks for integer
12198 overflow issues inside X.
12199 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12200 This removes the need for a memory_full check.
12201 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12202 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12203 (xbm_read_bitmap_data): Change locals back to 'int', since
12204 their values must fit in 'int'.
12205 (xpm_load_image, png_load, tiff_load):
12206 Invoke x_create_x_image_and_pixmap earlier,
12207 to avoid much needless work if the image is too large.
12208 (tiff_load): Treat overly large images as if
12209 x_create_x_image_and_pixmap failed, not as malloc failures.
12210 (gs_load): Use x_check_image_size.
12211
5f8f9cc2
PE
12212 * gtkutil.c: Omit integer casts.
12213 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12214 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12215
5adf60bc
PE
12216 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12217
c8907a93
PE
12218 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12219 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12220 would wrongly return t on a 64-bit host.
12221
e3c25c68
PE
12222 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12223 The plain *_OVERFLOW macros run afoul of GCC bug 49705
12224 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12225 and therefore cause GCC to emit a bogus diagnostic in some cases.
12226
3f791afe
PE
12227 * image.c: Integer signedness and overflow and related fixes.
12228 This is not an exhaustive set of fixes, but it's time to
12229 record what I've got.
12230 (lookup_pixel_color, check_image_size): Remove redundant decls.
12231 (check_image_size): Don't assume that arbitrary EMACS_INT values
12232 fit in 'int', or that arbitrary 'double' values fit in 'int'.
12233 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12234 (tiff_load, imagemagick_load_image):
12235 Check for overflow in size calculations.
12236 (x_create_x_image_and_pixmap): Remove unnecessary test for
12237 xmalloc returning NULL; that can't happen.
12238 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12239 (xpm_color_bucket): Use better integer hashing function.
12240 (xpm_cache_color): Don't possibly over-allocate memory.
12241 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12242 (gif_memory_source):
12243 Use ptrdiff_t, not int or size_t, to record sizes.
12244 (png_load): Don't assume values greater than 2**31 fit in 'int'.
12245 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12246 either works, as we prefer signed integers.
12247 (tiff_read_from_memory, tiff_write_from_memory):
12248 Return tsize_t, not size_t, since that's what the TIFF API wants.
12249 (tiff_read_from_memory): Don't fail simply because the read would
12250 go past EOF; instead, return a short read.
12251 (tiff_load): Omit no-longer-needed casts.
12252 (Fimagemagick_types): Don't assume size fits into 'int'.
12253
3cc5a532
PE
12254 Improve hashing quality when configured --with-wide-int.
12255 * fns.c (hash_string): New function, taken from sxhash_string.
12256 Do not discard information about ASCII character case; this
12257 discarding is no longer needed.
12258 (sxhash-string): Use it. Change sig to match it. Caller changed.
12259 * lisp.h: Declare it.
12260 * lread.c (hash_string): Remove, since we now use fns.c's version.
12261 The fns.c version returns a wider integer if --with-wide-int is
12262 specified, so this should help the quality of the hashing a bit.
12263
b312a492
PE
12264 * emacs.c: Integer overflow minor fix.
12265 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
12266 Define only if GNU_LINUX.
12267 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12268
dfd153ae
PE
12269 * dispnew.c: Integer signedness and overflow fixes.
12270 Remove unnecessary forward decls, that were a maintenance hassle.
12271 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12272 All uses changed.
12273 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
12274 (scrolling_window): Use ptrdiff_t, not int, for byte count.
12275 (prepare_desired_row, line_draw_cost):
12276 Use int, not unsigned, where either works.
12277 (save_current_matrix, restore_current_matrix):
12278 Use ptrdiff_t, not size_t, where either works.
12279 (init_display): Check for overflow more accurately, and without
12280 relying on undefined behavior.
12281
a81d11a3
PE
12282 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
12283 Remove, replacing with the new symbols in lisp.h. All uses changed.
12284 * fileio.c (make_temp_name):
12285 * filelock.c (lock_file_1, lock_file):
12286 * xdisp.c (message_dolog):
12287 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
12288 Use pMd etc. instead.
12289 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
12290 replacing the pWIDE etc. symbols removed from editfns.c.
12291
3300e6fd
PE
12292 * keyboard.h (num_input_events): Now uintmax_t.
12293 This is (very slightly) less likely to mess up due to wraparound.
12294 All uses changed.
12295
fd05c7e9
PE
12296 * buffer.c: Integer signedness fixes.
12297 (alloc_buffer_text, enlarge_buffer_text):
12298 Use ptrdiff_t rather than size_t when either will do, as we prefer
12299 signed integers.
12300
903fe15d
PE
12301 * alloc.c: Integer signedness and overflow fixes.
12302 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
12303 (__malloc_size_t): Default to size_t, not to int.
12304 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12305 (Fgarbage_collect, mark_object_loop_halt, mark_object):
12306 Prefer ptrdiff_t to size_t when either would do, as we prefer
12307 signed integers.
12308 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12309 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12310 Now const. Initialize with values that are in range even if char
12311 is signed.
12312 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12313 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
12314 These functions do the right thing with sizes > 2**32.
12315 (check_depth): Now ptrdiff_t, not int.
12316 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12317 Adjust to new way of storing sizes. Check for size overflow bugs
12318 in rest of code.
12319 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
12320 slightly wrong anyway, as it missed one instance of
12321 XMALLOC_OVERRUN_CHECK_OVERHEAD.
12322 (refill_memory_reserve): Omit needless cast to size_t.
12323 (mark_object_loop_halt): Mark as externally visible.
12324
ac82cc6a
PE
12325 * xselect.c: Integer signedness and overflow fixes.
12326 (Fx_register_dnd_atom, x_handle_dnd_message):
12327 Use ptrdiff_t, not size_t, since we prefer signed.
12328 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12329 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12330 x_dnd_atoms_size and x_dnd_atoms_length.
12331
c2d1e36d
PE
12332 * doprnt.c: Prefer signed to unsigned when either works.
12333 * eval.c (verror):
12334 * doprnt.c (doprnt):
12335 * lisp.h (doprnt):
12336 * xdisp.c (vmessage):
12337 Use ptrdiff_t, not size_t, when using or implementing doprnt,
12338 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12339 prefer signed arithmetic to avoid comparison confusion.
12340 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12341 but is a bit tricky.
12342
0e926e56
PE
12343 Assume freestanding C89 headers, string.h, stdlib.h.
12344 * data.c, doprnt.c, floatfns.c, print.c:
12345 Include float.h unconditionally.
12346 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12347 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12348 * regex.c: Likewise for stddef.h, string.h.
12349 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12350 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12351 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12352 (STDC_HEADERS): Remove obsolete defines.
12353 * sysdep.c: Include limits.h unconditionally.
12354
9cfdb3ec
PE
12355 Assume support for memcmp, memcpy, memmove, memset.
12356 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12357 * regex.c (memcmp, memcpy):
12358 Remove; we assume C89 now.
12359
12360 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12361 (__malloc_safe_bcopy): Remove; no longer needed.
12362
cf950e6b 12363 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
12364 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12365 well either way, and we prefer signed to unsigned.
12366
dbf38e02
LMI
123672011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12368
12369 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12370 closes the connection while we're reading (bug#9182).
12371
d6f0886c 123722011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 12373
d6f0886c
JD
12374 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12375 are specified (Bug#9168).
24e0f6b1 12376
2eb1f9e6
PE
123772011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12378
12379 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12380 Found by GCC static checking and --with-wide-int on a 32-bit host.
12381
22381272 123822011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
12383
12384 * xdisp.c (compute_display_string_pos): Fix logic of caching
12385 previous display string position. Initialize cached_prev_pos to
12386 -1. Fixes slow-down at the beginning of a buffer.
12387
f25e39b4
EZ
123882011-07-24 Eli Zaretskii <eliz@gnu.org>
12389
12390 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12391 for attrs[LFACE_FONTSET_INDEX].
12392
04c4b52e
PE
123932011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12394
12395 * xml.c (parse_region): Remove unused local
12396 that was recently introduced.
12397
c1734fbd
EZ
123982011-07-23 Eli Zaretskii <eliz@gnu.org>
12399
be18c5a5
EZ
12400 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12401 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12402
c1734fbd
EZ
12403 * xdisp.c (move_it_in_display_line_to): Record the best matching
12404 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
12405 exit if none of the characters scanned was an exact match.
12406 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
12407 when exact match is impossible due to invisible text, and the
12408 lines are truncated.
12409
a258d627
JD
124102011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12411
12412 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12413 for OSX >= 10.7.
12414
b6d5a689
EZ
124152011-07-22 Eli Zaretskii <eliz@gnu.org>
12416
0f74f785
EZ
12417 Fix a significant slow-down of cursor motion with C-n, C-p,
12418 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12419 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 12420 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
12421 (next_element_from_buffer): Call compute_stop_pos_backwards to
12422 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
12423 base_level_stop.
12424 (reseat): Don't look for prev_stop, as that could mean a very long
12425 run.
12426 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12427 <cached_disp_overlay_modiff>: Cache for last found display string
12428 position.
551918c1 12429 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
12430 about the same buffer in the same area of character positions, and
12431 the buffer wasn't changed since the time the display string
12432 position was cached.
551918c1 12433
b2d0c91a
EZ
124342011-07-22 Eli Zaretskii <eliz@gnu.org>
12435
12436 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12437 is an integer, which is important for empty lines. (Bug#9149)
12438
043604ee
CY
124392011-07-22 Chong Yidong <cyd@stupidchicken.com>
12440
12441 * frame.c (Fmodify_frame_parameters): In tty case, update the
12442 default face if necessary (Bug#4238).
12443
da4adb04
CY
124442011-07-21 Chong Yidong <cyd@stupidchicken.com>
12445
12446 * editfns.c (Fstring_to_char): No need to explain what a character
12447 is in the docstring (Bug#6576).
12448
9abd0532
LMI
124492011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12450
12451 * xml.c (parse_region): Make sure we always return a tree.
12452
36881d16
HK
124532011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12454
12455 * xml.c (parse_region): If a document contains only comments,
12456 return that, too.
12457
1e98674d
LMI
124582011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12459
12460 * xml.c (make_dom): Return comments, too.
12461
590bd467
PE
124622011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12463
12464 Port to OpenBSD.
12465 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12466 and the surrounding thread.
12467 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12468 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12469 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12470 timer goes off.
12471 * s/openbsd.h (BROKEN_SIGIO): Define.
12472 * unexelf.c (unexec) [__OpenBSD__]:
12473 Don't update the .mdebug section of the Alpha COFF symbol table.
12474
f41628b2
LMI
124752011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12476
12477 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12478 (bug#8460).
12479
b59b67c5
PE
124802011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12481
15e3a074
PE
12482 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12483 This fixes some race conditions on the permissions of any newly
12484 created file.
12485
41bed37d
PE
12486 * alloc.c (valid_pointer_p): Use pipe, not open.
12487 This fixes some permissions issues when debugging.
12488
b59b67c5
PE
12489 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12490 If fchown fails to set both uid and gid, try to set just gid,
12491 as that is sometimes allowed. Adjust the file's mode to eliminate
12492 setuid or setgid bits that are inappropriate if fchown fails.
12493
925a6be7
SM
124942011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12495
12496 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12497 to compare Lisp_Objects.
12498 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12499 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12500 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12501
52968808
AS
125022011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12503
0a6a104b
AS
12504 * lread.c (read_integer): Unread even EOF character.
12505 (read1): Likewise. Properly record start position of symbol.
12506
52968808
AS
12507 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12508 symbol character follows.
12509
9e381cdd
PE
125102011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12511
12512 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12513 This works around a problem with the previous change to Fcopy_file.
12514 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12515 and without this change, GCC might complain about discarding
12516 fchown's return value.
12517
b5641435
JB
125182011-07-16 Juanma Barranquero <lekktu@gmail.com>
12519
12520 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12521
a8031457
PE
125222011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12523
12524 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12525
dd889327
LMI
125262011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12527
750c33f7
LMI
12528 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12529 it's used from the C level.
12530
dd889327
LMI
12531 * process.c: Use the same condition for POLL_FOR_INPUT in both
12532 keyboard.c and process.c (bug#1858).
12533
87e86684
LM
125342011-07-09 Lawrence Mitchell <wence@gmx.li>
12535
12536 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12537 (Fgnutls_boot): Use it.
12538
64348f40
AS
125392011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12540
12541 * doc.c (Fsubstitute_command_keys): Revert last change.
12542
1d698799
LMI
125432011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12544
f863868c
LMI
12545 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12546 quotes the next character, and doesn't affect other longer
12547 sequences (bug#8935).
12548
1d698799
LMI
12549 * lread.c (syms_of_lread): Clarify that is isn't only
12550 `eval-buffer' and `eval-defun' that's affected by
12551 `lexical-binding' (bug#8460).
12552
aa4b6df6
EZ
125532011-07-15 Eli Zaretskii <eliz@gnu.org>
12554
12555 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 12556 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 12557
5d856da6
PE
125582011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12559
ad6042bb
PE
12560 Fix minor problems found by static checking.
12561 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12562 (elsz): Now a signed constant, not a size_t var. We prefer signed
12563 types to unsigned, to avoid integer comparison confusion. Without
12564 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12565 "cannot optimize loop, the loop counter may overflow", a symptom
12566 of the confusion.
f00bbb22 12567 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
12568 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12569
6468f31c
LMI
125702011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12571
49080b10
LMI
12572 * search.c (Fre_search_backward): Mention `case-fold-search' in
12573 all the re_search_* functions (bug#8138).
12574
6468f31c
LMI
12575 * keyboard.c (Fopen_dribble_file): Document when the file is
12576 closed (bug#8056).
12577
c965adc5
EZ
125782011-07-14 Eli Zaretskii <eliz@gnu.org>
12579
df9733bf
EZ
12580 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12581 bidi_cache_idx.
12582
0bb23927
EZ
12583 Support bidi reordering of display and overlay strings.
12584 * xdisp.c (compute_display_string_pos)
12585 (compute_display_string_end): Accept additional argument STRING.
12586 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12587 (reseat_to_string): Initialize bidi_it->string.s and
12588 bidi_it->string.schars.
12589 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
12590 NULL (avoids a crash in bidi_paragraph_init).
12591 Initialize itb.string.lstring.
0bb23927
EZ
12592 (init_iterator): Call bidi_init_it only of a valid
12593 buffer position was specified. Initialize paragraph_embedding to
12594 L2R.
12595 (reseat_to_string): Initialize the bidi iterator.
12596 (display_string): If we need to ignore text properties of
12597 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12598 original value of -1 will not work with bidi.)
12599 (compute_display_string_pos): First arg is now struct
12600 `text_pos *'; all callers changed. Support display properties on
12601 Lisp strings.
12602 (compute_display_string_end): Support display properties on Lisp
12603 strings.
12604 (init_iterator, reseat_1, reseat_to_string): Initialize the
12605 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12606 when iterating on a string not from display properties).
640c8776
SM
12607 (compute_display_string_pos, compute_display_string_end):
12608 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
12609 arrow keys.
12610 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
12611 base_level_stop; instead, set base_level_stop to BEGV.
12612 Fixes crashes in vertical-motion.
0bb23927
EZ
12613 (next_element_from_buffer): Improve commentary for when
12614 the iterator is before prev_stop.
12615 (init_iterator): Initialize bidi_p from the default value of
12616 bidi-display-reordering, not from buffer-local value. Use the
12617 buffer-local value only if initializing for buffer iteration.
12618 (handle_invisible_prop): Support invisible properties on strings
12619 that are being bidi-reordered.
12620 (set_iterator_to_next): Support bidi reordering of C strings and
12621 Lisp strings.
12622 (next_element_from_string): Support bidi reordering of Lisp
12623 strings.
12624 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
12625 (display_string): Support display of R2L glyph rows.
12626 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
12627 (init_iterator): Don't initialize it->bidi_p for strings
12628 here.
12629 (reseat_to_string): Initialize it->bidi_p for strings here.
12630 (next_element_from_string, next_element_from_c_string)
12631 (next_element_from_buffer): Add xassert's for correspondence
12632 between IT's object being iterated and it->bidi_it.string
12633 structure.
12634 (face_before_or_after_it_pos): Support bidi iteration.
12635 (next_element_from_c_string): Handle the case of the first string
12636 character that is not the first one in the visual order.
12637 (get_visually_first_element): New function, refactored from common
12638 parts of next_element_from_buffer, next_element_from_string, and
12639 next_element_from_c_string.
12640 (tool_bar_lines_needed, redisplay_tool_bar)
12641 (display_menu_bar): Force left-to-right direction. Add a FIXME
12642 comment for making that be controlled by a user option.
12643 (push_it, pop_it): Save and restore the state of the
12644 bidi iterator. Save and restore the bidi_p flag.
12645 (pop_it): Iterate out of display property for string iteration as
12646 well.
12647 (iterate_out_of_display_property): Support iteration over strings.
12648 (handle_single_display_spec): Set up it->bidi_it for iteration
12649 over a display string, and call bidi_init_it.
12650 (handle_single_display_spec, next_overlay_string)
12651 (get_overlay_strings_1, push_display_prop): Set up the bidi
12652 iterator for displaying display or overlay strings.
12653 (forward_to_next_line_start): Don't use the shortcut if
12654 bidi-iterating.
12655 (back_to_previous_visible_line_start): If handle_display_prop
12656 pushed the iterator stack, restore the internal state of the bidi
12657 iterator by calling bidi_pop_it same number of times.
12658 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12659 and we are bidi-iterating, don't decrement the iterator position;
12660 instead, set the first_elt flag in the bidi iterator, to produce
12661 the same effect.
12662 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12663 (push_display_prop): xassert that we are iterating a buffer.
12664 (push_it, pop_it): Save and restore paragraph_embedding member.
12665 (handle_single_display_spec, next_overlay_string)
12666 (get_overlay_strings_1, reseat_1, reseat_to_string)
12667 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12668 correctly. Don't assume unibyte strings are not bidi-reordered.
12669 (compute_display_string_pos)
12670 (compute_display_string_end): Fix handling the case of C string.
12671 (push_it, pop_it): Save and restore from_disp_prop_p.
12672 (handle_single_display_spec, push_display_prop): Set the
12673 from_disp_prop_p flag.
12674 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12675 (pop_it): Call iterate_out_of_display_property only if we are
12676 popping after iteration over a string that came from a display
12677 property. Fix a typo in popping stretch info. Add an assertion
12678 for verifying that the iterator position is in sync with the bidi
12679 iterator.
12680 (handle_single_display_spec, get_overlay_strings_1)
12681 (push_display_prop): Fix initialization of paragraph direction for
12682 string when that of the parent object is not yet determined.
12683 (reseat_1): Call bidi_init_it to resync the bidi
12684 iterator with IT's position. (Bug#7616)
12685 (find_row_edges): If ROW->start.pos gives position
12686 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12687 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12688 Reset the from_disp_prop_p flag.
12689 (SAVE_IT, RESTORE_IT): New macros.
12690 (pos_visible_p, face_before_or_after_it_pos)
12691 (back_to_previous_visible_line_start)
12692 (move_it_in_display_line_to, move_it_in_display_line)
12693 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12694 (try_scrolling, redisplay_window, display_line): Use them when
12695 saving a temporary copy of the iterator and restoring it back.
12696 (back_to_previous_visible_line_start, reseat_1)
12697 (init_iterator): Empty the bidi cache "stack".
12698 (move_it_in_display_line_to): If iterator ended up at
12699 EOL, but we never saw any buffer positions smaller than
12700 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12701 motion in bidi-reordered lines.
12702 (move_it_in_display_line_to): Record prev_method and prev_pos
12703 immediately before the call to set_iterator_to_next. Fixes cursor
12704 motion in bidi-reordered lines with stretch glyphs and strings
12705 displayed in margins. (Bug#8133) (Bug#8867)
12706 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12707 TO_CHARPOS.
640c8776
SM
12708 (pos_visible_p): Support positions in bidi-reordered lines.
12709 Save and restore bidi cache.
0bb23927
EZ
12710
12711 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12712 (bidi_paragraph_info): Delete unused struct.
12713 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12714 (bidi_cache_start): New variable.
12715 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12716 to zero.
12717 (bidi_cache_fetch_state, bidi_cache_search)
12718 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12719 (bidi_cache_find, bidi_peek_at_next_level)
12720 (bidi_level_of_next_char, bidi_find_other_level_edge)
12721 (bidi_move_to_visually_next): Compare cache index with
12722 bidi_cache_start rather than with zero.
12723 (bidi_fetch_char): Accept new argument STRING; all callers
12724 changed. Support iteration over a string. Support strings with
12725 display properties. Support unibyte strings. Fix the type of
12726 `len' according to what STRING_CHAR_AND_LENGTH expects.
12727 (bidi_paragraph_init, bidi_resolve_explicit_1)
12728 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
12729 (bidi_level_of_next_char, bidi_move_to_visually_next):
12730 Support iteration over a string.
0bb23927
EZ
12731 (bidi_set_sor_type, bidi_resolve_explicit_1)
12732 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12733 can now be zero (for strings); special values 0 and -1 were
12734 changed to -1 and -2, respectively.
12735 (bidi_char_at_pos): New function.
12736 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12737 Call it instead of FETCH_MULTIBYTE_CHAR.
12738 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12739 initialized to valid values.
12740 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12741 values.
12742 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12743 the test for valid cached positions. Fix the logic for looking up
12744 the sentinel state in the cache. GCPRO the Lisp string we are
12745 iterating.
12746 (bidi_push_it, bidi_pop_it): New functions.
12747 (bidi_initialize): Initialize the bidi cache start stack pointer.
12748 (bidi_cache_ensure_space): New function, refactored from part of
12749 bidi_cache_iterator_state. Don't assume the required size is just
12750 one BIDI_CACHE_CHUNK away.
12751 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12752 (bidi_count_bytes, bidi_char_at_pos): New functions.
12753 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12754 always valid if bidi_cache_idx is valid.
12755 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12756 is valid if it's going to be used.
12757 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12758 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
12759 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12760 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
12761 (bidi_find_other_level_edge, bidi_cache_start_stack):
12762 All variables related to cache indices are now EMACS_INT.
c965adc5 12763
0bb23927
EZ
12764 * dispextern.h (struct bidi_string_data): New structure.
12765 (struct bidi_it): New member `string'. Make flag members be 1-bit
12766 fields, and put them last in the struct.
640c8776
SM
12767 (compute_display_string_pos, compute_display_string_end):
12768 Update prototypes.
0bb23927
EZ
12769 (bidi_push_it, bidi_pop_it): Add prototypes.
12770 (struct iterator_stack_entry): New members bidi_p,
12771 paragraph_embedding, and from_disp_prop_p.
12772 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
12773 (bidi_shelve_cache, bidi_unshelve_cache):
12774 Declare prototypes.
0bb23927
EZ
12775
12776 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12777 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12778 and vector-like objects.
12779
12780 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12781 cache around display iteration.
12782
12783 * window.c (Fwindow_end, window_scroll_pixel_based)
12784 (displayed_window_lines, Frecenter): Save and restore the bidi
12785 cache around display iteration.
12786
3bbd2265
LMI
127872011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12788
12789 * editfns.c (Fdelete_region): Clarify the use of the named
12790 parameters (bug#6788).
12791
adc47434
MR
127922011-07-14 Martin Rudalics <rudalics@gmx.at>
12793
12794 * indent.c (Fvertical_motion): Set and restore w->pointm when
12795 saving and restoring the window's buffer (Bug#9006).
12796
837c31f8
LMI
127972011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12798
12799 * editfns.c (Fstring_to_char): Clarify just what is returned
12800 (bug#6576). Text by Eli Zaretskii.
12801
ac389d0c
JB
128022011-07-13 Juanma Barranquero <lekktu@gmail.com>
12803
12804 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12805
0be0ce47
EZ
128062011-07-13 Eli Zaretskii <eliz@gnu.org>
12807
12808 * buffer.c (mmap_find): Fix a typo.
12809
cd18e7e3
JB
128102011-07-13 Johan Bockgård <bojohan@gnu.org>
12811
12812 Fix execution of x selection hooks.
12813 * xselect.c (Qx_lost_selection_functions)
12814 (Qx_sent_selection_functions): New vars.
12815 (syms_of_xselect): DEFSYM them.
12816 (x_handle_selection_request): Pass Qx_sent_selection_functions
12817 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12818 (x_handle_selection_clear,x_clear_frame_selections):
12819 Pass Qx_lost_selection_functions rather than
12820 Vx_lost_selection_functions to Frun_hook_with_args.
12821
47ea7f44
PE
128222011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12823
ac389d0c 12824 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
12825 The old code sometimes used this field without initializing it.
12826
47ea7f44
PE
12827 * alloc.c (gc_sweep): Don't read past end of array.
12828 In theory, the old code could also have corrupted Emacs internals,
12829 though it'd be very unlikely.
12830
bc985c87
AS
128312011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12832
12833 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 12834 argument. (Bug#4026)
bc985c87 12835
0cf34688
LMI
128362011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12837
b3dadd76
LMI
12838 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12839 key" (bug#4257).
12840
0cf34688
LMI
12841 * window.c (Fset_window_start): Doc fix (bug#4199).
12842 (Fset_window_hscroll): Ditto.
12843
270768cd
PE
128442011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12845
077e3dda 12846 Fix minor new problems caught by GCC 4.6.1.
270768cd 12847 * term.c (init_tty): Remove unused local.
490011a6 12848 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 12849 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 12850 not used otherwise.
270768cd 12851
b1f58454
CY
128522011-07-12 Chong Yidong <cyd@stupidchicken.com>
12853
12854 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12855
22b9578d
LMI
128562011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12857
6e70ab07
LMI
12858 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12859 are the mini-buffer and the echo area (bug#3320).
12860
22b9578d
LMI
12861 * term.c (init_tty): Remove support for supdup, c10 and perq
12862 terminals, which are no longer supported (bug#1482).
12863
8974cc9f
JB
128642011-07-10 Johan Bockgård <bojohan@gnu.org>
12865
12866 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12867
a560d974
JD
128682011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12869
12870 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12871 for non-popups (Bug#3642).
12872
1dae0f0a
AS
128732011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12874
268c2c36 12875 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 12876 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
12877 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12878 * cm.c (losecursor): Likewise.
1dae0f0a
AS
12879 * data.c (fmod): Likewise.
12880 * dispnew.c (swap_glyphs_in_rows): Likewise.
12881 * emacs.c (memory_warning_signal): Likewise.
12882 * floatfns.c (float_error): Likewise.
12883 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12884 (otf_open, font_otf_capability, generate_otf_features)
12885 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12886 Likewise.
12887 * image.c (pbm_read_file): Likewise.
12888 * indent.c (string_display_width): Likewise.
12889 * intervals.c (check_for_interval, search_for_interval)
12890 (inc_interval_count, count_intervals, root_interval)
12891 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12892 * lread.c (defalias): Likewise.
268c2c36 12893 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
12894 * regex.c (set_image_of_range_1, set_image_of_range)
12895 (regex_grow_registers): Likewise.
12896 * sysdep.c (strerror): Likewise.
12897 * termcap.c (valid_filename_p, tprint, main): Likewise.
12898 * tparam.c (main): Likewise.
12899 * unexhp9k800.c (run_time_remap, save_data_space)
12900 (update_file_ptrs, read_header, write_header, calculate_checksum)
12901 (copy_file, copy_rest, display_header): Likewise.
12902 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12903 Likewise.
12904 * xdisp.c (check_it): Likewise.
12905 * xfaces.c (register_color, unregister_color, unregister_colors):
12906 Likewise.
12907 * xfns.c (print_fontset_result): Likewise.
12908 * xrdb.c (member, fatal, main): Likewise.
12909
99033785
PE
129102011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12911
12912 Fix minor problems found by static checking (Bug#9031).
12913 * chartab.c (char_table_set_range, map_sub_char_table):
12914 Remove unused locals.
12915 (uniprop_table): Now static.
12916 * composite.c (_work_char): Remove unused static var.
12917
9cb2ac56
JB
129182011-07-09 Juanma Barranquero <lekktu@gmail.com>
12919
12920 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12921
f25661f0
JD
129222011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12923
12924 * gtkutil.c (qttip_cb): Remove code without function.
12925
8278c4fe
EZ
129262011-07-09 Eli Zaretskii <eliz@gnu.org>
12927
12928 * w32.c (pthread_sigmask): New stub.
12929
1692ae2d 129302011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 12931
8a6ebd58 12932 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
12933 sigprocmask is portable only for single-threaded applications, and
12934 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
12935 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12936 (LIBES): Use it.
12937 * callproc.c (Fcall_process):
12938 * process.c (create_process):
12939 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12940 Use pthread_sigmask, not sigprocmask.
123403e4 12941
1b854618
JD
129422011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12943
12944 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12945 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12946 wrong (Bug#8591).
12947
3fe4b549
JD
129482011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12949
0ce7e563
JD
12950 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12951 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12952 (xg_hide_tooltip): Fix comment.
12953
3fe4b549
JD
12954 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12955 in registerServicesMenuSendTypes.
12956 (validRequestorForSendType): Don't check ns_return_types.
12957
12958 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12959 ns_return_type.
12960
5df75e47
JR
129612011-07-08 Jason Rumney <jasonr@gnu.org>
12962
22610910
JR
12963 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12964 SH_SHOW for hidden windows (Bug#5482).
12965
5df75e47
JR
12966 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12967 frame struct members of non-existent frames (Bug#6284).
12968
699c10bd
JD
129692011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12970
4393663b
JD
12971 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12972 variable firstTime not needed on OSX >= 10.6.
12973 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12974 >= 10.5. Use setKnobProportion, setDoubleValue.
12975
12976 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12977 (MAC_OS_X_VERSION_10_5): Define if not defined.
12978 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12979 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12980 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12981
12982 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 12983 cString and lossyCString on OSX >= 10.4.
4393663b 12984
58179cce 12985 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
12986 sizeToFit on OSX >= 10.2.
12987
12988 * nsimage.m (allocInitFromFile): Don't use deprecated method
12989 bestRepresentationForDevice on OSX >= 10.6.
12990
12991 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12992 to avoid warning.
12993
12994 * emacs.c: Declare unexec_init_emacs_zone.
12995
a63e0781
JD
12996 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12997
699c10bd
JD
12998 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12999
13000 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13001 on svcsMenu (Bug#8842).
13002
13003 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13004 ns_return_types.
13005 (Fns_list_services): Just return Qnil on 10.6, code not working there.
13006
13007 * nsterm.m (QUTF8_STRING): Declare.
13008 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13009 (validRequestorForSendType): Return type is (id).
13010 Change indexOfObjectIdenticalTo to indexOfObject.
13011 Check if we have local selection before returning self (Bug#8842).
13012 (writeSelectionToPasteboard): Put local selection into paste board
13013 if we have a local selection (Bug#8842).
13014 (syms_of_nsterm): DEFSYM QUTF8_STRING.
13015
13016 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13017 (ns_get_local_selection): Declare.
13018
54e10184
LMI
130192011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
13020
9888ff71
LMI
13021 * keymap.c (describe_map_tree): Don't insert a double newline at
13022 the end of the buffer (bug#1169) and return whether we inserted
13023 something.
13024
54e10184
LMI
13025 * callint.c (Fcall_interactively): Change "reading args" to
13026 "providing args" to try to clarify what it does (bug#1010).
13027
15fa4783
KH
130282011-07-07 Kenichi Handa <handa@m17n.org>
13029
13030 * composite.c (composition_compute_stop_pos): Ignore a static
13031 composition starting before CHARPOS (Bug#8915).
13032
13033 * xdisp.c (handle_composition_prop): Likewise.
13034
a8815b00
EZ
130352011-07-07 Eli Zaretskii <eliz@gnu.org>
13036
13037 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13038 (Bug#9015)
13039
ef7b981d 130402011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
13041
13042 * character.h (unicode_category_t): New enum type.
13043
13044 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13045 (Qchar_code_property_table): New variable.
13046 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13047 (UNIPROP_COMPRESSED_FORM_P): New macros.
13048 (char_table_ascii): Uncompress the compressed values.
13049 (sub_char_table_ref): New arg is_uniprop. Callers changed.
13050 Uncompress the compressed values.
ac389d0c 13051 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
13052 (char_table_ref_and_range): Uncompress the compressed values.
13053 (sub_char_table_set): New arg is_uniprop. Callers changed.
13054 Uncompress the compressed values.
13055 (sub_char_table_set_range): Args changed. Callers changed.
13056 (char_table_set_range): Adjuted for the above change.
13057 (map_sub_char_table): Delete args default_val and parent. Add arg
13058 top. Give decoded values to a Lisp function.
640c8776 13059 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
13060 values to a Lisp function. Gcpro more variables.
13061 (uniprop_table_uncompress)
13062 (uniprop_decode_value_run_length): New functions.
13063 (uniprop_decoder, uniprop_decoder_count): New variables.
13064 (uniprop_get_decoder, uniprop_encode_value_character)
13065 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13066 New functions.
13067 (uniprop_encoder, uniprop_encoder_count): New variables.
13068 (uniprop_get_encoder, uniprop_table)
13069 (Funicode_property_table_internal, Fget_unicode_property_internal)
13070 (Fput_unicode_property_internal): New functions.
13071 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13072 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 13073 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
13074 char-code-property-alist.
13075
640c8776 13076 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
13077 Vunicode_category_table.
13078
640c8776 13079 * font.c (font_range): Adjust for the change of
c805dec0
KH
13080 Vunicode_category_table.
13081
76b397fb
DN
130822011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13083
13084 * m/iris4d.h: Remove file, move contents ...
13085 * s/irix6-5.h: ... here.
13086
22b4128e
PE
130872011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13088
13089 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
13090 * alloc.c (mark_buffer):
13091 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13092 (clone_per_buffer_values): Don't assume that
22b4128e
PE
13093 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13094 This isn't true in general, and it's particularly not true
13095 if Emacs is configured with --with-wide-int.
13096 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13097 New macros, used in the buffer.c change.
13098
869795d6
JD
130992011-07-05 Jan Djärv <jan.h.d@swipnet.se>
13100
13101 * xsettings.c: Use both GConf and GSettings if both are available.
13102 (store_config_changed_event): Add comment.
13103 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13104 (store_tool_bar_style_changed): New functions.
5e617bc2 13105 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
13106 (struct xsettings): Move font inside HAVE_XFT.
13107 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 13108 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 13109 Move inside HAVE_XFT.
640c8776 13110 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
13111 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13112 also.
13113 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 13114 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 13115 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
13116 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13117 (parse_settings): Move check for font inside HAVE_XFT.
13118 (read_settings, apply_xft_settings): Add comment.
13119 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
13120 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
13121 call store_font_name_changed.
13122 (xft_settings_event): Add comment.
13123 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
13124 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
13125 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
13126 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
13127 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
13128 (xsettings_get_system_font, xsettings_get_system_normal_font):
13129 Add comment.
869795d6 13130
d8ed26bd
PE
131312011-07-05 Paul Eggert <eggert@cs.ucla.edu>
13132
13133 Random fixes. E.g., (random) never returned negative values.
13134 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
13135 subseconds part to the entropy, as that's a bit more random.
13136 Prefer signed to unsigned, since the signedness doesn't matter and
13137 in general we prefer signed. When given a limit, use a
13138 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
13139 latter isn't right if USE_2_TAGS_FOR_INTS.
13140 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
13141 not 0..VALMASK. Don't discard "excess" bits that random () returns.
13142
cabf1cac
SM
131432011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
13144
13145 * textprop.c (text_property_stickiness):
13146 Obey Vtext_property_default_nonsticky.
13147 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
13148 * w32fns.c (syms_of_w32fns):
13149 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
13150
6e9b2be9
PE
131512011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13152
13153 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
13154 This is more efficient than Ffile_directory_p and avoids a minor race.
13155
90186c68
LMI
131562011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
13157
7c301272
LMI
13158 * buffer.c (Foverlay_put): Say what the return value is
13159 (bug#7835).
13160
c4f2d8d4
LMI
13161 * fileio.c (barf_or_query_if_file_exists): Check first if the file
13162 is a directory before asking whether to use the file name
13163 (bug#7564).
ad637907
LMI
13164 (barf_or_query_if_file_exists): Make the "File is a directory"
13165 error be more correct.
c4f2d8d4 13166
90186c68
LMI
13167 * fns.c (Frequire): Remove the mention of the .gz files, since
13168 that's installation-specific, but keep the mention of
13169 `get-load-suffixes'.
13170
da64016e
PE
131712011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13172
13173 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
13174 Report string overflow if the output is too long.
13175
7d47b580
JB
131762011-07-04 Juanma Barranquero <lekktu@gmail.com>
13177
a555cb87
JB
13178 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
13179 (syms_of_gnutls): Remove duplicate DEFSYM for
13180 Qgnutls_bootprop_verify_hostname_error, an error for
13181 Qgnutls_bootprop_verify_error (which is no longer used).
13182
7d47b580
JB
13183 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13184 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
13185 Also (re)move comments that are misplaced or no longer relevant.
13186
1e49bfab
LMI
131872011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13188
13189 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13190
1485f4c0
CY
131912011-07-03 Chong Yidong <cyd@stupidchicken.com>
13192
13193 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13194 and background color parameters if they have been changed.
13195
a9ab721e
LMI
131962011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13197
13198 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13199
cf7cff57
PE
132002011-07-03 Paul Eggert <eggert@cs.ucla.edu>
13201
2e13213d
PE
13202 * xsettings.c (SYSTEM_FONT): Define only when used.
13203 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13204
cf7cff57
PE
13205 * keymap.c (access_keymap_1): Now static.
13206
7a8e04f7
CY
132072011-07-02 Chong Yidong <cyd@stupidchicken.com>
13208
13209 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13210 leave any prefix arg for the up event (Bug#1586).
13211
61352f62
LMI
132122011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
13213
69bb1ef7
LMI
13214 * lread.c (syms_of_lread): Mention single symbols defined by
13215 `defvar' or `defconst' (bug#7154).
13216
61352f62 13217 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 13218 (Frequire): Mention get-load-suffixes.
61352f62 13219
28545e04
MR
132202011-07-02 Martin Rudalics <rudalics@gmx.at>
13221
13222 * window.h (window): Remove clone_number slot.
13223 * window.c (Fwindow_clone_number, Fset_window_clone_number):
13224 Remove.
13225 (make_parent_window, make_window, saved_window)
13226 (Fset_window_configuration, save_window_save): Don't deal with
13227 clone numbers.
13228 * buffer.c (Qclone_number): Remove declaration.
13229 (sort_overlays, overlay_strings): Don't deal with clone numbers.
13230
3349e122
SM
132312011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
13232
13233 Add multiple inheritance to keymaps.
13234 * keymap.c (Fmake_composed_keymap): New function.
13235 (Fset_keymap_parent): Simplify.
13236 (fix_submap_inheritance): Remove.
13237 (access_keymap_1): New function extracted from access_keymap to handle
13238 embedded parents and handle lists of maps.
13239 (access_keymap): Use it.
13240 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13241 (Fcopy_keymap): Handle embedded parents.
13242 (Fcommand_remapping, define_as_prefix): Simplify.
13243 (Fkey_binding): Simplify.
13244 (syms_of_keymap): Move minibuffer-local-completion-map,
13245 minibuffer-local-filename-completion-map,
13246 minibuffer-local-must-match-map, and
13247 minibuffer-local-filename-must-match-map to Elisp.
13248 (syms_of_keymap): Defsubr make-composed-keymap.
13249 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13250 (parse_menu_item): Trivial simplification.
13251
3279eb87
GM
132522011-07-01 Glenn Morris <rgm@gnu.org>
13253
13254 * Makefile.in (SETTINGS_LIBS): Fix typo.
13255
39cb9e56 132562011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
13257
13258 * coding.c (Fencode_coding_string): Record the last coding system
13259 used, as the function doc string says (bug#8738).
13260
0949d2b6
JD
132612011-07-01 Jan Djärv <jan.h.d@swipnet.se>
13262
13263 * xsettings.c (store_monospaced_changed): Take new font as arg and
13264 check for change against current_mono_font.
13265 (EMACS_TYPE_SETTINGS): Remove this and related defines.
13266 (emacs_settings_constructor, emacs_settings_get_property)
13267 (emacs_settings_set_property, emacs_settings_class_init)
13268 (emacs_settings_init, gsettings_obj): Remove.
13269 (something_changedCB): New function for HAVE_GSETTINGS.
13270 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13271 with value as argument.
13272 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
13273 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 13274 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
13275 "changed".
13276
13277 * xgselect.c: Add defined (HAVE_GSETTINGS).
13278 (xgselect_initialize): Ditto.
13279
13280 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
13281 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
13282 xg_select.
13283
bbc6b304
PE
132842011-07-01 Paul Eggert <eggert@cs.ucla.edu>
13285
13286 * eval.c (struct backtrace): Simplify and port the data structure.
13287 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
13288 signed bit field, as this assumption is not portable and it makes
13289 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
13290 "char debug_on_exit : 1" as this is not portable either; instead,
13291 use the portable "unsigned int debug_on_exit : 1". Remove unused
13292 member evalargs. Remove obsolete comments about cc bombing out.
13293
9851bfc5
JD
132942011-06-30 Jan Djärv <jan.h.d@swipnet.se>
13295
51bb811f 13296 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
13297 Let HAVE_GSETTINGS override HAVE_GCONF.
13298 (store_monospaced_changed): New function.
13299 (EMACS_SETTINGS): A new type derived from GObject to handle
13300 GSettings notifications.
13301 (emacs_settings_constructor, emacs_settings_get_property)
13302 (emacs_settings_set_property, emacs_settings_class_init):
13303 New functions.
13304 (gsettings_client, gsettings_obj): New variables.
13305 (GSETTINGS_SCHEMA): New define.
13306 (something_changedCB): Call store_monospaced_changed.
13307 (init_gsettings): New function.
13308 (xsettings_initialize): Call init_gsettings.
13309 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13310 to NULL.
13311
640c8776 13312 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
13313 GCONF_CFLAGS/LIBS.
13314
5386012d
MR
133152011-06-29 Martin Rudalics <rudalics@gmx.at>
13316
13317 * window.c (resize_root_window, grow_mini_window)
13318 (shrink_mini_window): Rename Qresize_root_window to
13319 Qwindow_resize_root_window and Qresize_root_window_vertically to
13320 Qwindow_resize_root_window_vertically.
13321
f13e0b08
PE
133222011-06-28 Paul Eggert <eggert@cs.ucla.edu>
13323
13324 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13325
94515237
JB
133262011-06-27 Juanma Barranquero <lekktu@gmail.com>
13327
13328 * makefile.w32-in: Redesign dependencies so they reflect more
13329 clearly which files are directly included by each source file,
13330 and not through other includes.
13331
e43b6e43
MR
133322011-06-27 Martin Rudalics <rudalics@gmx.at>
13333
13334 * buffer.c (Qclone_number): Declare static and DEFSYM it.
13335 (sort_overlays, overlay_strings): When an overlay's clone number
13336 matches the window's clone number process the overlay even if
13337 the overlay's window property doesn't match the current window.
13338
d68443dc
MR
13339 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13340 (Fwindow_hchild): Rename to Fwindow_left_child.
13341 (Fwindow_next): Rename to Fwindow_next_sibling.
13342 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
13343 (resize_window_check): Rename to window_resize_check.
13344 (resize_window_apply): Rename to window_resize_apply.
13345 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13346 (Fdelete_other_windows_internal, resize_frame_windows)
13347 (Fsplit_window_internal, Fdelete_window_internal)
13348 (grow_mini_window, shrink_mini_window)
13349 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 13350
c7e73be5
JD
133512011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13352
13353 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13354 (emacs_fixed_set_min_size): Remove.
13355 (emacs_fixed_new): Take frame as argument.
13356
13357 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13358 (_EmacsFixedPrivate): Remove minwidth/height.
13359 Add struct frame *f.
13360 (emacs_fixed_init): Initialize priv->f.
13361 (get_parent_class, emacs_fixed_set_min_size): Remove.
13362 (emacs_fixed_new): Set priv->f to argument.
13363 (emacs_fixed_get_preferred_width)
13364 (emacs_fixed_get_preferred_height): Use min_width/height from
13365 frames size_hint to set minimum and natural (Bug#8919).
13366 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13367 and use min_width/height from frames size_hint to set
13368 min_width/height (Bug#8919).
13369
13370 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
13371 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13372 Fix indentation.
c7e73be5 13373
cf99dcf8
EZ
133742011-06-26 Eli Zaretskii <eliz@gnu.org>
13375
13376 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13377 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13378 called at ZV.
13379
029529ac
CY
133802011-06-26 Chong Yidong <cyd@stupidchicken.com>
13381
13382 * process.c (wait_reading_process_output): Bypass select if
13383 waiting for a cell while ignoring keyboard input, and input is
13384 pending. Suggested by Jan Djärv (Bug#8869).
13385
7a7ef429
PE
133862011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13387
13388 Use gnulib's dup2 module instead of rolling our own.
13389 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13390
11fdef7d 133912011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
13392
13393 * dispnew.c (scrolling_window): Before scrolling, turn off a
13394 mouse-highlight in the window being scrolled.
13395
cd3520a4
JB
133962011-06-24 Juanma Barranquero <lekktu@gmail.com>
13397
13398 Move DEFSYM to lisp.h and use everywhere.
13399
13400 * character.h (DEFSYM): Move declaration...
13401 * lisp.h (DEFSYM): ...here.
13402
13403 * gnutls.c:
13404 * minibuf.c:
13405 * w32menu.c:
13406 * w32proc.c:
13407 * w32select.c: Don't include character.h.
13408
13409 * alloc.c (syms_of_alloc):
13410 * buffer.c (syms_of_buffer):
13411 * bytecode.c (syms_of_bytecode):
13412 * callint.c (syms_of_callint):
13413 * casefiddle.c (syms_of_casefiddle):
13414 * casetab.c (init_casetab_once):
13415 * category.c (init_category_once, syms_of_category):
13416 * ccl.c (syms_of_ccl):
13417 * cmds.c (syms_of_cmds):
13418 * composite.c (syms_of_composite):
13419 * dbusbind.c (syms_of_dbusbind):
13420 * dired.c (syms_of_dired):
13421 * dispnew.c (syms_of_display):
13422 * doc.c (syms_of_doc):
13423 * editfns.c (syms_of_editfns):
13424 * emacs.c (syms_of_emacs):
13425 * eval.c (syms_of_eval):
13426 * fileio.c (syms_of_fileio):
13427 * fns.c (syms_of_fns):
13428 * frame.c (syms_of_frame):
13429 * fringe.c (syms_of_fringe):
13430 * insdel.c (syms_of_insdel):
13431 * keymap.c (syms_of_keymap):
13432 * lread.c (init_obarray, syms_of_lread):
13433 * macros.c (syms_of_macros):
13434 * msdos.c (syms_of_msdos):
13435 * print.c (syms_of_print):
13436 * process.c (syms_of_process):
13437 * search.c (syms_of_search):
13438 * sound.c (syms_of_sound):
13439 * syntax.c (init_syntax_once, syms_of_syntax):
13440 * terminal.c (syms_of_terminal):
13441 * textprop.c (syms_of_textprop):
13442 * undo.c (syms_of_undo):
13443 * w32.c (globals_of_w32):
13444 * window.c (syms_of_window):
13445 * xdisp.c (syms_of_xdisp):
13446 * xfaces.c (syms_of_xfaces):
13447 * xfns.c (syms_of_xfns):
13448 * xmenu.c (syms_of_xmenu):
13449 * xsettings.c (syms_of_xsettings):
13450 * xterm.c (syms_of_xterm): Use DEFSYM.
13451
4228cf16
TZ
134522011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13453
cd3520a4 13454 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 13455
7fcccf1e
PE
134562011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13457
7efb4e0e
PE
13458 Integer and buffer overflow fixes (Bug#8873).
13459
ff5844ad
PE
13460 * print.c (printchar, strout): Check for string overflow.
13461 (PRINTPREPARE, printchar, strout):
13462 Don't set size unless allocation succeeds.
13463
90532f02
PE
13464 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13465 for sizes. Check for string overflow more accurately.
13466 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13467
6d84508d
PE
13468 * macros.c: Integer and buffer overflow fixes.
13469 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13470 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13471 Use ptrdiff_t, not int, for sizes.
13472 Don't increment bufsize until after realloc succeeds.
13473 Check for size-calculation overflow.
13474 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13475
437b2cb4
PE
13476 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13477
8b9ac8b4
PE
13478 * lread.c: Integer overflow fixes.
13479 (read_integer): Radix is now EMACS_INT, not int,
13480 to improve quality of diagnostics for out-of-range radices.
13481 Calculate buffer size correctly for out-of-range radices.
13482 (read1): Check for integer overflow in radices, and in
13483 read-circle numbers.
82cb60d3
PE
13484 (read_escape): Avoid int overflow.
13485 (Fload, openp, read_buffer_size, read1)
13486 (substitute_object_recurse, read_vector, read_list, map_obarray):
13487 Use ptrdiff_t, not int, for sizes.
13488 (read1): Use EMACS_INT, not int, for sizes.
20270765 13489 Check for size overflow.
8b9ac8b4 13490
7fcccf1e
PE
13491 * image.c (cache_image): Check for size arithmetic overflow.
13492
bfbbd7e7
PE
13493 * lread.c: Integer overflow issues.
13494 (saved_doc_string_size, saved_doc_string_length)
13495 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13496 Now ptrdiff_t, not int.
13497 (read1): Don't assume doc string length fits in int. Check for
13498 out-of-range doc string lengths.
13499 (read_list): Don't assume file position fits in int.
39019e54 13500 (read_escape): Check for hex character overflow.
bfbbd7e7 13501
4e323265
LL
135022011-06-22 Leo Liu <sdl.web@gmail.com>
13503
13504 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13505 Move to minibuffer.el.
13506
85fece3e
PE
135072011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13508
20b84ce9 13509 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
13510 The following patches are for when GLYPH_DEBUG && !XASSERT.
13511 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13512 * dispnew.c (flush_stdout):
13513 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13514 Mark as externally visible.
13515 * dispnew.c (check_window_matrix_pointers): Now static.
13516 * dispnew.c (window_to_frame_vpos):
13517 * xfns.c (unwind_create_frame):
13518 * xterm.c (x_check_font): Remove unused local.
13519 * scroll.c (CHECK_BOUNDS):
13520 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13521 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13522 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13523 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13524 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13525 Now static.
13526 (debug_method_add): Use va_list and vsprintf rather than relying
13527 on undefined behavior with wrong number of arguments.
13528 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13529 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13530 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13531 since we're not interested in debugging glyphs with old libraries.
13532 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13533 GCC 4.6.0's static checking.
13534
0766b489
PE
135352011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13536
31fd4b32
PE
13537 Integer overflow and signedness fixes (Bug#8873).
13538 A few related buffer overrun fixes, too.
13539
b79e8648
PE
13540 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13541
0766b489
PE
13542 * dispextern.h (struct face.stipple):
13543 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13544 (x_bitmap_mask, x_allocate_bitmap_record)
13545 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13546 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13547 (x_create_bitmap_from_xpm_data):
13548 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13549 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13550 (.bitmaps_last):
13551 * xfaces.c (load_pixmap):
13552 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13553 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13554 (.bitmaps_last, struct x_output.icon_bitmap):
13555 Use ptrdiff_t, not int, for bitmap indexes.
13556 (x_allocate_bitmap_record): Check for size overflow.
13557 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13558
b081724f
PE
13559 Use ptrdiff_t, not int, for overlay counts.
13560 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13561 * editfns.c (overlays_around, get_pos_property):
13562 * textprop.c (get_char_property_and_overlay):
13563 * xdisp.c (next_overlay_change, note_mouse_highlight):
13564 * xfaces.c (face_at_buffer_position):
21514da7
PE
13565 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13566 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13567 (Fnext_overlay_change, Fprevious_overlay_change)
13568 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 13569 Use ptrdiff_t, not int, for sizes.
21514da7 13570 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 13571
3de73e5e
PE
13572 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13573
2606c57b
PE
13574 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13575 (x_session_initialize): Do not assume string length fits in int.
13576
aaafe47a
PE
13577 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13578 This is unlikely, but can occur if DPI is outlandish.
13579
2674ddc8 13580 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
13581 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13582
28154962
PE
13583 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13584 * xrdb.c (magic_file_p, search_magic_path):
13585 Omit last arg SUFFIX; it was always 0. All callers changed.
13586 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13587
7de51af5
PE
13588 * xfont.c (xfont_match): Avoid need for strlen.
13589
25ed6cc3
PE
13590 * xfns.c: Don't assume strlen fits in int.
13591 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13592
4eab31dd
PE
13593 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13594 not unsigned long, as we prefer signed integers. All callers changed.
13595 Detect integer overflow in repeat count.
13596 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 13597 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 13598
171e2a58
PE
13599 * termcap.c: Don't assume sizes fit in int and never overflow.
13600 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13601 (gobble_line): Check for size-calculation overflow.
13602
ad39faca 13603 * minibuf.c (Fread_buffer):
6e5bb2dc 13604 * lread.c (intern, intern_c_string):
74ca2eb3
PE
13605 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13606 Don't assume string length fits in int.
13607
52c61c22 13608 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
13609 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13610
b5b8c9e5
PE
13611 * font.c: Don't assume string length fits in int.
13612 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13613 Use ptrdiff_t, not int.
ccd6111c
PE
13614 (font_intern_prop): Don't assume string length fits in int.
13615 Don't assume integer property fits in fixnum.
13616 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 13617
882f0d81 13618 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 13619 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
13620 Reformulate so as not to need the command string.
13621 Invoke gzip -cd rather than gunzip, as it's more portable.
13622 (lock_info_type, lock_file_1, lock_file):
13623 Don't assume pid_t and time_t fit in unsigned long.
13624 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13625 (current_lock_owner): Prefer signed type for sizes.
13626 Use memcpy, not strncpy, where memcpy is what is really wanted.
13627 Don't assume (via atoi) that time_t and pid_t fit in int.
13628 Check for time_t and/or pid_t out of range, e.g., via a network share.
13629 Don't alloca where an auto var works fine.
13630
93f4cf88
PE
13631 * fileio.c: Fix some integer overflow issues.
13632 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13633 Don't assume string length fits in int.
13634 (directory_file_name): Don't assume string length fits in long.
13635 (make_temp_name): Don't assume pid fits in int, or that its print
13636 length is less than 20.
13637
f3e92b69
PE
13638 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13639
1bfdaf10
PE
13640 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13641
35016e9a
PE
13642 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13643
3d1e65a1
PE
13644 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13645 We prefer signed integers, even for size calculations.
13646
0b963a93
PE
13647 * emacs.c: Don't assume string length fits in 'int'.
13648 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13649 (main): Don't invoke strlen when not needed.
13650
573f4b54
PE
13651 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13652 (XD_DEBUG_MESSAGE): Don't waste a byte.
13653
989f33ba
PE
13654 * callproc.c (getenv_internal_1, getenv_internal)
13655 (Fgetenv_internal):
965d34eb
PE
13656 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13657
e4d29b33
PE
13658 * lread.c (invalid_syntax): Omit length argument.
13659 All uses changed. This doesn't fix a bug, but it simplifies the
13660 code away from its former Hollerith-constant appearance, and it's
13661 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 13662 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 13663
eb49b136
PE
13664 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13665 This didn't break anything, but it didn't help either.
13666 It's confusing to put a bogus integer in a place where the actual
13667 value does not matter.
9f62aeb1 13668 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 13669 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 13670
15375a22
PE
13671 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13672 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13673 implementation.
b61cc01c
PE
13674 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13675 We prefer signed types, and the value cannot exceed the EMACS_INT
13676 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
13677 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13678 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13679 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 13680
53b2623d
PE
13681 * indent.c (sane_tab_width): New function.
13682 (current_column, scan_for_column, Findent_to, position_indentation)
13683 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 13684 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 13685
51cab52b 13686 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 13687
f2ed8a70
PE
13688 * lisp.h (lint_assume): New macro.
13689 * composite.c (composition_gstring_put_cache):
13690 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13691
abe80cc6
PE
13692 * editfns.c, insdel.c:
13693 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 13694
b02c740e
PE
13695 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13696
ebc96716
PE
13697 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13698
b4e50fa0 13699 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 13700 Use much-faster test for byte-length change.
311d5d7c 13701 Don't assume string byte-length fits in 'int'.
a4cf38e4 13702 Check that character arg fits in 'int'.
85461888 13703 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 13704
c0c1ee9f
PE
13705 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13706
a498d7f4
PE
13707 * fns.c (concat): Catch string overflow earlier.
13708 Do not rely on integer wraparound.
13709
51cab52b
PE
13710 * dispextern.h (struct it.overlay_strings_charpos)
13711 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
13712 * xdisp.c (forward_to_next_line_start)
13713 (back_to_previous_visible_line_start)
13714 (reseat_at_next_visible_line_start, next_element_from_buffer):
13715 Don't arbitrarily truncate the value of 'selective' to int.
13716
76031fad
PE
13717 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13718
5eb55db9
PE
13719 * composite.c: Don't truncate sizes to 'int'.
13720 (composition_gstring_p, composition_reseat_it)
13721 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
13722 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13723 not EMACS_UINT, for indexes.
5eb55db9 13724
0703a717
PE
13725 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13726
d6202519
PE
13727 * buffer.c: Include <verify.h>.
13728 (struct sortvec.priority, struct sortstr.priority):
8961a454 13729 Now EMACS_INT, not int.
c20998a7 13730 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
13731 (struct sortstr.size, record_overlay_string)
13732 (struct sortstrlist.size, struct sortlist.used):
13733 Don't truncate size to int.
13734 (record_overlay_string): Check for size-calculation overflow.
d6202519 13735 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 13736
d5a19415
JM
137372011-06-22 Jim Meyering <meyering@redhat.com>
13738
029529ac 13739 Don't leak an XBM-image-sized buffer
d5a19415
JM
13740 * image.c (xbm_load): Free the image buffer after using it.
13741
a9041e6c
PE
137422011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13743
13744 Port to Sun C.
13745 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13746 that Sun C diagnosed.
13747 * fns.c (secure_hash): Fix pointer signedness issue.
13748 * intervals.c (static_offset_intervals): New function.
13749 (offset_intervals): Use it.
13750
7f3f739f
LL
137512011-06-21 Leo Liu <sdl.web@gmail.com>
13752
13753 * deps.mk (fns.o):
13754 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13755 sha512.h.
13756
13757 * fns.c (secure_hash): Rename from crypto_hash_function and change
13758 the first arg to accept symbols.
5b66d427 13759 (Fsecure_hash): New primitive.
7f3f739f
LL
13760 (syms_of_fns): New symbols.
13761
76147d94
DD
137622011-06-20 Deniz Dogan <deniz@dogan.se>
13763
13764 * process.c (Fset_process_buffer): Clarify return value in
13765 docstring.
13766
7d7d0045
CY
137672011-06-18 Chong Yidong <cyd@stupidchicken.com>
13768
13769 * dispnew.c (add_window_display_history): Use BVAR.
13770
13771 * xdisp.c (debug_method_add): Use BVAR.
13772 (check_window_end, dump_glyph_matrix, dump_glyph)
13773 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13774
13775 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13776 Likewise.
13777
13778 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13779 check till after the cache is created in init_frame_faces.
13780
ff2bc410
SM
137812011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13782
13783 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13784
28177add
PE
137852011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13786
dd3482fe
PE
13787 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13788 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13789 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13790
393d71f3 13791 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
13792 * fileio.c (Finsert_file_contents):
13793 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13794 Remove the old (too-loose) buffer overflow checks.
13795 They weren't needed, since make_gap checks for buffer overflow.
13796 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13797 The old code merely checked for Emacs fixnum overflow, and relied
13798 on undefined (wraparound) behavior. The new code avoids undefined
13799 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13800
2e6813b0 13801 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
13802 Tune. Don't use wider integers than needed. Don't use alloca.
13803 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 13804
599a9e4f
PE
13805 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13806
99561444
PE
13807 * insdel.c, lisp.h (buffer_overflow): New function.
13808 (insert_from_buffer_1, replace_range, replace_range_2):
13809 * insdel.c (make_gap_larger):
13810 * editfns.c (Finsert_char):
13811 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13812
28177add
PE
13813 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13814
e69dafad
PE
138152011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13816
4baa020d 13817 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 13818
b1c46f02
PE
13819 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13820 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13821
e69dafad
PE
13822 * fileio.c: Don't assume EMACS_INT fits in off_t.
13823 (emacs_lseek): New static function.
13824 (Finsert_file_contents, Fwrite_region): Use it.
13825 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13826
566684ea
PE
13827 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13828
e6966cd6
PE
13829 * fns.c: Don't overflow int when computing a list length.
13830 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13831 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13832 truncation on 64-bit hosts. Check for QUIT every
13833 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13834 faster and is responsive enough.
13835 (Flength): Report an error instead of overflowing an integer.
13836 (Fsafe_length): Return a float if the value is not representable
13837 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 13838 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 13839 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 13840
dd0b0efb
PE
13841 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13842 (header_size, word_size): New constants.
13843 (allocate_vectorlike): Don't check size overflow here.
13844 (allocate_vector): Check it here instead, since this is the only
13845 caller of allocate_vectorlike that could cause overflow.
13846 Check that the new vector's length is representable as a fixnum.
13847
86fe5cfe
PE
13848 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13849 The previous code was bogus. For example, next_almost_prime (32)
13850 returned 39, which is undesirable as it is a multiple of 3; and
13851 next_almost_prime (24) returned 25, which is a multiple of 5 so
13852 why was the code bothering to check for multiples of 7?
13853
80e88859
PE
13854 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13855
4a2f0ad6
PE
13856 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13857
f66c7cf8
PE
13858 Variadic C functions now count arguments with ptrdiff_t.
13859 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13860 Back then I didn't know that the Emacs coding style prefers signed int.
13861 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
13862 were being counted with int, which may truncate counts on 64-bit
13863 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
13864 * lisp.h (struct Lisp_Subr.function.aMANY)
13865 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13866 Arg counts are now ptrdiff_t, not size_t.
13867 All variadic functions and their callers changed accordingly.
13868 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13869 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13870 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13871 * callint.c (Fcall_interactively): Check arg count for overflow,
13872 to avoid potential buffer overrun. Use signed char, not 'int',
13873 for 'varies' array, so that we needn't bother to check its size
13874 calculation for overflow.
13875 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13876 * eval.c (apply_lambda):
13877 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13878 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13879 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13880
a1759b76
PE
13881 * callint.c (Fcall_interactively): Don't use index var as event count.
13882
d96be9fc
PE
13883 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13884 * mem-limits.h (SIZE): Remove; no longer used.
13885
a690a978 13886 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 13887
578c21e6
PE
13888 Remove unnecessary casts.
13889 * xterm.c (x_term_init):
13890 * xfns.c (x_set_border_pixel):
13891 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13892 These aren't needed now that we assume ANSI C.
13893
96f53c6c
PE
13894 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13895 It's more likely to cause problems (due to unsigned overflow)
13896 than to cure them.
13897
83c77d31
PE
13898 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13899
ee2079f1
PE
13900 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13901
6da65536
PE
13902 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13903
7147c4a4
PE
13904 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13905
193e32d9
PE
13906 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13907
e5533da6
PE
13908 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13909
9910e595
PE
13910 GLYPH_CODE_FACE returns EMACS_INT, not int.
13911 * dispextern.h (merge_faces):
13912 * xfaces.c (merge_faces):
01103c44
PE
13913 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13914 Don't assume EMACS_INT fits in int.
9910e595 13915
2638320e
PE
13916 * character.h (CHAR_VALID_P): Remove unused parameter.
13917 * fontset.c, lisp.h, xdisp.c: All uses changed.
13918
045eb8d9
PE
13919 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13920
c1f134b5
PE
13921 * fns.c (concat): Minor tuning based on overflow analysis.
13922 This doesn't fix any bugs. Use int to hold character, instead
13923 of constantly refetching from Emacs object. Use XFASTINT, not
13924 XINT, for value known to be a character. Don't bother comparing
13925 a single byte to 0400, as it's always less.
13926
395fcb93 13927 * floatfns.c (Fexpt):
327eeec8
PE
13928 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13929
abbd3d23
PE
13930 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13931 for characters.
13932
684a03ef
PE
13933 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13934
0fed43f3
PE
13935 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13936 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13937 incorrectly succeed when S was a string, because 4294967386 was
13938 truncated before it was used.
13939
8fd02eb7
PE
13940 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13941 Otherwise, an out-of-range integer could cause undefined behavior
13942 on a 64-bit host.
13943
f8c86b69
PE
13944 * composite.c: Use int, not EMACS_INT, for characters.
13945 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13946 EMACS_INT, for values that are known to be in character range.
13947 This doesn't fix any bugs but is the usual style inside Emacs and
13948 may generate better code on 32-bit machines.
13949
34206dd2
PE
13950 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13951 This is for reasons similar to the recent CHAR_STRING fix.
13952 * charset.c (Fencode_char): Check that character arg is actually
13953 a character. Pass an int to ENCODE_CHAR.
13954 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13955 wider than 'int', as a compile-time check to prevent future regressions
13956 in this area.
13957
c5958d4c 13958 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
13959
13960 Make sure a 64-bit char is never passed to CHAR_STRING.
13961 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13962 by silently ignoring the top 32 bits, allowing some values
13963 that were far too large to be valid characters.
13964 * character.h: Include <verify.h>.
13965 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13966 arguments are no wider than unsigned, as a compile-time check
13967 to prevent future regressions in this area.
13968 * data.c (Faset):
01103c44 13969 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
13970 (Fsubst_char_in_region):
13971 * fns.c (concat):
13972 * xdisp.c (decode_mode_spec_coding):
13973 Adjust to CHAR_STRING's new requirement.
13974 * editfns.c (Finsert_char, Fsubst_char_in_region):
13975 * fns.c (concat): Check that character args are actually
13976 characters. Without this test, these functions did the wrong
13977 thing with wildly out-of-range values on 64-bit hosts.
13978
d37ca623
PE
13979 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13980 These casts should not be needed on 32-bit hosts, either.
13981 * keyboard.c (read_char):
13982 * lread.c (Fload): Remove casts to unsigned.
13983
ea204efb
PE
13984 * lisp.h (UNSIGNED_CMP): New macro.
13985 This fixes comparison bugs on 64-bit hosts.
13986 (ASCII_CHAR_P): Use it.
13987 * casefiddle.c (casify_object):
01103c44 13988 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
13989 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13990 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13991 * dispextern.h (FACE_FROM_ID):
13992 * keyboard.c (read_char): Use UNSIGNED_CMP.
13993
41cb286c
PE
13994 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13995 not to EMACS_INT, to avoid GCC warning.
13996
4a1b9832
PE
13997 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13998
55daad71
PE
13999 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
14000 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14001 isn't needed on 32-bit machines.
8f95c75c 14002
01103c44
PE
14003 * buffer.c (Fgenerate_new_buffer_name):
14004 Use EMACS_INT for count, not int.
0ceccced 14005 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
14006
14007 * data.c (Qcompiled_function): Now static.
14008
c6f072e7
PE
14009 * window.c (window_body_lines): Now static.
14010
20ce5912
PE
14011 * image.c (gif_load): Rename local to avoid shadowing.
14012
9c4c5f81
PE
14013 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14014 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14015 * alloc.c (make_save_value): Integer argument is now of type
14016 ptrdiff_t, not int.
14017 (mark_object): Use ptrdiff_t, not int.
14018 * lisp.h (pD): New macro.
14019 * print.c (print_object): Use it.
14020
c0c5c8ae
PE
14021 * alloc.c: Use EMACS_INT, not int, to count objects.
14022 (total_conses, total_markers, total_symbols, total_vector_size)
14023 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
14024 (total_free_floats, total_floats, total_free_intervals)
14025 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
14026 Now EMACS_INT, not int. All uses changed.
14027 (Fgarbage_collect): Compute overall total using a double, so that
14028 integer overflow is less likely to be a problem. Check for overflow
14029 when converting back to an integer.
5a25e253
PE
14030 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14031 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14032 These were 'int' variables that could overflow on 64-bit hosts;
14033 they were never used, so remove them instead of repairing them.
211a0b2a 14034 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
14035 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14036 Previously, this ceilinged at INT_MAX, but that doesn't work on
14037 64-bit machines.
e46bb31a 14038 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 14039
c78baabf 14040 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 14041 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
14042 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
14043 when a (possibly-narrower) signed value would do just as well.
14044 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 14045
c9d624c6
PE
14046 * alloc.c: Catch some string size overflows that we were missing.
14047 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14048 for convenience in STRING_BYTES_MAX.
14049 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14050 The definition here is exact; the one in lisp.h was approximate.
14051 (allocate_string_data): Check for string overflow. This catches
14052 some instances we weren't catching before. Also, it catches
14053 size_t overflow on (unusual) hosts where SIZE_MAX <= min
14054 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14055 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 14056
c9d624c6
PE
14057 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14058 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 14059 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 14060
353032ce
PE
14061 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14062
2bccce07
PE
14063 * alloc.c (Fmake_string): Check for out-of-range init.
14064
0ac30604
SM
140652011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14066
14067 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14068
c195f2de
JD
140692011-06-14 Jan Djärv <jan.h.d@swipnet.se>
14070
14071 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14072 xg_get_default_scrollbar_width.
14073
14074 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14075 (int_gtk_range_get_value): Move to the scroll bar part of the file.
14076 (style_changed_cb): Call update_theme_scrollbar_width and call
14077 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14078 all frames (Bug#8505).
14079 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14080 Call gtk_window_set_resizable if HAVE_GTK3.
14081 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14082 and height if HAVE_GTK3 (Bug#8505).
14083 (scroll_bar_width_for_theme): New variable.
14084 (update_theme_scrollbar_width): New function.
14085 (xg_get_default_scrollbar_width): Move code to
14086 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14087 (xg_initialize): Call update_theme_scrollbar_width.
14088
14089 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14090
14091 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14092
e10ac9f1
MR
140932011-06-12 Martin Rudalics <rudalics@gmx.at>
14094
14095 * frame.c (make_frame): Call other_buffer_safely instead of
14096 other_buffer.
14097
14098 * window.c (temp_output_buffer_show): Call display_buffer with
14099 second argument Vtemp_buffer_show_specifiers and reset latter
14100 immediately after the call.
14101 (Vtemp_buffer_show_specifiers): New variable.
14102 (auto_window_vscroll_p, next_screen_context_lines)
14103 (Vscroll_preserve_screen_position): Remove leading asterisks from
14104 doc-strings.
14105
2d3c217e 141062011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 14107
7b7f97e8 14108 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
14109 * buffer.c (Qclone_number): Remove for now, as it's unused.
14110 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14111 (record_buffer): Remove unused local.
14112 * frame.c (other_visible_frames, frame_buffer_list): Now static.
14113 (set_frame_buffer_list): Remove; unused.
14114 * frame.h (other_visible_frames): Remove decl.
14115 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14116 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14117 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14118 if HAVE_GPM.
14119 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14120 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
14121 Define only if HAVE_GPM.
14122 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
14123 (update_hints_inhibit): Remove; never set. All uses removed.
14124 * widgetprv.h (emacsFrameClassRec): Remove decl.
14125 * window.c (delete_deletable_window): Now returns void, since it
14126 wasn't returning anything.
14127 (compare_window_configurations): Remove unused locals.
14128 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
14129 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
14130 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
14131 the same widths as pointers. This follows up on the 2011-05-06 patch.
14132 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
14133 * xterm.h: Likewise.
14134 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
14135
1384b89e
JB
141362011-06-12 Juanma Barranquero <lekktu@gmail.com>
14137
14138 * makefile.w32-in: Update dependencies.
14139 (LISP_H): Add lib/intprops.h.
14140
1100a63c
CY
141412011-06-11 Chong Yidong <cyd@stupidchicken.com>
14142
14143 * image.c (gif_load): Add animation frame delay to the metadata.
14144 (syms_of_image): Use DEFSYM. New symbol `delay'.
14145
6198ccd0
MR
141462011-06-11 Martin Rudalics <rudalics@gmx.at>
14147
14148 * window.c (delete_deletable_window): Re-add.
14149 (Fset_window_configuration): Rewrite to handle dead buffers and
14150 consequently deletable windows.
14151 (window_tree, Fwindow_tree): Remove. Supply functionality in
14152 window.el.
14153 (compare_window_configurations): Simplify code.
14154
b6e3633c
AS
141552011-06-11 Andreas Schwab <schwab@linux-m68k.org>
14156
1ab0dee5
AS
14157 * image.c (imagemagick_load_image): Fix type mismatch.
14158 (Fimagemagick_types): Likewise.
14159
b6e3633c
AS
14160 * window.h (replace_buffer_in_windows): Declare.
14161
9397e56f
MR
141622011-06-11 Martin Rudalics <rudalics@gmx.at>
14163
14164 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
14165 Qclone_number. Remove external declaration of Qdelete_window.
14166 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
14167 code.
640c8776
SM
14168 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
14169 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
14170 (Fother_buffer): Rewrite doc-string. Major rewrite for new
14171 buffer list implementation.
14172 (other_buffer_safely): New function.
14173 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
14174 calls to replace_buffer_in_windows and
14175 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
14176 if allowed.
14177 (record_buffer): Inhibit quitting and rewrite using quittable
14178 functions. Run Qbuffer_list_update_hook if allowed.
14179 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
14180 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
14181 Move switch-to-buffer to window.el.
9397e56f
MR
14182 (bury-buffer): Move to window.el.
14183 (Vbuffer_list_update_hook): New variable.
14184
14185 * lisp.h (other_buffer_safely): Add prototype in buffer.c
14186 section.
14187
14188 * window.h (resize_frame_windows): Move up in code.
14189 (Fwindow_frame): Remove EXFUN.
14190 (replace_buffer_in_all_windows): Remove prototype.
14191 (replace_buffer_in_windows_safely): Add prototype.
14192
14193 * window.c: Declare Qdelete_window static again. Move down
14194 declaration of select_count.
14195 (Fnext_window, Fprevious_window): Rewrite doc-strings.
14196 (Fother_window): Move to window.el.
14197 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14198 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14199 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14200 window.el.
14201 (replace_buffer_in_windows): Implement by calling
14202 Qreplace_buffer_in_windows.
14203 (replace_buffer_in_all_windows): Remove with some functionality
14204 moved into replace_buffer_in_windows_safely.
14205 (replace_buffer_in_windows_safely): New function.
14206 (select_window_norecord, select_frame_norecord): Move in front
14207 of run_window_configuration_change_hook. Remove now obsolete
14208 declarations.
640c8776
SM
14209 (Fset_window_buffer): Rewrite doc-string.
14210 Call Qrecord_window_buffer.
9397e56f
MR
14211 (keys_of_window): Move binding for other-window to window.el.
14212
b50691aa
CY
142132011-06-11 Chong Yidong <cyd@stupidchicken.com>
14214
14215 * dispextern.h (struct image): Replace data member, whose int_val
14216 and ptr_val fields were not used by anything, with a single
14217 lisp_val object.
14218
14219 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14220 (gif_clear_image, gif_load, imagemagick_load_image)
14221 (gs_clear_image, gs_load): Callers changed.
14222
3f754b86
PE
142232011-06-10 Paul Eggert <eggert@cs.ucla.edu>
14224
cca69397
PE
14225 * buffer.h: Include <time.h>, for time_t.
14226 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
14227
109e28d0
PE
14228 Fix minor problems found by static checking.
14229
60737f02
PE
14230 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14231
4b66faf3
PE
14232 Make identifiers static if they are not used in other modules.
14233 * data.c (Qcompiled_function, Qframe, Qvector):
14234 * image.c (QimageMagick, Qsvg):
14235 * minibuf.c (Qmetadata):
14236 * window.c (resize_window_check, resize_root_window): Now static.
14237 * window.h (resize_window_check, resize_root_window): Remove decls.
14238
109e28d0
PE
14239 * window.c (window_deletion_count, delete_deletable_window):
14240 Remove; unused.
46a4ce9e
PE
14241 (window_body_lines): Now static.
14242 (Fdelete_other_windows_internal): Mark vars as initialized.
14243 Make sure 'resize_failed' is initialized.
14244 (run_window_configuration_change_hook): Rename local to avoid shadowing.
14245 (resize_window_apply): Remove unused local.
14246 * window.h (delete_deletable_window): Remove decl.
14247
109e28d0 14248 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
14249 (imagemagick_load_image): Fix pointer signedness problem by changing
14250 last arg from unsigned char * to char *. All uses changed.
14251 Also, fix a local for similar reasons.
14252 Remove unused locals. Remove locals to avoid shadowing.
14253 (fn_rsvg_handle_free): Remove; unused.
14254 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 14255 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 14256
3f754b86
PE
14257 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14258
2547adb1
CY
142592011-06-10 Chong Yidong <cyd@stupidchicken.com>
14260
14261 * image.c (gif_load): Fix omitted cast error introduced by
14262 2011-06-06 change.
14263
2c8e37d4
MR
142642011-06-10 Martin Rudalics <rudalics@gmx.at>
14265
14266 * window.h (resize_proportionally, orig_total_lines)
14267 (orig_top_line): Remove from window structure.
14268 (set_window_height, set_window_width, change_window_heights)
14269 (Fdelete_window): Remove prototypes.
14270 (resize_frame_windows): Remove duplicate declaration.
14271
440a42e3
EZ
142722011-06-10 Eli Zaretskii <eliz@gnu.org>
14273
14274 * window.h (resize_frame_windows, resize_window_check)
14275 (delete_deletable_window, resize_root_window)
14276 (resize_frame_windows): Declare prototypes.
14277
14278 * window.c (resize_window_apply): Make definition be "static" to
14279 match the prototype.
14280
562dd5e9
MR
142812011-06-10 Martin Rudalics <rudalics@gmx.at>
14282
14283 * window.c: Remove declarations of Qwindow_size_fixed,
14284 window_min_size_1, window_min_size_2, window_min_size,
14285 size_window, window_fixed_size_p, enlarge_window, delete_window.
14286 Remove static from declaration of Qdelete_window, it's
14287 temporarily needed by Fbury_buffer.
14288 (replace_window): Don't assign orig_top_line and
14289 orig_total_lines.
14290 (Fdelete_window, delete_window): Remove. Window deletion is
14291 handled by window.el.
640c8776
SM
14292 (window_loop): Remove DELETE_OTHER_WINDOWS case.
14293 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
14294 (Fdelete_other_windows): Remove. Deleting other windows is
14295 handled by window.el.
14296 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
14297 handled in window.el.
14298 (window_min_size_2, window_min_size_1, window_min_size): Remove.
14299 Window minimum sizes are handled in window.el.
14300 (shrink_windows, size_window, set_window_height)
14301 (set_window_width, change_window_heights, window_height)
14302 (window_width, CURBEG, CURSIZE, enlarge_window)
14303 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
14304 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
14305 handled in window.el.
14306 (make_dummy_parent): Rename to make_parent_window and give it a
14307 second argument horflag.
14308 (make_window): Don't set resize_proportionally any more.
14309 (Fsplit_window): Remove. Windows are split in window.el.
14310 (save_restore_action, save_restore_orig_size)
14311 (shrink_window_lowest_first, save_restore_orig_size): Remove.
14312 Resize mini windows in window.el.
14313 (grow_mini_window, shrink_mini_window): Implement by calling
14314 Qresize_root_window_vertically, resize_window_check and
14315 resize_window_apply.
640c8776
SM
14316 (saved_window, Fset_window_configuration, save_window_save):
14317 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
14318 resize_proportionally.
14319 (window_min_height, window_min_width): Move to window.el.
14320 (keys_of_window): Move bindings for delete-other-windows,
14321 split-window, delete-window and enlarge-window to window.el.
14322
14323 * buffer.c: Temporarily extern Qdelete_window.
14324 (Fbury_buffer): Temporarily call Qdelete_window instead of
14325 Fdelete_window (Fbury_buffer will move to window.el soon).
14326
14327 * frame.c (set_menu_bar_lines_1): Remove code handling
14328 orig_top_line and orig_total_lines.
14329
14330 * dispnew.c (adjust_frame_glyphs_initially): Don't use
14331 set_window_height but set heights directly.
14332 (change_frame_size_1): Use resize_frame_windows.
14333
14334 * xdisp.c (init_xdisp): Don't use set_window_height but set
14335 heights directly.
14336
640c8776
SM
14337 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14338 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
14339 run_window_configuration_change_hook.
14340
14341 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14342 instead of change_window_heights and run
14343 run_window_configuration_change_hook.
14344
1a13852e
MR
143452011-06-09 Martin Rudalics <rudalics@gmx.at>
14346
14347 * window.c (replace_window): Rename second argument REPLACEMENT to
14348 NEW. New third argument SETFLAG. Rewrite.
14349 (delete_window, make_dummy_parent): Call replace_window with
14350 third argument 1.
14351 (window_list_1): Move down in code.
14352 (run_window_configuration_change_hook): Move set_buffer part
14353 before select_frame_norecord part in order to unwind correctly.
14354 Rename count1 to count.
14355 (recombine_windows, delete_deletable_window, resize_root_window)
14356 (Fdelete_other_windows_internal)
14357 (Frun_window_configuration_change_hook, make_parent_window)
14358 (resize_window_check, resize_window_apply, Fresize_window_apply)
14359 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
14360 (Fdelete_window_internal, Fresize_mini_window_internal):
14361 New functions.
1a13852e
MR
14362 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14363
f3d1777e
MR
143642011-06-08 Martin Rudalics <rudalics@gmx.at>
14365
496e208e
MR
14366 * window.h (window): Add some new members to window structure -
14367 normal_lines, normal_cols, new_total, new_normal, clone_number,
14368 splits, nest, prev_buffers, next_buffers.
14369 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 14370 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 14371
f3d1777e
MR
14372 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14373 Remove.
496e208e
MR
14374 (make_dummy_parent): Set new members of windows structure.
14375 (make_window): Move down in code. Handle new members of window
14376 structure.
14377 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14378 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14379 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14380 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
14381 (Fset_window_next_buffers, Fset_window_clone_number):
14382 New functions.
496e208e
MR
14383 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14384 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14385 Doc-string fixes.
14386 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14387 Argument WINDOW can be now internal window too.
14388 (Fwindow_use_time): Move up in code.
14389 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14390 Rewrite doc-string.
14391 (Fset_window_configuration, saved_window)
14392 (Fcurrent_window_configuration, save_window_save): Handle new
14393 members of window structure.
b9e809c2
MR
14394 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14395 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14396 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14397 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14398 Qget_mru_window, Qresize_root_window,
14399 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14400 Qauto_buffer_name; staticpro them.
f3d1777e 14401
abde8f8c
MR
144022011-06-07 Martin Rudalics <rudalics@gmx.at>
14403
14404 * window.c (Fwindow_total_size, Fwindow_left_column)
14405 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14406 (Fwindow_list_1): New functions.
14407 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
14408 (Fwindow_width, Fscroll_left, Fscroll_right):
14409 Use window_body_cols instead of window_box_text_cols.
14410 (delete_window, Fset_window_configuration):
14411 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
14412 (delete_all_subwindows): Take a window as argument and not a
14413 structure. Rewrite.
190b47e6
MR
14414 (window_loop): Remove handling of GET_LRU_WINDOW and
14415 GET_LARGEST_WINDOW.
14416 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
14417
14418 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
14419 window_box_text_cols. delete_all_subwindows now takes a
14420 Lisp_Object as argument.
abde8f8c 14421
640c8776
SM
14422 * indent.c (compute_motion, Fcompute_motion):
14423 Use window_body_cols instead of window_box_text_cols.
abde8f8c 14424
fa8a67e6
MR
14425 * frame.c (delete_frame): Call delete_all_subwindows with root
14426 window as argument.
14427
a54e3482
DC
144282011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14429
14430 * fns.c (Fputhash): Document return value.
14431
60002bf5
CY
144322011-06-06 Chong Yidong <cyd@stupidchicken.com>
14433
14434 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14435
0c671da6 144362011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 14437
b862a52a 14438 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 14439
be44ca6c
PE
14440 Check for overflow when converting integer to cons and back.
14441 * charset.c (Fdefine_charset_internal, Fdecode_char):
14442 Use cons_to_unsigned to catch overflow.
14443 (Fencode_char): Use INTEGER_TO_CONS.
14444 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14445 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14446 * data.c (long_to_cons, cons_to_long): Remove.
14447 (cons_to_unsigned, cons_to_signed): New functions.
14448 These signal an error for invalid or out-of-range values.
14449 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14450 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14451 * font.c (Ffont_variation_glyphs):
14452 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14453 * lisp.h: Include <intprops.h>.
14454 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14455 (cons_to_signed, cons_to_unsigned): New decls.
14456 (long_to_cons, cons_to_long): Remove decls.
14457 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14458 (Fprimitive_undo): Use CONS_TO_INTEGER.
14459 * xfns.c (Fx_window_property): Likewise.
14460 * xselect.c: Include <limits.h>.
14461 (x_own_selection, selection_data_to_lisp_data):
14462 Use INTEGER_TO_CONS.
14463 (x_handle_selection_request, x_handle_selection_clear)
14464 (x_get_foreign_selection, Fx_disown_selection_internal)
14465 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14466 (lisp_data_to_selection_data): Use cons_to_unsigned.
14467 (x_fill_property_data): Use cons_to_signed.
14468 Report values out of range.
14469
d1f3d2af
PE
14470 Check for buffer and string overflow more precisely.
14471 * buffer.h (BUF_BYTES_MAX): New macro.
14472 * lisp.h (STRING_BYTES_MAX): New macro.
14473 * alloc.c (Fmake_string):
14474 * character.c (string_escape_byte8):
14475 * coding.c (coding_alloc_by_realloc):
14476 * doprnt.c (doprnt):
14477 * editfns.c (Fformat):
14478 * eval.c (verror):
14479 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14480 since they may not be the same number.
14481 * editfns.c (Finsert_char):
14482 * fileio.c (Finsert_file_contents):
14483 Likewise for BUF_BYTES_MAX.
14484
dd52fcea
PE
14485 * image.c: Use ptrdiff_t, not int, for sizes.
14486 (slurp_file): Switch from int to ptrdiff_t.
14487 All uses changed.
14488 (slurp_file): Check that file size fits in both size_t (for
14489 malloc) and ptrdiff_t (for sanity and safety).
14490
7f9bbdbb
PE
14491 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14492 if b->modtime has its maximal value.
14493
dfe18f82
PE
14494 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14495
84acfcf0
PE
14496 Don't assume time_t can fit into int.
14497 * buffer.h (struct buffer.modtime): Now time_t, not int.
14498 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14499 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14500
ccd9a01a
PE
14501 Minor fixes for signed vs unsigned integers.
14502 * character.h (MAYBE_UNIFY_CHAR):
14503 * charset.c (maybe_unify_char):
14504 * keyboard.c (read_char, reorder_modifiers):
14505 XINT -> XFASTINT, since the integer must be nonnegative.
14506 * ftfont.c (ftfont_spec_pattern):
14507 * keymap.c (access_keymap, silly_event_symbol_error):
14508 XUINT -> XFASTINT, since the integer must be nonnegative.
14509 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14510 since it makes no difference and we prefer signed.
14511 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14512 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14513 nonnegative.
14514
d6d100dd
SM
145152011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14516
14517 * window.h (Fwindow_frame): Declare.
14518
2b6148e4
PE
145192011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14520
14521 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14522 (SPARE_MEMORY): Always define.
14523 (LARGE_REQUEST): Remove.
14524 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14525
f230ecc9
MR
145262011-06-06 Martin Rudalics <rudalics@gmx.at>
14527
727e958e
MR
14528 * lisp.h: Move EXFUNS for Fframe_root_window,
14529 Fframe_first_window and Fset_frame_selected_window to window.h.
14530
14531 * window.h: Move EXFUNS for Fframe_root_window,
14532 Fframe_first_window and Fset_frame_selected_window here from
14533 lisp.h.
14534
14535 * frame.c (Fwindow_frame, Fframe_first_window)
14536 (Fframe_root_window, Fframe_selected_window)
14537 (Fset_frame_selected_window): Move to window.c.
14538 (Factive_minibuffer_window): Move to minibuf.c.
14539 (Fother_visible_frames_p): New function.
14540
14541 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14542
f230ecc9
MR
14543 * window.c (decode_window, decode_any_window): Move up in code.
14544 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14545 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
14546 (Fwindow_buffer): Move up and rewrite doc-string.
14547 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14548 (Fwindow_prev): New functions.
727e958e
MR
14549 (Fwindow_frame): Move here from frame.c. Accept any window as
14550 argument.
14551 (Fframe_root_window, Fframe_first_window)
14552 (Fframe_selected_window): Move here from frame.c. Accept frame
14553 or arbitrary window as argument. Update doc-strings.
14554 (Fminibuffer_window): Move up in code.
14555 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
14556 (Fset_frame_selected_window): Move here from frame.c.
14557 Marginal rewrite.
727e958e
MR
14558 (Fselected_window, select_window, Fselect_window): Move up in
14559 code. Minor doc-string fixes.
f230ecc9 14560
4d09bcf6
PE
145612011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14562
14563 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14564 Do not assume that spare memory exists; that assumption is valid
14565 only if SYSTEM_MALLOC.
14566 (LARGE_REQUEST): New macro, so that the issue of large requests
14567 is separated from the issue of spare memory.
14568
810928a2
AS
145692011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14570
172418ad
AS
14571 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14572 format. (Bug#8806)
14573
43f862f7
AS
14574 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14575
810928a2
AS
14576 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14577 before statements.
14578
a059fe24
JD
145792011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14580
14581 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14582
14583 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14584
14585 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14586 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14587
989bf368
JB
145882011-06-05 Juanma Barranquero <lekktu@gmail.com>
14589
14590 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14591
4b80f674
CY
145922011-06-04 Chong Yidong <cyd@stupidchicken.com>
14593
14594 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14595 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
14596 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14597 New error handlers.
4b80f674
CY
14598 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14599 Obey Vx_select_enable_clipboard_manager. Catch errors in
14600 x_clipboard_manager_save (Bug#8779).
14601 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 14602 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 14603
99a33b77 146042011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
14605
14606 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14607
99a33b77 146082011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
14609
14610 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14611 in the current matrix if keep_current_p is non-zero.
14612
8264569d
EZ
146132011-06-04 Eli Zaretskii <eliz@gnu.org>
14614
14615 * bidi.c (bidi_level_of_next_char): Fix last change.
14616
57f97249
EZ
146172011-06-03 Eli Zaretskii <eliz@gnu.org>
14618
fec2107c 14619 Support bidi reordering of text covered by display properties.
57f97249 14620
fec2107c
EZ
14621 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14622 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14623 (bidi_cache_search, bidi_cache_iterator_state)
14624 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
14625 (bidi_level_of_next_char, bidi_move_to_visually_next):
14626 Support character positions inside a run of characters covered by a
fec2107c
EZ
14627 display string.
14628 (bidi_paragraph_init, bidi_resolve_explicit_1)
14629 (bidi_level_of_next_char): Call bidi_fetch_char and
14630 bidi_fetch_char_advance instead of FETCH_CHAR and
14631 FETCH_CHAR_ADVANCE.
14632 (bidi_init_it): Initialize new members.
14633 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14634 definitions.
14635 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14636 instead of using explicit *_CHAR codes.
d6d100dd
SM
14637 (bidi_resolve_explicit, bidi_resolve_weak):
14638 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
14639 bidirectional text is supported only in multibyte buffers.
14640 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14641 it to initialize the frame_window_p member of struct bidi_it.
14642 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14643 (bidi_resolve_explicit, bidi_resolve_weak)
14644 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14645 bidi_it->nchars is non-positive.
14646 (bidi_level_of_next_char): Don't try to lookup the cache for the
14647 next/previous character if nothing is cached there yet, or if we
14648 were just reseat()'ed to a new position.
c40e2fb2 14649
0e14fe90
EZ
14650 * xdisp.c (set_cursor_from_row): Set start and stop points
14651 according to the row's direction when priming the loop that looks
14652 for the glyph on which to display cursor.
14653 (single_display_spec_intangible_p): Function deleted.
14654 (display_prop_intangible_p): Reimplement to call
14655 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
14656 Accept 3 additional arguments needed by handle_display_spec.
14657 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
14658 values: lists, `(when COND...)' forms, etc.
14659 (single_display_spec_string_p): Support property values that are
14660 lists with the argument STRING its top-level element.
14661 (display_prop_string_p): Fix the condition for processing a
14662 property that is a list to be consistent with handle_display_spec.
fec2107c 14663 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
14664 last portion of handle_display_prop.
14665 (compute_display_string_pos): Accept additional argument
14666 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14667 value of a `display' property is a "replacing spec".
14668 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14669 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14670 the display property, but just return a value indicating whether
14671 the display property will replace the characters it covers.
14672 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14673 frame_window_p members of struct bidi_it.
d6d100dd
SM
14674 (compute_display_string_pos, compute_display_string_end):
14675 New functions.
fec2107c
EZ
14676 (push_it): Accept second argument POSITION, where pop_it should
14677 jump to continue iteration.
14678 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 14679
fec2107c
EZ
14680 * keyboard.c (adjust_point_for_property): Adjust the call to
14681 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
14682
14683 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
14684 (bidi_init_it): Update prototypes.
14685 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
14686 (compute_display_string_pos, compute_display_string_end):
14687 Declare prototypes.
fec2107c
EZ
14688 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14689 EMACS_INT.
fc6f18ce 14690
40087514 146912011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 14692
57f53182
PE
14693 Malloc failure behavior now depends on size of allocation.
14694 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14695 * lisp.h: Change signatures accordingly.
14696 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14697 All callers changed. (Bug#8762)
14698
14699 * gnutls.c: Use Emacs's memory allocators.
14700 Without this change, the gnutls library would invoke malloc etc.
14701 directly, which causes problems on non-SYNC_INPUT hosts, and which
14702 runs afoul of improving memory_full behavior. (Bug#8761)
14703 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14704 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14705 xfree instead of the default malloc, realloc, free.
14706 (Fgnutls_boot): No need to check for memory allocation failure,
14707 since xmalloc does that for us.
14708
ac32cd99 14709 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
14710 * category.c (hash_get_category_set):
14711 * ccl.c (ccl_driver):
14712 * charset.c (Fdefine_charset_internal):
14713 * charset.h (struct charset.hash_index):
14714 * composite.c (get_composition_id, gstring_lookup_cache)
14715 (composition_gstring_put_cache):
14716 * composite.h (struct composition.hash_index):
14717 * dispextern.h (struct image.hash):
14718 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14719 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14720 (hashfn_equal, hashfn_user_defined, make_hash_table)
14721 (maybe_resize_hash_table, hash_lookup, hash_put)
14722 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14723 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14724 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14725 * image.c (make_image, search_image_cache, lookup_image)
14726 (xpm_put_color_table_h):
14727 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 14728 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 14729 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 14730 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
14731 * alloc.c (allocate_vectorlike):
14732 Check for overflow in vector size calculations.
14733 * ccl.c (ccl_driver):
14734 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
14735 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14736 need to be updated by these changes.
40087514
PE
14737 * fns.c (make_hash_table, maybe_resize_hash_table):
14738 Check for integer overflow with large hash tables.
0de4bb68
PE
14739 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14740 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14741 (SXHASH_REDUCE): New macro.
14742 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14743 Use it instead of discarding useful hash info with large hash values.
14744 (sxhash_float): New function.
14745 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14746 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
14747 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14748 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
14749 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14750 Adjust signatures to match updated version of code.
14751 (consing_since_gc): Now EMACS_INT, since a single hash table can
14752 use more than INT_MAX bytes.
14753
698d32e2
DN
147542011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14755
14756 Make it possible to build with GCC-4.6+ -O2 -flto.
14757
14758 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14759
fd6fa53f
SM
147602011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14761
14762 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14763 Call minibuffer-inactive-mode.
14764
864db017
JB
147652011-05-31 Juanma Barranquero <lekktu@gmail.com>
14766
14767 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14768 Update dependencies.
14769
2ad0baf4
DN
147702011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14771
14772 * data.c (init_data): Remove code for UTS, this system is not
14773 supported anymore.
14774
4fcc2638
DN
147752011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14776
14777 Don't force ./temacs to start in terminal mode.
14778
14779 * frame.c (make_initial_frame): Initialize faces in all cases, not
14780 only when CANNOT_DUMP is defined.
14781 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14782
c56e0fd5
DN
147832011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14784
14785 * dispnew.c (add_window_display_history): Use const for the string
14786 pointer. Remove declaration, not needed.
14787
333d54da 147882011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 14789
55d4c1b2 14790 Use 'inline', not 'INLINE'.
333d54da 14791 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
14792 * alloc.c, fontset.c (INLINE): Remove.
14793 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14794 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14795 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14796 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14797 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14798
738db178
DN
147992011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14800
14801 Make it possible to run ./temacs.
14802
14803 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14804 syms_of_callproc does the same thing. Remove test for
14805 "initialized", do it in the caller.
14806 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14807
620c53a6
SM
148082011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14809
14810 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14811 (read_minibuf): Use get_minibuffer.
14812 (syms_of_minibuf): Use DEFSYM.
14813 (Qmetadata): New var.
14814 * data.c (Qbuffer): Don't make it static.
14815 (syms_of_data): Use DEFSYM.
14816
e003a292
PE
148172011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14818
14819 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14820 (CCL_CODE_MIN): New macro.
14821
ed008a6d
PE
148222011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14823
3687c2ef
PE
14824 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14825
ed008a6d
PE
14826 * eval.c (Qdebug): Now static.
14827 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14828 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14829 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14830
d66c4c7c
CY
148312011-05-29 Chong Yidong <cyd@stupidchicken.com>
14832
14833 * image.c: Various fixes to ImageMagick code comments.
14834 (Fimagemagick_types): Doc fix.
14835
5fbc2025
PE
148362011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14837
0196f88a
PE
14838 Minor fixes prompted by GCC 4.6.0 warnings.
14839
14840 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14841
5fbc2025
PE
14842 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14843 (x_clipboard_manager_save_all): Move extern decl to ...
14844 * xterm.h: ... here, so that it can be checked for consistency.
14845
1dd3c2d9
CY
148462011-05-29 Chong Yidong <cyd@stupidchicken.com>
14847
14848 * xselect.c (x_clipboard_manager_save_frame)
14849 (x_clipboard_manager_save_all): New functions.
14850 (Fx_clipboard_manager_save): Lisp function deleted.
14851
14852 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14853 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14854
14855 * xterm.h: Update prototype.
14856
5ba6571d
WX
148572011-05-28 William Xu <william.xwl@gmail.com>
14858
14859 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14860 exiting (Bug#8239).
14861
3eaff834
JM
148622011-05-28 Jim Meyering <meyering@redhat.com>
14863
e1900994 14864 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
14865 * fns.c (to_uchar): Define.
14866 (crypto_hash_function): Use it to convert some newly-signed
14867 variables to unsigned, to avoid sign-extension bugs. For example,
14868 without this change, (md5 "truc") would evaluate to
14869 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14870 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 14871 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 14872
0f6990a7
PE
148732011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14874
14875 Integer overflow fixes.
c8a9ca5a 14876
08686060
PE
14877 * dbusbind.c: Serial number integer overflow fixes.
14878 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
14879 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14880 to hold a serial number that is too large for a fixnum.
14881 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14882 Check for serial numbers out of range. Decode any serial number
59568bf0 14883 that was so large that it became a float. (Bug#8722)
08686060 14884
2d1fc3c7
PE
14885 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14886 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14887 Use XFASTINT rather than XUINT when numbers are nonnegative.
14888 (xd_append_arg, Fdbus_method_return_internal):
14889 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14890 arguments, check that Lisp number is nonnegative, rather than
59568bf0 14891 silently wrapping negative numbers around. (Bug#8722)
30217ff0 14892 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 14893 (Bug#8722)
2d1fc3c7 14894
c8a9ca5a
PE
14895 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14896
519e1d69
PE
14897 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14898
6df6ae42 14899 ccl: Add integer overflow checks.
30569699
PE
14900 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14901 (IN_INT_RANGE): New macros.
14902 (ccl_driver): Use them to check for integer overflow when
14903 decoding a CCL program. Many of the new checks are whether XINT (x)
14904 fits in int; it doesn't always, on 64-bit hosts. The new version
14905 doesn't catch all possible integer overflows, but it's an
847044ea 14906 improvement. (Bug#8719)
30569699 14907
c11285dc
PE
14908 * alloc.c (make_event_array): Use XINT, not XUINT.
14909 There's no need for unsigned here.
14910
fdccd48e
PE
14911 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14912 This follows up to the 2011-05-06 change that substituted uintptr_t
14913 for EMACS_INT. This case wasn't caught back then.
14914
37910ab2
PE
14915 Rework Fformat to avoid integer overflow issues.
14916 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14917 now (part of C89). Include <verify.h>.
14918 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14919 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14920 (Fformat): Avoid the prepass trying to compute sizes; it was only
14921 approximate and thus did not catch overflow reliably. Instead, walk
14922 through the format just once, formatting and computing sizes as we go,
14923 checking for integer overflow at every step, and allocating a larger
14924 buffer as needed. Keep track separately whether the format is
14925 multibyte. Keep only the most-recently calculated precision, rather
14926 than them all. Record whether each argument has been converted to
14927 string. Use EMACS_INT, not int, for byte and char and arg counts.
14928 Support field widths and precisions larger than INT_MAX. Avoid
14929 sprintf's undefined behavior with conversion specifications such as %#d
14930 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14931 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14932 formatting out-of-range floating point numbers with int
9173deec 14933 formats. (Bug#8668)
37910ab2 14934
2e6578fb
PE
14935 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14936
0ae6bdee
PE
14937 * data.c: Avoid integer truncation in expressions involving floats.
14938 * data.c: Include <intprops.h>.
14939 (arith_driver): When there's an integer overflow in an expression
14940 involving floating point, convert the integers to floating point
14941 so that the resulting value does not suffer from catastrophic
14942 integer truncation. For example, on a 64-bit host (* 4
14943 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14944 Do not rely on undefined behavior after integer overflow.
14945
de883a70
PE
14946 merge count_size_as_multibyte, parse_str_to_multibyte
14947 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 14948 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
14949 Check for integer overflow.
14950 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14951 since it's now a duplicate of the other. This is more of
14952 a character than a buffer op, so better that it's in character.c.
14953 * fns.c, print.c: Adjust to above changes.
14954
2ff916cb
PE
149552011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14956
14957 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14958
f1b54466
PE
149592011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14960
fb1ac845
PE
14961 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14962 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14963 (x_clipboard_manager_save): Now static.
14964 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14965
f1b54466
PE
14966 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14967 (crypto_hash_function): Now static.
14968 Fix pointer signedness problems. Avoid unnecessary initializations.
14969
a9f737ee
CY
149702011-05-27 Chong Yidong <cyd@stupidchicken.com>
14971
14972 * termhooks.h (Vselection_alist): Make it terminal-local.
14973
14974 * terminal.c (create_terminal): Initialize it.
14975
14976 * xselect.c: Support for clipboard managers.
14977 (Vselection_alist): Move to termhooks.h as terminal-local var.
14978 (LOCAL_SELECTION): New macro.
14979 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14980 (symbol_to_x_atom): Remove gratuitous arg.
14981 (x_handle_selection_request, lisp_data_to_selection_data)
14982 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
14983 (x_own_selection, x_get_local_selection, x_convert_selection):
14984 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
14985 (some_frame_on_display): Delete unused function.
14986 (Fx_own_selection_internal, Fx_get_selection_internal)
14987 (Fx_disown_selection_internal, Fx_selection_owner_p)
14988 (Fx_selection_exists_p): New optional frame arg.
14989 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14990 (x_handle_selection_clear): Don't treat other terminals with the
14991 same keyboard specially. Use the terminal-local Vselection_alist.
14992 (x_clear_frame_selections): Use Frun_hook_with_args.
14993
14994 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14995
14996 * xterm.h: Add support for those atoms.
14997
e067f0c1
CY
149982011-05-26 Chong Yidong <cyd@stupidchicken.com>
14999
15000 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15001 (converted_selections, conversion_fail_tag): New global variables.
15002 (x_selection_request_lisp_error): Free the above.
15003 (x_get_local_selection): Remove unnecessary code.
15004 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
15005 of converted selections stored in converted_selections.
15006 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
15007 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15008 (x_convert_selection): New function.
15009 (x_handle_selection_event): Simplify.
15010 (x_get_foreign_selection): Don't ignore incoming requests while
15011 waiting for an answer; this will fail when we implement
15012 SAVE_TARGETS, and seems unnecessary anyway.
15013 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15014 (Vx_sent_selection_functions): Doc fix.
15015
0f4aebc0
LL
150162011-05-26 Leo Liu <sdl.web@gmail.com>
15017
15018 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
15019
e61124cd
YM
150202011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15021
15022 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15023
15024 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15025 for fringe update if it has periodic bitmap.
ac389d0c 15026 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
15027 and fringe_bitmap_periodic_p.
15028
15029 * fringe.c (get_fringe_bitmap_data): New function.
15030 (draw_fringe_bitmap_1, update_window_fringes): Use it.
15031 (update_window_fringes): Record periodicity of fringe bitmap in glyph
15032 row. Mark glyph row for fringe update if periodicity changed.
15033
15034 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15035 for fringe update unless it has periodic bitmap.
15036
f16d9837
KH
150372011-05-25 Kenichi Handa <handa@m17n.org>
15038
15039 * xdisp.c (get_next_display_element): Set correct it->face_id for
15040 a static composition.
15041
e1b90ef6
LL
150422011-05-24 Leo Liu <sdl.web@gmail.com>
15043
15044 * deps.mk (fns.o):
15045 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15046
15047 * fns.c (crypto_hash_function, Fsha1): New function.
15048 (Fmd5): Use crypto_hash_function.
15049 (syms_of_fns): Add Ssha1.
15050
7400048f
PE
150512011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15052
15053 * gnutls.c: Remove unused macros.
15054 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15055 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15056 Remove macros that are defined and never used.
15057 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15058
abb71cf4
CY
150592011-05-22 Chong Yidong <cyd@stupidchicken.com>
15060
15061 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15062 (Fx_get_selection_internal): Minor cleanup.
15063 (Fx_own_selection_internal): Rename arguments for consistency with
15064 select.el.
15065
6307db39
PE
150662011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15067
15068 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15069
f3d4e0a4
CY
150702011-05-22 Chong Yidong <cyd@stupidchicken.com>
15071
15072 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15073
4d8ade89
YM
150742011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15075
15076 * dispnew.c (scrolling_window): Don't exclude the case that the
15077 last enabled row in the desired matrix touches the bottom boundary.
15078
32078c8d
GM
150792011-05-21 Glenn Morris <rgm@gnu.org>
15080
15081 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
15082 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15083 and add some more files.
32078c8d 15084
7285dc67
EZ
150852011-05-20 Eli Zaretskii <eliz@gnu.org>
15086
15087 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15088 report_file_error introduced by the change from 2011-05-07.
15089
89d1bd22
PE
150902011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15091
15092 * systime.h (Time): Define only if emacs is defined.
15093 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15094 where the include path doesn't have X11/X.h by default. See
15095 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15096
cd394be1 150972011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
15098
15099 * composite.c (find_automatic_composition): Fix previous change.
15100
b9704ad9
GM
151012011-05-20 Glenn Morris <rgm@gnu.org>
15102
15103 * lisp.mk: New file, split from Makefile.in.
15104 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15105 (shortlisp): Remove.
15106 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15107
4a720484
GM
151082011-05-19 Glenn Morris <rgm@gnu.org>
15109
15110 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15111 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15112 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15113 (lisp): Set the order to that of loadup.el.
15114 (shortlisp): Make it a copy of $lisp.
15115 (SOME_MACHINE_LISP): Remove.
15116 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15117 Use just $shortlisp, not $SOME_MACHINE_LISP too.
15118
a28d4396
KH
151192011-05-18 Kenichi Handa <handa@m17n.org>
15120
15121 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
15122 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
15123 (find_automatic_composition): Mostly rewrite for efficiency.
15124
a2b1fa8e
JB
151252011-05-18 Juanma Barranquero <lekktu@gmail.com>
15126
15127 * makefile.w32-in: Update dependencies.
15128
8e1f5610
CS
151292011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
15130
15131 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 15132 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 15133
7025ee00 151342011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 15135
cdfa6eab
PE
15136 Fix some integer overflow issues, such as string length overflow.
15137
06d6db33
PE
15138 * insdel.c (count_size_as_multibyte): Check for string overflow.
15139
2b4560a8
PE
15140 * character.c (lisp_string_width): Check for string overflow.
15141 Use EMACS_INT, not int, for string indexes and lengths; in
15142 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
15143 the resulting string length overflows an EMACS_INT; instead,
15144 report a string overflow if no precision given. When checking for
15145 precision exhaustion, use a check that cannot possibly have
15146 integer overflow. (Bug#8675)
15147 * character.h (lisp_string_width): Adjust to new signature.
15148
cb93f9be
PE
15149 * alloc.c (string_overflow): New function.
15150 (Fmake_string): Use it. This doesn't change behavior, but saves
15151 a few bytes and will simplify future changes.
15152 * character.c (string_escape_byte8): Likewise.
15153 * lisp.h (string_overflow): New decl.
15154
1a1f3366
PE
15155 Fixups, following up to the user-interface timestamp change.
15156 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
15157 for UI timestamps, instead of unsigned long.
9fbd6841
PE
15158 * msdos.c (mouse_get_pos): Likewise.
15159 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
15160 * w32gui.h (Time): Define by including "systime.h" rather than by
15161 declaring it ourselves. (Bug#8664)
15162
d4e3e4d3
PE
15163 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
15164 * image.c (clear_image_cache): Likewise.
15165
f6a24d19
PE
15166 * term.c (term_mouse_position): Don't assume time_t wraparound.
15167
08dc5ae6
PE
15168 Be more systematic about user-interface timestamps.
15169 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
15170 and sometimes 'EMACS_UINT', to represent these timestamps.
15171 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
15172 This makes the code easier to follow, and makes it easier to catch
15173 integer overflow bugs such as Bug#8664.
15174 * frame.c (Fmouse_position, Fmouse_pixel_position):
15175 Use Time, not unsigned long, for user-interface timestamps.
15176 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
15177 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
15178 * keyboard.h (last_event_timestamp): Likewise.
15179 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15180 * menu.h (xmenu_show): Likewise.
15181 * term.c (term_mouse_position): Likewise.
15182 * termhooks.h (struct input_event.timestamp): Likewise.
15183 (struct terminal.mouse_position_hook): Likewise.
15184 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15185 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15186 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
15187 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15188 what it was before.
15189 * menu.h, termhooks.h: Include "systime.h", for Time.
15190
8e55734a
PE
15191 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15192 Don't assume that the difference between two unsigned long values
15193 can fit into an integer. At this point, we know button_down_time
15194 <= event->timestamp, so the difference must be nonnegative, so
15195 there's no need to cast the result if double-click-time is
15196 nonnegative, as it should be; check that it's nonnegative, just in
15197 case. This bug is triggered when events are more than 2**31 ms
86db42d2 15198 apart (about 25 days). (Bug#8664)
8e55734a 15199
841f1b75 15200 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 15201 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 15202
3e26f69c
PE
15203 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15204 that always fit in int. Use a sentinel instead of a counter, to
15205 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
15206 * frame.h (struct frame): Use int for menu_bar_items_used
15207 instead of EMACS_INT, since it always fits in int.
3e26f69c 15208
5cc152c0
PE
15209 * menu.c (grow_menu_items): Check for int overflow.
15210
d89eb65e
PE
15211 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15212
5235bd3e
PE
15213 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15214 Before, the code was not consistent. These values cannot exceed
15215 2**31 - 1 so there's no need to make them unsigned.
15216 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15217 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15218 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15219 as modifiers.
15220 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15221
bc827e23
PE
15222 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15223 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15224 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15225 presumably because the widths might not match.
15226
78eb494e
PE
15227 * window.c (size_window): Avoid needless test at loop start.
15228
04f2d78b
CB
152292011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
15230
15231 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15232
d2fc7e3d 152332011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
15234
15235 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15236
d2fc7e3d 152372011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
15238
15239 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15240 `width' to `bar_area_x' and `bar_area_width', respectively.
15241 (x_scroll_run): Take account of fringe background extension.
15242
04f2d78b
CB
15243 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15244 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
15245 `bar_area_width', respectively.
15246 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15247 background extension.
15248
79b70037
GM
152492011-05-10 Jim Meyering <meyering@redhat.com>
15250
15251 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15252
2f142cc5
JB
152532011-05-10 Juanma Barranquero <lekktu@gmail.com>
15254
15255 * image.c (Finit_image_library): Return t for built-in image types,
15256 like pbm and xbm. (Bug#8640)
15257
57679c86
AS
152582011-05-09 Andreas Schwab <schwab@linux-m68k.org>
15259
15260 * w32menu.c (set_frame_menubar): Fix submenu allocation.
15261
888c9e86
EZ
152622011-05-07 Eli Zaretskii <eliz@gnu.org>
15263
b0512a1d
EZ
15264 * w32console.c (Fset_screen_color): Doc fix.
15265 (Fget_screen_color): New function.
15266 (syms_of_ntterm): Defsubr it.
15267
7285dc67
EZ
15268 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15269 unlink the temporary file if Fcall_process didn't create it in the
15270 first place.
15271 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15272 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
15273 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
15274 cue to call_process_cleanup not to close that handle.
15275
4d3fcc8e
BK
152762011-05-07 Ben Key <bkey76@gmail.com>
15277
15278 * makefile.w32-in: The bootstrap-temacs rule now makes use of
15279 one of two shell specific rules, either bootstrap-temacs-CMD or
15280 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
15281 to the previous implementation of the bootstrap-temacs rule.
15282 The bootstrap-temacs-CMD rule is similar to the previous
15283 implementation of the bootstrap-temacs rule except that it
15284 makes use of the ESC_CFLAGS variable instead of the CFLAGS
15285 variable.
15286
15287 These changes, along with some changes to nt/configure.bat,
15288 nt/gmake.defs, and nt/nmake.defs, are required to extend my
15289 earlier fix to add support for --cflags and --ldflags options
15290 that include quotes so that it works whether make uses cmd or
15291 sh as the shell.
15292
b4289b64
MA
152932011-05-06 Michael Albinus <michael.albinus@gmx.de>
15294
15295 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
15296 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
15297 is a constant.
15298 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
15299 a string. Handle both cases.
15300 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
15301 (Fdbus_register_method): Use Qinvalid_function.
15302
af4c0e28
JB
153032011-05-06 Juanma Barranquero <lekktu@gmail.com>
15304
15305 * makefile.w32-in: Update dependencies.
15306 (LISP_H): Add inttypes.h and stdin.h.
15307 (PROCESS_H): Add unistd.h.
15308
c51453d9
EZ
153092011-05-06 Eli Zaretskii <eliz@gnu.org>
15310
15311 * lread.c: Include limits.h (fixes the MS-Windows build broken by
15312 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15313
8ff0ac3c 153142011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 15315
4c4b566b
PE
15316 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15317
aab2b9b5
PE
15318 * term.c (vfatal): Remove stray call to va_end.
15319 It's not needed and the C Standard doesn't allow it here anyway.
15320
c378da0b
PE
15321 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15322 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
15323
288b08c7
PE
15324 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15325 bytes.
15326
e3601888
PE
15327 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15328
db6c0e74
PE
15329 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15330
dd5963ea
PE
15331 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15332
88c9450f
PE
15333 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15334
2f9442b8
PE
15335 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15336
c032b5f8
PE
15337 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15338 * charset.c (Fdefine_charset_internal): Don't initialize
15339 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 15340 32-bit int (Bug#8600).
a108c10b
PE
15341
15342 * lread.c (read_integer): Be more consistent with string-to-number.
15343 Use string_to_number to do the actual conversion; this avoids
15344 rounding errors and fixes some other screwups. Without this fix,
15345 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15346 (digit_to_number): Move earlier, for benefit of read_integer.
15347 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 15348 not a digit in any supported base. (Bug#8602)
a108c10b 15349
ad5f9eea
PE
15350 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15351
aec1708a
PE
15352 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15353 to match comment at start of function. This also removes a
15354 GCC warning about overflow in a 32+64-bit port.
15355
47be4ab5
PE
15356 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15357
371cac43
PE
15358 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15359 Reported by Stefan Monnier in
15360 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
15361 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15362 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 15363
d01a7826
PE
15364 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15365 (EMACS_UINTPTR): Likewise, with uintptr_t.
15366
7fd47d5c
PE
15367 * lisp.h: Prefer 64-bit EMACS_INT if available.
15368 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15369 on 32-bit hosts that have 64-bit int, so that they can access
15370 large files.
122b0c86
PE
15371 However, temporarily disable this change unless the temporary
15372 symbol WIDE_EMACS_INT is defined.
7fd47d5c 15373
8727937b
PE
15374 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15375
8ac068ac
PE
15376 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15377 This removes an assumption that EMACS_INT and long are the same
15378 width as pointers. The assumption is true for Emacs porting targets
15379 now, but we want to make other targets possible.
15380 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15381 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15382 In the rest of the code, change types of integers that hold casted
15383 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15384 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15385 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15386 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15387 No need to cast type when ORing.
15388 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15389 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15390 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15391 assume EMACS_INT is the same width as char *.
15392 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15393 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15394 Remove no-longer-needed casts.
15395 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15396 (xg_tool_bar_help_callback, xg_make_tool_item):
15397 Use EMACS_INTPTR to hold an integer
15398 that will be cast to void *; this can avoid a GCC warning
15399 if EMACS_INT is not the same width as void *.
15400 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15401 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15402 (current_message_1, set_message_1):
15403 Use a local to convert to proper width without a cast.
15404 * xmenu.c (dialog_selection_callback): Likewise.
15405
ede49d71
PE
15406 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15407 Also, don't assume VALBITS / RAND_BITS is less than 5,
15408 and don't rely on undefined behavior when shifting a 1 left into
15409 the sign bit.
15410 * lisp.h (get_random): Change signature to match.
15411
2f30ecd0
PE
15412 * lread.c (hash_string): Use size_t, not int, for hash computation.
15413 Normally we prefer signed values; but hashing is special, because
15414 it's better to use unsigned division on hash table sizes so that
15415 the remainder is nonnegative. Also, size_t is the natural width
15416 for hashing into memory. The previous code used 'int', which doesn't
15417 retain enough info to hash well into very large tables.
15418 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15419
2a866e7b
PE
15420 * dbusbind.c: Don't possibly lose pointer info when converting.
15421 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15422 Use XPNTR rather than XHASH, so that the high-order bits of
15423 the pointer aren't lost when converting through void *.
15424
51639eac
PE
15425 * eval.c (Fautoload): Don't double-shift a pointer.
15426
92394119
PE
15427 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15428
dbdb9a7c
JB
154292011-05-06 Juanma Barranquero <lekktu@gmail.com>
15430
15431 * gnutls.c (DEF_GNUTLS_FN):
15432 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15433
db7a0b4f
AS
154342011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15435
15436 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15437 marker. (Bug#8610)
15438
cd394be1 154392011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
15440
15441 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15442 New version that can reserve upto 2GB of heap space.
15443
f7ff1b0f 154442011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
15445
15446 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15447
639c109b
TZ
154482011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15449
15450 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15451 `gnutls_certificate_set_x509_key_file'.
15452
d2127135
JB
154532011-05-05 Juanma Barranquero <lekktu@gmail.com>
15454
15455 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15456 Update dependencies.
15457
e968f4f3
JB
154582011-05-04 Juanma Barranquero <lekktu@gmail.com>
15459
15460 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15461 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15462 Remove unused parameter `fildes'.
15463 * process.c (read_process_output, send_process): Don't pass it.
15464
84d358f0
JB
154652011-05-04 Juanma Barranquero <lekktu@gmail.com>
15466
15467 Fix previous change: the library cache is defined in w32.c.
15468 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15469 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15470
0898ca10
JB
154712011-05-04 Juanma Barranquero <lekktu@gmail.com>
15472
15473 Implement dynamic loading of GnuTLS on Windows.
15474
15475 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15476 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15477 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15478 Declare.
15479
15480 * gnutls.c (Qgnutls_dll): Define.
15481 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15482 (gnutls_*): Declare function pointers.
15483 (init_gnutls_functions): New function to initialize function pointers.
15484 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15485 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15486 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15487 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15488 (emacs_gnutls_write, emacs_gnutls_read)
15489 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15490 (Fgnutls_available_p): New function.
15491 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15492 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15493 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15494
15495 * image.c: Include w32.h.
15496 (Vimage_type_cache): Delete.
15497 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15498 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15499 (w32_delayed_load): Move to w32.c.
15500
15501 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15502
15503 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15504 (w32_delayed_load): Move from image.c. When loading a library, record
15505 its filename in the :loaded-from property of the library id.
15506 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15507 Initialize and staticpro them.
15508 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15509
15510 * process.c: Include lisp.h before w32.h, not after.
15511 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15512 instead of gnutls_record_check_pending.
15513
15514 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15515
ff4de4aa
TZ
155162011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15517
15518 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15519 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15520 as passed in.
15521
abe95abb
JD
155222011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15523
15524 * xterm.c (x_set_frame_alpha): Do not set property on anything
15525 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15526
e16e55d4
JB
155272011-05-02 Juanma Barranquero <lekktu@gmail.com>
15528
15529 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15530
bafcf6a5
JB
155312011-05-02 Juanma Barranquero <lekktu@gmail.com>
15532
15533 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15534 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15535 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15536 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15537 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15538 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15539 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15540 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15541 (Qgnutls_bootprop_callbacks_verify): Make static.
15542
e7a6747f
AS
155432011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15544
19ed11ba
AS
15545 * callproc.c: Indentation fixup.
15546
e7a6747f 15547 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
15548 (wait_for_termination, interruptible_wait_for_termination):
15549 Move after wait_for_termination_1.
e7a6747f 15550
1ef14cb4
LMI
155512011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15552
15553 * sysdep.c (interruptible_wait_for_termination): New function
15554 which is like wait_for_termination, but allows keyboard
15555 interruptions.
15556
15557 * callproc.c (Fcall_process): Add (:file "file") as an option for
15558 the STDOUT buffer.
15559 (Fcall_process_region): Ditto.
15560
330d880c
EZ
155612011-04-30 Eli Zaretskii <eliz@gnu.org>
15562
8db90b73
EZ
15563 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15564 rather than `XVECTOR (FOO)->size'.
15565
330d880c
EZ
15566 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15567 inttypes.h, as a gnulib replacement is used if it not available in
15568 system headers.
15569
15cbd324
EZ
155702011-04-21 Eli Zaretskii <eliz@gnu.org>
15571
15572 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15573 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15574 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15575
15576 * coding.c (coding_alloc_by_realloc): Error out if destination
15577 will grow beyond MOST_POSITIVE_FIXNUM.
15578 (decode_coding_emacs_mule): Abort if there isn't enough place in
15579 charbuf for the composition carryover bytes. Reserve an extra
15580 space for up to 2 characters produced in a loop.
15581 (decode_coding_iso_2022): Abort if there isn't enough place in
15582 charbuf for the composition carryover bytes.
15583
155842011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 15585
ae940cca
EZ
15586 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15587 aborting when %lld or %lll format is passed.
15588 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15589 %llo or %llx format is passed. (Bug#8545)
15590
03ab8921
EZ
15591 * window.c (window_scroll_line_based): Use a marker instead of
15592 simple variables to record original value of point. (Bug#7952)
15593
afda1437
EZ
15594 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15595 produced by %s or %c overflows available buffer space. (Bug#8545)
15596
f76dee0c
PE
155972011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15598
15599 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 15600 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 15601
fdc5744d
JB
156022011-04-28 Juanma Barranquero <lekktu@gmail.com>
15603
15604 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15605
638f053a
JB
156062011-04-28 Juanma Barranquero <lekktu@gmail.com>
15607
15608 * keyboard.c (Qdelayed_warnings_hook): Define.
15609 (command_loop_1): Run `delayed-warnings-hook'
15610 if Vdelayed_warnings_list is non-nil.
15611 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15612 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15613
d178f871
EZ
156142011-04-28 Eli Zaretskii <eliz@gnu.org>
15615
15616 * doprnt.c (doprnt): Don't return value smaller than the buffer
15617 size if the message was truncated. (Bug#8545).
15618
b124fd93
JB
156192011-04-28 Juanma Barranquero <lekktu@gmail.com>
15620
15621 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15622 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15623
e810457d
PE
156242011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15625
15626 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15627
ea51cceb
JB
156282011-04-27 Juanma Barranquero <lekktu@gmail.com>
15629
15630 * makefile.w32-in: Update dependencies.
15631
94dcfacf
EZ
156322011-04-27 Eli Zaretskii <eliz@gnu.org>
15633
15634 Improve `doprnt' and its usage. (Bug#8545)
15635 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15636 `format_end'. Remove support for %l as a conversion specifier.
15637 Don't use xrealloc. Improve diagnostics when the %l size modifier
15638 is used. Update the commentary.
15639
15640 * eval.c (verror): Simplify calculation of size_t.
15641
15642 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15643 messages.
15644
f61f41d7
PE
156452011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15646
15647 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15648 change.
15649
96fb4434
PE
156502011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15651
15652 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15653 This makes this file independent of the recent pseudovector change.
15654
671875da 156552011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 15656
69e9b5a3
PE
15657 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15658
b5f869a7 15659 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 15660 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 15661 Remove unused local.
c8926152 15662 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 15663
841a1577 15664 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
15665 GCC 4.6.0 optimizes based on type-based alias analysis.
15666 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
15667 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15668 != &v->size, and therefore "v->size = 1; b->size = 2; return
15669 v->size;" must therefore return 1. This assumption is incorrect
15670 for Emacs, since it type-puns struct Lisp_Vector * with many other
15671 types. To fix this problem, this patch adds a new type struct
f904488f 15672 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
15673 and pseudovectors, and helps optimizing compilers not get fooled
15674 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15675 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
15676 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15677 the size member.
eab3844f
PE
15678 (XSETPVECTYPE): Rewrite in terms of new macro.
15679 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15680 This is a bit clearer, and further avoids the possibility of
15681 undesirable aliasing.
15682 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 15683 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
15684 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15685 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
15686 (ASIZE): Now uses header.size rather than size.
15687 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
15688 to avoid the hassle of writing XVECTOR (foo)->header.size.
15689 (struct vectorlike_header): New type.
eab3844f
PE
15690 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15691 object, to help avoid aliasing.
15692 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15693 (SUBRP): Likewise, since Lisp_Subr is a special case.
15694 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15695 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15696 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 15697 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
15698 changed to be "header.size" and "header.next".
15699 * buffer.h (struct buffer): Likewise.
15700 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15701 * frame.h (struct frame): Likewise.
15702 * process.h (struct Lisp_Process): Likewise.
15703 * termhooks.h (struct terminal): Likewise.
15704 * window.c (struct save_window_data, struct saved_window): Likewise.
15705 * window.h (struct window): Likewise.
15706 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15707 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15708 * buffer.c (init_buffer_once): Likewise.
15709 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15710 special case.
15711 * process.c (Fformat_network_address): Use local var for size,
15712 for brevity.
15713
0df1eac5
PE
15714 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15715
847ab9d1 15716 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
15717 * data.c (atof): Remove decl; no longer used or needed.
15718 (digit_to_number): Move to lread.c.
15719 (Fstring_to_number): Use new string_to_number function, to be
15720 consistent with how the Lisp reader treats infinities and NaNs.
15721 Do not assume that floating-point numbers represent EMACS_INT
15722 without losing information; this is not true on most 64-bit hosts.
15723 Avoid double-rounding errors, by insisting on integers when
15724 parsing non-base-10 numbers, as the documentation specifies.
15725 * lisp.h (string_to_number): New decl, replacing ...
15726 (isfloat_string): Remove.
bc0a5c13 15727 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 15728 (read1): Do not accept +. and -. as integers; this
452f4150
PE
15729 appears to have been a coding error. Similarly, do not accept
15730 strings like +-1e0 as floating point numbers. Do not report
15731 overflow for integer overflows unless the base is not 10 which
15732 means we have no simple and reliable way to continue.
15733 Break out the floating-point parsing into a new
15734 function string_to_number, so that Fstring_to_number parses
15735 floating point numbers consistently with the Lisp reader.
04f2d78b 15736 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
15737 (E_CHAR, EXP_INT): Remove, replacing with ...
15738 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15739 (string_to_number): New function, replacing isfloat_string.
15740 This function checks for valid syntax and produces the resulting
15741 Lisp float number too. Rework it so that string-to-number
bc0a5c13 15742 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
15743 so that overflow for non-base-10 numbers is reported only when
15744 there's no portable and simple way to convert to floating point.
452f4150 15745
67769ffc
PE
15746 * textprop.c (set_text_properties_1): Rewrite for clarity,
15747 and to avoid GCC warning about integer overflow.
15748
c20db43f
PE
15749 * intervals.h (struct interval): Use EMACS_INT for members
15750 where EMACS_UINT might cause problems. See
15751 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15752 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15753 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15754 All uses changed.
37aa2f85
PE
15755 (offset_intervals): Tell GCC not to worry about length overflow
15756 when negating a negative length.
c20db43f 15757
2538aa2f
PE
15758 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15759 (overrun_check_free): Likewise.
15760
f2d3008d
PE
15761 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15762 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15763 word size.
15764
ec8df744
PE
15765 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15766 (gnutls_make_error): Rename local to avoid shadowing.
15767 (gnutls_emacs_global_deinit): ifdef out; not used.
15768 (Fgnutls_boot): Use const for pointer to readonly storage.
15769 Comment out unused local. Fix pointer signedness problems.
15770
640ee02d
PE
15771 * lread.c (openp): Don't stuff size_t into an 'int'.
15772 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15773 about possible signed overflow.
15774
6048fb2a
PE
15775 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15776 (GDK_KEY_g): Don't define if already defined.
15777 (xg_prepare_tooltip): Avoid pointer signedness problem.
15778 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15779
fa3c87e1
PE
15780 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15781 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15782
2172544b
PE
15783 * xfns.c (Fx_window_property): Simplify a bit,
15784 to make a bit faster and to avoid GCC 4.6.0 warning.
15785 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15786
9b821a21
PE
15787 * fns.c (internal_equal): Don't assume size_t fits in int.
15788
3c616cfa
PE
15789 * alloc.c (compact_small_strings): Tighten assertion a little.
15790
c2982e87
PE
15791 Replace pEd with more-general pI, and fix some printf arg casts.
15792 * lisp.h (pI): New macro, generalizing old pEd macro to other
15793 conversion specifiers. For example, use "...%"pI"d..." rather
15794 than "...%"pEd"...".
15795 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 15796 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
15797 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15798 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15799 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15800 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15801 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15802 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15803 64-bit hosts.
15804 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15805 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15806 * print.c (safe_debug_print, print_object): Likewise.
15807 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15808 to int.
6f04d126
PE
15809 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15810 avoiding the 0 flag, which is not portable.
c2982e87
PE
15811 * process.c (Fmake_network_process): Use pI to avoid cast.
15812 * region-cache.c (pp_cache): Likewise.
15813 * xdisp.c (decode_mode_spec): Likewise.
15814 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15815 behavior on 64-bit hosts with printf arg.
6f04d126 15816 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
15817 (x_stop_queuing_selection_requests): Likewise.
15818 (x_get_window_property): Don't truncate byte count to an 'int'
15819 when tracing.
0b432f21 15820
5e073ec7
PE
15821 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15822 here, since it parses constructs like leading '-' and spaces,
15823 which are not wanted; and it overflows with large numbers.
15824 Instead, simply match F[0-9]+, which is what is wanted anyway.
15825
36372bf9
PE
15826 * alloc.c: Remove unportable assumptions about struct layout.
15827 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15828 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15829 (allocate_vectorlike, make_pure_vector): Use the new macros,
15830 plus offsetof, to remove unportable assumptions about struct layout.
15831 These assumptions hold on all porting targets that I know of, but
15832 they are not guaranteed, they're easy to remove, and removing them
15833 makes further changes easier.
15834
0b432f21
PE
15835 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15836 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
15837 (string_overrun_cookie): Now const. Use initializers that
15838 don't formally overflow signed char, to avoid warnings.
000098c1
PE
15839 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15840 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
15841 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15842 multiple of sizeof (EMACS_INT); it need not be, if
15843 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 15844 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 15845
895009e1
JB
158462011-04-26 Juanma Barranquero <lekktu@gmail.com>
15847
15848 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15849
6a7a1b0b
TZ
158502011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15851
15852 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 15853 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
15854 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15855
841a1577 158562011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
15857
15858 * lisp.h (Qdebug): List symbol.
895009e1 15859 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
15860 * keyboard.c (debug-on-event): New variable.
15861 (handle_user_signal): Break into debugger when debug-on-event
15862 matches the current signal symbol.
15863
f2d3ba6f
DN
158642011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15865
15866 * alloc.c (check_sblock, check_string_bytes)
15867 (check_string_free_list): Convert to standard C.
15868
42ce4c63
TZ
158692011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15870
15871 * w32.c (emacs_gnutls_push): Fix typo.
15872
825cd63c
EZ
158732011-04-25 Eli Zaretskii <eliz@gnu.org>
15874
fb11d64d
EZ
15875 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15876 "cast to pointer from integer of different size".
15877
825cd63c
EZ
15878 Improve doprnt and its use in verror. (Bug#8545)
15879 * doprnt.c (doprnt): Document the set of format control sequences
15880 supported by the function. Use SAFE_ALLOCA instead of always
15881 using `alloca'.
15882
15883 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15884 is one byte too soon. Don't use xrealloc; instead xfree and
15885 xmalloc anew.
15886
e061a11b
TZ
158872011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15888
15889 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15890 callbacks stage.
15891
15892 * gnutls.c: Renamed global_initialized to
15893 gnutls_global_initialized. Added internals for the
15894 :verify-hostname-error, :verify-error, and :verify-flags
15895 parameters of `gnutls-boot' and documented those parameters in the
15896 docstring. Start callback support.
9173deec
JB
15897 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15898 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15899 on error. Return error code.
e061a11b
TZ
15900 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15901 (emacs_gnutls_read): Likewise.
15902 (Fgnutls_boot): Return handshake error code.
15903 (emacs_gnutls_handle_error): New function.
15904 (wsaerror_to_errno): Likewise.
15905
15906 * w32.h (emacs_gnutls_pull): Add prototype.
15907 (emacs_gnutls_push): Likewise.
15908
15909 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15910 (emacs_gnutls_push): Likewise.
15911
159122011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15913
15914 * process.c (wait_reading_process_output): Check if GnuTLS
15915 buffered some data internally if no FDs are set for TLS
15916 connections.
15917
15918 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15919 (LIBS): Link to USER_LIBS.
15920 ($(BLD)/gnutls.$(0)): New target.
15921
fa6996bc
EZ
159222011-04-24 Eli Zaretskii <eliz@gnu.org>
15923
eb35682e
EZ
15924 * xdisp.c (handle_single_display_spec): Rename the
15925 display_replaced_before_p argument into display_replaced_p, to
15926 make it consistent with the commentary. Fix typos in the
15927 commentary.
15928
e2ad650c
EZ
15929 * textprop.c (syms_of_textprop): Remove dead code.
15930 (copy_text_properties): Delete obsolete commentary about an
15931 interface that was deleted long ago. Fix typos in the description
15932 of arguments.
15933
1b2de274
EZ
15934 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15935 to changes in oldXMenu/XMenu.h from 2011-04-16.
15936 <menu_help_message, prev_menu_help_message>: Constify.
15937 (IT_menu_make_room): menu->help_text is now `const char **';
15938 adjust.
15939
15940 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15941 to changes in oldXMenu/XMenu.h from 2011-04-16.
15942 (struct XMenu): Declare `help_text' `const char **'.
15943
15944 * xfaces.c <Qunspecified>: Make extern again.
15945
15946 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 15947 required by POSIX.
1b2de274 15948
762b15be
EZ
15949 * doc.c (get_doc_string): Improve the format passed to `error'.
15950
15951 * doprnt.c (doprnt): Improve commentary.
15952
15953 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15954
15955 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15956 them with etags.
15957
f1052e5d
EZ
15958 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15959 changes in globals.h immediately force recompilation.
762b15be
EZ
15960 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15961 $(CURDIR)/s/ms-w32.h.
15962 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 15963
fa6996bc
EZ
15964 * character.c (Fchar_direction): Function deleted.
15965 (syms_of_character): Don't defsubr it.
15966 <char-direction-table>: Deleted.
15967
e6c3da20
EZ
159682011-04-23 Eli Zaretskii <eliz@gnu.org>
15969
15970 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15971 * doprnt.c: Include limits.h.
15972 (SIZE_MAX): New macro.
04f2d78b
CB
15973 (doprnt): Return a size_t value. 2nd arg is now size_t.
15974 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
15975 Improve overflow protection. Support `l' modifier for integer
15976 conversions. Support %l conversion. Don't assume an EMACS_INT
15977 argument for integer conversions and for %c.
15978
15979 * lisp.h (doprnt): Restore prototype.
15980
15981 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15982 $(SRC)/character.h.
15983
15984 * Makefile.in (base_obj): Add back doprnt.o.
15985
15986 * deps.mk (doprnt.o): Add back prerequisites.
15987 (callint.o): Depend on character.h.
15988
15989 * eval.c (internal_lisp_condition_case): Include the handler
15990 representation in the error message.
15991 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15992 when breaking from the loop.
15993
15994 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15995
15996 * callint.c (Fcall_interactively): When displaying error message
15997 about invalid control letter, pass the character's codepoint, not
15998 a pointer to its multibyte form. Improve display of the character
15999 in octal and display also its hex code.
16000
16001 * character.c (char_string): Use %x to display the (unsigned)
16002 codepoint of an invalid character, to avoid displaying a bogus
16003 negative value.
16004
16005 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16006 `error', not SYMBOL_NAME itself.
16007
16008 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16009 character arguments to `error'.
16010
16011 * charset.c (check_iso_charset_parameter): Fix incorrect argument
16012 to `error' in error message about FINAL_CHAR argument. Make sure
16013 FINAL_CHAR is a character, and use %c when it is passed as
16014 argument to `error'.
16015
4ffd0d6b 160162011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
16017
16018 * s/ms-w32.h (localtime): Redirect to sys_localtime.
16019
16020 * w32.c: Include <time.h>.
16021 (sys_localtime): New function.
16022
4ffd0d6b 160232011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
16024
16025 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16026
4ffd0d6b 16027 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 16028
4ffd0d6b 160292011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 16030
4ffd0d6b
GM
16031 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16032 zombies (Bug#8467).
aac0c6e3 16033
04c56954
EZ
160342011-04-19 Eli Zaretskii <eliz@gnu.org>
16035
16036 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16037 gl_state.e_property when gl_state.object is Qt.
16038
16039 * insdel.c (make_gap_larger): Remove limitation of buffer size
16040 to <= INT_MAX.
16041
16a43933
CY
160422011-04-18 Chong Yidong <cyd@stupidchicken.com>
16043
16044 * xdisp.c (lookup_glyphless_char_display)
16045 (produce_glyphless_glyph): Handle cons cell entry in
16046 glyphless-char-display.
16047 (Vglyphless_char_display): Document it.
16048
16049 * term.c (produce_glyphless_glyph): Handle cons cell entry in
16050 glyphless-char-display.
16051
4581706e
CY
160522011-04-17 Chong Yidong <cyd@stupidchicken.com>
16053
16054 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16055
16056 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16057
16058 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16059 definition for no-X builds.
16060
4887c6e2 160612011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 16062
fd35b6f9
PE
16063 Static checks with GCC 4.6.0 and non-default toolkits.
16064
5c1ccb01
PE
16065 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16066
006c5daa
PE
16067 * process.c (keyboard_bit_set): Define only if SIGIO.
16068 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16069 (send_process): Repair possible setjmp clobbering.
16070
efc736d3
PE
16071 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16072
4e2fe2e6
PE
16073 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16074
f97334a2
PE
16075 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16076
4e75f29d
PE
16077 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16078 Define only if needed.
16079
90efadd1
PE
16080 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16081 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 16082 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 16083
3c647824
PE
16084 * dispextern.h (struct redisplay_interface): Rename param
16085 to avoid shadowing.
e264f262 16086 * termhooks.h (struct terminal): Likewise.
761383f4 16087 * xterm.c (xembed_send_message): Likewise.
3c647824 16088
b58c5c4a
PE
16089 * insdel.c (make_gap_smaller): Define only if
16090 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16091
cad59032
PE
16092 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16093 it.
16094
c339dc2e
PE
16095 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16096 so that we aren't warned about unused symbols.
16097
91a3e27b
PE
16098 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16099
399c71d3 16100 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 16101
8ffc96f5
PE
16102 * xfns.c (x_real_positions): Mark locals as initialized.
16103
eef9bc79
PE
16104 * xmenu.c (xmenu_show): Don't use uninitialized vars.
16105
098db9dd
PE
16106 * xterm.c: Fix problems found by static analysis with other toolkits.
16107 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
16108 (x_dispatch_event): Declare static if USE_GTK, and
16109 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 16110 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 16111 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
16112 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16113 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 16114
eb18f6cc
PE
16115 * xmenu.c (menu_help_callback): Pointer type fixes.
16116 Use const pointers when pointing at readonly data. Avoid pointer
16117 signedness clashes.
16118 (FALSE): Remove unused macro.
16119 (update_frame_menubar): Remove unused decl.
16120
1fe72bf8
PE
16121 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
16122
60d9e1db
PE
16123 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
16124 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
16125 (single_menu_item): Rename local to avoid shadowing.
16126
39261c26
PE
16127 * keyboard.c (make_lispy_event): Remove unused local var.
16128
018c5e19
PE
16129 * frame.c, frame.h (x_get_resource_string): Bring this back, but
16130 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
16131
63d2b86e
PE
16132 * bitmaps: Change bitmaps from unsigned char back to the X11
16133 compatible char. Avoid the old compiler warnings about
16134 out-of-range initializers by using, for example, '\xab' rather
16135 than 0xab.
16136
aefd87e1
PE
16137 * xgselect.c (xgselect_initialize): Check vs interface
16138 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
16139
bf501fb9
PE
16140 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
16141
e9829fdf
PE
16142 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
16143 to read-only memory.
16144
1086c095
PE
16145 * fns.c (vector): Remove; this old hack is no longer needed.
16146
2baccd04 16147 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 16148 Remove unused var.
dde42981 16149 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 16150
72391843 16151 * xrdb.c (x_load_resources): Omit unused local.
3565b346 16152
436c16df 16153 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 16154 (x_window): Rename locals to avoid shadowing.
dc5ddd85 16155 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 16156
92bb796d 16157 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 16158 (x_term_init): Remove local to avoid shadowing.
92bb796d 16159
764430a3 16160 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
16161
16162 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
16163 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
16164
d1dfb56c
EZ
161652011-04-16 Eli Zaretskii <eliz@gnu.org>
16166
c4354cb4
EZ
16167 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
16168
d1dfb56c
EZ
16169 Fix regex.c, syntax.c and friends for buffers > 2GB.
16170 * syntax.h (struct gl_state_s): Declare character position members
16171 EMACS_INT.
16172
16173 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
16174
04f2d78b
CB
16175 * textprop.c (verify_interval_modification, interval_of):
16176 Declare arguments EMACS_INT.
d1dfb56c
EZ
16177
16178 * intervals.c (adjust_intervals_for_insertion): Declare arguments
16179 EMACS_INT.
16180
16181 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
16182
16183 * indent.c (Fvertical_motion): Local variable it_start is now
16184 EMACS_INT.
16185
16186 * regex.c (re_match, re_match_2, re_match_2_internal)
16187 (bcmp_translate, regcomp, regexec, print_double_string)
16188 (group_in_compile_stack, re_search, re_search_2, regex_compile)
16189 (re_compile_pattern, re_exec): Declare arguments and local
16190 variables `size_t' and `ssize_t' and return values `regoff_t', as
16191 appropriate.
16192 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16193 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16194 <compile_stack_type>: `size' and `avail' are now `size_t'.
16195
16196 * regex.h <regoff_t>: Use ssize_t, not int.
16197 (re_search, re_search_2, re_match, re_match_2): Arguments that
16198 specify buffer/string position and length are now ssize_t and
16199 size_t. Return type is regoff_t.
16200
613052cd
BK
162012011-04-16 Ben Key <bkey76@gmail.com>
16202
16203 * nsfont.m: Fixed bugs in ns_get_family and
16204 ns_descriptor_to_entity that were caused by using free to
16205 deallocate memory blocks that were allocated by xmalloc (via
16206 xstrdup). This caused Emacs to crash when compiled with
16207 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16208 --enable-checking=xmallocoverrun). xfree is now used to
16209 deallocate these memory blocks.
16210
4170f62f 162112011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 16212
71b41406
PE
16213 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16214
9587a89d
PE
16215 emacs_write: Accept and return EMACS_INT for sizes.
16216 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16217 et seq.
16218 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16219 Accept and return EMACS_INT.
16220 (emacs_gnutls_write): Return the number of bytes written on
16221 partial writes.
16222 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
16223 (emacs_read, emacs_write): Remove check for negative size, as the
16224 Emacs source code has been audited now.
9587a89d
PE
16225 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16226 (emacs_read, emacs_write): Use it.
273a5f82
PE
16227 * process.c (send_process): Adjust to the new signatures of
16228 emacs_write and emacs_gnutls_write. Do not attempt to store
16229 a byte offset into an 'int'; it might overflow.
9587a89d 16230 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 16231
3e047f51
PE
16232 * sound.c: Don't assume sizes fit in 'int'.
16233 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 16234 Return EMACS_INT, not int.
3e047f51 16235 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
16236 Accept EMACS_INT, not int.
16237 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
16238 record read return values.
16239
cc39a9db
BK
162402011-04-15 Ben Key <bkey76@gmail.com>
16241
c9d0ec6d
JB
16242 * keyboard.c (Qundefined): Don't declare static since it is used
16243 in nsfns.m.
16244 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16245 static since they are used in nsfont.m.
cc39a9db 16246
6c60eb9f
SM
162472011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
16248
16249 * process.c (Qprocessp): Don't declare static.
16250 * lisp.h (Qprocessp): Declare again.
16251
7990b61a
JB
162522011-04-15 Juanma Barranquero <lekktu@gmail.com>
16253
16254 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16255
5d4cb038
PE
162562011-04-14 Paul Eggert <eggert@cs.ucla.edu>
16257
8bd7b830 16258 Improve C-level modularity by making more things 'static'.
cd64ea1d 16259
e3b27b31
PE
16260 Don't publish debugger-only interfaces to other modules.
16261 * lisp.h (safe_debug_print, debug_output_compilation_hack):
16262 (verify_bytepos, count_markers): Move decls to the only modules
16263 that need them.
16264 * region-cache.h (pp_cache): Likewise.
16265 * window.h (check_all_windows): Likewise.
16266 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16267
5d4cb038
PE
16268 * sysdep.c (croak): Now static, if
16269 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16270 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
16271
16272 * alloc.c (refill_memory_reserve): Now static if
16273 !defined REL_ALLOC || defined SYSTEM_MALLOC.
16274 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 16275
e87b6180
PE
16276 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
16277 Define only if USE_LUCID.
16278
ac64929e
PE
16279 * xrdb.c (x_customization_string, x_rm_string): Now static.
16280
6f37259d
PE
16281 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
16282 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
16283
1683e3ab
PE
16284 * xdisp.c (draw_row_with_mouse_face): Now static.
16285 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
16286
de9c2632
PE
16287 * window.h (check_all_windows): Mark externally visible.
16288
2b96acb7
PE
16289 * window.c (window_deletion_count): Now static.
16290
16291 * undo.c: Make symbols static if they're not exported.
16292 (last_undo_buffer, last_boundary_position, pending_boundary):
16293 Now static.
16294
50436f33
PE
16295 * textprop.c (interval_insert_behind_hooks): Now static.
16296 (interval_insert_in_front_hooks): Likewise.
16297
64520e5c
PE
16298 * term.c: Make symbols static if they're not exported.
16299 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
16300 (max_frame_lines, tty_set_terminal_modes):
16301 (tty_reset_terminal_modes, tty_turn_off_highlight):
16302 (get_tty_terminal): Now static.
16303 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
16304 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 16305 HAVE_WINDOW_SYSTEM.
64520e5c
PE
16306 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16307 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16308
1fa53021
PE
16309 * sysdep.c: Make symbols static if they're not exported.
16310 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16311 Now static.
16312 (sigprocmask_set, full_mask): Remove; unused.
16313 (wait_debugging): Mark as visible.
16314 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16315 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16316
d4b43b22
PE
16317 * syntax.c (syntax_temp): Define only if !__GNUC__.
16318
b7c513d0
PE
16319 * sound.c (current_sound_device, current_sound): Now static.
16320
989b29ad
PE
16321 * search.c (searchbufs, searchbuf_head): Now static.
16322
13a55a78
PE
16323 * scroll.c (scroll_cost): Remove; unused.
16324 * dispextern.h (scroll_cost): Remove decl.
16325
de68a1fc
PE
16326 * region-cache.h (pp_cache): Mark as externally visible.
16327
40ccffa6
PE
16328 * process.c: Make symbols static if they're not exported.
16329 (process_tick, update_tick, create_process, chan_process):
16330 (Vprocess_alist, proc_buffered_char, datagram_access):
16331 (fd_callback_data, send_process_frame, process_sent_to): Now static.
16332 (deactivate_process): Mark defn as static, as well as decl.
16333 * lisp.h (create_process): Remove decl.
16334 * process.h (chan_process, Vprocess_alist): Remove decls.
16335
ad64fc97
PE
16336 * print.c: Make symbols static if they're not exported.
16337 (print_depth, new_backquote_output, being_printed, print_buffer):
16338 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16339 (print_interval, print_number_index, initial_stderr_stream):
16340 Now static.
16341 * lisp.h (Fprinc): Remove decl.
16342 (debug_output_compilation_hack): Mark as externally visible.
16343
adddb265
PE
16344 * sysdep.c (croak): Move decl from here to syssignal.h.
16345 * syssignal.h (croak): Put it here, so the API can be checked when
16346 'croak' is called from dissociate_if_controlling_tty.
16347
1717ede2
PE
16348 * minibuf.c: Make symbols static if they're not exported.
16349 (minibuf_save_list, choose_minibuf_frame): Now static.
16350 * lisp.h (choose_minibuf_frame): Remove decl.
16351
fa5fb2bc
PE
16352 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16353
1e3890d1
PE
16354 * lread.c: Make symbols static if they're not exported.
16355 (read_objects, initial_obarray, oblookup_last_bucket_number):
16356 Now static.
16357 (make_symbol): Remove; unused.
16358 * lisp.h (initial_obarray, make_symbol): Remove decls.
16359
8a1414fa
PE
16360 * keyboard.c: Make symbols static if they're not exported.
16361 (single_kboard, recent_keys_index, total_keys, recent_keys):
16362 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16363 (this_single_command_key_start, echoing, last_auto_save):
16364 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16365 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16366 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16367 (Vlispy_mouse_stem, double_click_count):
16368 Now static.
16369 (force_auto_save_soon): Define only if SIGDANGER.
16370 (ignore_mouse_drag_p): Now static if
16371 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16372 (print_help): Remove; unused.
16373 (stop_character, last_timer_event): Mark as externally visible.
16374 * keyboard.h (ignore_mouse_drag_p): Declare only if
16375 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16376 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16377 * lisp.h (echoing): Remove decl.
16378 (force_auto_save_soon): Declare only if SIGDANGER.
16379 * xdisp.c (redisplay_window): Simplify code, to make it more
16380 obvious that ignore_mouse_drag_p is not accessed if !defined
16381 USE_GTK && !defined HAVE_NS.
16382
93ea6e8f
PE
16383 * intervals.c: Make symbols static if they're not exported.
16384 (merge_properties_sticky, merge_interval_right, delete_interval):
16385 Now static.
16386 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16387
77382fcc
PE
16388 * insdel.c: Make symbols static if they're not exported.
16389 However, leave prepare_to_modify_buffer alone. It's never
16390 called from outside this function, but that appears to be a bug.
16391 (combine_after_change_list, combine_after_change_buffer):
4889fc82 16392 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
16393 (adjust_after_replace_noundo): Remove; unused.
16394 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 16395 (signal_before_change): Remove decls.
77382fcc 16396
9306c32e
PE
16397 * indent.c (val_compute_motion, val_vmotion): Now static.
16398
cd44d2eb
PE
16399 * image.c: Make symbols static if they're not exported.
16400 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16401 if USE_GTK.
16402 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16403 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16404
ad9a7a06
PE
16405 * fringe.c (standard_bitmaps): Now static.
16406 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16407
81626931
PE
16408 * frame.c: Make symbols static if they're not exported.
16409 (x_report_frame_params, make_terminal_frame): Now static.
16410 (get_frame_param): Now static, unless HAVE_NS.
16411 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16412 (x_get_resource_string): Remove; not used.
16413 * frame.h (make_terminal_frame, x_report_frame_params):
16414 (x_get_resource_string); Remove decls.
16415 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16416 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16417
239f9db9
PE
16418 * font.c, fontset.c: Make symbols static if they're not exported.
16419 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16420 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16421 * font.c (font_close_object): Now static.
16422 * font.h (font_close_object): Remove.
16423 * fontset.c (FONTSET_OBJLIST): Remove.
16424 (free_realized_fontset) #if-0 the body, which does nothing.
16425 (face_suitable_for_char_p): #if-0, as it's never called.
16426 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
16427 * xfaces.c (face_at_string_position):
16428 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
16429 since 0 is always ASCII.
16430
dfcf3579
PE
16431 * fns.c (weak_hash_tables): Now static.
16432
5045092b
PE
16433 * fileio.c: Make symbols static if they're not exported.
16434 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16435 (Vwrite_region_annotation_buffers): Now static.
16436
57a96f5c
PE
16437 * eval.c: Make symbols static if they're not exported.
16438 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16439 * lisp.h (backtrace_list): Remove decl.
16440
35f08c38
PE
16441 * emacs.c: Make symbols static if they're not exported.
16442 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16443 (fatal_error_code, fatal_error_signal_hook, standard_args):
16444 Now static.
16445 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16446 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16447 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16448 * lisp.h (fatal_error_signal_hook): Remove decl.
16449 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16450
f44bd759
PE
16451 * editfns.c: Move a (normally-unused) function to its only use.
16452 * editfns.c, lisp.h (get_operating_system_release): Remove.
16453 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16454 worth the hassle of breaking this out.
16455
b532497d
PE
16456 * xterm.c: Make symbols static if they're not exported.
16457 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16458 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16459 (x_destroy_window, x_delete_display):
16460 Now static.
16461 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16462 (x_mouse_leave): Remove; unused.
16463 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16464 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16465 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16466 Remove decls.
16467 (x_mouse_leave): Declare only if WINDOWSNT.
16468 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16469 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16470 USE_X_TOOLKIT.
16471
1675728f
PE
16472 * ftxfont.c: Make symbols static if they're not exported.
16473 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16474 HAVE_FREETYPE.
16475 * font.h (ftxfont_driver): Likewise.
16476
e4cebfca
PE
16477 * xfns.c: Make symbols static if they're not exported.
16478 (x_last_font_name, x_display_info_for_name):
16479 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16480 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16481 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16482 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16483 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16484 (last_show_tip_args): Now static.
16485 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16486 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16487 (x_screen_planes): Remove; unused.
16488 * dispextern.h (x_screen_planes): Remove decl.
16489
5bf46f05
PE
16490 * dispnew.c: Make symbols static if they're not exported.
16491 * dispextern.h (redraw_garbaged_frames, scrolling):
16492 (increment_row_positions): Remove.
16493 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16494 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16495 Now static.
16496 (redraw_garbaged_frames): Remove; unused.
16497
435f4c28
PE
16498 * xfaces.c: Make symbols static if they're not exported.
16499 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16500 Remove decls.
16501 * xterm.h (defined_color): Remove decls.
16502 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16503 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16504 (menu_face_changed_default, defined_color, free_realized_face):
16505 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16506 (ascii_face_of_lisp_face): Remove; unused.
16507
8524aef3
PE
16508 * xdisp.c: Make symbols static if they're not exported.
16509 * dispextern.h (scratch_glyph_row, window_box_edges):
16510 (glyph_to_pixel_coords, set_cursor_from_row):
16511 (get_next_display_element, set_iterator_to_next):
16512 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16513 (show_mouse_face): Remove decls
16514 * frame.h (message_buf_print): Likewise.
16515 * lisp.h (pop_message, set_message, check_point_in_composition):
16516 Likewise.
16517 * xterm.h (set_vertical_scroll_bar): Likewise.
16518 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16519 (message_buf_print, scratch_glyph_row, displayed_buffer):
16520 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16521 (get_next_display_element, show_mouse_face, window_box_edges):
16522 (frame_to_window_pixel_xy, check_point_in_composition):
16523 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16524 (glyph_to_pixel_coords): Remove; unused.
16525
16390cd2
PE
16526 * dired.c (file_name_completion): Now static.
16527
16528 * dbusbind.c (xd_in_read_queued_messages): Now static.
16529
a25f4dfa
PE
16530 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16531 * data.c (circular_list_error): Remove.
16532
14a9c8df
PE
16533 * commands.h (last_point_position, last_point_position_buffer):
16534 (last_point_position_window): Remove decls.
16535 * keyboard.c: Make these variables static.
16536
04f2d78b
CB
16537 * coding.h (coding, code_convert_region, encode_coding_gap):
16538 Remove decls.
74ab6df5
PE
16539 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16540 (iso_code_class, detect_coding, code_convert_region): Now static.
16541 (encode_coding_gap): Remove; unused.
16542
38dfbee1
PE
16543 * chartab.c (chartab_chars, chartab_bits): Now static.
16544
a2cb4e63
PE
16545 * charset.h (charset_iso_8859_1): Remove decl.
16546 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16547 Now static.
16548
127198fd
PE
16549 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16550 * ccl.c (Vccl_program_table): Now static.
16551 (check_ccl_update): Remove; unused.
16552
d85b608f
PE
16553 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16554 * category.h: ... from here.
16555 * category.c (check_category_table, set_category_set): Now static.
16556
31cd66f3
PE
16557 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16558 * lisp.h: Remove these decls.
16559
c358e587
PE
16560 * buffer.c (buffer_count): Remove unused var.
16561
e78aecca
PE
16562 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16563 so that it's not optimized away.
16564 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16565 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16566 exported only to the debugger.
16567
e192d7d3 16568 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 16569 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 16570
92470028
PE
16571 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16572 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16573 was inaccessible from Lisp.
16574 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16575 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16576
244ed907
PE
16577 alloc.c: Import and export fewer symbols, and remove unused items.
16578 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16579 is defined.
16580 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16581 it's not optimized away by whole-program optimization.
16582 (message_enable_multibyte, free_misc): Remove.
16583 (catchlist, handlerlist, mark_backtrace):
16584 Declare only if BYTE_MARK_STACK.
16585 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16586 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16587 (message_enable_multibyte): Remove decl.
16588 (free_misc, interval_free_list, float_block, float_block_index):
16589 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16590 (cons_free_list, last_marked_index):
16591 Now static.
16592 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16593 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16594 (mark_backtrace): Define only if BYTE_MARK_STACK.
16595 * xdisp.c (message_enable_multibyte): Now static.
16596
61c2b50e 16597 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
16598 This makes it easier for human readers (and static analyzers)
16599 to see whether these variables are used from other modules.
16600 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16601 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16602 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16603 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16604 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16605 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16606 * xmenu.c, xselect.c:
16607 Declare Q* vars static if they are not used in other modules.
16608 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16609 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16610 Remove decls of unexported vars.
16611 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16612
95c82688
PE
16613 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16614
16a97296
PE
16615 Make Emacs functions such as Fatom 'static' by default.
16616 This makes it easier for human readers (and static analyzers)
16617 to see whether these functions can be called from other modules.
16618 DEFUN now defines a static function. To make the function external
16619 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
16620 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16621 (Finit_image_library):
16a97296
PE
16622 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16623 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16624 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16625 Remove decls, since these functions are now static.
16626 (Funintern, Fget_internal_run_time): New decls, since these functions
16627 were already external.
95c82688 16628
16a97296
PE
16629 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16630 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16631 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16632 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16633 * keyboard.c, keymap.c, lread.c:
16634 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16635 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16636 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16637 Mark functions with DEFUE instead of DEFUN,
16638 if they are used in other modules.
16639 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16640 decls for now-static functions.
16641 * buffer.h (Fdelete_overlay): Remove decl.
16642 * callproc.c (Fgetenv_internal): Mark as internal.
16643 * composite.c (Fremove_list_of_text_properties): Remove decl.
16644 (Fcomposition_get_gstring): New forward static decl.
16645 * composite.h (Fcomposite_get_gstring): Remove decl.
16646 * dired.c (Ffile_attributes): New forward static decl.
16647 * doc.c (Fdocumntation_property): New forward static decl.
16648 * eval.c (Ffetch_bytecode): New forward static decl.
16649 (Funintern): Remove extern decl; now in .h file where it belongs.
16650 * fileio.c (Fmake_symbolic_link): New forward static decl.
16651 * image.c (Finit_image_library): New forward static decl.
16652 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16653 * intervals.h (Fprevious_property_change):
16654 (Fremove_list_of_text_properties): Remove decls.
16655 * keyboard.c (Fthis_command_keys): Remove decl.
16656 (Fcommand_execute): New forward static decl.
16657 * keymap.c (Flookup_key): New forward static decl.
16658 (Fcopy_keymap): Now static.
16659 * keymap.h (Flookup_key): Remove decl.
16660 * process.c (Fget_process): New forward static decl.
16661 (Fprocess_datagram_address): Mark as internal.
16662 * syntax.c (Fsyntax_table_p): New forward static decl.
16663 (skip_chars): Remove duplicate decl.
16664 * textprop.c (Fprevious_property_change): New forward static decl.
16665 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16666 Now internal.
16667 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16668 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16669
785bbd42
PE
16670 * editfns.c (Fformat): Remove unreachable code.
16671
8b913b57
AS
166722011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16673
16674 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16675 change. (Bug#8496)
16676
a6744a35
EZ
166772011-04-13 Eli Zaretskii <eliz@gnu.org>
16678
16679 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16680 when at ZV. (Bug#8487)
16681
e7974947
AS
166822011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16683
baad03f0
AS
16684 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16685 (Bug#8437)
16686 * keyboard.c (parse_tool_bar_item): Likewise.
16687 * sound.c (sound_cleanup, alsa_close): Likewise.
16688 * termcap.c (tgetent): Likewise.
16689 * xfns.c (x_default_font_parameter): Likewise.
16690 * xsettings.c (read_and_apply_settings): Likewise.
16691
e7974947
AS
16692 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16693 (overrun_check_free): Protoize.
16694
28272684
PE
166952011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16696
16697 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16698 since callers should never pass a negative size.
16699 Change the signature to match that of plain 'read' and 'write'; see
16700 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16701 * lisp.h: Update prototypes of emacs_write and emacs_read.
16702
11997c76
EZ
167032011-04-11 Eli Zaretskii <eliz@gnu.org>
16704
16705 * xdisp.c (redisplay_window): Don't try to determine the character
16706 position of the scroll margin if the window start point w->startp
e896f03c 16707 is outside the buffer's accessible region. (Bug#8468)
11997c76 16708
8a2cbd72
EZ
167092011-04-10 Eli Zaretskii <eliz@gnu.org>
16710
16711 Fix write-region and its subroutines for buffers > 2GB.
16712 * fileio.c (a_write, e_write): Modify declaration of arguments and
16713 local variables to support buffers larger than 2GB.
16714 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16715
16716 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16717 argument, local variables, and return value.
16718
16719 * lisp.h: Update prototypes of emacs_write and emacs_read.
16720
16721 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16722
4073e537 167232011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 16724
1ebfdcb6
PE
16725 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16726
b2ded58d
PE
16727 Fix more problems found by GCC 4.6.0's static checks.
16728
7d66342c
PE
16729 * xdisp.c (vmessage): Use a better test for character truncation.
16730
bbf47d44
PE
16731 * charset.c (load_charset_map): <, not <=, for optimization,
16732 and to avoid potential problems with integer overflow.
9248994d 16733 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 16734 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 16735 * editfns.c (Fformat): Likewise.
1e69125e 16736 * syntax.c (skip_chars): Likewise.
3befa583 16737
e3019616
PE
16738 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16739 This also lets GCC 4.6.0 generate slightly better loop code.
16740
becfa255
PE
16741 * callint.c (Fcall_interactively): <, not <=, for optimization.
16742 (Fcall_interactively): Count the number of arguments produced,
16743 not the number of arguments given. This is simpler and lets GCC
16744 4.6.0 generate slightly better code.
16745
dae0cd48
PE
16746 * ftfont.c: Distingish more carefully between FcChar8 and char.
16747 The previous code passed unsigned char * to a functions like
16748 strlen and xstrcasecmp that expect char *, which does not
16749 conform to the C standard.
16750 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16751 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16752 char * when the C standard requires it.
16753
76032d70
PE
16754 * keyboard.c (read_char): Remove unused var.
16755
eb3f1cc8
PE
16756 * eval.c: Port to Windows vsnprintf (Bug#8435).
16757 Include <limits.h>.
16758 (SIZE_MAX): Define if the headers do not.
16759 (verror): Do not give up if vsnprintf returns a negative count.
16760 Instead, grow the buffer. This ports to Windows vsnprintf, which
16761 does not conform to C99. Problem reported by Eli Zaretskii.
16762 Also, simplify the allocation scheme, by avoiding the need for
16763 calling realloc, and removing the ALLOCATED variable.
16764
70476b54
PE
16765 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16766
12020a9e
PE
16767 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16768 But keep the doprint source code for now, as we might revamp it
16769 and use it again (Bug#8435).
ea6c7ae6
PE
16770 * lisp.h (doprnt): Remove.
16771 * Makefile.in (base_obj): Remove doprnt.o.
16772 * deps.mk (doprnt.o): Remove.
16773
5fdb398c
PE
16774 error: Print 32- and 64-bit integers portably (Bug#8435).
16775 Without this change, on typical 64-bit hosts error ("...%d...", N)
16776 was used to print both 32- and 64-bit integers N, which relied on
16777 undefined behavior.
61bdb816 16778 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
16779 * lisp.h (error, verror): Mark as printf-like functions.
16780 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16781 Report overflow in size calculations when allocating printf buffer.
16782 Do not truncate output string at its first null byte.
16783 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16784 Truncate the output at a character boundary, since vsnprintf does not
16785 do that.
16786 * charset.c (check_iso_charset_parameter): Convert internal
16787 character to string before calling 'error', since %c now has the
16788 printf meaning.
16789 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16790 overflow when computing char to be passed to 'error'. Do not
16791 pass Lisp_Object to 'error'; pass the integer instead.
16792 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16793 formatted with plain %d.
16794
b189fa66
PE
16795 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16796
bff87ef0
PE
16797 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16798
7e2cac20
PE
16799 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16800
ce4d90b5
PE
16801 * xterm.c (x_catch_errors): Remove duplicate declaration.
16802
266c9547
PE
16803 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16804
79c49ad2
PE
16805 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16806
368f4090
JM
168072011-04-10 Jim Meyering <meyering@redhat.com>
16808
16809 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16810 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16811 return ssize_t not "int", and use size_t as the buffer length.
16812 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16813 * gnutls.h: Update declarations.
16814 * process.c (read_process_output): Use ssize_t, to match.
16815 (send_process): Likewise.
16816
a32d4040
CY
168172011-04-09 Chong Yidong <cyd@stupidchicken.com>
16818
16819 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16820
8546720e 168212011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 16822
04f2d78b
CB
16823 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16824 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 16825
8546720e
GM
16826 * xterm.c (handle_one_xevent):
16827 * xmenu.c (create_and_show_popup_menu):
16828 * xselect.c (x_decline_selection_request)
16829 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 16830
0a2f5c1a 168312011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
16832
16833 Fix some uses of `int' instead of EMACS_INT.
16834 * search.c (string_match_1, fast_string_match)
16835 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16836 (scan_buffer, find_next_newline_no_quit)
16837 (find_before_next_newline, search_command, Freplace_match)
16838 (Fmatch_data): Make some `int' variables be EMACS_INT.
16839
16840 * xdisp.c (display_count_lines): 3rd argument and return value now
16841 EMACS_INT. All callers changed.
16842 (pint2hrstr): Last argument is now EMACS_INT.
16843
16844 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16845 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16846 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16847 (decode_coding_utf_16, decode_coding_emacs_mule)
16848 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16849 (decode_coding_ccl, decode_coding_charset)
16850 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16851 (decode_coding_iso_2022, decode_coding_emacs_mule)
16852 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16853 <char_offset, last_offset>: Declare EMACS_INT.
16854 (encode_coding_utf_8, encode_coding_utf_16)
16855 (encode_coding_emacs_mule, encode_invocation_designation)
16856 (encode_designation_at_bol, encode_coding_iso_2022)
16857 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16858 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16859 Declare EMACS_INT.
16860 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16861 (encode_invocation_designation): Last argument P_NCHARS is now
16862 EMACS_INT.
16863 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16864 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16865
16866 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16867 All users changed.
16868
16869 * ccl.c (Fccl_execute_on_string): Declare some variables
16870 EMACS_INT.
16871
8546720e 168722011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
16873
16874 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16875
4e19a977
CS
168762011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16877
16878 * process.c (Fformat_network_address): Doc fix.
16879
87302331
R
168802011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16881
ee7683eb 16882 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 16883
cbb59342
CY
168842011-04-08 Chong Yidong <cyd@stupidchicken.com>
16885
16886 * keyboard.c (read_char): Call Lisp function help-form-show,
16887 instead of using internal_with_output_to_temp_buffer.
16888 (Qhelp_form_show): New var.
e0d38eeb 16889 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
16890
16891 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16892
16893 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16894
e67a13ab
CY
168952011-04-06 Chong Yidong <cyd@stupidchicken.com>
16896
04f2d78b
CB
16897 * process.c (Flist_processes): Remove to Lisp.
16898 (list_processes_1): Delete.
e67a13ab 16899
973f782d
EZ
169002011-04-06 Eli Zaretskii <eliz@gnu.org>
16901
7c106b1e
EZ
16902 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16903
973f782d
EZ
16904 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16905
41cf7d1a 169062011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 16907
ca23cc88
PE
16908 Fix more problems found by GCC 4.6.0's static checks.
16909
f390e2d5
PE
16910 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16911
42eea0d0
PE
16912 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16913
b69769da 16914 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 16915
f9541e84
PE
16916 * xdisp.c (vmessage): Mark as a printf-like function.
16917
13841b55
PE
16918 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16919
c136c10f
PE
16920 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16921
5e2d4a30
PE
16922 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16923 printf-like functions.
16924 (tiff_load): Add casts to remove these marks before passing them
16925 to system-supplied API.
16926
583f48b9
PE
16927 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16928
b25d760e
PE
16929 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16930 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
16931 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16932 directly, rather than having caller test rule sign. This avoids
16933 some unnecessary tests.
16934 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16935 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16936 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 16937
bc7b6697 16938 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 16939 (xfont_open): Avoid unnecessary tests.
bc7b6697 16940
27ccc379
PE
16941 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16942
dcd5c89a
PE
16943 * composite.h, composite.c (composition_gstring_put_cache):
16944 Use EMACS_INT, not int, for length.
16945
b13a45c6
PE
16946 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16947 breaking out part of COMPOSITION_DECODE_RULE.
16948 (COMPOSITION_DECODE_RULE): Use it.
16949 * composite.c (get_composition_id): Remove unused local vars,
16950 by using the new macro.
16951
1e792e4d
PE
16952 * textprop.c (set_text_properties_1): Change while to do-while,
16953 since the condition is always true at first.
16954
dc6c6455 16955 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
16956 (interval_deletion_adjustment): Return unsigned value.
16957 All uses changed.
dc6c6455 16958
aba7731a
PE
16959 * process.c (list_processes_1, create_pty, read_process_output):
16960 (exec_sentinel): Remove vars that were set but not used.
afd4052b 16961 (create_pty): Remove unnecessary "volatile"s.
bc57d757 16962 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 16963 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 16964 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 16965
fdfc4bf3
PE
16966 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16967
fca8fe46 16968 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 16969 (update_syntax_table): Use unsigned instead of int.
fca8fe46 16970
06a0259a 16971 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 16972 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 16973 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 16974
e7b9e80f
PE
16975 * print.c (print_error_message): Avoid int overflow.
16976
56201685
PE
16977 * font.c (font_list_entities): Redo for clarity,
16978 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16979
78834453 16980 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 16981 (font_score): Avoid potential overflow in diff calculation.
78834453 16982
0bc0b309 16983 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 16984 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 16985
e610eaca
PE
16986 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16987
b895abce
PE
16988 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16989 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16990 can always succeed if overflow has undefined behavior.
16991
1f1d9321 16992 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 16993 (wordify): Omit three unnecessary tests.
1f1d9321 16994
c59478bc
PE
16995 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16996 All callers changed. This avoids the need for an unused var.
16997
79b73827
PE
16998 * casefiddle.c (casify_region): Remove var that is set but not used.
16999
a4db5dfe
PE
17000 * dired.c (file_name_completion): Remove var that is set but not used.
17001
43aae36e
PE
17002 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17003
2a47c44d 17004 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 17005 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 17006
a37c69bf
PE
17007 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17008 Check for integer overflow on size calculations.
17009
328ab8e7
PE
17010 * buffer.c (Fprevious_overlay_change): Remove var that is set
17011 but not used.
17012
e5a2a5cb
PE
17013 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17014 Remove vars that are set but not used.
8d84a6eb 17015 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 17016 (timer_check_2): Mark vars as initialized.
e5a2a5cb 17017
a60e5f68
PE
17018 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17019
f661cb61 17020 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 17021 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 17022
f0397f5a
PE
17023 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17024 that are set but not used.
17025
8664db06 17026 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 17027 if XCreateBitmapFromData fails (Bug#8410).
8664db06 17028
6abdaa4a
PE
17029 * xselect.c (x_get_local_selection, x_handle_property_notify):
17030 Remove vars that are set but not used.
17031
0ce7538d 17032 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 17033 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 17034
9ae848fc
PE
17035 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17036 Remove var that is set but not used.
0b918413
PE
17037 (scroll_bar_windows_size): Now size_t, not int.
17038 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
17039 Check for overflow.
9ae848fc 17040
a5a62657
PE
17041 * xfaces.c (realize_named_face): Remove vars that are set but not used.
17042 (map_tty_color) [!defined MSDOS]: Likewise.
17043
5c5cdd39
PE
17044 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17045
66ebf983
PE
17046 * coding.c: Remove vars that are set but not used.
17047 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17048 All callers changed.
17049 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17050 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17051 (decode_coding_charset): Remove vars that are set but not used.
17052
1be4d761
PE
17053 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17054 that is set but not used.
17055
47553fa8
PE
17056 * print.c (print_object): Remove var that is set but not used.
17057
1f7196bf 17058 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
17059 The gnulib version avoids calling malloc in the usual case,
17060 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17061 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17062 * filelock.c (current_lock_owner): Likewise.
17063 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17064 * sysdep.c: Include allocator.h, careadlinkat.h.
17065 (emacs_no_realloc_allocator): New static constant.
17066 (emacs_readlink): New function.
fdb61804
PE
17067 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17068 ../lib/careadlinkat.h.
d1fdcab7 17069
f84c17c7
SM
170702011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
17071
17072 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17073 first non-nil return value).
17074
ef3862ad
JD
170752011-04-03 Jan Djärv <jan.h.d@swipnet.se>
17076
17077 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17078 if not defined (Bug#8403).
17079
376a7006
JB
170802011-04-02 Juanma Barranquero <lekktu@gmail.com>
17081
17082 * xdisp.c (display_count_lines): Remove parameter `start',
17083 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17084 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17085 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17086 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17087 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17088 and thereabouts. All callers changed.
17089 (get_per_char_metric): Remove parameter `f', unused since
17090 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17091
6ca3801d
JM
170922011-04-02 Jim Meyering <meyering@redhat.com>
17093
17094 do not dereference NULL upon failed strdup
17095 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17096 (ns_get_family): Likewise.
17097
d8e2b5ba
JB
170982011-04-02 Juanma Barranquero <lekktu@gmail.com>
17099
17100 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17101
8c74fcbd
JD
171022011-04-02 Jan Djärv <jan.h.d@swipnet.se>
17103
17104 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17105 later (Bug#8403).
17106
7200d79c
SM
171072011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
17108
03408648 17109 Add lexical binding.
7200d79c 17110
03408648
SM
17111 * window.c (Ftemp_output_buffer_show): New fun.
17112 (Fsave_window_excursion):
17113 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17114
17115 * lread.c (lisp_file_lexically_bound_p): New function.
17116 (Fload): Bind Qlexical_binding.
17117 (readevalloop): Remove `evalfun' arg.
17118 Bind Qinternal_interpreter_environment.
17119 (Feval_buffer): Bind Qlexical_binding.
17120 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
17121 Mark as dynamic.
17122 (syms_of_lread): Declare `lexical-binding'.
17123
17124 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
17125
17126 * keyboard.c (eval_dyn): New fun.
17127 (menu_item_eval_property): Use it.
ca105506
SM
17128
17129 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 17130
03408648
SM
17131 * fns.c (concat, mapcar1): Accept byte-code-functions.
17132
17133 * eval.c (Fsetq): Handle lexical vars.
17134 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
17135 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
17136 (FletX, Flet): Obey lexical binding.
17137 (Fcommandp): Handle closures.
17138 (Feval): New `lexical' arg.
17139 (eval_sub): New function extracted from Feval. Use it almost
17140 everywhere where Feval was used. Look up vars in lexical env.
17141 Handle closures.
17142 (Ffunctionp): Move from subr.el.
17143 (Ffuncall): Handle closures.
17144 (apply_lambda): Remove `eval_flags'.
17145 (funcall_lambda): Handle closures and new byte-code-functions.
17146 (Fspecial_variable_p): New function.
17147 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
17148 but without exporting it to Lisp.
23aba0ea 17149
23aba0ea 17150 * doc.c (Fdocumentation, store_function_docstring):
03408648 17151 * data.c (Finteractive_form): Handle closures.
23aba0ea 17152
03408648
SM
17153 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
17154 interactive spec.
ba83908c 17155
04f2d78b
CB
17156 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
17157 New byte-codes.
03408648
SM
17158 (exec_byte_code): New function extracted from Fbyte_code to handle new
17159 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 17160
03408648 17161 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 17162
03408648 17163 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 17164
e2abce01
JB
171652011-03-31 Juanma Barranquero <lekktu@gmail.com>
17166
17167 * xdisp.c (redisplay_internal): Fix prototype.
17168
63696a73 171692011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 17170
63696a73 17171 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
17172 (try_scrolling): Use it when setting scroll_limit.
17173 Limit scrolling to 100 screen lines.
63696a73
EZ
17174 (redisplay_window): Even when falling back on "recentering",
17175 position point in the window according to scroll-conservatively,
17176 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
17177
17178 (try_scrolling): When point is above the window, allow searching
17179 as far as scroll_max, or one screenful, to compute vertical
17180 distance from PT to the scroll margin position. This prevents
17181 try_scrolling from unnecessarily failing when
17182 scroll-conservatively is set to a value slightly larger than the
17183 window height. Clean up the case of PT below the margin at bottom
17184 of window: scroll_max can no longer be INT_MAX. When aggressive
17185 scrolling is in use, don't let point enter the opposite scroll
17186 margin as result of the scroll.
17187 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
17188 threshold of 100 lines for never-recentering scrolling.
17189
e4cc2dfc
JB
171902011-03-31 Juanma Barranquero <lekktu@gmail.com>
17191
17192 * dispextern.h (move_it_by_lines):
17193 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17194 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
17195 (message_log_check_duplicate): Remove parameters `prev_bol' and
17196 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17197 (redisplay_internal): Remove parameter `preserve_echo_area',
17198 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
17199
17200 * indent.c (Fvertical_motion):
17201 * window.c (window_scroll_pixel_based, Frecenter):
17202 Don't pass `need_y_p' to `move_it_by_lines'.
17203
1c470562
SM
172042011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
17205
44f230aa
SM
17206 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17207 steal a few bits to be more compact.
17208 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17209 Remove unneeded casts.
17210
1c470562
SM
17211 * bytecode.c (Fbyte_code): CAR and CDR can GC.
17212
888adce9
ZK
172132011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
17214
17215 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17216 binding" message (bug#7967).
17217
f838ed7b
PE
172182011-03-30 Paul Eggert <eggert@cs.ucla.edu>
17219
77861b95
PE
17220 Fix more problems found by GCC 4.6.0's static checks.
17221
de6dbc14
PE
17222 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17223 Remove unused local var.
17224
f838ed7b
PE
17225 * editfns.c (Fmessage_box): Remove unused local var.
17226
792c7b2b
PE
17227 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17228 (note_mode_line_or_margin_highlight, note_mouse_highlight):
17229 Omit unused local vars.
c499e557 17230 * window.c (shrink_windows): Omit unused local var.
b01a1c29 17231 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
17232 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17233 Omit unused local var.
17234
ba0165e1
PE
17235 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17236 Don't assume string length fits in int.
32ad8845 17237 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 17238 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 17239
3c59b4c9
PE
17240 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17241 instead of alloca (Bug#8344).
17242
a3eed478 17243 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 17244 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 17245
eb4d412d
PE
17246 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17247
1658b401
PE
17248 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17249 concerns.
17250
17251 * term.c (produce_glyphless_glyph): Remove unnecessary test.
17252
17253 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 17254
9a2c6e05
PE
17255 * keyboard.c (syms_of_keyboard): Use the same style as later
17256 in this function when indexing through an array. This also
17257 works around GCC bug 48267.
17258
03d0a109
PE
17259 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17260
44f730c8
PE
17261 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17262
fe75f926
PE
17263 * chartab.c (sub_char_table_ref_and_range): Redo for slight
17264 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17265
ffa8c828
PE
17266 * keyboard.c, keyboard.h (num_input_events): Now size_t.
17267 This avoids undefined behavior on integer overflow, and is a bit
17268 more convenient anyway since it is compared to a size_t variable.
17269
c5101a77
PE
17270 Variadic C functions now count arguments with size_t, not int.
17271 This avoids an unnecessary limitation on 64-bit machines, which
17272 caused (substring ...) to crash on large vectors (Bug#8344).
17273 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
17274 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 17275 All variadic functions and their callers changed accordingly.
c5101a77
PE
17276 (struct gcpro.nvars): Now size_t, not int. All uses changed.
17277 * data.c (arith_driver, float_arith_driver): Likewise.
17278 * editfns.c (general_insert_function): Likewise.
17279 * eval.c (struct backtrace.nargs, interactive_p)
17280 (internal_condition_case_n, run_hook_with_args, apply_lambda)
17281 (funcall_lambda, mark_backtrace): Likewise.
17282 * fns.c (concat): Likewise.
17283 * frame.c (x_set_frame_parameters): Likewise.
17284 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
17285 0 if not found, not -1. All callers changed.
17286
dd3f25f7
PE
17287 * alloc.c (garbage_collect): Don't assume stack size fits in int.
17288 (stack_copy_size): Now size_t, not int.
17289 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
17290
461c2ab9
JB
172912011-03-28 Juanma Barranquero <lekktu@gmail.com>
17292
17293 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
17294 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17295 All callers changed.
17296
17297 * lisp.h (multibyte_char_to_unibyte):
17298 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
17299 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17300 * character.h (CHAR_TO_BYTE8):
17301 * cmds.c (internal_self_insert):
17302 * editfns.c (general_insert_function):
17303 * keymap.c (push_key_description):
17304 * search.c (Freplace_match):
17305 * xdisp.c (message_dolog, set_message_1): All callers changed.
17306
f6d62986
SM
173072011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
17308
17309 * keyboard.c (safe_run_hook_funcall): New function.
17310 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17311 don't set the hook to nil, but remove the offending function instead.
17312 (Qcommand_hook_internal): Remove, unused.
17313 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17314 Vcommand_hook_internal.
17315
17316 * eval.c (enum run_hooks_condition): Remove.
17317 (funcall_nil, funcall_not): New functions.
17318 (run_hook_with_args): Call each function through a `funcall' argument.
17319 Remove `cond' argument, now redundant.
17320 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17321 (Frun_hook_with_args_until_failure): Adjust accordingly.
17322 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17323
1db5b1ad
JB
173242011-03-28 Juanma Barranquero <lekktu@gmail.com>
17325
17326 * dispextern.h (string_buffer_position): Remove declaration.
17327
17328 * print.c (strout): Remove parameter `multibyte', unused since
17329 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
17330
17331 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17332 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17333 All callers changed.
17334
17335 * w32.c (_wsa_errlist): Use braces for struct initializers.
17336
17337 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17338 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17339 All callers changed.
17340 (string_buffer_position): Likewise. Also, make static (it's never
17341 used outside xdisp.c).
17342 (cursor_row_p): Remove parameter `w', unused since
17343 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
17344 (decode_mode_spec): Remove parameter `precision', introduced during
17345 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17346 All callers changed.
17347
5ffb62aa
JD
173482011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17349
17350 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17351
461c2ab9 173522011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
17353
17354 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17355 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17356 (ns_update_auto_hide_menu_bar): New functions.
17357 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17358 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17359 ns_constrain_all_frames.
17360 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17361 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17362
5c380ffb
JD
173632011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17364
17365 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17366
9af30bdf
GM
173672011-03-27 Glenn Morris <rgm@gnu.org>
17368
17369 * syssignal.h: Replace RETSIGTYPE with void.
17370 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17371 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17372 Replace SIGTYPE with void everywhere.
17373 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17374 * s/template.h (SIGTYPE): Remove commented out definition.
17375
e2abce01
JB
173762011-03-26 Eli Zaretskii <eliz@gnu.org>
17377
17378 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17379 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17380
f868cd8a
JB
173812011-03-26 Juanma Barranquero <lekktu@gmail.com>
17382
59eb0929
JB
17383 * w32.c (read_unc_volume): Use parameter `henum', instead of
17384 global variable `wget_enum_handle'.
17385
17386 * keymap.c (describe_vector): Remove parameters `indices' and
17387 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17388 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17389
f868cd8a
JB
17390 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17391
17392 * keyboard.c (timer_check): Remove parameter `do_it_now',
17393 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17394 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17395 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17396
17397 * keyboard.c (read_char):
17398 * w32menu.c (w32_menu_display_help):
17399 * xmenu.c (show_help_event, menu_help_callback):
17400 Adjust calls to `show_help_echo'.
17401
17402 * gtkutil.c (xg_maybe_add_timer):
17403 * keyboard.c (readable_events):
17404 * process.c (wait_reading_process_output):
17405 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17406
17407 * insdel.c (adjust_markers_gap_motion):
17408 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17409 (gap_left, gap_right): Don't call it.
17410
2ecf6fdb
CY
174112011-03-25 Chong Yidong <cyd@stupidchicken.com>
17412
17413 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17414 incurred during fontification.
17415
6b1f9ba4
JB
174162011-03-25 Juanma Barranquero <lekktu@gmail.com>
17417
17418 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17419 (DEFVAR_PER_BUFFER): Don't pass it.
17420
17421 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17422 (scrolling_window): Don't pass it.
17423
0f4a96b5
JB
174242011-03-25 Juanma Barranquero <lekktu@gmail.com>
17425
17426 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17427
17428 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17429 and `suffix'.
17430 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17431 of variables specific to SELinux and computation of `encoded_absname'.
17432
17433 * image.c (XPutPixel): Remove unused variable `height'.
17434
17435 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17436
17437 * unexw32.c (get_section_info): Remove unused variable `section'.
17438
17439 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17440 (system_process_attributes): Remove unused variable `sess'.
17441 (sys_read): Remove unused variable `err'.
17442
17443 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17444 (w32_wnd_proc): Remove unused variable `isdead'.
17445 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17446 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17447 (x_create_tip_frame): Remove unused variable `tem'.
17448
17449 * w32inevt.c (w32_console_read_socket):
17450 Remove unused variable `no_events'.
17451
17452 * w32term.c (x_draw_composite_glyph_string_foreground):
17453 Remove unused variable `width'.
17454
1149507c
JB
174552011-03-24 Juanma Barranquero <lekktu@gmail.com>
17456
17457 * w32term.c (x_set_glyph_string_clipping):
17458 Don't pass uninitialized region to CombineRgn.
17459
9c88f339
JB
174602011-03-23 Juanma Barranquero <lekktu@gmail.com>
17461
17462 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17463 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17464 (Fx_close_connection): Remove unused variable `i'.
17465
17466 * w32font.c (w32font_draw): Return number of glyphs.
17467 (w32font_open_internal): Remove unused variable `i'.
17468 (w32font_driver): Add missing initializer.
17469
17470 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17471 (fill_in_menu): Remove unused variable `items_added'.
17472
17473 * w32term.c (last_mouse_press_frame): Remove static global variable.
17474 (w32_clip_to_row): Remove unused variable `f'.
17475 (x_delete_terminal): Remove unused variable `i'.
17476
17477 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17478 (NOTHING): Remove unused static global variable.
17479 (uniscribe_check_otf): Remove unused variable `table'.
17480 (uniscribe_font_driver): Add missing initializers.
17481
dee091a3
JD
174822011-03-23 Julien Danjou <julien@danjou.info>
17483
17484 * term.c (Fsuspend_tty, Fresume_tty):
17485 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17486 * window.c (temp_output_buffer_show):
17487 * insdel.c (signal_before_change):
17488 * frame.c (Fhandle_switch_frame):
17489 * fileio.c (Fdo_auto_save):
17490 * emacs.c (Fkill_emacs):
17491 * editfns.c (save_excursion_restore):
17492 * cmds.c (internal_self_insert):
17493 * callint.c (Fcall_interactively):
17494 * buffer.c (Fkill_all_local_variables):
17495 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17496 Use Frun_hooks.
0f4a96b5 17497 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 17498 unconditionally since it does the check itself.
dee091a3 17499
2c520ab5 175002011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 17501
c9c49752
PE
17502 Fix more problems found by GCC 4.5.2's static checks.
17503
8abc3f12
PE
17504 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17505 the first time through the loop, since we know p0 < p1 then.
17506 This also avoids a gcc -Wstrict-overflow warning.
17507
a2d26660
PE
17508 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17509 leading to a memory leak, possible in functions like
17510 load_charset_map_from_file that can allocate an unbounded number
b12ef411 17511 of objects (Bug#8318).
a2d26660 17512
916c72e9
PE
17513 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17514 that could (at least in theory) be that large.
17515
19ab8a18
PE
17516 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17517 This is less likely to overflow, and avoids undefined behavior if
17518 overflow does occur. All callers changed. Use strtoul to scan
17519 for the unsigned long integer.
b7cbbd6f
PE
17520 (pint2hrstr): Simplify and tune code slightly.
17521 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 17522
f0641eff
PE
17523 * scroll.c (do_scrolling): Work around GCC bug 48228.
17524 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17525
7f650bb9
PE
17526 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17527 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
17528 (validate_x_resource_name): Simplify count usage.
17529 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 17530
37dd57d1
PE
17531 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17532 fail (Bug#8306).
81e56e61 17533
699979fc 17534 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 17535
401bf9b4
PE
17536 * process.c (Fmake_network_process): Use socklen_t, not int,
17537 where POSIX says socklen_t is required in portable programs.
17538 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 17539 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
17540 (Fmake_network_process, server_accept_connection):
17541 (wait_reading_process_output, read_process_output):
17542 Likewise.
17543
b93aacde
PE
17544 * process.c: Rename or move locals to avoid shadowing.
17545 (list_processes_1, Fmake_network_process):
17546 (read_process_output_error_handler, exec_sentinel_error_handler):
17547 Rename or move locals.
4dc343ee 17548 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 17549 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 17550 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 17551 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 17552 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 17553
af8a867c 17554 Make tparam.h and terminfo.c consistent.
44f230aa
SM
17555 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17556 Include tparam.h instead, since it declares them.
af8a867c
PE
17557 * cm.h (PC): Remove extern decl; tparam.h now does this.
17558 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17559 * terminfo.c: Include tparam.h, to check interfaces.
17560 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17561 (tparam): Adjust signature to match interface in tparam.h;
17562 this removes some undefined behavior. Check that outstring and len
17563 are zero, which they always are with Emacs.
17564 * tparam.h (PC, BC, UP): New extern decls.
17565
0248044d 17566 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 17567 (xftfont_open): Rename locals to avoid shadowing.
0248044d 17568
8ff096c1 17569 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
17570 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17571 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 17572 (ftfont_list): Remove unused local.
49eaafba
PE
17573 (get_adstyle_property, ftfont_pattern_entity):
17574 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17575 Rename locals to avoid shadowing.
8ff096c1 17576
e2be39f6
PE
17577 * xfont.c (xfont_list_family): Mark var as initialized.
17578
c9735e30
PE
17579 * xml.c (make_dom): Now static.
17580
8f5201ae
PE
17581 * composite.c (composition_compute_stop_pos): Rename local to
17582 avoid shadowing.
b246f932
PE
17583 (composition_reseat_it): Remove unused locals.
17584 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 17585 (composition_update_it): Mark var as initialized.
11b61122
PE
17586 (find_automatic_composition): Mark vars as initialized,
17587 with a FIXME (Bug#8290).
8f5201ae 17588
760fbc2c
PE
17589 character.h: Rename locals to avoid shadowing.
17590 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17591 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17592 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17593 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17594 to avoid shadowing.
17595
ff08eb85
PE
17596 * textprop.c (property_change_between_p): Remove; unused.
17597
fc7bf025
PE
17598 * intervals.c (interval_start_pos): Now static.
17599
235d7abc
PE
17600 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17601
44f230aa
SM
17602 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17603 Rename locals to avoid shadowing.
3e7d6594 17604
50060332
PE
17605 * sound.c (wav_play, au_play, Fplay_sound_internal):
17606 Fix pointer signedness.
d01f234b 17607 (alsa_choose_format): Remove unused local var.
c83b8872
PE
17608 (wav_play): Initialize a variable to 0, to prevent undefined
17609 behavior (Bug#8278).
50060332 17610
c4fc4e30
PE
17611 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17612
918436ed
PE
17613 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17614
c939f91b
PE
17615 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17616 clobbering (Bug#8298).
b9c7f648
PE
17617 * sysdep.c (sys_subshell): Likewise.
17618 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 17619
6bd8c144
PE
17620 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17621 This should get cleaned up, so that child_setup has the
17622 same signature on all platforms.
17623
7710357c 17624 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 17625 (relocate_fd): Rename locals to avoid shadowing.
7710357c 17626
c59da222
CY
176272011-03-22 Chong Yidong <cyd@stupidchicken.com>
17628
17629 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17630 not to be necessary, and produces flickering.
17631
66b87493
GM
176322011-03-20 Glenn Morris <rgm@gnu.org>
17633
17634 * config.in: Remove file.
17635
45b6f6d5
JB
176362011-03-20 Juanma Barranquero <lekktu@gmail.com>
17637
17638 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17639 are now in src/globals.h.
17640 (syms_of_minibuf): Remove spurious & from previous change.
17641
cd394be1 176422011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
17643
17644 * minibuf.c (completing-read-function): New variable.
17645 (completing-read-default): Rename from completing-read.
17646 (completing-read): Call completing-read-function.
17647
b14e3e21
CY
176482011-03-19 Juanma Barranquero <lekktu@gmail.com>
17649
17650 * xfaces.c (Fx_load_color_file):
17651 Read color file from absolute filename (bug#8250).
17652
f2b726e6
JB
176532011-03-19 Juanma Barranquero <lekktu@gmail.com>
17654
17655 * makefile.w32-in: Update dependencies.
17656
09f6ff02
EZ
176572011-03-17 Eli Zaretskii <eliz@gnu.org>
17658
17659 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17660
29a6015a
PE
176612011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17662
a3a6c54e
PE
17663 Fix more problems found by GCC 4.5.2's static checks.
17664
b766f867
PE
17665 * process.c (make_serial_process_unwind, send_process_trap):
17666 (sigchld_handler): Now static.
17667
be02381c
PE
17668 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17669 That way, the code declares only the vars that it needs.
17670 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17671 * s/cygwin.h (PTY_ITERATION): Likewise.
17672 * s/darwin.h (PTY_ITERATION): Likewise.
17673 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17674
57048744
PE
17675 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17676 * process.c (allocate_pty): Don't declare stb unless it's needed.
17677
7914961c 17678 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
17679 (CONSTANTLIM): Remove; unused.
17680 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17681 Define only if needed.
7914961c 17682
b3967b18
PE
17683 * unexelf.c (unexec): Name an expression,
17684 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
17685 Use a different way to cause a compilation error if anyone uses
17686 n rather than nn, a way that does not involve shadowing.
73366a00 17687 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 17688
29a6015a
PE
17689 * deps.mk (unexalpha.o): Remove; unused.
17690
43cfc33e 17691 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 17692 * unexec.h: New file.
ce701a33
PE
17693 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17694 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17695 Depend on unexec.h.
17696 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17697 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17698 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 17699 Change as necessary to match prototype in unexec.h.
ce701a33 17700
01f44d5a
PE
17701 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17702 shadowing.
4f63c6bb 17703 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 17704
a6670b0b
PE
17705 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17706 Rename locals to avoid shadowing.
17707
cef2010d 17708 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 17709 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 17710
d4d7173a
PE
17711 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17712
f08b802a
PE
17713 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17714 warning when compiling print.c.
17715
3ddb0639
PE
17716 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17717 instead of using an uninitialized var.
5ad03b97 17718 (font_sort_entities): Mark var as initialized.
3ddb0639 17719
170a2692
PE
17720 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17721
e663c700
PE
17722 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17723 pointers to constants.
89bc529a 17724 (font_parse_fcname): Remove unused vars.
7b81e2d0 17725 (font_delete_unmatched): Now static.
ea838e10 17726 (font_get_spec): Remove; unused.
13a547c6
PE
17727 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17728 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17729 Rename or move locals to avoid shadowing.
e663c700 17730
2a80c887 17731 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 17732 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 17733
1384fa33 17734 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 17735 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 17736
8b2c52e9
PE
17737 * alloc.c (mark_backtrace): Move decl from here ...
17738 * lisp.h: ... to here, so that it can be checked.
17739
475545b5 17740 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 17741 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
17742 (lisp_indirect_variable): Name an expression,
17743 to avoid gcc -Wbad-function-cast warning.
1faed8ae 17744 (Fdefvar): Rename locals to avoid shadowing.
475545b5 17745
b1349114 17746 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 17747 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 17748 Use const pointer when appropriate.
b1349114 17749
a2928364
PE
17750 * lisp.h (get_system_name, get_operating_system_release):
17751 Move decls here, to check interfaces.
17752 * process.c (get_operating_system_release): Move decl to lisp.h.
17753 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
17754 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17755 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17756 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
17757 (Fformat_time_string, Fencode_time, Finsert_char):
17758 (Ftranslate_region_internal, Fformat):
17759 Rename or remove local vars to avoid shadowing.
9710023e 17760 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 17761
a415e694
PE
17762 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17763 avoid shadowing.
17764
8ef4622d
PE
17765 * lisp.h (eassert): Check that the argument compiles, even if
17766 ENABLE_CHECKING is not defined.
17767
946f9a5b
PE
17768 * data.c (Findirect_variable): Name an expression, to avoid
17769 gcc -Wbad-function-cast warning.
112396d6 17770 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 17771 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
17772 (Fmake_variable_buffer_local, Fmake_local_variable):
17773 Mark variables as initialized.
52746918 17774 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 17775
e5aab7e7 17776 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
17777 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17778 Rename locals to avoid shadowing.
dff45157
PE
17779 (mark_stack): Move local variables into the #ifdef region where
17780 they're used.
7bc26fdb
PE
17781 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17782 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17783 needed otherwise.
17784 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17785 (GC_STRING_CHARS): Remove; not used.
d40d4be1 17786 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 17787
e5aab7e7
PE
17788 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17789 avoids undefined behavior in theory.
17790
4da60324
PE
17791 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17792
88043301
PE
17793 Use functions, not macros, for up- and down-casing (Bug#8254).
17794 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17795 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17796 to use the following functions instead of these macros.
17797 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17798 EMACS_INT, since callers assume the returned value fits in int.
17799 (upcase1): Likewise, for UPCASE_TABLE.
17800 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 17801 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 17802 the race-condition problem in the old DOWNCASE.
88043301 17803
19ed5445
PE
17804 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17805 Rename locals to avoid shadowing.
17806 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
17807 (regex_compile, re_search_2, re_match_2_internal):
17808 Remove unused local vars.
952db0d7
PE
17809 (FREE_VAR): Rewrite so as not to use empty "else",
17810 which gcc can warn about.
da053e48 17811 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
17812 (RETALLOC_IF): Define only if needed.
17813 (WORDCHAR_P): Likewise. This one is never needed, but is used
17814 only in a comment talking about a compiler bug, so put inside
17815 the #if 0 of that comment.
17816 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17817 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17818 Remove; unused.
19ed5445 17819
1f3561e4 17820 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
17821 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17822 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 17823
ded6f8f7
PE
17824 * search.c (simple_search): Remove unused var.
17825
dbd37a95
PE
17826 * dired.c (compile_pattern): Move decl from here ...
17827 * lisp.h: ... to here, so that it can be checked.
17828 (struct re_registers): New forward decl.
17829
7e47afad
PE
17830 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17831
85f24f61
PE
17832 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17833 All uses changed.
17834 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17835 Rename locals to avoid shadowing.
5671df8f 17836 (Fvertical_motion): Mark locals as initialized.
85f24f61 17837
181aa2be 17838 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 17839 (casify_region): Mark local as initialized.
181aa2be 17840
930d429c
PE
17841 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17842
7082eac6
PE
17843 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17844 New macros, so that the caller can use some names other than
17845 gcpro1, gcpro2, etc.
17846 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17847 of the new macros.
17848 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17849 argument, for consistency with GCPRO2_VAR, etc: it is now the
17850 prefix of the variable, not the variable itself. All uses
17851 changed.
38b2c076
PE
17852 * dired.c (directory_files_internal, file_name_completion):
17853 Rename locals to avoid shadowing.
17854
15206ed9
PE
17855 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17856 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17857 dired.c's scmp function, had undefined behavior.
17858 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17859 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17860 * buffer.h: ... to here, because these macros use current_buffer,
17861 and the new implementation with inline functions needs to have
17862 current_buffer in scope now, rather than later when the macros
17863 are used.
17864 (downcase, upcase1): New static inline functions.
17865 (DOWNCASE, UPCASE1): Reimplement using these functions.
17866 This avoids undefined behavior in expressions like
17867 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17868 from race conditions in accessing the global variables
17869 case_temp1 and case_temp2.
17870 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17871 * lisp.h (case_temp1, case_temp2): Remove their decls.
17872 * character.h (ASCII_CHAR_P): Move from here ...
17873 * lisp.h: ... to here, so that the inline functions mentioned
17874 above can use them.
17875
4a6bea26
PE
17876 * dired.c (directory_files_internal_unwind): Now static.
17877
f14b7e14
PE
17878 * fileio.c (file_name_as_directory, directory_file_name):
17879 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17880 Now static.
2893f146
PE
17881 (file_name_as_directory): Use const pointers when appropriate.
17882 (Fexpand_file_name): Likewise. In particular, newdir might
17883 point at constant storage, so make it a const pointer.
fd4ead52 17884 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
17885 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17886 signedness issues.
f839df0c
PE
17887 (Fset_file_times, Finsert_file_contents, auto_save_error):
17888 Rename locals to avoid shadowing.
f14b7e14 17889
5716756e 17890 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
17891 (Ftry_completion, Fall_completions): Rename or remove locals
17892 to avoid shadowing.
5716756e 17893
b4c3046a
PE
17894 * marker.c (bytepos_to_charpos): Remove; unused.
17895
b45db522
PE
17896 * lisp.h (verify_bytepos, count_markers): New decls,
17897 so that gcc does not warn that these functions aren't declared.
17898
85876d07
PE
17899 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17900 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 17901 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 17902 (copy_text): Remove unused local var.
85876d07 17903
03d78a21 17904 * filelock.c (within_one_second): Now static.
b3dd38ab 17905 (lock_file_1): Rename local to avoid shadowing.
03d78a21 17906
5df8f01b
PE
17907 * buffer.c (fix_overlays_before): Mark locals as initialized.
17908 (fix_start_end_in_overlays): Likewise. This function should be
17909 simplified by using pointers-to-pointers, but that's a different
17910 matter.
b1d876f1 17911 (switch_to_buffer_1): Now static.
8f54f30a
PE
17912 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17913 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 17914
a70072c9 17915 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 17916 Fix pointer signedness issue.
edced198
PE
17917 (sys_subshell): Mark local as volatile if checking for lint,
17918 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 17919 (MAXPATHLEN): Define only if needed.
a70072c9 17920
a0977c44
PE
17921 * process.c (serial_open, serial_configure): Move decls from here ...
17922 * systty.h: ... to here, so that they can be checked.
17923
a884fdcc
PE
17924 * fns.c (get_random, seed_random): Move extern decls from here ...
17925 * lisp.h: ... to here, so that they can be checked.
17926
604efe86 17927 * sysdep.c (reset_io): Now static.
b8950c94 17928 (wait_for_termination_signal): Remove; unused.
604efe86 17929
38fc62d9
PE
17930 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17931 (copy_keymap_item, append_key, push_text_char_description):
17932 Now static.
1004a21a 17933 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 17934 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
17935 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17936 (describe_map_tree):
17937 Rename locals to avoid shadowing.
38fc62d9 17938
2f2650da
PE
17939 * keyboard.c: Declare functions static if they are not used elsewhere.
17940 (echo_char, echo_dash, cmd_error, top_level_2):
17941 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
17942 (read_char, kbd_buffer_get_event, make_lispy_position):
17943 (make_lispy_event, make_lispy_movement, apply_modifiers):
17944 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17945 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17946 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 17947 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 17948 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 17949
a053e86c 17950 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
17951 (mark_kboards): Move decl here ...
17952 * alloc.c (mark_kboards): ... from here.
a053e86c 17953
4752793e
PE
17954 * lisp.h (force_auto_save_soon): New decl.
17955
74f10ca7 17956 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
17957 (DEFINE_DUMMY_FUNCTION): New macro.
17958 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17959 Use it.
c03cd23f
PE
17960 (main): Add casts to avoid warnings
17961 if GCC considers string literals to be constants.
74f10ca7 17962
022e70d4
PE
17963 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17964
59d6fe83
PE
17965 * dbusbind.c: Pointer signedness fixes.
17966 (xd_signature, xd_append_arg, xd_initialize):
17967 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17968 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17969 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17970 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17971
78320123
PE
17972 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17973 if GCC considers string literals to be constants.
49cebcca 17974 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 17975
35ac2a97
SM
179762011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17977
fb103ca9
SM
17978 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17979 (print_preprocess, print_object): New macro to fix last change.
17980
35ac2a97
SM
17981 * print.c (print_preprocess): Don't forget font objects.
17982
62973b41
JB
179832011-03-16 Juanma Barranquero <lekktu@gmail.com>
17984
17985 * emacs.c (USAGE3): Doc fixes.
17986
0e48bb22
AS
179872011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17988
17989 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17990 structure.
17991
7684e57b
JB
179922011-03-14 Juanma Barranquero <lekktu@gmail.com>
17993
17994 * lisp.h (VWindow_system, Qfile_name_history):
17995 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17996 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17997 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17998
17999 * w32select.c: Don't #include "keyboard.h".
c96bbc66 18000 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
18001
18002 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18003 * w32console.c (detect_input_pending, read_input_pending)
18004 (encode_terminal_code):
18005 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18006 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18007 (w32_system_caret_y, Qfile_name_history):
18008 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18009 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18010 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18011 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18012 * w32proc.c (Qlocal, report_file_error):
18013 * w32term.c (Vwindow_system, updating_frame):
18014 * w32uniscribe.c (initialized, uniscribe_font_driver):
18015 Remove unneeded extern declarations.
18016
2aa46d6c
CY
180172011-03-14 Chong Yidong <cyd@stupidchicken.com>
18018
c96bbc66 18019 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 18020
cffc6f3b
CY
180212011-03-13 Chong Yidong <cyd@stupidchicken.com>
18022
18023 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18024 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18025 These macros can no longer be used for assignment.
18026
44f230aa
SM
18027 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18028 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
18029 (record_buffer_markers, fetch_buffer_markers): New functions for
18030 recording and fetching special buffer markers.
18031 (set_buffer_internal_1, set_buffer_temp): Use them.
18032
18033 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18034
18035 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18036
18037 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18038 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
18039
18040 * xdisp.c (hscroll_window_tree):
18041 (reconsider_clip_changes): Use PT instead of BUF_PT.
18042
d251f04b
EZ
180432011-03-13 Eli Zaretskii <eliz@gnu.org>
18044
18045 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18046 $(EMACS_ROOT)/lib/intprops.h.
18047
f0c77cd1
PE
180482011-03-13 Paul Eggert <eggert@cs.ucla.edu>
18049
3eca4629
PE
18050 Fix more problems found by GCC 4.5.2's static checks.
18051
7c86ee98
PE
18052 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18053 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
18054 (xg_free_frame_widgets): Make it clear that a local variable is
18055 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
18056 (gdk_window_get_screen): Make it clear that this macro is needed
18057 only if USE_GTK_TOOLTIP.
1e5524e7
PE
18058 (int_gtk_range_get_value): New function, which avoids a diagnostic
18059 from gcc -Wbad-function-cast.
18060 (xg_set_toolkit_scroll_bar_thumb): Use it.
18061 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18062 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
18063 (get_utf8_string, xg_get_file_with_chooser):
18064 Rename locals to avoid shadowing.
18065 (create_dialog): Move locals to avoid shadowing.
7c86ee98 18066
41729b81
PE
18067 * xgselect.c (xg_select): Remove unused var.
18068
f0c77cd1
PE
18069 * image.c (four_corners_best): Mark locals as initialized.
18070 (gif_load): Initialize transparent_p to zero (Bug#8238).
18071 Mark another local as initialized.
ec6cf4c6 18072 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 18073
ce0ad53d 18074 * image.c (clear_image_cache): Now static.
d5d5a617 18075 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 18076 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
18077 (x_edge_detection): Remove unnecessary cast that
18078 gcc -Wbad-function-cast diagnoses.
2037898d 18079 (gif_load): Fix pointer signedness.
6ae141d6
PE
18080 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18081 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 18082
33383987 180832011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 18084
d32df629
PE
18085 Improve quality of tests for time stamp overflow.
18086 For example, without this patch (encode-time 0 0 0 1 1
18087 1152921504606846976) returns the obviously-bogus value (-948597
18088 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18089 reports time overflow. See
18090 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
18091 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18092 * editfns.c: Include limits.h and intprops.h.
18093 (TIME_T_MIN, TIME_T_MAX): New macros.
18094 (time_overflow): Move earlier, to before first use.
18095 (hi_time, lo_time): New functions, for an accurate test for
18096 out-of-range times.
18097 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18098 (Fget_internal_run_time): Don't assume time_t fits in int.
18099 (make_time): Use list2 instead of Fcons twice.
18100 (Fdecode_time): More accurate test for out-of-range times.
18101 (check_tm_member): New function.
18102 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
18103 (lisp_time_argument): Don't rely on undefined left-shift and
18104 right-shift behavior when checking for time stamp overflow.
8be6f318 18105
fe31d94c
PE
18106 * editfns.c (time_overflow): New function, refactoring common code.
18107 (Fformat_time_string, Fdecode_time, Fencode_time):
18108 (Fcurrent_time_string): Use it.
18109
8be6f318
PE
18110 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18111 * dired.c (make_time): Move to ...
18112 * editfns.c (make_time): ... here.
18113 * systime.h: Note the move.
18114
09d9db2c 181152011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 18116
126bc0dc
YM
18117 * fringe.c (update_window_fringes): Remove unused variables.
18118
c47cbdfd
YM
18119 * unexmacosx.c (copy_data_segment): Also copy __got section.
18120 (Bug#8223)
18121
7ac80be9
EZ
181222011-03-12 Eli Zaretskii <eliz@gnu.org>
18123
c96bbc66 18124 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
18125 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
18126 Constify `char *' arguments and their references according to
18127 prototypes in tparam.h.
18128
ecb0f94d 18129 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 18130
7ac80be9
EZ
18131 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
18132 Adapt all references accordingly.
18133
18134 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
18135
ef1fd07e
TT
181362011-03-11 Tom Tromey <tromey@redhat.com>
18137
18138 * buffer.c (syms_of_buffer): Remove obsolete comment.
18139
7ef4b50c
EZ
181402011-03-11 Eli Zaretskii <eliz@gnu.org>
18141
18142 * termhooks.h (encode_terminal_code): Declare prototype.
18143
18144 * msdos.c (encode_terminal_code): Don't declare prototype.
18145
18146 * term.c (encode_terminal_code): Now external again, used by
18147 w32console.c and msdos.c.
18148
44f230aa
SM
18149 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
18150 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 18151
4b1ec863 181522011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 18153
1714f52b 18154 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 18155
4b1ec863
PE
18156 * fringe.c (update_window_fringes): Mark locals as initialized
18157 (Bug#8227).
18158 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 18159
524c7aa6
PE
18160 * alloc.c (mark_fringe_data): Move decl from here ...
18161 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
18162 to check its interface.
18163 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
18164
a5c0af81 18165 * fontset.c (free_realized_fontset): Now static.
7519b8cd 18166 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 18167 (fontset_font): Mark local as initialized.
a9a06e0b 18168 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 18169
b4716021
PE
18170 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
18171
811e9bac 18172 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 18173 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
18174 (x_own_selection, Fx_disown_selection_internal): Rename locals
18175 to avoid shadowing.
18176 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 18177
7e3ab302
PE
18178 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
18179 so that the caller can use some name other than gcpro1.
18180 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
18181 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18182 (Fx_backspace_delete_keys_p):
18183 Use them to avoid shadowing, and rename vars to avoid shadowing.
18184 (x_decode_color, x_set_name, x_window): Now static.
6b437900 18185 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 18186 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
18187 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18188 Remove unused locals.
7e3ab302
PE
18189 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18190 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18191 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18192 macros.
f78faa98 18193
e2b13473
PE
18194 * xterm.h (x_mouse_leave): New decl.
18195
77f23912
PE
18196 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18197 Remove unused functions.
cdf4ba58
PE
18198 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18199 (x_calc_absolute_position): Now static.
7411c686 18200 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 18201 Don't declare local "event" unless it's used.
ed7bf3a5
PE
18202 (x_iconify_frame, x_free_frame_resources): Don't declare locals
18203 unless they are used.
38d0b34a
PE
18204 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18205 (x_fatal_error_signal): Remove; not used.
a6067996
PE
18206 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18207 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18208 (x_error_catcher, x_connection_closed, x_error_handler):
18209 (x_error_quitter, xembed_send_message, x_iconify_frame):
18210 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 18211 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 18212 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 18213
44f230aa
SM
18214 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18215 Rename or move locals to avoid shadowing.
6b463e58 18216 (tty_defined_color, merge_face_heights): Now static.
5967d051 18217 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
18218 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18219 does not deduce is never used uninitialized.
73719eba
PE
18220 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18221 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 18222
426994c3 18223 * terminal.c (store_terminal_param): Now static.
5489860b 18224
032f1620 18225 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 18226 (set_frame_menubar): Remove unused local.
d4323972 18227 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
18228 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18229 since they might point to immutable storage.
281585b0
PE
18230 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18231 since it's unused otherwise.
032f1620 18232
367c19e5 18233 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 18234 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
18235 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18236 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 18237 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
18238 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18239 does not deduce are never used uninitialized.
70739cbe 18240
07b48fa9
PE
18241 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18242
8868a238 18243 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
18244 * window.c (window_loop, size_window):
18245 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 18246
7e5cf297 18247 * window.c (display_buffer): Now static.
d6550a9f
PE
18248 (size_window): Mark variables that gcc -Wuninitialized
18249 does not deduce are never used uninitialized.
a586633d
PE
18250 * window.h (check_all_windows): New decl, to forestall
18251 gcc -Wmissing-prototypes diagnostic.
5b555da1 18252 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 18253
f6095868
PE
18254 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18255 shadowing.
18256 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
18257 Include <limits.h>.
18258 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18259 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
18260 (load_charset_map): Mark variables that gcc -Wuninitialized
18261 does not deduce are never used uninitialized.
53df7c11 18262 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 18263
f38b440c
PE
18264 * coding.c (coding_set_source, coding_set_destination):
18265 Use "else { /* comment */ }" rather than "else /* comment */;"
18266 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
18267 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18268 a block, when the outer 'i' will do.
18269 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18270 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18271 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18272 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
18273 (Fdecode_sjis_char, Fdefine_coding_system_internal):
18274 Rename locals to avoid shadowing.
18275 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
18276 * coding.c (emacs_mule_char, encode_invocation_designation):
18277 Now static, since they're not used elsewhere.
413bb2db 18278 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 18279 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
18280 (decode_coding_emacs_mule): Mark variables that gcc
18281 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
18282 (detect_coding_iso_2022): Initialize a local variable that might
18283 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 18284 this initialization is needed. (Bug#8211)
5f58e762
PE
18285 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
18286 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
18287 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
18288 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
18289 Remove unused macros.
f38b440c 18290
232b38b9 18291 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 18292 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 18293 * character.c (string_count_byte8): Likewise.
232b38b9 18294
fb90da1b
PE
18295 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
18296 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
18297
fb93dbc2
PE
18298 * chartab.c (copy_sub_char_table): Now static, since it's not used
18299 elsewhere.
5c156ace
PE
18300 (sub_char_table_ref_and_range, char_table_ref_and_range):
18301 Rename locals to avoid shadowing.
bbcd0949 18302 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 18303
7d3b3862 18304 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 18305 (BIDI_BOB): Remove unused macro.
7d3b3862 18306
6be7d3da
PE
18307 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18308 deduce are never used uninitialized.
c2ed9c8b 18309 * term.c (encode_terminal_code): Likewise.
6be7d3da 18310
75f8807f 18311 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 18312
50938595
PE
18313 * tparam.h: New file.
18314 * term.c, tparam.h: Include it.
18315 * deps.mk (term.o, tparam.o): Depend on tparam.h.
18316 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18317 Move these decls to tparam.h, and make them agree with what
18318 is actually in tparam.c. The previous trick of using incompatible
18319 decls in different modules does not conform to the C standard.
18320 All callers of tparam changed to use tparam's actual API.
18321 * tparam.c (tparam1, tparam, tgoto):
18322 Use const pointers where appropriate.
18323
fbceeba2
PE
18324 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18325 * cm.h (struct cm): Likewise.
18326 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18327 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18328 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18329 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18330 (turn_on_face, init_tty): Likewise.
18331 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 18332
7f3f1250
PE
18333 * term.c (term_mouse_position): Rename local to avoid shadowing.
18334
e6ca6543
PE
18335 * alloc.c (mark_ttys): Move decl from here ...
18336 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18337
c40f8d15
AS
183382011-03-11 Andreas Schwab <schwab@linux-m68k.org>
18339
18340 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18341
cfe0661d
JB
183422011-03-09 Juanma Barranquero <lekktu@gmail.com>
18343
18344 * search.c (compile_pattern_1): Remove argument regp, unused since
18345 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18346 (compile_pattern): Don't pass it.
18347
0afb4571
J
183482011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18349
18350 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18351 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18352 for ! HAVE_GTK3.
18353 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18354
18355 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18356
18357 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18358 gdk_window_get_screen, gdk_window_get_geometry,
18359 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18360 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18361 (xg_get_pixbuf_from_pixmap): New function.
18362 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18363 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18364 Call xg_get_pixbuf_from_pixmap instead of
18365 gdk_pixbuf_get_from_drawable.
18366 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18367 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18368 (xg_check_special_colors): Use GtkStyleContext and its functions
18369 for HAVE_GTK3.
18370 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18371 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18372 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
18373 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18374 Call gtk_widget_get_preferred_size.
0afb4571
J
18375 (xg_frame_resized): gdk_window_get_geometry only takes 5
18376 parameters.
44f230aa
SM
18377 (xg_win_to_widget, xg_event_is_for_menubar):
18378 Call gdk_x11_window_lookup_for_display.
0afb4571
J
18379 (xg_set_widget_bg): New function.
18380 (delete_cb): New function.
895009e1 18381 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 18382 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
18383 (xg_set_background_color): Call xg_set_widget_bg.
18384 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18385 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18386 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18387 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18388 if ! HAVE_GTK3.
18389 (update_frame_tool_bar): Call gtk_widget_hide.
18390 (xg_initialize): Use GDK_KEY_g.
18391
18392 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18393 if ! HAVE_GTK3
18394 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18395
18396 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18397 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18398 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18399
1c2cc4ef
JB
184002011-03-08 Juanma Barranquero <lekktu@gmail.com>
18401
18402 * w32xfns.c (select_palette): Check success of RealizePalette against
18403 GDI_ERROR, not zero.
18404
33383987 18405See ChangeLog.11 for earlier changes.
aac0c6e3
MR
18406
18407;; Local Variables:
18408;; coding: utf-8
aac0c6e3
MR
18409;; End:
18410
2f097256 18411 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
18412
18413 This file is part of GNU Emacs.
18414
18415 GNU Emacs is free software: you can redistribute it and/or modify
18416 it under the terms of the GNU General Public License as published by
18417 the Free Software Foundation, either version 3 of the License, or
18418 (at your option) any later version.
18419
18420 GNU Emacs is distributed in the hope that it will be useful,
18421 but WITHOUT ANY WARRANTY; without even the implied warranty of
18422 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18423 GNU General Public License for more details.
18424
18425 You should have received a copy of the GNU General Public License
18426 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.