* nsterm.m (windowDidEnterFullScreen): Remove fprintf.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
914e743b
JD
12012-10-02 Jan Djärv <jan.h.d@swipnet.se>
2
3 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
4
d8ab37a8
EZ
52012-10-02 Eli Zaretskii <eliz@gnu.org>
6
7 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
8 consistent with the change in return value of 'safe_strsignal'.
9
b3ecad33
PE
102012-10-02 Paul Eggert <eggert@cs.ucla.edu>
11
0a99eee1
PE
12 Prefer plain 'static' to 'static inline' (Bug#12541).
13 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
14 (bidi_set_sor_type, bidi_push_embedding_level)
15 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
16 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
17 (bidi_cache_search, bidi_cache_ensure_space)
18 (bidi_cache_iterator_state, bidi_cache_find)
19 (bidi_peek_at_next_level, bidi_set_paragraph_end)
20 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
21 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
22 Now 'static', not 'static inline'.
23
b3ecad33
PE
24 Count overruns when profiling; change units to ns.
25 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
26 Give extra weight to samples after overruns, to attempt to count
27 the time more accurately.
28 (setup_cpu_timer): Change sampling interval units from ms to ns, since
29 the underlying primitives nominally do ns.
30 (Fprofiler_cpu_start): Document the change. Mention that
31 the sampling intervals are only approximate.
32
090cf9db
SM
332012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
34
35 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
36
37 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
38 case for the special 0 coding-system.
39
40 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
41 (Fmake_overlay): Remove redundant tests.
64edc777 42 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 43
81550bf4
JB
442012-10-02 Juanma Barranquero <lekktu@gmail.com>
45
46 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
47 Update dependencies.
48
aa1ba90e
PE
492012-10-01 Paul Eggert <eggert@cs.ucla.edu>
50
51 Fix a malloc race condition involving strsignal.
52 A signal can arrive in the middle of a malloc, and Emacs's signal
53 handler can invoke strsignal, which can invoke malloc, which is
54 not portable. This race condition bug makes Emacs hang on GNU/Linux.
55 Fix it by altering the signal handler so that it does not invoke
56 strsignal.
57 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
58 * process.c (status_message): Use const pointer, in case strsignal
59 is #defined to safe_strsignal.
60 * sysdep.c (sys_siglist, init_signals): Always define and
61 initialize a substitute sys_siglist if the system does not define
62 one, even if HAVE_STRSIGNAL.
63 (safe_strsignal): Rename from strsignal. Always define,
64 using sys_siglist. Return a const pointer.
65 * syssignal.h (safe_strsignal): New decl.
66 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
67
ace917bd
EZ
682012-10-01 Eli Zaretskii <eliz@gnu.org>
69
70 * w32proc.c (timer_loop): Fix code that waits for timer
71 expiration, to avoid high CPU usage.
72
9eb71b9c
SM
732012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
74
75 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
76 (sweep_weak_table): Remove redundant prototypes.
77
b3317662
FP
782012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
79
80 * emacs.c: Move the inclusion of TERM_HEADER after including
81 windows.h on WINDOWSNT. This avoids compilation problems with
82 MSVC.
83
f0e5f225
EZ
842012-10-01 Eli Zaretskii <eliz@gnu.org>
85
2d7d1608
EZ
86 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
87 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
88 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
89 as the previous version used 'void *'.
90
91 * ralloc.c (ROUNDUP): Fix last change.
92 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
93 'size_t'.
94
f0e5f225
EZ
95 * w32proc.c <disable_itimers>: New static flag.
96 (init_timers): Initialize it to zero, after creating the critical
97 sections used by the timer threads.
98 (term_timers): Set to 1 before deleting the critical sections.
99 (getitimer, setitimer): If disable_itimers is non-zero, return an
100 error indication without doing anything. Reported by Fabrice
101 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
102 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
103 return results.
104 [!HAVE_SETITIMER]: Behave as the previous version that didn't
105 support timers.
f0e5f225
EZ
106
107 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
108 term_ntproc after all the other bookkeeping, to get timers working
109 as long as possible.
110
82ef37c1
PE
1112012-10-01 Paul Eggert <eggert@cs.ucla.edu>
112
b3a4c387
PE
113 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
114 Suggested by Juri Linkov in
115 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
116
b0ab8123
PE
117 Prefer plain 'static' to 'static inline' (Bug#12541).
118 With static functions, modern compilers inline pretty well by
119 themselves; advice from programmers often hurts as much as it helps.
120 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
121 this change shrinks the text size of the Emacs executable by 1.1%
122 without affecting CPU significantly in my benchmark.
123 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
124 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
125 (mark_maybe_object, mark_maybe_pointer, bounded_number):
126 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
127 (bset_auto_fill_function, bset_auto_save_file_format)
128 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
129 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
130 (bset_cache_long_line_scans, bset_case_fold_search)
131 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
132 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
133 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
134 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
135 (bset_header_line_format, bset_indicate_buffer_boundaries)
136 (bset_indicate_empty_lines, bset_invisibility_spec)
137 (bset_left_fringe_width, bset_major_mode, bset_mark)
138 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
139 (bset_name, bset_overwrite_mode, bset_pt_marker)
140 (bset_right_fringe_width, bset_save_length)
141 (bset_scroll_bar_width, bset_scroll_down_aggressively)
142 (bset_scroll_up_aggressively, bset_selective_display)
143 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
144 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
145 (set_buffer_overlays_after):
146 * category.c (bset_category_table):
147 * charset.c (read_hex):
148 * coding.c (produce_composition, produce_charset)
149 (handle_composition_annotation, handle_charset_annotation)
150 (char_encodable_p):
151 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
152 (assign_row, set_frame_matrix_frame, make_current)
153 (add_row_entry):
154 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
155 * fns.c (maybe_resize_hash_table):
156 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
157 * gmalloc.c (register_heapinfo):
158 * image.c (lookup_image_type):
159 * intervals.c (set_interval_object, set_interval_left)
160 (set_interval_right, copy_interval_parent, rotate_right)
161 (rotate_left, balance_possible_root_interval):
162 * keyboard.c (kset_echo_string, kset_kbd_queue)
163 (kset_keyboard_translate_table, kset_last_prefix_arg)
164 (kset_last_repeatable_command, kset_local_function_key_map)
165 (kset_overriding_terminal_local_map, kset_real_last_command)
166 (kset_system_key_syms, clear_event, set_prop):
167 * lread.c (digit_to_number):
168 * marker.c (attach_marker, live_buffer, set_marker_internal):
169 * nsterm.m (ns_compute_glyph_string_overhangs):
170 * process.c (pset_buffer, pset_command)
171 (pset_decode_coding_system, pset_decoding_buf)
172 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
173 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
174 (pset_status, pset_tty_name, pset_type, pset_write_queue):
175 * syntax.c (bset_syntax_table, dec_bytepos):
176 * terminal.c (tset_param_alist):
177 * textprop.c (interval_has_some_properties)
178 (interval_has_some_properties_list):
179 * window.c (wset_combination_limit, wset_dedicated)
180 (wset_display_table, wset_hchild, wset_left_fringe_width)
181 (wset_left_margin_cols, wset_new_normal, wset_new_total)
182 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
183 (wset_right_fringe_width, wset_right_margin_cols)
184 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
185 (wset_vertical_scroll_bar_type, wset_window_parameters):
186 * xdisp.c (wset_base_line_number, wset_base_line_pos)
187 (wset_column_number_displayed, wset_region_showing)
188 (window_box_edges, run_window_scroll_functions)
189 (append_glyph_string_lists, prepend_glyph_string_lists)
190 (append_glyph_string, set_glyph_string_background_width)
191 (append_glyph, append_composite_glyph)
192 (take_vertical_position_into_account):
193 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
194 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
195 (lface_hash, lface_same_font_attributes_p, lookup_face):
196 * xml.c (libxml2_loaded_p):
197 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
198 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
199 Now 'static', not 'static inline'.
200
05584c31
PE
201 * bidi.c: Tune.
202 (bidi_copy_it): Do the whole copy with a single memcpy.
203 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
204
86ec63ba
PE
205 Revert the FOLLOW-SYMLINKS change for file-attributes.
206 Doing it right would require several changes to Tramp, and there's
207 not enough time to get that tested before the freeze today.
208 * dired.c (directory_files_internal, Ffile_attributes):
209 Undo last change.
210
82ef37c1
PE
211 * frame.c (x_report_frame_params): Port better to wider ints.
212 Do not assume that EMACS_UINT is the same width as uprintmax_t,
213 or that pointers can be printed in 15 decimal digits.
214 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
215
62aba0d4
FP
2162012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
217
218 Support x64 build on MS-Windows.
219 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
220 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
221 compatibility with x64.
5e4daaf3 222 (x_get_focus_frame): Add prototype.
62aba0d4
FP
223
224 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
225 defining an XRectangle structure.
226
227 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
228 arithmetics for compatibility with x64.
229
230 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
231 compatibility with x64.
232
233 * w32heap.h: Adjust prototypes and declarations.
234
235 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
236 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
237 DWORD, long, and unsigned long, for compatibility with x64.
238 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
239 (sbrk): Argument is now of type ptrdiff_t.
240
241 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
242 less than 0x0500.
243 (w32_msg_pump): Use WPARAM type for 'result'.
244
245 * w32.c (init_environment, get_emacs_configuration): Support AMD64
246 architecture.
247 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
248 compatibility with x64.
249
250 * vm-limit.c (lim_data): Now size_t.
251 (check_memory_limits): Adjust prototypes of real_morecore and
252 __morecore to receive argument of type ptrdiff_t. Use size_t for
253 five_percent and data_size.
254
255 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
256 variables, for compatibility with x64.
257 (rva_to_section, offset_to_section, relocate_offset)
258 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
259 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
260 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
261 for compatibility with x64.
262
263 * sysdep.c (STDERR_FILENO): Define if not already defined.
264
265 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
266 (__morecore): Argument type is now ptrdiff_t.
267 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
268 (relinquish): Use ptrdiff_t type for 'excess'.
269 (r_alloc_sbrk): Argument type is now ptrdiff_t.
270
271 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
272 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
273 instead of a literal number.
274
275 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
276 (min): Define only if not already defined.
277
278 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
279 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
280 hosts.
281
282 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
283 'bitmaps' is a pointer.
284
285 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
286
287 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
288
e7a2937b
PE
2892012-09-30 Paul Eggert <eggert@cs.ucla.edu>
290
291 file-attributes has a new optional arg FOLLOW-SYMLINKS.
292 * dired.c (directory_files_internal, Ffile_attributes):
293 New arg follow_symlinks. All uses changed.
294
b43d62ae
SM
2952012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
296
297 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
298
c06c382a
EZ
2992012-09-30 Eli Zaretskii <eliz@gnu.org>
300
301 Support atimers and CPU profiler via profile.c on MS-Windows.
302 * w32proc.c (sig_mask, crit_sig): New static variables.
303 (sys_signal): Support SIGALRM and SIGPROF.
304 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 305 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
306 sigfillset, and sigprocmask are no longer no-ops.
307 (sigismember): New function.
308 (struct itimer_data): New definition.
309 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
310 (crit_prof): New static variables.
311 (MAX_SINGLE_SLEEP): New definition.
312 (timer_loop, stop_timer_thread, term_timers, init_timers)
313 (start_timer_thread, getitimer, setitimer): New functions.
314 (alarm): No longer a no-op, calls setitimer.
315
316 * w32.c (term_ntproc): Call term_timers.
317 (init_ntproc): Make sure all signals are unblocked at startup, to
318 erase any traces of dumping. Call init_timers.
319
320 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
321 Windows-specific code to display the hourglass mouse pointer is no
322 longer used.
323 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
324 to hourglass timer expiration.
325 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
326 Remove, no longer used.
b43d62ae
SM
327 (w32_note_current_window, show_hourglass, hide_hourglass):
328 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
329 window systems.
330 (syms_of_w32fns): Don't initialize hourglass_timer.
331
332 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
333 WINDOWSNT as well.
334 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
335
336 * w32.h (init_timers, term_timers): Add prototypes.
337
95402d5f
KH
3382012-09-30 Kenichi Handa <handa@gnu.org>
339
340 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
341 to the buffer relocation which may be caused by ccl_driver.
342
dd946752
JD
3432012-09-30 Jan Djärv <jan.h.d@swipnet.se>
344
d7e642cc
JD
345 * xfns.c (Fx_file_dialog): Update comment.
346
347 * w32fns.c (Fx_file_dialog): Update comment.
348
349 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
350 Initialize panel name field if OSX >= 10.6.
351
352 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
353
dd946752
JD
354 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
355
356 * nsterm.m (NEW_STYLE_FS): New define.
357 (ns_fullscreen_hook, windowWillEnterFullScreen)
358 (windowDidEnterFullScreen, windowWillExitFullScreen)
359 (windowDidExitFullScreen, toggleFullScreen, handleFS)
360 (setFSValue): New functions.
361 (EmacsFSWindow): New implementation.
362 (canBecomeKeyWindow): New function for EmacsFSWindow.
363 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
364 (dealloc): Release nonfs_window if in fullscreen.
365 (updateFrameSize:): Call windowDidMove to update top/left.
366 (windowWillResize:toSize:): Check if frame is still maximized.
367 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
368 next_maximized, maximized_width, maximized_height and nonfs_window.
369 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
370 tbar_height.
371 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
372 fullscreen. Set maximized_width/height. Act on next_maximized.
373
374 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
375 (EmacsView): Add variables for fullscreen.
376 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
377 (EmacsFSWindow): New interface for fullscreen.
378
427730eb
JB
3792012-09-30 Juanma Barranquero <lekktu@gmail.com>
380
381 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
382
48de8b12
CY
3832012-09-30 Chong Yidong <cyd@gnu.org>
384
385 * fns.c (Frandom): Doc fix.
386
5938d519
MR
3872012-09-30 Martin Rudalics <rudalics@gmx.at>
388
389 * window.c (Vwindow_combination_limit): New default value.
390 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
391
cb5b0266
PE
3922012-09-30 Paul Eggert <eggert@cs.ucla.edu>
393
394 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
395 Suggested by Eli Zaretskii in
396 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
397
84f72efd
EZ
3982012-09-30 Eli Zaretskii <eliz@gnu.org>
399
400 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
401 HAVE_TIMER_SETTIME is defined.
402
9d4dcdc9
PE
4032012-09-30 Paul Eggert <eggert@cs.ucla.edu>
404
d89460ed
PE
405 Profiler improvements: more-accurate timers, overflow checks.
406 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
407 signal.h, setjmp.h. Include systime.h instead.
408 (saturated_add): New function.
409 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
410 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
411 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
412 New static vars.
84f72efd 413 (enum profiler_cpu_running): New enum.
d89460ed
PE
414 (profiler_cpu_running): Now of that enum type, not bool.
415 All uses changed to store the new value.
416 (handle_profiler_signal): Rename from sigprof_handler_1,
417 for consistency with other handlers. Do not check whether
418 cpu_log is a hash-table if garbage collecting, since it
419 doesn't matter in that case.
420 (deliver_profiler_signal): Rename from sigprof_handler,
421 for consistency with other handlers.
422 (setup_cpu_timer): New function, with much of what used to be in
423 Fprofiler_cpu_start. Check for out-of-range argument.
424 Prefer timer_settime if available, and prefer
425 thread cputime clocks, then process cputime clocks, then
426 monotonic clocks, to the old realtime clock. Use make_timeval
427 to round more-correctly when falling back to setitimer.
428 (Fprofiler_cpu_start): Use it.
429 (Fprofiler_cpu_stop): Prefer timer_settime if available.
430 Don't assume that passing NULL as the 2nd argument of setitimer
431 is the same as passing a pointer to all-zero storage.
432 Ignore SIGPROF afterwards.
433 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
434 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
435 non-fatal signal handlers. Ignore SIGPROF on startup.
436 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
437 in profiler.c, since sysdep.c now uses it.
438
9d4dcdc9
PE
439 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
440 Suggested by Eli Zaretskii in
441 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
442
8e5691a0
JB
4432012-09-29 Juanma Barranquero <lekktu@gmail.com>
444
445 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
446
e7c1b6ef
SM
4472012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
448
449 * lisp.h (struct backtrace): Remove indirection for `function' field.
450 * xdisp.c (redisplay_internal):
451 * profiler.c (record_backtrace, sigprof_handler_1):
452 * alloc.c (Fgarbage_collect):
453 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
454 (Fbacktrace_frame): Adjust accordingly.
455
e61d39cd 4562012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
457
458 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
459 (Frun_hook_with_args_until_failure): Doc fixes.
460
404043ea
EZ
4612012-09-28 Eli Zaretskii <eliz@gnu.org>
462
463 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
464 Qautomatic_redisplay and change the symbol name. All users changed.
465
704d3f45
TM
4662012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
467
468 * profiler.c (sigprof_handler): Fix race condition.
469
757140ff
GM
4702012-09-28 Glenn Morris <rgm@gnu.org>
471
472 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
473
a615a3ae
PE
4742012-09-27 Paul Eggert <eggert@cs.ucla.edu>
475
476 Check more robustly for timer_settime.
89d17fd0
PE
477 * Makefile.in (LIB_TIMER_TIME): New macro.
478 (LIBES): Add it.
a615a3ae
PE
479 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
480 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
481 call timer_settime.
482
3670daf7
TM
4832012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
484
485 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
486
6a586b7f
JB
4872012-09-26 Juanma Barranquero <lekktu@gmail.com>
488
489 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
490
41c8bfcf
PE
4912012-09-26 Paul Eggert <eggert@cs.ucla.edu>
492
493 * character.h (MAYBE_UNIFY_CHAR): Remove.
494 * charset.c, charset.h (maybe_unify_char): Now static.
495 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
496 Since this stuff is now private to charset.c, there's no need for
497 a public macro and no need to inline by hand.
498
3a880af4
SM
4992012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
500 Stefan Monnier <monnier@iro.umontreal.ca>
501 Juanma Barranquero <lekktu@gmail.com>
611b7507 502
3a880af4
SM
503 * profiler.c: New file.
504 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
505 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
506 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
507 * emacs.c (main): Call syms_of_profiler.
508 * alloc.c (Qautomatic_gc): New constant.
509 (MALLOC_PROBE): New macro.
510 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
511 (total_bytes_of_live_objects): New function.
512 (Fgarbage_collect): Use it. Record itself in backtrace_list.
513 Call malloc_probe for the memory profiler.
514 (syms_of_alloc): Define Qautomatic_gc.
515 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
516 race condition.
517 (struct backtrace): Move definition...
518 * lisp.h (struct backtrace): ..here.
519 (Qautomatic_gc, profiler_memory_running): Declare vars.
520 (malloc_probe, syms_of_profiler): Declare functions.
521 * xdisp.c (Qautomatic_redisplay): New constant.
522 (redisplay_internal): Record itself in backtrace_list.
523 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 524
5938d519 5252012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
5262012-09-25 Juanma Barranquero <lekktu@gmail.com>
527
528 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
529
e26fd2e4
PE
5302012-09-25 Paul Eggert <eggert@cs.ucla.edu>
531
532 Prefer POSIX timers if available.
533 They avoid a race if the timer is too close to the current time.
534 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
535 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 536 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 537
eedec3ee
EZ
5382012-09-25 Eli Zaretskii <eliz@gnu.org>
539
540 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
541 CHAR_STRING_ADVANCE.
542 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
543 STRING_CHAR_ADVANCE.
544
aa15c6bb
JB
5452012-09-25 Juanma Barranquero <lekktu@gmail.com>
546
547 Move Vlibrary_cache to emacs.c and reset before dumping.
548
549 * lisp.h (reset_image_types): Declare.
550 [WINDOWSNT] (Vlibrary_cache): Declare.
551
552 * image.c (reset_image_types): New function.
553
554 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
555 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
556 (Fdump_emacs): Reset Vlibrary_cache and image_types.
557
558 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
559 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
560
561 * w32.h (Vlibrary_cache): Do not declare.
562
54d629be
EZ
5632012-09-25 Eli Zaretskii <eliz@gnu.org>
564
16b22fef
EZ
565 * w32proc.c (sys_signal): Handle all signals defined by the
566 MS-Windows runtime, not just SIGCHLD. Actually install the signal
567 handlers for signals supported by Windows. Don't override
568 term_ntproc as the handler for SIGABRT.
569 (sigaction): Rewrite to call sys_signal instead of duplicating its
570 code.
571 (sys_kill): Improve commentary.
572
573 * w32.c (term_ntproc): Accept (and ignore) one argument, for
574 consistency with a signature of a signal handler. All callers
575 changed.
576 (init_ntproc): Accept an argument DUMPING. If dumping, don't
577 install term_ntproc as a signal handler for SIGABRT, as that
578 should be done by the dumped Emacs.
579
580 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
581
582 * w32select.c (term_w32select): Protect against repeated
583 invocation by setting clipboard_owner to NULL after calling
584 DestroyWindow.
585
586 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
587 and term_ntproc to their modified signatures.
588
54d629be
EZ
589 * character.c (char_string, string_char): Remove calls to
590 MAYBE_UNIFY_CHAR. See the discussion starting at
591 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
592 for the details.
593
59f7af81
CY
5942012-09-25 Chong Yidong <cyd@gnu.org>
595
596 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
597
22e8cf4a
SM
5982012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
599
600 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
601 when encountering an unknown bytecode.
602
578098f3
PE
6032012-09-24 Paul Eggert <eggert@cs.ucla.edu>
604
605 image.c, indent.c: Use bool for booleans.
606 * dispextern.h (struct image_type): Members valid_p, load, init
607 now return bool, not int. All uses changed.
608 * image.c: Omit unnecessary static decls.
609 (x_create_bitmap_mask, x_build_heuristic_mask):
610 Return void, not int, since callers don't care about the return value.
611 (x_create_bitmap_mask, define_image_type, valid_image_p)
612 (struct image_keyword, parse_image_spec, image_spec_value)
613 (check_image_size, image_background)
614 (image_background_transparent, x_clear_image_1)
615 (postprocess_image, lookup_image, x_check_image_size)
616 (x_create_x_image_and_pixmap, xbm_image_p)
617 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
618 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
619 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
620 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
621 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
622 (png_image_p, init_png_functions, png_load_body, png_load)
623 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
624 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
625 (init_gif_functions, gif_load, imagemagick_image_p)
626 (imagemagick_load_image, imagemagick_load, svg_image_p)
627 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
628 (gs_load):
629 * nsimage.m (ns_load_image):
630 * nsterm.m (ns_defined_color):
631 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
632 * xfns.c (x_defined_color):
633 * xterm.c (x_alloc_lighter_color_for_widget)
634 (x_alloc_nearest_color_1, x_alloc_nearest_color)
635 (x_alloc_lighter_color):
636 * indent.c (disptab_matches_widthtab, current_column)
637 (scan_for_column, string_display_width, indented_beyond_p)
638 (compute_motion, vmotion, Fvertical_motion):
639 Use bool for booleans.
640
a5f2b6ec
CY
6412012-09-24 Chong Yidong <cyd@gnu.org>
642
643 * chartab.c (Fset_char_table_default): Obsolete function removed.
644
18e27ea8
PE
6452012-09-23 Paul Eggert <eggert@cs.ucla.edu>
646
afea8a8a
PE
647 Move pid_t related decls out of lisp.h.
648 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
649 (interruptible_wait_for_termination):
650 Move these decls from lisp.h to syswait.h, since they use pid_t.
651 Needed on FreeBSD; see Herbert J. Skuhra in
652 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
653 * callproc.c: Include syswait.h.
654
18e27ea8
PE
655 gnutls.c, gtkutil.c: Use bool for boolean.
656 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
657 (emacs_gnutls_handle_error):
658 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
659 (xg_hide_tooltip, xg_create_frame_widgets)
660 (create_dialog, xg_uses_old_file_dialog)
661 (xg_get_file_with_chooser, xg_get_file_with_selection)
662 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
663 (xg_item_label_same_p, xg_update_menubar)
664 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
665 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
666 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
667 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
668 (update_frame_tool_bar, free_frame_tool_bar):
669 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
670 * nsmenu.m (ns_update_menubar):
671 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
672 * xfns.c (Fx_show_tip) [USE_GTK]:
673 Use bool for boolean.
674 * gtkutil.c (xg_update_frame_menubar):
675 * xmenu.c (update_frame_menubar):
676 Return void, not int, since caller ignores return value.
677 * gtkutil.c (xg_change_toolbar_position):
678 Return void, not 1.
679
af0e9f75
JB
6802012-09-23 Juanma Barranquero <lekktu@gmail.com>
681
682 * makefile.w32-in (BLOCKINPUT_H): Remove.
683 (SYSSIGNAL_H): New macro.
684 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
685 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
686 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
687 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
688 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
689 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
690 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
691 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
692 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
693 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
694 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
695 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
696 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
697 ($(BLD)/w32xfns.$(O)): Update dependencies.
698
5101529e
EZ
6992012-09-23 Eli Zaretskii <eliz@gnu.org>
700
701 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
702 fatal_error_backtrace.
703
704 * w32proc.c (sys_kill): Undo last change: don't do anything when
705 invoked to deliver SIGABRT to our own process. This is now
706 handled by emacs_raise.
707
2c3ee0ad
JB
7082012-09-23 Juanma Barranquero <lekktu@gmail.com>
709
710 * w32term.c (w32_read_socket): Remove leftover reference to
711 interrupt_input_pending.
712
62a1d661
PE
7132012-09-23 Paul Eggert <eggert@cs.ucla.edu>
714
715 Do not use SA_NODEFER.
716 Problem reported by Dani Moncayo in
717 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
718 * alloc.c (die):
719 * sysdep.c (emacs_abort): Do not reset signal handler.
720 * emacs.c (terminate_due_to_signal): Reset signal handler here.
721 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
722 wanted even on POSIXish hosts, and it doesn't work on Windows.
723
a0942b9a
JD
7242012-09-23 Jan Djärv <jan.h.d@swipnet.se>
725
726 * xterm.c (x_term_init): Call fixup_locale before and after calling
727 gtk_init (Bug#12392).
728
d07ff9db
CY
7292012-09-23 Chong Yidong <cyd@gnu.org>
730
731 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
732 Vdynamic_library_alist.
733
734 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
735 (Fgnutls_available_p): Caller changed.
736
737 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
738 (Flibxml_parse_xml_region): Likewise.
739
740 * dispextern.h (struct image_type): Remove arg from init function.
741
742 * image.c (Finit_image_library, lookup_image_type)
743 (define_image_type): Remove now-unneeded second arg.
744 (init_xpm_functions, init_png_functions, init_jpeg_functions)
745 (init_tiff_functions, init_gif_functions, init_svg_functions):
746 Arglist and w32_delayed_load calling convention changed.
747 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 748 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 749
4d7e6e51
PE
7502012-09-23 Paul Eggert <eggert@cs.ucla.edu>
751
752 Simplify and avoid signal-handling races (Bug#12471).
753 * alloc.c (die):
754 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
755 Avoid recursive loop if there's a fatal error in the function itself.
756 * atimer.c (pending_atimers):
757 * blockinput.h: Don't include "atimer.h"; no longer needed.
758 (interrupt_input_pending): Remove. All uses removed.
759 pending_signals now counts both atimers and ordinary interrupts.
760 This is less racy than having three separate pending-signal flags.
761 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
762 (input_blocked_p):
763 Rename from their upper-case counterparts BLOCK_INPUT,
764 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
765 INPUT_BLOCKED_P, and turn into functions. All uses changed.
766 This makes it easier to access volatile variables more accurately.
767 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
768 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
769 that's more reliable if the code is buggy and sets
770 interrupt_input_blocked to a negative value. All uses changed.
771 * atimer.c (deliver_alarm_signal):
772 Remove. No need to deliver this to the parent; any thread can
773 handle this signal now. All uses replaced by underlying handler.
774 * atimer.c (turn_on_atimers):
775 * dispnew.c (handle_window_change_signal):
776 * emacs.c (handle_danger_signal):
777 * keyboard.c (kbd_buffer_get_event):
778 Don't reestablish signal handler; not needed with sigaction.
779 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
780 (UNBLOCK_INPUT_TO):
781 Rework to avoid unnecessary accesses to volatile variables.
782 (UNBLOCK_INPUT_TO): Now a function.
783 (totally_unblock_input, unblock_input): New decls.
784 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
785 (init_data): Remove. Necessary stuff now done in init_signal.
786 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
787 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
788 (fatal_error_code): Remove; no longer needed.
789 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
790 it doesn't always backtrace. All uses changed. No need to reset
791 signal to default, since sigaction and/or die does that for us now.
792 Use emacs_raise (FOO), not kill (getpid (), FOO).
793 (main): Check more-accurately whether we're dumping.
794 Move fatal-error setup to sysdep.c
795 * floatfns.c: Do not include "syssignal.h"; no longer needed.
796 * gtkutil.c (xg_get_file_name, xg_get_font):
797 Remove no-longer-needed signal-mask manipulation.
798 * keyboard.c, process.c (POLL_FOR_INPUT):
799 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
800 * keyboard.c (read_avail_input): Remove.
801 All uses replaced by gobble_input.
802 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
803 (kbd_buffer_store_event_hold, gobble_input):
804 (record_asynch_buffer_change) [USABLE_SIGIO]:
805 (store_user_signal_events):
806 No need to mess with signal mask.
807 (gobble_input): If blocking input and there are terminals, simply
808 set pending_signals to 1 and return. All hooks changed to not
809 worry about whether input is blocked.
810 (process_pending_signals): Clear pending_signals before processing
811 them, in case a signal comes in while we're processing.
812 By convention callers now test pending_signals before calling us.
813 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
814 New functions, to support changes to blockinput.h.
815 (handle_input_available_signal): Now extern.
816 (reinvoke_input_signal): Remove. All uses replaced by
817 handle_async_input.
818 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
819 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
820 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
821 Clear sigmask reliably, even if Fsignal returns, which it can.
822 Omit unnecessary accesses to volatile var.
823 (quit_throw_to_read_char): No need to restore sigmask.
824 * keyboard.c (gobble_input, handle_user_signal):
825 * process.c (wait_reading_process_output):
826 Call signal-handling code rather than killing ourselves.
827 * lisp.h: Include <float.h>, for...
828 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
829 (pending_signals): Now volatile.
830 (syms_of_data): Now const if IEEE floating point.
831 (handle_input_available_signal) [USABLE_SIGIO]:
832 (terminate_due_to_signal, record_child_status_change): New decls.
833 * process.c (create_process): Avoid disaster if memory is exhausted
834 while we're processing a vfork, by tightening the critical section
835 around the vfork.
836 (send_process_frame, process_sent_to, handle_pipe_signal)
837 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
838 ignores SIGPIPE.
839 (send_process): No need for setjmp/longjmp any more, since the
840 SIGPIPE stuff is now gone. Instead, report an error if errno
841 is EPIPE.
842 (record_child_status_change): Now extern. PID and W are now args.
843 Return void, not bool. All callers changed.
844 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
845 Remove. All uses removed. This bug should be fixed now in a
846 different way.
847 (wait_for_termination_1): Use waitpid rather than sigsuspend,
848 and record the child status change directly. This avoids the
849 need to futz with the signal mask.
850 (process_fatal_action): Move here from emacs.c.
851 (emacs_sigaction_flags): New function, containing
852 much of what used to be in emacs_sigaction_init.
853 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
854 caught by emacs, to make races less likely.
855 (deliver_process_signal): Rename from handle_on_main_thread.
856 All uses changed.
857 (BACKTRACE_LIMIT_MAX): Now at top level.
858 (thread_backtrace_buffer, threadback_backtrace_pointers):
859 New static vars.
860 (deliver_thread_signal, deliver_fatal_thread_signal):
861 New functions, for more-accurate delivery of thread-specific signals.
862 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
863 (deliver_arith_signal): Handle in this thread, not
864 in the main thread, since it's triggered by this thread.
865 (maybe_fatal_sig): New function.
866 (init_signals): New arg DUMPING so that we can be more accurate
867 about whether we're dumping. Caller changed.
868 Treat thread-specific signals differently from process-general signals.
869 Block all signals while handling fatal error; that's safer.
870 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
871 on IEEE hosts.
872 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
873 Ignore SIGPIPE unless batch.
874 (emacs_backtrace): Output backtrace for the appropriate thread,
875 which is not necessarily the main thread.
876 * syssignal.h: Include <stdbool.h>.
877 (emacs_raise): New macro.
878 * xterm.c (x_connection_signal): Remove; no longer needed
879 now that we use sigaction.
880 (x_connection_closed): No need to mess with sigmask now.
881 (x_initialize): No need to reset SIGPIPE handler here, since
882 init_signals does this for us now.
883
8f4635e9
JD
8842012-09-23 Jan Djärv <jan.h.d@swipnet.se>
885
886 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 887 background rect may be larger (Bug#12245).
8f4635e9 888
3296976d
CY
8892012-09-23 Chong Yidong <cyd@gnu.org>
890
891 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
892
d41e491e
PE
8932012-09-22 Paul Eggert <eggert@cs.ucla.edu>
894
895 * .gdbinit: Just stop at fatal_error_backtrace.
896 See Stefan Monnier's request in
897 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
898 Remove no-longer-used query of system type.
899
c88b867f
CY
9002012-09-22 Chong Yidong <cyd@gnu.org>
901
902 * search.c (Freplace_match): Doc fix (Bug#12325).
903
904 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
905
906 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
907 (Fline_end_position): Doc fix.
908
909 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
910
bb4d86b4
CY
9112012-09-22 Chong Yidong <cyd@gnu.org>
912
913 * dispextern.h (struct image_type): Add new slot, storing a type
914 initialization function.
915
916 * image.c (define_image_type): Call the image initializer function
917 if it is defined. Arguments and return value changed.
918 (valid_image_p, make_image): Callers changed.
919 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
920 (gif_type, imagemagick_type, svg_type, gs_type):
921 Add initialization functions.
bb4d86b4
CY
922 (Finit_image_library): Call lookup_image_type.
923 (CHECK_LIB_AVAILABLE): Macro deleted.
924 (lookup_image_type): Call define_image_type here, rather than via
925 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
926 (syms_of_image): Move define_image_type calls for xbm_type and
927 pbm_type to lookup_image_type.
928
df9685f3
EZ
9292012-09-22 Eli Zaretskii <eliz@gnu.org>
930
931 * keyboard.c (timer_check_2): Move calculation of 'timers' and
932 'idle_timers' from here ...
933 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
934 lists, to avoid infloops when the timer does something stupid,
935 like reinvoke itself with the same or smaller time-out.
936 (Bug#12447)
937
8e17c9ba
MR
9382012-09-22 Martin Rudalics <rudalics@gmx.at>
939
940 * window.c (Fsplit_window_internal): Handle only Qt value of
941 Vwindow_combination_limit separately.
942 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
943 (Vwindow_combination_limit): New default value.
944 Rewrite doc-string.
8e17c9ba 945
589bd69b
EZ
9462012-09-22 Eli Zaretskii <eliz@gnu.org>
947
948 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
949 the new overlay string. (Bug#10159)
950
01108e3f
PE
9512012-09-22 Paul Eggert <eggert@cs.ucla.edu>
952
953 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
954 or that fprintf is async-signal-safe. POSIX doesn't require
955 either assumption.
956
82f8cd94
CY
9572012-09-22 Chong Yidong <cyd@gnu.org>
958
959 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
960 (Bug#8207).
961
3cccbd87
KH
9622012-09-22 Kenichi Handa <handa@gnu.org>
963
964 * composite.c (composition_reseat_it): Handle the case that a
965 grapheme cluster is not covered by a single font (Bug#12352).
966
09c01941
CY
9672012-09-21 Chong Yidong <cyd@gnu.org>
968
969 * image.c (define_image_type): Avoid adding duplicate types to
970 image_types (Bug#12463). Suggested by Jörg Walter.
971
acfa068f 9722012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
973
974 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
975 (print_load_command_name): Add case LC_DATA_IN_CODE.
976 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
977
acfa068f 9782012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
979
980 * eval.c (Frun_hook_with_args_until_success)
981 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
982
acfa068f 9832012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
984
985 * fileio.c (Ffile_selinux_context): Only call freecon when
986 lgetfilecon succeeded.
987 (Fset_file_selinux_context): Likewise. (Bug#12444)
988
acfa068f 9892012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
990
991 * xdisp.c (try_window_reusing_current_matrix): Under bidi
992 reordering, locate the cursor by calling set_cursor_from_row; if
993 that fails, clear the desired glyph matrix before returning a
994 failure indication to the caller. Fixes leaving garbled display
995 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
996 (compute_stop_pos_backwards): Fix a typo that caused crashes while
997 scrolling through multibyte text.
aa36e4d2 998
e99f70c8
SM
9992012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
1000
1001 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
1002 calling mark_vectorlike since that's the one that marks the window.
1003 (mark_discard_killed_buffers): Mark the final cdr.
1004 * window.h (struct window): Move prev/next_buffers to the
1005 non-standard fields.
1006 * window.c (make_window): Initialize prev/next_buffers manually.
1007
f75beb47
PE
10082012-09-20 Paul Eggert <eggert@cs.ucla.edu>
1009
1010 Omit unused arg EXPECTED from socket hooks.
1011 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1012 * nsterm.m (ns_term_init):
1013 * termhooks.h (struct terminal.read_socket_hook):
1014 * w32inevt.c (w32_console_read_socket):
1015 * w32term.c (w32_read_socket):
1016 * xterm.c (XTread_socket):
1017 Omit unused arg EXPECTED. All callers changed.
1018 (store_user_signal_events): Return void, not int, since callers no
1019 longer care about the return value. All uses changed.
1020
b019b76a
JB
10212012-09-20 Juanma Barranquero <lekktu@gmail.com>
1022
1023 * w32gui.h (XParseGeometry): Do not declare.
1024
05642592
PE
10252012-09-19 Paul Eggert <eggert@cs.ucla.edu>
1026
e4bce92a
PE
1027 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1028 Ignore 'expected'. See Eli Zaretskii in
1029 <http://bugs.gnu.org/12471#8> (last line).
1030
05642592
PE
1031 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
1032 (XParseGeometry): Now static. Substitute extremal values for
1033 values that are out of range.
1034
e543ae91
JD
10352012-09-19 Jan Djärv <jan.h.d@swipnet.se>
1036
1037 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1038
1039 * nsfns.m (XParseGeometry): Remove.
1040 (Fx_create_frame): Call x_set_offset to correctly interpret
1041 top_pos in geometry.
1042
3a880af4 1043 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
1044 (Fx_parse_geometry): If there is a space in string, call
1045 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1046
45ba16c7
EZ
10472012-09-17 Eli Zaretskii <eliz@gnu.org>
1048
c8b9f1bc
EZ
1049 * search.c (scan_buffer): Use character positions in calls to
1050 region_cache_forward and region_cache_backward, not byte
1051 positions. (Bug#12196)
1052
b4c932a2
EZ
1053 * w32term.c (w32_read_socket): Set pending_signals to 1, like
1054 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
1055
45ba16c7
EZ
1056 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1057 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1058 emacs_blocked_malloc, now deleted.
1059
eeceac93
PE
10602012-09-17 Paul Eggert <eggert@cs.ucla.edu>
1061
1062 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1063 The workaround was for improving performance on Solaris 2.4, but
1064 is getting in the way now. Emacs will still work if someone is
1065 still running Solaris 2.4 in a museum somewhere; Sun dropped
1066 support for Solaris 2.4 in 2003.
1067 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1068 * process.c (create_process) [HAVE_WORKING_VFORK]:
1069 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1070 since Emacs no longer uses vfork on that platform.
1071
78f83752
GM
10722012-09-17 Glenn Morris <rgm@gnu.org>
1073
1074 * emacs.c: Use COPYRIGHT.
1075
634b8cac
PE
10762012-09-16 Paul Eggert <eggert@cs.ucla.edu>
1077
0caaedb1
PE
1078 Remove configure's --without-sync-input option (Bug#12450).
1079 When auditing signal-handling in preparation for cleaning it up,
1080 I found that SYNC_INPUT has race conditions and would be a real
1081 pain to fix. Since it's an undocumented and deprecated
1082 configure-time option, now seems like a good time to remove it.
1083 Also see <http://bugs.gnu.org/11080#16>.
1084 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1085 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1086 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1087 (malloc_hysteresis):
1088 (check_depth) [XMALLOC_OVERRUN_CHECK]:
1089 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1090 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1091 (dont_register_blocks, bytes_used_when_reconsidered)
1092 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1093 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1094 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1095 Remove. All uses removed.
1096 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1097 implementation, one that depends on whether the new macro
1098 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1099 is defined.
1100 * atimer.c (run_timers, handle_alarm_signal):
1101 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1102 (handle_async_input, process_pending_signals)
1103 (handle_input_available_signal, init_keyboard):
1104 * nsterm.m (ns_read_socket):
1105 * process.c (wait_reading_process_output):
1106 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1107 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1108 (emacs_write):
1109 * xterm.c (XTread_socket):
1110 Assume SYNC_INPUT.
1111 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1112 * eval.c (handling_signal): Remove. All uses removed.
1113 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1114 All uses replaced with the SYNC_INPUT version.
1115 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1116 Remove decls.
1117 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1118 Now static.
1119
634b8cac
PE
1120 * font.c (Ffont_shape_gstring): Remove unused local.
1121
83da1b55
GM
11222012-09-16 Glenn Morris <rgm@gnu.org>
1123
518650a5
GM
1124 * Makefile.in (clean): No longer run nextstep's clean.
1125
83da1b55
GM
1126 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1127 (ns_frag): Remove.
1128 (ns-app): Move here from ns.mk, and simplify.
1129 (clean): Simplify nextstep entry.
1130 * ns.mk: Remove file.
1131
85a43e2e
KH
11322012-09-17 Kenichi Handa <handa@gnu.org>
1133
1134 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1135 not covert the last few charactes.
1136
ba13e616 11372012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
1138
1139 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1140 here, but just check the validity of glyphs in the glyph-string.
1141
a8c729af
MR
11422012-09-16 Martin Rudalics <rudalics@gmx.at>
1143
3a880af4
SM
1144 * window.c (Fwindow_parameter, Fset_window_parameter):
1145 Accept any window as argument (Bug#12452).
a8c729af 1146
c077c059
JD
11472012-09-16 Jan Djärv <jan.h.d@swipnet.se>
1148
1149 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1150 to ns_term_init to avoid memory leak.
1151
1152 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
1153 explicit retain/release.
1154 (ns_term_init): Only allow one display. Initialize outerpool and
1155 ns_*_types.
1156
39a57ad0
PE
11572012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1158
1159 Port _setjmp fix to POSIXish hosts as well as Microsoft.
1160 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
1161 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
1162 the Microsoft problem in a different way, by altering ../nt/config.nt.
1163
7105c8cb
EZ
11642012-09-15 Eli Zaretskii <eliz@gnu.org>
1165
1166 * w32xfns.c:
1167 * w32uniscribe.c:
1168 * w32term.c:
1169 * w32select.c:
1170 * w32reg.c:
1171 * w32proc.c:
1172 * w32menu.c:
1173 * w32inevt.c:
1174 * w32heap.c:
1175 * w32font.c:
1176 * w32fns.c:
1177 * w32console.c:
1178 * w32.c:
1179 * w16select.c: Remove inclusion of setjmp.h, as it is now included
1180 by lisp.h. This completes removal of setjmp.h inclusion
1181 erroneously announced in the previous commit. (Bug#12446)
1182
1183 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
1184 more accurate.
1185
1186 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
1187 not defined as a macro. The latter happens on MS-Windows.
1188 (Bug#12446)
1189
0328b6de
PE
11902012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1191
1192 Port better to POSIX hosts lacking _setjmp (Bug#12446).
1193 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 1194 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
1195 only reason for the instance was because "lisp.h" was included.
1196 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
1197 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
1198 and _longjmp with the new symbols. Emacs already uses _setjmp if
1199 available, so this change affects only POSIXish hosts that have
1200 sigsetjmp but not _setjmp, such as some versions of Solaris and
1201 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
1202 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
1203 (png_load_body) [HAVE_PNG]:
1204 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
1205 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
1206 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
1207 since PNG requires jmp_buf. This is the only exception to the
1208 general rule that we now use sys_setjmp and sys_longjmp.
1209 This exception is OK since this code does not change the signal
1210 mask or longjmp out of a signal handler.
1211
2af03429
PE
12122012-09-14 Paul Eggert <eggert@cs.ucla.edu>
1213
1214 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1215 Include "syssignal.h", for 'main_thread'.
1216
2f294edf
DA
12172012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
1218
1219 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
1220 * insdel.c (replace_range, replace_range_2):
1221 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
1222 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1223 Remove redundant check before calling offset_intervals.
1224
6b533e9c
MR
12252012-09-14 Martin Rudalics <rudalics@gmx.at>
1226
1227 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1228 current buffer (Bug#12387).
1229
2a7931e3
JB
12302012-09-14 Juanma Barranquero <lekktu@gmail.com>
1231
1232 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1233
c18e885b
PE
12342012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1235
1236 Use a more backwards-compatible timer format (Bug#12430).
1237 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1238 vector element, not from the 4th, since PSECS is now at the end.
1239 (Fcurrent_idle_time): Doc fix.
1240
d59a1afb
DA
12412012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
1242
1243 Function to mark objects and remove killed buffers at once.
1244 * alloc.c (discard_killed_buffers): Rename to ...
1245 (mark_discard_killed buffers) ... new name. Add marking
1246 of remaining objects. Fix comment. Adjust users.
1247 (mark_object): Do not touch frame buffer lists here.
1248 * frame.c (delete_frame): Reset frame buffer lists here.
1249
5f0cb45a
PE
12502012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1251
8ea47e3a
PE
1252 Better workaround for GNOME bug when --enable-gcc-warnings.
1253 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1254 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
1255 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1256
4a4bbad2
PE
1257 Simplify SIGIO usage (Bug#12408).
1258 The code that dealt with SIGIO was crufty and confusing, e.g., it
1259 played tricks like "#undef SIGIO" but these tricks were not used
1260 consistently. Simplify mostly by not #undeffing standard symbols,
1261 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1262 or not as we please) rather than "defined SIGIO" (standard symbol
1263 that we probably shouldn't #undef).
1264 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1265 Modules that need it can include it.
1266 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1267 * dispextern.h (ignore_sigio): New decl.
1268 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1269 unconditionally, since it's now a no-op if !USABLE_SIGIO.
1270 * emacs.c (shut_down_emacs):
1271 * keyboard.c (kbd_buffer_store_event_hold):
1272 Use ignore_sigio rather than invoking 'signal' directly.
1273 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1274 for FIONREAD.
1275 (FIONREAD, SIGIO): Do not #undef.
1276 (tty_read_avail_input): Use #error rather than a syntax error.
1277 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1278 for I_PIPE, used by SETUP_SLAVE_PTY.
1279 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1280 * sysdep.c (croak): Remove; no longer needed. This bit of
1281 temporary code, with Fred N. Fish's comment that it's temporary,
1282 has been in Emacs since at least 1992!
1283 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1284 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1285 * syssignal.h (croak): Remove decl.
1286 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1287 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1288 now that we're termios-only.
1289 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1290 * term.c (dissociate_if_controlling_tty): Use #error rather than
1291 a run-time error.
1292
5f0cb45a
PE
1293 Work around GCC and GNOME bugs when --enable-gcc-warnings.
1294 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1295 to work around GNOME bug 683906.
1296 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1297 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1298 This works around GCC bug 54561.
1299
40bce90b
PE
13002012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1301
1302 More fixes for 'volatile' and setjmp/longjmp.
1303 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1304 * image.c (struct png_load_context) [HAVE_PNG]: New type.
1305 (png_load_body) [HAVE_PNG]:
1306 (jpeg_load_body) [HAVE_JPEG]:
1307 New function, with most of the old parent function's body.
1308 (png_load) [HAVE_PNG]:
1309 (jpeg_load) [HAVE_JPEG]:
1310 Invoke the new function, to avoid longjmp munging our locals.
1311 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
1312 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
1313 longjmp is passed 2, as the C standard doesn't guarantee this.
1314 Instead, store the failure code into mgr->failure_code.
1315
bfeae2cf
SM
13162012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1317
1318 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
1319 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
1320 (syms_of_keyboard): Remove support for unread-command-char.
1321
8099e36b
EZ
13222012-09-12 Eli Zaretskii <eliz@gnu.org>
1323
1324 * w32proc.c (sys_kill): If PID is our process ID and the signal is
1325 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
1326 violation. (Bug#12426)
1327
92547ff9
PE
13282012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1329
1330 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
1331
45b82ad0
SM
13322012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1333
1334 * eval.c: Add `inhibit-debugger'.
1335 (Qinhibit_debugger): New symbol.
1336 (call_debugger): Bind it instead of Qdebug_on_error.
1337 (maybe_call_debugger): Test Vinhibit_debugger.
1338 (syms_of_eval): Define inhibit-debugger.
1339 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1340 (syms_of_xdisp): Remove inhibit-debug-on-message.
1341
5779a1dc
PE
13422012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1343
50f2e553
PE
1344 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1345 If a nonvolatile local variable is written before a _longjmp to
1346 the frame containing the variable, and is read after the _longjmp,
1347 the value read is indeterminate. Some local variables of type
1348 'struct handler' and 'struct catchtag' are used in this way, so
1349 mark each of their slots as volatile if the slot can be set before
1350 _longjmp and read afterwards.
1351 * lisp.h (struct handler): var and chosen_clause are now volatile.
1352 (struct catchtag): val, next, and pdlcount are now volatile.
1353
ae1d87e2
PE
1354 * bidi.c (bidi_push_it, bidi_pop_it):
1355 * fns.c (copy_hash_table):
1356 * image.c (define_image_type):
1357 * keyboard.c (kbd_buffer_store_event_hold):
1358 * process.c (Fprocess_send_eof):
1359 * xfaces.c (x_create_gc) [HAVE_NS]:
1360 * xgselect.c (xg_select):
1361 Prefer assignment to memcpy when either will do.
1362
5779a1dc
PE
1363 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1364 Use pointer-to-a-pointer to simplify and avoid a NILP check each
1365 time an item is removed. No need to mark this function 'inline';
1366 the compiler knows better than we do.
1367
c4c9756b
JD
13682012-09-11 Jan Djärv <jan.h.d@swipnet.se>
1369
1370 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1371 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1372 to change_frame_size (Bug#12388).
1373 (windowDidResize:): Pass YES to updateFrameSize.
1374
1375 * nsterm.h: Add delay parameter to updateFrameSize.
1376
d73e321c
DA
13772012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1378
1379 Discard killed buffers from deleted window and frame objects.
1380 This reduces an amount of references to killed buffers and
1381 helps GC to reclaim them faster.
1382 * alloc.c (discard_killed_buffers): New function.
1383 (mark_object): Use it for deleted windows and frames.
1384 (mark_object): If symbol's value is set up for a killed buffer
1385 or deleted frame, restore it's global binding.
1386 * data.c (swap_in_global_binding): Add GC notice.
1387 (swap_in_symval_forwarding): Use convenient set_blv_where.
1388 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1389 * window.h: ... to here.
1390
e578f381
DA
13912012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1392
1393 Convenient macro to check whether the buffer is live.
1394 * buffer.h (BUFFER_LIVE_P): New macro.
1395 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1396 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1397
3057e615
YM
13982012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1399
1400 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1401 composition cases (Bug#12364).
1402
1403 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1404 overhang of succeeding glyphs overlapping box cursor.
1405
1406 * w32term.c (x_draw_glyph_string): Likewise.
1407
6fda35f2
PE
14082012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1409
c990426a
PE
1410 Simplify, document, and port floating-point (Bug#12381).
1411 The porting part of this patch fixes bugs on non-IEEE platforms
1412 with frexp, ldexp, logb.
1413 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1414 Now static.
1415 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1416 support, by removing commented-out code and briefly listing the
1417 C89 functions excluded. The commented-out stuff was confusing
1418 maintenance, e.g., we thought we needed cbrt but it was commented out.
1419 (logb): Remove decl; no longer needed.
1420 (isfinite): New macro, if not already supplied.
1421 (isnan): Don't replace any existing macro.
1422 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1423 are present on all C89 platforms.
1424 (Ffrexp): Do not special-case zero, as frexp does the right thing
1425 for that case.
1426 (Flogb): Do not use logb, as it doesn't have the desired meaning
1427 on hosts that use non-base-2 floating point. Instead, stick with
1428 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1429 frexp, to avoid getting an unspecified result.
1430
6fda35f2
PE
1431 * xdisp.c (Qinhibit_debug_on_message): Now static.
1432
16130a58
JD
14332012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1434
1435 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1436 NSBezierPath (Bug#12131).
1437
d105a573
CY
14382012-09-10 Chong Yidong <cyd@gnu.org>
1439
1440 * fns.c (Fdelq, Fdelete): Doc fix.
1441
ff55dfe8
PE
14422012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1443
1444 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1445 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1446
e7032e7c
SM
14472012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1448
1449 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1450 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1451 Use it.
1452
e9957956
EZ
14532012-09-09 Eli Zaretskii <eliz@gnu.org>
1454
aba05ce9
EZ
1455 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1456 left fringe if the window has a left margin. This avoids leaving
1457 traces of the cursor because its leftmost pixel is not drawn over.
1458
e9957956
EZ
1459 * dispnew.c (update_window_line): When the left margin area of a
1460 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1461 that screen line. (Bug#12277)
1462
f6196b87
PE
14632012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1464
1465 Assume C89 or later for math functions (Bug#12381).
1466 This simplifies the code, and makes it a bit smaller and faster,
1467 and (most important) makes it easier to clean up signal handling
1468 since we can stop worring about floating-point exceptions in
1469 library code. That was a problem before C89, but the problem
1470 went away many years ago on all practical Emacs targets.
1471 * data.c, image.c, lread.c, print.c:
1472 Don't include <math.h>; no longer needed.
1473 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1474 might be autoconfigured, as that never happens.
1475 * data.c (fmod):
1476 * doprnt.c (DBL_MAX_10_EXP):
1477 * print.c (DBL_DIG):
1478 Remove. C89 or later always defines these.
1479 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1480 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1481 (arith_error, domain_error, domain_error2):
1482 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1483 no longer needed -- we simply return what C returns. All uses removed.
1484 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1485 the wrapped code.
1486 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1487 Remove. All uses expanded, as these macros are no longer used
1488 more than once and are now more trouble than they're worth.
1489 (Ftan): Use tan, not sin / cos.
1490 (Flogb): Assume C89 frexp.
1491 (fmod_float): Assume C89 fmod.
1492 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1493 (init_floatfns): Remove. All uses removed.
1494
9d7f1863
JD
14952012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1496
1497 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1498 compositeToPoint for OSX < 10.6 (Bug#12390).
1499
eabf0404
PE
15002012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1501
1502 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1503 This produces more-accurate results.
1504
0b3b1d23
JD
15052012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1506
1507 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1508 changes (Bug#12088).
1509
6dcef6ec
CY
15102012-09-08 Chong Yidong <cyd@gnu.org>
1511
1512 * syntax.c (Fstring_to_syntax): Doc fix.
1513
aa7d57c5
JD
15142012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1515
1516 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1517 in the internal border.
1518 (x_set_window_size): Remove static variables and their usage.
1519 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
1520 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1521 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
1522 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1523 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1524 (ns_fix_rect_ibw): Remove.
1525 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1526 (ns_dumpglyphs_box_or_relief): Ditto.
1527 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1528 adjustment.
1529 (ns_dumpglyphs_image): Ditto.
fc0c31f8 1530 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
1531 border adjustment.
1532 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1533 their usage. Add fringe_extended_p and its use as in other terms.
1534 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1535 scroll bar was removed.
1536 (updateFrameSize): New function.
1537 (windowDidResize): Move code to updateFrameSize and call it.
1538
1539 * nsterm.h (EmacsView): Add updateFrameSize.
1540
1a5432bc
CY
15412012-09-07 Chong Yidong <cyd@gnu.org>
1542
b4f5313e
CY
1543 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1544
1a5432bc
CY
1545 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1546
1a4f1e9b
PE
15472012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1548
1549 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
1550 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1551 Problem introduced when merging patches. Noted by Eli Zaretskii in
1552 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
1553 * floatfns.c: Comment fix.
1554 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1555 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1556 and anyway the declaration is harmless even if SIGDANGER is not defined.
1557 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1558 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1559 source files not surprisingly expected syssignal.h to define, or
1560 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1561 Include <sys/ioctl.h>, for FIONREAD.
1562 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1563 This eliminates a problem whereby other files mysteriously had
1564 to include "syssignal.h" before including "systty.h" if they
1565 wanted to use "#ifdef SIGIO".
1566
bc8000ff
EZ
15672012-09-07 Eli Zaretskii <eliz@gnu.org>
1568
3e6d6928
EZ
1569 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1570
1571 * w32.c (sigemptyset): Empty the set.
1572 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1573
bc8000ff
EZ
1574 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1575
b4fa72f2
DA
15762012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1577
1578 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1579 (mark_object): Likewise for frame objects.
1580
30730c93
PE
15812012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1582
1583 * syssignal.h (handle_on_main_thread): Always declare,
1584 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1585 This ports to platforms without HAVE_PTHREAD.
1586
2fe28299
PE
15872012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1588
1589 Signal-handler cleanup (Bug#12327).
1590 Emacs's signal handlers were written in the old 4.2BSD style with
1591 sigblock and sigmask and so forth, and this led to some
1592 inefficiencies and confusion. Rewrite these to use
1593 pthread_sigmask etc. without copying signal sets around. Also,
1594 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1595 'signal', and instead use functions that do not attempt to take
1596 over the system name space. This patch causes Emacs's text
1597 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1598 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1599 Do not include <signal.h> or "syssignal.h", as these
1600 modules do not use signals.
1601 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1602 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1603 Do not include <signal.h>, as "syssignal.h" does that for us now.
1604 * atimer.c (sigmask_atimers): New function.
1605 (block_atimers, unblock_atimers): New functions,
1606 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1607 All uses replaced.
1608 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1609 no longer needed here.
1610 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 1611 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
1612 * sysdep.c (struct save_signal): New member 'action', replacing
1613 old member 'handler'.
1614 (save_signal_handlers, restore_signal_handlers):
1615 Use sigaction instead of 'signal' to save and restore.
1616 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1617 New function. All users of 'signal' modified to use set_sighandler
1618 if they're writeonly, and to use sys_signal if they're read+write.
1619 (emacs_sigaction_init, forwarded_signal): New functions.
1620 (sys_signal): Remove. All uses replaced by calls to sigaction
1621 and emacs_sigaction_init, or by direct calls to 'signal'.
1622 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1623 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1624 all uses replaced by pthread_sigmask etc. calls.
1625 * syssignal.h: Include <signal.h>.
1626 (emacs_sigaction_init, forwarded_signal): New decls.
1627 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1628 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1629 (sigmask, sys_sigmask): Remove; no longer needed.
1630 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1631 (sigblock, sigunblock, sigfree):
1632 (sigsetmask) [!defined sigsetmask]:
1633 Remove. All uses replaced by pthread_sigmask.
1634 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1635 no longer need to be replaced, and its typical old uses
1636 are now done via emacs_sigaction_init and sigaction.
1637 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1638 (sys_sigdel): Remove; unused.
1639 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1640
0216c128
EZ
16412012-09-06 Eli Zaretskii <eliz@gnu.org>
1642
1643 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1644 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1645
c752cfa9
DA
16462012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1647
1648 Explicitly mark buffer_defaults and buffer_local_symbols.
1649 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1650 mark_local_symbols here.
1651 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1652 since special buffers aren't marked here any more.
1653 (allocate_buffer): Chain new buffer with all_buffers here...
1654 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1655 not here.
1656 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1657 (syms_of_buffer): Remove staticpro of the above.
1658 (init_buffer_once): Set names for buffer_defaults and
1659 buffer_local_symbols.
1660
a864ef14
PE
16612012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1662
1663 Use bool for booleans in font-related modules.
1664 * font.c (font_intern_prop, font_style_to_value)
1665 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1666 (generate_otf_features, font_check_otf_features, font_check_otf)
1667 (font_match_p, font_list_entities, font_at):
1668 * fontset.c (fontset_id_valid_p, reorder_font_vector
1669 (fontset_find_font, Fset_fontset_font)
1670 (face_suitable_for_char_p) [0]:
1671 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1672 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1673 (m17n_flt_initialized, ftfont_shape_by_flt):
1674 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1675 * nsfont.m (nsfont_draw):
1676 * w32font.c (w32font_draw):
1677 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1678 Use bool for booleans.
1679 * font.h: Adjust to above API changes.
1680 (struct font, struct font_driver, struct font_driver_list):
1681 Use bool for booleans.
1682 (struct font): Remove useless member encoding_type.
1683 All users removed.
1684 * fontset.c, xftfont.c: Omit unnecessary static decls.
1685
0699fc18
DA
16862012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1687
1688 * alloc.c (mark_object): Revert window marking code
1689 since it's unsafe for the Fset_window_configuration.
1690
20ef56db
PE
16912012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1692
2fe28299 1693 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
1694 Be more systematic about preserving errno whenever a signal
1695 handler returns, even if it's not in the main thread. Do this by
1696 renaming signal handlers to distinguish between signal delivery
1697 and signal handling. All uses changed.
1698 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1699 * data.c (deliver_arith_signal): Rename from arith_error.
1700 * dispnew.c (deliver_window_change_signal): Rename from
1701 window_change_signal.
1702 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1703 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1704 * keyboard.c (deliver_input_available_signal): Rename from
1705 input_available_signal.
1706 (deliver_user_signal): Rename from handle_user_signal.
1707 (deliver_interrupt_signal): Rename from interrupt_signal.
1708 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1709 (deliver_child_signal): Rename from sigchld_handler.
1710 * atimer.c (handle_alarm_signal):
1711 * data.c (handle_arith_signal):
1712 * dispnew.c (handle_window_change_signal):
1713 * emacs.c (handle_fatal_signal, handle_danger_signal):
1714 * keyboard.c (handle_input_available_signal):
1715 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1716 * process.c (handle_pipe_signal, handle_child_signal):
1717 New functions, with the actual signal-handling code taken from the
1718 original respective signal handlers, sans the sporadic attempts to
1719 preserve errno, since that's now done by handle_on_main_thread.
1720 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1721 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1722 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1723 Move to sysdep.c.
1724 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1725 Move initialization of main_thread to sysdep.c's init_signals.
1726 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1727 our usage, and simplifies the mainline code.
1728 (record_child_status_change): New static function, as a helper
1729 for handle_child_signal, and with most of the old child handler's
1730 contents.
1731 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1732 (handle_child_signal): Use the above.
1733 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1734 Moved here from emacs.c.
1735 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1736 code moved here from emacs.c's main function.
1737 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
1738 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
1739 This lets callers save and restore errno properly.
20ef56db 1740
e3ccf108
DA
17412012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1742
1743 Remove redundant or unused things here and there.
1744 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1745 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1746 * editfns.c (Fcompare_buffer_substrings): Likewise.
1747 * frame.h (struct terminal, struct font_driver_list):
1748 Remove redundant declarations.
1749 * window.h (Qleft, Qright): Likewise.
1750
697e1e39
DA
17512012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1752
1753 Do not mark objects from deleted buffers, windows and frames.
1754 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1755 (mark_object): Likewise for windows and frames.
1756
c1ca42ca
DA
17572012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1758
1759 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1760 buffer_defaults and buffer_local_symbols as valid objects.
1761 Return special value to denote them.
1762
014d93be
PE
17632012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1764
f75d7a91
PE
1765 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1766 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1767 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1768 (file_name_absolute_p, Fsubstitute_in_file_name):
1769 (check_executable, check_writable, Ffile_accessible_directory_p)
1770 (Fset_file_selinux_context, Fdefault_file_modes)
1771 (Finsert_file_contents, choose_write_coding_system)
1772 (Fwrite_region, build_annotations, a_write, e_write)
1773 (Fdo_auto_save):
1774 * filelock.c (boot_time_initialized, get_boot_time)
1775 (get_boot_time_1, lock_file_1, within_one_second):
1776 * floatfns.c (in_float):
1777 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1778 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1779 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1780 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1781 * window.c (compare_window_configurations):
1782 Use bool for booleans.
1783 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1784 (Fdefault_file_modes): Now mode_t, not int, for modes.
1785 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1786 (internal_delete_file): Now returns void, not a (boolean) int,
1787 since nobody was looking at the return value.
1788 * lisp.h, window.h: Adjust to above API changes.
1789
014d93be
PE
1790 * xdisp.c (set_message): Simplify and reindent last change.
1791
776f29e1
JB
17922012-09-05 Juanma Barranquero <lekktu@gmail.com>
1793
1794 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1795
7f7e0167
LI
17962012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1797
1798 * eval.c (call_debugger): Make the function non-static so that we
1799 can call it from set_message.
1800
1801 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1802 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1803
cf29dd84
PE
18042012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1805
1806 Give more-useful info on a fatal error (Bug#12328).
1807 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1808 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1809 of doing the work ourselves.
1810 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1811 do most of the work.
1812 (fatal_error_backtrace): New function, taken from the guts
1813 of the old fatal_error_signal, but with a new option to output
1814 a backtrace.
1815 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1816 info about the signal than just its number.
1817 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1818 * sysdep.c: Include <execinfo.h>
1819 (emacs_backtrace): New function, taken partly from the previous
1820 code of the 'die' function.
1821 (emacs_abort): Call fatal_error_backtrace rather than abort.
1822
972debf2
SM
18232012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1824
1825 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1826 eager (load-time) macro-expansion.
1827 * lisp.mk (lisp): Add macroexp.
1828
1088b922
PE
18292012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1830
1831 Simplify redefinition of 'abort' (Bug#12316).
1832 Do not try to redefine the 'abort' function. Instead, redo
1833 the code so that it calls 'emacs_abort' rather than 'abort'.
1834 This removes the need for the NO_ABORT configure-time macro
1835 and makes it easier to change the abort code to do a backtrace.
1836 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1837 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1838 Remove; sysdep.c's emacs_abort now takes its place.
1839 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1840 'abort' changed to use 'emacs_abort'.
1841 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1842 (abort) [!defined abort]: Rename to ...
1843 (emacs_abort): ... new name.
1844 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1845 the place of the old 'abort' in emacs.c.
1846 * w32.c, w32fns.c (abort): Do not #undef.
1847 * w32.c (emacs_abort): Rename from w32_abort.
1848
30934d33
EZ
18492012-09-04 Eli Zaretskii <eliz@gnu.org>
1850
1851 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1852 offsets[j].dv, since the y axis of the screen coordinates points
1853 down, while the y axis of the font definition coordinates points
1854 up. This fixes display of Arabic diacritics such as KASRA and
1855 KASRATAN. (Bug#11860)
1856
af26b72c
PE
18572012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1858
1859 Be more systematic about _setjmp vs setjmp.
1860 * alloc.c (test_setjmp, mark_stack):
1861 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1862 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1863 (png_load, my_error_exit, jpeg_load):
1864 * process.c (send_process_trap, send_process):
1865 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1866 The underscored versions are up to 30x faster on some hosts.
1867 Formerly, the code used setjmp+longjmp sometimes and
1868 _setjmp+_longjmp at other times, with no particular reason to
1869 prefer setjmp+longjmp.
1870
26d4541d
PE
18712012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1872
d42f4f0f 1873 Fix minor problem found by static checking.
26d4541d 1874 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 1875
c5e28e39
MR
18762012-09-03 Martin Rudalics <rudalics@gmx.at>
1877
1878 * buffer.c (Fdelete_all_overlays): New function.
1879
3eab3ca9
CY
18802012-09-03 Chong Yidong <cyd@gnu.org>
1881
1882 * gtkutil.c: Add extern decl for Qxft.
1883
c04889f8
PE
18842012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1885
1882aa38
PE
1886 * emacs.c, eval.c: Use bool for boolean.
1887 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1888 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1889 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1890 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1891 (main, decode_env_path, Fdaemon_initialized):
1892 * eval.c (call_debugger, Finteractive_p, interactive_p):
1893 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1894 (maybe_call_debugger, Fbacktrace):
1895 * process.c (read_process_output, exec_sentinel):
1896 Use bool for booleans.
1897 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1898 All callers changed.
1899 * eval.c (interactive_p): Omit always-true boolean argument
1900 EXCLUDE_SUBRS_P. All callers changed.
1901 * dispextern.h, lisp.h: Reflect above API changes.
1902 * firstfile.c (dummy): Use the address of 'main', whose signature
1903 won't change, instead of the address of 'initialize', whose
1904 signature just changed from int to bool.
1905 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1906 * msdos.c (fatal_error_in_progress): ... from here.
1907 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1908 of incrementing it.
1909 (redisplay_internal, unwind_redisplay): Simply clear
1910 REDISPLAYING_P when unwinding, instead of saving its previous,
1911 always-false value and then restoring it.
1912
a411ac43
PE
1913 Clean up some extern decls.
1914 Mostly, this hoists extern decls out of .c files and into .h files.
1915 That way, we're more likely to catch errors if the interfaces change.
1916 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1917 declare xg_mark_data.
1918 * dispextern.h (x_frame_parm_handlers):
1919 * font.h (Qxft):
1920 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1921 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1922 (Qultra_bold, Qoblique, Qitalic):
1923 Move extern decl here from .c file.
1924 * alloc.c (xg_mark_data) [USE_GTK]:
1925 * doc.c (Qclosure):
1926 * eval.c (Qlexical_binding):
1927 * fns.c (time) [!HAVE_UNISTD_H]:
1928 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1929 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1930 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1931 * lread.c (Qinternal_interpreter_environment):
1932 * minibuf.c (Qbuffer):
1933 * process.c (QCfamily, QCfilter):
1934 * widget.c (free_frame_faces):
1935 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1936 * xfont.c (x_clear_errors):
1937 * xterm.c (x_frame_parm_handlers):
1938 Remove now-redundant extern decls.
1939 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1940 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1941 Now static.
1942 * xfaces.c: Remove unnecessary static decls.
1943 * xterm.c (updating_frame): Remove decl of nonexistent object.
1944
c04889f8
PE
1945 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1946 when building globals.h, as the objects that are not built on
1947 this host are not needed to compile C files on this host.
1948
8b339673
JD
19492012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1950
1951 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1952
1953 * frame.h: Add missing prototype for x_wm_set_size_hint.
1954
a08d4ba7
PE
19552012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1956
1957 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1958 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1959 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1960 (Fsubstitute_command_keys):
1961 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1962 (save_excursion_save, save_excursion_restore)
1963 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1964 (format_time_string, general_insert_function)
1965 (make_buffer_string, make_buffer_string_both)
1966 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1967 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1968 (copy_text, insert_1, insert_1_both, insert_from_string)
1969 (insert_from_string_before_markers, insert_from_string_1)
1970 (insert_from_buffer, insert_from_buffer_1, replace_range)
1971 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1972 (del_range_2, modify_region):
1973 * intervals.c (intervals_equal, balance_possible_root_interval)
1974 (adjust_intervals_for_insertion, merge_properties_sticky)
1975 (graft_intervals_into_buffer, lookup_char_property)
1976 (adjust_for_invis_intang, set_point_both)
1977 (get_property_and_range, compare_string_intervals)
1978 (set_intervals_multibyte_1, set_intervals_multibyte):
1979 * keyboard.c (decode_timer):
1980 Use bool for boolean.
1981 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1982 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1983
48c948de
CY
19842012-09-02 Chong Yidong <cyd@gnu.org>
1985
1986 * keymap.c (push_key_description): Print M-TAB as C-M-i
1987 (Bug#11758).
1988
6c49a40b
JB
19892012-09-02 Juanma Barranquero <lekktu@gmail.com>
1990
1991 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1992 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1993 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1994 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1995 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1996 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1997 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1998
4dfbd238
EZ
19992012-09-01 Eli Zaretskii <eliz@gnu.org>
2000
7e510e28
EZ
2001 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
2002 more than one grapheme cluster passed to the shaper: compute the
2003 offset adjustment values separately for each cluster. (Bug#11860)
2004
4dfbd238
EZ
2005 * image.c: Restore mistakenly removed inclusion of w32.h. Without
2006 it, GCC doesn't see prototypes of w32_delayed_load, and complains
2007 about implicit conversions from integer to pointer.
2008
86571ae0
DC
20092012-09-01 Daniel Colascione <dancol@dancol.org>
2010
2011 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2012 system used too early.
2013
0e23ef9d
PE
20142012-09-01 Paul Eggert <eggert@cs.ucla.edu>
2015
2016 Better seed support for (random).
2017 * emacs.c (main): Call init_random.
2018 * fns.c (Frandom): Set the seed from a string argument, if given.
2019 Remove long-obsolete Gentzel cruft.
2020 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
2021 (init_random): New function.
2022
17a2cbbd
DC
20232012-09-01 Daniel Colascione <dancol@dancol.org>
2024
2025 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
2026 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
2027 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
2028 x_wm_set_size_hint, x_query_colors, x_real_positions,
2029 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
2030 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
2031 all of which have been moved to common code.
2032
2033 * xfaces.c: Include TERM_HEADER instead of listing all possible
2034 window-system headers.
2035
2036 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2037 to match header.
2038
2039 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2040 directly accessing frame internals.
2041
f18cbb28 2042 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
2043 globals_of_w32font.
2044
2045 * process.c: Include TERM_HEADER instead of listing all possible
2046 window-system headers.
2047
3a880af4
SM
2048 * nsterm.h: Remove declarations now in frame.h.
2049 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
2050
2051 * menu.c: Include TERM_HEADER instead of listing all possible
2052 window-system headers.
2053
2054 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2055 window system.
2056
2057 * keyboard.c: Include TERM_HEADER instead of listing all possible
2058 window-system headers.
2059
2060 * image.c: Include TERM_HEADER instead of listing all possible
2061 window-system headers. Declare Vlibrary_cache when compiling for
2062 Windows.
2063
2064 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2065 window system declarations.
2066
2067 * frame.h: Move common functions here: set_frame_menubar,
2068 x_set_window_size, x_sync, x_get_focus_frame,
2069 x_set_mouse_position, x_set_mouse_pixel_position,
2070 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
2071 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
2072 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
2073 x_activate_menubar, x_real_positions, x_bitmap_icon,
2074 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
2075 and x_query_colors.
2076
2077 * frame.c: Include TERM_HEADER instead of listing all possible
2078 window-system headers.
2079
2080 * font.c: Include TERM_HEADER instead of listing all possible
2081 window-system headers.
2082
2083 * emacs.c: Include TERM_HEADER.
2084
f18cbb28
EZ
2085 * dispnew.c: Include TERM_HEADER instead of listing all possible
2086 window-system headers.
17a2cbbd 2087
f18cbb28 2088 * ccl.h: Include character.h.
17a2cbbd
DC
2089
2090 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2091 the current window system; include in list of objects to link into
2092 Emacs.
2093
c650a5de
DA
20942012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2095
2096 Remove mark_ttys function and fix tty_display_info initialization.
2097 * lisp.h (mark_ttys): Remove prototype.
2098 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2099 to mark_ttys because all possible values of 'top_frame' slot are
2100 the frames which are reachable from Vframe_list.
2101 * term.c (mark_ttys): Remove.
2102 (init_tty): Safely initialize 'top_frame' slot with Qnil.
2103
4e0f6479
DA
21042012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2105
2106 Change struct frame bitfields from unsigned char to unsigned.
2107 * frame.h (struct frame): Change type of 'display_preempted',
2108 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2109 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2110 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2111 bitfields from unsigned char to unsigned.
2112
8b96a52c
DA
21132012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2114
2115 Remove unused member of struct x_output and struct w32_output.
2116 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2117 * w32term.h (struct w32_output): Likewise.
2118
b4444c8a
JD
21192012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2120
2121 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2122 does not become zero (Bug#12234).
2123
b98521db
PE
21242012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2125
2126 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2127 for GCC 4.7.1 x86-64.
2128
31d02438
GM
21292012-08-30 Glenn Morris <rgm@gnu.org>
2130
2131 * lread.c (init_lread): For out-of-tree builds, only add the
2132 source directory's site-lisp dir to the load-path if it exists,
2133 consistent with in-tree builds. (Bug#12302)
2134
7f8941d8
JD
21352012-08-28 Jan Djärv <jan.h.d@swipnet.se>
2136
2137 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 2138 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
2139 (windowShouldClose:): Set window_closed.
2140 (dealloc): New member, free button_values.
fc0c31f8
JB
2141 (process_dialog:): Make member function. Remove window argument,
2142 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
2143 in button_values.
2144 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 2145 with tag. Remove return self, declare return value as void.
7f8941d8
JD
2146 (addString:row:): Remove return self, declare return value as void.
2147 (addSplit): Remove return self, declare return value as void.
2148 (clicked:): Remove return self, declare return value as void.
fc0c31f8 2149 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
2150 (initFromContents:isQuestion:): Adjust call to process_dialog.
2151 Code formatting change.
2152 (timeout_handler:): Set timer_fired to YES.
2153 (runDialogAt:): Set timer_fired to NO.
2154 Handle click on close button as quit.
2155
2156 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
2157 Add window_closed and button_values. Add void as return value for
2158 add(Button|String|Split). addButton takes int instead of Lisp_Object.
2159 Add process_dialog as new member.
2160
eada0861 21612012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 2162
eada0861
GM
2163 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
2164 is not one of the heaps we manage. (Bug#12242)
2165
21662012-08-28 Glenn Morris <rgm@gnu.org>
2167
2168 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
2169
457294dd
MR
21702012-08-28 Martin Rudalics <rudalics@gmx.at>
2171
2172 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
2173 auto-buffer-name window parameter. Install revision of reverted
2174 fix.
457294dd 2175
4f2daf31
DA
21762012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2177
2178 Do not allow to set major mode for a dead buffer.
2179 * buffer.c (Fset_buffer_major_mode): Signal an error
2180 if the buffer is dead.
2181 (Fother_buffer, other_buffer_safely): Remove redundant
2182 nested declaration.
2183
66322887
DA
21842012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2185
2186 Always use set_buffer_if_live to restore original buffer at unwind.
2187 * buffer.h (record_unwind_current_buffer): New function.
2188 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
2189 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
2190 * undo.c, window.c: Adjust users.
2191 * buffer.c (set_buffer_if_live): Fix comment.
2192
a3d794a1
DA
21932012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2194
2195 Fix usage of set_buffer_internal.
2196 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
2197 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
2198 * coding.c (decode_coding): Omit redundant test.
2199 * fileio.c (decide_coding_unwind): Likewise.
2200 * fns.c (secure_hash): Likewise.
2201 * insdel.c (modify_region): Likewise.
2202 * keyboard.c (command_loop_1): Likewise.
2203 * print.c (PRINTFINISH): Likewise.
2204 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
2205
59ea14cd
PE
22062012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2207
2208 * dispnew.c: Use bool for boolean.
2209 (frame_garbaged, display_completed, delayed_size_change)
2210 (fonts_changed_p, add_window_display_history)
2211 (add_frame_display_history, verify_row_hash)
2212 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
2213 (row_equal_p, realloc_glyph_pool)
2214 (allocate_matrices_for_frame_redisplay)
2215 (showing_window_margins_p)
2216 (adjust_frame_glyphs_for_frame_redisplay)
2217 (build_frame_matrix_from_leaf_window, make_current)
2218 (mirrored_line_dance, mirror_line_dance, update_frame)
2219 (update_window_tree, update_single_window)
2220 (check_current_matrix_flags, update_window, update_text_area)
2221 (update_window_line, set_window_update_flags, scrolling_window)
2222 (update_frame_1, scrolling, buffer_posn_from_coords)
2223 (do_pending_window_change, change_frame_size)
2224 (change_frame_size_1, sit_for):
2225 Use bool for boolean.
2226 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2227 and remove last int (actually boolean) argument, which was always 0.
2228 All callers changed.
2229 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2230 * dispextern.h (struct composition_it): Use bool for boolean.
2231 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2232 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2233 * dired.c (file_name_completion):
2234 Use bool for boolean. (This was missed in an earlier change.)
2235
95072a94
MR
22362012-08-27 Martin Rudalics <rudalics@gmx.at>
2237
2238 * window.c (Fset_window_configuration): Revert first part of
2239 last change.
2240
0f19feff
JD
22412012-08-27 Jan Djärv <jan.h.d@swipnet.se>
2242
2243 * nsterm.h (NSPanel): New class variable dialog_return.
2244
3a880af4
SM
2245 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2246 Initialize dialog_return.
0f19feff
JD
2247 (windowShouldClose:): Use stop instead of stopModalWithCode.
2248 (clicked:): Ditto, and also set dialog_return (Bug#12258).
2249 (timeout_handler:): Use stop instead of abortModal. Send a dummy
2250 event.
2251 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
2252 modal loop returns.
2253
f10fe38f
PE
22542012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2255
de1339b0
PE
2256 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2257 * composite.c (find_composition, composition_gstring_p)
2258 (composition_reseat_it, find_automatic_composition):
2259 * data.c (let_shadows_buffer_binding_p)
2260 (let_shadows_global_binding_p, set_internal, make_blv)
2261 (Fmake_variable_buffer_local, Fmake_local_variable)
2262 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2263 (cons_to_signed, arith_driver):
2264 * dbusbind.c (xd_in_read_queued_messages):
2265 * dired.c (directory_files_internal, file_name_completion):
2266 Use bool for booleans.
2267 * dired.c (file_name_completion):
2268 * process.h (fd_callback):
2269 Omit int (actually boolean) argument. It wasn't being used.
2270 All uses changed.
2271 * composite.h, lisp.h: Reflect above API changes.
2272
f10fe38f
PE
2273 * cmds.c, coding.c: Use bool for booleans.
2274 * cmds.c (move_point, Fself_insert_command):
2275 * coding.h (struct composition status, struct coding_system):
2276 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2277 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2278 (emacs_mule_char, decode_coding_emacs_mule)
2279 (encode_coding_emacs_mule, detect_coding_iso_2022)
2280 (decode_coding_iso_2022, encode_invocation_designation)
2281 (encode_designation_at_bol, encode_coding_iso_2022)
2282 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2283 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2284 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2285 (encode_coding_raw_text, detect_coding_charset)
2286 (decode_coding_charset, encode_coding_charset, detect_eol)
2287 (detect_coding, get_translation_table, produce_chars)
2288 (consume_chars, reused_workbuf_in_use)
2289 (make_conversion_work_buffer, code_conversion_save)
2290 (decode_coding_object, encode_coding_object)
2291 (detect_coding_system, char_encodable_p)
2292 (Funencodable_char_position, code_convert_region)
2293 (code_convert_string, code_convert_string_norecord)
2294 (Fset_coding_system_priority):
2295 * fileio.c (Finsert_file_contents):
2296 Use bool for booleans.
2297 * coding.h, lisp.h: Reflect above API changes.
2298 * coding.c: Remove unnecessary static function decls.
2299 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2300 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2301 not a boolean 'int', since callers never look at the return value.
2302 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2303 * coding.h (decoding_buffer_size, encoding_buffer_size)
2304 (emacs_mule_string_char): Remove unused extern decls.
2305 (struct iso_2022_spec, struct coding_system):
2306 Use 'unsigned int : 1' for boolean fields, since there's more than one.
2307 (struct emacs_mule_spec): Remove unused field 'full_support'.
2308 All initializations removed.
2309 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2310
5474c384
DA
23112012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2312
f10fe38f 2313 Fix spare memory change (Bug#12286).
5474c384
DA
2314 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
2315 (valid_lisp_object_p): Likewise.
2316
c4b6914d
MR
23172012-08-27 Martin Rudalics <rudalics@gmx.at>
2318
2319 * window.c (Fset_window_configuration): Record any window's old
2320 buffer if it's replaced (see Bug#8789). If the new current
2321 buffer doesn't appear in the selected window, go to its old
2322 point (Bug#12208).
2323
35aaa1ea
DA
23242012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2325
2326 Special MEM_TYPE_SPARE to denote reserved memory.
2327 * alloc.c (enum mem_type): New memory type.
2328 (refill_memory_reserve): Use new type for spare memory.
2329 This prevents live_cons_p and live_string_p from incorrect
2330 detection of uninitialized objects from spare memory as live.
2331
6af64513
PE
23322012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2333
8b2e00a3
PE
2334 Spelling fixes.
2335 * Makefile.in (.PHONY): versioclean -> versionclean.
2336
b52d6985
PE
2337 Remove unused external symbols.
2338 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2339 * window.c (Qwindow_valid_p, decode_valid_window):
2340 Now static, not extern.
2341 * data.c (Qinterval): Remove; unused.
2342 (syms_of_data): Do not define 'interval'.
2343 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2344 * window.h (decode_valid_window):
2345 Remove decls.
2346
d5172d4f
PE
2347 * character.c, charset.c, chartab.c: Use bool for booleans.
2348 * character.c (lisp_string_width, string_count_byte8)
2349 (string_escape_byte8):
2350 * charset.c (charset_map_loaded, load_charset_map, read_hex):
2351 (load_charset_map_from_file, map_charset_chars)
2352 (Fdefine_charset_internal, define_charset_internal)
2353 (Fdeclare_equiv_charset, find_charsets_in_text)
2354 (Ffind_charset_region, char_charset, Fiso_charset):
2355 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2356 (sub_char_table_set, sub_char_table_set_range)
2357 (char_table_set_range, optimize_sub_char_table)
2358 (map_sub_char_table):
2359 Use bool for boolean.
2360 * character.c (str_to_unibyte): Omit last boolean argument; it was
2361 always 0. All callers changed.
2362 * character.h, charset.h: Adjust to match previous changes.
2363 * character.h (char_printable_p): Remove decl of nonexistent function.
2364 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2365 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2366 are all boolean, so make them single-bit bitfields.
2367
6af64513
PE
2368 * lisp.h (ASET): Remove attempt to detect side effects.
2369 It was meant to be temporary and it often doesn't work,
2370 because when IDX has side effects the behavior of IDX==IDX
2371 is undefined. See Stefan Monnier in
2372 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2373
e1f29348
BR
23742012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2375
2376 * lisp.h (functionp): New function (extracted from Ffunctionp).
2377 (FUNCTIONP): Use it.
2378 * eval.c (Ffunctionp): Use it.
2379
17c05d74
PE
23802012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2381
0f46bc75
PE
2382 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2383 as that's faster and simpler than static storage. Don't bother
2384 with the g_main_context_query overhead if g_main_context_pending
2385 says no events are pending.
2386 (gfds, gfds_size): Remove these static vars.
2387 (xgselect_initialize): Remove; no longer needed.
2388 All uses and decls removed.
2389
ee4c0f69
PE
2390 * emacs.c (fatal_error_signal_hook): Remove.
2391 All uses removed. This leftover from old code was always 0.
2392
17c05d74
PE
2393 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2394 * casefiddle.c (casify_object, casify_region):
2395 * casetab.c (set_case_table):
2396 * category.c, category.h (word_boundary_p):
2397 * category.h (CHAR_HAS_CATEGORY):
2398 Use bool for booleans, instead of int.
2399
391ceac5
EZ
24002012-08-25 Eli Zaretskii <eliz@gnu.org>
2401
2402 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2403
2f221583
PE
24042012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2405
f4a681b0
PE
2406 On assertion failure, print backtrace if available.
2407 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2408 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2409 * Makefile.in (LIB_EXECINFO): New macro.
2410 (LIBES): Use it.
2411
2f221583
PE
2412 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2413 * bytecode.c (exec_byte_code):
2414 * callint.c (check_mark, Fcall_interactively):
2415 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2416 (getenv_internal, sync_process_alive, call_process_exited):
2417 * lisp.h (USE_SAFE_ALLOCA):
2418 Use bool for booleans, instead of int.
2419 * lisp.h, process.h: Adjust prototypes to match above changes.
2420 * callint.c (Fcall_interactively): Don't assume the mark's
2421 offset fits in 'int'.
2422
37ef52bb
PE
24232012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2424
2425 * buffer.c, buffer.h: Use bool for boolean.
2426 * buffer.c (reset_buffer_local_variables)
2427 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2428 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2429 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2430 (overlay_touches_p, overlay_strings, Foverlay_put)
2431 (report_overlay_modification, call_overlay_mod_hooks):
2432 (mmap_enlarge, mmap_set_vars):
2433 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2434 Use bool for booleans, instead of int.
2435 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2436 since the 1-or-0 return value is always ignored anyway.
2437 (mmap_initialized_p):
2438 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2439 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2440
2cc21167
PE
24412012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2442
2443 * bidi.c: Use bool for boolean.
2444 This is a bit more readable, and makes the text segment of bidi.o
2445 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2446 Presumably it's faster too.
2447 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2448 Now bool.
2449 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2450 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2451 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2452 (bidi_explicit_dir_char, bidi_level_of_next_char)
2453 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2454 Use bool for booleans, instead of int.
2455 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2456 (bidi_unshelve_cache): Adjust decls to match code.
2457
7db4ddf4
MR
24582012-08-23 Martin Rudalics <rudalics@gmx.at>
2459
2460 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2461 argument.
2462
b1bb8011
PE
24632012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2464
2465 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2466 * atimer.h: Include <stdbool.h>.
2467
ff687885
DN
24682012-08-22 Dan Nicolaescu <dann@gnu.org>
2469
2470 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2471 compile time tests instead of run time tests on systems that do
2472 not use them.
2473 (FRAME_MAC_P): Remove leftover from deleted code.
2474 * frame.c (syms_of_frame): Remove leftover from deleted code.
2475
4ce7a138
JD
24762012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2477
2478 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2479
d733ec6d
PE
24802012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2481
2482 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2483 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 2484 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
2485 (fontset_add): Return void, for FONTSET_ADD.
2486
d0d2d26f
PE
24872012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2488
fce31d69
PE
2489 * alloc.c: Use bool for booleans.
2490 (gc_in_progress, abort_on_gc)
2491 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2492 (dont_register_blocks) [GC_MALLOC_CHECK]:
2493 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2494 (check_string_bytes, make_specified_string, memory_full)
2495 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2496 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2497 (mark_stack, valid_pointer_p, make_pure_string)
2498 (Fgarbage_collect, survives_gc_p, gc_sweep):
2499 Use bool for booleans, instead of int.
2500 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2501 Remove unused local.
2502 * alloc.c (PURE_POINTER_P):
2503 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2504 * editfns.c (Fformat):
2505 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2506 (Fdo_auto_save):
2507 * fns.c (sweep_weak_table):
2508 * lisp.h (suppress_checking, push_message, survives_gc_p)
2509 (make_pure_string, gc_in_progress, abort_on_gc):
2510 * lread.c (readchar, read1):
2511 * print.c (Fprin1_to_string):
2512 * xdisp.c (push_message):
2513 Use bool for booleans affected directly or indirectly by
2514 alloc.c's changes.
2515
d0d2d26f
PE
2516 Make recently-introduced setters macros.
2517 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2518 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2519 (set_fontset_default, set_fontset_fallback): Rename from their
2520 upper-case counterparts, and make them functions rather than macros.
2521 This is more consistent with the other recently-introduced setters.
2522 These don't need to be inline, since they're local.
2523
d18e2bb6
JD
25242012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2525
2526 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2527 the loop (Bug#12247).
2528
1b9d9d16
PE
25292012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2530
2531 * lisp.h (vcopy): Use memcpy rather than our own loop.
2532 This fixes a performance regression introduced by the recent
2533 addition of vcopy. This means 'vcopy' will need to be modified
2534 for a copying collector, but that's OK. Also, tighten the
2535 checking in the assertion.
2536
b2f09701
EZ
25372012-08-21 Eli Zaretskii <eliz@gnu.org>
2538
2539 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2540 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2541 non-base glyph for the width of the base character, according to
e1f29348
BR
2542 what x_draw_composite_glyph_string_foreground expects.
2543 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
2544 expectations, to produce correct width of the composed character.
2545 Reverse the sign of the DU offset produced by ScriptPlace.
2546
9b994fed
PE
25472012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2548
2549 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2550
086ca913
DA
25512012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2552
2553 Avoid direct writes to contents member of struct Lisp_Vector.
2554 * lisp.h (vcopy): New function to copy data into vector.
2555 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2556 * fns.c (Ffillarray): Use ASET.
2557 * keyboard.c (timer_check_2): Use AREF and ASET.
2558 (append_tool_bar_item, Frecent_keys): Use vcopy.
2559 * lread.c (read_vector): Use ASET.
2560 * msdos.c (Frecent_doskeys): Use vcopy.
2561 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2562 (Finternal_merge_in_global_face): Use ASET and vcopy.
2563 * xfont.c (xfont_list_pattern): Likewise.
2564
5481664a
MR
25652012-08-21 Martin Rudalics <rudalics@gmx.at>
2566
2567 * window.c (Fwindow_point): For the selected window always return
2568 the position of its buffer's point.
2569 (Fset_window_point): For the selected window always go in its
2570 buffer to the specified position.
2571
6d470bdd
DA
25722012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2573
2574 Setter macros for fontsets.
2575 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2576 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2577 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2578 Adjust users.
2579
24564fe1
GM
25802012-08-20 Glenn Morris <rgm@gnu.org>
2581
2582 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2583 Don't assume that `ln -f' works.
2584
0a05a035
EZ
25852012-08-20 Eli Zaretskii <eliz@gnu.org>
2586
2587 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2588 and later about non-assignments with no effect. See discussion at
2589 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2590 details.
2591
e46f2325
DA
25922012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2593
2594 Inline setter functions for Lisp_Objects slots of struct specbinding.
2595 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2596 Adjust users.
2597
734fbd86
MR
25982012-08-20 Martin Rudalics <rudalics@gmx.at>
2599
2600 * window.c (select_window): Always make selected window's buffer
2601 current.
2602
f1a95992
DA
26032012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2604
2605 Use AREF and ASET for docstrings of category tables.
2606 * category.h (CATEGORY_DOCSTRING): Use AREF.
2607 (SET_CATEGORY_DOCSTRING): Use ASET.
2608 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2609
e83064be
DA
26102012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2611
2612 Inline setter functions for hash table members.
2613 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2614 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2615 (set_hash_key_and_value, set_hash_index, set_hash_next)
2616 (set_hash_hash): New functions.
2617 * charset.c, fns.c: Adjust users.
2618
4ce60d2e
DA
26192012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2620
2621 Inline getter and setter functions for per-buffer values.
2622 * buffer.h (per_buffer_default, set_per_buffer_default)
2623 (per_buffer_value, set_per_buffer_value): New functions.
2624 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2625 * buffer.c, data.c: Adjust users.
2626
c06c9690
JB
26272012-08-20 Juanma Barranquero <lekktu@gmail.com>
2628
2629 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2630
32bd4250
PE
26312012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2632
bad03192 2633 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
2634 as gnulib does this if the system doesn't.
2635 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
2636 Remove declaration. MS-Windows declares it on stdlib.h which is
2637 included by conf_post.h.
b69a6d22
PE
2638 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2639 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2640 * vm-limit.c: Include <unistd.h>, for 'environ'.
2641
22d7feb2
PE
2642 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2643 (start_of_data): Remove decl; mem-limits.h provides it.
2644
32bd4250
PE
2645 * xdisp.c (handle_invisible_prop): Make it a bit faster
2646 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2647
450809af
CY
26482012-08-19 Chong Yidong <cyd@gnu.org>
2649
2650 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2651 ends (Bug#3874).
2652
9e677988
AS
26532012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2654
6b1319ce
AS
2655 * .gdbinit: Use call instead of set when calling a function in the
2656 inferior.
2657
9e677988
AS
2658 * data.c (set_internal): Don't use set_blv_found.
2659 (Fkill_local_variable): Likewise.
2660
d7191076
AA
26612012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2662
2663 * nsfont.m (ns_ascii_average_width): Ensure the string
2664 ascii_printable is initialized with a null-terminated character
2665 array. Otherwise, it can contain undesired extra characters.
2666
e757f1c6
PE
26672012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2668
2669 port new setting code to Sun C 5.8 2005/10/13
2670 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2671 Return void, not Lisp_Object. Otherwise, the compiler
2672 complains about (A?B:C) where B is void and C is Lisp_Object
2673 when compiling CHAR_TABLE_SET, due to the recent change to
2674 the API of sub_char_table_set_contents.
2675
a999ce26
CY
26762012-08-18 Chong Yidong <cyd@gnu.org>
2677
2678 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2679 for the string case (Bug#3874).
2680
3f22b86f
PE
26812012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2682
39eb03f1
PE
2683 * buffer.h (BSET): Remove (Bug#12215).
2684 Replace all uses with calls to new setter functions.
2685 (bset_bidi_paragraph_direction, bset_case_canon_table)
2686 (bset_case_eqv_table, bset_directory, bset_display_count)
2687 (bset_display_time, bset_downcase_table)
2688 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2689 (bset_last_selected_window, bset_local_var_alist)
2690 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2691 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2692 (bset_width_table):
2693 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2694 (bset_auto_fill_function, bset_auto_save_file_format)
2695 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2696 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2697 (bset_cache_long_line_scans, bset_case_fold_search)
2698 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2699 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2700 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2701 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2702 (bset_header_line_format, bset_indicate_buffer_boundaries)
2703 (bset_indicate_empty_lines, bset_invisibility_spec)
2704 (bset_left_fringe_width, bset_major_mode, bset_mark)
2705 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2706 (bset_name, bset_overwrite_mode, bset_pt_marker)
2707 (bset_right_fringe_width, bset_save_length)
2708 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2709 (bset_scroll_up_aggressively, bset_selective_display)
2710 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2711 (bset_word_wrap, bset_zv_marker):
2712 * category.c (bset_category_table):
2713 * syntax.c (bset_syntax_table):
2714 New setter functions.
2715
6a09a33b
PE
2716 * process.h (PSET): Remove (Bug#12215).
2717 Replace all uses with calls to new setter functions.
2718 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2719 (PROCESS_INLINE): New macro.
2720 (pset_childp): New setter function.
2721 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2722 * process.c (PROCESS_INLINE):
2723 Define to EXTERN_INLINE, so that the corresponding functions
2724 are compiled into code.
2725 (pset_buffer, pset_command, pset_decode_coding_system)
2726 (pset_decoding_buf, pset_encode_coding_system)
2727 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2728 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2729 (pset_type, pset_write_queue): New setter functions.
2730
e8c17b81
PE
2731 * window.h (WSET): Remove (Bug#12215).
2732 Replace all uses with calls to new setter functions.
2733 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2734 (WINDOW_INLINE): New macro.
2735 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2736 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2737 (wset_total_lines, wset_vertical_scroll_bar)
2738 (wset_window_end_pos, wset_window_end_valid)
2739 (wset_window_end_vpos): New setter functions.
2740 * window.c (WINDOW_INLINE):
2741 Define to EXTERN_INLINE, so that the corresponding functions
2742 are compiled into code.
2743 (wset_combination_limit, wset_dedicated, wset_display_table)
2744 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2745 (wset_new_normal, wset_new_total, wset_next_buffers)
2746 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2747 (wset_prev_buffers, wset_right_fringe_width)
2748 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2749 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2750 (wset_window_parameters):
2751 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2752 (wset_column_number_displayed, wset_region_showing):
2753 New setter functions.
2754
3f22b86f
PE
2755 * termhooks.h (TSET): Remove (Bug#12215).
2756 Replace all uses with calls to new setter functions.
2757 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2758 (TERMHOOKS_INLINE): New macro.
2759 (tset_charset_list, tset_selection_alist): New setter functions.
2760 * terminal.c (TERMHOOKS_INLINE):
2761 Define to EXTERN_INLINE, so that the corresponding functions
2762 are compiled into code.
2763 (tset_param_alist): New setter function.
2764
742af32f
PE
27652012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2766
15dbb4d6
PE
2767 * keyboard.h (KSET): Remove (Bug#12215).
2768 Replace all uses with calls to new setter functions.
2769 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2770 (KEYBOARD_INLINE): New macro.
2771 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2772 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2773 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2774 New setter functions.
2775 * keyboard.c (KEYBOARD_INLINE):
2776 Define to EXTERN_INLINE, so that the corresponding functions
2777 are compiled into code.
2778 (kset_echo_string, kset_kbd_queue)
2779 (kset_keyboard_translate_table, kset_last_prefix_arg)
2780 (kset_last_repeatable_command, kset_local_function_key_map)
2781 (kset_overriding_terminal_local_map, kset_real_last_command)
2782 (kset_system_key_syms): New setter functions.
2783
f00af5b1
PE
2784 * frame.h (FSET): Remove (Bug#12215).
2785 Replace all uses with calls to new setter functions.
2786 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2787 (FRAME_INLINE): New macro.
2788 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2789 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2790 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2791 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2792 (fset_param_alist, fset_root_window, fset_scroll_bars)
2793 (fset_selected_window, fset_title, fset_tool_bar_items)
2794 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2795 * frame.c (FRAME_INLINE):
2796 Define to EXTERN_INLINE, so that the corresponding functions
2797 are compiled into code.
2798 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2799
0c94c8d6
PE
2800 A few more naming-convention fixes for getters and setters.
2801 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2802 and rename from buffer_overlays_set_before.
2803 (set_buffer_overlays_after): Move here from buffer.h, and rename
2804 from buffer_overlays_set_after.
2805 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2806 All uses changed.
2807 (set_buffer_intervals): Rename from buffer_set_intervals.
2808 * intervals.c (set_interval_object): Move here from intervals.h,
2809 and rename from interval_set_object.
2810 (set_interval_left): Move here from intervals.h, and rename from
2811 interval_set_left.
2812 (set_interval_right): Move here from intervals.h, and rename from
2813 interval_set_right.
2814 (copy_interval_parent): Move here from intervals.h, and rename from
2815 interval_copy_parent.
2816 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2817 (set_interval_plist): Rename from interval_set_plist.
2818 Return void, not Lisp_Object, since no caller uses the result.
2819 * lisp.h (string_intervals): Rename from string_get_intervals.
2820 (set_string_intervals): Rename from string_set_intervals.
2821
34dabdb7
PE
2822 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2823 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 2824 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
2825 All uses changed. See the end of
2826 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2827
742af32f
PE
2828 * lisp.h (CSET): Remove (Bug#12215).
2829 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2830 (set_char_table_purpose): New functions,
2831 replacing CSET. All uses changed. For example, replace
2832 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 2833 "set_char_table_parent (char_table, parent);".
742af32f
PE
2834 The old version was confusing because it used the same name
2835 'parent' for two different things.
2836
a04e2c62
DA
28372012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2838
2839 Functions to get and set Lisp_Object fields of buffer-local variables.
2840 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2841 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2842 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2843 * data.c, eval.c, frame.c: Adjust users.
2844
383dcbf9
CY
28452012-08-17 Chong Yidong <cyd@gnu.org>
2846
2847 * xfaces.c (merge_face_vectors): If the target font specfies a
2848 font spec, make the font's attributes take precedence over
2849 directly-specified attributes.
2850 (merge_face_ref): Recognize :font.
2851
44386687
DA
28522012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2853
2854 Do not use memcpy for copying intervals.
2855 * intervals.c (reproduce_interval): New function.
2856 (reproduce_tree, reproduce_tree_obj): Use it.
2857 (reproduce_tree_obj): Remove prototype.
2858
927c7216
PE
28592012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2860
2861 * lisp.h (duration_to_sec_usec): Remove unused decl.
2862
93044f7b
AA
28632012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2864
2865 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2866 to an allocated instance of NSString, not to the class itself.
2867
9851e4a5
JB
28682012-08-17 Juanma Barranquero <lekktu@gmail.com>
2869
2870 * makefile.w32-in (C_CTYPE_H): New macro.
2871 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2872 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2873 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2874
620f13b0
PE
28752012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2876
2877 Use ASCII tests for character types.
2878 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2879 * xfns.c, xterm.c:
2880 Don't include <ctype.h>; was not needed.
2881 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2882 * sysdep.c, xfaces.c:
2883 Include <c-ctype.h> instead of <ctype.h>.
2884 * nsterm.m: Include <c-ctype.h>.
2885 * charset.c (read_hex):
2886 * doc.c (Fsnarf_documentation):
2887 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2888 (DRIVE_LETTER) [DOS_NT]:
2889 (Ffile_name_directory, Fexpand_file_name)
2890 (Fsubstitute_in_file_name):
2891 * font.c (font_parse_xlfd, font_parse_fcname):
2892 * frame.c (x_set_font_backend):
2893 * gtkutil.c (xg_get_font):
2894 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2895 * nsimage.m (hexchar):
2896 * nsterm.m (ns_xlfd_to_fontname):
2897 * sysdep.c (system_process_attributes):
2898 * xfaces.c (hash_string_case_insensitive):
2899 Use C-locale tests instead of locale-specific tests for character
2900 types, since we want the ASCII interpretation here, not the
2901 interpretation suitable for whatever happens to be the current locale.
2902
52162052
MR
29032012-08-16 Martin Rudalics <rudalics@gmx.at>
2904
2905 Consistently check windows for validity/liveness
2906 (Bug#11984, Bug#12025, Bug#12026).
2907 * lisp.h (CHECK_VALID_WINDOW): New macro.
2908 * window.c (decode_window): Rename to decode_live_window.
2909 (decode_valid_window, Fwindow_valid_p): New functions.
2910 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2911 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2912 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2913 (Fwindow_prev_sibling, Fwindow_combination_limit)
2914 (Fset_window_combination_limit, Fwindow_use_time)
2915 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2916 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2917 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2918 (Fwindow_hscroll, Fset_window_hscroll)
2919 (Fwindow_redisplay_end_trigger)
2920 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2921 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2922 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2923 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2924 (Fwindow_end, Fset_window_point, Fset_window_start)
2925 (Fpos_visible_in_window_p, Fwindow_line_height)
2926 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2927 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2928 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2929 (Fset_window_parameter, Fwindow_display_table)
2930 (Fset_window_display_table, Fdelete_other_windows_internal)
2931 (Fset_window_buffer, Fset_window_new_total)
2932 (Fset_window_new_normal, Fdelete_window_internal)
2933 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2934 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2935 (Fwindow_scroll_bars): Check whether argument window is a valid or
2936 live window. Update doc-strings.
2937 (syms_of_window): New symbol Qwindow_valid_p.
2938 * keyboard.c (Fposn_at_x_y): Check whether argument
2939 frame_or_window denotes a valid window.
2940
2751c80f
DA
29412012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2942
2943 Fix previous char table change.
2944 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2945 * chartab.c (optimize_sub_char_table): Likewise.
2946
032a42c8
CY
29472012-08-16 Chong Yidong <cyd@gnu.org>
2948
a2d19368
CY
2949 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2950
032a42c8
CY
2951 * xfont.c (xfont_open):
2952 * xftfont.c (xftfont_open): Set the font's max_width field.
2953
2954 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2955 min_width to space_width and average_width to the average over
2956 printable ASCII characters.
2957 (ns_char_width): Code cleanup.
2958 (ns_ascii_average_width): New utility function.
2959
2960 * font.h (struct font): Update comments.
2961
a098c930
DA
29622012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2963
032a42c8 2964 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
2965 * lisp.h (CSET): New macro.
2966 (char_table_set_extras, char_table_set_contents)
2967 (sub_char_table_set_contents): New function.
2968 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2969 * syntax.c: Adjust users.
2970
8be3a09c
SM
29712012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2972
2973 * eval.c (eval_sub): Bind lexical-binding.
2974 * lread.c (Qlexical_binding): Make non-static.
2975
ac4845a6
JD
29762012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2977
ddee6515
JD
2978 * nsmenu.m (popupSession): Remove.
2979 (pop_down_menu): Remove endModalSession.
2980 (timeout_handler:): New method.
2981 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2982 Call runModalForWindow. Check timer_fired when it returns.
2983 If not set, cancel timer and break out of loop.
2984 Otherwise loop again, with a new timeout.
2985
2986 * nsterm.m: Include fcntl.h if present.
2987 (fd_entry, t_readfds, inNsSelect): Remove.
2988 (select_writefds, select_valid, select_timeout, selfds)
2989 (select_mutex, apploopnr): Add.
2990 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2991 Otherwise call kbd_buffer_store_event.
2992 (ns_send_appdefined): Remove release of fd_entry.
2993 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2994 Increment and decrement apploopnr.
2995 (ns_select): If no file descriptors, just do a NSTimer.
2996 Otherwise copy read/write masks and start select thread (fd_handler).
2997 Start main loop and wait for application defined event.
2998 Inform select thread to stop selecting after main loop is exited.
2999 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 3000 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
3001 (fd_handler:): Loop forever, wait for info from the main thread
3002 to either start or stop selecting. When select returns, send
3003 and appdefined event.
3004 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
3005 If not call kbd_buffer_store_event.
3006
3007 * nsterm.h (EmacsApp): fd_handler takes id argument.
3008 (EmacsDialogPanel): Add timer_fired and timeout_handler.
3009
ac4845a6
JD
3010 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3011
eb424fe3
EZ
30122012-08-15 Eli Zaretskii <eliz@gnu.org>
3013
3014 * region-cache.c (move_cache_gap): Update gap_len using the actual
3015 growth of the boundaries array. Do not change cache_len.
3016 (Bug#12196)
3017
4e6a86c6
DA
30182012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3019
3020 Generalize and cleanup font subsystem checks.
3021 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
3022 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
3023 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 3024
5bf192ca
DA
30252012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3026
3027 * gtkutil.c (xg_get_font): Use pango_units_to_double.
3028
f2045622
CY
30292012-08-15 Chong Yidong <cyd@gnu.org>
3030
8be3a09c
SM
3031 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
3032 When using the new font chooser, use gtk_font_chooser_get_font_desc to
3033 extract the font descriptor instead of just the font name.
3034 In that case, return a font spec instead of a string.
f2045622
CY
3035 (x_last_font_name): Move to this file from xfns.c.
3036
3037 * xfns.c (Fx_select_font): The return value can also be a font
3038 spec. Move x_last_font_name management to gtkutil.c.
3039
3040 * xfaces.c: Make font weight and style symbols non-static.
3041
7f6feb56
SM
30422012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
3043
3044 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3045 (bug#12117).
3046
fecbd8ff
SM
30472012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
3048
3049 * alloc.c (Fgarbage_collect): Use plural form consistently.
3050
9b8d5165
EZ
30512012-08-14 Eli Zaretskii <eliz@gnu.org>
3052
3053 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3054 iteration through the command loop. Fixes a problem whereby mouse
3055 movements are ignored until the first mouse click.
3056
f5d9e83a
PE
30572012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3058
3059 Use bool, not int, for Lisp booleans.
3060 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3061 makes Emacs a bit smaller and presumably a bit faster.
3062 * lisp.h: Include <stdbool.h>.
3063 (struct Lisp_Boolfwd, defvar_bool):
3064 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3065 * regex.c [!emacs]: Include <stdbool.h>.
3066 (false, true): Remove; <stdbool.h> does this for us now.
3067
55802e4a
CY
30682012-08-14 Chong Yidong <cyd@gnu.org>
3069
4abcdac8
CY
3070 * character.c (Fcharacterp): Doc fix (Bug#12076).
3071
3072 * data.c (Findirect_variable): Doc fix (Bug#11040).
3073
55802e4a
CY
3074 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
3075
3076 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 3077 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 3078
8e99d072
BR
30792012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3080
3081 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3082 (bug#12022).
3083
08908aca
MR
30842012-08-14 Martin Rudalics <rudalics@gmx.at>
3085
3086 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3087 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3088 * minibuf.c (choose_minibuf_frame, read_minibuf):
3089 * w32fns.c (x_create_tip_frame):
3090 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3091 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3092
56120d6f
PE
30932012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3094
3095 * intervals.c (offset_intervals): Remove obsolete comment.
3096
67b77c0b
AS
30972012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3098
3099 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3100
f48b82fd
GR
31012012-08-14 Gergely Risko <gergely@risko.hu>
3102
3103 * coding.c (decode_coding): Record buffer modification before
3104 disabling undo_list (Bug#11773).
3105
fd318b54
DA
31062012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3107
3108 Revert and cleanup some recent overlay changes.
3109 * buffer.h (enum overlay_type): Remove.
3110 (buffer_get_overlays, buffer_set_overlays): Likewise.
3111 (buffer_set_overlays_before, buffer_set_overlays_after):
3112 New function. Adjust users.
3113 (unchain_both): Add eassert.
3114
41a62dd9
DA
31152012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3116
3117 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3118
5884c324
PE
31192012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3120
3121 * gtkutil.c (xg_mark_data): Don't assume C99.
3122
ca06f160
JD
31232012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3124
3125 * gtkutil.c (xg_frame_tb_info): New struct.
3126 (TB_INFO_KEY): New define.
3127 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3128 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3129 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3130 if not present.
3131 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 3132 is up to date. Otherwise store new data.
ca06f160
JD
3133 (free_frame_tool_bar): Free xg_frame_tb_info if present.
3134
7864a3f7
DA
31352012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3136
3137 Use KSET for write access to Lisp_Object members of struct kboard.
3138 * keyboard.h (KSET): New macro.
3139 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3140 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3141 * xterm.c: Adjust users.
3142
4c31be61
DA
31432012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3144
3145 Use BSET for write access to Lisp_Object members of struct buffer.
3146 * buffer.h (BSET): New macro.
3147 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3148 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3149 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3150 * window.c, xdisp.c, xfns.c: Adjust users.
3151
14ae4239
BT
31522012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
3153
3154 * lread.c (syms_of_lread): Initialize Vlexical_binding.
3155
32bcadb4
JD
31562012-08-11 Jan Djärv <jan.h.d@swipnet.se>
3157
3d29b2ce 3158 * nsterm.m (not_in_argv): New function.
fc0c31f8 3159 (application:openFile, application:openTempFile:):
3d29b2ce
JD
3160 (application:openFileWithoutUI:, application:openFiles:): Open file
3161 if not_in_argv returns non-zero (bug#12171).
3162
32bcadb4 3163 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
3164 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
3165 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
3166 (xg_get_font_name): Use those functions/macros here.
3167 Reported by Frans Oilinki <moilinki@gmail.com>.
3168
9ff9402d 31692012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
3170
3171 * unexmacosx.c (copy_data_segment): Copy initialized data in
3172 statically linked libraries from input file rather than memory.
3173
db74a5fc
YM
3174 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
3175 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
3176 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
3177
25e65510
GM
31782012-08-10 Glenn Morris <rgm@gnu.org>
3179
3180 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
3181 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
3182
7961135c
DA
31832012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3184
3185 Fix last change to allow compilation with low optimization levels.
3186 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
3187 Reported by Jan Djärv <jan.h.d@swipnet.se>.
3188
42b3a444
DA
31892012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3190
3191 Use common inline syntax in intervals.h.
3192 * intervals.h (INTERVALS_INLINE): New macro.
3193 Change all users from LISP_INLINE.
3194
9fb0c957
DA
31952012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3196
3197 Define Qnone once for all platforms.
3198 * frame.c (Qnone): Define here.
3199 (syms_of_frame): DEFSYM it.
3200 * lisp.h (Qnone): New declaration.
3201 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
3202 * xfns.c: Remove duplication. Adjust users.
3203
65e8ee52
DA
32042012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3205
3206 Remove unused macros from intervals.h.
3207 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
3208 * intervals.c: Adjust comment.
3209
9b855fd6
EZ
32102012-08-10 Eli Zaretskii <eliz@gnu.org>
3211
3212 * w32fns.c <w32_unicode_gui>: New static variable.
3213 (globals_of_w32fns): Initialize it according to os_subtype.
3214 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3215 testing os_subtype.
3216
39cb9e56 32172012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
3218 Eli Zaretskii <eliz@gnu.org>
3219
3220 Fix bug #10299 with Unicode characters sent by customized
3221 keyboards created by MSKLC.
3222 * w32fns.c (INIT_WINDOW_CLASS): New macro.
3223 (w32_init_class): Use it to initialize the Emacs class with either
3224 ANSI or Unicode API calls.
3225 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3226 later.
3227 (w32_wnd_proc): If the character code sent by WM_CHAR or
3228 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3229 original message. Call DefWindowProcW on NT and later.
3230
9374581a
GM
32312012-08-10 Glenn Morris <rgm@gnu.org>
3232
4b94e8cf
GM
3233 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3234
9374581a
GM
3235 * lisp.h (DIRECTORY_SEP): Let configure set it.
3236
a2752828
DA
32372012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
3238
3239 Use TSET for write access to Lisp_Object slots of struct terminal.
3240 * termhooks.h (TSET): New macro.
3241 * coding.c, terminal.c, xselect.c: Adjust users.
3242
cc92c454
SM
32432012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
3244
3245 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
3246 the failing expression, include them in the error message.
3247 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3248 * lisp.h (internal_condition_case_n): Update declaration.
3249
4cb3e6b3
DA
32502012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3251
3252 Inline functions to examine and change buffer overlays.
3253 * buffer.c (unchain_both): New function.
3254 * buffer.h (buffer_get_overlays, buffer_set_overlays):
3255 (buffer_has_overlays): New function.
3256 (enum overlay_type): New enum.
3257 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3258 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3259
8707c1e5
DA
32602012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3261
3262 Inline functions to examine and change buffer intervals.
3263 * alloc.c (mark_interval_tree): Remove.
3264 (MARK_INTERVAL_TREE): Simplify.
3265 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
3266 * intervals.c (buffer_balance_intervals): New function.
3267 (graft_intervals_into_buffer): Adjust indentation.
3268 (set_intervals_multibyte): Simplify.
3269 * buffer.h (BUF_INTERVALS): Remove.
3270 (buffer_get_intervals, buffer_set_intervals): New function.
3271 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3272 * intervals.c, textprop.c: Adjust users.
3273
ad8c997f
DA
32742012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3275
3276 Inline functions to examine and change string intervals.
3277 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3278 (string_get_intervals, string_set_intervals): New function.
3279 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3280 * lread.c, print.c, textprop.c: Adjust users.
3281
32ac3a6b
GM
32822012-08-08 Glenn Morris <rgm@gnu.org>
3283
3284 * lisp.mk (lisp): Remove language/persian.elc.
3285
77c7bcb1
DA
32862012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3287
3288 Cleanup intervals.
3289 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3290 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
3291 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3292 Adjust comment. Move under #if 0.
77c7bcb1
DA
3293 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3294 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3295
9c08a8d4
DA
32962012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3297
3298 Check total length of intervals with eassert.
3299 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3300 * intervals.c: Change all users to eassert.
3301
26d16b35
EZ
33022012-08-07 Eli Zaretskii <eliz@gnu.org>
3303
14ae4239
BT
3304 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
3305 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
3306 INTERNAL_FIELD in Lisp_Cons.
3307
c644523b
DA
33082012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3309
3310 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
3311 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
3312 name since all xname users are fixed long time ago. Do not
3313 use INTERNAL_FIELD.
3314 (set_symbol_name, set_symbol_function, set_symbol_plist):
3315 (set_symbol_next, set_overlay_plist): New function.
3316 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
3317 (struct Lisp_Overlay): Likewise.
3318 (CVAR, MVAR, SVAR): Remove.
3319 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
3320 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
3321 * xterm.c: Adjust users.
3322 * .gdbinit: Change to use name field of struct Lisp_Symbol
3323 where appropriate.
3324
6a3d20cc
DA
33252012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3326
3327 Basic functions to set Lisp_Object and pointer slots of intervals.
3328 * intervals.h (interval_set_parent, interval_set_object):
3329 (interval_set_left, interval_set_right, interval_set_plist):
3330 (interval_copy_parent): New function.
3331 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
3332 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
3333 Adjust indentation.
6a3d20cc
DA
3334 (INTERVAL_SIZE): Remove. Adjust users.
3335 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3336
4d2b044c
DA
33372012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3338
3339 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3340 * process.h (PGET): Remove.
3341 (struct Lisp_Process): Do not use INTERNAL_FIELD.
3342 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3343
d3d50620
DA
33442012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3345
3346 Drop WGET and revert read access to Lisp_Objects slots of struct window.
3347 * window.h (WGET): Remove.
3348 (struct window): Do not use INTERNAL_FIELD.
3349 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3350 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3351 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3352 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3353 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3354 Adjust users.
3355
d10a51dc
CY
33562012-08-07 Chong Yidong <cyd@gnu.org>
3357
3358 * window.c (Fwindow_edges, Fwindow_pixel_edges)
3359 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3360 (Fdelete_window_internal): Signal an error if the window is not on
3361 a live frame (Bug#12025).
3362
e69b0960
DA
33632012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3364
3365 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3366 * frame.h (FGET): Remove.
3367 (struct frame): Do not use INTERNAL_FIELD.
3368 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3369 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3370 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3371 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3372
25a20a3a
JB
33732012-08-06 Juanma Barranquero <lekktu@gmail.com>
3374
3375 * w32.c: Silence compiler warnings.
3376 (map_w32_filename): Remove unused variable `is_fat'.
3377 (chase_symlinks): Add parentheses around expression.
3378
1c6f11f4
GM
33792012-08-06 Glenn Morris <rgm@gnu.org>
3380
1db4583a
GM
3381 * sysdep.c: Respect BROKEN_GETWD.
3382
1c6f11f4
GM
3383 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3384 Let configure handle it.
3385 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3386
2b90362b
DA
33872012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3388
3389 Use GCALIGNMENT where appropriate.
3390 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3391 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3392 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3393
5f50daf2
EZ
33942012-08-06 Eli Zaretskii <eliz@gnu.org>
3395
14ae4239
BT
3396 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3397 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 3398
cbcc7007
SM
33992012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3400
3401 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3402 that should be sufficient for everyone.
3403
4d365fa4
JD
34042012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3405
3406 * keyboard.c (timer_check_2): Add break so timer_check returns next
3407 timeout.
3408
dd86bd82
DA
34092012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3410
3411 Fix Windows build errors introduced after converting to WGET and WSET.
3412 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3413 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3414
054e1668
JD
34152012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3416
3417 * nsterm.m (ns_frame_rehighlight): Use FSET.
3418
3419 * nsmenu.m (ns_update_menubar): Use FSET.
3420
21238f11
DA
34212012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3422
3423 Separate read and write access to Lisp_Object slots of Lisp_Process.
3424 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3425 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3426
077288cf
DA
34272012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3428
3429 Separate read and write access to Lisp_Object slots of struct window.
3430 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3431 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3432 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3433 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3434 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3435 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3436 Adjust users.
3437
71688bd7
DA
34382012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3439
3440 Fix Windows build errors introduced after converting to FGET and FSET.
3441 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3442 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3443 (w32_judge_scroll_bars): Change to use FSET.
3444 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3445
f99bac93
DA
34462012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3447
3448 Fix replacement typo.
3449 * window.c (replace_window): Set root_window instead of
3450 selected_window. This fixes a total window subsystem
3451 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3452
8c2a0f2d
GM
34532012-08-06 Glenn Morris <rgm@gnu.org>
3454
3455 * lisp.mk (lisp): Add language/persian.elc.
3456
edd74c35
DA
34572012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3458
3459 Separate read and write access to Lisp_Object slots of struct frame.
3460 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3461 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3462 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3463 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3464 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3465
8671676c
AS
34662012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3467
3468 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3469
663e2b3f
DA
34702012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3471
3472 Generalize common compile-time constants.
3473 * lisp.h (header_size, bool_header_size, word_size): Now here.
3474 (struct Lisp_Vector): Add comment.
3475 (struct Lisp_Bool_Vector): Move up to define handy constants.
3476 (VECSIZE, PSEUDOVECSIZE): Simplify.
3477 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3478 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3479 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3480 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3481 * xfont.c, xmenu.c: Use word_size where appropriate.
3482
d32e47af
LM
34832012-08-05 Lawrence Mitchell <wence@gmx.li>
3484
3485 * search.c (Freplace_match): Treat \? in the replacement text
3486 literally (Bug#8161).
3487
e5d9c0d1
CY
34882012-08-05 Chong Yidong <cyd@gnu.org>
3489
3490 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3491 * frame.c (Vdelete_frame_functions):
3492 * emacs.c (Vkill_emacs_hook): Doc fix.
3493
8da0576b
EZ
34942012-08-04 Eli Zaretskii <eliz@gnu.org>
3495
3496 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3497 --with-x-toolkit=no builds.
3498 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3499
02676e5d
CY
35002012-08-04 Chong Yidong <cyd@gnu.org>
3501
3502 * syntax.c (Fmodify_syntax_entry): Doc fix.
3503
97147da9
EZ
35042012-08-04 Eli Zaretskii <eliz@gnu.org>
3505
76151e2c
EZ
3506 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3507 * w32.c (init_environment): Change the default values of many
3508 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
3509 them into environment when they were not already defined.
3510 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 3511 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
3512 (check_windows_init_file): Now external, not static.
3513 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
3514 called when Vload_path is already set up.
3515
3516 * w32.h (check_windows_init_file): Add prototype.
3517
3518 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3519 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3520 compatibility with Posix platforms.
3521 (main): Move the call to check_windows_init_file to here from
3522 w32.c.
3523 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3524 any, in the DEFALT argument into the root of the Emacs build or
3525 installation tree, as appropriate.
3526
3527 * callproc.c (init_callproc_1): Call decode_env_path instead of
3528 doing its equivalent by hand.
3529 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3530 the code that sets Vexec_path run on MS-Windows.
3531
3532 * lread.c (init_lread): Add comments to #ifdef's.
3533
97147da9
EZ
3534 * msdos.c (dos_set_window_size, IT_update_begin)
3535 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3536 instead of direct references.
3537
185ee146
PE
35382012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3539
3540 Export DEFAULT_REHASH_* to GDB.
3541 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3542 Now constants, not macros.
3543
8834c57a
PE
35442012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3545
98c6f1e3
PE
3546 Remove unnecessary casts involving pointers.
3547 These casts are no longer needed now that we assume C89 or later,
3548 since they involve casting to or from void *.
3549 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3550 (make_pure_float, make_pure_vector):
3551 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3552 * macros.c (Fstart_kbd_macro):
3553 * menu.c (find_and_return_menu_selection):
3554 * minibuf.c (read_minibuf_noninteractive):
3555 * sysdep.c (closedir):
3556 * xdisp.c (x_produce_glyphs):
3557 * xfaces.c (compare_fonts_by_sort_order):
3558 * xfns.c (x_real_positions, select_visual):
3559 * xselect.c (x_stop_queuing_selection_requests)
3560 (x_get_window_property, x_get_window_property_as_lisp_data):
3561 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3562 Remove unnecessary pointer casts.
3563 * alloc.c (record_xmalloc): New function.
3564 * lisp.h (record_xmalloc): New decl.
3565 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3566 more like a function. This is because the pointer cast is not
3567 needed. All uses changed.
3568 * print.c (print_string, print_error_message): Avoid length recalc.
3569
8834c57a
PE
3570 Improve fix for macroexp crash with debugging (Bug#12118).
3571 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3572 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3573 not supposed to be invoked from the garbage collector.
3574 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3575 (gc_aset): New function, which is like ASET but can be
3576 used in the garbage collector.
3577 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3578 (set_hash_index): Use it instead of ASET.
3579
6dad7178
EZ
35802012-08-03 Eli Zaretskii <eliz@gnu.org>
3581
3582 Support symlinks on latest versions of MS-Windows.
3583 * w32.c: Include winioctl.h and aclapi.h.
3584 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3585 (revert_to_self): Forward declarations of static functions.
3586 <static BOOL g_b_init_get_security_info>:
3587 <g_b_init_create_symbolic_link>: New static flags.
3588 (globals_of_w32): Initialize them to zero.
3589 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3590 (map_w32_filename): Improve commentary. Simplify switch.
3591 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3592 headers (most versions of MinGW w32api don't).
3593 (get_security_info, create_symbolic_link)
3594 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3595 New functions.
3596 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3597 in the argument file name.
3598 (sys_access): Call unc_volume_file_attributes only if
3599 GetFileAttributes fails with network-related error codes.
3600 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3601 have the required privileges.
14ae4239 3602 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
3603 get_file_security_desc.
3604 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
3605 with addition of handling of symlinks and support for 'lstat'.
3606 If possible, get file's attributes and security information by
6dad7178
EZ
3607 handle, not by name. Produce S_IFLNK bit for symlinks, when
3608 called from 'lstat'.
3609 (stat, lstat): New functions, call 'stat_worker'.
3610 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3611 symlinks when the underlying filesystem supports them.
3612
f162bcc3
PE
36132012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3614
79ea6c20
PE
3615 Fix macroexp crash on Windows with debugging (Bug#12118).
3616 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3617 checking subscripts; problem introduced with the recent
3618 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3619 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3620 since it's used in non-static inline functions now.
3621
c0ce93fd
PE
3622 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3623 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 3624
f162bcc3
PE
3625 Use C99-style 'extern inline' if available.
3626 * buffer.h (BUFFER_INLINE):
3627 * category.h (CATEGORY_INLINE):
3628 * character.h (CHARACTER_INLINE):
3629 * charset.h (CHARSET_INLINE):
3630 * composite.h (COMPOSITE_INLINE):
3631 * dispextern.h (DISPEXTERN_INLINE):
3632 * lisp.h (LISP_INLINE):
3633 * systime.h (SYSTIME_INLINE):
3634 New macro, replacing 'static inline' in this header.
3635 * buffer.h, category.h, character.h, charset.h, composite.h:
3636 * dispextern.h, lisp.h, systime.h:
3637 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3638 * alloc.c (LISP_INLINE):
3639 * buffer.c (BUFFER_INLINE):
3640 * category.c (CATEGORY_INLINE):
3641 * character.c (CHARACTER_INLINE):
3642 * charset.c (CHARSET_INLINE):
3643 * composite.c (COMPOSITE_INLINE):
3644 * dispnew.c (DISPEXTERN_INLINE):
3645 * sysdep.c (SYSTIME_INLINE):
3646 Define to EXTERN_INLINE, so that the corresponding functions
3647 are compiled into code.
3648 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3649 (INLINE_HEADER_END): New macros.
3650 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3651 since it's used in non-static inline functions now.
a8333d03 3652 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 3653
837b365b
GM
36542012-08-02 Glenn Morris <rgm@gnu.org>
3655
d66b744d
GM
3656 * s/: Remove empty directory.
3657
837b365b
GM
3658 * s/ms-w32.h: Move to ../nt/inc.
3659 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3660 Update for new ms-w32.h location.
3661
13294f95
PE
36622012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3663
3664 Port to Solaris 8.
3665 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3666
90df0db3
GM
36672012-08-02 Glenn Morris <rgm@gnu.org>
3668
3669 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3670 hard-coding the path separator.
3671
4939150c
PE
36722012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3673
3674 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3675 This how ASET and AREF are supposed to work, and makes
3676 it easier to think about future improvements. See
3677 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3678 * charset.h (set_charset_attr): New function.
3679 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3680 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3681 (aref_addr): New function. All uses of &AREF(...) changed.
3682 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3683 (set_hash_index): New functions. All lvalue-style uses of
3684 HASH_KEY etc. changed.
3685 * keyboard.c (set_prop): New function. All lvalue-style uses
3686 of PROP changed.
3687
947b2afd
AA
36882012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3689
3690 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3691 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3692 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3693 * nsfns.m (ns_set_name_as_filename): Likewise.
3694 * nsmenu.m (ns_update_menubar): Likewise.
3695 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3696
4f5d0325
EZ
36972012-08-01 Eli Zaretskii <eliz@gnu.org>
3698
2008beae
EZ
3699 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3700 Adapt to latest changes in field names of the corresponding Lisp
288479f6 3701 objects.
2008beae 3702
4f5d0325
EZ
3703 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3704
fe3cc771
GM
37052012-08-01 Glenn Morris <rgm@gnu.org>
3706
3707 * s/msdos.h: Remove file.
3708 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3709 * Makefile.in (S_FILE): Remove.
3710 (config_h): Remove S_FILE.
3711
c90acc54
JB
37122012-08-01 Juanma Barranquero <lekktu@gmail.com>
3713
3714 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3715 Remove; moved to nt/config.nt.
3716
d8a05828
DA
37172012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3718
3719 Use INTERNAL_FIELD for conses and overlays.
3720 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3721 Remove obsolete comment.
3722 (MVAR): New macro.
3723 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3724 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3725
8271d590
DA
37262012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3727
3728 Use INTERNAL_FIELD for symbols.
3729 * lisp.h (SVAR): New macro. Adjust users.
3730 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3731 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3732
3193acd2
DA
37332012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3734
3735 Use INTERNAL_FIELD for processes.
3736 * process.h (PVAR): New macro. Adjust style.
3737 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3738 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3739
3a45383a
DA
37402012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3741
3742 Use INTERNAL_FIELD for windows.
3743 * window.h (WVAR): New macro.
3744 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3745 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3746 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3747 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3748 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3749 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3750
c1dbc63c
PE
37512012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3752
3753 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3754
5c0c0e8a
GM
37552012-08-01 Glenn Morris <rgm@gnu.org>
3756
3757 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3758 Move to configure.ac.
3759
552a99b4
JB
37602012-08-01 Juanma Barranquero <lekktu@gmail.com>
3761
3762 * makefile.w32-in (CONFIG_H): Update dependencies.
3763 (CONF_POST_H): New macro.
3764
3765 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3766
8d8e2dfe
GM
37672012-07-31 Glenn Morris <rgm@gnu.org>
3768
bc96620a
GM
3769 * Makefile.in (S_FILE): No longer set by configure.
3770
476b1b2d
GM
3771 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3772 is available.
3773 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3774
b2c7a106
GM
3775 * process.h (NULL_DEVICE):
3776 * emacs.c (SEPCHAR):
3777 * editfns.c (USER_FULL_NAME): Let configure set them.
3778
d53d062a
GM
3779 * s/README, s/template.h: Remove files.
3780
4515017f
GM
3781 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3782
8d8e2dfe
GM
3783 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3784 Move to configure.ac.
3785
5b20b3cc
EZ
37862012-07-31 Eli Zaretskii <eliz@gnu.org>
3787
1e0afd9a
EZ
3788 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3789 resulting renaming of 'struct frame' members.
3790
5b20b3cc
EZ
3791 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3792
3793 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3794 after introduction of FVAR.
3795
f1310128
JD
37962012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3797
79e721e0
JD
3798 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3799
3800 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3801 instead of compositeToPoint.
3802 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3803
8d7c7eed 3804 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 3805
e34f7f79
DA
38062012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3807
3808 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3809 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 3810 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
3811 (BVAR): Change to use INTERNAL_FIELD.
3812 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3813 (KVAR): Change to use INTERNAL_FIELD.
3814 * frame.h (FVAR): New macro.
3815 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
3816 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3817 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3818 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
3819 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3820
c09bfb2f
DA
38212012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3822
3823 Miscellaneous fixes for non-default X toolkits.
3824 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3825 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3826 Move under #ifdef USE_LUCID.
3827 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3828 definition and usage to avoid warnings.
3829
14c114ae
JD
38302012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3831
3832 * nsterm.m (openFiles): Fix previous checkin.
3833
3bd21e82
PE
38342012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3835
3836 * indent.c (compute_motion): Remove unused local.
3837
c1529ded
GM
38382012-07-31 Glenn Morris <rgm@gnu.org>
3839
400d5621
GM
3840 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3841
268e2432
GM
3842 * conf_post.h [USG5_4]:
3843 Move remaining contents of s/usg5-4-common.h here.
3844 * s/usg5-4-common.h: Remove file.
3845
7552f3ee
GM
3846 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3847 * s/irix6-5.h: Remove file.
3848
6a381852
GM
3849 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3850 * s/darwin.h: Remove file.
3851
c1529ded
GM
3852 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3853 * s/hpux10-20.h: Remove file, which is now empty.
3854
b429a4ee
GM
38552012-07-30 Glenn Morris <rgm@gnu.org>
3856
3857 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3858 * Makefile.in (config_h): Add conf_post.h.
3859 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3860
adff3182
JD
38612012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3862
3863 * nsterm.m (ns_do_open_file): New variable.
b9031d69 3864 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
3865 (openFile, openTempFile, openFileWithoutUI, openFiles):
3866 Open files only if ns_do_open_file.
adff3182 3867
c32af1e4
PE
38682012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3869
7393bcbb
PE
3870 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3871 This no-op macro hasn't been needed for many years.
3872 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3873
c32af1e4
PE
3874 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3875 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3876 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3877 gdb_make_enums_visible.
3878 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3879 (DIRECTORY_SEP): Now a constant, not a macro.
3880
302fc036
EZ
38812012-07-30 Eli Zaretskii <eliz@gnu.org>
3882
3883 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3884 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3885
3886 * w32term.c <w32_keyboard_codepage>: Renamed from
3887 keyboard_codepage and now external. All users changed.
3888
3889 * w32term.h: Add declaration of w32_keyboard_codepage.
3890
3891 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3892 the codepage to translate keys to Unicode. If this argument is
3893 -1, use the value returned by GetConsoleCP. All callers changed.
3894
88fb40b4
PE
38952012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3896
0aee6912
PE
3897 Update .PHONY listings in makefiles.
3898 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3899 bootstrap-clean, distclean, maintainer-clean, versioclean,
3900 extraclean, frc.
3901
88fb40b4
PE
3902 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3903 This is a bit clearer. Fix some commentary typos.
3904
0a763bd1
GM
39052012-07-30 Glenn Morris <rgm@gnu.org>
3906
32bac6d6
GM
3907 * s/netbsd.h: Let configure include signal.h if needed.
3908 Remove file, which is now empty.
3909
b65e7c46
GM
3910 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3911 Let configure set them.
3912 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3913 No more need to undefine.
0a763bd1 3914
169304bd
AS
39152012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3916
3917 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3918 non-single-byte char when adding meta modifier. (Bug#12090)
3919
6cd7a139
DA
39202012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3921
3922 Convert safe_call to use variable number of arguments.
3923 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3924 (safe_call2): Fix comment.
3925 * lisp.h (safe_call): Adjust prototype.
3926 * coding.c (encode_coding_object): Change to use safe_call2.
3927 * xfaces.c (merge_face_heights): Change to use safe_call1.
3928
d34d6ffc
GM
39292012-07-30 Glenn Morris <rgm@gnu.org>
3930
7b8a48e4 3931 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 3932 does that unconditionally. Remove file, which is now empty.
7b8a48e4 3933
d34d6ffc
GM
3934 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3935 Remove empty files.
3936
03a660a6
PE
39372012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3938
3939 Export to GDB most of lisp.h's remaining object-like macros.
3940 * lisp.h (min, max): Move earlier, because they're used earlier now.
3941 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3942 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3943 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3944 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3945 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3946 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3947 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3948 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3949 Now constants, for GDB. They need not be macros.
3950 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3951 Now constants, for GDB, as well as macros, for static initializers.
3952 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3953 Move to after the definition of struct Lisp_Char_Table,
3954 since the former now needs that type defined.
3955 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3956 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3957 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3958 New enums, for gdb_make_enums_visible.
3959 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 3960 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
3961 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3962 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3963 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3964 enum maxargs, enum MAX_ALLOCA.
3965 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3966 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3967 no longer needed, now that they are done in lisp.h.
3968
e499d0ee
DA
39692012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3970
3971 Cleanup string bytes checking.
3972 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3973 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3974 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3975 (check_sblock, compact_small_strings): Simplify.
3976
d5040d2d
PE
39772012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3978
3979 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3980 These macros are confusing and no longer need to be defined, as
3981 the enum values now suffice. All uses replaced with definiens.
3982 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3983
7f259ae6
JB
39842012-07-29 Juanma Barranquero <lekktu@gmail.com>
3985
3986 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3987 ($(BLD)/w32console.$(O)): Update dependencies.
3988
7e63e0c3
DA
39892012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3990
3991 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3992 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3993 time. Adjust users.
3994 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3995
ffd817eb
JD
39962012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3997
3998 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3999 setting sitelisp (Bug#12010).
4000
417a7a0e
EZ
40012012-07-29 Eli Zaretskii <eliz@gnu.org>
4002
14ae4239 4003 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
4004
4005 * w32heap.c (cache_system_info):
4006 * w32.c (sys_rename):
4007 * w32proc.c (find_child_console, sys_kill): All users changed.
4008
387d4d92
PE
40092012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4010
4011 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4012
55a6cca6
EZ
40132012-07-29 Eli Zaretskii <eliz@gnu.org>
4014
4015 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
4016
dbcf001c
DA
40172012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4018
4019 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
4020 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
4021 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 4022
e2688e4a
DA
40232012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4024
4025 Generalize marker debugging code under MARKER_DEBUG and use eassert.
4026 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
4027 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
4028 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
4029 (replace_range, replace_range_2, del_range_2): Change to eassert.
4030 * marker.c (byte_char_debug_check): Adjust style.
4031
b46a6a83
PE
40322012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4033
4034 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4035 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4036 long-ago-commented-out code that talks about "WIN32".
4037 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4038 All uses changed.
4039
e32a5799
PE
40402012-07-28 Paul Eggert <eggert@cs.ucla.edu>
4041
4042 Use Gnulib stdalign module (Bug#9772, Bug#9960).
4043 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4044 Simplify by using alignof.
4045 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4046 * lisp.h: Include <stdalign.h>.
4047 (GCALIGNMENT): New macro and constant.
4048 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
4049 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4050 (stdalign): New macro, if not already defined.
4051
df81cd29
EZ
40522012-07-28 Eli Zaretskii <eliz@gnu.org>
4053
01bd1b0d
EZ
4054 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
4055 * w32inevt.c: Include w32inevt.h.
4056 (w32_read_console_input): New inline function, calls either
4057 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4058 w32_console_unicode_input.
4059 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4060 (w32_kbd_patch_key, key_event): Use the codepage returned by
4061 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4062 (key_event): use uChar.UnicodeChar only if
4063 w32_console_unicode_input is non-zero.
4064
4065 * w32console.c: Include w32heap.h.
4066 <w32_console_unicode_input>: New global variable.
4067 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4068 family of Windows, zero otherwise.
4069
4070 * w32inevt.h: Declare w32_console_unicode_input.
4071
df81cd29
EZ
4072 * xdisp.c (init_iterator): Don't reference tip_frame in a build
4073 --without-x. (Bug#11742)
4074
c20fdd9e
PE
40752012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4076
4077 Adjust GDB to reflect pvec_type changes (Bug#12036).
4078 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
4079 2012-07-04 changes to pseudovector representation.
4080 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 4081
32770973 40822012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
4083
4084 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4085 bus address.
4086 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4087
3438fe21
EZ
40882012-07-27 Eli Zaretskii <eliz@gnu.org>
4089
bcfbc9de
EZ
4090 * alloc.c (listn): Fix the order the arguments are consed onto the
4091 list.
4092
3438fe21
EZ
4093 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4094 enumeration constants, as PURE and HEAP are too general, and clash
4095 with other headers and sources, such as gmalloc.c and the
4096 MS-Windows system headers. All users changed.
4097
eeaea515
DA
40982012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4099
4100 Revert last save_excursion_save and save_excursion_restore changes.
4101 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4102 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4103
073c88c2
DA
41042012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4105
4106 Fix recently-introduced typos in Windows port.
4107 Reported by Martin Rudalics <rudalics@gmx.at>.
4108 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 4109 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 4110
4706125e
PE
41112012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4112
4113 Improve GDB symbol export (Bug#12036).
4114 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4115 arms of an 'if', not using conditional expressions; otherwise GDB
4116 complains about the types in the unevaluated arm when the argument
4117 is an integer literal.
4118 (xgetint): Simplify expression.
4119 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4120 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4121 Zaretskii in <http://bugs.gnu.org/12036#13>.
4122 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4123 needed now that we have gdb_make_enums_visible.
4124 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4125 (enum enum_USE_LSB_TAG):
4126 New enum types, packaging up enums that need to be exported to GDB.
4127
694b6c97
DA
41282012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4129
4130 Utility function to make a list from specified amount of objects.
4131 * lisp.h (enum constype): New datatype.
4132 (listn): New prototype.
4133 * alloc.c (listn): New function.
4134 (Fmemory_use_count, syms_of_alloc): Use it.
4135 * buffer.c (syms_of_buffer): Likewise.
4136 * callint.c (syms_of_callint): Likewise.
4137 * charset.c (define_charset_internal): Likewise.
4138 * coding.c (syms_of_coding): Likewise.
4139 * keymap.c (syms_of_keymap): Likewise.
4140 * search.c (syms_of_search): Likewise.
4141 * syntax.c (syms_of_syntax): Likewise.
4142 * w32.c (init_environment): Likewise.
4143 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4144 * xdisp.c (syms_of_xdisp): Likewise.
4145 * xfns.c (syms_of_xfns): Likewise.
4146
6195f384
DA
41472012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4148
4149 Fast save_excursion_save and save_excursion_restore.
4150 * lisp.h (struct Lisp_Excursion): New data type.
4151 (PVEC_EXCURSION): New pseudovector type.
4152 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
4153 to deal with it. Adjust comments.
4154 (init_marker, attach_marker): New prototype.
4155 (unchain_marker): Adjust prototype.
4156 * marker.c (attach_marker): Change to global.
4157 (init_marker): New function.
4158 * alloc.c (Fmake_marker, build_marker): Use it.
4159 (build_marker): More easserts.
4160 (mark_object): Handle struct Lisp_Excursion.
4161 * editfns.c (save_excursion_save, save_excursion_restore):
4162 Reimplement to use struct Lisp_Excursion. Add comments.
4163
5eceb8fb
PE
41642012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4165
4166 Fix export of symbols to GDB (Bug#12036).
4167 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
4168 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
4169 emacs.c, as this is a more-suitable home. Had this been done earlier
4170 the fix for 12036 would have avoided some of the problems noted in
4171 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
4172 would have been more obvious.
562157c8
PE
4173 * emacs.c: Do not include <verify.h>; no longer needed.
4174 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
4175 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
4176 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4177 Remove; now done in lisp.h.
4178 * lisp.h (PUBLISH_TO_GDB): New macro.
4179 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
4180 (DATA_SEG_BITS): Use it.
4181 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
4182 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
4183 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
4184 not be usable in #if. This simplifies things.
4185
d6749401
JB
41862012-07-26 Juanma Barranquero <lekktu@gmail.com>
4187
4188 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
4189
1781b9e9
PE
41902012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4191
d89518db 4192 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
4193 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
4194 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
4195 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
4196 Adjust to changes in lisp.h and emacs.c, by using
4197 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
4198 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
4199 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
4200 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
4201 instead of gdb_valbits.
4202 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
4203 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
4204 instead of gdb_array_mark_flag.
4205 (xboolvector): Get size from $->size, not $->header.size.
4206 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
4207 (xreload, hook-run, hookpost-run): Remove.
4208 * emacs.c: Include <verify.h>.
4209 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
4210 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
4211 Remove.
4212 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
4213 (gdb_USE_LSB_TAG): New enum constants.
4214 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4215 Also define these as enum constants, so they're visible to GDB.
4216 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4217 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4218 as constants, so they're visible to GDB.
4219 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4220 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4221 Now enum constants, not macros, so they're visible to GDB.
4222 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4223 more convenient now. All uses changed.
4224 (VALMASK) [USE_LSB_TAG]: Also define in this case.
4225 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4226
3628596a
DA
42272012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
4228
4229 Explicitly free restriction data that are not needed anymore.
4230 * editfns.c (save_restriction_restore): Free restriction data.
4231
7abaf5cc
SM
42322012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
4233
4234 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4235 add argument, tune behavior, and adjust all callers.
4236
71f88e00
PE
42372012-07-25 Paul Eggert <eggert@cs.ucla.edu>
4238
4239 Use typedef for EMACS_INT, EMACS_UINT.
4240 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4241 than macros. This simplifies debugging in the usual case, since
4242 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4243 and it allows expressions involving EMACS_INT casts.
4244 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4245
57ec3034
JD
42462012-07-25 Jan Djärv <jan.h.d@swipnet.se>
4247
4248 * nsterm.m (ns_read_socket): Return early if there is a modal
4249 window (Bug#12043).
4250
8137e7b3
MR
42512012-07-25 Martin Rudalics <rudalics@gmx.at>
4252
4253 * frame.c (Fredirect_frame_focus): In doc-string don't mention
4254 that FOCUS-FRAME can be omitted.
4255
04e9897c
DA
42562012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
4257
4258 Adjust buffer text indirection counters at the end of Fkill_buffer.
4259 * buffer.c (Fkill_buffer): Adjust indirection counters when the
4260 buffer is definitely dead. This should really fix an issue reported
4261 by Christoph Scholtes again. (Bug#12007).
4262 (init_buffer_once): Initialize indirection counters of
4263 buffer_defaults and buffer_local_symbols (for sanity and safety).
4264
8a0484e1
EZ
42652012-07-24 Eli Zaretskii <eliz@gnu.org>
4266
4267 * xdisp.c (init_iterator): Don't compute dimensions of truncation
4268 and continuation glyphs on tooltip frames, leave them at zero.
4269 Avoids continued lines in tooltips. (Bug#11832)
4270
fa691a83
DA
42712012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
4272
4273 Simplify copy_overlay.
04e9897c 4274 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
4275 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4276
436bc8e0
EZ
42772012-07-23 Eli Zaretskii <eliz@gnu.org>
4278
4279 * print.c (print_object): Don't crash when a frame's name is nil
4280 or invalid. (Bug#12025)
4281
4282 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4283 it signals an error when a tooltip frame is being created.
4284
d7a7fda3
DA
42852012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4286
4287 Cleanup miscellaneous objects allocation and initialization.
4288 * alloc.c (allocate_misc): Change to static. Add argument to
4289 specify the subtype. Adjust comment and users.
4290 (build_overlay): New function.
4291 * buffer.c (copy_overlays, Fmake_overlay): Use it.
4292 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4293 (allocate_misc): Remove prototype.
4294 (build_overlay): Add prototype.
4295
42962012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
4297
4298 Swap buffer text indirection counters in Fbuffer_swap_text.
4299 * buffer.c (Fbuffer_swap_text): Swap indirections too.
4300 This avoids crash reported by Christoph Scholtes at
4301 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4302
9d7fa573
JD
43032012-07-22 Jan Djärv <jan.h.d@swipnet.se>
4304
4305 * nsmenu.m (Popdown_data): New struct.
4306 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
4307 free Popdown_data.
4308 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
4309 (initWithContentRect): Make imgView and contentView non-static
4310 and autorelease them. Also autorelease img and matrix (Bug#12005).
4311 (dealloc): Remove (Bug#12005).
4312
0dd6d66d
DA
43132012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4314
4315 Adjust consing_since_gc when objects are explicitly freed.
4316 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
4317 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
4318 (free_cons, free_misc): Subtract object size from consing_since_gc.
4319
d36d71df
DA
43202012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4321
4322 Simplify and cleanup markers positioning code.
4323 * marker.c (attach_marker): More useful eassert.
4324 (live_buffer, set_marker_internal): New function.
4325 (Fset_marker, set_marker_restricted): Use set_marker_internal.
4326 (set_marker_both, set_marker_restricted_both): Use live_buffer.
4327
fb9ea40f
PE
43282012-07-22 Paul Eggert <eggert@cs.ucla.edu>
4329
4330 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
4331 as it's limited by the amount of memory, not by INT_MAX.
4332
2d5c5f7d
EZ
43332012-07-21 Eli Zaretskii <eliz@gnu.org>
4334
07fb592e
EZ
4335 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
4336 in special-event-map. See the discussion at
4337 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4338 for the reasons.
4339
37a9eac8 4340 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
4341 info.dwItemData. Fixes crashes on 64-bit Windows.
4342 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 4343
c4328746
JD
43442012-07-21 Jan Djärv <jan.h.d@swipnet.se>
4345
fc0c31f8 4346 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 4347 (conversationIdentifier): Return value is NSInteger.
784051c4 4348 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 4349
6e5d1c12
CY
43502012-07-21 Chong Yidong <cyd@gnu.org>
4351
4352 * window.c (decode_any_window): Signal an error if the window is
4353 on a dead frame (Bug#11984).
4354
9928463d
DA
43552012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4356
4357 Add indirection counting to speed up Fkill_buffer.
4358 * buffer.h (struct buffer): New member.
4359 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4360 (Fmake_indirect_buffer): Set indirection counter to -1, increment
4361 base buffer indirection counter.
4362 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4363 (Fkill_buffer): Adjust indirection counters as needed, don't walk
4364 through buffer list if indirection counter is 0.
4365
f8643a6b
DA
43662012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4367
4368 Extend the value returned by Fgarbage_collect with heap statistics.
4369 * alloc.c (Qheap): New symbol.
4370 (syms_of_alloc): DEFSYM it.
4371 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4372 (Fmemory_free): Remove.
4373 (syms_of_alloc): Don't defsubr it.
4374 * buffer.c (Fcompact_buffer): Remove.
4375 (syms_of_buffer): Don't defsubr it.
4376
dac616ff
DA
43772012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4378
4379 Make maybe_gc inline.
4380 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4381 * lisp.h (consing_since_gc, gc_relative_threshold)
4382 (memory_full_cons_threshold): Revert declaration.
4383 (maybe_gc): Remove prototype, define as inline.
4384 * alloc.c: Remove old commented-out code.
4385 (consing_since_gc, gc_relative_threshold)
4386 (memory_full_cons_threshold): Revert to global.
4387 (maybe_gc): Remove.
4388
d7ea76b4
DA
43892012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4390
4391 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4392 * lisp.h (build_unibyte_string): New function.
4393 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4394 * sysdep.c, w32fns.c, xfns.c: Use it.
4395 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4396 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4397 Adjust users accordingly.
4398 * font.h (font_open_by_name): Adjust prototype.
4399
765e61e3
DA
44002012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4401
4402 Cleanup calls to Fgarbage_collect.
4403 * lisp.h (maybe_gc): New prototype.
4404 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4405 Remove declarations.
4406 * alloc.c (maybe_gc): New function.
4407 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4408 Make them static.
4409 * bytecode.c (MAYBE_GC): Use maybe_gc.
4410 * eval.c (eval_sub, Ffuncall): Likewise.
4411 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4412 to avoid dependency from auto-save feature.
4413
52b852c7
PE
44142012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4415
4416 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4417 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4418 'for_each_per_buffer_object_at'.
4419 All uses changed. It's better to use upper-case for macros that
4420 cannot be implemented as functions, to give the reader a clue
4421 that they're special.
4422
5db81e33
SM
44232012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4424
4425 * alloc.c (Fgarbage_collect): Tweak docstring.
4426
5b835e1d
DA
44272012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4428
4429 Tweak the value returned from Fgarbage_collect again.
4430 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4431 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4432 Adjust documentation.
4433 (total_vector_bytes): Rename to total_vector_slots, adjust
4434 accounting.
4435 (total_free_vector_bytes): Rename to total_free_vector_slots,
4436 adjust accounting.
4437 (Qstring_bytes, Qvector_slots): New symbols.
4438 (syms_of_alloc): DEFSYM them.
4439
9cd47b72
DA
44402012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4441
4442 Buffer compaction primitive which may be used from Lisp.
4443 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4444 (syms_of_buffer): Register Fcompact_buffer.
4445 * alloc.c (Fgarbage_collect): Use compact_buffer.
4446 * buffer.h (compact_buffer): New prototype.
4447 (struct buffer_text): New member.
4448
d17337e5
DA
44492012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4450
4451 New macro to iterate over all buffers, miscellaneous cleanups.
4452 * lisp.h (all_buffers): Remove declaration.
4453 * buffer.h (all_buffers): Add declaration, with comment.
4454 (for_each_buffer): New macro.
4455 * alloc.c (Fgarbage_collect, mark_object): Use it.
4456 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4457 (init_buffer): Likewise.
4458 * data.c (Fset_default): Likewise.
4459 * coding.c (code_conversion_restore): Remove redundant check
4460 for dead buffer.
4461 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4462
60cfd278
AS
44632012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4464
4465 Fix bug that created negative-length intervals.
4466 * intervals.c (merge_interval_right, merge_interval_left):
4467 Do not zero out this interval if it is absorbed by its children,
4468 as this interval's total length doesn't change in that case. See
4469 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4470
d06714cb
PE
44712012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4472
83713154
PE
4473 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4474 when invoking (make-bool-vector N t) and N is a positive
4475 multiple of 8 -- the last 8 bits were mistakenly cleared.
4476
d06714cb
PE
4477 Remove some struct layout assumptions in bool vectors.
4478 * alloc.c (bool_header_size): New constant.
4479 (header_size, word_size): Move earlier, as they're now used earlier.
4480 Use 'word_size' in a few more places, where it's appropriate.
4481 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4482 padding before the data member of a bool vector.
4483 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4484 than doing the check by hand with an abort ().
4485
464d5a5e
SM
44862012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4487
5fbc0409
SM
4488 * eval.c (Fdefvar): Don't check constants since we only set the var if
4489 it's not yet defined anyway (bug#11904).
4490
464d5a5e
SM
4491 * lisp.h (last_undo_boundary): Declare new var.
4492 * keyboard.c (command_loop_1): Set it.
4493 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4494 were auto-added by the command loop (bug#11774).
4495
8dc2e44a
AS
44962012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4497
4498 * w32font.c (Qsymbol): Remove local definition.
4499 (syms_of_w32font): Don't DEFSYM it.
4500
169925ec
DA
45012012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4502
4503 Fix sweep_vectors to handle large bool vectors correctly.
4504 * alloc.c (sweep_vectors): Account total_vector_bytes for
4505 bool vectors larger than VBLOCK_BYTES_MAX.
4506
5fbfb018
CY
45072012-07-18 Chong Yidong <cyd@gnu.org>
4508
4509 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4510 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4511
3ab6e069
DA
45122012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4513
4514 Return more descriptive data from Fgarbage_collect.
4515 Suggested by Stefan Monnier in
4516 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4517 * alloc.c (bounded_number): New function.
4518 (total_buffers, total_vectors): New variable.
4519 (total_string_size): Rename to total_string_bytes, adjust users.
4520 (total_vector_size): Rename to total_vector_bytes, adjust users.
4521 (sweep_vectors): Account total_vectors and total_vector_bytes.
4522 (Fgarbage_collect): New return value. Adjust documentation.
4523 (gc_sweep): Account total_buffers.
4524 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4525 (VECTOR_SIZE): Remove.
4526 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4527 (Qinterval, Qmisc): New symbols.
4528 (syms_of_data): Initialize them.
4529 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4530 (Qcons, Qbuffer): New declarations.
4531
6d02fe5b
PE
45322012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4533
4534 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4535 Round up, not down. Improve doc.
4536
b7ffe040
DA
45372012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4538
4539 Restore old code in allocate_string_data to avoid Faset breakage.
4540 Reported by Julien Danjou <julien@danjou.info> in
4541 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4542 * alloc.c (allocate_string_data): Restore old code with minor
4543 adjustments, fix comment to explain this subtle issue.
4544
4dc7c8d5
SM
45452012-07-17 Eli Zaretskii <eliz@gnu.org>
4546
4547 Remove FILE_SYSTEM_CASE.
4548 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4549
4550 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4551 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4552 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4553 call-process-region passes it through expand-file-name.
4554
4555 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4556
45572012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4558
4559 Fix crash when creating indirect buffer (Bug#11917)
4560 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4561 Don't handle unbound variables specially if non-zero.
4562 (Fbuffer_local_variables): Pass zero.
4563 (clone_per_buffer_values): Pass non-zero.
4564
45652012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4566
4567 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4568 to make the loop interruptible.
4569
45702012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4571
4572 * gnutls.c (emacs_gnutls_handshake): Only retry if
4573 GNUTLS_E_INTERRUPTED.
4574
cce7fefc
DA
45752012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4576
4577 Cleanup and convert miscellaneous checks to eassert.
4578 * alloc.c (mark_interval): Fix comment, partially rephrase
4579 old comment from intervals.h (see below).
4580 * intervals.c (find_interval, adjust_intervals_for_insertion)
4581 (delete_interval, adjust_intervals_for_deletion)
4582 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4583 Convert to eassert.
4584 (adjust_intervals_for_insertion, make_new_interval):
4585 Remove obsolete and unused code.
4586 * intervals.h (struct interval): Remove obsolete comment.
4587 * textprotp.c (erase_properties): Remove unused code.
4588 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4589 (Fremove_list_of_text_properties): Convert to eassert.
4590
9ea10cc3
CY
45912012-07-17 Chong Yidong <cyd@gnu.org>
4592
4593 * editfns.c (Finsert_char): Doc fix.
4594
3900d5de
DA
45952012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4596
4597 Fix previous change to make Fmemory_free always accurate.
4598 * alloc.c (make_interval): Update total_free_intervals.
4599 (make_float): Likewise for total_free_floats.
4600 (free_cons, Fcons): Likewise for total_free_conses.
4601 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4602 Likewise for total_free_vector_bytes.
4603 (Fmake_symbol): Likewise for total_free_symbols.
4604 (bytes_free): Remove.
4605
7098646f
DA
46062012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4607
4608 Simple free memory accounting feature.
4609 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4610 (sweep_vectors): Accumulate size of free vectors.
4611 (Fgarbage_collect): Setup bytes_free.
4612 (Fmemory_free): New function.
4613 (syms_of_alloc): Register it.
4614
22657b40
DA
46152012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4616
4617 Cleanup overlays checking.
4618 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4619 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4620 eassert and OVERLAYP.
4621 (sort_overlays): Change to use OVERLAYP.
4622
ddfc8813
RK
46232012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4624
4625 * editfns.c (Finsert_char): Make it interactive, and make the
4626 second arg optional. Copy interactive spec and docstring from
4627 ucs-insert.
4628
7c26cf3c
PE
46292012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4630
4631 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4632 Unlike the other wrapped functions, fabs has an unspecified
4633 effect on errno.
4634
5d127af9
JD
46352012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4636
4637 * nsterm.m (keyDown): Interpret flags without left/right bits
4638 as the left key (Bug#11670).
4639
6a0dd1d7
DA
46402012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4641
4642 Remove empty and useless init functions.
4643 * lisp.h (init_character_once, init_fns, init_image)
4644 (init_filelock, init_sound): Remove prototype.
4645 * character.c (init_character_once): Remove.
4646 * filelock.c (init_filelock): Likewise.
4647 * fns.c (init_fns): Likewise.
4648 * image.c (init_image): Likewise.
4649 * sound.c (init_sound): Likewise.
4650 * emacs.c (main): Adjust accordingly.
4651
7a6136fd
DA
46522012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4653
4654 * gtkutil.h: Tiny cleanups.
4655 (use_old_gtk_file_dialog): Remove useless declaration.
4656 (xg_uses_old_file_dialog): Add suggested const attribute.
4657
ce811ad9
EZ
46582012-07-15 Eli Zaretskii <eliz@gnu.org>
4659
4660 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4661 (bidi_paragraph_init): Use it to limit search forward for a strong
4662 directional character in abnormally large paragraphs full of
4663 neutral or weak characters. (Bug#11943)
4664
c9adfeaa
SF
46652012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4666
4667 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4668 the toolbar (Bug#9451).
4669 (xg_make_tool_item): Give the widget event box a transparent
4670 background.
4671
fff62aa9
DA
46722012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4673
4674 Cleanup basic allocation variables and functions.
4675 * alloc.c (ignore_warnings, init_intervals, init_float)
4676 (init_cons, init_symbol, init_marker): Remove.
4677 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4678 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4679 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4680 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4681 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4682 (staticidx, init_alloc_once, init_strings, free_ablock):
4683 Remove redundant initialization.
4684 * fns.c (init_weak_hash_tables): Remove.
4685 * lisp.h (init_weak_hash_tables): Remove prototype.
4686
9730daca
DA
46872012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4688
4689 Use zero_vector where appropriate.
4690 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4691 accordingly.
4692 * lisp.h (zero_vector): New declaration.
4693 * font.c (null_vector): Remove.
4694 (syms_of_font): Remove initialization and staticpro.
4695 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4696 * keymap.c (Faccessible_keymaps): Likewise.
4697
2e2d2a13
LL
46982012-07-15 Leo Liu <sdl.web@gmail.com>
4699
4700 * fringe.c: Fix typo in comments.
4701
cd276f6e
LL
47022012-07-14 Leo Liu <sdl.web@gmail.com>
4703
4704 * fringe.c: Add a new bitmap exclamation-mark.
4705
5a1131d9
EZ
47062012-07-14 Eli Zaretskii <eliz@gnu.org>
4707
4708 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4709
4710 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4711 (HAVE_MENUS): Don't define, defined by editing config.in with
4712 msdos/sed2v2.inp.
4713 (GMALLOC_INHIBIT_VALLOC): Don't define.
4714 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4715
22e983b7
JB
47162012-07-14 Juanma Barranquero <lekktu@gmail.com>
4717
4718 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4719
5b3f250f
GM
47202012-07-14 Glenn Morris <rgm@gnu.org>
4721
4722 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4723 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4724 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4725
33d63ff4
GM
47262012-07-13 Glenn Morris <rgm@gnu.org>
4727
5b633342
GM
4728 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4729
33d63ff4
GM
4730 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4731 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4732
b55b9f85
JD
47332012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4734
0dc8cf50
JD
4735 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4736 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4737 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4738 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4739 where appropriate.
4740 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4741 as boolean expression.
4742 (x_set_window_size): Remove unused variable toolbar.
4743 (ns_get_color_default, ns_mod_to_lisp): Remove.
4744 (ns_mouse_position): Remove unused variables xchar and ychar.
4745 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4746 (ns_set_vertical_scroll_bar): Remove unused variable count.
4747 (ns_delete_terminal): Remove unused variable i.
4748 (ns_term_init): Remove unused variables r, g and b.
4749 (mouseDown): Remove unused variable window.
4750 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4751 (initFrameFromEmacs): Remove unused variable vbextra.
4752 (mouseEntered): Remove unused variables p and dpyinfo.
4753 (mouseExited): Remove unused variables p and r.
4754 (ns_define_frame_cursor, ns_clear_frame_area)
4755 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4756 (menuDown): Assign [sender tag] to variable and cast the variable.
4757
4758 * nsterm.h (menuDown): Add id as type to argument sender.
4759 (ns_display_info_for_name): Add Lisp_Object argument.
4760 (ns_term_init): Add Lisp_Object argument.
4761 (ns_map_event_to_object): Add void argument.
4762 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4763 prototype with arguments and only declare if __OBJC__.
4764 (nxatoms_of_nsselect): Add void argument.
4765 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4766 (ns_alloc_autorelease_pool): Add void argument.
4767 (ns_release_autorelease_pool): Add void* argument.
4768 (ns_get_defaults_value): Add const char* argument.
4769
4770 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4771 (initFromContents): Use SSDATA where appropriate.
4772 (ns_update_menubar): Add braces to ambigous if-else.
4773 (initWithTitle): Put () around assignment in if statement.
4774 (ns_menu_show): Remove unused variables window and keymap.
4775 (update_frame_tool_bar): Remove unused variable selected_p.
4776 (initWithContentRect): Remove unused variable this_cmd_name.
4777
4778 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4779 appropriate.
4780 (setXBMColor): Remove unused variable len.
4781 (setPixmapData): Put () around assignment in loop statement.
4782
4783 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4784 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4785 where appropriate.
4786 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4787 around assignment in loop statement.
4788 (nsfont_open): Remove unused variable i.
4789 (nsfont_open): Remove unused variable len.
4790 (nsfont_draw): Remove unused variable cs.
4791
4792 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4793 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4794 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4795 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4796 (Fns_font_name, Fns_perform_service)
4797 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4798 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4799 (ns_set_name): Remove unused variable view.
4800 (x_set_menu_bar_lines): Remove unused variable olines.
4801 (x_set_tool_bar_lines): Remove unused variable root_window.
4802 (Fns_list_colors): Put () around assignment in while statement.
4803 (Fns_perform_service): Remove unused variable len.
4804 (Fns_display_usable_bounds): Remove unused variable top.
4805 (syms_of_nsfns): Remove unused variable i.
4806
b55b9f85
JD
4807 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4808 memcpy (Bug#11907).
4809
ed9265fc 48102012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
4811
4812 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4813 and free it with DestroyExceptionInfo (Bug#11558).
4814
ef099b57
JB
48152012-07-13 Juanma Barranquero <lekktu@gmail.com>
4816
4817 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4818 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4819 Set here, not in nt/config.nt.
4820
ea814a5d
EZ
48212012-07-13 Eli Zaretskii <eliz@gnu.org>
4822
4823 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4824 cursor overflow into the last glyph on display line when the right
4825 fringe is off. (Bug#11832)
4826
1a952767
PE
48272012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4828
4829 * xdisp.c (produce_special_glyphs): Now static.
4830 * dispextern.h (produce_special_glyphs): Remove decl.
4831
983188fd
GM
48322012-07-13 Glenn Morris <rgm@gnu.org>
4833
8d7c7eed 4834 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
4835 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4836
983188fd
GM
4837 * s/usg5-4-common.h (USG, USG5):
4838 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4839 * s/sol2-6.h (SOLARIS2):
4840 * s/irix6-5.h (IRIX6_5):
4841 * s/hpux10-20.h (USG, USG5, HPUX):
4842 * s/gnu-linux.h (USG, GNU_LINUX):
4843 * s/freebsd.h (BSD_SYSTEM):
4844 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4845 * s/cygwin.h (CYGWIN):
4846 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4847 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4848
d1e68667 48492012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
4850
4851 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 4852
6de0e799
GM
48532012-07-13 Glenn Morris <rgm@gnu.org>
4854
739ae010
GM
4855 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4856
dbee5793
GM
4857 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4858
6de0e799
GM
4859 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4860 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4861
b82da769
GM
48622012-07-12 Glenn Morris <rgm@gnu.org>
4863
4fae5a7a 4864 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
4865
4866 * process.c (init_process_emacs): Rename from init_process.
4867 The old name is also the name of a Mach system call.
4868 * lisp.h, emacs.c: Update for this name change.
4869 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4870 longer needed.
4871
5a979817
EZ
48722012-07-12 Eli Zaretskii <eliz@gnu.org>
4873
4874 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4875 memmove call that removes glyphs covered by the left truncation
4876 glyph. Improve commentary.
4877 (display_line): Fix display of continuation glyphs on GUI frames
4878 when the right fringe is turned off and variable-size fonts are
4879 used in the window. Move the code that appends a stretch glyph to
4880 produce_special_glyphs, so that it could be used for truncation
4881 and continuation glyphs alike.
4882 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4883 glyph of a suitably computed width, to align the special glyphs at
4884 the window margin. Code moved from display_line. (Bug#11832)
4885
3e91a053
GM
48862012-07-12 Glenn Morris <rgm@gnu.org>
4887
ba9e4b84
GM
4888 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4889
4890 * s/gnu-linux.h, s/hpux10-20.h:
4891 Do not unconditionally define HAVE_XRMSETDATABASE.
4892
3e91a053
GM
4893 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4894
b300b1f4
PE
48952012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4896
4897 Fix typos that broke OS X build.
4898 Reported by Randal L. Schwartz in
4899 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4900 * nsterm.m (ns_timeout): Add missing local decl.
4901 (ns_get_color): snprintf -> sprintf, to fix typo.
4902
6e777848
GM
49032012-07-12 Glenn Morris <rgm@gnu.org>
4904
3f922c37
GM
4905 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4906 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4907 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4908 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4909
0ab7b23a
GM
4910 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4911 Move PTY_OPEN to configure.
4912
6e777848
GM
4913 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4914 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4915 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4916
4a7edc24
DA
49172012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4918
4919 Use empty_unibyte_string where applicable.
4920 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4921 * lread.c (read1): Likewise.
4922 * xsettings.c (syms_of_xsettings): Likewise.
4923
308aab79
GM
49242012-07-12 Glenn Morris <rgm@gnu.org>
4925
42bd1719
GM
4926 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4927 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
4928 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4929 * s/hpux10-20.h (RUN_TIME_REMAP):
4930 * s/bsd-common.h (TABDLY): Move to configure.
4931
4932 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4933
4934 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4935
ea0bbd17 4936 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 4937 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
4938
4939 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 4940
308aab79
GM
4941 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4942 * s/template.h: Move NARROWPROTO to configure.
4943
ee1cf5cf
GM
49442012-07-11 Glenn Morris <rgm@gnu.org>
4945
30fe9bf4
GM
4946 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4947 unused since 2011-01-17 change to systty.h.
4948
ee1cf5cf
GM
4949 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4950 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4951 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4952
63e47e07
PE
49532012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4954
4955 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4956
c43fb4c3
GM
49572012-07-11 Glenn Morris <rgm@gnu.org>
4958
4959 * s/darwin.h, s/gnu-linux.h, s/template.h:
4960 Move INTERRUPT_INPUT to configure.
4961
e8df9267
DA
49622012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4963
4964 Minor adjustments to interning code.
4965 * lisp.h (intern, intern_c_string): Redefine as static inline
4966 wrappers for intern_1 and intern_c_string_1, respectively.
4967 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
4968 * lread.c (intern_1, intern_c_string_1, oblookup):
4969 Simplify Vobarray checking.
e8df9267
DA
4970 * font.c (font_intern_prop): Likewise. Adjust comment.
4971 * w32font.c (intern_font_name): Likewise.
4972
34348bd4
AS
49732012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4974
d96a1e0c
AS
4975 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4976
34348bd4
AS
4977 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4978 of Fcar/Fcdr if possible.
4979 * font.c (check_otf_features): Likewise.
4980 * fontset.c (Fnew_fontset): Likewise.
4981 * gnutls.c (Fgnutls_boot): Likewise.
4982 * minibuf.c (read_minibuf): Likewise.
4983 * msdos.c (IT_set_frame_parameters): Likewise.
4984 * xmenu.c (Fx_popup_dialog): Likewise.
4985 * w32menu.c (Fx_popup_dialog): Likewise.
4986
c8add24e
GM
49872012-07-11 Glenn Morris <rgm@gnu.org>
4988
4b575b3c
GM
4989 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4990 since nothing has defined it on these platforms.
4991
09f4e3b0
GM
4992 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4993 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4994
172bedef
GM
4995 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4996 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4997 Move CLASH_DETECTION to configure.
4998
249685df
GM
4999 * s/gnu.h: Remove file, which is now empty.
5000
c8add24e
GM
5001 * s/gnu.h, s/gnu-linux.h:
5002 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
5003
b41253a3
JW
50042012-07-11 John Wiegley <johnw@newartisans.com>
5005
5006 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
5007 function attribute, so we only use it if it exists in the
5008 compiler.
5009
d923b542
DA
50102012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5011
5012 Avoid call to strlen in fast_c_string_match_ignore_case.
5013 * search.c (fast_c_string_match_ignore_case): Change to use
5014 length argument. Adjust users accordingly.
5015 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
5016
5ebbef1d
PE
50172012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5018
bb352260
PE
5019 Assume mkdir, rmdir.
5020 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
5021 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
5022
57054ddd
PE
5023 Assume rename.
5024 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
5025
b747d3f7
PE
5026 Assume perror.
5027 * s/hpux10-20.h (HAVE_PERROR): Remove.
5028 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
5029 Remove dummy definition, as this problem was obsolete long ago.
5030
5ebbef1d
PE
5031 Assume strerror.
5032 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5033
984e7f30
DA
50342012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5035
5036 Avoid calls to strlen in font processing functions.
5037 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
5038 (font_open_by_name): Change to use length argument.
5039 Adjust users accordingly.
d923b542
DA
5040 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5041 Adjust prototypes.
5042 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5043 Change to return ptrdiff_t.
984e7f30
DA
5044 (xfont_list_pattern, xfont_match): Use length returned by
5045 xfont_decode_coding_xlfd.
5046 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5047
20e94fdd
GM
50482012-07-11 Glenn Morris <rgm@gnu.org>
5049
9d596af3
GM
5050 * s/darwin.h, s/freebsd.h, s/netbsd.h:
5051 Move DONT_REOPEN_PTY to configure.
5052
20e94fdd
GM
5053 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5054 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5055
e99a530f
PE
50562012-07-10 Paul Eggert <eggert@cs.ucla.edu>
5057
22ffb973
PE
5058 Remove "#define unix" that is no longer needed (Bug#11905).
5059 * s/aix4-2.h (unix): Remove; no longer needed.
5060
e9a9ae03
PE
5061 EMACS_TIME simplification (Bug#11875).
5062 This replaces macros (which typically do not work in GDB)
5063 with functions, typedefs and enums, making the code easier to debug.
5064 The functional style also makes code easier to read and maintain.
5065 * systime.h: Include <sys/time.h> on all hosts, not just if
5066 WINDOWSNT, since 'struct timeval' is needed in general.
5067 (EMACS_TIME): Now a typedef, not a macro.
5068 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5069 not macros.
5070 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
5071 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
5072 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
5073 (EMACS_TIME_LE): Now functions, not macros.
5074 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
5075 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
5076 which are not functions. All uses rewritten to use:
5077 (make_emacs_time): New function.
5078 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5079 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5080 not functions. All uses rewritten to use the following, respectively:
5081 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5082 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 5083 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
5084 * fileio.c (Fcopy_file):
5085 * xterm.c (XTflash): Get the current time closer to when it's used.
5086 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5087
ffacb126
PE
5088 * bytecode.c (targets): Suppress -Woverride-init warnings.
5089
e99a530f
PE
5090 Simplify by avoiding confusing use of strncpy etc.
5091 * doc.c (Fsnarf_documentation):
5092 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5093 * frame.c (Fmake_terminal_frame):
5094 * gtkutil.c (get_utf8_string):
5095 * lread.c (openp):
5096 * nsmenu.m (ns_update_menubar):
5097 * regex.c (regerror):
5098 Prefer memcpy to strncpy and strncat when either will do.
5099 * fileio.c (Fsubstitute_in_file_name):
5100 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5101 (menu_separator_name_p):
5102 * nsmenu.m (ns_update_menubar):
5103 Prefer memcmp to strncmp when either will do.
5104 * nsterm.m: Include <ftoastr.h>.
5105 (ns_get_color):
5106 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5107 Prefer snprintf to strncpy.
5108 * nsterm.m (ns_term_init):
5109 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5110 * nsterm.m (ns_term_init):
5111 Avoid the need for strncpy, by using build_string or
5112 make_unibyte_string directly. Use dtoastr, not snprintf.
5113 * process.c (Fmake_network_process): Diagnose service names that
5114 are too long, rather than silently truncating them or creating
5115 non-null-terminated names.
5116 (Fnetwork_interface_info): Likewise, for interface names.
5117 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5118 Prefer sprintf to strncat.
5119 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5120 Prefer vsnprintf to vsprintf + strncpy.
5121
c59592b3
GM
51222012-07-10 Glenn Morris <rgm@gnu.org>
5123
5124 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5125 Clarify fallback case.
5126
7d7bbefd
DA
51272012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5128
5129 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5130 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5131 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 5132 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
5133 where argument type is known to be a Lisp_Cons.
5134
3a4c8000
TT
51352012-07-10 Tom Tromey <tromey@redhat.com>
5136
5137 * bytecode.c (BYTE_CODE_THREADED): New macro.
5138 (BYTE_CODES): New macro. Replaces all old byte-code defines.
5139 (enum byte_code_op): New type.
5140 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5141 (exec_byte_code): Use them. Use token threading when applicable.
5142
2a0213a6
DA
51432012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5144
5145 Optimize pure C strings initialization.
5146 * lisp.h (make_pure_string): Fix prototype.
5147 (build_pure_c_string): New function, defined as static inline. This
5148 provides a better opportunity to optimize away calls to strlen when
5149 the function is called with compile-time constant argument.
5150 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
5151 argument, adjust users accordingly. Use build_pure_c_string where
5152 appropriate.
5153 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
5154 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
5155 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
5156
cb1caeaf
DA
51572012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5158
5159 Avoid calls to strlen in miscellaneous functions.
5160 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
5161 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
5162 * lread.c (openp): Likewise.
5163
c293e30c
DA
51642012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5165
5166 Avoid calls to strlen in path processing functions.
5167 * fileio.c (file_name_as_directory): Add comment. Change to add
5168 srclen argument and return the length of result. Adjust users
5169 accordingly.
5170 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
5171 swap 1st and 2nd arguments to obey the common convention.
5172 Adjust users accordingly.
c293e30c
DA
5173 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
5174
9e059e3f
GM
51752012-07-10 Glenn Morris <rgm@gnu.org>
5176
d02eb359
GM
5177 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
5178 Move PENDING_OUTPUT_COUNT definition to configure.
5179
882cf227
GM
5180 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
5181 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
5182 * s/gnu.h (DATA_START): Move definitions to configure.
5183
af6e839f
GM
5184 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
5185 We include usg5-4-common.h, which defines them both.
5186
40289a12
GM
5187 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
5188 O_RDONLY already includes it).
5189
9e059e3f
GM
5190 Stop ns builds setting the EMACSLOADPATH environment variable.
5191 * nsterm.m (ns_load_path): Rename from ns_init_paths.
5192 Now it does not set EMACSLOADPATH, just returns the load-path string.
5193 * nsterm.h: Update accordingly.
5194 * lread.c [HAVE_NS]: Include nsterm.h.
5195 (init_lread) [HAVE_NS]: Use ns_load_path.
5196 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
5197
7c4e8ec0
GM
51982012-07-09 Glenn Morris <rgm@gnu.org>
5199
d4f600ff
GM
5200 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
5201 since the included bsd-common.h does so.
5202
cbb31951
GM
5203 Stop ns builds setting the EMACSPATH environment variable.
5204 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
5205 (ns_init_paths): Do not set EMACSPATH.
5206 * nsterm.h (ns_exec_path): Add it.
5207 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
5208 Use ns_exec_path.
5209
7c4e8ec0
GM
5210 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
5211
26bccfae
PE
52122012-07-09 Paul Eggert <eggert@cs.ucla.edu>
5213
a0bee46f
PE
5214 * process.c (wait_reading_process_output): 'waitchannels' was unset
5215 when read_kbd || !NILP (wait_for_cell); fix this.
5216
5994c183
PE
5217 Add GCC-style 'const' attribute to functions that can use it.
5218 * character.h (char_resolve_modifier_mask):
5219 * keyboard.h (make_ctrl_char):
5220 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5221 (init_character_once, next_almost_prime, init_fns, init_image)
5222 (flush_pending_output, init_sound):
5223 * mem-limits.h (start_of_data):
5224 * menu.h (finish_menu_items):
5225 Add ATTRIBUTE_CONST.
5226 * emacs.c (DEFINE_DUMMY_FUNCTION):
5227 Declare the dummy function with ATTRIBUTE_CONST.
5228 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5229 Add decls with ATTRIBUTE_CONST.
5230
26bccfae
PE
5231 Minor improvements to make_formatted_string.
5232 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5233 where int is good enough, as vsprintf returns an int.
5234 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5235
a8290ec3
DA
52362012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5237
5238 Use make_formatted_string to avoid double length calculation.
5239 * lisp.h (make_formatted_string): New prototype.
5240 * alloc.c (make_formatted_string): New function.
5241 * buffer.c (Fgenerate_new_buffer_name): Use it.
5242 * dbus.c (syms_of_dbusbind): Likewise.
5243 * editfns.c (Fcurrent_time_zone): Likewise.
5244 * filelock.c (get_boot_time): Likewise.
5245 * frame.c (make_terminal_frame, set_term_frame_name)
5246 (x_report_frame_params): Likewise.
5247 * image.c (gs_load): Likewise.
5248 * minibuf.c (get_minibuffer): Likewise.
5249 * msdos.c (dos_set_window_size): Likewise.
5250 * process.c (make_process): Likewise.
5251 * xdisp.c (ensure_echo_area_buffers): Likewise.
5252 * xsettings.c (apply_xft_settings): Likewise.
5253
d01ba2f1
GM
52542012-07-09 Glenn Morris <rgm@gnu.org>
5255
5256 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5257 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5258 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5259 * nsterm.h (ns_etc_directory): Add it.
5260 * callproc.c [HAVE_NS]: Include nsterm.h.
5261 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5262
f1f924b6
DA
52632012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5264
5265 Move marker debugging code under MARKER_DEBUG.
5266 * marker.c (MARKER_DEBUG): Move marker debugging code under
5267 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5268 for bootstrap with --enable-checking (~3x slowdown reported
5269 by Juanma Barranquero <lekktu@gmail.com>).
5270 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5271
ab531b66
PE
52722012-07-08 Paul Eggert <eggert@cs.ucla.edu>
5273
5274 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5275 See <http://bugs.gnu.org/11825#29>.
5276
c4b3bc8a
EZ
52772012-07-08 Eli Zaretskii <eliz@gnu.org>
5278
5279 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5280 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
5281 (display_line): Add commentary about displaying truncation glyphs
5282 on GUI frames.
5283 (produce_special_glyphs): Move here from term.c.
5284
5285 * term.c (produce_special_glyphs): Move to xdisp.c.
5286
5287 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5288 section.
c4b3bc8a 5289
b676b881
AS
52902012-07-07 Andreas Schwab <schwab@linux-m68k.org>
5291
f17c5273
AS
5292 * xdisp.c (display_line): Avoid warning about implicit declaration
5293 of FRAME_FONT.
5294
298819b9
AS
5295 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5296
b676b881
AS
5297 * lisp.h: Remove empty conditional.
5298
6045c4fd
PE
52992012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5300
b3350bf9
PE
5301 * lread.c (load_path_check): Now static.
5302
6045c4fd
PE
5303 Fix some minor --with-ns problems found by static checking.
5304 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
5305 (x_set_font) [!HAVE_X_WINDOWS]:
5306 * image.c (xpm_load_image) [HAVE_NS]:
5307 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
5308 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
5309 Remove unused local.
5310 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
5311 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
5312 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
5313 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
5314 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
5315 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
5316 Fix pointer signedness problem.
5317 * xfaces.c (FRAME_X_FONT_TABLE):
5318 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
5319
929e7845
GM
53202012-07-07 Glenn Morris <rgm@gnu.org>
5321
5322 * lread.c (load_path_check): New function, split from init_lread.
5323 (init_lread): Reorganize. Motivation:
5324 If EMACSLOADPATH is set, check/warn about that rather than the
5325 defaults, which we are not going to use. Hence we can remove
5326 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
5327 Don't warn if site-lisp directories are missing.
5328 If not installed, start from a blank load-path, since
5329 PATH_LOADSEARCH refers to the eventual installation directories.
5330
58dd0aa4
EZ
53312012-07-07 Eli Zaretskii <eliz@gnu.org>
5332
5333 Support truncation and continuation glyphs on GUI frames, when
5334 fringes are disabled. (Bug#11832)
5335 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
5336 continuation glyphs even if on GUI frames.
5337 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
5338 or both, are absent.
5339 (start_display, move_it_in_display_line_to): Handle the case of a
5340 GUI frame without a fringe to display continuation or truncation
5341 glyphs.
5342 (insert_left_trunc_glyphs): Support GUI frames: make sure
5343 truncation glyphs overwrite enough glyphs from the current line to
5344 have sufficient space in pixels.
5345 (display_line): Support truncation and continuation glyphs on GUI
5346 frames. If some spare pixels are left on the line after inserting
5347 the truncation glyphs, fill that space with a stretch glyph of a
5348 suitably computed width.
5349
5350 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5351 produce_glyphs, to support GUI sessions.
5352
31571fd7
PE
53532012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5354
5a16b9bc
PE
5355 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5356
f3047c75
PE
5357 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5358
31571fd7
PE
5359 Do not require float-time's arg to fit in time_t (Bug#11825).
5360 This works better on hosts where time_t is unsigned, and where
5361 float-time is applied to the (negative) difference between two times.
5362 * editfns.c (decode_time_components): Last arg is now double *,
5363 not int *, and means to store all the result as a double, without
5364 worrying about whether the seconds part fits in time_t.
5365 All callers changed.
5366 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5367 All callers changed.
5368 (Ffloat_time): Do not fail merely because the specified time falls
5369 outside of time_t range.
5370
4516fbef
GM
53712012-07-07 Glenn Morris <rgm@gnu.org>
5372
5373 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5374 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5375 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5376
07adc2c6
JB
53772012-07-07 Juanma Barranquero <lekktu@gmail.com>
5378
5379 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5380 Update dependencies.
5381
5382 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5383
fd573f31
PE
53842012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5385
fee5959d
PE
5386 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5387 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5388 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5389 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5390 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5391 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5392
fd573f31
PE
5393 * xfont.c (compare_font_names): Redo to omit the need for casts.
5394
ddadbc0e
AS
53952012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5396
fca8d6b6
AS
5397 * xfns.c (Fx_change_window_property): Doc fix.
5398 * w32fns.c (Fx_change_window_property): Doc fix.
5399
ddadbc0e
AS
5400 * w32fns.c (Fx_window_property): Accept the same arguments as the
5401 X Windows version. Doc fix.
5402 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5403
ed9265fc 54042012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
5405 Eli Zaretskii <eliz@gnu.org>
5406
5407 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5408 Windows-specific code from nt/config.nt moved here.
5409 Obsolete settings removed.
5410
216ee680
PE
54112012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5412
5413 * process.c: Avoid unnecessary calls to gettime.
5414 (wait_reading_process_output): Don't get the time of day
5415 when gobbling data immediately and not waiting, as there's no need
5416 for it in that case. This removes a FIXME.
5417
bdd091e4
JD
54182012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5419
5420 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5421 is defined (Bug#11768).
5422
9d44f8ce
DA
54232012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5424
5425 Fix marker debugging code.
5426 * marker.c (byte_char_debug_check): Do not perform the check
5427 if buffer is not multibyte.
090bd7cb
JB
5428 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5429 Call byte_char_debug_check with correct arguments.
9d44f8ce 5430
90fc4786
DA
54312012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5432
5433 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
5434 * marker.c (byte_char_debug_check, count_markers):
5435 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
5436 (byte_debug_flag): Remove.
5437 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5438 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5439
7b7ae965
DA
54402012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5441
4e57b342
DA
5442 Avoid code repetition in marker-related functions.
5443 * marker.c (attach_marker): New function.
5444 (Fset_marker, set_marker_restricted, set_marker_both)
5445 (set_marker_restricted_both): Use it.
5446 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5447 Consistently rename charno to charpos.
5448 (marker_position): Add eassert.
5449 (marker_byte_position): Convert to eassert.
5450
54512012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5452
5453 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 5454 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 5455 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 5456
657924ff
DA
54572012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5458
5459 Introduce fast path for the widely used marker operation.
5460 * alloc.c (build_marker): New function.
5461 * lisp.h (build_marker): New prototype.
5462 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5463 * composite.c (autocmp_chars): Likewise.
5464 * editfns.c (buildmark): Remove.
5465 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5466 (save_restriction_save): Use build_marker.
5467 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5468 * window.c (save_window_save): Likewise.
5469
041a49a6
DA
54702012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5471
5472 Do not use Fdelete_overlay in delete_all_overlays
5473 to avoid redundant calls to unchain_overlay.
5474 * buffer.c (drop_overlay): New function.
5475 (delete_all_overlays, Fdelete_overlay): Use it.
5476 * minibuf.c (get_minibuffer): Fix comment.
5477
7dca65a4
PE
54782012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5479
5480 Port to OpenBSD 5.1 amd64.
5481 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5482 This is needed for OpenBSD, and should be harmless on all BSD systems.
5483 Also, include <sys/sysctl.h>, as it should be available on all
5484 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5485 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5486 use p_pid member, not kp_proc.pid.
5487
8eb876e2
GM
54882012-07-06 Glenn Morris <rgm@gnu.org>
5489
5490 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5491
38182d90
PE
54922012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5493
5494 More xmalloc and related cleanup.
5495 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5496 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5497 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5498 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5499 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5500 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5501 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5502 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5503 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5504 * xterm.c:
5505 Omit needless casts involving void * pointers and allocation.
5506 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5507 as the former is more robust if P's type is changed.
5508 Prefer xzalloc to xmalloc + memset 0.
5509 Simplify malloc-or-realloc to realloc.
5510 Don't worry about xmalloc returning a null pointer.
5511 Prefer xstrdup to xmalloc + strcpy.
5512 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5513 growing it.
5514 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5515 alloca of a constant.
5516
6dd5a677
EZ
55172012-07-05 Eli Zaretskii <eliz@gnu.org>
5518
5519 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5520 hscroll is larger than the line width. Fixes long and futile
5521 looping inside extend_face_to_end_of_line (on a TTY) producing
5522 glyphs that are not needed and thrown away.
5523
6b312f0f
DA
55242012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5525
5526 * marker.c (set_marker_restricted_both): Simplify by using
5527 clip_to_bounds.
5528
f520ef9b
PE
55292012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5530
5531 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5532
383b7c95
JD
55332012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5534
5535 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5536 not defined (Bug#11768).
5537 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5538 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5539 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5540 followed by gtk_box_set_homogeneous (Bug#11768).
5541 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
5542 (update_theme_scrollbar_width, xg_create_scroll_bar):
5543 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
5544 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5545 (is_box_type): New function (Bug#11768).
5546 (xg_tool_item_stale_p): Call is_box_type.
5293d758 5547 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
5548 with default display (Bug#11768).
5549
d6e7bf45
EZ
55502012-07-05 Eli Zaretskii <eliz@gnu.org>
5551
5552 * xdisp.c (window_hscroll_limited): New function.
5553 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5554 coordinates when window's hscroll is set to insanely large
5555 values. (Bug#11857)
5556
431391ec
JB
55572012-07-05 Juanma Barranquero <lekktu@gmail.com>
5558
5559 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5560 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5561
23f86fce
DA
55622012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5563
5564 Cleanup xmalloc.
5565 * lisp.h (xzalloc): New prototype. Omit needless casts.
5566 * alloc.c (xzalloc): New function. Omit needless casts.
5567 * charset.c: Omit needless casts. Convert all calls to
5568 xmalloc with following memset to xzalloc.
5569 * dispnew.c: Likewise.
5570 * fringe.c: Likewise.
5571 * image.c: Likewise.
5572 * sound.c: Likewise.
5573 * term.c: Likewise.
5574 * w32fns.c: Likewise.
5575 * w32font.c: Likewise.
5576 * w32term.c: Likewise.
5577 * xfaces.c: Likewise.
5578 * xfns.c: Likewise.
5579 * xterm.c: Likewise.
5580 * atimer.c: Omit needless casts.
5581 * buffer.c: Likewise.
5582 * callproc.c: Likewise.
5583 * ccl.c: Likewise.
5584 * coding.c: Likewise.
5585 * composite.c: Likewise.
5586 * doc.c: Likewise.
5587 * doprnt.c: Likewise.
5588 * editfns.c: Likewise.
5589 * emacs.c: Likewise.
5590 * eval.c: Likewise.
5591 * filelock.c: Likewise.
5592 * fns.c: Likewise.
5593 * gtkutil.c: Likewise.
5594 * keyboard.c: Likewise.
5595 * lisp.h: Likewise.
5596 * lread.c: Likewise.
5597 * minibuf.c: Likewise.
5598 * msdos.c: Likewise.
5599 * print.c: Likewise.
5600 * process.c: Likewise.
5601 * region-cache.c: Likewise.
5602 * search.c: Likewise.
5603 * sysdep.c: Likewise.
5604 * termcap.c: Likewise.
5605 * terminal.c: Likewise.
5606 * tparam.c: Likewise.
5607 * w16select.c: Likewise.
5608 * w32.c: Likewise.
5609 * w32reg.c: Likewise.
5610 * w32select.c: Likewise.
5611 * w32uniscribe.c: Likewise.
5612 * widget.c: Likewise.
5613 * xdisp.c: Likewise.
5614 * xmenu.c: Likewise.
5615 * xrdb.c: Likewise.
5616 * xselect.c: Likewise.
5617
0497dc44
PE
56182012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5619
5620 * fileio.c (time_error_value): Check the right error number.
5621 Problem reported by Troels Nielsen in
5622 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5623
356e7178
PE
56242012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5625
4e71fd89
PE
5626 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5627 This should be fixed in a better way; see Eli Zaretskii in
5628 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5629 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5630
f0941253
PE
5631 * fileio.c (time_error_value): Rename from special_mtime.
5632 The old name's problems were noted by Eli Zaretskii in
5633 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5634
065c9eb4
PE
5635 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5636 This variable's comment says Emacs needs at least one GDB-visible
5637 symbol of type enum pvec_type, to work around GDB problems.
5638 The symbol's value doesn't matter.
5639
356e7178
PE
5640 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5641 that causes compilation to fail on pre-C99 compilers.
5642
ed9265fc 56432012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
5644
5645 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5646 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5647
3884d954
DA
56482012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5649
d209e2fb 5650 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
5651 headers for buffer_defaults and buffer_local_symbols.
5652 Reported by Juanma Barranquero <lekktu@gmail.com>.
5653
ee28be33
SM
56542012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5655
5656 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5657 * lisp.h (enum pvec_type): Use fewer bits.
5658 (PSEUDOVECTOR_SIZE_BITS): New constant.
5659 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5660 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5661 change in pvec_type.
5662 (PSEUDOVECTOR_TYPEP): New macro.
5663 (TYPED_PSEUDOVECTORP): Use it.
5664 * fns.c (internal_equal): Adapt code to extract pvectype.
5665 * emacs.c (gdb_pvec_type): Update type.
5666 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5667 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5668 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5669 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5670 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5671 abusing vector->header.next.nbytes.
5672 (live_vector_p): Use PVEC_TYPE.
5673 (mark_object): Adapt code to extract pvectype. Use switch.
5674
c7f2cd7f
PE
56752012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5676
5677 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5678 Tighten new eassert a bit.
5679
8ce70ed2
DA
56802012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5681
5682 Fix compilation with --enable-gcc-warnings and -O1
5683 optimization level.
5684 * doprnt.c (doprnt): Change type of tem to int, initialize
5685 to avoid compiler warning. Add eassert.
5686 * search.c (simple_search): Initialize match_byte to avoid
5687 compiler warning. Add eassert.
5688
dea7f1e5
PE
56892012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5690
24a212eb
PE
5691 Avoid weird behavior with large horizontal scrolls.
5692 Without this change, for example, large hscroll values would
5693 mess up Emacs's display on Fedora 15 x86, presumably due to
5694 overflows in int calculations in the display code.
5695 Also, if buffers had long lines, Emacs would freeze.
5696 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5697 (set_window_hscroll): New function, containing the old guts of
5698 Fset_window_hscroll. Return the clipped value.
5699 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5700 This avoids the need to check against PTRDIFF_MAX.
5701
dea7f1e5
PE
5702 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5703
76046526
DA
57042012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5705
5706 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5707
39adff0d
PE
57082012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5709
63807d47
PE
5710 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5711 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5712 since GCC 4.4.6 issues a bogus warning for them.
5713
39adff0d
PE
5714 Fix bugs in file timestamp newness comparisons.
5715 * fileio.c (Ffile_newer_than_file_p):
5716 * lread.c (Fload): Use full timestamp resolution of files,
5717 not just the 1-second resolution, so that files that are only
5718 slightly newer still count as newer.
5719 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5720 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5721
dbeed9a6
PE
57222012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5723
5724 * fileio.c: Improve handling of file time marker. (Bug#11852)
5725 (special_mtime): New function.
5726 (Finsert_file_contents, Fverify_visited_file_modtime):
5727 Use it to set special mtime values consistently.
5728
636334d6
AS
57292012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5730
5731 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5732 marker for non-existing file. (Bug#11852)
5733
e2017fe2
GM
57342012-07-03 Glenn Morris <rgm@gnu.org>
5735
5736 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5737 and did not make it into globals.h).
5738
404dbd37
TT
57392012-07-03 Tom Tromey <tromey@redhat.com>
5740
5741 * window.c (Fset_window_margins, Fset_window_fringes)
5742 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5743 * textprop.c (Fprevious_property_change): No longer static.
5744 * syntax.c (Fsyntax_table_p): No longer static.
5745 * process.c (Fget_process, Fprocess_datagram_address): No longer
5746 static.
5747 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5748 * keyboard.c (Fcommand_execute): No longer static.
5749 Remove EXFUN.
5750 * insdel.c (Fcombine_after_change_execute): No longer static.
5751 * image.c (Finit_image_library): No longer static.
5752 * fileio.c (Fmake_symbolic_link): No longer static.
5753 * eval.c (Ffetch_bytecode): No longer static.
5754 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
5755 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5756 No longer static.
404dbd37
TT
5757 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5758 static.
5759 * dired.c (Ffile_attributes): No longer static.
5760 * composite.c (Fcomposition_get_gstring): No longer static.
5761 * callproc.c (Fgetenv_internal): No longer static.
5762
5763 * ccl.h: Remove EXFUNs.
5764 * buffer.h: Remove EXFUNs.
5765 * dispextern.h: Remove EXFUNs.
5766 * intervals.h: Remove EXFUNs.
5767 * fontset.h: Remove EXFUN.
5768 * font.h: Remove EXFUNs.
5769 * dosfns.c (system_process_attributes): Remove EXFUN.
5770 * keymap.h: Remove EXFUNs.
5771 * lisp.h: Remove EXFUNs.
5772 * w32term.h: Remove EXFUNs.
5773 * window.h: Remove EXFUNs.
5774 * xsettings.h: Remove EXFUN.
5775 * xterm.h: Remove EXFUN.
5776
8e4fd1e1
GM
57772012-07-03 Glenn Morris <rgm@gnu.org>
5778
5779 * lisp.h (Frandom): Make it visible to C.
5780 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5781 buffer for invisible buffers. (Bug#1229)
5782
ca95b3eb
DA
57832012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5784
5785 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5786 values which aren't power of 2.
14ae4239
BT
5787 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5788 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
5789 accordingly.
5790
7555c33f
SM
57912012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5792
5793 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5794
5795 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5796
d12e8f5a
DA
57972012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5798
5799 * alloc.c (allocate_vector_block): Remove redundant
5800 calls to mallopt if DOUG_LEA_MALLOC is defined.
5801 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5802 avoid calls to mallopt if zero_vector is returned.
5803
296094c3
DA
58042012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5805
5806 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5807 is enabled, avoid dereferencing NULL current_sblock if
5808 running undumped.
5809
36429c89
DA
58102012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5811
5812 Cleanup basic buffer management.
5813 * buffer.h (struct buffer): Change layout to use generic vector
5814 marking code. Fix some comments. Change type of 'clip_changed'
5815 to bitfield. Remove unused #ifndef old.
5816 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5817 (GET_OVERLAYS_AT): Fix indentation.
5818 (for_each_per_buffer_object_at): New macro.
5819 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5820 (Fbuffer_local_variables): Use it.
5821 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5822 * alloc.c (allocate_buffer): Adjust to match new layout of
5823 struct buffer. Fix comment.
5824 (mark_overlay): New function.
5825 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5826 Lisp area of struct buffer.
5827 (mark_object): Use it. Adjust marking of misc objects
5828 and related comments.
5829
3b3e4cac
PE
58302012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5831
5832 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5833 wrapper that is not needed because the wrapped code is a no-op (zero
5834 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5835 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5836
cf5c0175
DA
58372012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5838
5839 * alloc.c (mark_buffer): Simplify. Remove prototype.
5840 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 5841 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
5842 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5843 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 5844
ca26824c
GM
58452012-06-30 Glenn Morris <rgm@gnu.org>
5846
2e4c5312
GM
5847 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5848
ca26824c
GM
5849 * epaths.in (PATH_SITELOADSEARCH): New.
5850 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5851 This is rather than relying on --enable-locallisppath elements
5852 having "site-lisp" in their names. (Bug#10208#25, 11658)
5853
0d23c240
EZ
58542012-06-30 Eli Zaretskii <eliz@gnu.org>
5855
c9240d7a
EZ
5856 * w32proc.c (sys_select): Accept and ignore one more argument.
5857
5858 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5859
0d23c240 5860 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 5861 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
5862
5863 * sysdep.c: Don't include dos.h and dosfns.h.
5864
5865 * process.c (sys_select):
5866 * msdos.c (sys_select): Accept one more argument and ignore it.
5867
5868 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5869 adapt data types and code to that.
5870
5871 * dosfns.c:
5872 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5873 which clashes with the gnulib function of the same name.
5874
af5a5a98
AS
58752012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5876
c5e4379c
AS
5877 * font.c (font_style_to_value, font_style_symbolic)
5878 (font_prop_validate_style): Add type checks for values in
5879 font_style_table.
5880
af5a5a98
AS
5881 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5882 argument.
5883 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5884 uses.
5885
8d38f461
EZ
58862012-06-29 Eli Zaretskii <eliz@gnu.org>
5887
2e5a6631
EZ
5888 * xdisp.c (try_window_id): Undo last change.
5889
8d38f461
EZ
5890 * w32.c (getwd): Adjust commentary about startup_dir.
5891 (init_environment): Always call sys_access, even in non-MSVC
5892 builds. Don't chdir to the directory of the Emacs executable.
5893 This undoes code from 1997 which was justified by the need to
5894 "avoid conflicts when removing and renaming directories". But its
5895 downside was that every relative file name was being interpreted
5896 relative to the directory of the Emacs executable, which can never
5897 be TRT. In particular, it broke sys_access when called with
5898 relative file names.
5899 (sys_access): Map GetLastError to errno.
5900
2af3565e
DA
59012012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5902
5903 * window.h (struct window): Change type of 'fringes_outside_margins'
5904 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 5905 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
5906 Adjust comment.
5907 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5908 to ptrdiff_t.
5909
c8d3a25c 59102012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 5911
c8d3a25c
GM
5912 * gnutls.c (emacs_gnutls_handshake):
5913 Add QUIT to make the loop interruptible.
57570cd3 5914
c8d3a25c 59152012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 5916
c8d3a25c
GM
5917 * charset.c (init_charset): Make lack of etc/charsets fatal.
5918
3e984ee8
DA
59192012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5920
5921 * editfns.c (region_limit): Fix type mismatch.
5922
ef884f23
DA
59232012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5924
5925 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5926 undefined. Convert from xassert to eassert.
5927 * nsmenu.m: Convert from xassert to eassert.
5928 * nsterm.m: Likewise.
5929
7d7e0027
SM
59302012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5931
5932 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5933
aa754e6a
PE
59342012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5935
5936 Avoid integer overflow on scroll-left and scroll-right.
5937 * window.c (HSCROLL_MAX): New macro.
5938 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5939 overflow when requested scroll falls outside ptrdiff_t range.
5940
80b00b08
DA
59412012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5942
5943 * window.h (struct window): Change type of 'hscroll',
5944 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5945 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5946 Adjust users accordingly.
5947 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5948 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5949 from EMACS_INT to ptrdiff_t.
5950 (make_window): Omit redundant initialization.
5951
62b2bcf6
JB
59522012-06-28 Juanma Barranquero <lekktu@gmail.com>
5953
5954 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5955
45942c7d
DA
59562012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5957
5958 * window.h (struct window): Change type of 'use_time' and
5959 'sequence_number' from Lisp_Object to int.
5960 * frame.c (make_frame): Adjust users accordingly.
5961 * print.c (print_object): Likewise.
5962 * window.c (select_window, Fwindow_use_time, make_parent_window)
5963 (make_window): Likewise.
5964
e509cfa6
DA
59652012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5966
5967 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5968 enabled with --enable-checking=[all,glyphs] configure option.
5969 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5970 adjust comments accordingly.
5971 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5972 undefined, adjust comments accordingly.
5973 * image.c: Likewise.
5974 * scroll.c: Likewise.
5975 * w32fns.c: Likewise.
5976 * w32term.c: Likewise.
5977 * xdisp.c: Likewise.
5978 * xfaces.c: Likewise.
5979 * xfns.c: Likewise.
5980 * xterm.c: Likewise.
5981
a54e2c05
DA
59822012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5983
5984 Generalize run-time debugging checks.
5985 * dispextern.h (XASSERTS): Remove.
5986 * fontset.c (xassert): Remove.
5987 Convert from xassert to eassert.
5988 * alloc.c: Convert from xassert to eassert.
5989 * bidi.c: Likewise.
5990 * dispnew.c: Likewise.
5991 * fns.c: Likewise.
5992 * fringe.c: Likewise.
5993 * ftfont.c: Likewise.
5994 * gtkutil.c: Likewise.
5995 * image.c: Likewise.
5996 * keyboard.c: Likewise.
5997 * menu.c: Likewise.
5998 * process.c: Likewise.
5999 * scroll.c: Likewise.
6000 * sound.c: Likewise.
6001 * term.c: Likewise.
6002 * w32console.c: Likewise.
6003 * w32fns.c: Likewise.
6004 * w32term.c: Likewise.
6005 * window.c: Likewise.
6006 * xdisp.c: Likewise.
6007 * xfaces.c: Likewise.
6008 * xfns.c: Likewise.
6009 * xselect.c: Likewise.
6010 * xterm.c: Likewise.
6011
1ec4b7b2
SM
60122012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
6013
6014 * fns.c (maybe_resize_hash_table): Output message when growing the
6015 purify-hashtable.
6016
2014308a
DA
60172012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6018
6019 * alloc.c (allocate_string_data): Remove dead code.
6020 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
6021 avoid GCC warning about unused macro.
6022
246155eb
DA
60232012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6024
6025 * alloc.c (allocate_string): Omit intervals initialization.
6026 * alloc.c (make_uninit_multibyte_string): Initialize intervals
6027 as in make_pure_string and make_pure_c_string.
6028
43184b7b
DA
60292012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6030
d209e2fb 6031 * alloc.c (allocate_string): Fix last change.
43184b7b 6032
3fe6dd74
DA
60332012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6034
d209e2fb 6035 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
6036 to memset, add explicit initialization where appropriate.
6037
1ba6038a
GM
60382012-06-27 Glenn Morris <rgm@gnu.org>
6039
6040 * lisp.mk (lisp): Remove paths.elc.
6041
c89926a5
CY
60422012-06-27 Chong Yidong <cyd@gnu.org>
6043
6044 * doc.c (Fsubstitute_command_keys): Fix punctuation.
6045
ed6b3510
JW
60462012-06-26 John Wiegley <johnw@newartisans.com>
6047
1ec4b7b2 6048 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
6049 on Mac OS X Lion: __mod_init_func and __mod_term_func.
6050
ed6b3510
JW
6051 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6052 when building with Clang.
6053
8edd4a2b
SM
60542012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
6055
6056 * eval.c (Fapply): Allow calling it with a single argument.
6057
f6f62d1b
EZ
60582012-06-26 Eli Zaretskii <eliz@gnu.org>
6059
6060 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6061 _stricmp and _strnicmp.
6062 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6063
62efea5e
DA
60642012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6065
6066 * alloc.c (allocate_window): Zero out non-Lisp part of newly
6067 allocated window.
6068 (allocate_process): Likewise for new process.
8edd4a2b 6069 (allocate_terminal): Change to use offsetof.
62efea5e
DA
6070 (allocate_frame): Likewise.
6071 * frame.c (make_frame): Omit redundant initialization.
6072 * window.c (make_parent_window): Use memset.
6073 (make_window): Omit redundant initialization.
6074 * process.c (make_process): Omit redundant initialization.
6075 * terminal.c (create_terminal): Likewise.
6076
42997f4d
DA
60772012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6078
6079 * term.c (delete_tty): Remove redundant call to memset.
6080
1130ecfc
DA
60812012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6082
6083 * alloc.c: Remove build_string.
6084 * lisp.h: Define build_string as static inline. This provides
6085 a better opportunity to optimize away calls to strlen when the
6086 function is called with compile-time constant argument.
6087 * image.c (imagemagick_error): Convert to build_string.
6088 * w32proc.c (sys_spawnve): Likewise.
6089 * xterm.c (x_term_init): Likewise.
6090
cf38a720
PE
60912012-06-26 Paul Eggert <eggert@cs.ucla.edu>
6092
99027bdd
PE
6093 Use sprintf return value instead of invoking strlen on result.
6094 In the old days this wasn't portable, since some sprintf
6095 implementations returned char *. But they died out years ago and
6096 Emacs already assumes sprintf returns int.
6097 Similarly for float_to_string.
6098 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6099 * ccl.c (ccl_driver):
6100 * character.c (string_escape_byte8):
6101 * data.c (Fnumber_to_string):
6102 * doprnt.c (doprnt):
6103 * print.c (print_object):
6104 * xdisp.c (message_dolog):
6105 * xfns.c (syms_of_xfns):
6106 Use sprintf or float_to_string result to avoid need to call strlen.
6107 * data.c (Fnumber_to_string):
6108 Use make_unibyte_string, since the string must be ASCII.
6109 * lisp.h, print.c (float_to_string): Now returns int length.
6110 * term.c (produce_glyphless_glyph):
6111 Use sprintf result rather than recomputing it.
6112
cf38a720
PE
6113 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6114 * Makefile.in (ALL_CFLAGS):
6115 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6116 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6117
3511c784
DA
61182012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6119
0a08eb21 6120 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
6121 strcasecmp if available.
6122 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6123
fb7da12e
AS
61242012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6125
6126 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6127 Avoid comma operator.
6128 * menu.c (push_submenu_start, push_submenu_end)
6129 (push_left_right_boundary, push_menu_pane): Likewise.
6130 * msdos.c (dos_rawgetc): Likewise.
6131
afa2ffd8
DA
61322012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6133
6134 * xfns.c (xic_create_fontsetname): Remove redundant calls
6135 to memset.
6136
b3b4476b
PE
61372012-06-25 Paul Eggert <eggert@cs.ucla.edu>
6138
4495ff38
PE
6139 * gtkutil.c (get_utf8_string): Remove redundant assignment.
6140 sprintf already null-terminates its output.
6141
b3b4476b
PE
6142 * xfns.c (x_window): Remove redundant cast.
6143
b00876c9
DA
61442012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6145
6146 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6147 `const char *' to `char *' to avoid compiler warning.
6148
d188e26b
PE
61492012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6150
885d1d74
PE
6151 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6152 instead of truncating it to 63 (admittedly a generous limit).
6153
d188e26b
PE
6154 * process.c: Fix spelling and caps in comments.
6155
e2f560b1
DN
61562012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
6157
e86db54b 6158 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
6159 * sysdep.c (setpgrp): Remove definition, not used in this file.
6160
7583a3a1
JB
61612012-06-24 Juanma Barranquero <lekktu@gmail.com>
6162
6163 * makefile.w32-in: Update dependencies.
6164
696056c2
EZ
61652012-06-24 Eli Zaretskii <eliz@gnu.org>
6166
6167 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
6168 (SYSTIME_H): Add nt/inc/sys/time.h.
6169
6170 * systime.h [WINDOWSNT]: Include sys/time.h.
6171
6172 * s/ms-w32.h (struct timespec): Definition moved from
6173 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
6174
845ca893
PE
61752012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6176
6177 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
6178 * buffer.h (buffer_slot_type_mismatch):
6179 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6180 * eval.c (unwind_to_catch):
6181 * image.c (my_png_error, my_error_exit):
6182 * keyboard.c (quit_throw_to_read_char, user_error)
6183 (Fexit_recursive_edit, Fabort_recursive_edit):
6184 * lisp.h (die, args_out_of_range, args_out_of_range_3)
6185 (wrong_type_argument, buffer_overflow, __executable_start)
6186 (memory_full, buffer_memory_full, string_overflow, Fthrow)
6187 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
6188 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
6189 (fatal):
6190 (child_setup) [!DOS_NT]:
6191 * lread.c (end_of_file_error, invalid_syntax):
6192 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6193 * puresize.h (pure_write_error):
6194 * search.c (matcher_overflow):
6195 * sound.c (sound_perror, alsa_sound_perror):
6196 * sysdep.c, syssignal.h (croak):
6197 * term.c (maybe_fatal, vfatal):
6198 * textprop.c (text_read_only):
6199 * undo.c (user_error):
6200 * unexmacosx.c (unexec_error):
6201 * xterm.c (x_ins_del_lines, x_delete_glyphs):
6202 Use _Noreturn rather than NO_RETURN.
6203 No need for separate decl merely because of _Noreturn.
6204 * sound.c (sound_warning, parse_sound):
6205 Remove unnecessary forward decls.
6206
f1dd8073
PE
62072012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6208
6209 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
6210 * lisp.h (WAIT_READING_MAX): New macro.
6211 * dispnew.c (Fsleep_for, sit_for):
6212 * keyboard.c (kbd_buffer_get_event):
6213 * process.c (Faccept_process_output):
6214 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6215 This improves on the previous patch, which introduced a bug
6216 when time_t is unsigned and as wide as intmax_t.
6217 See <http://bugs.gnu.org/9000#51>.
6218
b82c1755
EZ
62192012-06-23 Eli Zaretskii <eliz@gnu.org>
6220
6221 * dispnew.c (sit_for, Fsleep_for):
6222 * keyboard.c (kbd_buffer_get_event):
6223 * process.c (Faccept_process_output): Avoid compiler warnings when
6224 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6225
ca300656
JB
62262012-06-23 Juanma Barranquero <lekktu@gmail.com>
6227
049ec95b
JB
6228 * makefile.w32-in: Update dependencies.
6229
ca300656
JB
6230 * w32.c (ltime): Add return type and declare static.
6231 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6232
db7b8d06
PE
62332012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6234
6235 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6236 Privately reported by Herbert J. Skuhra.
6237 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6238 All uses changed.
6239 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6240 not make_lisp_timeval, when the argument is of type EMACS_TIME.
6241
0bd8297f
EZ
62422012-06-23 Eli Zaretskii <eliz@gnu.org>
6243
96512555
EZ
6244 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6245 last argument of make_unibyte_string.
6246
0bd8297f
EZ
6247 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6248 language ID in the event parameters.
6249
6250 * w32term.c (w32_read_socket): Put the new keyboard codepage into
6251 event.code, not the obscure "character set ID".
6252
63def6b6
CY
62532012-06-23 Chong Yidong <cyd@gnu.org>
6254
6255 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6256
e8a02204
EZ
62572012-06-23 Eli Zaretskii <eliz@gnu.org>
6258
388cdec0
EZ
6259 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6260 * w32.c (fdutimens): New function.
6261
6262 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6263
6264 * s/ms-w32.h (pselect): Redirect to sys_select.
6265
6266 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6267
e8a02204
EZ
6268 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6269 in the logic of incrementing and decrementing the value of
6270 use_relocatable_buffers.
6271
d054f3fb
PE
62722012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6273
6274 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6275 Privately reported by Herbert J. Skuhra.
6276 [__FreeBSD__]: Remove "*/" typo after "#include".
6277 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6278 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6279 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6280 Don't assume EMACS_TIME and struct timeval are the same type.
6281
d35af63c
PE
62822012-06-22 Paul Eggert <eggert@cs.ucla.edu>
6283
6284 Support higher-resolution time stamps (Bug#9000).
6285 The time stamps are only nanosecond-resolution at the C level,
6286 since that's the best that any real-world system supports now.
6287 But they are picosecond-resolution at the Lisp level, as that's
6288 easy, and leaves room for future OS improvements.
6289
6290 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6291 (LIBES): Use it.
6292
6293 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6294 Don't get current time unless it's needed.
6295
6296 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6297 now provides it if it's absent.
6298 (start_atimer): Port to higher-res time stamps.
6299 Check for time stamp overflow. Don't get current time more
6300 often than is needed.
6301
6302 * buffer.h (struct buffer): Buffer modtime now has high resolution.
6303 Include systime.h, not time.h.
6304 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
6305
6306 * dired.c: Include stat-time.h.
6307 (Ffile-attributes): File times now have higher resolution.
6308
6309 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
6310 (struct image): Timestamp now has higher resolution.
6311
6312 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
6313 has at least microseconds now. All uses removed.
6314 (update_frame, update_single_window, update_window, update_frame_1)
6315 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 6316 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
6317
6318 * editfns.c (time_overflow): Now extern.
6319 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
6320 (float-time, Fformat_time_string, Fcurrent_time_string)
6321 (Fcurrent_time_zone): Accept and generate higher-resolution
6322 time stamps.
6323 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
6324 (decode_time_components, lisp_seconds_argument): New functions.
6325 (make_time): Now static.
6326 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
6327 Report an error if the time is invalid, rather than having the caller
6328 do that.
6329
6330 * fileio.c: Include <stat-time.h>
6331 (Fcopy_file): Copy higher-resolution time stamps.
6332 Prefer to set the time stamp via a file descriptor if that works.
6333 (Fset_file_times, Finsert_file_contents, Fwrite_region)
6334 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
6335 (Fvisited_file_modtime, Fset_visited_file_modtime):
6336 Support higher-resolution time stamps.
6337
6338 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6339
6340 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6341
6342 * image.c (prepare_image_for_display, clear_image_cache)
6343 (lookup_image): Port to higer-resolution time stamps.
6344
6345 * keyboard.c (start_polling, bind_polling_period):
6346 Check for time stamp overflow.
6347 (read_char, kbd_buffer_get_event, timer_start_idle)
6348 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6349 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6350 Port to higher-resolution time stamps. Do not assume time_t is signed.
6351 (decode_timer): New function. Timers are now vectors of length 9,
6352 not 8, to accommodate the picosecond component.
6353 (timer_check_2): Use it.
6354
6355 * nsterm.m (select_timeout, timeval_subtract): Remove.
6356 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6357 as they're a bit more accurate and handle overflow better.
6358 (ns_select): Change prototype to be compatible with pselect.
6359 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6360 * nsterm.h (ns_select): Adjust prototype.
6361
6362 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6363 us-resolution time stamps.
6364 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6365
6366 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6367
6368 * lisp.h (time_overflow): New decl.
6369 (wait_reading_process_output): First arg is now intmax_t, not int,
6370 to accommodate larger waits.
6371
6372 * process.h (struct Lisp_Process.read_output_delay):
6373 Now counts nanoseconds, not microseconds.
6374 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6375 EMACS_HAS_USECS.
6376 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6377 (wait_reading_process_output):
6378 Port to ns-resolution time stamps.
6379 (Faccept_process_output, wait_reading_process_output):
6380 Check for time stamp overflow. Do not assume time_t is signed.
6381 (select_wrapper): Remove; we now use pselect.
6382 (Fprocess_attributes): Now generates ns-resolution time stamps.
6383
6384 * sysdep.c: Include utimens.h. Don't include utime.h
6385 or worry about struct utimbuf; gnulib does that for us now.
6386 (gettimeofday): Remove; gnulib provides a substitute.
6387 (make_timeval): New function.
6388 (set_file_times): Now sets ns-resolution time stamps.
6389 New arg FD; all uses changed.
6390 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6391 (system_process_attributes):
6392 Now returns ns-resolution time stamp. All uses changed.
6393 Check for time stamp overflow.
6394
6395 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6396 provides a substitute now.
6397
6398 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6399 since it guarantees struct timespec.
6400 (EMACS_TIME): Now struct timespec, so that we can support
6401 ns-resolution time stamps.
6402 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6403 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6404 (EMACS_USECS): Remove.
6405 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6406 so multiply the arg by 1000 before storing it.
6407 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6408 New macros.
6409 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6410 Port to ns-resolution time stamps.
6411 (EMACS_TIME_NEG_P): Remove; replaced by....
6412 (EMACS_TIME_SIGN): New macro.
6413 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6414 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6415 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6416 (make_timeval, make_lisp_time, decode_time_components): New decls.
6417 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6418 that it mishandled time_t overflow. You can't compare by subtracting!
6419 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6420 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6421
6422 * term.c: Include <sys/time.h>.
6423 (timeval_to_Time): New function, for proper overflow wraparound.
6424 (term_mouse_position, term_mouse_click): Use it.
6425
6426 * undo.c (record_first_change): Support higher-resolution time stamps
6427 in the undo buffer.
6428 (Fprimitive_undo): Use them when restoring time stamps.
6429
6430 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6431 (w32_get_internal_run_time):
6432 Port to higher-resolution Emacs time stamps.
6433 (ltime): Now accepts single 64-bit integer, as that's more convenient
6434 for callers.
6435
6436 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6437
6438 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6439 for compatibility with pselect. Support ns-resolution time stamps.
6440
6441 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6442
6443 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6444 Check for time stamp overflow, and support ns-resolution time stamps.
6445
6446 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6447 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6448 (timeval_subtract): Remove; no longer needed.
6449 (XTflash, XTring_bell, x_wait_for_event):
6450 Port to ns-resolution time stamps. Don't assume time_t is signed.
6451
b6a92dfe
CY
64522012-06-22 Chong Yidong <cyd@gnu.org>
6453
6454 * xdisp.c (x_consider_frame_title): Revert last change.
6455
d251c37c
EZ
64562012-06-22 Eli Zaretskii <eliz@gnu.org>
6457
6458 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6459 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6460 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6461 staticidx goes up to 1597 out of 1600 = 0x640.)
6462
f10deafb
PE
64632012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6464
6465 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6466 Otherwise, the umask might be mistakenly 0 while handling input signals.
6467
ec6de1e2
SM
64682012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6469
6470 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6471
28be1ada
DA
64722012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6473
6474 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6475 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6476 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6477 access to `contents' member of Lisp_Vector objects with AREF and ASET
6478 where appropriate.
6479
c6bf3022
CY
64802012-06-19 Chong Yidong <cyd@gnu.org>
6481
6482 * frame.c (delete_frame): When selecting a frame on a different
6483 text terminal, do not alter the terminal's top-frame.
6484
6485 * xdisp.c (format_mode_line_unwind_data): Record the target
6486 frame's selected window and its terminal's top-frame.
6487 (unwind_format_mode_line): Restore them.
6488 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6489 Callers changed.
6490 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6491 since tty frames can be explicitly named.
6492 (prepare_menu_bars): Likewise.
6493
6494 * term.c (Ftty_top_frame): New function.
6495
defd4196
PE
64962012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6497
6498 Port byte-code-meter to modern targets.
6499 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6500 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 6501 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
6502 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6503 (METER_1, METER_2): Simplify.
6504
1053a871
SM
65052012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6506
6507 * data.c (Fdefalias): Return `symbol' (bug#11686).
6508
b7e8d081
MR
65092012-06-18 Martin Rudalics <rudalics@gmx.at>
6510
6511 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
6512 gets killed during executing of this function (Bug#11665).
6513 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
6514 (Vkill_buffer_query_functions): In doc-string say that functions
6515 run by this hook should not change the current buffer.
6516
7ea2b339
PE
65172012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6518
6519 Fix recently-introduced process.c problems found by static checking.
6520 * process.c (write_queue_push, write_queue_pop, send_process):
6521 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6522 (write_queue_pop): Fix pointer signedness problem.
6523 (send_process): Remove unused local.
6524
96a313a1
CY
65252012-06-17 Chong Yidong <cyd@gnu.org>
6526
6527 * xdisp.c (redisplay_internal): No need to redisplay terminal
6528 frames that are not on top.
6529
20ca2e94
TN
65302012-06-17 Troels Nielsen <bn.troels@gmail.com>
6531
6532 * process.c (make_process): Initialize write_queue.
6533 (write_queue_push, write_queue_pop): New functions.
6534 (send_process): Use them to maintain correct ordering of process
6535 writes (Bug#10815).
6536
9a900ca9
PE
65372012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6538
310fbfa8
PE
6539 * lisp.h (eassert): Assume C89 or later.
6540 This removes the need for CHECK.
6541 (CHECK): Remove. Its comments about always evaluating its
6542 argument were confusing, as 'eassert' typically does not evaluate
6543 its argument.
6544
27bb1ca4
PE
6545 * coding.c (produce_chars): Use ptrdiff_t, not int.
6546
9a900ca9
PE
6547 * xterm.c (x_draw_underwave): Check for integer overflow.
6548 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6549
41b7f8bc 65502012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
6551
6552 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6553 referenced (Bug#11583).
6554
9b0e3eba
AA
65552012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6556
6557 Implement wave-style variant of underlining.
6558 * dispextern.h (face_underline_type): New enum.
6559 (face): Add field for underline type.
6560 * nsterm.m (ns_draw_underwave): New function.
6561 (ns_draw_text_decoration): Use it.
6562 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6563 New functions.
6564 (x_draw_glyph_string): Use them.
6565 * xfaces.c (Qline, Qwave): New Lisp objects.
6566 (check_lface_attrs, merge_face_ref)
1053a871
SM
6567 (Finternal_set_lisp_face_attribute, realize_x_face):
6568 Handle wave-style underline face attributes.
9b0e3eba
AA
6569 * xterm.c (x_draw_underwave): New function.
6570 (x_draw_glyph_string): Use it.
6571
0fb52f11
JB
65722012-06-16 Juanma Barranquero <lekktu@gmail.com>
6573
6574 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6575 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6576 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6577 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6578 ($(BLD)/w32select.$(O)): Update dependencies.
6579
e5560ff7
AS
65802012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6581
6582 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6583 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6584 * character.c (_fetch_multibyte_char_p): Remove.
6585 * alloc.c: Include "character.h" before "buffer.h".
6586 * bidi.c: Likewise.
6587 * buffer.c: Likewise.
6588 * bytecode.c: Likewise.
6589 * callint.c: Likewise.
6590 * callproc.c: Likewise.
6591 * casefiddle.c: Likewise.
6592 * casetab.c: Likewise.
6593 * category.c: Likewise.
6594 * cmds.c: Likewise.
6595 * coding.c: Likewise.
6596 * composite.c: Likewise.
6597 * dired.c: Likewise.
6598 * dispnew.c: Likewise.
6599 * doc.c: Likewise.
6600 * dosfns.c: Likewise.
6601 * editfns.c: Likewise.
6602 * emacs.c: Likewise.
6603 * fileio.c: Likewise.
6604 * filelock.c: Likewise.
6605 * font.c: Likewise.
6606 * fontset.c: Likewise.
6607 * fringe.c: Likewise.
6608 * indent.c: Likewise.
6609 * insdel.c: Likewise.
6610 * intervals.c: Likewise.
6611 * keyboard.c: Likewise.
6612 * keymap.c: Likewise.
6613 * lread.c: Likewise.
6614 * macros.c: Likewise.
6615 * marker.c: Likewise.
6616 * minibuf.c: Likewise.
6617 * nsfns.m: Likewise.
6618 * nsmenu.m: Likewise.
6619 * print.c: Likewise.
6620 * process.c: Likewise.
6621 * regex.c: Likewise.
6622 * region-cache.c: Likewise.
6623 * search.c: Likewise.
6624 * syntax.c: Likewise.
6625 * term.c: Likewise.
6626 * textprop.c: Likewise.
6627 * undo.c: Likewise.
6628 * unexsol.c: Likewise.
6629 * w16select.c: Likewise.
6630 * w32fns.c: Likewise.
6631 * w32menu.c: Likewise.
6632 * window.c: Likewise.
6633 * xdisp.c: Likewise.
6634 * xfns.c: Likewise.
6635 * xmenu.c: Likewise.
6636 * xml.c: Likewise.
6637 * xselect.c: Likewise.
6638
2f07e6af
EZ
66392012-06-16 Eli Zaretskii <eliz@gnu.org>
6640
1053a871
SM
6641 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6642 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 6643 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
6644 row.
6645 (handle_face_prop): Use chunk-relative overlay string index when
6646 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
6647 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6648 the rightmost. (Bug#11720)
2f07e6af 6649
29b83cec
AS
66502012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6651
6652 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6653 (CATEGORY_MEMBER): Enforce 1/0 value.
6654 * category.c (_temp_category_set): Remove.
6655
4c5501e9
EZ
66562012-06-16 Eli Zaretskii <eliz@gnu.org>
6657
6658 * window.c (Fdelete_other_windows_internal)
6659 (Fdelete_window_internal): Don't access frame's mouse highlight
6660 info of the initial frame. (Bug#11677)
6661
2b570124
PE
66622012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6663
e93864f9
PE
6664 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6665 Assume USE_2_TAGS_FOR_INTS.
6666 (xreload): Adjust $tagmask width to match recent lisp.h change.
6667
2b570124
PE
6668 Simplify lisp.h in minor ways that should not affect code.
6669 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6670 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6671 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6672 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6673 (INTTYPEBITS): New macro, for clarity.
6674 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
6675 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6676 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
6677 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6678 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6679
81755f69
JB
66802012-06-13 Juanma Barranquero <lekktu@gmail.com>
6681
6682 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6683
16192a57
GM
66842012-06-13 Glenn Morris <rgm@gnu.org>
6685
6686 * s/bsd-common.h (BSD4_3):
6687 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6688
646b5f55
AS
66892012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6690
6691 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6692 instead of union.
6693 (XLI, XIL): Define.
1053a871
SM
6694 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6695 Use them.
6696 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 6697 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 6698 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
6699 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6700 * frame.c (delete_frame): Remove outdated comment.
6701 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6702 USE_LISP_UNION_TYPE.
6703 (Fw32_unregister_hot_key): Likewise.
6704 (Fw32_toggle_lock_key): Likewise.
6705 * w32menu.c (add_menu_item): Likewise.
6706 (w32_menu_display_help): Use XIL instead of checking
6707 USE_LISP_UNION_TYPE.
6708 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6709 (init_heap): Likewise.
6710 * w32term.c (w32_read_socket): Update comment.
6711
1d3823c9
GM
67122012-06-13 Glenn Morris <rgm@gnu.org>
6713
c62ff706
GM
6714 * s/usg5-4-common.h, src/s/unixware.h:
6715 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6716
1d3823c9
GM
6717 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6718
bfe3e0a2
PE
67192012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6720
6721 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6722 * alloc.c (make_number) [!defined make_number]:
6723 Remove, as lisp.h always defines this now.
6724 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6725 (roundup_size): Verify that it is a power of 2.
6726 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6727 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6728 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6729 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6730 USE_LSB_TAG now is always defined to be either 0 or 1.
6731 All uses changed.
6732 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6733 code works fine either way, and efficiency is not a concern here,
6734 as the union type is for debugging, not for production.
6735 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6736 Use an inline function on all platforms when using the union type,
6737 since this is simpler and 'static inline' can be used portably
6738 within Emacs now.
6739 (LISP_INITIALLY_ZERO): New macro.
6740 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6741 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6742
45fa9c0f
GM
67432012-06-12 Glenn Morris <rgm@gnu.org>
6744
b4492cba
GM
6745 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6746
6747 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 6748
45fa9c0f
GM
6749 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6750 Move BROKEN_SIGIO to configure.
6751
6752 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6753 Move NO_TERMIO to configure.
6754
0e25d334
CY
67552012-06-12 Chong Yidong <cyd@gnu.org>
6756
6757 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6758 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6759 MagickExportImagePixels is undefined.
6760
43682bb6
PE
67612012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6762
6763 * image.c (imagemagick_load_image): Remove unused label.
6764
a9be7d2b
GM
67652012-06-11 Glenn Morris <rgm@gnu.org>
6766
6767 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6768 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6769 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6770 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6771
3017f87f
SM
67722012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6773
6774 * alloc.c (make_byte_code): New function.
6775 (Fmake_byte_code): Use it. Don't purify here.
6776 * lread.c (read1): Use it as well to avoid extra allocation.
6777
1b9b4cf4
CY
67782012-06-11 Chong Yidong <cyd@gnu.org>
6779
6780 * image.c (imagemagick_load_image): Implement transparency.
6781
95988fcf
AS
67822012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6783
6784 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6785 account for preceding backslashes. (Bug#11663)
6786
cd4eb164
CY
67872012-06-09 Chong Yidong <cyd@gnu.org>
6788
6789 * term.c: Support italics in capable terminals (Bug#9652).
6790 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6791 (turn_on_face): Output using TS_enter_italic_mode if available.
6792 Don't handle unused blinking and alt-charset cases.
6793 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6794 and tty_alt_charset_p cases.
6795 (tty_capable_p, init_tty): Support italics.
6796
6797 * termchar.h (struct tty_display_info): Add field for italics.
6798 Remove unused blink field.
6799
6800 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6801 Handle slant.
6802
6803 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6804 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6805 tty_alt_charset_p. Add tty_italic_p.
6806
ff88beb8
MA
68072012-06-09 Michael Albinus <michael.albinus@gmx.de>
6808
6809 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6810 dbus_type_is_basic if available.
6811 (xd_extract_signed, xd_extract_unsigned): Rename from
6812 extract_signed and extract_unsigned, respectively. Adapt callers.
6813
44286096
CY
68142012-06-09 Chong Yidong <cyd@gnu.org>
6815
1682701f
CY
6816 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6817
44286096
CY
6818 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6819 case (Bug#9752).
6820
d86feb17
PE
68212012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6822
6823 * xdisp.c (vmessage): Treat frame message as multibyte.
6824 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6825 would generate the diagnostic "Making \302\247 buffer-local while
6826 let-bound!".
6827
d5c20fe8
EZ
68282012-06-08 Eli Zaretskii <eliz@gnu.org>
6829
6830 * dispnew.c (showing_window_margins_p): Undo last change, which
6831 was done due to an inadvertent commit.
6832 (adjust_frame_glyphs_for_frame_redisplay): Do call
6833 showing_window_margins_p.
6834
513749ee
SM
68352012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6836
6837 * eval.c (Fmake_var_non_special): New primitive.
6838 (syms_of_eval): Defsubr it.
6839 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6840
d4a8f5c1
JB
68412012-06-08 Juanma Barranquero <lekktu@gmail.com>
6842
6843 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6844 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6845
8bbbc977
EZ
68462012-06-08 Eli Zaretskii <eliz@gnu.org>
6847
6848 * alloc.c (allocate_vectorlike): Fix last change.
6849
f3372c87
DA
68502012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6851
6852 Block-based vector allocation of small vectors.
6853 * lisp.h (struct vectorlike_header): New field `nbytes',
6854 adjust comment accordingly.
6855 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 6856 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
6857 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6858 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6859 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6860 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6861 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6862 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6863 (roundup_size): New constant.
6864 (struct vector_block): New data type.
6865 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 6866 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
6867 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6868 (sweep_vectors): New functions.
6869 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 6870 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
6871 or equal to VBLOCK_BYTES_MAX.
6872 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6873 (init_alloc_once): Add call to init_vectors.
6874
4f18a4ed
SM
68752012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6876
6877 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6878
86f158bc
PE
68792012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6880
6881 * doprnt.c (doprnt): Truncate multibyte char correctly.
6882 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6883 would mishandle a string argument "Xc" if X was a multibyte
6884 character of length 2: it would truncate after X's first byte
6885 rather than including all of X.
6886
c5cfcbe0
CY
68872012-06-06 Chong Yidong <cyd@gnu.org>
6888
6889 * buffer.c (word_wrap): Doc fix.
6890
c05cf390
PE
68912012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6892
6893 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6894
0c3461de
GM
68952012-06-03 Glenn Morris <rgm@gnu.org>
6896
6897 * xdisp.c (tool-bar-style): Doc fix.
6898
c71232db
UM
68992012-06-03 Ulrich Müller <ulm@gentoo.org>
6900
6901 * Makefile.in (PAXCTL): Define.
6902 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6903 binary via PaX flags if the paxctl utility is available.
6904 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6905 Restore PaX flags to their default. (Bug#11398)
6906
383f7350
CY
69072012-06-03 Chong Yidong <cyd@gnu.org>
6908
6909 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6910 buffer (Bug#11226).
6911
5f2c76c6
CY
69122012-06-03 Chong Yidong <cyd@gnu.org>
6913
6914 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6915 (note_mode_line_or_margin_highlight): If there is no help echo,
6916 use mode-line-default-help-echo. Handle the case where the mouse
6917 position is past the end of the mode line string.
6918
6919 * buffer.c (buffer_local_value_1): New function, split from
6920 Fbuffer_local_value; can return Qunbound.
6921 (Fbuffer_local_value): Use it.
6922 (Vmode_line_format): Docstring tweaks.
6923
773d47f6
PE
69242012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6925
6926 * sysdep.c (system_process_attributes): Improve comment.
6927
f2d6a3df
SM
69282012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6929
6930 * keyboard.c: Export real-this-command to Elisp.
6931 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6932 and DEFVAR it. Update all users.
6933
63810350
PE
69342012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6935
7bd5c1f4
PE
6936 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6937
63810350
PE
6938 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6939 Convert pctcpu and pctmem to Lisp float properly.
6940 Let the compiler fold better, as 100.0/0x8000 is exact.
6941
a2821611
AS
69422012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6943
6944 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6945 cons_block.
6946
5fceba1d
PE
69472012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6948
6949 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6950
c98ff5dd
DA
69512012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6952
6953 For a 'struct window', replace some Lisp_Object fields to
6954 bitfields where appropriate, remove unused fields.
6955 * window.h (struct window): Remove unused 'last_mark_x' and
6956 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6957 change it's type from Lisp_Object to bitfield.
6958 Change type of 'force_start', 'optional_new_start',
6959 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 6960 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 6961
ca34e0be
PE
69622012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6963
6964 Pacify gcc -Wdouble-precision when using Xaw.
6965 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6966 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6967 Use 'float' consistently, rather than 'float' in most places
6968 and 'double' in a couple of places.
6969
efc00ab1 69702012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
6971
6972 * xdisp.c (handle_stop): Detect whether we have overlay strings
6973 loaded by testing it->current.overlay_string_index to be
6974 non-negative, instead of checking whether n_overlay_strings is
6975 positive. (Bug#11587)
6976
efc00ab1 69772012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
6978
6979 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6980
6981 * doc.c (Fsubstitute_command_keys): Doc fix.
6982
efc00ab1 69832012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
6984
6985 * search.c (search_buffer): Remove calls to
6986 r_alloc_inhibit_buffer_relocation, as it is now called by
6987 maybe_unify_char, which was the cause of relocation of buffer text
6988 in bug#11519.
6989
efc00ab1 69902012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
6991
6992 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6993 for the duration of call to load_charset, to avoid problems with
6994 callers of maybe_unify_char that access buffer text through C
6995 pointers.
6996
6997 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6998 decrement the inhibition flag, instead of just setting or
6999 resetting it.
7000
ba93a187
PE
70012012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7002
7003 Remove obsolete '#define static' cruft.
7004 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
7005 This #undef was "temporary" in 2000; it is no longer needed
7006 now that '#define static' has gone away.
7007 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
7008 (gray_bitmap_bits): Remove; no longer needed.
7009 All uses replaced with definiens.
7010 * xterm.c: Include "bitmaps/gray.xbm".
7011
9e4bf381
PE
70122012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7013
7014 Clean up __executable_start, monstartup when --enable-profiling.
7015 The following changes affect the code only when profiling.
7016 * dispnew.c (__executable_start): Rename from safe_bcopy.
7017 Define only on platforms that need it.
7018 * emacs.c: Include <sys/gmon.h> when profiling.
7019 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
7020 (__executable_start): Remove decl, since lisp.h does it now.
7021 (safe_bcopy): Remove decl; no longer has that name.
7022 (main): Coalesce #if into single bit of code, for simplicity.
7023 Cast pointers to uintptr_t, since standard libraries want integers
7024 and not pointers.
7025 * lisp.h (__executable_start): New decl.
7026
32d72c2f
GM
70272012-05-31 Glenn Morris <rgm@gnu.org>
7028
7029 * image.c (Fimagemagick_types): Doc fix.
7030
baac5bc7
JM
70312012-05-30 Jim Meyering <meyering@redhat.com>
7032
7033 * callproc.c (Fcall_process_region): Include directory component
7034 in mkstemp error message (Bug#11586).
7035
72cb32cf
PE
70362012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7037
7038 * alloc.c, lisp.h (make_pure_vector): Now static.
7039
61b108cc
SM
70402012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
7041
7042 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7043 Move to byte-run.el.
7044 (Fautoload): Do the hash-doc more carefully.
7045 * data.c (Fdefalias): Purify definition, except for keymaps.
7046 (Qdefun): Move from eval.c.
7047 * lisp.h (Qdefun): Remove.
7048 * lread.c (read1): Tiny simplification.
7049
471fe23d
TN
70502012-05-29 Troels Nielsen <bn.troels@gmail.com>
7051
934f3f58 7052 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
7053 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7054 Bug#9642, but explicitly check that the buffer the overlay would
7055 be moved to is live and rearrange lines to make sure that errors
7056 will not put the overlay in an inconsistent state.
7057 (Fdelete_overlay): Cosmetics.
7058
85d0efd1
EZ
70592012-05-28 Eli Zaretskii <eliz@gnu.org>
7060
7061 * w32term.c (my_bring_window_to_top): New function.
7062 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
7063 could be different from the original one.
7064 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
7065 (Bug#11513)
7066
7067 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7068 by calling BringWindowToTop.
7069
7070 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
7071 (WM_EMACS_END): Increase by one.
7072
da92a98c
PE
70732012-05-28 Paul Eggert <eggert@cs.ucla.edu>
7074
7075 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
7076 This avoids undefined behavior that might cause the eassert
7077 to not catch an out-of-range value.
7078
74d1f848
JB
70792012-05-28 Juanma Barranquero <lekktu@gmail.com>
7080
7081 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7082 Update dependencies.
7083
9e1a06fc
EZ
70842012-05-27 Eli Zaretskii <eliz@gnu.org>
7085
7086 * bidi.c (bidi_mirror_char): Fix last change.
7087
f3dd7312
AS
70882012-05-27 Andreas Schwab <schwab@linux-m68k.org>
7089
7090 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7091 when referring to sectname field in printf format.
7092
81899c91
PE
70932012-05-27 Paul Eggert <eggert@cs.ucla.edu>
7094
57b81a9f
PE
7095 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7096 Only r_alloc_inhibit_buffer_relocation needed to be added;
7097 the others were already declared.
7098
81899c91
PE
7099 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7100 before checking whether it's out of range. Put the check inside
7101 eassert. See
7102 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7103
33017faf 71042012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
7105
7106 * callproc.c (Fcall_process): Restore a line that was accidentally
7107 commented out in the 2011-02-13 change (bug#11547).
7108
33017faf 71092012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
7110
7111 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7112 defined on ralloc.c.
7113
7114 * buffer.c [REL_ALLOC]: Remove prototypes of
7115 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7116 they are now on lisp.h.
7117
7118 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7119
7120 * search.c (search_buffer): Use it to inhibit relocation of buffer
7121 text while re_search_2 is doing its job, because re_search_2 is
7122 passed C pointers to buffer text. (Bug#11519)
7123
23415acf
EZ
7124 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7125 Update value to 24.
7126
44e27368
EZ
7127 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7128 state after an additional call to move_it_in_display_line_to, keep
7129 the values of it->max_ascent and it->max_descent found for the
7130 entire line.
7131 (pos_visible_p): Revert the comparison against bottom_y to what it
7132 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7133 (Bug#11464)
7134
c1892f11
PE
71352012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7136
7137 Fix coding-related core dumps with gcc -ftrapv.
7138 The code was computing A - B, where A and B are pointers, and B is
7139 random garbage. This can lead to core dumps on platforms that
7140 have special pointer registers, and it also leads to core dumps on
7141 x86-64 when compiled with gcc -ftrapv. The fix is to compute
7142 A - B only when B is initialized properly.
7143 * coding.c (coding_set_source, coding_set_destination): Return void.
7144 (coding_change_source, coding_change_destinations): New functions,
7145 with the old behaviors of coding_set_source and coding_set_destination.
7146 All callers that need an offset changed to use these new functions.
7147
eb7afdad
GM
71482012-05-26 Glenn Morris <rgm@gnu.org>
7149
7150 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
7151
f12fdf02
EZ
71522012-05-26 Eli Zaretskii <eliz@gnu.org>
7153
53a63be6 7154 Extend mouse support on W32 text-mode console.
61b108cc
SM
7155 * xdisp.c (draw_row_with_mouse_face):
7156 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 7157
eb3f6f01 7158 * w32console.c: Include window.h.
61b108cc
SM
7159 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
7160 New functions.
eb3f6f01
EZ
7161 (initialize_w32_display): Initialize mouse-highlight data.
7162
53a63be6
EZ
7163 * w32inevt.c: Include termchar.h and window.h.
7164 (do_mouse_event): Support mouse-autoselect-window. When the mouse
7165 moves, call note_mouse_highlight. If help_echo changed, call
7166 gen_help_event to produce help-echo message in the echo area.
7167 Call clear_mouse_face if mouse_face_hidden is set in the mouse
7168 highlight info.
7169
4cfd81f6
PE
71702012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7171
7172 * lread.c (read1): Simplify slightly to avoid an overflow warning
7173 with GCC 4.7.0 on x86-64.
7174
4446092a
EZ
71752012-05-26 Eli Zaretskii <eliz@gnu.org>
7176
7177 * bidi.c (bidi_mirror_char): Revert last change: an int is
7178 definitely wide enough here.
7179
42b2a986 71802012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 7181
42b2a986 7182 Fix integer width and related bugs (Bug#9874).
eb106a49 7183 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
7184 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
7185 (string_bytes, check_sblock, allocate_string_data):
7186 (compact_small_strings, Fmake_bool_vector, make_string)
7187 (make_unibyte_string, make_multibyte_string)
7188 (make_string_from_bytes, make_specified_string)
7189 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
7190 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
7191 (mark_vectorlike):
7192 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7193 (allocate_pseudovector):
7194 Use int, not EMACS_INT, where int is wide enough.
7195 (inhibit_garbage_collection, Fgarbage_collect):
7196 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7197 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
7198 int might not be wide enough.
7199 (bidi_cache_search, bidi_cache_find, bidi_init_it)
7200 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
7201 (bidi_at_paragraph_end, bidi_find_paragraph_start)
7202 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7203 (bidi_level_of_next_char, bidi_move_to_visually_next):
7204 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7205 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
7206 (Fkill_buffer, Fset_buffer_major_mode)
7207 (advance_to_char_boundary, Fbuffer_swap_text)
7208 (Fset_buffer_multibyte, overlays_at, overlays_in)
7209 (overlay_touches_p, struct sortvec, record_overlay_string)
7210 (overlay_strings, recenter_overlay_lists)
7211 (adjust_overlays_for_insert, adjust_overlays_for_delete)
7212 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
7213 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
7214 (Foverlay_recenter, last_overlay_modification_hooks_used)
7215 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7216 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
7217 (validate_region): Omit unnecessary test for b <= e,
7218 since that's guaranteed by the previous test.
d311d28c
PE
7219 (adjust_overlays_for_delete): Avoid pos + length overflow.
7220 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7221 (report_overlay_modification):
7222 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7223 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7224 Omit pointer cast, which isn't needed anyway, and doesn't work
7225 after the EMACS_INT -> ptrdiff_t change.
02481186 7226 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
7227 * buffer.h: Adjust decls to match defn changes elsewhere.
7228 (struct buffer_text, struct buffer):
7229 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7230 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
7231 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7232 not int, to avoid needless 32-bit limit on 64-bit hosts.
7233 (exec_byte_code): Use tighter memory-full test, one that checks
7234 for alloca overflow. Don't compute the address of the object just
7235 before an array, as that's not portable. Use EMACS_INT, not
7236 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
7237 * callint.c (Fcall_interactively):
7238 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7239 * callproc.c (call_process_kill, Fcall_process):
7240 Don't assume pid_t fits into an Emacs fixnum.
7241 (call_process_cleanup, Fcall_process, child_setup):
7242 Don't assume pid_t fits into int.
7243 (call_process_cleanup, Fcall_process, delete_temp_file)
7244 (Fcall_process_region):
7245 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7246 (Fcall_process): Simplify handling of volatile integers.
7247 Use int, not EMACS_INT, where int will do.
7248 * casefiddle.c (casify_object, casify_region, operate_on_word)
7249 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7250 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7251 (casify_object): Avoid integer overflow when overallocating buffer.
7252 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 7253 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
7254 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7255 * category.h (CATEGORYP): Don't assume arg is nonnegative.
7256 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7257 integers are now checked earlier. All uses replaced with XINT.
7258 (ccl_driver):
7259 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7260 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
7261 (ccl_driver, Fregister_code_conversion_map):
7262 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
7263 (resolve_symbol_ccl_program): Check that vector header is in range.
7264 Always copy the vector, so that we can check its contents reliably
7265 now rather than having to recheck each instruction as it's being
7266 executed. Check that vector words fit in 'int'.
7267 (ccl_get_compiled_code, Fregister_ccl_program)
7268 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7269 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7270 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7271 contents are in range.
7272 (Fccl_execute_on_string): Check that status is in range.
7273 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7274 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7275 Accept and return EMACS_INT, not int, because callers can pass values
7276 out of 'int' range.
7277 (c_string_width, strwidth, lisp_string_width, chars_in_text)
7278 (multibyte_chars_in_text, parse_str_as_multibyte)
7279 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7280 (str_as_unibyte, str_to_unibyte, string_count_byte8)
7281 (string_escape_byte8, Fget_byte):
7282 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 7283 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
7284 avoid mishandling large integers.
7285 * character.h: Adjust decls to match defn changes elsewhere.
7286 * charset.c (load_charset_map_from_file, find_charsets_in_text)
7287 (Ffind_charset_region):
7288 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7289 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7290 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 7291 Don't assume fixnum fits in int.
d311d28c
PE
7292 (load_charset_map_from_vector, Fmap_charset_chars):
7293 Remove now-unnecessary CHECK_NATNUMs.
7294 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
7295 Don't rely on undefined behavior with signed left shift overflow.
7296 Don't assume unsigned int fits into fixnum, or that fixnum fits
7297 into unsigned int. Don't require max_code to be a valid fixnum;
7298 that's not true for gb10830 4-byte on a 32-bit host. Allow
7299 invalid_code to be a cons, for the same reason. Require code_offset
7300 to be a character. Avoid int overflow if max_char is close
7301 to INT_MAX.
7302 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7303 this is intended anyway and avoids some undefined behavior.
7304 (load_charset_map): Pass unsigned, not int, as 2nd arg of
7305 INDEX_TO_CODE_POINT, as that's what it expects.
7306 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
7307 * charset.h (DECODE_CHAR): Return int, not unsigned;
7308 this is what was intended anyway, and it avoids undefined behavior.
7309 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
7310 integer-overflow issues.
7311 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
7312 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
7313 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
7314 * chartab.c (Fmake_char_table, Fset_char_table_range)
7315 (uniprop_get_decoder, uniprop_get_encoder):
7316 Don't assume fixnum fits in int.
7317 * cmds.c (move_point): New function, that does the gist of
7318 Fforward_char and Fbackward_char, but does so while checking
7319 for integer overflow more accurately.
c96e5d6a 7320 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
7321 (Fforward_line, Fend_of_line, internal_self_insert)
7322 (internal_self_insert):
7323 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7324 Fix a FIXME, by checking for integer overflow when calculating
7325 target_clm and actual_clm.
7326 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 7327 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
7328 (ASSURE_DESTINATION, coding_alloc_by_realloc)
7329 (coding_alloc_by_making_gap, alloc_destination)
7330 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
7331 (encode_coding_utf_16, detect_coding_emacs_mule)
7332 (decode_coding_emacs_mule, encode_coding_emacs_mule)
7333 (detect_coding_iso_2022, decode_coding_iso_2022)
7334 (encode_invocation_designation, encode_designation_at_bol)
7335 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7336 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7337 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7338 (encode_coding_ccl, encode_coding_raw_text)
7339 (detect_coding_charset, decode_coding_charset)
7340 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7341 (produce_composition, produce_charset, produce_annotation)
7342 (decode_coding, handle_composition_annotation)
7343 (handle_charset_annotation, consume_chars, decode_coding_gap)
7344 (decode_coding_object, encode_coding_object, detect_coding_system)
7345 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7346 (code_convert_region, code_convert_string)
8f50130c
PE
7347 (Fdefine_coding_system_internal)
7348 (coding_set_source, coding_set_destination):
d311d28c
PE
7349 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7350 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7351 (Fdefine_coding_system_internal):
7352 Don't assume fixnums fit in int.
7353 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 7354 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
7355 (Funencodable_char_position, Fcheck_coding_systems_region)
7356 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 7357 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 7358 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 7359 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 7360 Don't access memory outside of the args array.
d311d28c 7361 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
7362 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7363 result of ENCODE_CHAR.
d311d28c
PE
7364 * coding.h: Adjust decls to match defn changes elsewhere.
7365 (struct coding_system):
7366 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7367 * composite.c (get_composition_id, find_composition)
7368 (run_composition_function, update_compositions)
7369 (compose_text, composition_gstring_put_cache)
7370 (composition_gstring_p, composition_gstring_width)
7371 (fill_gstring_header, fill_gstring_body, autocmp_chars)
7372 (composition_compute_stop_pos, composition_reseat_it)
7373 (composition_update_it, struct position_record)
7374 (find_automatic_composition, composition_adjust_point)
7375 (Fcomposition_get_gstring, Ffind_composition_internal):
7376 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7377 (update_compositions):
7378 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7379 * composite.h: Adjust decls to match defn changes elsewhere.
7380 (struct composition):
7381 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7382 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7383 Do not attempt to compute the address of the object just before a
7384 buffer; this is not portable.
7385 (Faref, Faset):
7386 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7387 (Faset): Use int, not EMACS_INT, where int is wide enough.
7388 (Fstring_to_number): Don't assume fixnums fit in int.
7389 (Frem): Don't assume arg is nonnegative.
7390 * dbusbind.c (xd_append_arg): Check for integers out of range.
7391 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 7392 (extract_signed, extract_unsigned): New functions.
243e0530
PE
7393 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7394 (xd_get_connection_references): Return ptrdiff_t, not int.
7395 All uses changed.
7396 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7397 (xd_read_message_1):
7398 Use int, not unsigned, where the dbus API uses int.
7399 (Fdbus_message_internal): Don't overflow mtype.
7400 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
7401 * dired.c (directory_files_internal, file_name_completion, scmp)
7402 (file_name_completion_stat):
7403 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7404 (file_name_completion): Don't overflow matchcount.
7405 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7406 * dispextern.h: Adjust decls to match defn changes elsewhere.
7407 (struct text_pos, struct glyph, struct bidi_saved_info)
7408 (struct bidi_string_data, struct bidi_it, struct composition_it)
7409 (struct it):
7410 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7411 (struct display_pos, struct composition_it, struct it):
7412 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7413 * dispnew.c (increment_matrix_positions)
7414 (increment_row_positions, mode_line_string)
7415 (marginal_area_string):
7416 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 7417 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
7418 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7419 (duration_to_sec_usec): New function, to check for overflow better.
7420 (Fsleep_for, sit_for): Use it.
7421 * doc.c (get_doc_string, store_function_docstring):
7422 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7423 (get_doc_string, Fsnarf_documentation):
7424 Use int, not EMACS_INT, where int is wide enough.
7425 (get_doc_string):
7426 Use SAFE_ALLOCA, not alloca.
7427 Check for overflow when converting EMACS_INT to off_t.
7428 * doprnt.c (doprnt):
7429 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7430 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7431 Don't assume uid_t fits into fixnum.
7432 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7433 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7434 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7435 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7436 (general_insert_function)
7437 (Finsert_char, make_buffer_string, make_buffer_string_both)
7438 (update_buffer_properties, Fbuffer_substring)
7439 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7440 (Fsubst_char_in_region, check_translation)
7441 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7442 (transpose_markers, Ftranspose_regions):
7443 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7444 (clip_to_bounds): Move to lisp.h as an inline function).
7445 (Fconstrain_to_field): Don't assume integers are nonnegative.
7446 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7447 (Fsubst_char_in_region, Fsave_restriction):
7448 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7449 (Femacs_pid): Don't assume pid_t fits into fixnum.
7450 (lo_time): Use int, not EMACS_INT, when int suffices.
7451 (lisp_time_argument): Check for usec out of range.
7452 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
7453 (Fuser_login_name, Fuser_full_name): Signal an error
7454 if a uid argument is out of range, rather than relying on
7455 undefined behavior.
c8d5c857
PE
7456 (Fformat_time_string): Remove now-unnecessary check.
7457 lisp_time_argument checks for out-of-range usec now.
243e0530 7458 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
7459 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7460 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7461 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7462 (init_cmdargs, Fdump_emacs):
7463 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7464 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7465 the bottom (typically) 32 bits of the fixnum.
7466 * eval.c (specpdl_size, call_debugger):
7467 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7468 (when_entered_debugger, Fbacktrace_debug):
7469 Don't assume fixnum can fit in int.
7470 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7471 the object just before a buffer; this is not portable.
7472 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7473 (grow_specpdl, unbind_to):
7474 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7475 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7476 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 7477 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
7478 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7479 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7480 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7481 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7482 (a_write, e_write):
7483 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7484 (Fcopy_file, non_regular_nbytes, read_non_regular)
7485 (Finsert_file_contents):
7486 Use int, not EMACS_INT, where int is wide enough.
7487 (READ_BUF_SIZE): Verify that it fits in int.
7488 (Finsert_file_contents): Check that counts are in proper range,
7489 rather than assuming fixnums fit into ptrdiff_t etc.
7490 Don't assume fixnums fit into int.
125b3835 7491 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
7492 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7493 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
7494 (string_char_to_byte, string_byte_to_char)
7495 (string_make_multibyte, string_to_multibyte)
7496 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7497 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7498 (substring_both, Fdelete, internal_equal, Ffillarray)
7499 (Fclear_string, mapcar1)
7500 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7501 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7502 (larger_vector, make_hash_table, maybe_resize_hash_table)
7503 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7504 (Fmaphash, secure_hash):
7505 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7506 (concat): Check for string index and length overflow.
7507 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7508 (Frequire):
7509 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7510 (larger_vector): New API (vec, incr_min, size_max) replaces old
7511 one (vec, new_size, init). This catches size overflow.
7512 INIT was removed because it was always Qnil.
7513 All callers changed.
7514 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7515 the upper bound on a hash table index size.
7516 (make_hash_table, maybe_resize_hash_table): Use it.
7517 (secure_hash): Computer start_byte and end_byte only after
7518 they're known to be in ptrdiff_t range.
7519 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7520 (Ffont_get_glyphs, Ffont_at):
7521 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7522 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7523 (Flist_fonts, Fopen_font):
7524 Don't assume fixnum can fit in int.
7525 (check_gstring): Don't assume index can fit in int.
7526 (font_match_p): Check that fixnum is a character, not a nonnegative
7527 fixnum, since the later code needs to stuff it into an int.
7528 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7529 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7530 conversion overflow issues.
7531 (Fopen_font): Check for integer out of range.
7532 (Ffont_get_glyphs): Don't assume index can fit in int.
7533 * font.h: Adjust decls to match defn changes elsewhere.
7534 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7535 integer overflow.
7536 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7537 printmax_t, where ptrdiff_t is wide enough.
7538 (Finternal_char_font):
7539 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7540 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7541 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7542 (Fset_frame_position, x_set_frame_parameters)
7543 (x_set_line_spacing, x_set_border_width)
7544 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7545 Check that fixnums are in proper range for system types.
7546 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7547 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7548 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7549 Use SAFE_ALLOCA_LISP, not alloca.
7550 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7551 intptr_t is wide enough.
7552 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7553 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7554 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7555 Check for fixnum out of range.
7556 * ftfont.c (ftfont_list): Don't assume index fits in int.
7557 Check that fixnums are in proper range for system types.
7558 (ftfont_shape_by_flt):
7559 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
7560 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7561 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7562 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7563 Check that fixnums are in proper range for system types.
7564 * gnutls.h: Adjust decls to match defn changes elsewhere.
7565 * gtkutil.c (xg_dialog_run):
7566 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7567 (update_frame_tool_bar):
7568 Check that fixnums are in proper range for system types.
7569 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 7570 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
7571 * indent.c (last_known_column, last_known_column_point):
7572 (current_column_bol_cache):
7573 (skip_invisible, current_column, check_display_width):
7574 (check_display_width, scan_for_column, current_column_1)
7575 (Findent_to, Fcurrent_indentation, position_indentation)
7576 (indented_beyond_p, Fmove_to_column, compute_motion):
7577 (Fcompute_motion, Fvertical_motion):
7578 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7579 (last_known_column_modified): Use EMACS_INT, not int.
7580 (check_display_width):
7581 (Fcompute_motion):
7582 Check that fixnums and floats are in proper range for system types.
7583 (compute_motion): Don't assume index or fixnum fits in int.
7584 (compute_motion, Fcompute_motion):
7585 Use int, not EMACS_INT, when it is wide enough.
7586 (vmotion): Omit local var start_hpos that is always 0; that way
7587 we don't need to worry about overflow in expressions involving it.
7588 * indent.h: Adjust decls to match defn changes elsewhere.
7589 (struct position):
7590 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7591 Use int, not EMACS_INT, where int is wide enough.
7592 Remove unused members ovstring_chars_done and tab_offset;
7593 all uses removed.
7594 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7595 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7596 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7597 (make_gap, copy_text, insert, insert_and_inherit)
7598 (insert_before_markers, insert_before_markers_and_inherit)
7599 (insert_1, count_combining_before, count_combining_after)
7600 (insert_1_both, insert_from_string)
7601 (insert_from_string_before_markers, insert_from_string_1)
7602 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7603 (adjust_after_replace, adjust_after_insert, replace_range)
7604 (replace_range_2, del_range, del_range_1, del_range_byte)
7605 (del_range_both, del_range_2, modify_region)
7606 (prepare_to_modify_buffer, signal_before_change)
7607 (signal_after_change, Fcombine_after_change_execute):
7608 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7609 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7610 (balance_an_interval, split_interval_right, split_interval_left)
7611 (find_interval, next_interval, update_interval)
7612 (adjust_intervals_for_insertion, delete_node, delete_interval)
7613 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7614 (static_offset_intervals, offset_intervals)
7615 (merge_interval_right, merge_interval_left, make_new_interval)
7616 (graft_intervals_into_buffer, temp_set_point_both)
7617 (temp_set_point, set_point, adjust_for_invis_intang)
7618 (set_point_both, move_if_not_intangible, get_property_and_range)
7619 (get_local_map, copy_intervals, copy_intervals_to_string)
7620 (compare_string_intervals, set_intervals_multibyte_1):
7621 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7622 * intervals.h: Adjust decls to match defn changes elsewhere.
7623 (struct interval):
7624 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7625 * keyboard.c (this_command_key_count, this_single_command_key_start)
7626 (before_command_key_count, before_command_echo_length, echo_now)
7627 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7628 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7629 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7630 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7631 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7632 (last_non_minibuf_size, last_point_position, echo_truncate)
7633 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7634 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7635 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7636 (stuff_buffered_input):
7637 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7638 (last_auto_save, command_loop_1, read_char):
7639 Use EMACS_INT, not int, to avoid integer overflow.
7640 (record_char): Avoid overflow in total_keys computation.
7641 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7642 * keyboard.h: Adjust decls to match defn changes elsewhere.
7643 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7644 (Fkey_description, Fdescribe_vector, Flookup_key):
7645 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7646 (click_position): New function, to check that positions are in range.
7647 (Fcurrent_active_maps):
7648 (describe_command):
7649 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7650 (Faccessible_keymaps, Fkey_description):
7651 (preferred_sequence_p):
7652 Don't assume fixnum can fit into int.
7653 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7654 Check for integer overflow in size calculations.
7655 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7656 avoid mishandling large integers.
7657 * lisp.h: Adjust decls to match defn changes elsewhere.
7658 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7659 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7660 (struct Lisp_Marker):
7661 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7662 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
7663 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7664 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7665 All callers changed.
7666 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7667 Assume the arg has valid form, since it always does.
7668 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7669 unsigned integer system type.
7670 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7671 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7672 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7673 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7674 (duration_to_sec_usec): New decl.
7675 * lread.c (read_from_string_index, read_from_string_index_byte)
7676 (read_from_string_limit, readchar, unreadchar, openp)
7677 (read_internal_start, read1, oblookup):
7678 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7679 (Fload, readevalloop, Feval_buffer, Feval_region):
7680 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7681 (openp): Check for out-of-range argument to 'access'.
7682 (read1): Use int, not EMACS_INT, where int is wide enough.
7683 Don't assume fixnum fits into int.
6efdadfd 7684 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
7685 (read_filtered_event): Use duration_to_sec_usec
7686 to do proper overflow checking on durations.
d311d28c
PE
7687 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7688 in size calculation.
7689 (Fexecute_kbd_macro):
7690 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7691 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7692 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7693 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7694 (set_marker_both, set_marker_restricted_both, marker_position)
7695 (marker_byte_position, Fbuffer_has_markers_at):
7696 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7697 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 7698 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
7699 It now merely ensures that the menu is large enough, without
7700 necessarily growing it, as this avoids some integer overflow issues.
7701 All callers changed.
7702 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7703 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7704 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7705 Use SAFE_ALLOCA_LISP, not alloca.
7706 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7707 to EMACS_INT. Check that fixnums are in proper range for system types.
7708 * minibuf.c (minibuf_prompt_width, string_to_object)
7709 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7710 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7711 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7712 (get_minibuffer, read_minibuf_unwind):
7713 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7714 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7715 this simplifies overflow checking. All callers changed.
7716 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7717 (Ftest_completion):
7718 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7719 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7720 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7721 Check that fixnums are in proper range for system types.
7722 (Fx_create_frame, Fx_show_tip):
7723 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7724 * nsfont.m (ns_findfonts, nsfont_list_family):
7725 Don't assume fixnum fits in long.
7726 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7727 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7728 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7729 wide enough.
17fdb222 7730 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
7731 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7732 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7733 (PRINTDECLARE, PRINTPREPARE):
7734 (strout, print_string):
7735 (print, print_preprocess, print_check_string_charset_prop)
7736 (print_object):
7737 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7738 (PRINTDECLARE):
7739 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7740 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7741 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 7742 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 7743 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
7744 (print_error_message): Use SAFE_ALLOCA, not alloca.
7745 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
7746 (print_depth, new_backquote_output, print_number_index):
7747 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
7748 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7749 (Fset_process_window_size, Fformat_network_address)
7750 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 7751 (sigchld_handler):
d311d28c 7752 Check that fixnums are in proper range for system types.
d44287d4 7753 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
7754 Check for process-ids out of pid_t range rather than relying on
7755 undefined behavior.
e4d81efc 7756 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
7757 (Fformat_network_address, read_process_output, send_process)
7758 (Fprocess_send_region, status_notify):
7759 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7760 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7761 (wait_reading_process_output, read_process_output, exec_sentinel):
7762 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7763 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7764 (Faccept_process_output): Use duration_to_sec_usec to do proper
7765 overflow checking on durations.
dde14581
PE
7766 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7767 Don't assume pid_t fits in int.
02481186
PE
7768 * process.h (struct Lisp_Process): Members tick and update_tick
7769 are now of type EMACS_INT, not int.
b62b53e8
PE
7770 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7771 configured --with-wide-int.
d311d28c
PE
7772 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7773 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7774 * search.c (looking_at_1, string_match_1):
7775 (fast_string_match, fast_c_string_match_ignore_case)
7776 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7777 (scan_newline, find_before_next_newline, search_command)
7778 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7779 (set_search_regs, wordify):
7780 (Freplace_match):
7781 (Fmatch_data):
7782 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7783 (string_match_1, search_buffer, set_search_regs):
7784 (Fmatch_data):
7785 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7786 (wordify): Check for overflow in size calculation.
7787 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7788 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7789 Check that fixnums are in proper range for system types.
7790 * sound.c (struct sound_device)
7791 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7792 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7793 (Fplay_sound_internal):
7794 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 7795 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
7796 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7797 (Fparse_partial_sexp):
7798 Don't assume fixnums can fit in int.
7799 (struct lisp_parse_state, find_start_pos, find_start_value)
7800 (find_start_value_byte, find_start_begv)
7801 (update_syntax_table, char_quoted, dec_bytepos)
7802 (find_defun_start, prev_char_comend_first, back_comment):
7803 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7804 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7805 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7806 (Finternal_describe_syntax_value): Check that match_lisp is a
7807 character, not an integer, since the code stuffs it into int.
7808 (scan_words, scan_sexps_forward):
7809 Check that fixnums are in proper range for system types.
7810 (Fforward_word):
7811 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7812 (scan_sexps_forward):
7813 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7814 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7815 * syntax.h: Adjust decls to match defn changes elsewhere.
7816 (struct gl_state_s):
7817 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
7818 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7819 MOST_POSITIVE_FIXNUM.
d311d28c
PE
7820 * sysdep.c (wait_for_termination_1, wait_for_termination)
7821 (interruptible_wait_for_termination, mkdir):
7822 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7823 (emacs_read, emacs_write):
7824 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
7825 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7826 and double all fit in int.
d311d28c
PE
7827 * term.c (set_tty_color_mode):
7828 Check that fixnums are in proper range for system types.
7829 * termhooks.h (struct input_event):
7830 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7831 * textprop.c (validate_interval_range, interval_of)
7832 (Fadd_text_properties, set_text_properties_1)
7833 (Fremove_text_properties, Fremove_list_of_text_properties)
7834 (Ftext_property_any, Ftext_property_not_all)
7835 (copy_text_properties, text_property_list, extend_property_ranges)
7836 (verify_interval_modification):
7837 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7838 (Fnext_single_char_property_change)
7839 (Fprevious_single_char_property_change):
7840 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
7841 (copy_text_properties):
7842 Check for integer overflow in index calculation.
d311d28c
PE
7843 * undo.c (last_boundary_position, record_point, record_insert)
7844 (record_delete, record_marker_adjustment, record_change)
7845 (record_property_change):
7846 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7847 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7848 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7849 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7850 (Fx_hide_tip, Fx_file_dialog):
7851 * w32menu.c (set_frame_menubar):
7852 Use ptrdiff_t, not int, for consistency with rest of code.
7853 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7854 (select_window, Fdelete_other_windows_internal)
7855 (window_scroll_pixel_based, window_scroll_line_based)
7856 (Frecenter, Fset_window_configuration):
7857 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7858 (Fset_window_hscroll, run_window_configuration_change_hook)
7859 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 7860 (Fscroll_other_window, Frecenter):
d311d28c
PE
7861 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7862 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7863 Don't assume fixnum fits in int.
7864 (Fset_window_scroll_bars):
7865 Check that fixnums are in proper range for system types.
7866 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7867 (string_pos, c_string_pos, number_of_chars, init_iterator)
7868 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7869 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7870 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
7871 (face_before_or_after_it_pos, handle_invisible_prop)
7872 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
7873 (display_prop_intangible_p, string_buffer_position_lim)
7874 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7875 (get_overlay_strings_1, get_overlay_strings)
7876 (iterate_out_of_display_property, forward_to_next_line_start)
7877 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7878 (get_next_display_element, set_iterator_to_next)
7879 (get_visually_first_element, compute_stop_pos_backwards)
7880 (handle_stop_backwards, next_element_from_buffer)
7881 (move_it_in_display_line_to, move_it_in_display_line)
7882 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7883 (add_to_log, message_dolog, message_log_check_duplicate)
7884 (message2, message2_nolog, message3, message3_nolog
7885 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7886 (current_message_1, truncate_echo_area, truncate_message_1)
7887 (set_message, set_message_1, store_mode_line_noprop)
7888 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7889 (text_outside_line_unchanged_p, check_point_in_composition)
7890 (reconsider_clip_changes)
7891 (redisplay_internal, set_cursor_from_row, try_scrolling)
7892 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7893 (redisplay_window, find_last_unchanged_at_beg_row)
7894 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7895 (trailing_whitespace_p, find_row_edges, display_line)
7896 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7897 (display_mode_element, store_mode_line_string)
7898 (pint2str, pint2hrstr, decode_mode_spec)
7899 (display_count_lines, display_string, draw_glyphs)
7900 (x_produce_glyphs, x_insert_glyphs)
7901 (rows_from_pos_range, mouse_face_from_buffer_pos)
7902 (fast_find_string_pos, mouse_face_from_string_pos)
7903 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7904 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7905 (safe_call, init_from_display_pos, handle_fontified_prop)
7906 (handle_single_display_spec, load_overlay_strings)
7907 (with_echo_area_buffer, setup_echo_area_for_printing)
7908 (display_echo_area, echo_area_display)
7909 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7910 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
7911 (redisplay_window, dump_glyph_row, display_mode_line)
7912 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 7913 (handle_display_spec, display_prop_string_p):
d311d28c
PE
7914 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7915 (handle_single_display_spec, build_desired_tool_bar_string)
7916 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7917 (get_specified_cursor_type):
7918 Check that fixnums are in proper range for system types.
7919 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7920 (Flookup_image_map):
7921 Don't assume fixnums fit in int.
7922 (compare_overlay_entries):
7923 Avoid mishandling comparisons due to subtraction overflow.
7924 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7925 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7926 (handle_tool_bar_click):
7927 Use int, not unsigned, since we prefer signed and the signedness
7928 doesn't matter here.
7929 (get_next_display_element, next_element_from_display_vector):
7930 Use int, not EMACS_INT, when int is wide enough.
7931 (start_hourglass): Use duration_to_sec_usec to do proper
7932 overflow checking on durations.
7933 * xfaces.c (Fbitmap_spec_p):
7934 Check that fixnums are in proper range for system types.
7935 (compare_fonts_by_sort_order):
7936 Avoid mishandling comparisons due to subtraction overflow.
7937 (Fx_family_fonts, realize_basic_faces):
7938 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7939 (Fx_family_fonts):
7940 Don't assume fixnum fits in int.
7941 Use SAFE_ALLOCA_LISP, not alloca.
7942 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7943 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7944 (face_at_buffer_position, face_for_overlay_string)
7945 (face_at_string_position):
7946 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7947 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7948 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7949 (Fx_show_tip):
7950 Check that fixnums are in proper range for system types.
7951 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7952 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7953 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7954 (Fx_change_window_property): Don't assume fixnums fit in int.
7955 * xfont.c (xfont_chars_supported):
7956 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7957 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7958 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7959 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7960 * xml.c (parse_region):
7961 * xrdb.c (magic_file_p):
7962 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7963 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7964 (x_get_local_selection, x_reply_selection_request)
7965 (x_handle_selection_request, wait_for_property_change):
7966 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7967 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7968 short is wide enough.
7969 (x_send_client_event): Don't assume fixnum fits in int.
7970 * xterm.c (x_x_to_emacs_modifiers):
7971 Don't assume EMACS_INT overflows nicely into int.
7972 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7973 may come from Lisp.
7974 (handle_one_xevent): NATNUMP can eval its arg twice.
7975 (x_connection_closed):
7976 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7977 * xterm.h: Adjust decls to match defn changes elsewhere.
7978 (struct scroll_bar): Use struct vectorlike_header
7979 rather than rolling our own approximation.
7980 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7981
c6574eb5
GM
79822012-05-25 Glenn Morris <rgm@gnu.org>
7983
7984 * lisp.mk (lisp): Update for more files being compiled now.
7985
e8d32c7e
SM
79862012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7987
48def666
SM
7988 * lread.c: Remove `read_pure' which makes no difference.
7989 (read_pure): Remove var.
7990 (unreadpure): Remove function.
7991 (readevalloop): Don't call read_list with -1 flag.
7992 (read1, read_vector): Don't test read_pure any more.
7993 (read_list): Simplify.
7994
e8d32c7e
SM
7995 * fileio.c, character.h: Minor style tweaks.
7996
4b2addb7
DA
79972012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7998
7999 * window.h (clip_changed): Remove useless declaration.
8000
584461b2
JB
80012012-05-22 Juanma Barranquero <lekktu@gmail.com>
8002
8003 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
8004 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
8005
34374650
PE
80062012-05-22 Paul Eggert <eggert@cs.ucla.edu>
8007
8008 Remove src/m/*.
8009 This directory predates autoconf and is no longer needed nowadays.
8010 Move its few remaining bits of functionality to where they're needed.
8011 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8012 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8013 * m/template.h: Remove.
8014 * Makefile.in (M_FILE): Remove. All uses removed.
8015 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
8016 * lisp.h (USE_LSB_TAG):
8017 * mem-limits.h (EXCEEDS_LISP_PTR):
8018 Use VAL_MAX, not VALBITS, in #if.
8019 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
8020 (EMACS_UINT): Define unconditionally now.
8021 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
8022 (BITS_PER_EMACS_INT): New constants, replacing
8023 what used to be in config.h, but not useful in #if.
8024 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
8025 define them any more.
8026 (VAL_MAX): New macro.
8027 (VALMASK): Use it.
8028 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
8029 BITS_PER_EMACS_INT, in #if.
8030 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8031 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
8032 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8033 * s/ms-w32.h (DATA_START):
8034 Move here from removed file m/intel386.h.
8035 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8036 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8037
261cb4bb
PE
80382012-05-21 Paul Eggert <eggert@cs.ucla.edu>
8039
8040 Assume C89 or later.
8041 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8042 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8043 (xrealloc):
8044 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8045 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8046 * textprop.c, tparam.c (NULL): Remove.
8047 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8048 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8049 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
8050 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8051 * xterm.c (input_signal_count): Assume volatile works.
8052
ff23cd9f
KB
80532012-05-21 Ken Brown <kbrown@cornell.edu>
8054
8055 * xgselect.c (xg_select): Fix first argument in call to 'select'
8056 (bug#11508).
8057
1b170bc6
KB
80582012-05-20 Ken Brown <kbrown@cornell.edu>
8059
8060 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 8061 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 8062
b2f4d39f
KB
80632012-05-19 Ken Brown <kbrown@cornell.edu>
8064
8065 * xfns.c (x_in_use): Remove `static' qualifier.
8066 * xterm.h (x_in_use): Declare.
8067 * xgselect.c: Include xterm.h.
8068 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8069 and `display_arg' (bug#9754).
8070
003fdae2
PE
80712012-05-19 Paul Eggert <eggert@cs.ucla.edu>
8072
9232a6d9
PE
8073 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
8074
003fdae2
PE
8075 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
8076 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8077
784b56e2
EZ
80782012-05-18 Eli Zaretskii <eliz@gnu.org>
8079
8080 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8081
8082 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 8083 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
8084
8085 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8086 reference to image_cache->refcount.
8087 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8088
a0a79cde
JL
80892012-05-17 Juri Linkov <juri@jurta.org>
8090
8091 * search.c (Fword_search_regexp, Fword_search_backward)
8092 (Fword_search_forward, Fword_search_backward_lax)
8093 (Fword_search_forward_lax): Move functions to isearch.el
8094 (bug#10145, bug#11381).
8095
b0572523
PE
80962012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8097
8098 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8099
9660f5fc
SM
81002012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8101
8102 * lread.c (init_obarray): Declare Qt and Qnil as special.
8103
4374de83
GM
81042012-05-14 Glenn Morris <rgm@gnu.org>
8105
8106 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 8107 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 8108
dc44c39a
PE
81092012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8110
078c97cb
PE
8111 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8112
dc44c39a
PE
8113 * unexaix.c: Port to more-recent AIX compilers.
8114 (report_error, report_error_1, make_hdr, copy_sym)
8115 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8116 Make arguments const char *, not char *, to avoid violations of C
8117 standard and to fix some AIX warnings reported by Gilles Pion.
8118
e18afed7 81192012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
8120
8121 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8122 already have overlays loaded.
8123 (handle_single_display_spec): Before returning without displaying
8124 fringe bitmap, synchronize the bidi iterator with the main display
8125 iterator, by calling iterate_out_of_display_property.
8126 (iterate_out_of_display_property): Detect buffer iteration by
8127 testing that it->string is a Lisp string.
8128 (get_next_display_element): When the current object is exhausted,
8129 and there's something on it->stack, call set_iterator_to_next to
8130 proceed with what's on the stack, instead of returning zero.
8131 (set_iterator_to_next): If called at the end of a Lisp string,
8132 proceed to consider_string_end without incrementing string
8133 position. Don't increment display vector index past the end of
8134 the display vector. (Bug#11417)
c8fb9dc6
EZ
8135 (pos_visible_p): Don't report a position visible when move_it_to
8136 stopped at the last line of window, which happens to be scanned
8137 backwards by the bidi iteration. (Bug#11464)
ac268e67 8138
e18afed7 81392012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
8140
8141 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8142 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
8143 are on a TTY, and thus unable to display on the fringes.
8144 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
8145 so we need to signal to the caller that this is a "replacing"
8146 display spec. This fixes display when the spec is invalid or we
8147 are on a TTY.
8148
e18afed7 81492012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
8150
8151 * unexaix.c (make_hdr): Fix typo in prototype.
8152 This bug broke the build on AIX. Problem reported by Gilles Pion.
8153
9d0a235a
MA
81542012-05-14 Michael Albinus <michael.albinus@gmx.de>
8155
8156 * keyboard.c (kbd_buffer_get_event): Read special events also in
8157 batch mode. (Bug#11415)
8158
9e6b06ed
GM
81592012-05-12 Glenn Morris <rgm@gnu.org>
8160
8161 * ns.mk: Update for ns_appbindir no longer having trailing "/".
8162
c1a1d7a3
EZ
81632012-05-12 Eli Zaretskii <eliz@gnu.org>
8164
8165 * lisp.mk (lisp): Add newcomment.elc.
8166
3fe7cdc8
GM
81672012-05-12 Glenn Morris <rgm@gnu.org>
8168
8169 * Makefile.in (MKDIR_P): New, set by configure.
8170 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
8171
53f7d2c0
PE
81722012-05-11 Paul Eggert <eggert@cs.ucla.edu>
8173
8174 Remove unused function hourglass_started.
8175 * dispextern.h (hourglass_started):
8176 * w32fns.c (hourglass_started):
8177 * xdisp.c (hourglass_started): Remove.
8178
75aafb17
JB
81792012-05-10 Juanma Barranquero <lekktu@gmail.com>
8180
8181 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
8182 Update dependencies.
8183
12959e8e
PE
81842012-05-10 Paul Eggert <eggert@cs.ucla.edu>
8185
97107e2e
PE
8186 * xgselect.c (xg_select): Put maxfds+1 into a var.
8187 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
8188
12959e8e
PE
8189 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
8190
836d29b3
DA
81912012-05-10 Dave Abrahams <dave@boostpro.com>
8192
8193 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
8194 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
8195
5cb67954
MA
81962012-05-09 Michael Albinus <michael.albinus@gmx.de>
8197
8198 * dbusbind.c (xd_registered_buses): New internal Lisp object.
8199 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
8200 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
8201 Initialize xd_registered_buses.
8202
3478ec45
PE
82032012-05-09 Paul Eggert <eggert@cs.ucla.edu>
8204
b263a6b0
PE
8205 Untag more efficiently if USE_LSB_TAG.
8206 This is based on a proposal by YAMAMOTO Mitsuharu in
8207 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
8208 For an admittedly artificial (nth 8000 longlist) benchmark on
8209 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
8210 Emacs's overall text size by 1%.
8211 * lisp.h (XUNTAG): New macro.
8212 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
8213 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
8214 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8215 * eval.c (Fautoload):
8216 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8217 * frame.h (XFRAME): Use XUNTAG.
8218
3478ec45
PE
8219 Port recent dbusbind.c changes to 32-bit --with-wide-int.
8220 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8221 Remove unportable assumptions about print widths of types like
8222 dbus_uint32_t.
8223 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8224 intptr_t when converting between pointer and integer, to avoid GCC
8225 warnings about wrong width.
8226
666b903b 82272012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
8228
8229 * w32proc.c (new_child): Force Windows to reserve only 64KB of
8230 stack for each reader_thread, instead of defaulting to 8MB
8231 determined by the linker. This avoids failures in creating
8232 subprocesses on Windows 7, see the discussion in this thread:
8233 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8234
b120cc17
JC
82352012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
8236
8237 Fix up display of the *Minibuf-0* buffer in the mini window.
8238 * keyboard.c (read_char): Don't clear the echo area if there's no
8239 message to clear.
8240 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 8241 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 8242
9a4b36f8
MA
82432012-05-07 Michael Albinus <michael.albinus@gmx.de>
8244
8245 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8246 batch mode.
8247
e5f9458f
CY
82482012-05-06 Chong Yidong <cyd@gnu.org>
8249
8250 * lisp.mk (lisp): Update.
8251
eceeb5fc 82522012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
8253
8254 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8255
71873e2b
SM
82562012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
8257
8258 * data.c (PUT_ERROR): New macro.
8259 (syms_of_data): Use it. Add new error type `user-error'.
8260 * undo.c (user_error): New function.
8261 (Fprimitive_undo): Use it.
8262 * print.c (print_error_message): Adjust print style for `user-error'.
8263 * keyboard.c (user_error): New function.
8264 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8265
ab0fa4e4
PE
82662012-05-03 Paul Eggert <eggert@cs.ucla.edu>
8267
8268 Do not limit current-time-string to years 1000..9999.
8269 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8270 (Fcurrent_time_string): Support any year that is supported by the
8271 underlying localtime representation. Don't use asctime, as it
8272 has undefined behavior for years outside the range -999..9999.
8273
7ed806a7
PE
82742012-05-02 Paul Eggert <eggert@cs.ucla.edu>
8275
8276 Fix race conditions involving setenv, gmtime, localtime, asctime.
8277 Without this fix, interrupts could mess up code that uses these
8278 nonreentrant functions, since setting TZ invalidates existing
8279 tm_zone or tzname values, and since most of these functions return
8280 pointers to static storage.
8281 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8282 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8283 Grow the critical sections to include not just invoking
8284 localtime/gmtime, but also accessing these functions' results
8285 including their tm_zone values if any, and any related TZ setting.
8286 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
8287 so that the struct tm is saved in the critical section.
8288 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
8289 motivated by the fact that memory allocation needs to be outside
8290 the critical section.
8291
0c16dfed
DA
82922012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
8293
8294 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8295 with RESET_INTERVAL.
8296
8297 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8298 Remove duplicated buffer name initialization.
8299
3f83ace8
JM
83002012-05-02 Jim Meyering <jim@meyering.net>
8301
8302 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8303
c7b8541e
JM
8304 * xfns.c (x_window): Use xstrdup (Bug#11375).
8305
90207a15 83062012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
8307
8308 * xdisp.c (pos_visible_p): If already at a newline from the
8309 display string before the 'while' loop, don't walk back the glyphs
8310 from it3.glyph_row. Solves assertion violation when the display
8311 string begins with a newline (egg.el). (Bug#11367)
8312
b593d6a9
AH
83132012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
8314
8315 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
8316 Move to simple.el.
8317
4737362e
GM
83182012-05-01 Glenn Morris <rgm@gnu.org>
8319
99cf43f9
GM
8320 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
8321 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
8322 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
8323 All were removed before 23.1.
8324
9311dcff
GM
8325 * dispnew.c: Remove HAVE_LIBNCURSES test;
8326 it is always true on relevant platforms.
8327
4d5c6349
GM
8328 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
8329 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
8330
4737362e
GM
8331 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
8332
74dd3a6b
AS
83332012-04-30 Andreas Schwab <schwab@linux-m68k.org>
8334
8335 * .gdbinit (xpr): Remove checks for no longer existing misc types.
8336 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8337 Remove.
8338
13c379ee
PE
83392012-04-28 Paul Eggert <eggert@cs.ucla.edu>
8340
8341 Do not avoid creating empty evaporating overlays (Bug#9642).
8342 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8343 That is, do not delete an evaporating overlay if it becomes
8344 empty after its bounds are adjusted to fit within its buffer.
8345 This fix caused other problems, and I'm reverting it until we get
8346 to the bottom of them.
8347
a8e7d6d7 83482012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
8349
8350 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8351
a8e7d6d7 83522012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
8353
8354 * xdisp.c (pos_visible_p): If the window start position is beyond
8355 ZV, start the display from buffer beginning. Prevents assertion
8356 violation in init_iterator when the minibuffer window is scrolled
8357 via the scroll bar.
8358
8359 * window.c (window_scroll_pixel_based): Likewise.
8360
a8e7d6d7 83612012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
8362
8363 * keymap.c (where_is_internal): Doc fix (Bug#10872).
8364
a8e7d6d7 83652012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
8366
8367 * fileio.c (Fcopy_file, Fset_file_selinux_context):
8368 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
8369
a8e7d6d7 83702012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 8371
b593d6a9
AH
8372 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8373 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 8374
1c6900d9
EZ
83752012-04-26 Eli Zaretskii <eliz@gnu.org>
8376
4c3fa1d9
EZ
8377 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8378 display element, check also the underlying string or buffer
8379 character. (Bug#11341)
8380
1c6900d9
EZ
8381 * w32menu.c: Include w32heap.h.
8382 (add_menu_item): If the call to AppendMenuW (via
8383 unicode_append_menu) fails, disable Unicode menus only if we are
8384 running on Windows 9X/Me.
8385
42bf8205
AS
83862012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8387
8388 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8389 (xgetint): Add missing shift for LSB tags.
8390
b1bac16e
MR
83912012-04-24 Martin Rudalics <rudalics@gmx.at>
8392
8393 * keyboard.c (read_char): Don't wipe echo area for select window
8394 events: These might get delayed via `mouse-autoselect-window'
8395 (Bug#11304).
8396
d69621cc
JB
83972012-04-24 Juanma Barranquero <lekktu@gmail.com>
8398
8399 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8400 manipulation of :loaded-from data.
8401
02fd101b
JB
84022012-04-23 Juanma Barranquero <lekktu@gmail.com>
8403
8404 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8405 now a cons (bug#11311).
8406
888bec30
PE
84072012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8408
89a438bd
PE
8409 Do not create empty overlays with the evaporate property (Bug#9642).
8410 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8411 if it becomes empty after its bounds are adjusted to fit within
8412 its buffer. Without this fix, in a nonempty buffer (let ((o
8413 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8414 yields an empty overlay that has the evaporate property, which is
8415 not supposed to happen.
8416
1068fe4d
PE
8417 Fix minor GTK3 problems found by static checking.
8418 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8419 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8420 (struct _EmacsFixedClass, emacs_fixed_get_type):
8421 Move decls here from emacsgtkfixed.h, since they needn't be public.
8422 (emacs_fixed_get_type): Now static.
8423 (emacs_fixed_class_init): Omit unused local.
8424 (emacs_fixed_child_type): Remove; unused.
8425 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8426 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8427 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8428 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8429 (EMACS_FIXED_GET_CLASS): Remove; unused.
8430 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8431
888bec30
PE
8432 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8433 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8434
de85e130
PE
84352012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8436
d0baac98 8437 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 8438 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
8439 (__malloc_size_t, __malloc_ptrdiff_t):
8440 Remove. All uses removed, replaced by the definiens if needed,
8441 since we can assume C89 or better now.
8442 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8443 (protect_malloc_state, align, get_contiguous_space)
8444 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8445 (malloc_atfork_handler_child, malloc_enable_thread)
8446 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8447 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8448 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8449 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8450 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8451 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8452 Define using prototypes, not old style.
8453 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8454 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8455 (align): Don't assume that signed integer overflow wraps around.
8456 Omit unused local var.
8457 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8458 (_free_internal_nolock, memalign, mallochook, reallochook):
8459 Omit no-longer-needed casts.
8460 (valloc): Use getpagesize, not __getpagesize.
8461 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8462 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8463
de85e130
PE
8464 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8465
dcbf5805
MA
84662012-04-22 Michael Albinus <michael.albinus@gmx.de>
8467
8468 Move functions from C to Lisp. Make non-blocking method calls
8469 the default. Implement further D-Bus standard interfaces.
8470
8471 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8472 (QCdbus_request_name_allow_replacement)
8473 (QCdbus_request_name_replace_existing)
8474 (QCdbus_request_name_do_not_queue)
8475 (QCdbus_request_name_reply_primary_owner)
8476 (QCdbus_request_name_reply_in_queue)
8477 (QCdbus_request_name_reply_exists)
8478 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8479 (QCdbus_registered_serial, QCdbus_registered_method)
8480 (QCdbus_registered_signal): New Lisp objects.
8481 (XD_DEBUG_MESSAGE): Use sizeof.
8482 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8483 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8484 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8485 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8486 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8487 (xd_signature, xd_append_arg): Allow float for integer types.
8488 (xd_get_connection_references): New function.
b593d6a9
AH
8489 (xd_get_connection_address): Rename from xd_initialize.
8490 Return cached address.
dcbf5805
MA
8491 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8492 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8493 level.
8494 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 8495 Return number of refcounts.
dcbf5805
MA
8496 (Fdbus_get_unique_name): Make stronger parameter check.
8497 (Fdbus_message_internal): New defun.
8498 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8499 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8500 (Fdbus_send_signal, Fdbus_register_service)
8501 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8502 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8503 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8504 (Vdbus_compiled_version, Vdbus_runtime_version)
8505 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8506 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8507 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
8508 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8509 Adapt docstring.
dcbf5805 8510
52828e02
PE
85112012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8512
da05bc4c
PE
8513 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8514 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8515 Do not assume ptrdiff_t is the same width as 'int'.
8516
52828e02
PE
8517 * alloc.c: Handle unusual debugging option combinations.
8518 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8519 since the two debugging options are incompatible.
8520 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8521 is defined.
8522 (mem_init, mem_insert, mem_insert_fixup):
8523 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8524 (NEED_MEM_INSERT): Remove; no longer needed.
8525
f01769f9
LL
85262012-04-22 Leo Liu <sdl.web@gmail.com>
8527
8528 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8529
5790543d
PE
85302012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8531
8532 * sysdep.c [__FreeBSD__]: Minor cleanups.
8533 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8534 Use Emacs indenting style more consistently. Avoid some casts.
8535 Use 'double' consistently rather than mixing 'float' and 'double'.
8536
b91b7e4d
EW
85372012-04-21 Eduard Wiebe <usenet@pusto.de>
8538
b593d6a9
AH
8539 * sysdep.c (list_system_processes, system_process_attributes):
8540 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 8541
6114eb15
AS
85422012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8543
8544 * lisp.mk (lisp): Update.
8545
2f38dff7
PE
85462012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8547
8548 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8549 It is never used otherwise.
8550
4ae29f89
SM
85512012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8552
8553 * print.c (print_preprocess): Only check print_depth if print-circle
8554 is nil.
8555 (print_object): Check for cycles even when print-circle is nil and
8556 print-gensym is t, but only check print_depth if print-circle is nil.
8557
f30d612a
CY
85582012-04-20 Chong Yidong <cyd@gnu.org>
8559
8560 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8561 set the status to "failed" and ensure that sentinel is run.
8562
c07a4c0b 85632012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
8564
8565 * process.c (Fset_process_inherit_coding_system_flag)
8566 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 8567 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 8568
c07a4c0b 85692012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
8570
8571 * xdisp.c (string_buffer_position_lim): Limit starting position to
8572 BEGV.
8573 (set_cursor_from_row): If called for a mode-line or header-line
8574 row, return zero immediately.
8575 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
8576 farther than the first row after the header line, if any.
8577 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
8578 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8579
c07a4c0b 85802012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8581
4ae29f89
SM
8582 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8583 (bug#11238).
ad3a2b41 8584
c07a4c0b 85852012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 85862012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
8587
8588 configure: new option --enable-gcc-warnings (Bug#11207)
8589 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8590 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8591 (ALL_CFLAGS): Use new macros rather than old.
8592 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8593 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8594 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8595 -Wunused-result, -Wunused-variable. This should go away once
8596 the Emacs and Gnulib regex code is merged.
8597 (xmalloc, xrealloc): Now static.
8598
aba027e8
PE
85992012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8600
8601 * dired.c (Fsystem_groups): Remove unused local.
8602
e5a36063
GM
86032012-04-17 Glenn Morris <rgm@gnu.org>
8604
8605 * dired.c (Fsystem_users): Doc fix.
8606
316411f0
DA
86072012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8608
8609 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8610 (syms_of_dired): Add them.
8611
9426aba4
PE
86122012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8613
b62a57be
PE
8614 Fix minor alloc.c problems found by static checking.
8615 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8616 New extern decls, to avoid calling undeclared functions.
8617 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8618 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8619 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8620 (NEED_MEM_INSERT): New macro.
8621 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 8622 Remove one incorrect comment and fix another.
b62a57be 8623
3539f31f
PE
8624 Fix minor ralloc.c problems found by static checking.
8625 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8626 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8627 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8628 (r_alloc_sbrk): Now static.
8629
a041960a
PE
8630 Improve ralloc.c interface checking.
8631 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8632 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8633 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8634 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8635 [REL_ALLOC]: ... to here, to check interface.
8636 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8637 Remove decls. This fixes an "It stinks!".
8638
9426aba4
PE
8639 * alloc.c (which_symbols): Fix alignment issue / type clash.
8640
d55c12ed
AS
86412012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8642
8643 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8644 (struct Lisp_Misc_Any): Likewise.
8645 (struct Lisp_Free): Likewise.
8646 * alloc.c (union aligned_Lisp_Symbol): Define.
8647 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8648 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8649 (union aligned_Lisp_Misc): Define.
8650 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8651 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 8652 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 8653
b948ce8b
PE
86542012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8655
8656 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8657 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8658 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8659 * s/netbsd.h, s/sol2-6.h:
8660 Remove definition of GC_MARK_STACK, since the default now works.
8661 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8662 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8663 no longer the default.
8664 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8665
35dc09a1 86662012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8667
35dc09a1
GM
8668 * lread.c (lisp_file_lexically_bound_p):
8669 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 8670
35dc09a1
GM
86712012-04-14 Eli Zaretskii <eliz@gnu.org>
8672
8673 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8674 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8675
86762012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8677
8678 * nsterm.m (constrainFrameRect): Always constrain when there is only
8679 one screen (Bug#10962).
8680
bcd86815
KB
86812012-04-13 Ken Brown <kbrown@cornell.edu>
8682
8683 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8684
c25df26e
RT
86852012-04-13 Reuben Thomas <rrt@sc3d.org>
8686
8687 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8688
0fc59f1e
DC
86892012-04-11 Daniel Colascione <dancol@dancol.org>
8690
8691 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8692 against is gone. It's better to use vfork now so that when Cygwin
8693 gains a new, working vfork, we use it automatically (bug#10398).
8694
de8c03dc
SM
86952012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8696
8697 * window.c (save_window_save): Obey window-point-insertion-type.
8698
2f097256
GM
86992012-04-11 Glenn Morris <rgm@gnu.org>
8700
8701 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8702
453b951e
SM
87032012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8704
8705 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8706
75f1671a 87072012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
8708
8709 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8710 (force_quit_count): New var.
8711 (handle_interrupt): Use it.
8712
2a8ce227
JB
87132012-04-10 Juanma Barranquero <lekktu@gmail.com>
8714
8715 * w32.c (w32_delayed_load): Record the full path of the library
8716 being loaded (bug#10424).
8717
935396c0
GM
87182012-04-09 Glenn Morris <rgm@gnu.org>
8719
05920a43
GM
8720 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8721 not just in the obarray, before snarfing them. (Bug#11036)
8722
935396c0
GM
8723 * Makefile.in ($(leimdir)/leim-list.el):
8724 Pass EMACS rather than BUILT_EMACS.
8725
a18ecafa
TZ
87262012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8727
8728 * process.c (make_process):
8729 * process.h: Add integer `gnutls_handshakes_tried' member to
8730 process struct.
8731
6bbef4e5
JC
8732 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8733 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
8734
8735 * gnutls.c (gnutls_log_function2i): Convenience log function.
8736 (emacs_gnutls_read): Use new log functions,
8737 `gnutls_handshakes_tried' process member, and
8738 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8739 attempts per process (connection).
8740
b4d3bc10
CY
87412012-04-09 Chong Yidong <cyd@gnu.org>
8742
8743 * eval.c (Fuser_variable_p, user_variable_p_eh)
8744 (lisp_indirect_variable): Functions deleted.
8745 (Fdefvar): Caller changed.
8746
8747 * callint.c (Finteractive, Fcall_interactively):
8748 * minibuf.c (Fread_variable): Callers changed.
8749
70f4d973
EZ
87502012-04-09 Eli Zaretskii <eliz@gnu.org>
8751
8752 * xdisp.c (set_cursor_from_row): If the display string appears in
8753 the buffer at position that is closer to point than the position
8754 after the display string, display the cursor on the first glyph of
8755 the display string. Fixes cursor display when a 'display' text
8756 property immediately follows invisible text. (Bug#11094)
8757
cb3c2e3e
PE
87582012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8759
8760 composite.c: use 'double' consistently
8761 * composite.c (get_composition_id): Use 'double' consistently
8762 instead of converting 'float' to 'double' and vice versa; this is
8763 easier to understand and avoids a GCC warning.
8764
fd06db5d
GM
87652012-04-09 Glenn Morris <rgm@gnu.org>
8766
50fe702a
GM
8767 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8768 preparation for dumping it with emacs. (Bug#4789)
8769 (leimdir): New variable.
8770 ($(leimdir)/leim-list.el): New rule.
8771 (emacs$(EXEEXT)): Depend on leim-list.el.
8772
fd06db5d
GM
8773 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8774 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8775 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8776
55c131ee
AS
87772012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8778
8779 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8780 proper alignment.
8781
9209588f
JB
87822012-04-07 Juanma Barranquero <lekktu@gmail.com>
8783
8784 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8785 Remove unused local variable.
8786
e3fb2efb
PE
87872012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8788
8789 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8790 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8791 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8792 objects, as mark_maybe_pointer will catch them otherwise.
8793 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8794 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8795
b5385551
PE
87962012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8797
8798 Fix typo that broke non-Windows builds.
8799 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8800
9078ead6
EZ
88012012-04-07 Eli Zaretskii <eliz@gnu.org>
8802
8803 Support building on MS-Windows with libxml2.
8804
8805 * makefile.w32-in (OBJ2): Add xml.$(O).
8806 (GLOBAL_SOURCES): Add xml.c.
8807 ($(BLD)/xml.$(O)): New dependency list.
8808
8809 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8810 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8811 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8812 [!WINDOWSNT]: New macros.
8813 (init_libxml2_functions, libxml2_loaded_p): New functions.
8814 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8815 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8816 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8817 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8818 linked in).
6bbef4e5
JC
8819 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8820 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
8821 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8822
8823 * emacs.c: Don't include libxml/parser.h.
8824 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8825 xmlCleanupParser directly.
8826
8827 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8828
3811fdf3
EZ
88292012-04-07 Eli Zaretskii <eliz@gnu.org>
8830
8831 * indent.c (Fvertical_motion): If there is a display string at
8832 point, use it.vpos to compute how many lines to backtrack after
8833 move_it_to point. (Bug#11133)
8834
2f8e16b2
EZ
88352012-04-06 Eli Zaretskii <eliz@gnu.org>
8836
8837 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8838 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8839 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8840 macros related to unification of CJK characters. For the details,
8841 see the discussion following the message here:
8842 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8843
3d439cd1
CY
88442012-04-04 Chong Yidong <cyd@gnu.org>
8845
8846 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8847
8bc53d00
EZ
88482012-04-01 Eli Zaretskii <eliz@gnu.org>
8849
8850 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8851 instead of alloca. (Bug#11138)
8852
3b0512a3
AS
88532012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8854
8855 * w32menu.c (is_simple_dialog): Properly check lisp types.
8856 (Bug#11141)
8857
8427ddd2
EZ
88582012-03-31 Eli Zaretskii <eliz@gnu.org>
8859
979022ef
EZ
8860 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8861 position we get to after a call to move_it_to fails the
8862 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8863 only if we wind up in a string from display property. (Bug#11063)
8864
a6b1c7cc
EZ
8865 * window.c (Fdelete_other_windows_internal): Invalidate the row
8866 and column information about mouse highlight, so that redisplay
8867 restores it after reallocating the glyph matrices. (Bug#7464)
8868
8427ddd2
EZ
8869 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8870 string comes from a `display' text property, use the buffer
8871 position of that property as if we actually saw that position in
8872 the row's glyphs.
697ba24b
EZ
8873 (move_it_by_lines): Remove the assertion that
8874 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8875 violated when there's a before-string at the beginning of a line.
8876 (Bug#11063)
8427ddd2 8877
65a0a738
EZ
88782012-03-30 Eli Zaretskii <eliz@gnu.org>
8879
8880 * xdisp.c (append_space_for_newline): If the default face was
8881 remapped, use the remapped face for the appended newline.
8882 (extend_face_to_end_of_line): Use the remapped default face for
8883 extending the face to the end of the line.
8884 (display_line): Call extend_face_to_end_of_line when the default
8885 face was remapped. (Bug#11068)
8886
581355cc
EZ
88872012-03-29 Eli Zaretskii <eliz@gnu.org>
8888
8889 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8890
e8fc049f
SM
88912012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8892
8893 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8894
4fb9a543
GM
88952012-03-27 Glenn Morris <rgm@gnu.org>
8896
8897 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8898 Doc fixes.
8899
679910f1
KH
89002012-03-26 Kenichi Handa <handa@m17n.org>
8901
8902 * dispextern.h (struct glyph): Fix previous change. Change the
8903 bit length of glyphless.ch to 25 (Bug#11082).
8904
90d49b7f
CY
89052012-03-26 Chong Yidong <cyd@gnu.org>
8906
8907 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8908 (command_loop_1): Use it; inhibit selection update for
8909 handle-select-window too (Bug#8996).
8910
f514f6f0
FP
89112012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8912
e8fc049f 8913 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 8914
bf43fa51
KH
89152012-03-25 Kenichi Handa <handa@m17n.org>
8916
8917 * dispextern.h (struct glyph): Change the bit length of
8918 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8919
8a0c01dd
EZ
89202012-03-24 Eli Zaretskii <eliz@gnu.org>
8921
8922 * s/ms-w32.h (tzname): Include time.h before redirecting to
8923 _tzname. Fixes the MSVC build. (Bug#9960)
8924
7d1c3a76
AS
89252012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8926
8ed79523
AS
8927 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8928 characters.
8929
7d1c3a76
AS
8930 * xterm.c (XTread_socket): Only modify handling_signal if
8931 !SYNC_INPUT. (Bug#11080)
8932
e99a9b8b
EZ
89332012-03-23 Eli Zaretskii <eliz@gnu.org>
8934
8935 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8936 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8937 when fetching a multibyte character consumes more bytes than
8938 CHAR_BYTES returns, due to unification of CJK characters in
8939 string_char. (Bug#11073)
8940
5063c0e1
TN
89412012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8942
8943 * process.c (wait_reading_process_output): Handle pty disconnect
8944 by refraining from sending oneself a SIGCHLD (bug#10933).
8945
9f851fbd
CY
89462012-03-22 Chong Yidong <cyd@gnu.org>
8947
8948 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8949
5063c0e1 8950 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
8951 Mark string as coming from a prefix property.
8952 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8953 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8954
fb5b8aca
CY
89552012-03-21 Chong Yidong <cyd@gnu.org>
8956
8957 * xfaces.c (Vface_remapping_alist): Doc fix.
8958
62356a1b
EZ
89592012-03-20 Eli Zaretskii <eliz@gnu.org>
8960
8961 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
8962 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8963 Doc fixes.
62356a1b 8964
025de85b
CY
89652012-03-20 Chong Yidong <cyd@gnu.org>
8966
8967 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8968 to reflect default non-nil value of redisplay-dont-pause.
8969
4827f94e
KH
89702012-03-19 Kenichi Handa <handa@m17n.org>
8971
8972 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8973 it fit in a valid range (Bug#11003).
8974
e50a24a2
EZ
89752012-03-18 Eli Zaretskii <eliz@gnu.org>
8976
8977 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8978 that is not from display property, accept the row as a "cursor
8979 row" if one of the string's character has a non-nil `cursor'
8980 property. Fixes cursor positioning when there are newlines in
8981 overlay strings, e.g. in icomplete.el. (Bug#11035)
8982
9af5ed87
PE
89832012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8984
8985 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8986
d1f55f16
CY
89872012-03-12 Chong Yidong <cyd@gnu.org>
8988
8989 * eval.c (inhibit_lisp_code): Rename from
8990 inhibit_window_configuration_change_hook; move from window.c.
8991
8992 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8993 * window.c (run_window_configuration_change_hook)
8994 (syms_of_window): Callers changed.
8995
66c5eebd
CY
89962012-03-11 Chong Yidong <cyd@gnu.org>
8997
413df973
CY
8998 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8999
66c5eebd
CY
9000 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
9001
1de11f56
CY
90022012-03-10 Chong Yidong <cyd@gnu.org>
9003
9004 * frame.c (other_visible_frames): Don't assume the selected frame
9005 is visible (Bug#10955).
9006
cae07000
SM
90072012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
9008
9009 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9010
89c94350
JD
90112012-03-08 Jan Djärv <jan.h.d@swipnet.se>
9012
9013 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9014 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
9015 zero (Bug#10954).
9016
999dd333
GM
90172012-03-03 Glenn Morris <rgm@gnu.org>
9018
01a6dcc8 9019 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 9020
de0100f2
EZ
90212012-03-02 Eli Zaretskii <eliz@gnu.org>
9022
9023 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
9024 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
9025 (redisplay_window, next_element_from_string): Fix typos in
9026 comments.
3e441275
EZ
9027 (redisplay_window): Pass to move_it_vertically the margin in
9028 pixels, not in screen lines.
de0100f2 9029
96a72ee9
GM
90302012-03-02 Glenn Morris <rgm@gnu.org>
9031
9032 * buffer.c (buffer-list-update-hook): Doc fix.
9033
312508d7
EZ
90342012-02-29 Eli Zaretskii <eliz@gnu.org>
9035
9036 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9037 push_it before setting up the iterator for the first overlay
9038 string, even if we have an empty string loaded.
9039 (next_overlay_string): If there's an empty string on the iterator
9040 stack, pop the stack. (Bug#10903)
9041
27f3c637
PE
90422012-02-25 Paul Eggert <eggert@cs.ucla.edu>
9043
9044 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9045 Suggested by Stefan Monnier in
9046 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9047 * alloc.c (widen_to_Lisp_Object): New static function.
9048 (mark_memory): Also mark Lisp_Objects by fetching pointer words
9049 and widening them to Lisp_Objects. This would work even if
9050 USE_LSB_TAG is defined and wide integers are used, which might
9051 happen in a future version of Emacs.
9052
3c9dfce6
CY
90532012-02-25 Chong Yidong <cyd@gnu.org>
9054
fa74b241
CY
9055 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9056 Doc fix.
9057
3c9dfce6
CY
9058 * xselect.c (Fx_selection_exists_p): Doc fix.
9059 (x_clipboard_manager_save_all): Print an informative message
9060 before saving to clipboard manager.
9061
9486df08
CY
90622012-02-24 Chong Yidong <cyd@gnu.org>
9063
9064 * keyboard.c (process_special_events): Handle all X selection
9065 requests in kbd_buffer, not just the next one (Bug#8869).
9066
f01d3321
CY
90672012-02-23 Chong Yidong <cyd@gnu.org>
9068
9069 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9070 call when setting menu-bar-lines and tool-bar-lines parameters.
9071 (unwind_create_frame_1): New helper function.
9072
9073 * window.c (inhibit_window_configuration_change_hook): New var.
9074 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 9075 (syms_of_window): Initialize it.
f01d3321 9076
86b847b6
CY
90772012-02-22 Chong Yidong <cyd@gnu.org>
9078
9079 * xterm.c (x_draw_image_relief): Add missing type check for
9080 Vtool_bar_button_margin (Bug#10743).
9081
a59225b1
CY
90822012-02-21 Chong Yidong <cyd@gnu.org>
9083
9084 * fileio.c (Vfile_name_handler_alist): Doc fix.
9085
9086 * buffer.c (Fget_file_buffer): Protect against invalid file
9087 handler return value.
9088
310f5bd4
PE
90892012-02-20 Paul Eggert <eggert@cs.ucla.edu>
9090
cb3a28cc
PE
9091 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9092 when computing $valmask.
9093
310f5bd4
PE
9094 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9095 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9096 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9097 It's useless in that case, and it can cause problems on hosts
9098 that allocate halves of EMACS_INT values separately.
9099 Reported by Dan Horák. Diagnosed by Andreas Schwab in
9100 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9101 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9102 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
9103 it avoids undefined behavior on hosts where shifting right by more
9104 than the word width has undefined behavior.
9105
2375c96a
CY
91062012-02-19 Chong Yidong <cyd@gnu.org>
9107
9108 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9109 (Funhandled_file_name_directory, Ffile_name_as_directory)
9110 (Fdirectory_file_name, Fexpand_file_name)
9111 (Fsubstitute_in_file_name): Protect against invalid file handler
9112 return values (Bug#10845).
9113
3eb49e71
EZ
91142012-02-18 Eli Zaretskii <eliz@gnu.org>
9115
9116 * .gdbinit (pitx): Fix incorrect references to fields of the
9117 iterator stack.
9118
7b926f3f
CY
91192012-02-17 Chong Yidong <cyd@gnu.org>
9120
9121 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9122
11273115
PE
91232012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9124
9125 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9126 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9127
c3a70e2b
CY
91282012-02-15 Chong Yidong <cyd@gnu.org>
9129
9130 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9131 marked as special. Also, starting docstrings with * is obsolete.
9132
0ca43699
AS
91332012-02-13 Andreas Schwab <schwab@linux-m68k.org>
9134
9135 * gnutls.c (emacs_gnutls_write): Fix last change.
9136
2e8f3c56
LI
91372012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
9138
9139 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9140 send_process.
9141
af70074f
SM
91422012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
9143
9144 * keymap.c (Fsingle_key_description): Handle char ranges.
9145
95986d52
CY
91462012-02-12 Chong Yidong <cyd@gnu.org>
9147
afd83bd1
CY
9148 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9149 as that creates a dangerous corner case.
9150
95986d52
CY
9151 * window.c (Fdelete_window_internal): Invalidate the mouse
9152 highlight (Bug#9904).
9153
bd7da63e
GM
91542012-02-12 Glenn Morris <rgm@gnu.org>
9155
9156 * xselect.c (Fx_own_selection_internal)
9157 (Fx_get_selection_internal, Fx_disown_selection_internal)
9158 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
9159 * nsselect.m (Fx_own_selection_internal)
9160 (Fx_disown_selection_internal, Fx_selection_exists_p)
9161 (Fx_selection_owner_p, Fx_get_selection_internal):
9162 Sync docs and argument specs with the xselect.c versions.
9163
77abcbc2
LI
91642012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
9165
9166 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
9167
90b671e2
EZ
91682012-02-11 Eli Zaretskii <eliz@gnu.org>
9169
1c0ca0b7
EZ
9170 * w32select.c (Fx_selection_exists_p): Sync doc string and
9171 argument list with xselect.c. (Bug#10783)
9172
9173 * w16select.c (Fx_selection_exists_p): Sync doc string and
9174 argument list with xselect.c. (Bug#10783)
90b671e2 9175
49241268
GM
91762012-02-10 Glenn Morris <rgm@gnu.org>
9177
9178 * fns.c (Fsecure_hash): Doc fix.
9179
f998bbe7 91802012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
9181
9182 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
9183
0992bd9c
CY
91842012-02-07 Chong Yidong <cyd@gnu.org>
9185
9186 * buffer.c (Fbuffer_local_variables)
9187 (buffer_lisp_local_variables): Handle unbound vars correctly;
9188 don't let Qunbound leak into Lisp.
9189
af008560
GM
91902012-02-07 Glenn Morris <rgm@gnu.org>
9191
dd605cc4
GM
9192 * image.c (Fimagemagick_types): Doc fix.
9193
af008560
GM
9194 * image.c (imagemagick-render-type): Change it from a lisp object
9195 to an integer. Move the doc here from the lisp manual.
9196 Treat all values not equal to 0 the same.
9197
1449fa1d
CY
91982012-02-06 Chong Yidong <cyd@gnu.org>
9199
9200 * doc.c (store_function_docstring): Avoid applying docstring of
9201 alias to base function (Bug#2603).
9202
3723ec07
AS
92032012-02-04 Andreas Schwab <schwab@linux-m68k.org>
9204
9205 * .gdbinit (pp1, pv1): Remove redundant defines.
9206 (pr): Use pp.
9207
79c1cc1e
CY
92082012-02-04 Chong Yidong <cyd@gnu.org>
9209
9210 * nsterm.m: Declare a global (Bug#10694).
9211
d7f29f8e
EZ
92122012-02-04 Eli Zaretskii <eliz@gnu.org>
9213
cae07000
SM
9214 * w32.c (get_emacs_configuration_options):
9215 Include --enable-checking, if specified, in the return value.
d7f29f8e 9216
3b95a6f9
MR
92172012-02-04 Martin Rudalics <rudalics@gmx.at>
9218
9219 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9220 after rounding frame sizes. (Bug#9723)
9221
d6fa96a6
EZ
92222012-02-04 Eli Zaretskii <eliz@gnu.org>
9223
9224 * keyboard.c (adjust_point_for_property): Don't position point
9225 before BEGV. (Bug#10696)
9226
df0b2940
PE
92272012-02-03 Paul Eggert <eggert@cs.ucla.edu>
9228
9229 Handle overflow when computing char display width (Bug#9496).
9230 * character.c (char_width): Return EMACS_INT, not int.
9231 (char_width, c_string_width): Check for overflow when
9232 computing the width; this is possible now that individual
9233 characters can have unbounded width. Problem introduced
9234 by merge from Emacs 23 on 2012-01-19.
9235
6bee44d6
MA
92362012-02-02 Michael Albinus <michael.albinus@gmx.de>
9237
9238 * dbusbind.c (Fdbus_register_method): Mention the return value
9239 :ignore in the docstring.
9240
44f92739
GM
92412012-02-02 Glenn Morris <rgm@gnu.org>
9242
1b9f60cc
GM
9243 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9244
44f92739
GM
9245 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9246 Unconditionally set to t. (Bug#10673)
9247 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9248 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9249 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9250
c5d3843c
KH
92512012-02-02 Kenichi Handa <handa@m17n.org>
9252
9253 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
9254 0, do not call append_composite_glyph.
9255
159462d4 92562012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
9257
9258 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9259 NULL (Bug#6988).
9260 (x_produce_glyphs): If the component of a composition is a null
9261 string, set it->pixel_width to 1 to avoid zero-width glyph.
9262
78cef877
EZ
92632012-02-01 Eli Zaretskii <eliz@gnu.org>
9264
9265 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9266 first 2 arguments are identical. This makes inserting large
9267 output from a subprocess an order of magnitude faster on
9268 MS-Windows, where all sbrk'ed memory is always contiguous.
9269
97897668
GM
92702012-01-31 Glenn Morris <rgm@gnu.org>
9271
9272 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 9273 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
9274 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9275
31fd3586
GM
92762012-01-29 Glenn Morris <rgm@gnu.org>
9277
9278 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9279
0e24a8b2
CY
92802012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
9281
9282 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9283
cc0adcb0
CY
92842012-01-28 Chong Yidong <cyd@gnu.org>
9285
9286 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9287
acc28cb9
CY
92882012-01-26 Chong Yidong <cyd@gnu.org>
9289
9c69cfb7
CY
9290 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9291
acc28cb9
CY
9292 * search.c (Fsearch_forward, Fsearch_backward): Document negative
9293 repeat counts (Bug#10507).
9294
48da7392
GM
92952012-01-26 Glenn Morris <rgm@gnu.org>
9296
9297 * lread.c (syms_of_lread): Doc fix.
9298
14af5f7f
CY
92992012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
9300
9301 * coding.c (encode_designation_at_bol): Change return value to
9302 EMACS_INT.
9303
0b21c100
CY
93042012-01-25 Chong Yidong <cyd@gnu.org>
9305
9306 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
9307
3c2907f7
CY
93082012-01-21 Chong Yidong <cyd@gnu.org>
9309
9310 * floatfns.c (Fcopysign): Make the second argument non-optional,
9311 since nil is not allowed anyway.
9312
959ad23f
AS
93132012-01-21 Andreas Schwab <schwab@linux-m68k.org>
9314
9315 * process.c (read_process_output): Use p instead of XPROCESS (proc).
9316 (send_process): Likewise.
9317
34a02f46
MR
93182012-01-19 Martin Rudalics <rudalics@gmx.at>
9319
9320 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
9321 (Vwindow_persistent_parameters): Do not use Qstate.
9322 Rewrite doc-strings.
34a02f46 9323
1259009a 93242012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
9325
9326 * character.c (char_width): New function.
70d4fdf6
GM
9327 (Fchar_width, c_string_width, lisp_string_width):
9328 Use char_width (Bug#9496).
25ed9e61 9329
6a6ee00d
MR
93302012-01-16 Martin Rudalics <rudalics@gmx.at>
9331
9332 * window.c (Vwindow_persistent_parameters): New variable.
9333 (Fset_window_configuration, save_window_save): Handle persistent
9334 window parameters.
9335
c85efaf7
EZ
93362012-01-14 Eli Zaretskii <eliz@gnu.org>
9337
9338 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9339 thrashing the stack of the thread. (Bug#9087)
9340
5944709e
PE
93412012-01-12 Paul Eggert <eggert@cs.ucla.edu>
9342
9343 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9344
e71f5d99
EZ
93452012-01-11 Eli Zaretskii <eliz@gnu.org>
9346
9347 * xdisp.c (rows_from_pos_range): Handle the case where the
9348 highlight ends on a newline. (Bug#10464)
9349 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9350 he end column for display of highlight that ends on a newline
9351 before a R2L line.
9352
ce316182
GM
93532012-01-11 Glenn Morris <rgm@gnu.org>
9354
9355 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9356 from load-path also when installation-directory is nil. (Bug#10208)
9357
5b43da69
GM
93582012-01-10 Glenn Morris <rgm@gnu.org>
9359
74cc8ff9
GM
9360 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9361
7d8d6e4e
GM
9362 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9363 Update template values to be closer to their typical values these days.
5b43da69 9364
a0db8d43
EZ
93652012-01-09 Eli Zaretskii <eliz@gnu.org>
9366
9367 * xdisp.c (rows_from_pos_range): Accept additional argument
9368 DISP_STRING, and accept any glyph in a row whose object is that
9369 string as eligible for mouse highlight. Fixes mouse highlight of
9370 display strings from overlays. (Bug#10464)
9371
9a0115ab 93722012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 9373
b9110d6a 9374 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
9375 * fileio.c (auto_saving_dir_umask): New static var.
9376 (Fmake_directory_internal): Use it.
9377 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9378 creating the directory. The old code temporarily assigns
9379 too-generous permissions to the directory.
9380 (do_auto_save_eh): Clear it.
b9110d6a 9381 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
9382 that the var is always cleared.
9383
6c1bd3f3
EZ
93842012-01-07 Eli Zaretskii <eliz@gnu.org>
9385
9386 * search.c (scan_buffer): Pass character positions to
9387 know_region_cache, not byte positions. (Bug#6540)
9388
069d2b50
L
93892012-01-07 LynX <_LynX@bk.ru> (tiny change)
9390
9391 * w32.c (sys_rename): Report EXDEV when rename of a directory
9392 fails because the target is on another logical disk. (Bug#10284)
9393
75bf0d33
DB
93942012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9395
9396 * xterm.c (x_embed_request_focus): New function.
9397
9398 * xterm.h: Add prototype.
9399
9400 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9401
1c6e5a32
GM
94022012-01-05 Glenn Morris <rgm@gnu.org>
9403
9404 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9405
651e947e
EZ
94062012-01-01 Eli Zaretskii <eliz@gnu.org>
9407
9408 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9409 Load gnutls_transport_set_lowat only if GnuTLS version is below
9410 2.11.1.
9411 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9412 GnuTLS versions below 2.11.1.
9413
3778cdd8
AL
94142011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9415
9416 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9417 to the doc string advising against its use for altering the way
9418 windows are scrolled.
9419
0e5317f7
KH
94202011-12-28 Kenichi Handa <handa@m17n.org>
9421
9422 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9423 coding-system ASCII compatible only when it does not produce BOM
9424 on encoding (Bug#10383).
9425
93d5ca1f
JD
94262011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9427
9428 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9429 can scroll.
9430 (create_and_show_popup_menu): Always use menu_position_func for
9431 Gtk3 (Bug#10361).
9432
ca22b785
AS
94332011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9434
9435 * callint.c (Fcall_interactively): Don't truncate prompt string.
9436
d048e1e6
EZ
94372011-12-23 Eli Zaretskii <eliz@gnu.org>
9438
9439 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9440 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 9441 resumed from there (after widening). (Bug#10360)
d048e1e6 9442
5ccaba1f
JD
94432011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9444
9445 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9446
204ee57f
JD
94472011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9448
b81d40f0
JB
9449 * nsterm.m (x_free_frame_resources):
9450 Release f->output_data.ns->miniimage.
204ee57f
JD
9451 (ns_index_color): Fix indentation. Do not retain
9452 color_table->colors[i].
9453
9454 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9455 before returning.
9456
9457 * nsfns.m (x_set_background_color): Assign return value from
9458 ns_index_color to face-background instead of NSColor*.
9459 (ns_implicitly_set_icon_type): Fix indentation.
9460 Change assignment in for loop to comparison.
9461
9462 * emacs.c (ns_pool): New variable.
9463 (main): Assign ns_pool.
9464 (Fkill_emacs): Call ns_release_autorelease_pool.
9465
9466 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9467 autorelease fdesc, release fdAttrs and tdict.
9468 (ns_get_covering_families): Release charset.
9469 (ns_findfonts): Release NSFontDescriptor created with new.
9470 (ns_uni_to_glyphs): Fix indentation.
9471 (setString): Release attrStr before assigning new value.
9472
c803b2b7
JD
94732011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9474
678f4426
JD
9475 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9476 and NS_IMPL_COCOA.
9477 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9478 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9479
cd394be1 94802011-12-18 David Reitter <reitter@cmu.edu>
678f4426 9481
5fecd5fc
JD
9482 * nsterm.m (ns_term_init): Subscribe for notifications
9483 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9484 to method trackingNotification in EmacsMenu.
9485
9486 * nsmenu.m (trackingMenu): New variable.
3771cb17 9487 (trackingNotification): New method (from Aquamacs).
5fecd5fc 9488 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 9489 from Aquamacs (Bug#7030).
678f4426
JD
9490
94912011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 9492
c803b2b7
JD
9493 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9494 (symbol_to_nsstring): Fix indentation.
9495 (ns_symbol_to_pb): New function.
cae07000
SM
9496 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9497 (Fns_rotate_cut_buffers_internal): Remove.
9498 (Fns_store_selection_internal): Rename from
c803b2b7
JD
9499 Fns_store_cut_buffer_internal.
9500 (ns_get_foreign_selection, Fx_own_selection_internal)
9501 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
9502 (Fns_get_selection_internal, Fns_store_selection_internal):
9503 Use ns_symbol_to_pb and check if return value is nil.
9504 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9505 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
9506 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9507 renamed to Sns_store_selection_internal.
9508 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9509 and remove this function.
9510 (ns_handle_selection_clear): Remove, never used.
9511 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9512 here.
9513
e1b01a3a
KB
95142011-12-17 Ken Brown <kbrown@cornell.edu>
9515
9516 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9517 GID is unknown (Bug#10257).
9518
2adb6e85
PE
95192011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9520
9521 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9522 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9523 which caused a build failure on GNU/Linux IA-64. This problem was
9524 introduced by my 2011-10-07 patch.
9525
d1d7b339
JL
95262011-12-15 Juri Linkov <juri@jurta.org>
9527
9528 * image.c (imagemagick_error): New function. (Bug#10112)
9529 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9530 Use `imagemagick_error' where ImageMagick functions return
9531 `MagickFalse'.
9532 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9533 proper order.
9534
100d5755
KH
95352011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9536
9537 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9538 fill background (Bug#8992).
9539
454592a6
MR
95402011-12-13 Martin Rudalics <rudalics@gmx.at>
9541
9542 * window.c (Vwindow_combination_resize)
9543 (Vwindow_combination_limit): Use t instead of non-nil in
9544 doc-strings.
61d4b438
MR
9545 (Vrecenter_redisplay): Add first sentence of doc-string on
9546 separate line.
53524d93 9547 (Frecenter): Fix doc-string typo.
454592a6 9548
3633e3aa
KH
95492011-12-11 Kenichi Handa <handa@m17n.org>
9550
9551 * coding.c (Funencodable_char_position): Pay attention to the
9552 buffer text relocation (Bug#9389).
9553
7b9d523a 95542011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 9555
7b9d523a
JD
9556 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9557 gtk_init (Bug#10100).
9558
b73189c6
EZ
95592011-12-10 Eli Zaretskii <eliz@gnu.org>
9560
9561 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9562 IT->string is nil. (Bug#10263)
9563
f7dfe5d6
JD
95642011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9565
83faebb4
JD
9566 * nsterm.h (x_free_frame_resources): Declare.
9567
f7dfe5d6
JD
9568 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9569 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9570
9571 * nsterm.h (ns_get_defaults_value): Declare.
9572
9573 * nsterm.m (ns_default): Call ns_get_defaults_value.
9574
7cd4e72c
EZ
95752011-12-09 Eli Zaretskii <eliz@gnu.org>
9576
9577 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9578 (Bug#10170)
9579
b34d7317
YM
95802011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9581
9582 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9583 that where the value of an _OBJC_* symbol points to is in the .bss
9584 section (Bug#10240).
9585
76470ad1
KH
95862011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9587
9588 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 9589 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 9590
745fff94
KH
95912011-12-08 Kenichi Handa <handa@m17n.org>
9592
9593 * ftfont.c (get_adstyle_property): Fix previous change
9594 (Bug#10233).
9595
6e44397c
JB
95962011-12-07 Juanma Barranquero <lekktu@gmail.com>
9597
9598 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9599 dirs from the default value of EMACSLOADPATH (bug#10208).
9600
7efa6272
GM
96012011-12-07 Glenn Morris <rgm@gnu.org>
9602
9603 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9604 installation and source directories as well. (Bug#10208)
9605
f6fc4d87
CY
96062011-12-06 Chong Yidong <cyd@gnu.org>
9607
9608 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9609
2bf26180
GM
96102011-12-06 Glenn Morris <rgm@gnu.org>
9611
9612 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9613 as an error, not just -1. (Bug#10217)
9614
3a6ad4f0
CY
96152011-12-05 Chong Yidong <cyd@gnu.org>
9616
9617 * keyboard.c (process_special_events): New function.
9618 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9619
75a3b399
PE
96202011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9621
9622 * coding.c (encode_designation_at_bol): Don't use uninitialized
9623 local variable (Bug#9318).
9624
c3c9e25e
KH
96252011-12-05 Kenichi Handa <handa@m17n.org>
9626
9627 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9628 return Qnil (Bug#8046, Bug#10193).
9629
5eb05ea3
KH
96302011-12-05 Kenichi Handa <handa@m17n.org>
9631
9632 * coding.c (encode_designation_at_bol): New args charbuf_end and
9633 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
9634 (coding_set_source): Return how many bytes coding->source was
9635 relocated.
9636 (coding_set_destination): Return how many bytes
9637 coding->destination was relocated.
9638 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 9639 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
9640
96412011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9642
9643 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9644 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9645 macro (Bug#9318).
9646
96472011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9648
9649 The following changes are to fix Bug#9318.
9650
a79703f5 9651 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
9652 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9653 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 9654 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 9655
7dbda6df
JB
96562011-12-05 Juanma Barranquero <lekktu@gmail.com>
9657
9658 * lisp.h (process_quit_flag): Fix external declaration.
9659
6d5eb5b0
SM
96602011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9661
9662 Don't macro-inline non-performance-critical code.
9663 * eval.c (process_quit_flag): New function.
9664 * lisp.h (QUIT): Use it.
9665
a0c3fad0
JD
96662011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9667
9668 * nsfns.m (get_geometry_from_preferences): New function.
9669 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9670
6c07aac2
AS
96712011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9672
9673 * emacs.c (Qkill_emacs): Define.
9674 (syms_of_emacs): Initialize it.
9675 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9676 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
9677 (quit_throw_to_read_char): Add parameter `from_signal'.
9678 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
9679 * lisp.h (QUIT): Call Fkill_emacs if requested.
9680
c052ead4
JD
96812011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9682
9683 * widget.c (update_wm_hints): Return if wmshell is null.
9684 (widget_update_wm_size_hints): New function.
9685
9686 * widget.h (widget_update_wm_size_hints): Declare.
9687
9688 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9689 widget_update_wm_size_hints (Bug#10104).
9690
9e49252b
EZ
96912011-12-03 Eli Zaretskii <eliz@gnu.org>
9692
9693 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9694 before a newline, prepare the bidi iterator for consuming the
9695 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 9696 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 9697
02b16839
JL
96982011-12-02 Juri Linkov <juri@jurta.org>
9699
9700 * search.c (Fword_search_regexp): New Lisp function created from
9701 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9702 (Fword_search_backward, Fword_search_forward)
9703 (Fword_search_backward_lax, Fword_search_forward_lax):
9704 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9705 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9706
0068070e
SM
97072011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9708
9709 * fileio.c (Finsert_file_contents): Move after-change-function call
9710 to before the "handled:" label, since all "goto handled" appear in
9711 cases where the *-change-functions have already been properly called
9712 (bug#10117).
9713
3360a3fc
AS
97142011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9715
9716 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9717 waiting for input. (Bug#10169)
9718
73d6c093
EZ
97192011-11-30 Eli Zaretskii <eliz@gnu.org>
9720
9721 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9722 verifies glyph row's hash code--we have just reallocated the
9723 glyphs, so their contents can be complete garbage. (Bug#10164)
9724
febe6bea
JB
97252011-11-30 Juanma Barranquero <lekktu@gmail.com>
9726
9727 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9728
801a4313
EZ
97292011-11-30 Eli Zaretskii <eliz@gnu.org>
9730
9731 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9732 attributes are tested _before_ calling verify_row_hash, to protect
9733 against GCC re-ordering of the tests. (Bug#10164)
9734
2b56b87e
JD
97352011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9736
9737 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9738
9739 * xterm.c (handle_one_xevent): Only set async_visible and friends
9740 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 9741 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
9742 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9743
dbf31225
PE
97442011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9745
9746 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9747 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9748 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9749 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9750 All uses changed to use GCPRO1 etc.
9751 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9752 Revert to old implementation (i.e., before 2011-03-11).
9753
1305621b
YM
97542011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9755
9756 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9757 of scroll runs so as to avoid assigning disabled bogus rows and
9758 unnecessary graphics copy operations.
9759
8c9afb46
EZ
97602011-11-27 Eli Zaretskii <eliz@gnu.org>
9761
9762 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9763 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9764 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9765 (malloc, free, realloc, calloc): Redirect to e_* only when
9766 compiling Emacs.
9767
9768 * lisp.h (GCTYPEBITS): Move before first use.
9769 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9770 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9771 this macro definition.
9772
9773 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9774 _MSC_VER.
9775
54e9e3bf
JD
97762011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9777
6d5eb5b0
SM
9778 * gtkutil.c (xg_create_frame_widgets):
9779 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
9780 present with Gtk+ 2.0.
9781
83aca1cb
PE
97822011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9783
9784 * fileio.c (Finsert_file_contents): Undo previous change; see
9785 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9786
5b76caa4
PE
97872011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9788
9789 Rename locals to avoid shadowing.
9790 * fileio.c (Finsert_file_contents):
9791 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9792 * process.c (wait_reading_process_output):
9793 Rename inner 'proc' to 'p' to avoid shadowing.
9794 Indent for consistency with usual Emacs style.
9795
8c535114
EZ
97962011-11-25 Eli Zaretskii <eliz@gnu.org>
9797
9798 * xdisp.c (redisplay_window): If cursor row is not fully visible
9799 after recentering, and scroll-conservatively is set to a large
9800 number, scroll window by a few more lines to make the cursor fully
9801 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
9802 (start_display): Don't move to the next line if the display should
9803 start at a newline that is part of a display vector or an overlay
9804 string. (Bug#10119)
8c535114 9805
fa4fdb5c
JL
98062011-11-24 Juri Linkov <juri@jurta.org>
9807
9808 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9809 after the `MagickPingImage' call. (Bug#10112)
9810
90ec88df
CY
98112011-11-23 Chong Yidong <cyd@gnu.org>
9812
9813 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9814
56e2e794
MR
98152011-11-23 Martin Rudalics <rudalics@gmx.at>
9816
9817 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9818 making another buffer current. (Bug#10114)
9819
b6e64c41
GM
98202011-11-23 Glenn Morris <rgm@gnu.org>
9821
9822 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9823
6b21de18
CY
98242011-11-23 Chong Yidong <cyd@gnu.org>
9825
9826 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9827 using it (Bug#5984).
9828
b12cd789
EZ
98292011-11-22 Eli Zaretskii <eliz@gnu.org>
9830
9831 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9832 and header-lines, as they don't have one computed for them.
9833 (Bug#10098)
9834
9835 * .gdbinit (prow): Make displayed values more self-explaining.
9836 Add row's hash code.
9837
261b6fd4
LMI
98382011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9839
9840 * process.c (wait_reading_process_output): Fix asynchrounous
9841 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 9842 (wait_reading_process_output): Add comment and URL.
261b6fd4 9843
e7cfd277
JD
98442011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9845
9846 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9847
a9b9b7f5
CY
98482011-11-21 Chong Yidong <cyd@gnu.org>
9849
9850 * window.c (Fnext_window, Fprevious_window): Doc fix.
9851
b0d15b4f
SM
98522011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9853
9854 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9855
fe7a3057
JB
98562011-11-20 Juanma Barranquero <lekktu@gmail.com>
9857
9858 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9859
d2999b1a
MR
98602011-11-20 Martin Rudalics <rudalics@gmx.at>
9861
9862 * window.c (Fset_window_combination_limit): Rename argument
9863 STATUS to LIMIT.
9864 (Vwindow_combination_limit): Remove "status" from doc-string.
9865
d5ff9cd0
AS
98662011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9867
9868 * m/ibms390.h: Remove.
9869 * m/ibms390x.h: Don't include "ibms390.h".
9870
a5bb9bd3
SM
98712011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9872
9873 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9874 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9875
cd1181db
JB
98762011-11-20 Juanma Barranquero <lekktu@gmail.com>
9877
9878 * casetab.c (Fset_case_table):
9879 * charset.c (Fcharset_after): Fix typos.
9880
615a3b8d 98812011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 9882
17e845af
PE
9883 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9884 Otherwise, valgrind does not work on some platforms.
9885 Problem reported by Andreas Schwab in
6a0bf43d
PE
9886 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9887 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9888 is set, removing the need for VIRT_ADDRESS_VARIES.
9889 (PURE_P): Use a more-efficient implementation that needs just one
9890 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9891 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9892 to 4 (xorl, subq, cmpq, setbe).
9893 * alloc.c (pure): Always extern now, since that's the
9894 VIRT_ADDR_VARIES behavior.
9895 (PURE_POINTER_P): Use a single comparison, not two, for
9896 consistency with the new puresize.h.
9897 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9898 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9899 Remove VIRT_ADDR_VARIES no longer needed.
9900
f8fe6f96
EZ
99012011-11-19 Eli Zaretskii <eliz@gnu.org>
9902
9903 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9904 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9905 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9906 behave as if the cursor position were at the window margin.
9907
9908 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9909 and the cursor position is out of bounds, behave as if the cursor
9910 position were at the window margin. (Bug#10075)
9911
df05a53c
CY
99122011-11-18 Chong Yidong <cyd@gnu.org>
9913
9914 * window.c (Fwindow_combination_limit): Make first argument
9915 non-optional, since it is meaningless for live windows like the
9916 selected window.
61ccba97 9917
2071918e
DA
99182011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9919
9920 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9921
b50a28de
SM
99222011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9923
9924 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9925 (graft_intervals_into_buffer): Simplify.
9926
015137db
EZ
99272011-11-18 Eli Zaretskii <eliz@gnu.org>
9928
9929 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9930 hash values of the two rows.
9931 (copy_row_except_pointers): Preserve the used[] arrays and the
9932 hash values of the two rows. (Bug#10035)
68c95424 9933 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
9934
9935 * xdisp.c (row_hash): New function, body extracted from
9936 compute_line_metrics.
9937 (compute_line_metrics): Call row_hash, instead of computing the
9938 hash code inline.
9939
9940 * dispnew.c (verify_row_hash): Call row_hash for computing the
9941 hash code of a row, instead of duplicating code from xdisp.c.
9942
9943 * dispextern.h (row_hash): Add prototype.
9944
a2addb04
TH
99452011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9946
9947 * frame.c (delete_frame): Don't delete the terminal when the last
9948 X frame is closed if emacs is built with GTK toolkit.
9949
df85d315
JB
99502011-11-17 Juanma Barranquero <lekktu@gmail.com>
9951
9952 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9953
a0c2d0ae
MR
99542011-11-17 Martin Rudalics <rudalics@gmx.at>
9955
9956 * window.c (Vwindow_splits): Rename to
9957 Vwindow_combination_resize. Suggested by Juri Linkov.
9958 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9959 of Vwindow_splits.
9960
58179cce
JB
99612011-11-16 Juanma Barranquero <lekktu@gmail.com>
9962
7877f373
JB
9963 * nsfns.m (Fns_font_name):
9964 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 9965
b6f67890
MR
99662011-11-16 Martin Rudalics <rudalics@gmx.at>
9967
9968 * window.h (window): Rename slot "nest" to "combination_limit".
9969 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9970 (Fset_window_nest): Rename to Fset_window_combination_limit.
9971 (Vwindow_nest): Rename to Vwindow_combination_limit.
9972 (recombine_windows, make_parent_window, make_window)
9973 (Fsplit_window_internal, saved_window)
9974 (Fset_window_configuration, save_window_save): Rename all
9975 occurrences of window_nest to window_combination_limit.
9976
c7015153
JB
99772011-11-15 Juanma Barranquero <lekktu@gmail.com>
9978
9979 * image.c (imagemagick_load_image): Fix typo.
9980
322ad6ec
EZ
99812011-11-14 Eli Zaretskii <eliz@gnu.org>
9982
9983 * xdisp.c (display_line): Move the call to
9984 highlight_trailing_whitespace before the call to
9985 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
9986 faces of all the glyphs to compute ROW's hash value.
9987 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 9988
f067b8ec
JB
99892011-11-14 Juanma Barranquero <lekktu@gmail.com>
9990
9991 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9992 just return (bug#10044).
9993
1e5b2111
EZ
99942011-11-12 Eli Zaretskii <eliz@gnu.org>
9995
7ef3cbd5
EZ
9996 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9997 with user-defined heap size. Bump the default size of the temacs
9998 heap to 27MB, to avoid memory warning when running temacs.
9999 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
10000
1e5b2111
EZ
10001 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
10002 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
10003 (verify_row_hash) [XASSERTS]: New function.
10004 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
10005 that the hash value of glyph rows is correct.
1e5b2111 10006
89d61221
MR
100072011-11-12 Martin Rudalics <rudalics@gmx.at>
10008
10009 * window.h (window): Remove splits slot.
10010 * window.c (Fwindow_splits, Fset_window_splits): Remove.
10011 (Fdelete_other_windows_internal, make_parent_window)
10012 (make_window, Fsplit_window_internal, Fdelete_window_internal)
10013 (Fset_window_configuration, save_window_save): Don't deal with
10014 split status of windows.
10015 (saved_window): Remove splits slot.
10016 (Vwindow_splits): Rewrite doc-string.
10017
97f18cc8
JD
100182011-11-11 Jan Djärv <jan.h.d@swipnet.se>
10019
10020 * xfns.c (unwind_create_frame):
10021 * nsfns.m (unwind_create_frame):
10022 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
10023 Vframe_list (Bug#9999).
10024
22a648b4
DA
100252011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
10026
0b381c7e 10027 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 10028
659afede
KH
100292011-11-11 Kenichi Handa <handa@m17n.org>
10030
10031 * callproc.c (Fcall_process): Set the member dst_multibyte of
10032 process_coding.
10033
9ac0394b
KH
100342011-11-11 Johan Bockgård <bojohan@gnu.org>
10035
10036 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10037 avoid a crash (bug#9496).
10038
2fbdc249
CY
100392011-11-09 Chong Yidong <cyd@gnu.org>
10040
10041 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10042 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10043
ac6b1f81
PE
100442011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10045
10046 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10047
09db192c
PE
100482011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10049
10050 Avoid some portability problems by eschewing 'extern inline' functions.
10051 The trivial performance wins aren't worth the portability hassles; see
10052 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10053 et seq.
10054 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10055 (window_box_width, window_box_left, window_box_left_offset)
10056 (window_box_right, window_box_right_offset): Undo previous change,
10057 by removing the "extern"s.
10058 * intervals.c (adjust_intervals_for_insertion)
10059 (adjust_intervals_for_deletion): Undo previous change,
10060 making these static again.
10061 (offset_intervals, temp_set_point_both, temp_set_point)
10062 (copy_intervals_to_string): No longer inline.
10063 * xdisp.c (window_text_bottom_y, window_box_width)
10064 (window_box_height, window_box_left_offset)
10065 (window_box_right_offset, window_box_left, window_box_right)
10066 (window_box): No longer inline.
10067
105216ed
CY
100682011-11-08 Chong Yidong <cyd@gnu.org>
10069
10070 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
10071 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
10072 Signal an error if not a live window.
105216ed
CY
10073 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
10074 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
10075
ae9e237f
JB
100762011-11-07 Juanma Barranquero <lekktu@gmail.com>
10077
10078 * lisp.h (syms_of_abbrev): Remove declaration.
10079 Reported by CHENG Gao <chenggao@royau.me>.
10080
c7aa8333
EZ
100812011-11-07 Eli Zaretskii <eliz@gnu.org>
10082
10083 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10084 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
10085 of temacs in GUI mode.
10086
be7f5545
MR
100872011-11-07 Martin Rudalics <rudalics@gmx.at>
10088
10089 * window.h: Declare delete_all_child_windows instead of
10090 delete_all_subwindows.
10091 * window.c (Fwindow_nest, Fset_window_nest)
10092 (Fset_window_new_total, Fset_window_new_normal)
10093 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10094 (delete_all_subwindows): Rename to delete_all_child_windows.
10095 (Fdelete_other_windows_internal, Fset_window_configuration):
10096 Call delete_all_child_windows instead of delete_all_subwindows.
10097 * frame.c (delete_frame): Call delete_all_child_windows instead
10098 of delete_all_subwindows.
10099
ca78dc43
PE
101002011-11-07 Paul Eggert <eggert@cs.ucla.edu>
10101
10102 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10103 This is also needed for porting to any host where GC_MARK_STACK is
10104 not GC_MAKE_GCPROS_NOOPS.
10105 (which_symbols): Use it.
10106
a0241d01
KH
101072011-11-07 Kenichi Handa <handa@m17n.org>
10108
10109 * coding.c (coding_set_destination): Check coding->src_pos only
10110 when coding->src_object is a buffer (bug#9910).
10111
10112 * process.c (send_process): Set the member src_multibyte of coding
10113 to 0 (bug#9911) when sending a unibyte text.
10114
10115 * callproc.c (Fcall_process): Set the member src_multibyte of
10116 process_coding to 0 (bug#9912).
10117
a64bfdfa 101182011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
10119
10120 * xmenu.c (cleanup_widget_value_tree): New function.
10121 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10122 calling free_menubar_widget_value_tree directly (Bug#9830).
10123
cb41b32a
PE
101242011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10125
10126 Fix some portability problems with 'inline'.
10127 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10128 (window_box_width, window_box_left, window_box_left_offset)
10129 (window_box_right, window_box_right_offset): Declare extern.
10130 Otherwise, these inline functions do not conform to C99 and
10131 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
10132 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10133 * intervals.c (adjust_intervals_for_insertion)
10134 (adjust_intervals_for_deletion): Now extern, because otherwise the
10135 extern inline functions 'offset_intervals' couldn't refer to it.
10136 (static_offset_intervals): Remove.
10137 (offset_intervals): Rewrite using the old contents of
10138 static_offset_intervals. The old version didn't conform to C99
10139 because an extern inline function contained a reference to an
10140 identifier with static linkage.
10141
b7041366
AS
101422011-11-06 Andreas Schwab <schwab@linux-m68k.org>
10143
10144 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10145 GC.
10146
88a37c4d
EZ
101472011-11-06 Eli Zaretskii <eliz@gnu.org>
10148
10149 * xdisp.c (init_iterator, reseat_to_string): Don't set the
10150 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
10151 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10152 return Qleft_to_right.
10153
49745b39
CY
101542011-11-06 Chong Yidong <cyd@gnu.org>
10155
10156 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
10157 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
10158 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
10159 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
10160 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
10161 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
10162 (Fwindow_vscroll): Doc fix.
10163 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
10164 argument, since it makes no sense to pass a live window and for
10165 consistency with window-child.
10166
1f05cd82
CS
101672011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
10168
10169 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
10170 support MSVC.
10171
22610910
JR
101722011-11-05 Jason Rumney <jasonr@gnu.org>
10173
10174 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
10175 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
10176 fonts (Bug#6029).
10177 (add_font_entity_to_list): Fix logic errors in mixed boolean and
10178 bitwise arithmetic preventing use of unicode-sip and non-truetype
10179 opentype fonts.
10180
a06776b2
EZ
101812011-11-05 Eli Zaretskii <eliz@gnu.org>
10182
3ad924ba
EZ
10183 * s/ms-w32.h (fstat, stat, utime): Move redirections to
10184 "emacs"-only part.
10185
a06776b2
EZ
10186 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
10187 initialization code to keep similarity to xfns.c after changes
10188 from 2011-11-05.
10189
c9e7db78
JD
101902011-11-05 Jan Djärv <jan.h.d@swipnet.se>
10191
a97f8f3f
JD
10192 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
10193 (unwind_create_frame): New function (Bug#9943).
10194 (Fx_create_frame): Restructure code to be more similar to the one in
10195 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
10196 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
10197 Move terminal->reference_count++ just before making the frame official
10198 (Bug#9943).
10199
10200 * nsterm.m (x_free_frame_resources): New function.
10201 (x_destroy_window): Move code to x_free_frame_resources.
10202
c9e7db78 10203 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
10204 (Fx_create_frame, x_create_tip_frame):
10205 Move terminal->reference_count++ just before making the frame
75f1671a 10206 official. Move initialization of image_cache_refcount and
c9e7db78
JD
10207 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
10208
a6fc3b5c
EZ
102092011-11-05 Eli Zaretskii <eliz@gnu.org>
10210
10211 Support MSVC build with newer versions of Visual Studio.
10212 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
10213 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
10214 nt/gmake.defs.
10215
10216 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10217 which are not supported by MSVC.
10218 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10219 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10220 bitfields.
10221 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10222 types in bitfields.
10223 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10224
10225 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10226
58179cce 102272011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
10228
10229 Support MSVC build with newer versions of Visual Studio.
10230 * w32.c: Don't include w32api.h for MSVC.
10231 (init_environment) [_MSC_VER]: Call sys_access, not _access.
10232
10233 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10234 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10235 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10236 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10237 e_* cousins.
10238 (alloca) [_MSC_VER]: Define to _alloca.
10239
10240 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10241
10242 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10243
a58c13ed
EZ
102442011-11-04 Eli Zaretskii <eliz@gnu.org>
10245
10246 * xdisp.c (note_mouse_highlight): If either of
10247 previous/next-single-property-change returns nil, treat that as
10248 the beginning or the end of the buffer. (Bug#9955)
10249
fe0b6370
JD
102502011-11-04 Jan Djärv <jan.h.d@swipnet.se>
10251
a58c13ed 10252 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
10253 label is not null (Bug#9951).
10254 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10255 may be NULL.
10256
89bd5ee1
EZ
102572011-11-04 Eli Zaretskii <eliz@gnu.org>
10258
10259 * window.c (Fwindow_body_size): Mention in the doc string that the
10260 return value is in frame's canonical units. (Bug#9949)
10261
84c3edb9
EZ
102622011-11-03 Eli Zaretskii <eliz@gnu.org>
10263
4e2fb5c7
EZ
10264 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
10265
84c3edb9 10266 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 10267 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 10268 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 10269
bc17a887
EZ
102702011-11-01 Eli Zaretskii <eliz@gnu.org>
10271
10272 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10273 Don't stop backward scan on the continuation glyph, even though
10274 its CHARPOS is positive.
6d5eb5b0
SM
10275 (mouse_face_from_buffer_pos, note_mouse_highlight):
10276 Rename cover_string to disp_string.
bc17a887 10277
4ee88440
MR
102782011-11-01 Martin Rudalics <rudalics@gmx.at>
10279
10280 * window.c (temp_output_buffer_show): Don't use
10281 Vtemp_buffer_show_specifiers.
10282 (Vtemp_buffer_show_specifiers): Remove unused variable.
10283
c2ff3c02
EZ
102842011-10-30 Eli Zaretskii <eliz@gnu.org>
10285
10286 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10287 past the beginning of the current glyph matrix.
10288
58179cce 102892011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
10290
10291 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10292 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10293 HAVE_GTK3 (Bug#9869).
b77a6a7f 10294
3b574623
JD
10295 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10296 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10297
b77a6a7f
JD
10298 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10299
10300 * xterm.c: Declare x_handle_net_wm_state to return int.
10301 (handle_one_xevent): Check if we are iconified but don't have
10302 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
10303 (get_current_wm_state): Return non-zero if not hidden,
10304 check for _NET_WM_STATE_HIDDEN (Bug#9893).
10305 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
10306 (x_handle_net_wm_state): Return what get_current_wm_state returns.
10307 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
10308
196e41e4
PE
103092011-10-29 Paul Eggert <eggert@cs.ucla.edu>
10310
10311 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
10312 so that this new function doesn't get optimized away by a
10313 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
10314
021f2e1a
AS
103152011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10316
10317 * frame.h (MOUSE_HL_INFO): Remove excess parens.
10318
8b058d44
EZ
103192011-10-29 Eli Zaretskii <eliz@gnu.org>
10320
10321 Fix the `xbytecode' command.
10322 * .gdbinit (xprintbytestr): New command.
b50a28de 10323 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
10324 (xbytecode): Print the byte-code string as well.
10325
4452fb80
EZ
103262011-10-29 Kim Storm <storm@cua.dk>
10327
8b058d44
EZ
10328 * alloc.c (which_symbols): New function.
10329
21b72067
AS
103302011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10331
10332 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
10333 line. (Bug#9903)
10334
83ed7b5c
GM
103352011-10-29 Glenn Morris <rgm@gnu.org>
10336
10337 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10338 Not clear what it was for, and it causes various bugs. (Bug#9839)
10339
5a7a728b
EZ
103402011-10-28 Eli Zaretskii <eliz@gnu.org>
10341
10342 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10343 possible random value that matches one of those tested as
10344 condition to clear the mouse face.
10345
d3d0842f
CY
103462011-10-28 Chong Yidong <cyd@gnu.org>
10347
10348 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10349
31b39d13
DN
103502011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
10351
10352 * window.c (make_window): Initialize phys_cursor_on_p.
10353
9aba6043
SM
103542011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
10355
10356 * lisp.h (struct Lisp_Symbol): Update comments.
10357
c20992f4
JB
103582011-10-28 Juanma Barranquero <lekktu@gmail.com>
10359
10360 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10361
db4f02f2
EZ
103622011-10-28 Eli Zaretskii <eliz@gnu.org>
10363
10364 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
10365 <oslsachem@gmail.com> for helping to debug this.
10366
10367 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10368 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10369 (g_b_init_get_glyph_outline_w): New static variables.
10370 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10371 (GetGlyphOutlineW_Proc): New typedefs.
10372 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
10373 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10374 New functions.
10375 (w32font_open_internal, compute_metrics):
10376 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
10377 instead of calling the "wide" APIs directly.
10378
10379 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10380
10381 * w32.h (syms_of_w32font): Add prototype.
10382
87e68db4
JB
103832011-10-27 Juanma Barranquero <lekktu@gmail.com>
10384
10385 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10386 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10387 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10388 (Fmove_to_window_line): Doc fix.
10389
435c1d67
CY
103902011-10-27 Chong Yidong <cyd@gnu.org>
10391
10392 * process.c (make_process): Set gnutls_state to NULL.
10393
10394 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10395 non-NULL, regardless of GNUTLS_INITSTAGE.
10396 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10397 an error. Set process slots as soon as we allocate them.
10398
10399 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10400
9c6c6f49
CY
104012011-10-27 Chong Yidong <cyd@gnu.org>
10402
9aba6043
SM
10403 * gnutls.c (emacs_gnutls_deinit): New function.
10404 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
10405 (Fgnutls_deinit, Fgnutls_boot): Use it.
10406
10407 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10408 (deactivate_process): Call emacs_gnutls_deinit.
10409
657d08d3
JB
104102011-10-27 Juanma Barranquero <lekktu@gmail.com>
10411
10412 * image.c (x_create_x_image_and_pixmap):
10413 * w32.c (sys_rename, w32_delayed_load):
10414 * w32font.c (fill_in_logfont):
10415 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10416
5430d399
JB
104172011-10-26 Juanma Barranquero <lekktu@gmail.com>
10418
10419 * w32fns.c (w32_default_color_map): New function,
10420 extracted from Fw32_default_color_map.
a7ef684b 10421 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 10422
fe0055fa
PE
104232011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10424
10425 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10426
e6346438
SM
104272011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10428
10429 * keyboard.c (test_undefined): New function (bug#9751).
10430 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10431
e112cc37
ET
104322011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10433
10434 * sysdep.c (init_sys_modes): Fix the check for the controlling
10435 terminal (Bug#6649).
10436
7b5d6677
EZ
104372011-10-20 Eli Zaretskii <eliz@gnu.org>
10438
10439 * dispextern.h (struct bidi_it): New member next_en_type.
10440
10441 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10442 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10443 current character, check also for next_en_type being WEAK_EN.
10444 (bidi_resolve_weak): Don't enter the expensive loop if the current
10445 position is before next_en_pos. Record the bidi type of the first
10446 non-ET, non-BN character we find, in addition to its position.
10447 (bidi_level_of_next_char): Invalidate next_en_type when
10448 next_en_pos is over-stepped.
10449
7da0b018
PE
104502011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10451
10452 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10453 * editfns.c: Rewrite current-time-zone so that it invokes
10454 the equivalent of (format-time-string "%Z") to get the time zone name.
10455 This fixes a bug when the time zone name contains characters that
10456 need converting from the system time locale to Emacs internal format.
10457 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10458 that patch fixed format-time-string to do the conversion, but
10459 I forgot to fix current-time-zone.
10460 (format_time_string): New function, containing most of
10461 what Fformat_time_string used to contain.
10462 (Fformat_time_string): Rewrite in terms of format_time_string.
10463 This doesn't change this function's behavior.
10464 (current-time-zone): Rewrite to use format_time_string.
10465 This fixes the bug reported by Michael Schierl in
10466 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10467 Jason Rumney's 2007-06-07 change worked around this bug, but
10468 didn't fix it.
10469 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10470
8547b010
EZ
104712011-10-19 Eli Zaretskii <eliz@gnu.org>
10472
10473 * xdisp.c (start_display): If the character at POS is displayed
10474 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
10475 (try_window_reusing_current_matrix): If a line ends in a display
10476 vector or the next line starts in a display vector, continue
10477 redrawing the window even though the character position of
10478 start_row was reached.
8547b010
EZ
10479 (Bug#9771, part 2)
10480
4e948d15
CY
104812011-10-18 Chong Yidong <cyd@gnu.org>
10482
10483 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10484 with nobreak-char-display too.
10485
4787455f
EZ
104862011-10-18 Eli Zaretskii <eliz@gnu.org>
10487
10488 Fix part 3 of bug#9771.
10489 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10490 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10491 non-neutral characters if the current character is a paragraph
10492 separator (a.k.a. Newline). This avoids running the same
10493 expensive loop twice, once when we consume the preceding newline
10494 and the other time when the line actually needs to be displayed.
10495 Avoid the loop when we see neutrals on the base embedding level
10496 following a character whose directionality is the same as the
10497 paragraph's. This avoids running the expensive loop when a line
10498 ends in a long sequence of neutrals, like control characters.
10499 Add assertion against STRONG_AL type. Slightly rearrange code
10500 that determines the type of a neutral given the first non-neutral
10501 that follows it.
10502 (bidi_level_of_next_char): Set next_en_pos to zero when
10503 invalidating its info.
10504
2c91f553
EZ
105052011-10-17 Eli Zaretskii <eliz@gnu.org>
10506
10507 * xdisp.c (push_display_prop): Determine whether to record string
10508 or buffer position by IT->string, not by IT->method. Allow
10509 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
10510 (move_it_vertically_backward): Don't look for character position
10511 immediately after the newline when in a continuation line.
10512 (Bug#9771, part 1)
2c91f553 10513
c7b08b0d
MR
105142011-10-15 Martin Rudalics <rudalics@gmx.at>
10515
10516 * window.c (coordinates_in_window): Rewrite and delabelize
10517 vertical border check. (Bug#5357) (Bug#9618)
10518
6b02f655
SM
105192011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10520
10521 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10522 errors in XSetWindowBorder (bug#9310).
10523
81d40c92
DA
105242011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10525
10526 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10527 avoid crash when xmalloc overrun checking is enabled.
10528
d4172c3b
EZ
105292011-10-13 Eli Zaretskii <eliz@gnu.org>
10530
10531 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10532 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10533 cursor motion with <left> and <right> arrow keys.
10534
10535 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10536 some callers set that themselves.
10537
b00eea75
EZ
105382011-10-12 Eli Zaretskii <eliz@gnu.org>
10539
10540 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10541 display string and the previous row comes from the same string and
10542 is empty. (Bug#9739) (Bug#9738)
10543
8fe012c4
SM
105442011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10545
10546 * doc.c (get_doc_string): Encode file name (bug#9735).
10547
0074aef2
EZ
105482011-10-12 Eli Zaretskii <eliz@gnu.org>
10549
79beb178
EZ
10550 * bidi.c (bidi_level_of_next_char):
10551 * xdisp.c (get_visually_first_element): Remove old incorrect
10552 comments regarding the Unicode Line Separator character.
10553
0074aef2
EZ
10554 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10555
6e4b3fbe
DA
105562011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10557
10558 * alloc.c (Fgc_status): Do not access beyond zombies array
10559 boundary if nzombies > MAX_ZOMBIES.
10560 * alloc.c (dump_zombies): Add missing format specifier.
10561
0324f3af
PE
105622011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10563
b5525cac
PE
10564 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10565 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10566
0324f3af
PE
10567 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10568 Some packages use them to denote characters with modifiers.
10569
e9b5f888
AS
105702011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10571
10572 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10573 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10574 matching a pp-number. Rename parameter var to var1.
10575
127827c0
SM
105762011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10577
10578 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10579
c8fd3bd0
GM
105802011-10-08 Glenn Morris <rgm@gnu.org>
10581
10582 * callint.c (Fcall_interactively): Give a more explicit error for the
10583 'c' case with a non-character input. (Bug#8479)
10584
352ec8ff
EZ
105852011-10-08 Eli Zaretskii <eliz@gnu.org>
10586
03669ccb
EZ
10587 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10588 lines.
7061c986
EZ
10589 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10590 lines that are hscrolled on the left.
03669ccb 10591
352ec8ff
EZ
10592 * dispnew.c (buffer_posn_from_coords): Account for a possible
10593 presence of header-line. (Bug#4426)
10594
a66cfb1c
SM
105952011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10596
6b02f655
SM
10597 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10598 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 10599
7c5ee88e
PE
106002011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10601
10602 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10603 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10604 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10605 this makes Emacs dump core during garbage collection on rare
10606 occasions. sizeof is obviously inferior to offsetof here, so
10607 stick with offsetof.
10608 (GC_POINTER_ALIGNMENT): New macro.
10609 (mark_memory): Omit 3rd (offset) arg; caller changed.
10610 Don't assume EMACS_INT alignment is the same as pointer alignment.
10611
df1bbe5b
SM
106122011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10613
10614 * keyboard.c (read_key_sequence_remapped): New var.
10615 (read_key_sequence): Compute remapping in the right buffer.
10616 (command_loop_1): Use read_key_sequence's remapping directly.
10617
51553db6
SM
106182011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10619
32c1fffd
SM
10620 * dired.c (file_name_completion): Don't expand file name.
10621 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10622 before checking file name handler.
10623
51553db6
SM
10624 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10625 they've been requested explicitly (bug#9591).
10626
b6bd1599 106272011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
10628
10629 * keymap.c (Fsingle_key_description): Use make_specified_string
10630 instead of build_string to build string from push_key_description.
10631 (Bug#5193)
10632
f701dc2a
PE
106332011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10634
4222c55d
PE
10635 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10636 This fixes a Y2038 bug on 64-bit hosts.
10637 * buffer.c (reset_buffer):
10638 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10639 (Fclear_buffer_auto_save_failure):
10640 Use 0, not -1, to represent an unset failure time, since time_t
10641 might not be signed.
10642
f701dc2a
PE
10643 Remove dependency on glibc malloc internals.
10644 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10645 Move back here from lisp.h, but with their new implementations.
10646 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10647 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10648 * charset.c (charset_table_init): New static var.
10649 (syms_of_charset): Use it instead of xmalloc. This removes a
10650 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10651 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10652 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10653 Move back to alloc.c.
10654 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10655 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10656
9ceebf39
JD
106572011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10658
10659 * nsterm.m (windowDidResize): Call x_set_window_size only when
10660 ns_in_resize is true. Otherwise set pixelwidth/height and
10661 call change_frame_size (Bug#9628).
10662
cb993c58
PE
106632011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10664
3930c88b
PE
10665 Port --enable-checking=all to Fedora 14 x86-64.
10666 * charset.c (syms_of_charset): Also account for glibc malloc's
10667 internal overhead when calculating the initial malloc maximum.
10668
cb993c58
PE
10669 Port --enable-checking=all to Fedora 14 x86.
10670 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10671 Move to lisp.h.
10672 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10673 (overrun_check_realloc, overrun_check_free):
10674 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10675 That way, xmalloc returns a properly-aligned pointer even if
10676 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10677 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10678 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10679 into account when calculating the initial malloc maximum.
10680 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10681 Move here from alloc.c, so that charset.c can use it too.
10682 Properly align; the old code wasn't right for common 32-bit hosts
10683 when configured with --enable-checking=all.
10684 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10685 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10686
31bed486
EZ
106872011-09-29 Eli Zaretskii <eliz@gnu.org>
10688
04c70788 10689 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
10690 use EDOM.
10691
fbcaa2f3
EZ
106922011-09-28 Eli Zaretskii <eliz@gnu.org>
10693
10694 * xdisp.c (compute_display_string_end): If there's no display
10695 string at CHARPOS, return -1.
10696
10697 * bidi.c (bidi_fetch_char): When compute_display_string_end
10698 returns a negative value, treat the character as a normal
10699 character not covered by a display string. (Bug#9624)
10700
a239d4e9
JB
107012011-09-28 Juanma Barranquero <lekktu@gmail.com>
10702
10703 * lread.c (Fread_from_string): Fix typo in docstring.
10704
88652fd5
EZ
107052011-09-27 Eli Zaretskii <eliz@gnu.org>
10706
10707 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10708 newline, reseat the iterator instead of bidi-iterating there one
10709 character at a time. (Bug#9610)
32c1fffd
SM
10710 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10711 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 10712
ed497dd4
AS
107132011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10714
10715 * lread.c (readevalloop): Use correct code for NBSP.
10716 (read1): Likewise. (Bug#9608)
10717
b2bf61aa
MA
107182011-09-25 Michael Albinus <michael.albinus@gmx.de>
10719
10720 * dbusbind.c (Fdbus_register_signal): When service is not
10721 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10722
32bbb17c
GM
107232011-09-25 Glenn Morris <rgm@gnu.org>
10724
10725 * buffer.c (truncate-lines): Doc fix.
10726
94e0933e
CY
107272011-09-24 Chong Yidong <cyd@stupidchicken.com>
10728
10729 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10730 (Fset_window_next_buffers): Doc fix.
10731
cddde921
GM
107322011-09-24 Glenn Morris <rgm@gnu.org>
10733
10734 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10735
1260aef1
PE
107362011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10737
25b4bfa0
PE
10738 Fix minor problems found by static checking.
10739 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
10740 * indent.c (Fvertical_motion): Fix == vs = typo.
10741
e3cbd34b
EZ
107422011-09-24 Eli Zaretskii <eliz@gnu.org>
10743
a66cfb1c
SM
10744 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10745 Default value is now t. Doc fix.
6bf7006f 10746
e3cbd34b 10747 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 10748 logic when moving up, not only when moving down. Fix the
e3cbd34b 10749 confusing name and values of the it_overshoot_expected variable;
32c1fffd 10750 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
10751
10752 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10753 CHARPOS is covered by a display string which includes newlines.
10754 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10755 is covered by a display string with embedded newlines.
10756
a3de0cbd
MA
107572011-09-24 Michael Albinus <michael.albinus@gmx.de>
10758
10759 * dbusbind.c (Fdbus_register_signal): Add match rule to
10760 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
10761 (Fdbus_register_method, Vdbus_registered_objects_table):
10762 Fix docstring.
a3de0cbd 10763
b260039d
JM
107642011-09-24 Jim Meyering <meyering@redhat.com>
10765
32c1fffd 10766 do not ignore write error for any output size
b260039d
JM
10767 The previous change was incomplete.
10768 While it makes emacs --batch detect the vast majority of stdout
10769 write failures, errors were still ignored whenever the output size is
10770 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10771 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10772 && echo FAIL: ignored write error
10773 FAIL: ignored write error
10774 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10775 && echo FAIL: ignored write error
10776 FAIL: ignored write error
10777 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10778
8eca8a7c
AS
107792011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10780
10781 * emacs.c (Fkill_emacs): In noninteractive mode exit
10782 non-successfully if a write error occurred on stdout. (Bug#9574)
10783
3341db62
EZ
107842011-09-21 Eli Zaretskii <eliz@gnu.org>
10785
10786 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10787 the xassert test.
10788
10789 * dispextern.h (struct it): Update the comment documenting what
10790 can it->OBJECT be.
10791
8c203dbf
EZ
107922011-09-20 Eli Zaretskii <eliz@gnu.org>
10793
10794 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10795 a display string, extend search for cursor position to end of row.
10796 (find_row_edges): If the row ends in a newline from a display
10797 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10798 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
10799 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10800 non-empty line. Fixes confusing cursor motion with arrow keys at
10801 the beginning of a line that starts with whitespace.
8c203dbf 10802
a4824228
LMI
108032011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10804
10805 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10806 (bug#9493).
10807
33ed493b
CY
108082011-09-18 Chong Yidong <cyd@stupidchicken.com>
10809
10810 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10811 boolean (Bug#9154).
10812
56cd55c8
EZ
108132011-09-18 Eli Zaretskii <eliz@gnu.org>
10814
10815 * xdisp.c (display_line): Record maximum and minimum buffer
10816 positions even if no glyphs were produced (e.g., by a zero-width
10817 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10818 buffer positions that will be removed from the glyph row because
10819 they don't fit.
c02dcedf
EZ
10820 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10821 column is beyond frame width: don't subtract 1 "pixel" when
10822 computing width of the stretch.
3e62b7e0
EZ
10823 (reseat_at_next_visible_line_start): Undo the change made on
10824 2011-09-17 that saved paragraph information and restored it after
10825 the call to `reseat'. (Bug#9545)
56cd55c8 10826
5ed99d36 108272011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
10828
10829 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10830 and turn window cursor on if cleared (Bug#9415).
10831
5ed99d36 108322011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
10833
10834 * search.c (boyer_moore): Take unibyte characters from pattern
10835 literally. (Bug#9458)
10836
9bade7b2
EZ
108372011-09-18 Eli Zaretskii <eliz@gnu.org>
10838
10839 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10840
e5e9d610
PE
108412011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10842
87e4427a
PE
10843 Fix minor problem found by static checking.
10844 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10845 initialized, to pacify gcc -Wuninitialized.
10846
e5e9d610
PE
10847 * fileio.c: Report proper errno when syscall falls.
10848 (Finsert_file_contents): Save and restore errno,
10849 so that report_file_error outputs the correct diagnostic.
10850 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10851
a1674f0b
EZ
108522011-09-18 Eli Zaretskii <eliz@gnu.org>
10853
10854 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10855
fbfb6dd4
EZ
108562011-09-17 Eli Zaretskii <eliz@gnu.org>
10857
10858 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10859 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10860
bb187662
EZ
108612011-09-17 Eli Zaretskii <eliz@gnu.org>
10862
1137e8b8 10863 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 10864 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
10865
10866 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10867 (bidi_find_paragraph_start): Search back for paragraph beginning
10868 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10869 (bidi_move_to_visually_next): Only trigger paragraph-related
10870 computations when the last character is a newline or at EOB, not
10871 just any NEUTRAL_B. (Bug#9470)
10872
bb187662
EZ
10873 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10874 truncated lines if point is covered by a display string. (Bug#9524)
10875
2e621251
PE
108762011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10877
10878 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10879 (cons_to_x_long): New function.
10880 (lisp_data_to_selection_data): Use it. Correct the test for
10881 short-versus-long data; it was negated. Break out of vector
10882 loop, for efficiency, when a long datum is discovered.
10883
91a15bc6
SM
108842011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10885
10886 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10887
b41c3a35
EZ
108882011-09-16 Eli Zaretskii <eliz@gnu.org>
10889
10890 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10891 GCC PR/17406) by declaring this function with external scope.
10892
7812ba2d
PE
108932011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10894
10895 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10896 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10897
cf7edc2a
AS
108982011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10899
10900 * editfns.c (Fformat): Correctly handle text properties on "%%".
10901
bd01620e
EZ
109022011-09-15 Eli Zaretskii <eliz@gnu.org>
10903
10904 * xterm.c (x_draw_composite_glyph_string_foreground):
10905 * w32term.c (x_draw_composite_glyph_string_foreground):
10906 * term.c (encode_terminal_code):
10907 * composite.c (composition_update_it, get_composition_id):
10908 * xdisp.c (get_next_display_element)
10909 (fill_composite_glyph_string): Add comments about special meaning
10910 of TAB characters in a composition.
10911
a02719a3
PE
109122011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10913
10914 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
10915 This occurs when processing a multibyte format.
10916 Problem reported by Wolfgang Jenker.
a02719a3 10917
72589a3c
JB
109182011-09-15 Johan Bockgård <bojohan@gnu.org>
10919
10920 * xdisp.c (try_cursor_movement): Only check for exact match if
10921 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10922
1c14176c
PE
109232011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10924
10925 Remove unused external symbols.
10926 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10927 * xdisp.c (calc_pixel_width_or_height): Now static.
10928 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10929 * indent.c (check_display_width):
10930 * w32term.c: Fix comment to match code.
10931 * xterm.c, xterm.h (x_catching_errors): Remove.
10932
d2eea5b5
PE
109332011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10934
10935 * xselect.c: Use signed conversions more consistently (Bug#9498).
10936 (selection_data_to_lisp_data): Assume incoming selection data are
10937 signed integers, not unsigned. This is to be consistent with
10938 outgoing selection data, which was modified to use signed integers
10939 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10940 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10941 expects long, not unsigned long.
10942
46888499
EZ
109432011-09-14 Eli Zaretskii <eliz@gnu.org>
10944
10945 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10946 computation of loop end. Reported by Johan Bockgård
10947 <bojohan@gnu.org>.
10948
ef8ef9fb
CY
109492011-09-13 Chong Yidong <cyd@stupidchicken.com>
10950
10951 * frame.c (Fother_visible_frames_p): Function deleted.
10952
fa819fed
EZ
109532011-09-12 Eli Zaretskii <eliz@gnu.org>
10954
10955 * indent.c (compute_motion): Process display vector front to back
10956 rather than the other way around. (Bug#2496)
10957
2ba8e008
SM
109582011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10959
10960 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10961
20f53c69
CY
109622011-09-11 Chong Yidong <cyd@stupidchicken.com>
10963
10964 * minibuf.c (Fread_from_minibuffer): Doc fix.
10965
d562d7a4
EZ
109662011-09-11 Eli Zaretskii <eliz@gnu.org>
10967
10968 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10969 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10970
1c4d7f3d
LMI
109712011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10972
10973 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10974 value for non-existent files.
10975
b885bf36
EZ
109762011-09-11 Eli Zaretskii <eliz@gnu.org>
10977
10978 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10979 set its "size" to -1. This will set the modtime_size field of
10980 the corresponding buffer to -1, which is what
10981 verify-visited-file-modtime expects for files that do not exist.
10982 (Bug#9139)
10983
6612f0bf
PE
109842011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10985
10986 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10987 here ...
10988 * lisp.h: ... from here. push_key_description is no longer
10989 defined in keyboard.c, so its declaration should not be in
10990 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10991 logically belongs with push_key_description.
10992
dfb3f755
PE
109932011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10994
10995 * buffer.h: Include <sys/types.h> instead of <time.h>.
10996 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10997 Problem reported by Herbert J. Skuhra.
10998
3134906c
LMI
109992011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
11000
11001 * xml.c (parse_region): Make the parsing work for
11002 non-comment-starting XML files again (bug#9144).
11003
8d903f4e
AS
110042011-09-10 Andreas Schwab <schwab@linux-m68k.org>
11005
11006 * image.c (gif_load): Fix calculation of bottom and right corner.
11007 (Bug#9468)
11008
80ad64f4
EZ
110092011-09-10 Eli Zaretskii <eliz@gnu.org>
11010
11011 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
11012 redisplay in small windows.
11013
208a048d
EZ
110142011-09-09 Eli Zaretskii <eliz@gnu.org>
11015
11016 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
11017
9b1c252e
MR
110182011-09-08 Martin Rudalics <rudalics@gmx.at>
11019
11020 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
11021 Operate on live windows only.
11022
2949f33b
JB
110232011-09-08 Juanma Barranquero <lekktu@gmail.com>
11024
11025 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
11026
e08dcafd
EZ
110272011-09-07 Eli Zaretskii <eliz@gnu.org>
11028
11029 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
11030 only under bidi iteration.
11031
115b96bd
JD
110322011-09-07 Jan Djärv <jan.h.d@swipnet.se>
11033
11034 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11035
c8199d0f
PE
110362011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11037
11038 isnan: Fix porting problem to Solaris 10 with bundled gcc.
11039 Without this fix, the command to link temacs failed due to an
11040 undefined symbol __builtin_isnan. This is because
11041 /usr/include/iso/math_c99.h #defines isnan(x) to
11042 __builtin_isnan(x), but the bundled gcc, which identifies itself
11043 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11044 a __builtin_isnan.
11045 * floatfns.c (isnan): #undef, and then #define to a clone of
11046 what's in data.c.
11047 (Fisnan): Always define, since it's always available now.
11048 (syms_of_floatfns): Always define isnan at the Lisp level.
11049
e39b275c 110502011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
11051
11052 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11053
b2db44d9 110542011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 11055
f4af5137 11056 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
11057 The previous code assumed that file offsets (off_t values) fit in
11058 EMACS_INT variables, which is not true on typical 32-bit hosts.
11059 The code messed up by falsely reporting buffer overflow in cases
11060 such as (insert-file-contents "big" nil 1 2) into an empty buffer
11061 when "big" contains more than 2**29 bytes, even though this
11062 inserts just one byte and does not overflow the buffer.
11063 (Finsert_file_contents): Store file offsets as off_t
11064 values, not as EMACS_INT values. Check for overflow when
11065 converting between EMACS_INT and off_t. When checking for
11066 buffer overflow or for overlap, take the offsets into account.
11067 Don't use EMACS_INT for small values where int suffices.
11068 When checking for overlap, fix a typo: ZV was used where
11069 ZV_BYTE was intended.
11070 (Fwrite_region): Don't assume off_t fits into 'long'.
11071 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
11072
ecfc0a49
MA
110732011-09-05 Michael Albinus <michael.albinus@gmx.de>
11074
11075 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
11076
6511acf2 110772011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 11078
0999621a 11079 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
11080
11081 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 11082 (esprintf, exprintf, evxprintf): New functions.
62f19c19 11083 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 11084 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
11085 (modify_event_symbol): Do not assume that the length of
11086 name_alist_or_stem is safe to alloca and fits in int.
11087 (Fexecute_extended_command): Likewise for function name and binding.
11088 (Frecursion_depth): Wrap around reliably on integer overflow.
11089 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11090 since some callers pass EMACS_INT values.
11091 (Fsingle_key_description): Don't crash if symbol name contains more
11092 than MAX_ALLOCA bytes.
11093 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11094 (get_minibuffer): Arg is now EMACS_INT, not int.
11095 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 11096 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
11097 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11098
2be7d702
PE
11099 * dbusbind.c (signature_cat): New function.
11100 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
11101 Do not overrun buffer; instead, report string overflow.
11102
9d1df220
PE
11103 * dispnew.c (add_window_display_history): Don't overrun buffer.
11104 Truncate instead; this is OK since it's just a log.
11105
33ef5c64
PE
11106 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11107 even if the time zone offset is outlandishly large.
11108 Don't mishandle offset == INT_MIN.
11109
66c6fdd5
PE
11110 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11111 when creating daemon; the previous buffer-overflow check was incorrect.
11112
d749b01b
PE
11113 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11114 which has the guts of the old verror function.
11115
b5cd1905
PE
11116 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11117 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11118
6e1a67fb
PE
11119 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11120 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 11121 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 11122 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
11123 length of string rather than counting it via multiple sprintfs;
11124 that's simpler and more reliable.
c21721cc
PE
11125 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11126 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11127 sprintf, in case result does not fit in int.
11128
c57b67fc
PE
11129 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11130 (fontset_from_font): Print it.
11131
8a401434
PE
11132 * frame.c (tty_frame_count): Now printmax_t, not int.
11133 (make_terminal_frame, set_term_frame_name): Print it.
11134 (x_report_frame_params): In X, window IDs are unsigned long,
11135 not signed long, so print them as unsigned.
11136 (validate_x_resource_name): Check for implausibly long names,
11137 and don't assume name length fits in 'int'.
11138 (x_get_resource_string): Don't blindly alloca invocation name;
11139 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
11140 not fit in int.
11141
6e1a67fb
PE
11142 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11143 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
11144 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11145
0df02bf3
PE
11146 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11147 Use esprintf, not sprintf, in case result does not fit in int.
11148
48e30793
PE
11149 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11150 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11151 it as a large positive number.
11152 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
11153 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11154
a66ff6d8
PE
11155 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
11156 in case result does not fit in int.
11157
aca216ff
PE
11158 * print.c (float_to_string): Detect width overflow more reliably.
11159 (print_object): Make sprintf buffer a bit bigger, to avoid potential
11160 buffer overrun. Don't assume list length fits in 'int'. Treat
11161 print length of 0 as 0, not as infinity; to be consistent with other
11162 uses of print length in this function. Don't overflow print length
11163 index. Don't assume hash table size fits in 'long', or that
11164 vectorlike size fits in 'unsigned long'.
11165
31c286f7
PE
11166 * process.c (make_process): Use printmax_t, not int, to format
11167 process-name gensyms.
11168
55e5faa1
PE
11169 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
11170
80f2e268
PE
11171 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
11172 to avoid potential buffer overrun.
11173
670741ab
PE
11174 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
11175 if X resource line is longer than 512 bytes.
11176
b7163a50
PE
11177 * xfns.c (x_window): Make sprintf buffer a bit bigger
11178 to avoid potential buffer overrun.
11179
ae58ff1f
PE
11180 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
11181
c43c8a6a
PE
11182 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
11183
3f8236f4
PE
111842011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11185
53e9fe90 11186 Integer overflow fixes for scrolling, etc.
6511acf2
PE
11187 Without these, Emacs silently mishandles large integers sometimes.
11188 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
11189 it were "C-u 1 M-x recenter" on a typical 64-bit host.
11190
6511acf2
PE
11191 * xdisp.c (try_window_id): Check Emacs fixnum range before
11192 converting to 'int'.
806add1d 11193
6511acf2 11194 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
11195 Check that an Emacs fixnum is in range before assigning it to 'int'.
11196 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
11197 values converted from Emacs fixnums.
11198 (Frecenter): Don't wrap around a line count if it is out of 'int'
11199 range; instead, treat it as an extreme value.
11200 (Fset_window_configuration, compare_window_configurations):
11201 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
11202
6511acf2
PE
11203 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
11204 that can exceed INT_MAX. Check that EMACS_INT value is in range
11205 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
11206 (match_limit): Don't assume that a fixnum can fit in 'int'.
11207
6511acf2 11208 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
11209 exceed INT_MAX.
11210
6511acf2 11211 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
11212 (Fvertical_motion): Don't wrap around LINES values that don't fit
11213 in 'int'. Instead, treat them as extreme values. This is good
11214 enough for windows, which can't have more than INT_MAX lines anyway.
11215
fcb901a7
LMI
112162011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11217
0f2f6b6d
LMI
11218 * Require libxml/parser.h to avoid compilation warning.
11219
fcb901a7
LMI
11220 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11221
11222 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11223 since this reportedly can destroy thread storage.
11224
6e20a0d4
CY
112252011-08-30 Chong Yidong <cyd@stupidchicken.com>
11226
11227 * syntax.c (find_defun_start): Update all cache variables if
11228 exiting early (Bug#9401).
11229
148ae00e
EZ
112302011-08-30 Eli Zaretskii <eliz@gnu.org>
11231
f6cfbd8f
EZ
11232 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11233
148ae00e
EZ
11234 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11235 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
11236 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
11237
11238 * term.c (tty_append_glyph): New function.
11239 (produce_stretch_glyph): Static function and its prototype deleted.
11240
a66cfb1c
SM
11241 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11242 Add prototypes.
148ae00e 11243
c4a07a4c
PE
112442011-08-29 Paul Eggert <eggert@cs.ucla.edu>
11245
11246 * image.c (parse_image_spec): Check for nonnegative, not for positive,
11247 when checking :margin (Bug#9390).
11248 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 11249 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
11250 so that the name doesn't mislead. All uses changed.
11251
6bc8cd65
JB
112522011-08-28 Johan Bockgård <bojohan@gnu.org>
11253
11254 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11255 set_tty_hooks.
11256
dca4927e
EZ
112572011-08-27 Eli Zaretskii <eliz@gnu.org>
11258
11259 * xdisp.c (move_it_to): Don't bail out early when reaching
11260 position beyond to_charpos, if we are scanning backwards.
11261 (move_it_vertically_backward): When DY == 0, make sure we get to
11262 the first character in the line after the newline.
11263
f2cad773
PE
112642011-08-27 Paul Eggert <eggert@cs.ucla.edu>
11265
11266 * ccl.c: Improve and simplify overflow checking (Bug#9196).
11267 (ccl_driver): Do not generate an out-of-range pointer.
11268 (Fccl_execute_on_string): Remove unnecessary check for
11269 integer overflow, noted by Stefan Monnier in
11270 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11271 Remove a FIXME that didn't need fixing.
11272 Simplify the newly-introduced buffer reallocation code.
11273
0cae2cdb
JB
112742011-08-27 Juanma Barranquero <lekktu@gmail.com>
11275
11276 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11277
5fc295a4 112782011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 11279
70c60eb2 11280 Integer and memory overflow issues (Bug#9196).
726e0ab1 11281
d31850da
PE
11282 * doc.c (get_doc_string): Rework so that
11283 get_doc_string_buffer_size is the actual buffer size, rather than
11284 being 1 less than the actual buffer size; this makes xpalloc more
11285 convenient.
11286
a69fbedb
PE
11287 * image.c (x_allocate_bitmap_record, cache_image):
11288 * xselect.c (Fx_register_dnd_atom):
11289 Simplify previous changes by using xpalloc.
11290
fe5c5d37
PE
11291 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11292 since either will do and ptrdiff_t is convenient with xpalloc.
11293
0065d054
PE
11294 * charset.c (charset_table_size)
11295 (struct charset_sort_data.priority): Now ptrdiff_t.
11296 (charset_compare): Don't overflow if priorities differ greatly.
11297 (Fsort_charsets): Don't assume list length fits in int.
11298 Check for size-calculation overflow when allocating sort data.
11299 (syms_of_charset): Allocate an initial charset table that is
11300 just under 64 KiB, to avoid problems with glibc malloc and mmap.
11301
11302 * cmds.c (internal_self_insert): Check for size-calculation overflow.
11303
11304 * composite.h (struct composition.glyph_len): Now int, not unsigned.
11305 The actual value is always <= INT_MAX, and leaving it unsigned made
11306 overflow checking harder.
11307
11308 * dispextern.h (struct glyph_matrix.rows_allocated)
11309 (struct face_cache.size): Now ptrdiff_t, for convenience in use
11310 with xpalloc. The values are still always <= INT_MAX.
11311
11312 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
11313
11314 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
11315 (SAFE_NALLOCA): New macro.
11316
11317 * region-cache.c (struct boundary.pos, find_cache_boundary)
11318 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
11319 (set_cache_region, invalidate_region_cache)
11320 (revalidate_region_cache, know_region_cache, region_cache_forward)
11321 (region_cache_backward, pp_cache):
11322 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
11323 so that ptrdiff_t * can be passed to xpalloc.
11324 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
11325 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
11326 (pp_cache): Don't assume cache_len fits in int.
11327 * region-cache.h: Adjust extern decls to match.
11328
11329 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
11330 EMACS_INT, since either will do, for xpalloc.
11331
11332 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
11333 (xnmalloc, xnrealloc, xpalloc): New functions.
11334
726e0ab1
PE
11335 * bidi.c (bidi_shelve_header_size): New constant.
11336 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11337 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11338
51f30bc5 11339 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
11340 * buffer.c (overlays_at, overlays_in, record_overlay_string)
11341 (overlay_strings):
11342 Don't update size of array until after memory allocation succeeds,
11343 because xmalloc/xrealloc may not return.
0065d054
PE
11344 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11345 now that we have proper integer overflow checking.
11346 (record_overlay_string, overlay_strings): Catch overflows when
11347 calculating size of overlay_str_buf.
726e0ab1 11348
0065d054
PE
11349 * callproc.c (Fcall_process): Check for size overflow when
11350 calculating size of args2.
11351 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11352 Normally we prefer signed values, but sticking with ptrdiff_t would
11353 require adding more-complicated checks.
726e0ab1
PE
11354
11355 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11356 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11357 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 11358 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
11359
11360 * character.c (Fstring): Check for size-calculation overflow.
11361
11362 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11363 unnecessary integer overflow. Check for size overflow.
11364 (encode_coding_object): Don't update size until xmalloc succeeds.
11365
11366 * composite.c (get_composition_id): Check for overflow in glyph
11367 length calculations.
11368
11369 Integer and memory overflow fixes for display code.
11370 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11371 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11372 (scrolling_window): Check for overflow in size calculations.
11373 (line_draw_cost, realloc_glyph_pool, add_row_entry):
11374 Don't assume glyph table len fits in int.
11375 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11376 (row_table_size): Now ptrdiff_t, not int.
11377 (scrolling_window): Avoid overflow in size calculations.
11378 Don't update size until allocation succeeds.
11379 * fns.c (concat): Check for overflow in size calculations.
11380 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11381 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11382 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11383
11384 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11385 (get_doc_string): Check for size calculation overflow.
11386 Don't update size until allocation succeeds.
11387 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11388 EMACS_INT, where ptrdiff_t will do.
11389 (Fsubstitute_command_keys): Check for string overflow.
11390
11391 * editfns.c (set_time_zone_rule): Don't assume environment length
11392 fits in int.
11393 (message_length): Now ptrdiff_t, not int.
11394 (Fmessage_box): Don't update size until allocation succeeds.
11395 Don't assume message length fits in int.
11396 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11397
0065d054
PE
11398 * emacs.c (main): Do not reallocate argv, since there is a null at
11399 the end that can be overwritten, and this way there's no need to
11400 worry about size-calculation overflow.
11401 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
11402
11403 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11404 alloc succeeds.
11405 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11406
11407 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11408 (x_set_scroll_bar_width, x_figure_window_size):
11409 Check for integer overflow.
11410 (x_set_alpha): Do not assume XINT fits in int.
11411
11412 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11413 This is for the members text_lines, text_cols, total_lines, total_cols,
11414 where the system imposes an 'int' limit.
11415
11416 * fringe.c (Fdefine_fringe_bitmap):
11417 Don't update size until alloc works.
11418
11419 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11420 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11421
11422 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11423 Check for size-calculation overflow.
11424 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11425 do, as we prefer signed integers.
11426 (id_to_widget.max_size, id_to_widget.used)
11427 (xg_store_widget_in_map, xg_remove_widget_from_map)
11428 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11429 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11430 Use and return ptrdiff_t, not int.
11431 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11432 * gtkutil.h: Change prototypes to match the above.
11433
11434 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11435 are duplicate now that they've been promoted to lisp.h.
11436 (x_allocate_bitmap_record, x_alloc_image_color)
11437 (make_image_cache, cache_image, xpm_load):
11438 Don't update size until alloc is done.
11439 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11440 (x_detect_edges):
3256efce 11441 Check for size calculation overflow.
726e0ab1
PE
11442 (ct_colors_allocated_max): New constant.
11443 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11444 overflow.
3256efce 11445
726e0ab1
PE
11446 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11447 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11448 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11449 Use ptrdiff_t, not int, to count maps.
11450 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
11451 calculations. Don't update size until allocation succeeds.
11452 Redo calculations to avoid overflow.
726e0ab1
PE
11453 * keyboard.h: Change prototypes to match the above.
11454
11455 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11456 to count maps.
11457 (current_minor_maps): Check for size calculation overflow.
11458 * keymap.h: Change prototypes to match the above.
11459
11460 * lread.c (read1, init_obarray): Don't update size until alloc done.
11461
11462 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11463 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11464
726e0ab1
PE
11465 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11466 Now ptrdiff_t, not int.
11467 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11468 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11469
11470 * process.c (Fnetwork_interface_list): Check for overflow
11471 in size calculation.
11472
11473 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11474
11475 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11476 overflow. Don't bother calling xmalloc when xrealloc will do.
11477
11478 * search.c (Freplace_match): Check for size calculation overflow.
11479 (Fset_match_data): Don't assume list lengths fit in 'int'.
11480
11481 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11482 for command line length. Do not attempt to address one before the
11483 beginning of an array, as that's not portable.
11484
11485 * term.c (max_frame_lines): Remove; unused.
11486 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11487 not int.
11488 (encode_terminal_code, calculate_costs): Check for size
11489 calculation overflow.
11490 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11491 table lengths and related sizes. Don't update size until alloc
11492 done. Redo calculations to avoid overflow.
11493 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11494
11495 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11496 subtracting pointers.
11497 (gobble_line): Check for overflow more carefully. Don't update size
11498 until alloc done.
11499
11500 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11501 Don't update size until alloc done.
11502 Redo size calculations to avoid overflow.
11503 Check for size calculation overflow.
0065d054 11504 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
11505
11506 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11507 Use ptrdiff_t, not int, for sizes.
11508 (store_mode_line_noprop_char): Don't update size until alloc done.
11509
0065d054
PE
11510 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11511 Use ptrdiff_t, not int, for sizes.
11512 (Finternal_make_lisp_face, cache_face):
11513 Check for size calculation overflow.
11514 (cache_face): Treat size calculation overflows as if they were
11515 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
11516
11517 * xfns.c (x_encode_text, x_set_name_internal)
11518 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11519 sizes, since they can exceed INT_MAX in size. Check for size
11520 calculation overflow.
11521
0065d054
PE
11522 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11523 (xg_select): Check for size calculation overflow.
726e0ab1
PE
11524 Don't update size until alloc done.
11525
0065d054 11526 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 11527 as sprintf is limited to int lengths.
1d526e2f 11528
252c5ee1
PE
11529 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11530 (X_LONG_MIN): New macros.
864d7ce7
PE
11531 Use them to make the following changes clearer.
11532 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11533 This change doesn't affect the value now, but it may help remind
11534 future maintainers not to raise the value too much later.
11535 (SELECTION_QUANTUM): Remove, replacing with ...
11536 (selection_quantum): ... new function, which avoids overflow.
11537 All uses changed.
11538 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11539 assumption that selection length fits in 'int'.
11540 (x_reply_selection_request, x_handle_selection_request)
11541 (x_get_window_property, receive_incremental_selection)
11542 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11543 (lisp_data_to_selection_data, clean_local_selection_data):
11544 Use ptrdiff_t, not int, to record length of selection.
11545 (x_reply_selection_request, x_get_window_property)
11546 (receive_incremental_selection, x_property_data_to_lisp):
11547 Redo calculations to avoid overflow.
11548 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 11549 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
11550 something.
11551 (x_get_window_property, receive_incremental_selection)
11552 (lisp_data_to_selection_data, x_property_data_to_lisp):
11553 Check for size-calculation overflow.
11554 (x_get_window_property, receive_incremental_selection)
11555 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11556 Don't store size until memory allocation succeeds.
11557 (x_get_window_property): Plug memory leak on memory exhaustion.
11558 Don't double-block input; malloc is safe here. Don't assume 2**34
11559 - 4 fits in unsigned long. Add an xassert to check
11560 XGetWindowProperty overflow. Be more careful about overflow
11561 calculations, and distinguish size from memory overflow better.
11562 (receive_incremental_selection): When tracing, don't assume
11563 unsigned int is less than INT_MAX.
11564 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11565 harmful) conversions of unsigned short to int.
11566 (lisp_data_to_selection_data): Don't assume that integers
11567 in the range -65535 through -1 fit in an X unsigned short.
11568 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11569 result parameters unless successful. Rely on cons_to_unsigned
11570 to report problems with elements; the old code wasn't right anyway.
11571 (x_check_property_data): Check for int overflow; we cannot use
11572 a wider type due to X limits.
11573 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11574
726e0ab1 11575 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 11576
0065d054
PE
11577 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11578 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
11579 (x_color_cells): Don't store size until memory allocation succeeds.
11580 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 11581 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
11582 (x_term_init): Don't assume length fits in int (sprintf is limited
11583 to int size).
bc18e09d 11584
ebfa62c0
PE
11585 Use ptrdiff_t for composition IDs.
11586 * character.c (lisp_string_width):
11587 * composite.c (composition_table_size, n_compositions)
11588 (get_composition_id, composition_gstring_from_id):
11589 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11590 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11591 * window.c (Frecenter):
11592 Use ptrdiff_t, not int, for composition IDs.
11593 * composite.c (get_composition_id): Check for integer overflow.
11594 * composite.h: Adjust prototypes to match the above changes.
11595
d3411f89
PE
11596 Use ptrdiff_t for hash table indexes.
11597 * category.c (hash_get_category_set):
11598 * ccl.c (ccl_driver):
11599 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11600 * coding.c (coding_system_charset_list, detect_coding_system):
11601 * coding.h (struct coding_system.id):
11602 * composite.c (get_composition_id, gstring_lookup_cache):
11603 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11604 * image.c (xpm_get_color_table_h):
11605 * lisp.h (hash_lookup, hash_put):
11606 * minibuf.c (Ftest_completion):
11607 Use ptrdiff_t for hash table indexes, not int (which is too
11608 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11609 32-bit --with-wide-int hosts).
11610
e097a6fa
PE
11611 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11612 Add a FIXME comment about memory leaks.
11613 (syms_of_charset): Don't assume xmalloc returns.
11614
5637687f
PE
11615 Don't assume that stated character widths fit in int.
11616 * character.c (Fchar_width, c_string_width, lisp_string_width):
11617 * character.h (CHAR_WIDTH):
11618 * indent.c (MULTIBYTE_BYTES_WIDTH):
11619 Use sanitize_char_width to avoid undefined and/or bad behavior
11620 with outlandish widths.
a66cfb1c 11621 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
11622 now that we have two such functions. All uses changed.
11623 (sanitize_char_width): New inline function.
11624
a2271ba2
PE
11625 Don't assume that tab-width fits in int.
11626 * character.h (sanitize_width): New inline function.
11627 (SANE_TAB_WIDTH): New macro.
11628 (ASCII_CHAR_WIDTH): Use it.
11629 * indent.c (sane_tab_width): Remove. All uses replaced by
11630 SANE_TAB_WIDTH (current_buffer).
11631 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11632
18c52557
PE
11633 * fileio.c: Integer overflow issues with file modes.
11634 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11635
caeeedc1
PE
11636 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11637 Remove unreachable code.
11638 (read_hex, load_charset_map_from_file): Check for integer overflow.
11639
6df6ae42 11640 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
11641 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11642 (x_send_scroll_bar_event): Likewise. Check that the size does not
11643 exceed limits imposed by XClientMessageEvent, as well as the usual
11644 ptrdiff_t and size_t limits.
11645
b13995db
PE
11646 * keyboard.c: Overflow, signedness and related fixes.
11647 (make_lispy_movement): Use same integer type in forward decl
11648 that is used in the definition.
11649 (read_key_sequence, keyremap_step):
11650 Change bufsize argument back to int, undoing my 2011-03-30 change.
11651 We prefer signed types, and int is wide enough here.
11652 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11653 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11654 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11655 length, not size_t. Use ptrdiff_t for index, not int.
11656 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11657 possibility of integer overflow.
11658
13464394
PE
11659 Overflow, signedness and related fixes for images.
11660
11661 * dispextern.h (struct it.stack[0].u.image.image_id)
11662 (struct_it.image_id, struct image.id, struct image_cache.size)
11663 (struct image_cache.used, struct image_cache.ref_count):
11664 * gtkutil.c (update_frame_tool_bar):
11665 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11666 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11667 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11668 * nsmenu.m (update_frame_tool_bar):
11669 * xdisp.c (calc_pixel_width_or_height):
11670 * xfns.c (image_cache_refcount):
11671 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11672 on typical 64-bit hosts.
11673
11674 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11675 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11676 Omit unnecessary casts to int.
11677 (parse_image_spec): Check that integers fall into 'int' range
11678 when the callers expect that.
11679 (image_ascent): Redo ascent calculation to avoid int overflow.
11680 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11681 (lookup_image): Remove unnecessary tests.
11682 (xbm_image_p): Locals are now of int, not EMACS_INT,
11683 since parse_image_check makes sure they fit into int.
11684 (png_load, gif_load, svg_load_image):
11685 Prefer int to unsigned where either will do.
11686 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
11687 old tiff_error_handler and tiff_warning_handler.
11688 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
11689 stack buffer overflows. It uses only the features of vsnprintf
11690 that are common to both POSIX and native Microsoft.
11691 (tiff_error_handler, tiff_warning_handler): Use it.
11692 (tiff_load, gif_load, imagemagick_load_image):
11693 Don't assume :index value fits in 'int'.
11694 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11695 (imagemagick_load_image): Check that crop parameters fit into
11696 the integer types that MagickCropImage accepts. Don't assume
11697 Vimagemagick_render_type has a nonnegative value. Don't assume
11698 size_t fits in 'long'.
11699 (gs_load): Use printmax_t to print the widest integers possible.
11700 Check for integer overflow when computing image height and width.
11701
c11821d4
EZ
117022011-08-26 Eli Zaretskii <eliz@gnu.org>
11703
11704 * xdisp.c (redisplay_window): Don't force window start if point
11705 will be invisible in the resulting window. (Bug#9324)
11706
0c95fcf7
EZ
117072011-08-25 Eli Zaretskii <eliz@gnu.org>
11708
11709 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11710 the display spec is of the form `(space ...)'.
11711 (handle_display_spec): Return the value returned by
11712 handle_single_display_spec, not just 1 or zero.
11713 (handle_single_display_spec): If the display spec is of the form
11714 `(space ...)', and specifies display in the text area, return 2
11715 rather than 1.
fee65a97 11716 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
11717 accurately, and prefer exact match for point under bidi.
11718 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
11719
11720 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11721 into disp_prop; all users changed.
11722
11723 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11724 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11725 for the text covered by the display property.
11726
e4ed06f1
CY
117272011-08-25 Chong Yidong <cyd@stupidchicken.com>
11728
11729 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11730 Change return value to nil.
11731 (Frecord_buffer): Delete unused function.
11732
f67cdd7f
EZ
117332011-08-24 Eli Zaretskii <eliz@gnu.org>
11734
5980d4c6
EZ
11735 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11736 buffers, return left-to-right.
8610fe8b
EZ
11737 (set_cursor_from_row): Consider candidate row a win if its glyph
11738 represents a newline and point is on that newline. Fixes cursor
11739 positioning on the newline at EOL of R2L text within L2R
11740 paragraph, and vice versa.
11741 (try_cursor_movement): Check continued rows, in addition to
11742 continuation rows. Fixes unwarranted scroll when point enters a
11743 continued line of R2L text within an L2R paragraph, or vice versa.
11744 (cursor_row_p): Consider the case of point being equal to
11745 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11746 from the end of a short line to the beginning of a continued line
11747 of R2L text within L2R paragraph.
11748 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11749 composed characters.
5980d4c6 11750
f67cdd7f
EZ
11751 * bidi.c (bidi_check_type): Use xassert.
11752 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11753 members.
11754
bca633fb
EZ
117552011-08-23 Eli Zaretskii <eliz@gnu.org>
11756
11757 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11758 a character.
11759
4a5885a7
CY
117602011-08-23 Chong Yidong <cyd@stupidchicken.com>
11761
11762 * nsfont.m (ns_otf_to_script): Fix typo.
11763
0902a04e
KH
117642011-08-22 Kenichi Handa <handa@m17n.org>
11765
11766 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11767 extra slot even if the purpose is char-code-property-table.
11768
1a2e6670
EZ
117692011-08-23 Eli Zaretskii <eliz@gnu.org>
11770
8ddde651
EZ
11771 * xdisp.c (redisplay_window): When computing centering_position,
11772 account for the height of the header line. (Bug#8874)
11773
425cc014
EZ
11774 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11775 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11776 candidate is selected by the mouse, and that candidate has a
11777 composed character under the mouse.
11778
1a2e6670
EZ
11779 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11780 coordinates reported by pos-visible-in-window-p for a composed
11781 character in column zero.
11782
8b76d6f8
SM
117832011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11784
11785 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11786
dac347dd
EZ
117872011-08-22 Eli Zaretskii <eliz@gnu.org>
11788
11789 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11790 consider it a hit if to_charpos is anywhere in the range of the
11791 composed buffer positions.
11792
e013fb34
CY
117932011-08-22 Chong Yidong <cyd@stupidchicken.com>
11794
11795 * image.c (gif_load): Don't assume that each subimage has the same
11796 dimensions as the base image. Handle disposal method that is
11797 "undefined" by the gif spec (Bug#9335).
11798
bd1ba3e8
CY
117992011-08-20 Chong Yidong <cyd@stupidchicken.com>
11800
11801 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 11802 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 11803
54a1215b
EZ
118042011-08-19 Eli Zaretskii <eliz@gnu.org>
11805
823564e5
EZ
11806 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11807 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11808 from an Org mode buffer to a Speedbar frame.
11809
54a1215b
EZ
11810 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11811 a composition, take its buffer position from IT->cmp_it.charpos.
11812 Fixes cursor positioning at the beginning of a line that begins
11813 with a composed character.
11814
9778ebcc
EZ
118152011-08-18 Eli Zaretskii <eliz@gnu.org>
11816
0be6ee06
EZ
11817 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11818 character bidirectional type, use STRONG_L instead. Fixes crashes
11819 in a buffer produced by `describe-categories'.
11820
9778ebcc
EZ
11821 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11822 members before the level stack, so they would be saved and
11823 restored when copying iterator state. Fixes incorrect reordering
11824 around TABs covered by display properties.
11825
156bffbe
AS
118262011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11827
6b02f655 11828 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 11829
72ad093b
CY
118302011-08-17 Chong Yidong <cyd@stupidchicken.com>
11831
11832 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
11833 (internal_condition_case_2, internal_condition_case_n):
11834 Remove unnecessary aborts (Bug#9081).
72ad093b 11835
35774242
EZ
118362011-08-17 Eli Zaretskii <eliz@gnu.org>
11837
11838 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11839 has no `load' handler, try opening the file locally. (Bug#9311)
11840
db76dd85
KB
118412011-08-16 Ken Brown <kbrown@cornell.edu>
11842
11843 * gmalloc.c: Expand comment.
11844
b215eee5
EZ
118452011-08-16 Eli Zaretskii <eliz@gnu.org>
11846
11847 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11848 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11849
a4579d33
KB
118502011-08-16 Ken Brown <kbrown@cornell.edu>
11851
11852 Fix memory allocation problems in Cygwin build (Bug#9273).
11853
11854 * unexcw.c ( __malloc_initialized): Declare external variable.
11855 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11856
8b76d6f8
SM
11857 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11858 New variables.
a4579d33
KB
11859 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11860 dumped emacs.
11861 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11862 in the static heap.
11863 [CYGWIN] (special_realloc): New function.
11864 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11865 requests to realloc storage in the static heap.
11866
3ebec551
PE
118672011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11868
11869 * bidi.c (bidi_initialize): Remove unused local.
11870
9fd8be00
EZ
118712011-08-15 Eli Zaretskii <eliz@gnu.org>
11872
6b02f655
SM
11873 * bidimirror.h:
11874 * biditype.h: Remove file.
11875 * makefile.w32-in ($(BLD)/bidi.$(O)):
11876 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
11877
11878 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11879
11880 * chartab.c: Improve commentary for the uniprop_table API.
11881
32413314
EZ
11882 * bidi.c (bidi_paragraph_init): Support zero value of
11883 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
11884 (bidi_initialize): Use uniprop_table instead of including
11885 biditype.h and bidimirror.h.
32413314 11886
9fd8be00
EZ
11887 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11888 coordinates of the iterator when restoring from ppos_it.
11889 (Bug#9296)
11890
5cf2b69b
KH
118912011-08-14 Kenichi Handa <handa@m17n.org>
11892
11893 * process.c (create_process): Call setup_process_coding_systems
72ad093b 11894 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 11895
daf17d00
EZ
118962011-08-14 Eli Zaretskii <eliz@gnu.org>
11897
11898 * xdisp.c (move_it_in_display_line_to): Don't invoke
11899 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11900 ppos_it. Fixes vertical cursor motion when line beginning is
11901 covered by an image. (Bug#9296)
11902
08e3161a
JD
119032011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11904
11905 * nsterm.h (ns_run_ascript): Declare.
11906 (NSAPP_DATA2_RUNASSCRIPT): Define.
11907
11908 * nsfns.m (as_script, as_result, as_status): New static variables.
11909 (ns_run_ascript): New function.
5e617bc2 11910 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
11911 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11912 the event loop. Get status from as_status (Bug#7276).
11913
11914 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11915 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11916 the event loop (Bug#7276).
11917
a3720aa2
AS
119182011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11919
11920 * gnutls.c (QCgnutls_bootprop_priority)
11921 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11922 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11923 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11924 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11925 (QCgnutls_bootprop_verify_hostname_error)
11926 (QCgnutls_bootprop_callbacks_verify): Rename from
11927 Qgnutls_bootprop_..., all uses changed.
11928
11929 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11930 uses changed.
11931
0a0d27fb
PE
119322011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11933
19d5c50c
PE
11934 * xfaces.c (Qframe_set_background_mode): Now static.
11935 * dispextern.h (Qframe_set_background_mode): Remove decl.
11936
0a0d27fb
PE
11937 * process.c (Fnetwork_interface_info): Declare local only if needed.
11938
377538cb
JD
119392011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11940
11941 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11942 (Fnetwork_interface_list): Allocate in increments of bytes instead
11943 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11944 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11945 sockaddr.
11946 (struct ifflag_def): notrailers is smart on OSX.
11947 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11948 Get hardware address with getifaddrs if available.
11949
08fff70c
EZ
119502011-08-12 Eli Zaretskii <eliz@gnu.org>
11951
11952 * xdisp.c (iterate_out_of_display_property): xassert that
11953 IT->position is set to within IT->object's boundaries. Break from
11954 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
11955 when IT->position is set up wrongly due to some bug.
11956 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
11957 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11958 entry. Force push_it to save on the stack the current
11959 buffer/string position, to be restored by pop_it. Fix flags in
11960 the iterator structure wrt the object coming from a display
11961 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11962 properties. (Bug#9284)
11963
7be1c708 119642011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 11965
7be1c708
CY
11966 * fontset.c (fontset_get_font_group): Add proper type checks.
11967 (Bug#9172)
aac0c6e3 11968
7be1c708 119692011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 11970
7be1c708
CY
11971 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11972 and LC_VERSION_MIN_MACOSX.
11973 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11974 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 11975
97bb72a6
EZ
119762011-08-08 Eli Zaretskii <eliz@gnu.org>
11977
11978 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
11979 no-display-properties-and-no-overlays under bidi display.
11980 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 11981 properties and overlays.
97bb72a6 11982
d5617611
CY
119832011-08-08 Chong Yidong <cyd@stupidchicken.com>
11984
37e11a63
CY
11985 * editfns.c (Fset_time_zone_rule): Document relationship with the
11986 setenv function.
11987
d5617611
CY
11988 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11989 the font entity extracted from the cache (Bug#8109).
11990
58872834
CY
119912011-08-07 Chong Yidong <cyd@stupidchicken.com>
11992
11993 * composite.c (autocmp_chars): Don't reset point. That is done by
11994 restore_point_unwind (Bug#5984).
11995
75bfc667
JL
119962011-08-07 Juri Linkov <juri@jurta.org>
11997
11998 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11999 to show the arg `TIME' instead of `TIMEVAL'.
12000
d1410150
EZ
120012011-08-06 Eli Zaretskii <eliz@gnu.org>
12002
12003 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
12004 display property strides EOL and includes a newline, as in
12005 longlines-mode. (Bug#9254)
75b771e4
EZ
12006 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
12007 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
12008
12009 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12010 is non-zero, even if the data buffer is NULL. Fixes a crash in
12011 vertical-motion with longlines-mode. (Bug#9254)
12012
35928349
EZ
120132011-08-05 Eli Zaretskii <eliz@gnu.org>
12014
ec7cc85b
EZ
12015 * bidi.c <bidi_cache_total_alloc>: Now static.
12016 (bidi_initialize): Initialize bidi_cache_total_alloc.
12017
8b76d6f8 12018 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
12019 cache. (Bug#9221)
12020
12021 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
12022 amount allocated this far in `bidi_cache_total_alloc'.
12023 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
12024 non-zero, only free the data buffer without restoring the cache
12025 contents. All callers changed.
12026
12027 * dispextern.h (bidi_unshelve_cache): Update prototype.
12028
12029 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
12030 (move_it_in_display_line, move_it_to)
12031 (move_it_vertically_backward, move_it_by_lines): Replace the call
12032 to xfree to an equivalent call to bidi_unshelve_cache.
12033 (move_it_in_display_line_to): Fix logic of returning
412b6358 12034 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 12035
e2e2423b
EZ
120362011-08-05 Eli Zaretskii <eliz@gnu.org>
12037
12038 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12039 came from a string character with a `cursor' property. (Bug#9229)
12040
ae9e757a
JD
120412011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12042
12043 * Makefile.in (LIB_PTHREAD): New variable.
12044 (LIBES): Add LIB_PTHREAD (Bug#9216).
12045
12046 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12047 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12048
213bd7f2
AS
120492011-08-04 Andreas Schwab <schwab@linux-m68k.org>
12050
6b02f655 12051 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 12052
99aaf75f
JD
120532011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12054
12055 * xterm.c (x_find_topmost_parent): New function.
12056 (x_set_frame_alpha): Find topmost parent window with
12057 x_find_topmost_parent and set the property there also (bug#9181).
12058 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12059
c74e9d86
PE
120602011-08-04 Paul Eggert <eggert@cs.ucla.edu>
12061
12062 * callproc.c (Fcall_process): Avoid vfork clobbering
12063 the local vars buffer, coding_systems, current_dir.
12064
640c8776
SM
120652011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
12066
12067 * keymap.c (Fmake_composed_keymap): Move to subr.el.
12068
f26d0e4c
PE
120692011-08-03 Paul Eggert <eggert@cs.ucla.edu>
12070
8a10d76c
PE
12071 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
12072 so that it is not optimized away.
12073
f26d0e4c
PE
12074 * xdisp.c (compute_display_string_pos): Remove unused local.
12075
55439c61
EZ
120762011-08-02 Eli Zaretskii <eliz@gnu.org>
12077
12078 Fix slow cursor motion and scrolling in large buffers with
12079 selective display, like Org Mode buffers. (Bug#9218)
12080
12081 * dispextern.h (struct bidi_it): New member disp_prop_p.
12082
12083 * xdisp.c: Remove one-slot cache of display string positions.
12084 (compute_display_string_pos): Accept an additional argument
5e617bc2 12085 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
12086 for a display string or property. If found, set DISP_PROP_P
12087 non-zero.
12088
12089 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
12090 DISP_PROP_P, and pass it to compute_display_string_pos.
12091 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
12092 non-zero. All callers of bidi_fetch_char changed.
12093
fb33fa43
SM
120942011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
12095
12096 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12097
b099e063
DM
120982010-12-03 Don March <don@ohspite.net>
12099
12100 * keymap.c (Fdefine_key): Fix non-prefix key error message when
12101 last character M-[char] is translated to ESC [char] (bug#7541).
12102
5cc7f7af
KH
121032011-08-02 Kenichi Handa <handa@m17n.org>
12104
d0fffa3f 12105 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
12106
12107 * chartab.c (uniprop_table): Make it non-static.
12108
525d5e6e
EZ
121092011-08-01 Eli Zaretskii <eliz@gnu.org>
12110
12111 * xdisp.c (forward_to_next_line_start): Accept additional argument
12112 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12113 on the newline.
12114 (reseat_at_next_visible_line_start): Use the bidi iterator state
12115 returned by forward_to_next_line_start to restore the state of
12116 it->bidi_it after backing up to previous newline. (Bug#9212)
12117
31011111
AS
121182011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12119
12120 * regex.c (re_comp): Protoize.
12121 (re_exec): Fix return type.
12122 (regexec): Fix type of `ret'. (Bug#9203)
12123
476371c4
PE
121242011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12125
e5d76069
PE
12126 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12127 This is needed if max-image-size is a floating-point number.
12128
9a79b20c
AS
121292011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12130
12131 * print.c (print_object): Print empty symbol as ##.
12132
12133 * lread.c (read1): Read ## as empty symbol.
12134
d8c2fa78
AA
121352011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12136
12137 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12138 setting frame foreground color (Bug#9175).
12139 (x_set_background_color): Likewise.
12140
ffe57a7a
AA
12141 * nsmenu.m (-setText): Size tooltip dimensions precisely to
12142 contents (Bug#9176).
12143 (EmacsTooltip -init): Remove bezels and add shadows to
12144 tooltip windows.
12145
bf3492a5
AA
12146 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12147 or scroll bar (Bug#8470).
12148
d55e9c53
AA
12149 * nsfont.m (nsfont_open): Remove assignment to voffset and
12150 unnecessary vars hshink, expand, hd, full_height, min_height.
12151 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12152
12153 * nsterm.h (nsfont_info): Remove voffset field.
12154
d8c2fa78 121552011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
12156
12157 Implement strike-through and overline on NextStep (Bug#8863).
12158
12159 * nsfont.m (nsfont_open): Use underline position provided by font,
12160 instead of hard-coded value of 2.
12161 (nsfont_draw): Call ns_draw_text_decoration instead.
12162
12163 * nsterm.h: Add declaration for ns_draw_text_decoration.
12164
12165 * nsterm.m (ns_draw_text_decoration): New function for drawing
12166 underline, overline, and strike-through.
12167 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
12168 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 12169 accommodate underlining, etc.
4843aac3 12170
4cc60b9b
EZ
121712011-07-28 Eli Zaretskii <eliz@gnu.org>
12172
bc7ece87
EZ
12173 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
12174 default.
4cc60b9b 12175
476371c4
PE
121762011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12177
66606eea
PE
12178 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
12179 Without this fix, if a signal arrives just after memory fills up,
12180 'malloc' might be invoked reentrantly.
12181
476371c4
PE
12182 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
12183 In other words, assume that every image size is allowed, on non-X
12184 hosts. This assumption is probably wrong, but it lets Emacs compile.
12185
f3fcc40d
AS
121862011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12187
12188 * regex.c (re_iswctype): Convert return values to boolean.
12189
350c992f
EZ
121902011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
12191
12192 * xdisp.c (compute_display_string_pos): Don't use cached display
12193 string position if the buffer had its restriction changed.
12194 (Bug#9184)
12195
5266b4bb
PE
121962011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12197
12198 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12199
2573a837 122002011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 12201
41f55ccd 12202 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 12203
39e378da
PE
12204 * bidi.c: Integer size and overflow fixes.
12205 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
12206 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
12207 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12208 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
12209 (bidi_find_other_level_edge):
12210 Use ptrdiff_t instead of EMACS_INT where either will do.
12211 This works better on 32-bit hosts configured --with-wide-int.
12212 (bidi_cache_ensure_space): Check for size-calculation overflow.
12213 Use % rather than repeated addition, for better worst-case speed.
12214 Don't set bidi_cache_size until after xrealloc returns, because it
12215 might not return.
12216 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
12217 (bidi_cache_ensure_space): Also check that the bidi cache size
12218 does not exceed that of the largest Lisp string or buffer. See Eli
12219 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 12220
5e927815
PE
12221 * alloc.c (__malloc_size_t): Remove.
12222 All uses replaced by size_t. See Andreas Schwab's note
12223 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12224
ca4aa935
PE
12225 * image.c: Improve checking for integer overflow.
12226 (check_image_size): Assume that f is nonnull, since
12227 it is always nonnull in practice. This is one less thing to
12228 worry about when checking for integer overflow later.
12229 (x_check_image_size): New function, which checks for integer
12230 overflow issues inside X.
12231 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12232 This removes the need for a memory_full check.
12233 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12234 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12235 (xbm_read_bitmap_data): Change locals back to 'int', since
12236 their values must fit in 'int'.
12237 (xpm_load_image, png_load, tiff_load):
12238 Invoke x_create_x_image_and_pixmap earlier,
12239 to avoid much needless work if the image is too large.
12240 (tiff_load): Treat overly large images as if
12241 x_create_x_image_and_pixmap failed, not as malloc failures.
12242 (gs_load): Use x_check_image_size.
12243
5f8f9cc2
PE
12244 * gtkutil.c: Omit integer casts.
12245 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12246 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12247
5adf60bc
PE
12248 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12249
c8907a93
PE
12250 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12251 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12252 would wrongly return t on a 64-bit host.
12253
e3c25c68
PE
12254 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12255 The plain *_OVERFLOW macros run afoul of GCC bug 49705
12256 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12257 and therefore cause GCC to emit a bogus diagnostic in some cases.
12258
3f791afe
PE
12259 * image.c: Integer signedness and overflow and related fixes.
12260 This is not an exhaustive set of fixes, but it's time to
12261 record what I've got.
12262 (lookup_pixel_color, check_image_size): Remove redundant decls.
12263 (check_image_size): Don't assume that arbitrary EMACS_INT values
12264 fit in 'int', or that arbitrary 'double' values fit in 'int'.
12265 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12266 (tiff_load, imagemagick_load_image):
12267 Check for overflow in size calculations.
12268 (x_create_x_image_and_pixmap): Remove unnecessary test for
12269 xmalloc returning NULL; that can't happen.
12270 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12271 (xpm_color_bucket): Use better integer hashing function.
12272 (xpm_cache_color): Don't possibly over-allocate memory.
12273 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12274 (gif_memory_source):
12275 Use ptrdiff_t, not int or size_t, to record sizes.
12276 (png_load): Don't assume values greater than 2**31 fit in 'int'.
12277 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12278 either works, as we prefer signed integers.
12279 (tiff_read_from_memory, tiff_write_from_memory):
12280 Return tsize_t, not size_t, since that's what the TIFF API wants.
12281 (tiff_read_from_memory): Don't fail simply because the read would
12282 go past EOF; instead, return a short read.
12283 (tiff_load): Omit no-longer-needed casts.
12284 (Fimagemagick_types): Don't assume size fits into 'int'.
12285
3cc5a532
PE
12286 Improve hashing quality when configured --with-wide-int.
12287 * fns.c (hash_string): New function, taken from sxhash_string.
12288 Do not discard information about ASCII character case; this
12289 discarding is no longer needed.
12290 (sxhash-string): Use it. Change sig to match it. Caller changed.
12291 * lisp.h: Declare it.
12292 * lread.c (hash_string): Remove, since we now use fns.c's version.
12293 The fns.c version returns a wider integer if --with-wide-int is
12294 specified, so this should help the quality of the hashing a bit.
12295
b312a492
PE
12296 * emacs.c: Integer overflow minor fix.
12297 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
12298 Define only if GNU_LINUX.
12299 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12300
dfd153ae
PE
12301 * dispnew.c: Integer signedness and overflow fixes.
12302 Remove unnecessary forward decls, that were a maintenance hassle.
12303 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12304 All uses changed.
12305 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
12306 (scrolling_window): Use ptrdiff_t, not int, for byte count.
12307 (prepare_desired_row, line_draw_cost):
12308 Use int, not unsigned, where either works.
12309 (save_current_matrix, restore_current_matrix):
12310 Use ptrdiff_t, not size_t, where either works.
12311 (init_display): Check for overflow more accurately, and without
12312 relying on undefined behavior.
12313
a81d11a3
PE
12314 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
12315 Remove, replacing with the new symbols in lisp.h. All uses changed.
12316 * fileio.c (make_temp_name):
12317 * filelock.c (lock_file_1, lock_file):
12318 * xdisp.c (message_dolog):
12319 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
12320 Use pMd etc. instead.
12321 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
12322 replacing the pWIDE etc. symbols removed from editfns.c.
12323
3300e6fd
PE
12324 * keyboard.h (num_input_events): Now uintmax_t.
12325 This is (very slightly) less likely to mess up due to wraparound.
12326 All uses changed.
12327
fd05c7e9
PE
12328 * buffer.c: Integer signedness fixes.
12329 (alloc_buffer_text, enlarge_buffer_text):
12330 Use ptrdiff_t rather than size_t when either will do, as we prefer
12331 signed integers.
12332
903fe15d
PE
12333 * alloc.c: Integer signedness and overflow fixes.
12334 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
12335 (__malloc_size_t): Default to size_t, not to int.
12336 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12337 (Fgarbage_collect, mark_object_loop_halt, mark_object):
12338 Prefer ptrdiff_t to size_t when either would do, as we prefer
12339 signed integers.
12340 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12341 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12342 Now const. Initialize with values that are in range even if char
12343 is signed.
12344 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12345 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
12346 These functions do the right thing with sizes > 2**32.
12347 (check_depth): Now ptrdiff_t, not int.
12348 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12349 Adjust to new way of storing sizes. Check for size overflow bugs
12350 in rest of code.
12351 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
12352 slightly wrong anyway, as it missed one instance of
12353 XMALLOC_OVERRUN_CHECK_OVERHEAD.
12354 (refill_memory_reserve): Omit needless cast to size_t.
12355 (mark_object_loop_halt): Mark as externally visible.
12356
ac82cc6a
PE
12357 * xselect.c: Integer signedness and overflow fixes.
12358 (Fx_register_dnd_atom, x_handle_dnd_message):
12359 Use ptrdiff_t, not size_t, since we prefer signed.
12360 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12361 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12362 x_dnd_atoms_size and x_dnd_atoms_length.
12363
c2d1e36d
PE
12364 * doprnt.c: Prefer signed to unsigned when either works.
12365 * eval.c (verror):
12366 * doprnt.c (doprnt):
12367 * lisp.h (doprnt):
12368 * xdisp.c (vmessage):
12369 Use ptrdiff_t, not size_t, when using or implementing doprnt,
12370 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12371 prefer signed arithmetic to avoid comparison confusion.
12372 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12373 but is a bit tricky.
12374
0e926e56
PE
12375 Assume freestanding C89 headers, string.h, stdlib.h.
12376 * data.c, doprnt.c, floatfns.c, print.c:
12377 Include float.h unconditionally.
12378 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12379 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12380 * regex.c: Likewise for stddef.h, string.h.
12381 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12382 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12383 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12384 (STDC_HEADERS): Remove obsolete defines.
12385 * sysdep.c: Include limits.h unconditionally.
12386
9cfdb3ec
PE
12387 Assume support for memcmp, memcpy, memmove, memset.
12388 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12389 * regex.c (memcmp, memcpy):
12390 Remove; we assume C89 now.
12391
12392 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12393 (__malloc_safe_bcopy): Remove; no longer needed.
12394
cf950e6b 12395 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
12396 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12397 well either way, and we prefer signed to unsigned.
12398
dbf38e02
LMI
123992011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12400
12401 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12402 closes the connection while we're reading (bug#9182).
12403
d6f0886c 124042011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 12405
d6f0886c
JD
12406 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12407 are specified (Bug#9168).
24e0f6b1 12408
2eb1f9e6
PE
124092011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12410
12411 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12412 Found by GCC static checking and --with-wide-int on a 32-bit host.
12413
22381272 124142011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
12415
12416 * xdisp.c (compute_display_string_pos): Fix logic of caching
12417 previous display string position. Initialize cached_prev_pos to
12418 -1. Fixes slow-down at the beginning of a buffer.
12419
f25e39b4
EZ
124202011-07-24 Eli Zaretskii <eliz@gnu.org>
12421
12422 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12423 for attrs[LFACE_FONTSET_INDEX].
12424
04c4b52e
PE
124252011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12426
12427 * xml.c (parse_region): Remove unused local
12428 that was recently introduced.
12429
c1734fbd
EZ
124302011-07-23 Eli Zaretskii <eliz@gnu.org>
12431
be18c5a5
EZ
12432 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12433 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12434
c1734fbd
EZ
12435 * xdisp.c (move_it_in_display_line_to): Record the best matching
12436 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
12437 exit if none of the characters scanned was an exact match.
12438 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
12439 when exact match is impossible due to invisible text, and the
12440 lines are truncated.
12441
a258d627
JD
124422011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12443
12444 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12445 for OSX >= 10.7.
12446
b6d5a689
EZ
124472011-07-22 Eli Zaretskii <eliz@gnu.org>
12448
0f74f785
EZ
12449 Fix a significant slow-down of cursor motion with C-n, C-p,
12450 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12451 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 12452 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
12453 (next_element_from_buffer): Call compute_stop_pos_backwards to
12454 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
12455 base_level_stop.
12456 (reseat): Don't look for prev_stop, as that could mean a very long
12457 run.
12458 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12459 <cached_disp_overlay_modiff>: Cache for last found display string
12460 position.
551918c1 12461 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
12462 about the same buffer in the same area of character positions, and
12463 the buffer wasn't changed since the time the display string
12464 position was cached.
551918c1 12465
b2d0c91a
EZ
124662011-07-22 Eli Zaretskii <eliz@gnu.org>
12467
12468 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12469 is an integer, which is important for empty lines. (Bug#9149)
12470
043604ee
CY
124712011-07-22 Chong Yidong <cyd@stupidchicken.com>
12472
12473 * frame.c (Fmodify_frame_parameters): In tty case, update the
12474 default face if necessary (Bug#4238).
12475
da4adb04
CY
124762011-07-21 Chong Yidong <cyd@stupidchicken.com>
12477
12478 * editfns.c (Fstring_to_char): No need to explain what a character
12479 is in the docstring (Bug#6576).
12480
9abd0532
LMI
124812011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12482
12483 * xml.c (parse_region): Make sure we always return a tree.
12484
36881d16
HK
124852011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12486
12487 * xml.c (parse_region): If a document contains only comments,
12488 return that, too.
12489
1e98674d
LMI
124902011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12491
12492 * xml.c (make_dom): Return comments, too.
12493
590bd467
PE
124942011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12495
12496 Port to OpenBSD.
12497 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12498 and the surrounding thread.
12499 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12500 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12501 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12502 timer goes off.
12503 * s/openbsd.h (BROKEN_SIGIO): Define.
12504 * unexelf.c (unexec) [__OpenBSD__]:
12505 Don't update the .mdebug section of the Alpha COFF symbol table.
12506
f41628b2
LMI
125072011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12508
12509 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12510 (bug#8460).
12511
b59b67c5
PE
125122011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12513
15e3a074
PE
12514 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12515 This fixes some race conditions on the permissions of any newly
12516 created file.
12517
41bed37d
PE
12518 * alloc.c (valid_pointer_p): Use pipe, not open.
12519 This fixes some permissions issues when debugging.
12520
b59b67c5
PE
12521 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12522 If fchown fails to set both uid and gid, try to set just gid,
12523 as that is sometimes allowed. Adjust the file's mode to eliminate
12524 setuid or setgid bits that are inappropriate if fchown fails.
12525
925a6be7
SM
125262011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12527
12528 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12529 to compare Lisp_Objects.
12530 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12531 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12532 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12533
52968808
AS
125342011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12535
0a6a104b
AS
12536 * lread.c (read_integer): Unread even EOF character.
12537 (read1): Likewise. Properly record start position of symbol.
12538
52968808
AS
12539 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12540 symbol character follows.
12541
9e381cdd
PE
125422011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12543
12544 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12545 This works around a problem with the previous change to Fcopy_file.
12546 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12547 and without this change, GCC might complain about discarding
12548 fchown's return value.
12549
b5641435
JB
125502011-07-16 Juanma Barranquero <lekktu@gmail.com>
12551
12552 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12553
a8031457
PE
125542011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12555
12556 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12557
dd889327
LMI
125582011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12559
750c33f7
LMI
12560 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12561 it's used from the C level.
12562
dd889327
LMI
12563 * process.c: Use the same condition for POLL_FOR_INPUT in both
12564 keyboard.c and process.c (bug#1858).
12565
87e86684
LM
125662011-07-09 Lawrence Mitchell <wence@gmx.li>
12567
12568 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12569 (Fgnutls_boot): Use it.
12570
64348f40
AS
125712011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12572
12573 * doc.c (Fsubstitute_command_keys): Revert last change.
12574
1d698799
LMI
125752011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12576
f863868c
LMI
12577 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12578 quotes the next character, and doesn't affect other longer
12579 sequences (bug#8935).
12580
1d698799
LMI
12581 * lread.c (syms_of_lread): Clarify that is isn't only
12582 `eval-buffer' and `eval-defun' that's affected by
12583 `lexical-binding' (bug#8460).
12584
aa4b6df6
EZ
125852011-07-15 Eli Zaretskii <eliz@gnu.org>
12586
12587 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 12588 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 12589
5d856da6
PE
125902011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12591
ad6042bb
PE
12592 Fix minor problems found by static checking.
12593 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12594 (elsz): Now a signed constant, not a size_t var. We prefer signed
12595 types to unsigned, to avoid integer comparison confusion. Without
12596 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12597 "cannot optimize loop, the loop counter may overflow", a symptom
12598 of the confusion.
f00bbb22 12599 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
12600 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12601
6468f31c
LMI
126022011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12603
49080b10
LMI
12604 * search.c (Fre_search_backward): Mention `case-fold-search' in
12605 all the re_search_* functions (bug#8138).
12606
6468f31c
LMI
12607 * keyboard.c (Fopen_dribble_file): Document when the file is
12608 closed (bug#8056).
12609
c965adc5
EZ
126102011-07-14 Eli Zaretskii <eliz@gnu.org>
12611
df9733bf
EZ
12612 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12613 bidi_cache_idx.
12614
0bb23927
EZ
12615 Support bidi reordering of display and overlay strings.
12616 * xdisp.c (compute_display_string_pos)
12617 (compute_display_string_end): Accept additional argument STRING.
12618 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12619 (reseat_to_string): Initialize bidi_it->string.s and
12620 bidi_it->string.schars.
12621 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
12622 NULL (avoids a crash in bidi_paragraph_init).
12623 Initialize itb.string.lstring.
0bb23927
EZ
12624 (init_iterator): Call bidi_init_it only of a valid
12625 buffer position was specified. Initialize paragraph_embedding to
12626 L2R.
12627 (reseat_to_string): Initialize the bidi iterator.
12628 (display_string): If we need to ignore text properties of
12629 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12630 original value of -1 will not work with bidi.)
12631 (compute_display_string_pos): First arg is now struct
12632 `text_pos *'; all callers changed. Support display properties on
12633 Lisp strings.
12634 (compute_display_string_end): Support display properties on Lisp
12635 strings.
12636 (init_iterator, reseat_1, reseat_to_string): Initialize the
12637 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12638 when iterating on a string not from display properties).
640c8776
SM
12639 (compute_display_string_pos, compute_display_string_end):
12640 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
12641 arrow keys.
12642 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
12643 base_level_stop; instead, set base_level_stop to BEGV.
12644 Fixes crashes in vertical-motion.
0bb23927
EZ
12645 (next_element_from_buffer): Improve commentary for when
12646 the iterator is before prev_stop.
12647 (init_iterator): Initialize bidi_p from the default value of
12648 bidi-display-reordering, not from buffer-local value. Use the
12649 buffer-local value only if initializing for buffer iteration.
12650 (handle_invisible_prop): Support invisible properties on strings
12651 that are being bidi-reordered.
12652 (set_iterator_to_next): Support bidi reordering of C strings and
12653 Lisp strings.
12654 (next_element_from_string): Support bidi reordering of Lisp
12655 strings.
12656 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
12657 (display_string): Support display of R2L glyph rows.
12658 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
12659 (init_iterator): Don't initialize it->bidi_p for strings
12660 here.
12661 (reseat_to_string): Initialize it->bidi_p for strings here.
12662 (next_element_from_string, next_element_from_c_string)
12663 (next_element_from_buffer): Add xassert's for correspondence
12664 between IT's object being iterated and it->bidi_it.string
12665 structure.
12666 (face_before_or_after_it_pos): Support bidi iteration.
12667 (next_element_from_c_string): Handle the case of the first string
12668 character that is not the first one in the visual order.
12669 (get_visually_first_element): New function, refactored from common
12670 parts of next_element_from_buffer, next_element_from_string, and
12671 next_element_from_c_string.
12672 (tool_bar_lines_needed, redisplay_tool_bar)
12673 (display_menu_bar): Force left-to-right direction. Add a FIXME
12674 comment for making that be controlled by a user option.
12675 (push_it, pop_it): Save and restore the state of the
12676 bidi iterator. Save and restore the bidi_p flag.
12677 (pop_it): Iterate out of display property for string iteration as
12678 well.
12679 (iterate_out_of_display_property): Support iteration over strings.
12680 (handle_single_display_spec): Set up it->bidi_it for iteration
12681 over a display string, and call bidi_init_it.
12682 (handle_single_display_spec, next_overlay_string)
12683 (get_overlay_strings_1, push_display_prop): Set up the bidi
12684 iterator for displaying display or overlay strings.
12685 (forward_to_next_line_start): Don't use the shortcut if
12686 bidi-iterating.
12687 (back_to_previous_visible_line_start): If handle_display_prop
12688 pushed the iterator stack, restore the internal state of the bidi
12689 iterator by calling bidi_pop_it same number of times.
12690 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12691 and we are bidi-iterating, don't decrement the iterator position;
12692 instead, set the first_elt flag in the bidi iterator, to produce
12693 the same effect.
12694 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12695 (push_display_prop): xassert that we are iterating a buffer.
12696 (push_it, pop_it): Save and restore paragraph_embedding member.
12697 (handle_single_display_spec, next_overlay_string)
12698 (get_overlay_strings_1, reseat_1, reseat_to_string)
12699 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12700 correctly. Don't assume unibyte strings are not bidi-reordered.
12701 (compute_display_string_pos)
12702 (compute_display_string_end): Fix handling the case of C string.
12703 (push_it, pop_it): Save and restore from_disp_prop_p.
12704 (handle_single_display_spec, push_display_prop): Set the
12705 from_disp_prop_p flag.
12706 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12707 (pop_it): Call iterate_out_of_display_property only if we are
12708 popping after iteration over a string that came from a display
12709 property. Fix a typo in popping stretch info. Add an assertion
12710 for verifying that the iterator position is in sync with the bidi
12711 iterator.
12712 (handle_single_display_spec, get_overlay_strings_1)
12713 (push_display_prop): Fix initialization of paragraph direction for
12714 string when that of the parent object is not yet determined.
12715 (reseat_1): Call bidi_init_it to resync the bidi
12716 iterator with IT's position. (Bug#7616)
12717 (find_row_edges): If ROW->start.pos gives position
12718 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12719 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12720 Reset the from_disp_prop_p flag.
12721 (SAVE_IT, RESTORE_IT): New macros.
12722 (pos_visible_p, face_before_or_after_it_pos)
12723 (back_to_previous_visible_line_start)
12724 (move_it_in_display_line_to, move_it_in_display_line)
12725 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12726 (try_scrolling, redisplay_window, display_line): Use them when
12727 saving a temporary copy of the iterator and restoring it back.
12728 (back_to_previous_visible_line_start, reseat_1)
12729 (init_iterator): Empty the bidi cache "stack".
12730 (move_it_in_display_line_to): If iterator ended up at
12731 EOL, but we never saw any buffer positions smaller than
12732 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12733 motion in bidi-reordered lines.
12734 (move_it_in_display_line_to): Record prev_method and prev_pos
12735 immediately before the call to set_iterator_to_next. Fixes cursor
12736 motion in bidi-reordered lines with stretch glyphs and strings
12737 displayed in margins. (Bug#8133) (Bug#8867)
12738 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12739 TO_CHARPOS.
640c8776
SM
12740 (pos_visible_p): Support positions in bidi-reordered lines.
12741 Save and restore bidi cache.
0bb23927
EZ
12742
12743 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12744 (bidi_paragraph_info): Delete unused struct.
12745 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12746 (bidi_cache_start): New variable.
12747 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12748 to zero.
12749 (bidi_cache_fetch_state, bidi_cache_search)
12750 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12751 (bidi_cache_find, bidi_peek_at_next_level)
12752 (bidi_level_of_next_char, bidi_find_other_level_edge)
12753 (bidi_move_to_visually_next): Compare cache index with
12754 bidi_cache_start rather than with zero.
12755 (bidi_fetch_char): Accept new argument STRING; all callers
12756 changed. Support iteration over a string. Support strings with
12757 display properties. Support unibyte strings. Fix the type of
12758 `len' according to what STRING_CHAR_AND_LENGTH expects.
12759 (bidi_paragraph_init, bidi_resolve_explicit_1)
12760 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
12761 (bidi_level_of_next_char, bidi_move_to_visually_next):
12762 Support iteration over a string.
0bb23927
EZ
12763 (bidi_set_sor_type, bidi_resolve_explicit_1)
12764 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12765 can now be zero (for strings); special values 0 and -1 were
12766 changed to -1 and -2, respectively.
12767 (bidi_char_at_pos): New function.
12768 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12769 Call it instead of FETCH_MULTIBYTE_CHAR.
12770 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12771 initialized to valid values.
12772 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12773 values.
12774 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12775 the test for valid cached positions. Fix the logic for looking up
12776 the sentinel state in the cache. GCPRO the Lisp string we are
12777 iterating.
12778 (bidi_push_it, bidi_pop_it): New functions.
12779 (bidi_initialize): Initialize the bidi cache start stack pointer.
12780 (bidi_cache_ensure_space): New function, refactored from part of
12781 bidi_cache_iterator_state. Don't assume the required size is just
12782 one BIDI_CACHE_CHUNK away.
12783 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12784 (bidi_count_bytes, bidi_char_at_pos): New functions.
12785 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12786 always valid if bidi_cache_idx is valid.
12787 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12788 is valid if it's going to be used.
12789 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12790 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
12791 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12792 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
12793 (bidi_find_other_level_edge, bidi_cache_start_stack):
12794 All variables related to cache indices are now EMACS_INT.
c965adc5 12795
0bb23927
EZ
12796 * dispextern.h (struct bidi_string_data): New structure.
12797 (struct bidi_it): New member `string'. Make flag members be 1-bit
12798 fields, and put them last in the struct.
640c8776
SM
12799 (compute_display_string_pos, compute_display_string_end):
12800 Update prototypes.
0bb23927
EZ
12801 (bidi_push_it, bidi_pop_it): Add prototypes.
12802 (struct iterator_stack_entry): New members bidi_p,
12803 paragraph_embedding, and from_disp_prop_p.
12804 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
12805 (bidi_shelve_cache, bidi_unshelve_cache):
12806 Declare prototypes.
0bb23927
EZ
12807
12808 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12809 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12810 and vector-like objects.
12811
12812 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12813 cache around display iteration.
12814
12815 * window.c (Fwindow_end, window_scroll_pixel_based)
12816 (displayed_window_lines, Frecenter): Save and restore the bidi
12817 cache around display iteration.
12818
3bbd2265
LMI
128192011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12820
12821 * editfns.c (Fdelete_region): Clarify the use of the named
12822 parameters (bug#6788).
12823
adc47434
MR
128242011-07-14 Martin Rudalics <rudalics@gmx.at>
12825
12826 * indent.c (Fvertical_motion): Set and restore w->pointm when
12827 saving and restoring the window's buffer (Bug#9006).
12828
837c31f8
LMI
128292011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12830
12831 * editfns.c (Fstring_to_char): Clarify just what is returned
12832 (bug#6576). Text by Eli Zaretskii.
12833
ac389d0c
JB
128342011-07-13 Juanma Barranquero <lekktu@gmail.com>
12835
12836 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12837
0be0ce47
EZ
128382011-07-13 Eli Zaretskii <eliz@gnu.org>
12839
12840 * buffer.c (mmap_find): Fix a typo.
12841
cd18e7e3
JB
128422011-07-13 Johan Bockgård <bojohan@gnu.org>
12843
12844 Fix execution of x selection hooks.
12845 * xselect.c (Qx_lost_selection_functions)
12846 (Qx_sent_selection_functions): New vars.
12847 (syms_of_xselect): DEFSYM them.
12848 (x_handle_selection_request): Pass Qx_sent_selection_functions
12849 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12850 (x_handle_selection_clear,x_clear_frame_selections):
12851 Pass Qx_lost_selection_functions rather than
12852 Vx_lost_selection_functions to Frun_hook_with_args.
12853
47ea7f44
PE
128542011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12855
ac389d0c 12856 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
12857 The old code sometimes used this field without initializing it.
12858
47ea7f44
PE
12859 * alloc.c (gc_sweep): Don't read past end of array.
12860 In theory, the old code could also have corrupted Emacs internals,
12861 though it'd be very unlikely.
12862
bc985c87
AS
128632011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12864
12865 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 12866 argument. (Bug#4026)
bc985c87 12867
0cf34688
LMI
128682011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12869
b3dadd76
LMI
12870 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12871 key" (bug#4257).
12872
0cf34688
LMI
12873 * window.c (Fset_window_start): Doc fix (bug#4199).
12874 (Fset_window_hscroll): Ditto.
12875
270768cd
PE
128762011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12877
077e3dda 12878 Fix minor new problems caught by GCC 4.6.1.
270768cd 12879 * term.c (init_tty): Remove unused local.
490011a6 12880 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 12881 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 12882 not used otherwise.
270768cd 12883
b1f58454
CY
128842011-07-12 Chong Yidong <cyd@stupidchicken.com>
12885
12886 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12887
22b9578d
LMI
128882011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12889
6e70ab07
LMI
12890 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12891 are the mini-buffer and the echo area (bug#3320).
12892
22b9578d
LMI
12893 * term.c (init_tty): Remove support for supdup, c10 and perq
12894 terminals, which are no longer supported (bug#1482).
12895
8974cc9f
JB
128962011-07-10 Johan Bockgård <bojohan@gnu.org>
12897
12898 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12899
a560d974
JD
129002011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12901
12902 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12903 for non-popups (Bug#3642).
12904
1dae0f0a
AS
129052011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12906
268c2c36 12907 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 12908 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
12909 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12910 * cm.c (losecursor): Likewise.
1dae0f0a
AS
12911 * data.c (fmod): Likewise.
12912 * dispnew.c (swap_glyphs_in_rows): Likewise.
12913 * emacs.c (memory_warning_signal): Likewise.
12914 * floatfns.c (float_error): Likewise.
12915 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12916 (otf_open, font_otf_capability, generate_otf_features)
12917 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12918 Likewise.
12919 * image.c (pbm_read_file): Likewise.
12920 * indent.c (string_display_width): Likewise.
12921 * intervals.c (check_for_interval, search_for_interval)
12922 (inc_interval_count, count_intervals, root_interval)
12923 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12924 * lread.c (defalias): Likewise.
268c2c36 12925 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
12926 * regex.c (set_image_of_range_1, set_image_of_range)
12927 (regex_grow_registers): Likewise.
12928 * sysdep.c (strerror): Likewise.
12929 * termcap.c (valid_filename_p, tprint, main): Likewise.
12930 * tparam.c (main): Likewise.
12931 * unexhp9k800.c (run_time_remap, save_data_space)
12932 (update_file_ptrs, read_header, write_header, calculate_checksum)
12933 (copy_file, copy_rest, display_header): Likewise.
12934 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12935 Likewise.
12936 * xdisp.c (check_it): Likewise.
12937 * xfaces.c (register_color, unregister_color, unregister_colors):
12938 Likewise.
12939 * xfns.c (print_fontset_result): Likewise.
12940 * xrdb.c (member, fatal, main): Likewise.
12941
99033785
PE
129422011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12943
12944 Fix minor problems found by static checking (Bug#9031).
12945 * chartab.c (char_table_set_range, map_sub_char_table):
12946 Remove unused locals.
12947 (uniprop_table): Now static.
12948 * composite.c (_work_char): Remove unused static var.
12949
9cb2ac56
JB
129502011-07-09 Juanma Barranquero <lekktu@gmail.com>
12951
12952 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12953
f25661f0
JD
129542011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12955
12956 * gtkutil.c (qttip_cb): Remove code without function.
12957
8278c4fe
EZ
129582011-07-09 Eli Zaretskii <eliz@gnu.org>
12959
12960 * w32.c (pthread_sigmask): New stub.
12961
1692ae2d 129622011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 12963
8a6ebd58 12964 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
12965 sigprocmask is portable only for single-threaded applications, and
12966 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
12967 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12968 (LIBES): Use it.
12969 * callproc.c (Fcall_process):
12970 * process.c (create_process):
12971 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12972 Use pthread_sigmask, not sigprocmask.
123403e4 12973
1b854618
JD
129742011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12975
12976 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12977 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12978 wrong (Bug#8591).
12979
3fe4b549
JD
129802011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12981
0ce7e563
JD
12982 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12983 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12984 (xg_hide_tooltip): Fix comment.
12985
3fe4b549
JD
12986 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12987 in registerServicesMenuSendTypes.
12988 (validRequestorForSendType): Don't check ns_return_types.
12989
12990 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12991 ns_return_type.
12992
5df75e47
JR
129932011-07-08 Jason Rumney <jasonr@gnu.org>
12994
22610910
JR
12995 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12996 SH_SHOW for hidden windows (Bug#5482).
12997
5df75e47
JR
12998 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12999 frame struct members of non-existent frames (Bug#6284).
13000
699c10bd
JD
130012011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13002
4393663b
JD
13003 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
13004 variable firstTime not needed on OSX >= 10.6.
13005 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
13006 >= 10.5. Use setKnobProportion, setDoubleValue.
13007
13008 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13009 (MAC_OS_X_VERSION_10_5): Define if not defined.
13010 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13011 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13012 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13013
13014 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 13015 cString and lossyCString on OSX >= 10.4.
4393663b 13016
58179cce 13017 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
13018 sizeToFit on OSX >= 10.2.
13019
13020 * nsimage.m (allocInitFromFile): Don't use deprecated method
13021 bestRepresentationForDevice on OSX >= 10.6.
13022
13023 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
13024 to avoid warning.
13025
13026 * emacs.c: Declare unexec_init_emacs_zone.
13027
a63e0781
JD
13028 * nsgui.h: Fix compiler warning about gnulib redefining verify.
13029
699c10bd
JD
13030 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
13031
13032 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13033 on svcsMenu (Bug#8842).
13034
13035 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13036 ns_return_types.
13037 (Fns_list_services): Just return Qnil on 10.6, code not working there.
13038
13039 * nsterm.m (QUTF8_STRING): Declare.
13040 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13041 (validRequestorForSendType): Return type is (id).
13042 Change indexOfObjectIdenticalTo to indexOfObject.
13043 Check if we have local selection before returning self (Bug#8842).
13044 (writeSelectionToPasteboard): Put local selection into paste board
13045 if we have a local selection (Bug#8842).
13046 (syms_of_nsterm): DEFSYM QUTF8_STRING.
13047
13048 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13049 (ns_get_local_selection): Declare.
13050
54e10184
LMI
130512011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
13052
9888ff71
LMI
13053 * keymap.c (describe_map_tree): Don't insert a double newline at
13054 the end of the buffer (bug#1169) and return whether we inserted
13055 something.
13056
54e10184
LMI
13057 * callint.c (Fcall_interactively): Change "reading args" to
13058 "providing args" to try to clarify what it does (bug#1010).
13059
15fa4783
KH
130602011-07-07 Kenichi Handa <handa@m17n.org>
13061
13062 * composite.c (composition_compute_stop_pos): Ignore a static
13063 composition starting before CHARPOS (Bug#8915).
13064
13065 * xdisp.c (handle_composition_prop): Likewise.
13066
a8815b00
EZ
130672011-07-07 Eli Zaretskii <eliz@gnu.org>
13068
13069 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13070 (Bug#9015)
13071
ef7b981d 130722011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
13073
13074 * character.h (unicode_category_t): New enum type.
13075
13076 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13077 (Qchar_code_property_table): New variable.
13078 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13079 (UNIPROP_COMPRESSED_FORM_P): New macros.
13080 (char_table_ascii): Uncompress the compressed values.
13081 (sub_char_table_ref): New arg is_uniprop. Callers changed.
13082 Uncompress the compressed values.
ac389d0c 13083 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
13084 (char_table_ref_and_range): Uncompress the compressed values.
13085 (sub_char_table_set): New arg is_uniprop. Callers changed.
13086 Uncompress the compressed values.
13087 (sub_char_table_set_range): Args changed. Callers changed.
13088 (char_table_set_range): Adjuted for the above change.
13089 (map_sub_char_table): Delete args default_val and parent. Add arg
13090 top. Give decoded values to a Lisp function.
640c8776 13091 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
13092 values to a Lisp function. Gcpro more variables.
13093 (uniprop_table_uncompress)
13094 (uniprop_decode_value_run_length): New functions.
13095 (uniprop_decoder, uniprop_decoder_count): New variables.
13096 (uniprop_get_decoder, uniprop_encode_value_character)
13097 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13098 New functions.
13099 (uniprop_encoder, uniprop_encoder_count): New variables.
13100 (uniprop_get_encoder, uniprop_table)
13101 (Funicode_property_table_internal, Fget_unicode_property_internal)
13102 (Fput_unicode_property_internal): New functions.
13103 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13104 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 13105 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
13106 char-code-property-alist.
13107
640c8776 13108 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
13109 Vunicode_category_table.
13110
640c8776 13111 * font.c (font_range): Adjust for the change of
c805dec0
KH
13112 Vunicode_category_table.
13113
76b397fb
DN
131142011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13115
13116 * m/iris4d.h: Remove file, move contents ...
13117 * s/irix6-5.h: ... here.
13118
22b4128e
PE
131192011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13120
13121 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
13122 * alloc.c (mark_buffer):
13123 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13124 (clone_per_buffer_values): Don't assume that
22b4128e
PE
13125 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13126 This isn't true in general, and it's particularly not true
13127 if Emacs is configured with --with-wide-int.
13128 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13129 New macros, used in the buffer.c change.
13130
869795d6
JD
131312011-07-05 Jan Djärv <jan.h.d@swipnet.se>
13132
13133 * xsettings.c: Use both GConf and GSettings if both are available.
13134 (store_config_changed_event): Add comment.
13135 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13136 (store_tool_bar_style_changed): New functions.
5e617bc2 13137 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
13138 (struct xsettings): Move font inside HAVE_XFT.
13139 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 13140 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 13141 Move inside HAVE_XFT.
640c8776 13142 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
13143 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13144 also.
13145 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 13146 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 13147 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
13148 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13149 (parse_settings): Move check for font inside HAVE_XFT.
13150 (read_settings, apply_xft_settings): Add comment.
13151 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
13152 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
13153 call store_font_name_changed.
13154 (xft_settings_event): Add comment.
13155 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
13156 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
13157 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
13158 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
13159 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
13160 (xsettings_get_system_font, xsettings_get_system_normal_font):
13161 Add comment.
869795d6 13162
d8ed26bd
PE
131632011-07-05 Paul Eggert <eggert@cs.ucla.edu>
13164
13165 Random fixes. E.g., (random) never returned negative values.
13166 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
13167 subseconds part to the entropy, as that's a bit more random.
13168 Prefer signed to unsigned, since the signedness doesn't matter and
13169 in general we prefer signed. When given a limit, use a
13170 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
13171 latter isn't right if USE_2_TAGS_FOR_INTS.
13172 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
13173 not 0..VALMASK. Don't discard "excess" bits that random () returns.
13174
cabf1cac
SM
131752011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
13176
13177 * textprop.c (text_property_stickiness):
13178 Obey Vtext_property_default_nonsticky.
13179 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
13180 * w32fns.c (syms_of_w32fns):
13181 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
13182
6e9b2be9
PE
131832011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13184
13185 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
13186 This is more efficient than Ffile_directory_p and avoids a minor race.
13187
90186c68
LMI
131882011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
13189
7c301272
LMI
13190 * buffer.c (Foverlay_put): Say what the return value is
13191 (bug#7835).
13192
c4f2d8d4
LMI
13193 * fileio.c (barf_or_query_if_file_exists): Check first if the file
13194 is a directory before asking whether to use the file name
13195 (bug#7564).
ad637907
LMI
13196 (barf_or_query_if_file_exists): Make the "File is a directory"
13197 error be more correct.
c4f2d8d4 13198
90186c68
LMI
13199 * fns.c (Frequire): Remove the mention of the .gz files, since
13200 that's installation-specific, but keep the mention of
13201 `get-load-suffixes'.
13202
da64016e
PE
132032011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13204
13205 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
13206 Report string overflow if the output is too long.
13207
7d47b580
JB
132082011-07-04 Juanma Barranquero <lekktu@gmail.com>
13209
a555cb87
JB
13210 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
13211 (syms_of_gnutls): Remove duplicate DEFSYM for
13212 Qgnutls_bootprop_verify_hostname_error, an error for
13213 Qgnutls_bootprop_verify_error (which is no longer used).
13214
7d47b580
JB
13215 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13216 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
13217 Also (re)move comments that are misplaced or no longer relevant.
13218
1e49bfab
LMI
132192011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13220
13221 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13222
1485f4c0
CY
132232011-07-03 Chong Yidong <cyd@stupidchicken.com>
13224
13225 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13226 and background color parameters if they have been changed.
13227
a9ab721e
LMI
132282011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13229
13230 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13231
cf7cff57
PE
132322011-07-03 Paul Eggert <eggert@cs.ucla.edu>
13233
2e13213d
PE
13234 * xsettings.c (SYSTEM_FONT): Define only when used.
13235 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13236
cf7cff57
PE
13237 * keymap.c (access_keymap_1): Now static.
13238
7a8e04f7
CY
132392011-07-02 Chong Yidong <cyd@stupidchicken.com>
13240
13241 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13242 leave any prefix arg for the up event (Bug#1586).
13243
61352f62
LMI
132442011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
13245
69bb1ef7
LMI
13246 * lread.c (syms_of_lread): Mention single symbols defined by
13247 `defvar' or `defconst' (bug#7154).
13248
61352f62 13249 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 13250 (Frequire): Mention get-load-suffixes.
61352f62 13251
28545e04
MR
132522011-07-02 Martin Rudalics <rudalics@gmx.at>
13253
13254 * window.h (window): Remove clone_number slot.
13255 * window.c (Fwindow_clone_number, Fset_window_clone_number):
13256 Remove.
13257 (make_parent_window, make_window, saved_window)
13258 (Fset_window_configuration, save_window_save): Don't deal with
13259 clone numbers.
13260 * buffer.c (Qclone_number): Remove declaration.
13261 (sort_overlays, overlay_strings): Don't deal with clone numbers.
13262
3349e122
SM
132632011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
13264
13265 Add multiple inheritance to keymaps.
13266 * keymap.c (Fmake_composed_keymap): New function.
13267 (Fset_keymap_parent): Simplify.
13268 (fix_submap_inheritance): Remove.
13269 (access_keymap_1): New function extracted from access_keymap to handle
13270 embedded parents and handle lists of maps.
13271 (access_keymap): Use it.
13272 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13273 (Fcopy_keymap): Handle embedded parents.
13274 (Fcommand_remapping, define_as_prefix): Simplify.
13275 (Fkey_binding): Simplify.
13276 (syms_of_keymap): Move minibuffer-local-completion-map,
13277 minibuffer-local-filename-completion-map,
13278 minibuffer-local-must-match-map, and
13279 minibuffer-local-filename-must-match-map to Elisp.
13280 (syms_of_keymap): Defsubr make-composed-keymap.
13281 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13282 (parse_menu_item): Trivial simplification.
13283
3279eb87
GM
132842011-07-01 Glenn Morris <rgm@gnu.org>
13285
13286 * Makefile.in (SETTINGS_LIBS): Fix typo.
13287
39cb9e56 132882011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
13289
13290 * coding.c (Fencode_coding_string): Record the last coding system
13291 used, as the function doc string says (bug#8738).
13292
0949d2b6
JD
132932011-07-01 Jan Djärv <jan.h.d@swipnet.se>
13294
13295 * xsettings.c (store_monospaced_changed): Take new font as arg and
13296 check for change against current_mono_font.
13297 (EMACS_TYPE_SETTINGS): Remove this and related defines.
13298 (emacs_settings_constructor, emacs_settings_get_property)
13299 (emacs_settings_set_property, emacs_settings_class_init)
13300 (emacs_settings_init, gsettings_obj): Remove.
13301 (something_changedCB): New function for HAVE_GSETTINGS.
13302 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13303 with value as argument.
13304 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
13305 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 13306 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
13307 "changed".
13308
13309 * xgselect.c: Add defined (HAVE_GSETTINGS).
13310 (xgselect_initialize): Ditto.
13311
13312 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
13313 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
13314 xg_select.
13315
bbc6b304
PE
133162011-07-01 Paul Eggert <eggert@cs.ucla.edu>
13317
13318 * eval.c (struct backtrace): Simplify and port the data structure.
13319 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
13320 signed bit field, as this assumption is not portable and it makes
13321 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
13322 "char debug_on_exit : 1" as this is not portable either; instead,
13323 use the portable "unsigned int debug_on_exit : 1". Remove unused
13324 member evalargs. Remove obsolete comments about cc bombing out.
13325
9851bfc5
JD
133262011-06-30 Jan Djärv <jan.h.d@swipnet.se>
13327
51bb811f 13328 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
13329 Let HAVE_GSETTINGS override HAVE_GCONF.
13330 (store_monospaced_changed): New function.
13331 (EMACS_SETTINGS): A new type derived from GObject to handle
13332 GSettings notifications.
13333 (emacs_settings_constructor, emacs_settings_get_property)
13334 (emacs_settings_set_property, emacs_settings_class_init):
13335 New functions.
13336 (gsettings_client, gsettings_obj): New variables.
13337 (GSETTINGS_SCHEMA): New define.
13338 (something_changedCB): Call store_monospaced_changed.
13339 (init_gsettings): New function.
13340 (xsettings_initialize): Call init_gsettings.
13341 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13342 to NULL.
13343
640c8776 13344 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
13345 GCONF_CFLAGS/LIBS.
13346
5386012d
MR
133472011-06-29 Martin Rudalics <rudalics@gmx.at>
13348
13349 * window.c (resize_root_window, grow_mini_window)
13350 (shrink_mini_window): Rename Qresize_root_window to
13351 Qwindow_resize_root_window and Qresize_root_window_vertically to
13352 Qwindow_resize_root_window_vertically.
13353
f13e0b08
PE
133542011-06-28 Paul Eggert <eggert@cs.ucla.edu>
13355
13356 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13357
94515237
JB
133582011-06-27 Juanma Barranquero <lekktu@gmail.com>
13359
13360 * makefile.w32-in: Redesign dependencies so they reflect more
13361 clearly which files are directly included by each source file,
13362 and not through other includes.
13363
e43b6e43
MR
133642011-06-27 Martin Rudalics <rudalics@gmx.at>
13365
13366 * buffer.c (Qclone_number): Declare static and DEFSYM it.
13367 (sort_overlays, overlay_strings): When an overlay's clone number
13368 matches the window's clone number process the overlay even if
13369 the overlay's window property doesn't match the current window.
13370
d68443dc
MR
13371 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13372 (Fwindow_hchild): Rename to Fwindow_left_child.
13373 (Fwindow_next): Rename to Fwindow_next_sibling.
13374 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
13375 (resize_window_check): Rename to window_resize_check.
13376 (resize_window_apply): Rename to window_resize_apply.
13377 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13378 (Fdelete_other_windows_internal, resize_frame_windows)
13379 (Fsplit_window_internal, Fdelete_window_internal)
13380 (grow_mini_window, shrink_mini_window)
13381 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 13382
c7e73be5
JD
133832011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13384
13385 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13386 (emacs_fixed_set_min_size): Remove.
13387 (emacs_fixed_new): Take frame as argument.
13388
13389 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13390 (_EmacsFixedPrivate): Remove minwidth/height.
13391 Add struct frame *f.
13392 (emacs_fixed_init): Initialize priv->f.
13393 (get_parent_class, emacs_fixed_set_min_size): Remove.
13394 (emacs_fixed_new): Set priv->f to argument.
13395 (emacs_fixed_get_preferred_width)
13396 (emacs_fixed_get_preferred_height): Use min_width/height from
13397 frames size_hint to set minimum and natural (Bug#8919).
13398 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13399 and use min_width/height from frames size_hint to set
13400 min_width/height (Bug#8919).
13401
13402 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
13403 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13404 Fix indentation.
c7e73be5 13405
cf99dcf8
EZ
134062011-06-26 Eli Zaretskii <eliz@gnu.org>
13407
13408 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13409 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13410 called at ZV.
13411
029529ac
CY
134122011-06-26 Chong Yidong <cyd@stupidchicken.com>
13413
13414 * process.c (wait_reading_process_output): Bypass select if
13415 waiting for a cell while ignoring keyboard input, and input is
13416 pending. Suggested by Jan Djärv (Bug#8869).
13417
7a7ef429
PE
134182011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13419
13420 Use gnulib's dup2 module instead of rolling our own.
13421 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13422
11fdef7d 134232011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
13424
13425 * dispnew.c (scrolling_window): Before scrolling, turn off a
13426 mouse-highlight in the window being scrolled.
13427
cd3520a4
JB
134282011-06-24 Juanma Barranquero <lekktu@gmail.com>
13429
13430 Move DEFSYM to lisp.h and use everywhere.
13431
13432 * character.h (DEFSYM): Move declaration...
13433 * lisp.h (DEFSYM): ...here.
13434
13435 * gnutls.c:
13436 * minibuf.c:
13437 * w32menu.c:
13438 * w32proc.c:
13439 * w32select.c: Don't include character.h.
13440
13441 * alloc.c (syms_of_alloc):
13442 * buffer.c (syms_of_buffer):
13443 * bytecode.c (syms_of_bytecode):
13444 * callint.c (syms_of_callint):
13445 * casefiddle.c (syms_of_casefiddle):
13446 * casetab.c (init_casetab_once):
13447 * category.c (init_category_once, syms_of_category):
13448 * ccl.c (syms_of_ccl):
13449 * cmds.c (syms_of_cmds):
13450 * composite.c (syms_of_composite):
13451 * dbusbind.c (syms_of_dbusbind):
13452 * dired.c (syms_of_dired):
13453 * dispnew.c (syms_of_display):
13454 * doc.c (syms_of_doc):
13455 * editfns.c (syms_of_editfns):
13456 * emacs.c (syms_of_emacs):
13457 * eval.c (syms_of_eval):
13458 * fileio.c (syms_of_fileio):
13459 * fns.c (syms_of_fns):
13460 * frame.c (syms_of_frame):
13461 * fringe.c (syms_of_fringe):
13462 * insdel.c (syms_of_insdel):
13463 * keymap.c (syms_of_keymap):
13464 * lread.c (init_obarray, syms_of_lread):
13465 * macros.c (syms_of_macros):
13466 * msdos.c (syms_of_msdos):
13467 * print.c (syms_of_print):
13468 * process.c (syms_of_process):
13469 * search.c (syms_of_search):
13470 * sound.c (syms_of_sound):
13471 * syntax.c (init_syntax_once, syms_of_syntax):
13472 * terminal.c (syms_of_terminal):
13473 * textprop.c (syms_of_textprop):
13474 * undo.c (syms_of_undo):
13475 * w32.c (globals_of_w32):
13476 * window.c (syms_of_window):
13477 * xdisp.c (syms_of_xdisp):
13478 * xfaces.c (syms_of_xfaces):
13479 * xfns.c (syms_of_xfns):
13480 * xmenu.c (syms_of_xmenu):
13481 * xsettings.c (syms_of_xsettings):
13482 * xterm.c (syms_of_xterm): Use DEFSYM.
13483
4228cf16
TZ
134842011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13485
cd3520a4 13486 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 13487
7fcccf1e
PE
134882011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13489
7efb4e0e
PE
13490 Integer and buffer overflow fixes (Bug#8873).
13491
ff5844ad
PE
13492 * print.c (printchar, strout): Check for string overflow.
13493 (PRINTPREPARE, printchar, strout):
13494 Don't set size unless allocation succeeds.
13495
90532f02
PE
13496 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13497 for sizes. Check for string overflow more accurately.
13498 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13499
6d84508d
PE
13500 * macros.c: Integer and buffer overflow fixes.
13501 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13502 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13503 Use ptrdiff_t, not int, for sizes.
13504 Don't increment bufsize until after realloc succeeds.
13505 Check for size-calculation overflow.
13506 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13507
437b2cb4
PE
13508 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13509
8b9ac8b4
PE
13510 * lread.c: Integer overflow fixes.
13511 (read_integer): Radix is now EMACS_INT, not int,
13512 to improve quality of diagnostics for out-of-range radices.
13513 Calculate buffer size correctly for out-of-range radices.
13514 (read1): Check for integer overflow in radices, and in
13515 read-circle numbers.
82cb60d3
PE
13516 (read_escape): Avoid int overflow.
13517 (Fload, openp, read_buffer_size, read1)
13518 (substitute_object_recurse, read_vector, read_list, map_obarray):
13519 Use ptrdiff_t, not int, for sizes.
13520 (read1): Use EMACS_INT, not int, for sizes.
20270765 13521 Check for size overflow.
8b9ac8b4 13522
7fcccf1e
PE
13523 * image.c (cache_image): Check for size arithmetic overflow.
13524
bfbbd7e7
PE
13525 * lread.c: Integer overflow issues.
13526 (saved_doc_string_size, saved_doc_string_length)
13527 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13528 Now ptrdiff_t, not int.
13529 (read1): Don't assume doc string length fits in int. Check for
13530 out-of-range doc string lengths.
13531 (read_list): Don't assume file position fits in int.
39019e54 13532 (read_escape): Check for hex character overflow.
bfbbd7e7 13533
4e323265
LL
135342011-06-22 Leo Liu <sdl.web@gmail.com>
13535
13536 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13537 Move to minibuffer.el.
13538
85fece3e
PE
135392011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13540
20b84ce9 13541 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
13542 The following patches are for when GLYPH_DEBUG && !XASSERT.
13543 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13544 * dispnew.c (flush_stdout):
13545 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13546 Mark as externally visible.
13547 * dispnew.c (check_window_matrix_pointers): Now static.
13548 * dispnew.c (window_to_frame_vpos):
13549 * xfns.c (unwind_create_frame):
13550 * xterm.c (x_check_font): Remove unused local.
13551 * scroll.c (CHECK_BOUNDS):
13552 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13553 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13554 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13555 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13556 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13557 Now static.
13558 (debug_method_add): Use va_list and vsprintf rather than relying
13559 on undefined behavior with wrong number of arguments.
13560 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13561 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13562 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13563 since we're not interested in debugging glyphs with old libraries.
13564 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13565 GCC 4.6.0's static checking.
13566
0766b489
PE
135672011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13568
31fd4b32
PE
13569 Integer overflow and signedness fixes (Bug#8873).
13570 A few related buffer overrun fixes, too.
13571
b79e8648
PE
13572 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13573
0766b489
PE
13574 * dispextern.h (struct face.stipple):
13575 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13576 (x_bitmap_mask, x_allocate_bitmap_record)
13577 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13578 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13579 (x_create_bitmap_from_xpm_data):
13580 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13581 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13582 (.bitmaps_last):
13583 * xfaces.c (load_pixmap):
13584 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13585 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13586 (.bitmaps_last, struct x_output.icon_bitmap):
13587 Use ptrdiff_t, not int, for bitmap indexes.
13588 (x_allocate_bitmap_record): Check for size overflow.
13589 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13590
b081724f
PE
13591 Use ptrdiff_t, not int, for overlay counts.
13592 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13593 * editfns.c (overlays_around, get_pos_property):
13594 * textprop.c (get_char_property_and_overlay):
13595 * xdisp.c (next_overlay_change, note_mouse_highlight):
13596 * xfaces.c (face_at_buffer_position):
21514da7
PE
13597 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13598 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13599 (Fnext_overlay_change, Fprevious_overlay_change)
13600 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 13601 Use ptrdiff_t, not int, for sizes.
21514da7 13602 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 13603
3de73e5e
PE
13604 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13605
2606c57b
PE
13606 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13607 (x_session_initialize): Do not assume string length fits in int.
13608
aaafe47a
PE
13609 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13610 This is unlikely, but can occur if DPI is outlandish.
13611
2674ddc8 13612 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
13613 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13614
28154962
PE
13615 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13616 * xrdb.c (magic_file_p, search_magic_path):
13617 Omit last arg SUFFIX; it was always 0. All callers changed.
13618 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13619
7de51af5
PE
13620 * xfont.c (xfont_match): Avoid need for strlen.
13621
25ed6cc3
PE
13622 * xfns.c: Don't assume strlen fits in int.
13623 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13624
4eab31dd
PE
13625 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13626 not unsigned long, as we prefer signed integers. All callers changed.
13627 Detect integer overflow in repeat count.
13628 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 13629 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 13630
171e2a58
PE
13631 * termcap.c: Don't assume sizes fit in int and never overflow.
13632 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13633 (gobble_line): Check for size-calculation overflow.
13634
ad39faca 13635 * minibuf.c (Fread_buffer):
6e5bb2dc 13636 * lread.c (intern, intern_c_string):
74ca2eb3
PE
13637 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13638 Don't assume string length fits in int.
13639
52c61c22 13640 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
13641 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13642
b5b8c9e5
PE
13643 * font.c: Don't assume string length fits in int.
13644 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13645 Use ptrdiff_t, not int.
ccd6111c
PE
13646 (font_intern_prop): Don't assume string length fits in int.
13647 Don't assume integer property fits in fixnum.
13648 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 13649
882f0d81 13650 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 13651 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
13652 Reformulate so as not to need the command string.
13653 Invoke gzip -cd rather than gunzip, as it's more portable.
13654 (lock_info_type, lock_file_1, lock_file):
13655 Don't assume pid_t and time_t fit in unsigned long.
13656 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13657 (current_lock_owner): Prefer signed type for sizes.
13658 Use memcpy, not strncpy, where memcpy is what is really wanted.
13659 Don't assume (via atoi) that time_t and pid_t fit in int.
13660 Check for time_t and/or pid_t out of range, e.g., via a network share.
13661 Don't alloca where an auto var works fine.
13662
93f4cf88
PE
13663 * fileio.c: Fix some integer overflow issues.
13664 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13665 Don't assume string length fits in int.
13666 (directory_file_name): Don't assume string length fits in long.
13667 (make_temp_name): Don't assume pid fits in int, or that its print
13668 length is less than 20.
13669
f3e92b69
PE
13670 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13671
1bfdaf10
PE
13672 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13673
35016e9a
PE
13674 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13675
3d1e65a1
PE
13676 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13677 We prefer signed integers, even for size calculations.
13678
0b963a93
PE
13679 * emacs.c: Don't assume string length fits in 'int'.
13680 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13681 (main): Don't invoke strlen when not needed.
13682
573f4b54
PE
13683 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13684 (XD_DEBUG_MESSAGE): Don't waste a byte.
13685
989f33ba
PE
13686 * callproc.c (getenv_internal_1, getenv_internal)
13687 (Fgetenv_internal):
965d34eb
PE
13688 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13689
e4d29b33
PE
13690 * lread.c (invalid_syntax): Omit length argument.
13691 All uses changed. This doesn't fix a bug, but it simplifies the
13692 code away from its former Hollerith-constant appearance, and it's
13693 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 13694 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 13695
eb49b136
PE
13696 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13697 This didn't break anything, but it didn't help either.
13698 It's confusing to put a bogus integer in a place where the actual
13699 value does not matter.
9f62aeb1 13700 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 13701 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 13702
15375a22
PE
13703 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13704 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13705 implementation.
b61cc01c
PE
13706 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13707 We prefer signed types, and the value cannot exceed the EMACS_INT
13708 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
13709 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13710 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13711 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 13712
53b2623d
PE
13713 * indent.c (sane_tab_width): New function.
13714 (current_column, scan_for_column, Findent_to, position_indentation)
13715 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 13716 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 13717
51cab52b 13718 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 13719
f2ed8a70
PE
13720 * lisp.h (lint_assume): New macro.
13721 * composite.c (composition_gstring_put_cache):
13722 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13723
abe80cc6
PE
13724 * editfns.c, insdel.c:
13725 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 13726
b02c740e
PE
13727 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13728
ebc96716
PE
13729 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13730
b4e50fa0 13731 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 13732 Use much-faster test for byte-length change.
311d5d7c 13733 Don't assume string byte-length fits in 'int'.
a4cf38e4 13734 Check that character arg fits in 'int'.
85461888 13735 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 13736
c0c1ee9f
PE
13737 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13738
a498d7f4
PE
13739 * fns.c (concat): Catch string overflow earlier.
13740 Do not rely on integer wraparound.
13741
51cab52b
PE
13742 * dispextern.h (struct it.overlay_strings_charpos)
13743 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
13744 * xdisp.c (forward_to_next_line_start)
13745 (back_to_previous_visible_line_start)
13746 (reseat_at_next_visible_line_start, next_element_from_buffer):
13747 Don't arbitrarily truncate the value of 'selective' to int.
13748
76031fad
PE
13749 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13750
5eb55db9
PE
13751 * composite.c: Don't truncate sizes to 'int'.
13752 (composition_gstring_p, composition_reseat_it)
13753 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
13754 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13755 not EMACS_UINT, for indexes.
5eb55db9 13756
0703a717
PE
13757 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13758
d6202519
PE
13759 * buffer.c: Include <verify.h>.
13760 (struct sortvec.priority, struct sortstr.priority):
8961a454 13761 Now EMACS_INT, not int.
c20998a7 13762 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
13763 (struct sortstr.size, record_overlay_string)
13764 (struct sortstrlist.size, struct sortlist.used):
13765 Don't truncate size to int.
13766 (record_overlay_string): Check for size-calculation overflow.
d6202519 13767 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 13768
d5a19415
JM
137692011-06-22 Jim Meyering <meyering@redhat.com>
13770
029529ac 13771 Don't leak an XBM-image-sized buffer
d5a19415
JM
13772 * image.c (xbm_load): Free the image buffer after using it.
13773
a9041e6c
PE
137742011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13775
13776 Port to Sun C.
13777 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13778 that Sun C diagnosed.
13779 * fns.c (secure_hash): Fix pointer signedness issue.
13780 * intervals.c (static_offset_intervals): New function.
13781 (offset_intervals): Use it.
13782
7f3f739f
LL
137832011-06-21 Leo Liu <sdl.web@gmail.com>
13784
13785 * deps.mk (fns.o):
13786 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13787 sha512.h.
13788
13789 * fns.c (secure_hash): Rename from crypto_hash_function and change
13790 the first arg to accept symbols.
5b66d427 13791 (Fsecure_hash): New primitive.
7f3f739f
LL
13792 (syms_of_fns): New symbols.
13793
76147d94
DD
137942011-06-20 Deniz Dogan <deniz@dogan.se>
13795
13796 * process.c (Fset_process_buffer): Clarify return value in
13797 docstring.
13798
7d7d0045
CY
137992011-06-18 Chong Yidong <cyd@stupidchicken.com>
13800
13801 * dispnew.c (add_window_display_history): Use BVAR.
13802
13803 * xdisp.c (debug_method_add): Use BVAR.
13804 (check_window_end, dump_glyph_matrix, dump_glyph)
13805 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13806
13807 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13808 Likewise.
13809
13810 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13811 check till after the cache is created in init_frame_faces.
13812
ff2bc410
SM
138132011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13814
13815 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13816
28177add
PE
138172011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13818
dd3482fe
PE
13819 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13820 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13821 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13822
393d71f3 13823 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
13824 * fileio.c (Finsert_file_contents):
13825 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13826 Remove the old (too-loose) buffer overflow checks.
13827 They weren't needed, since make_gap checks for buffer overflow.
13828 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13829 The old code merely checked for Emacs fixnum overflow, and relied
13830 on undefined (wraparound) behavior. The new code avoids undefined
13831 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13832
2e6813b0 13833 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
13834 Tune. Don't use wider integers than needed. Don't use alloca.
13835 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 13836
599a9e4f
PE
13837 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13838
99561444
PE
13839 * insdel.c, lisp.h (buffer_overflow): New function.
13840 (insert_from_buffer_1, replace_range, replace_range_2):
13841 * insdel.c (make_gap_larger):
13842 * editfns.c (Finsert_char):
13843 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13844
28177add
PE
13845 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13846
e69dafad
PE
138472011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13848
4baa020d 13849 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 13850
b1c46f02
PE
13851 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13852 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13853
e69dafad
PE
13854 * fileio.c: Don't assume EMACS_INT fits in off_t.
13855 (emacs_lseek): New static function.
13856 (Finsert_file_contents, Fwrite_region): Use it.
13857 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13858
566684ea
PE
13859 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13860
e6966cd6
PE
13861 * fns.c: Don't overflow int when computing a list length.
13862 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13863 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13864 truncation on 64-bit hosts. Check for QUIT every
13865 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13866 faster and is responsive enough.
13867 (Flength): Report an error instead of overflowing an integer.
13868 (Fsafe_length): Return a float if the value is not representable
13869 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 13870 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 13871 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 13872
dd0b0efb
PE
13873 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13874 (header_size, word_size): New constants.
13875 (allocate_vectorlike): Don't check size overflow here.
13876 (allocate_vector): Check it here instead, since this is the only
13877 caller of allocate_vectorlike that could cause overflow.
13878 Check that the new vector's length is representable as a fixnum.
13879
86fe5cfe
PE
13880 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13881 The previous code was bogus. For example, next_almost_prime (32)
13882 returned 39, which is undesirable as it is a multiple of 3; and
13883 next_almost_prime (24) returned 25, which is a multiple of 5 so
13884 why was the code bothering to check for multiples of 7?
13885
80e88859
PE
13886 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13887
4a2f0ad6
PE
13888 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13889
f66c7cf8
PE
13890 Variadic C functions now count arguments with ptrdiff_t.
13891 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13892 Back then I didn't know that the Emacs coding style prefers signed int.
13893 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
13894 were being counted with int, which may truncate counts on 64-bit
13895 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
13896 * lisp.h (struct Lisp_Subr.function.aMANY)
13897 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13898 Arg counts are now ptrdiff_t, not size_t.
13899 All variadic functions and their callers changed accordingly.
13900 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13901 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13902 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13903 * callint.c (Fcall_interactively): Check arg count for overflow,
13904 to avoid potential buffer overrun. Use signed char, not 'int',
13905 for 'varies' array, so that we needn't bother to check its size
13906 calculation for overflow.
13907 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13908 * eval.c (apply_lambda):
13909 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13910 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13911 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13912
a1759b76
PE
13913 * callint.c (Fcall_interactively): Don't use index var as event count.
13914
d96be9fc
PE
13915 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13916 * mem-limits.h (SIZE): Remove; no longer used.
13917
a690a978 13918 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 13919
578c21e6
PE
13920 Remove unnecessary casts.
13921 * xterm.c (x_term_init):
13922 * xfns.c (x_set_border_pixel):
13923 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13924 These aren't needed now that we assume ANSI C.
13925
96f53c6c
PE
13926 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13927 It's more likely to cause problems (due to unsigned overflow)
13928 than to cure them.
13929
83c77d31
PE
13930 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13931
ee2079f1
PE
13932 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13933
6da65536
PE
13934 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13935
7147c4a4
PE
13936 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13937
193e32d9
PE
13938 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13939
e5533da6
PE
13940 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13941
9910e595
PE
13942 GLYPH_CODE_FACE returns EMACS_INT, not int.
13943 * dispextern.h (merge_faces):
13944 * xfaces.c (merge_faces):
01103c44
PE
13945 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13946 Don't assume EMACS_INT fits in int.
9910e595 13947
2638320e
PE
13948 * character.h (CHAR_VALID_P): Remove unused parameter.
13949 * fontset.c, lisp.h, xdisp.c: All uses changed.
13950
045eb8d9
PE
13951 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13952
c1f134b5
PE
13953 * fns.c (concat): Minor tuning based on overflow analysis.
13954 This doesn't fix any bugs. Use int to hold character, instead
13955 of constantly refetching from Emacs object. Use XFASTINT, not
13956 XINT, for value known to be a character. Don't bother comparing
13957 a single byte to 0400, as it's always less.
13958
395fcb93 13959 * floatfns.c (Fexpt):
327eeec8
PE
13960 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13961
abbd3d23
PE
13962 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13963 for characters.
13964
684a03ef
PE
13965 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13966
0fed43f3
PE
13967 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13968 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13969 incorrectly succeed when S was a string, because 4294967386 was
13970 truncated before it was used.
13971
8fd02eb7
PE
13972 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13973 Otherwise, an out-of-range integer could cause undefined behavior
13974 on a 64-bit host.
13975
f8c86b69
PE
13976 * composite.c: Use int, not EMACS_INT, for characters.
13977 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13978 EMACS_INT, for values that are known to be in character range.
13979 This doesn't fix any bugs but is the usual style inside Emacs and
13980 may generate better code on 32-bit machines.
13981
34206dd2
PE
13982 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13983 This is for reasons similar to the recent CHAR_STRING fix.
13984 * charset.c (Fencode_char): Check that character arg is actually
13985 a character. Pass an int to ENCODE_CHAR.
13986 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13987 wider than 'int', as a compile-time check to prevent future regressions
13988 in this area.
13989
c5958d4c 13990 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
13991
13992 Make sure a 64-bit char is never passed to CHAR_STRING.
13993 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13994 by silently ignoring the top 32 bits, allowing some values
13995 that were far too large to be valid characters.
13996 * character.h: Include <verify.h>.
13997 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13998 arguments are no wider than unsigned, as a compile-time check
13999 to prevent future regressions in this area.
14000 * data.c (Faset):
01103c44 14001 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
14002 (Fsubst_char_in_region):
14003 * fns.c (concat):
14004 * xdisp.c (decode_mode_spec_coding):
14005 Adjust to CHAR_STRING's new requirement.
14006 * editfns.c (Finsert_char, Fsubst_char_in_region):
14007 * fns.c (concat): Check that character args are actually
14008 characters. Without this test, these functions did the wrong
14009 thing with wildly out-of-range values on 64-bit hosts.
14010
d37ca623
PE
14011 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14012 These casts should not be needed on 32-bit hosts, either.
14013 * keyboard.c (read_char):
14014 * lread.c (Fload): Remove casts to unsigned.
14015
ea204efb
PE
14016 * lisp.h (UNSIGNED_CMP): New macro.
14017 This fixes comparison bugs on 64-bit hosts.
14018 (ASCII_CHAR_P): Use it.
14019 * casefiddle.c (casify_object):
01103c44 14020 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
14021 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
14022 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
14023 * dispextern.h (FACE_FROM_ID):
14024 * keyboard.c (read_char): Use UNSIGNED_CMP.
14025
41cb286c
PE
14026 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
14027 not to EMACS_INT, to avoid GCC warning.
14028
4a1b9832
PE
14029 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
14030
55daad71
PE
14031 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
14032 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14033 isn't needed on 32-bit machines.
8f95c75c 14034
01103c44
PE
14035 * buffer.c (Fgenerate_new_buffer_name):
14036 Use EMACS_INT for count, not int.
0ceccced 14037 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
14038
14039 * data.c (Qcompiled_function): Now static.
14040
c6f072e7
PE
14041 * window.c (window_body_lines): Now static.
14042
20ce5912
PE
14043 * image.c (gif_load): Rename local to avoid shadowing.
14044
9c4c5f81
PE
14045 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14046 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14047 * alloc.c (make_save_value): Integer argument is now of type
14048 ptrdiff_t, not int.
14049 (mark_object): Use ptrdiff_t, not int.
14050 * lisp.h (pD): New macro.
14051 * print.c (print_object): Use it.
14052
c0c5c8ae
PE
14053 * alloc.c: Use EMACS_INT, not int, to count objects.
14054 (total_conses, total_markers, total_symbols, total_vector_size)
14055 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
14056 (total_free_floats, total_floats, total_free_intervals)
14057 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
14058 Now EMACS_INT, not int. All uses changed.
14059 (Fgarbage_collect): Compute overall total using a double, so that
14060 integer overflow is less likely to be a problem. Check for overflow
14061 when converting back to an integer.
5a25e253
PE
14062 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14063 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14064 These were 'int' variables that could overflow on 64-bit hosts;
14065 they were never used, so remove them instead of repairing them.
211a0b2a 14066 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
14067 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14068 Previously, this ceilinged at INT_MAX, but that doesn't work on
14069 64-bit machines.
e46bb31a 14070 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 14071
c78baabf 14072 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 14073 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
14074 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
14075 when a (possibly-narrower) signed value would do just as well.
14076 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 14077
c9d624c6
PE
14078 * alloc.c: Catch some string size overflows that we were missing.
14079 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14080 for convenience in STRING_BYTES_MAX.
14081 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14082 The definition here is exact; the one in lisp.h was approximate.
14083 (allocate_string_data): Check for string overflow. This catches
14084 some instances we weren't catching before. Also, it catches
14085 size_t overflow on (unusual) hosts where SIZE_MAX <= min
14086 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14087 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 14088
c9d624c6
PE
14089 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14090 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 14091 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 14092
353032ce
PE
14093 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14094
2bccce07
PE
14095 * alloc.c (Fmake_string): Check for out-of-range init.
14096
0ac30604
SM
140972011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14098
14099 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14100
c195f2de
JD
141012011-06-14 Jan Djärv <jan.h.d@swipnet.se>
14102
14103 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14104 xg_get_default_scrollbar_width.
14105
14106 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14107 (int_gtk_range_get_value): Move to the scroll bar part of the file.
14108 (style_changed_cb): Call update_theme_scrollbar_width and call
14109 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14110 all frames (Bug#8505).
14111 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14112 Call gtk_window_set_resizable if HAVE_GTK3.
14113 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14114 and height if HAVE_GTK3 (Bug#8505).
14115 (scroll_bar_width_for_theme): New variable.
14116 (update_theme_scrollbar_width): New function.
14117 (xg_get_default_scrollbar_width): Move code to
14118 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14119 (xg_initialize): Call update_theme_scrollbar_width.
14120
14121 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14122
14123 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14124
e10ac9f1
MR
141252011-06-12 Martin Rudalics <rudalics@gmx.at>
14126
14127 * frame.c (make_frame): Call other_buffer_safely instead of
14128 other_buffer.
14129
14130 * window.c (temp_output_buffer_show): Call display_buffer with
14131 second argument Vtemp_buffer_show_specifiers and reset latter
14132 immediately after the call.
14133 (Vtemp_buffer_show_specifiers): New variable.
14134 (auto_window_vscroll_p, next_screen_context_lines)
14135 (Vscroll_preserve_screen_position): Remove leading asterisks from
14136 doc-strings.
14137
2d3c217e 141382011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 14139
7b7f97e8 14140 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
14141 * buffer.c (Qclone_number): Remove for now, as it's unused.
14142 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14143 (record_buffer): Remove unused local.
14144 * frame.c (other_visible_frames, frame_buffer_list): Now static.
14145 (set_frame_buffer_list): Remove; unused.
14146 * frame.h (other_visible_frames): Remove decl.
14147 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14148 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14149 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14150 if HAVE_GPM.
14151 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14152 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
14153 Define only if HAVE_GPM.
14154 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
14155 (update_hints_inhibit): Remove; never set. All uses removed.
14156 * widgetprv.h (emacsFrameClassRec): Remove decl.
14157 * window.c (delete_deletable_window): Now returns void, since it
14158 wasn't returning anything.
14159 (compare_window_configurations): Remove unused locals.
14160 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
14161 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
14162 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
14163 the same widths as pointers. This follows up on the 2011-05-06 patch.
14164 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
14165 * xterm.h: Likewise.
14166 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
14167
1384b89e
JB
141682011-06-12 Juanma Barranquero <lekktu@gmail.com>
14169
14170 * makefile.w32-in: Update dependencies.
14171 (LISP_H): Add lib/intprops.h.
14172
1100a63c
CY
141732011-06-11 Chong Yidong <cyd@stupidchicken.com>
14174
14175 * image.c (gif_load): Add animation frame delay to the metadata.
14176 (syms_of_image): Use DEFSYM. New symbol `delay'.
14177
6198ccd0
MR
141782011-06-11 Martin Rudalics <rudalics@gmx.at>
14179
14180 * window.c (delete_deletable_window): Re-add.
14181 (Fset_window_configuration): Rewrite to handle dead buffers and
14182 consequently deletable windows.
14183 (window_tree, Fwindow_tree): Remove. Supply functionality in
14184 window.el.
14185 (compare_window_configurations): Simplify code.
14186
b6e3633c
AS
141872011-06-11 Andreas Schwab <schwab@linux-m68k.org>
14188
1ab0dee5
AS
14189 * image.c (imagemagick_load_image): Fix type mismatch.
14190 (Fimagemagick_types): Likewise.
14191
b6e3633c
AS
14192 * window.h (replace_buffer_in_windows): Declare.
14193
9397e56f
MR
141942011-06-11 Martin Rudalics <rudalics@gmx.at>
14195
14196 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
14197 Qclone_number. Remove external declaration of Qdelete_window.
14198 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
14199 code.
640c8776
SM
14200 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
14201 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
14202 (Fother_buffer): Rewrite doc-string. Major rewrite for new
14203 buffer list implementation.
14204 (other_buffer_safely): New function.
14205 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
14206 calls to replace_buffer_in_windows and
14207 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
14208 if allowed.
14209 (record_buffer): Inhibit quitting and rewrite using quittable
14210 functions. Run Qbuffer_list_update_hook if allowed.
14211 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
14212 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
14213 Move switch-to-buffer to window.el.
9397e56f
MR
14214 (bury-buffer): Move to window.el.
14215 (Vbuffer_list_update_hook): New variable.
14216
14217 * lisp.h (other_buffer_safely): Add prototype in buffer.c
14218 section.
14219
14220 * window.h (resize_frame_windows): Move up in code.
14221 (Fwindow_frame): Remove EXFUN.
14222 (replace_buffer_in_all_windows): Remove prototype.
14223 (replace_buffer_in_windows_safely): Add prototype.
14224
14225 * window.c: Declare Qdelete_window static again. Move down
14226 declaration of select_count.
14227 (Fnext_window, Fprevious_window): Rewrite doc-strings.
14228 (Fother_window): Move to window.el.
14229 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14230 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14231 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14232 window.el.
14233 (replace_buffer_in_windows): Implement by calling
14234 Qreplace_buffer_in_windows.
14235 (replace_buffer_in_all_windows): Remove with some functionality
14236 moved into replace_buffer_in_windows_safely.
14237 (replace_buffer_in_windows_safely): New function.
14238 (select_window_norecord, select_frame_norecord): Move in front
14239 of run_window_configuration_change_hook. Remove now obsolete
14240 declarations.
640c8776
SM
14241 (Fset_window_buffer): Rewrite doc-string.
14242 Call Qrecord_window_buffer.
9397e56f
MR
14243 (keys_of_window): Move binding for other-window to window.el.
14244
b50691aa
CY
142452011-06-11 Chong Yidong <cyd@stupidchicken.com>
14246
14247 * dispextern.h (struct image): Replace data member, whose int_val
14248 and ptr_val fields were not used by anything, with a single
14249 lisp_val object.
14250
14251 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14252 (gif_clear_image, gif_load, imagemagick_load_image)
14253 (gs_clear_image, gs_load): Callers changed.
14254
3f754b86
PE
142552011-06-10 Paul Eggert <eggert@cs.ucla.edu>
14256
cca69397
PE
14257 * buffer.h: Include <time.h>, for time_t.
14258 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
14259
109e28d0
PE
14260 Fix minor problems found by static checking.
14261
60737f02
PE
14262 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14263
4b66faf3
PE
14264 Make identifiers static if they are not used in other modules.
14265 * data.c (Qcompiled_function, Qframe, Qvector):
14266 * image.c (QimageMagick, Qsvg):
14267 * minibuf.c (Qmetadata):
14268 * window.c (resize_window_check, resize_root_window): Now static.
14269 * window.h (resize_window_check, resize_root_window): Remove decls.
14270
109e28d0
PE
14271 * window.c (window_deletion_count, delete_deletable_window):
14272 Remove; unused.
46a4ce9e
PE
14273 (window_body_lines): Now static.
14274 (Fdelete_other_windows_internal): Mark vars as initialized.
14275 Make sure 'resize_failed' is initialized.
14276 (run_window_configuration_change_hook): Rename local to avoid shadowing.
14277 (resize_window_apply): Remove unused local.
14278 * window.h (delete_deletable_window): Remove decl.
14279
109e28d0 14280 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
14281 (imagemagick_load_image): Fix pointer signedness problem by changing
14282 last arg from unsigned char * to char *. All uses changed.
14283 Also, fix a local for similar reasons.
14284 Remove unused locals. Remove locals to avoid shadowing.
14285 (fn_rsvg_handle_free): Remove; unused.
14286 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 14287 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 14288
3f754b86
PE
14289 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14290
2547adb1
CY
142912011-06-10 Chong Yidong <cyd@stupidchicken.com>
14292
14293 * image.c (gif_load): Fix omitted cast error introduced by
14294 2011-06-06 change.
14295
2c8e37d4
MR
142962011-06-10 Martin Rudalics <rudalics@gmx.at>
14297
14298 * window.h (resize_proportionally, orig_total_lines)
14299 (orig_top_line): Remove from window structure.
14300 (set_window_height, set_window_width, change_window_heights)
14301 (Fdelete_window): Remove prototypes.
14302 (resize_frame_windows): Remove duplicate declaration.
14303
440a42e3
EZ
143042011-06-10 Eli Zaretskii <eliz@gnu.org>
14305
14306 * window.h (resize_frame_windows, resize_window_check)
14307 (delete_deletable_window, resize_root_window)
14308 (resize_frame_windows): Declare prototypes.
14309
14310 * window.c (resize_window_apply): Make definition be "static" to
14311 match the prototype.
14312
562dd5e9
MR
143132011-06-10 Martin Rudalics <rudalics@gmx.at>
14314
14315 * window.c: Remove declarations of Qwindow_size_fixed,
14316 window_min_size_1, window_min_size_2, window_min_size,
14317 size_window, window_fixed_size_p, enlarge_window, delete_window.
14318 Remove static from declaration of Qdelete_window, it's
14319 temporarily needed by Fbury_buffer.
14320 (replace_window): Don't assign orig_top_line and
14321 orig_total_lines.
14322 (Fdelete_window, delete_window): Remove. Window deletion is
14323 handled by window.el.
640c8776
SM
14324 (window_loop): Remove DELETE_OTHER_WINDOWS case.
14325 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
14326 (Fdelete_other_windows): Remove. Deleting other windows is
14327 handled by window.el.
14328 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
14329 handled in window.el.
14330 (window_min_size_2, window_min_size_1, window_min_size): Remove.
14331 Window minimum sizes are handled in window.el.
14332 (shrink_windows, size_window, set_window_height)
14333 (set_window_width, change_window_heights, window_height)
14334 (window_width, CURBEG, CURSIZE, enlarge_window)
14335 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
14336 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
14337 handled in window.el.
14338 (make_dummy_parent): Rename to make_parent_window and give it a
14339 second argument horflag.
14340 (make_window): Don't set resize_proportionally any more.
14341 (Fsplit_window): Remove. Windows are split in window.el.
14342 (save_restore_action, save_restore_orig_size)
14343 (shrink_window_lowest_first, save_restore_orig_size): Remove.
14344 Resize mini windows in window.el.
14345 (grow_mini_window, shrink_mini_window): Implement by calling
14346 Qresize_root_window_vertically, resize_window_check and
14347 resize_window_apply.
640c8776
SM
14348 (saved_window, Fset_window_configuration, save_window_save):
14349 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
14350 resize_proportionally.
14351 (window_min_height, window_min_width): Move to window.el.
14352 (keys_of_window): Move bindings for delete-other-windows,
14353 split-window, delete-window and enlarge-window to window.el.
14354
14355 * buffer.c: Temporarily extern Qdelete_window.
14356 (Fbury_buffer): Temporarily call Qdelete_window instead of
14357 Fdelete_window (Fbury_buffer will move to window.el soon).
14358
14359 * frame.c (set_menu_bar_lines_1): Remove code handling
14360 orig_top_line and orig_total_lines.
14361
14362 * dispnew.c (adjust_frame_glyphs_initially): Don't use
14363 set_window_height but set heights directly.
14364 (change_frame_size_1): Use resize_frame_windows.
14365
14366 * xdisp.c (init_xdisp): Don't use set_window_height but set
14367 heights directly.
14368
640c8776
SM
14369 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14370 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
14371 run_window_configuration_change_hook.
14372
14373 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14374 instead of change_window_heights and run
14375 run_window_configuration_change_hook.
14376
1a13852e
MR
143772011-06-09 Martin Rudalics <rudalics@gmx.at>
14378
14379 * window.c (replace_window): Rename second argument REPLACEMENT to
14380 NEW. New third argument SETFLAG. Rewrite.
14381 (delete_window, make_dummy_parent): Call replace_window with
14382 third argument 1.
14383 (window_list_1): Move down in code.
14384 (run_window_configuration_change_hook): Move set_buffer part
14385 before select_frame_norecord part in order to unwind correctly.
14386 Rename count1 to count.
14387 (recombine_windows, delete_deletable_window, resize_root_window)
14388 (Fdelete_other_windows_internal)
14389 (Frun_window_configuration_change_hook, make_parent_window)
14390 (resize_window_check, resize_window_apply, Fresize_window_apply)
14391 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
14392 (Fdelete_window_internal, Fresize_mini_window_internal):
14393 New functions.
1a13852e
MR
14394 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14395
f3d1777e
MR
143962011-06-08 Martin Rudalics <rudalics@gmx.at>
14397
496e208e
MR
14398 * window.h (window): Add some new members to window structure -
14399 normal_lines, normal_cols, new_total, new_normal, clone_number,
14400 splits, nest, prev_buffers, next_buffers.
14401 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 14402 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 14403
f3d1777e
MR
14404 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14405 Remove.
496e208e
MR
14406 (make_dummy_parent): Set new members of windows structure.
14407 (make_window): Move down in code. Handle new members of window
14408 structure.
14409 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14410 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14411 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14412 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
14413 (Fset_window_next_buffers, Fset_window_clone_number):
14414 New functions.
496e208e
MR
14415 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14416 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14417 Doc-string fixes.
14418 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14419 Argument WINDOW can be now internal window too.
14420 (Fwindow_use_time): Move up in code.
14421 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14422 Rewrite doc-string.
14423 (Fset_window_configuration, saved_window)
14424 (Fcurrent_window_configuration, save_window_save): Handle new
14425 members of window structure.
b9e809c2
MR
14426 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14427 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14428 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14429 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14430 Qget_mru_window, Qresize_root_window,
14431 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14432 Qauto_buffer_name; staticpro them.
f3d1777e 14433
abde8f8c
MR
144342011-06-07 Martin Rudalics <rudalics@gmx.at>
14435
14436 * window.c (Fwindow_total_size, Fwindow_left_column)
14437 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14438 (Fwindow_list_1): New functions.
14439 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
14440 (Fwindow_width, Fscroll_left, Fscroll_right):
14441 Use window_body_cols instead of window_box_text_cols.
14442 (delete_window, Fset_window_configuration):
14443 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
14444 (delete_all_subwindows): Take a window as argument and not a
14445 structure. Rewrite.
190b47e6
MR
14446 (window_loop): Remove handling of GET_LRU_WINDOW and
14447 GET_LARGEST_WINDOW.
14448 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
14449
14450 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
14451 window_box_text_cols. delete_all_subwindows now takes a
14452 Lisp_Object as argument.
abde8f8c 14453
640c8776
SM
14454 * indent.c (compute_motion, Fcompute_motion):
14455 Use window_body_cols instead of window_box_text_cols.
abde8f8c 14456
fa8a67e6
MR
14457 * frame.c (delete_frame): Call delete_all_subwindows with root
14458 window as argument.
14459
a54e3482
DC
144602011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14461
14462 * fns.c (Fputhash): Document return value.
14463
60002bf5
CY
144642011-06-06 Chong Yidong <cyd@stupidchicken.com>
14465
14466 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14467
0c671da6 144682011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 14469
b862a52a 14470 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 14471
be44ca6c
PE
14472 Check for overflow when converting integer to cons and back.
14473 * charset.c (Fdefine_charset_internal, Fdecode_char):
14474 Use cons_to_unsigned to catch overflow.
14475 (Fencode_char): Use INTEGER_TO_CONS.
14476 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14477 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14478 * data.c (long_to_cons, cons_to_long): Remove.
14479 (cons_to_unsigned, cons_to_signed): New functions.
14480 These signal an error for invalid or out-of-range values.
14481 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14482 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14483 * font.c (Ffont_variation_glyphs):
14484 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14485 * lisp.h: Include <intprops.h>.
14486 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14487 (cons_to_signed, cons_to_unsigned): New decls.
14488 (long_to_cons, cons_to_long): Remove decls.
14489 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14490 (Fprimitive_undo): Use CONS_TO_INTEGER.
14491 * xfns.c (Fx_window_property): Likewise.
14492 * xselect.c: Include <limits.h>.
14493 (x_own_selection, selection_data_to_lisp_data):
14494 Use INTEGER_TO_CONS.
14495 (x_handle_selection_request, x_handle_selection_clear)
14496 (x_get_foreign_selection, Fx_disown_selection_internal)
14497 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14498 (lisp_data_to_selection_data): Use cons_to_unsigned.
14499 (x_fill_property_data): Use cons_to_signed.
14500 Report values out of range.
14501
d1f3d2af
PE
14502 Check for buffer and string overflow more precisely.
14503 * buffer.h (BUF_BYTES_MAX): New macro.
14504 * lisp.h (STRING_BYTES_MAX): New macro.
14505 * alloc.c (Fmake_string):
14506 * character.c (string_escape_byte8):
14507 * coding.c (coding_alloc_by_realloc):
14508 * doprnt.c (doprnt):
14509 * editfns.c (Fformat):
14510 * eval.c (verror):
14511 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14512 since they may not be the same number.
14513 * editfns.c (Finsert_char):
14514 * fileio.c (Finsert_file_contents):
14515 Likewise for BUF_BYTES_MAX.
14516
dd52fcea
PE
14517 * image.c: Use ptrdiff_t, not int, for sizes.
14518 (slurp_file): Switch from int to ptrdiff_t.
14519 All uses changed.
14520 (slurp_file): Check that file size fits in both size_t (for
14521 malloc) and ptrdiff_t (for sanity and safety).
14522
7f9bbdbb
PE
14523 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14524 if b->modtime has its maximal value.
14525
dfe18f82
PE
14526 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14527
84acfcf0
PE
14528 Don't assume time_t can fit into int.
14529 * buffer.h (struct buffer.modtime): Now time_t, not int.
14530 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14531 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14532
ccd9a01a
PE
14533 Minor fixes for signed vs unsigned integers.
14534 * character.h (MAYBE_UNIFY_CHAR):
14535 * charset.c (maybe_unify_char):
14536 * keyboard.c (read_char, reorder_modifiers):
14537 XINT -> XFASTINT, since the integer must be nonnegative.
14538 * ftfont.c (ftfont_spec_pattern):
14539 * keymap.c (access_keymap, silly_event_symbol_error):
14540 XUINT -> XFASTINT, since the integer must be nonnegative.
14541 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14542 since it makes no difference and we prefer signed.
14543 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14544 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14545 nonnegative.
14546
d6d100dd
SM
145472011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14548
14549 * window.h (Fwindow_frame): Declare.
14550
2b6148e4
PE
145512011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14552
14553 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14554 (SPARE_MEMORY): Always define.
14555 (LARGE_REQUEST): Remove.
14556 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14557
f230ecc9
MR
145582011-06-06 Martin Rudalics <rudalics@gmx.at>
14559
727e958e
MR
14560 * lisp.h: Move EXFUNS for Fframe_root_window,
14561 Fframe_first_window and Fset_frame_selected_window to window.h.
14562
14563 * window.h: Move EXFUNS for Fframe_root_window,
14564 Fframe_first_window and Fset_frame_selected_window here from
14565 lisp.h.
14566
14567 * frame.c (Fwindow_frame, Fframe_first_window)
14568 (Fframe_root_window, Fframe_selected_window)
14569 (Fset_frame_selected_window): Move to window.c.
14570 (Factive_minibuffer_window): Move to minibuf.c.
14571 (Fother_visible_frames_p): New function.
14572
14573 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14574
f230ecc9
MR
14575 * window.c (decode_window, decode_any_window): Move up in code.
14576 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14577 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
14578 (Fwindow_buffer): Move up and rewrite doc-string.
14579 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14580 (Fwindow_prev): New functions.
727e958e
MR
14581 (Fwindow_frame): Move here from frame.c. Accept any window as
14582 argument.
14583 (Fframe_root_window, Fframe_first_window)
14584 (Fframe_selected_window): Move here from frame.c. Accept frame
14585 or arbitrary window as argument. Update doc-strings.
14586 (Fminibuffer_window): Move up in code.
14587 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
14588 (Fset_frame_selected_window): Move here from frame.c.
14589 Marginal rewrite.
727e958e
MR
14590 (Fselected_window, select_window, Fselect_window): Move up in
14591 code. Minor doc-string fixes.
f230ecc9 14592
4d09bcf6
PE
145932011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14594
14595 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14596 Do not assume that spare memory exists; that assumption is valid
14597 only if SYSTEM_MALLOC.
14598 (LARGE_REQUEST): New macro, so that the issue of large requests
14599 is separated from the issue of spare memory.
14600
810928a2
AS
146012011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14602
172418ad
AS
14603 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14604 format. (Bug#8806)
14605
43f862f7
AS
14606 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14607
810928a2
AS
14608 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14609 before statements.
14610
a059fe24
JD
146112011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14612
14613 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14614
14615 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14616
14617 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14618 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14619
989bf368
JB
146202011-06-05 Juanma Barranquero <lekktu@gmail.com>
14621
14622 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14623
4b80f674
CY
146242011-06-04 Chong Yidong <cyd@stupidchicken.com>
14625
14626 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14627 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
14628 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14629 New error handlers.
4b80f674
CY
14630 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14631 Obey Vx_select_enable_clipboard_manager. Catch errors in
14632 x_clipboard_manager_save (Bug#8779).
14633 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 14634 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 14635
99a33b77 146362011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
14637
14638 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14639
99a33b77 146402011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
14641
14642 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14643 in the current matrix if keep_current_p is non-zero.
14644
8264569d
EZ
146452011-06-04 Eli Zaretskii <eliz@gnu.org>
14646
14647 * bidi.c (bidi_level_of_next_char): Fix last change.
14648
57f97249
EZ
146492011-06-03 Eli Zaretskii <eliz@gnu.org>
14650
fec2107c 14651 Support bidi reordering of text covered by display properties.
57f97249 14652
fec2107c
EZ
14653 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14654 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14655 (bidi_cache_search, bidi_cache_iterator_state)
14656 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
14657 (bidi_level_of_next_char, bidi_move_to_visually_next):
14658 Support character positions inside a run of characters covered by a
fec2107c
EZ
14659 display string.
14660 (bidi_paragraph_init, bidi_resolve_explicit_1)
14661 (bidi_level_of_next_char): Call bidi_fetch_char and
14662 bidi_fetch_char_advance instead of FETCH_CHAR and
14663 FETCH_CHAR_ADVANCE.
14664 (bidi_init_it): Initialize new members.
14665 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14666 definitions.
14667 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14668 instead of using explicit *_CHAR codes.
d6d100dd
SM
14669 (bidi_resolve_explicit, bidi_resolve_weak):
14670 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
14671 bidirectional text is supported only in multibyte buffers.
14672 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14673 it to initialize the frame_window_p member of struct bidi_it.
14674 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14675 (bidi_resolve_explicit, bidi_resolve_weak)
14676 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14677 bidi_it->nchars is non-positive.
14678 (bidi_level_of_next_char): Don't try to lookup the cache for the
14679 next/previous character if nothing is cached there yet, or if we
14680 were just reseat()'ed to a new position.
c40e2fb2 14681
0e14fe90
EZ
14682 * xdisp.c (set_cursor_from_row): Set start and stop points
14683 according to the row's direction when priming the loop that looks
14684 for the glyph on which to display cursor.
14685 (single_display_spec_intangible_p): Function deleted.
14686 (display_prop_intangible_p): Reimplement to call
14687 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
14688 Accept 3 additional arguments needed by handle_display_spec.
14689 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
14690 values: lists, `(when COND...)' forms, etc.
14691 (single_display_spec_string_p): Support property values that are
14692 lists with the argument STRING its top-level element.
14693 (display_prop_string_p): Fix the condition for processing a
14694 property that is a list to be consistent with handle_display_spec.
fec2107c 14695 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
14696 last portion of handle_display_prop.
14697 (compute_display_string_pos): Accept additional argument
14698 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14699 value of a `display' property is a "replacing spec".
14700 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14701 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14702 the display property, but just return a value indicating whether
14703 the display property will replace the characters it covers.
14704 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14705 frame_window_p members of struct bidi_it.
d6d100dd
SM
14706 (compute_display_string_pos, compute_display_string_end):
14707 New functions.
fec2107c
EZ
14708 (push_it): Accept second argument POSITION, where pop_it should
14709 jump to continue iteration.
14710 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 14711
fec2107c
EZ
14712 * keyboard.c (adjust_point_for_property): Adjust the call to
14713 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
14714
14715 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
14716 (bidi_init_it): Update prototypes.
14717 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
14718 (compute_display_string_pos, compute_display_string_end):
14719 Declare prototypes.
fec2107c
EZ
14720 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14721 EMACS_INT.
fc6f18ce 14722
40087514 147232011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 14724
57f53182
PE
14725 Malloc failure behavior now depends on size of allocation.
14726 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14727 * lisp.h: Change signatures accordingly.
14728 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14729 All callers changed. (Bug#8762)
14730
14731 * gnutls.c: Use Emacs's memory allocators.
14732 Without this change, the gnutls library would invoke malloc etc.
14733 directly, which causes problems on non-SYNC_INPUT hosts, and which
14734 runs afoul of improving memory_full behavior. (Bug#8761)
14735 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14736 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14737 xfree instead of the default malloc, realloc, free.
14738 (Fgnutls_boot): No need to check for memory allocation failure,
14739 since xmalloc does that for us.
14740
ac32cd99 14741 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
14742 * category.c (hash_get_category_set):
14743 * ccl.c (ccl_driver):
14744 * charset.c (Fdefine_charset_internal):
14745 * charset.h (struct charset.hash_index):
14746 * composite.c (get_composition_id, gstring_lookup_cache)
14747 (composition_gstring_put_cache):
14748 * composite.h (struct composition.hash_index):
14749 * dispextern.h (struct image.hash):
14750 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14751 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14752 (hashfn_equal, hashfn_user_defined, make_hash_table)
14753 (maybe_resize_hash_table, hash_lookup, hash_put)
14754 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14755 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14756 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14757 * image.c (make_image, search_image_cache, lookup_image)
14758 (xpm_put_color_table_h):
14759 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 14760 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 14761 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 14762 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
14763 * alloc.c (allocate_vectorlike):
14764 Check for overflow in vector size calculations.
14765 * ccl.c (ccl_driver):
14766 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
14767 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14768 need to be updated by these changes.
40087514
PE
14769 * fns.c (make_hash_table, maybe_resize_hash_table):
14770 Check for integer overflow with large hash tables.
0de4bb68
PE
14771 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14772 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14773 (SXHASH_REDUCE): New macro.
14774 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14775 Use it instead of discarding useful hash info with large hash values.
14776 (sxhash_float): New function.
14777 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14778 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
14779 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14780 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
14781 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14782 Adjust signatures to match updated version of code.
14783 (consing_since_gc): Now EMACS_INT, since a single hash table can
14784 use more than INT_MAX bytes.
14785
698d32e2
DN
147862011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14787
14788 Make it possible to build with GCC-4.6+ -O2 -flto.
14789
14790 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14791
fd6fa53f
SM
147922011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14793
14794 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14795 Call minibuffer-inactive-mode.
14796
864db017
JB
147972011-05-31 Juanma Barranquero <lekktu@gmail.com>
14798
14799 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14800 Update dependencies.
14801
2ad0baf4
DN
148022011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14803
14804 * data.c (init_data): Remove code for UTS, this system is not
14805 supported anymore.
14806
4fcc2638
DN
148072011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14808
14809 Don't force ./temacs to start in terminal mode.
14810
14811 * frame.c (make_initial_frame): Initialize faces in all cases, not
14812 only when CANNOT_DUMP is defined.
14813 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14814
c56e0fd5
DN
148152011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14816
14817 * dispnew.c (add_window_display_history): Use const for the string
14818 pointer. Remove declaration, not needed.
14819
333d54da 148202011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 14821
55d4c1b2 14822 Use 'inline', not 'INLINE'.
333d54da 14823 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
14824 * alloc.c, fontset.c (INLINE): Remove.
14825 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14826 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14827 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14828 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14829 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14830
738db178
DN
148312011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14832
14833 Make it possible to run ./temacs.
14834
14835 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14836 syms_of_callproc does the same thing. Remove test for
14837 "initialized", do it in the caller.
14838 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14839
620c53a6
SM
148402011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14841
14842 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14843 (read_minibuf): Use get_minibuffer.
14844 (syms_of_minibuf): Use DEFSYM.
14845 (Qmetadata): New var.
14846 * data.c (Qbuffer): Don't make it static.
14847 (syms_of_data): Use DEFSYM.
14848
e003a292
PE
148492011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14850
14851 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14852 (CCL_CODE_MIN): New macro.
14853
ed008a6d
PE
148542011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14855
3687c2ef
PE
14856 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14857
ed008a6d
PE
14858 * eval.c (Qdebug): Now static.
14859 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14860 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14861 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14862
d66c4c7c
CY
148632011-05-29 Chong Yidong <cyd@stupidchicken.com>
14864
14865 * image.c: Various fixes to ImageMagick code comments.
14866 (Fimagemagick_types): Doc fix.
14867
5fbc2025
PE
148682011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14869
0196f88a
PE
14870 Minor fixes prompted by GCC 4.6.0 warnings.
14871
14872 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14873
5fbc2025
PE
14874 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14875 (x_clipboard_manager_save_all): Move extern decl to ...
14876 * xterm.h: ... here, so that it can be checked for consistency.
14877
1dd3c2d9
CY
148782011-05-29 Chong Yidong <cyd@stupidchicken.com>
14879
14880 * xselect.c (x_clipboard_manager_save_frame)
14881 (x_clipboard_manager_save_all): New functions.
14882 (Fx_clipboard_manager_save): Lisp function deleted.
14883
14884 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14885 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14886
14887 * xterm.h: Update prototype.
14888
5ba6571d
WX
148892011-05-28 William Xu <william.xwl@gmail.com>
14890
14891 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14892 exiting (Bug#8239).
14893
3eaff834
JM
148942011-05-28 Jim Meyering <meyering@redhat.com>
14895
e1900994 14896 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
14897 * fns.c (to_uchar): Define.
14898 (crypto_hash_function): Use it to convert some newly-signed
14899 variables to unsigned, to avoid sign-extension bugs. For example,
14900 without this change, (md5 "truc") would evaluate to
14901 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14902 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 14903 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 14904
0f6990a7
PE
149052011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14906
14907 Integer overflow fixes.
c8a9ca5a 14908
08686060
PE
14909 * dbusbind.c: Serial number integer overflow fixes.
14910 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
14911 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14912 to hold a serial number that is too large for a fixnum.
14913 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14914 Check for serial numbers out of range. Decode any serial number
59568bf0 14915 that was so large that it became a float. (Bug#8722)
08686060 14916
2d1fc3c7
PE
14917 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14918 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14919 Use XFASTINT rather than XUINT when numbers are nonnegative.
14920 (xd_append_arg, Fdbus_method_return_internal):
14921 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14922 arguments, check that Lisp number is nonnegative, rather than
59568bf0 14923 silently wrapping negative numbers around. (Bug#8722)
30217ff0 14924 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 14925 (Bug#8722)
2d1fc3c7 14926
c8a9ca5a
PE
14927 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14928
519e1d69
PE
14929 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14930
6df6ae42 14931 ccl: Add integer overflow checks.
30569699
PE
14932 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14933 (IN_INT_RANGE): New macros.
14934 (ccl_driver): Use them to check for integer overflow when
14935 decoding a CCL program. Many of the new checks are whether XINT (x)
14936 fits in int; it doesn't always, on 64-bit hosts. The new version
14937 doesn't catch all possible integer overflows, but it's an
847044ea 14938 improvement. (Bug#8719)
30569699 14939
c11285dc
PE
14940 * alloc.c (make_event_array): Use XINT, not XUINT.
14941 There's no need for unsigned here.
14942
fdccd48e
PE
14943 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14944 This follows up to the 2011-05-06 change that substituted uintptr_t
14945 for EMACS_INT. This case wasn't caught back then.
14946
37910ab2
PE
14947 Rework Fformat to avoid integer overflow issues.
14948 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14949 now (part of C89). Include <verify.h>.
14950 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14951 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14952 (Fformat): Avoid the prepass trying to compute sizes; it was only
14953 approximate and thus did not catch overflow reliably. Instead, walk
14954 through the format just once, formatting and computing sizes as we go,
14955 checking for integer overflow at every step, and allocating a larger
14956 buffer as needed. Keep track separately whether the format is
14957 multibyte. Keep only the most-recently calculated precision, rather
14958 than them all. Record whether each argument has been converted to
14959 string. Use EMACS_INT, not int, for byte and char and arg counts.
14960 Support field widths and precisions larger than INT_MAX. Avoid
14961 sprintf's undefined behavior with conversion specifications such as %#d
14962 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14963 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14964 formatting out-of-range floating point numbers with int
9173deec 14965 formats. (Bug#8668)
37910ab2 14966
2e6578fb
PE
14967 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14968
0ae6bdee
PE
14969 * data.c: Avoid integer truncation in expressions involving floats.
14970 * data.c: Include <intprops.h>.
14971 (arith_driver): When there's an integer overflow in an expression
14972 involving floating point, convert the integers to floating point
14973 so that the resulting value does not suffer from catastrophic
14974 integer truncation. For example, on a 64-bit host (* 4
14975 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14976 Do not rely on undefined behavior after integer overflow.
14977
de883a70
PE
14978 merge count_size_as_multibyte, parse_str_to_multibyte
14979 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 14980 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
14981 Check for integer overflow.
14982 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14983 since it's now a duplicate of the other. This is more of
14984 a character than a buffer op, so better that it's in character.c.
14985 * fns.c, print.c: Adjust to above changes.
14986
2ff916cb
PE
149872011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14988
14989 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14990
f1b54466
PE
149912011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14992
fb1ac845
PE
14993 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14994 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14995 (x_clipboard_manager_save): Now static.
14996 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14997
f1b54466
PE
14998 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14999 (crypto_hash_function): Now static.
15000 Fix pointer signedness problems. Avoid unnecessary initializations.
15001
a9f737ee
CY
150022011-05-27 Chong Yidong <cyd@stupidchicken.com>
15003
15004 * termhooks.h (Vselection_alist): Make it terminal-local.
15005
15006 * terminal.c (create_terminal): Initialize it.
15007
15008 * xselect.c: Support for clipboard managers.
15009 (Vselection_alist): Move to termhooks.h as terminal-local var.
15010 (LOCAL_SELECTION): New macro.
15011 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15012 (symbol_to_x_atom): Remove gratuitous arg.
15013 (x_handle_selection_request, lisp_data_to_selection_data)
15014 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
15015 (x_own_selection, x_get_local_selection, x_convert_selection):
15016 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
15017 (some_frame_on_display): Delete unused function.
15018 (Fx_own_selection_internal, Fx_get_selection_internal)
15019 (Fx_disown_selection_internal, Fx_selection_owner_p)
15020 (Fx_selection_exists_p): New optional frame arg.
15021 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
15022 (x_handle_selection_clear): Don't treat other terminals with the
15023 same keyboard specially. Use the terminal-local Vselection_alist.
15024 (x_clear_frame_selections): Use Frun_hook_with_args.
15025
15026 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
15027
15028 * xterm.h: Add support for those atoms.
15029
e067f0c1
CY
150302011-05-26 Chong Yidong <cyd@stupidchicken.com>
15031
15032 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15033 (converted_selections, conversion_fail_tag): New global variables.
15034 (x_selection_request_lisp_error): Free the above.
15035 (x_get_local_selection): Remove unnecessary code.
15036 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
15037 of converted selections stored in converted_selections.
15038 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
15039 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15040 (x_convert_selection): New function.
15041 (x_handle_selection_event): Simplify.
15042 (x_get_foreign_selection): Don't ignore incoming requests while
15043 waiting for an answer; this will fail when we implement
15044 SAVE_TARGETS, and seems unnecessary anyway.
15045 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15046 (Vx_sent_selection_functions): Doc fix.
15047
0f4aebc0
LL
150482011-05-26 Leo Liu <sdl.web@gmail.com>
15049
15050 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
15051
e61124cd
YM
150522011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15053
15054 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15055
15056 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15057 for fringe update if it has periodic bitmap.
ac389d0c 15058 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
15059 and fringe_bitmap_periodic_p.
15060
15061 * fringe.c (get_fringe_bitmap_data): New function.
15062 (draw_fringe_bitmap_1, update_window_fringes): Use it.
15063 (update_window_fringes): Record periodicity of fringe bitmap in glyph
15064 row. Mark glyph row for fringe update if periodicity changed.
15065
15066 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15067 for fringe update unless it has periodic bitmap.
15068
f16d9837
KH
150692011-05-25 Kenichi Handa <handa@m17n.org>
15070
15071 * xdisp.c (get_next_display_element): Set correct it->face_id for
15072 a static composition.
15073
e1b90ef6
LL
150742011-05-24 Leo Liu <sdl.web@gmail.com>
15075
15076 * deps.mk (fns.o):
15077 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15078
15079 * fns.c (crypto_hash_function, Fsha1): New function.
15080 (Fmd5): Use crypto_hash_function.
15081 (syms_of_fns): Add Ssha1.
15082
7400048f
PE
150832011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15084
15085 * gnutls.c: Remove unused macros.
15086 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15087 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15088 Remove macros that are defined and never used.
15089 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15090
abb71cf4
CY
150912011-05-22 Chong Yidong <cyd@stupidchicken.com>
15092
15093 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15094 (Fx_get_selection_internal): Minor cleanup.
15095 (Fx_own_selection_internal): Rename arguments for consistency with
15096 select.el.
15097
6307db39
PE
150982011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15099
15100 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15101
f3d4e0a4
CY
151022011-05-22 Chong Yidong <cyd@stupidchicken.com>
15103
15104 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15105
4d8ade89
YM
151062011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15107
15108 * dispnew.c (scrolling_window): Don't exclude the case that the
15109 last enabled row in the desired matrix touches the bottom boundary.
15110
32078c8d
GM
151112011-05-21 Glenn Morris <rgm@gnu.org>
15112
15113 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
15114 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15115 and add some more files.
32078c8d 15116
7285dc67
EZ
151172011-05-20 Eli Zaretskii <eliz@gnu.org>
15118
15119 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15120 report_file_error introduced by the change from 2011-05-07.
15121
89d1bd22
PE
151222011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15123
15124 * systime.h (Time): Define only if emacs is defined.
15125 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15126 where the include path doesn't have X11/X.h by default. See
15127 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15128
cd394be1 151292011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
15130
15131 * composite.c (find_automatic_composition): Fix previous change.
15132
b9704ad9
GM
151332011-05-20 Glenn Morris <rgm@gnu.org>
15134
15135 * lisp.mk: New file, split from Makefile.in.
15136 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15137 (shortlisp): Remove.
15138 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15139
4a720484
GM
151402011-05-19 Glenn Morris <rgm@gnu.org>
15141
15142 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15143 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15144 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15145 (lisp): Set the order to that of loadup.el.
15146 (shortlisp): Make it a copy of $lisp.
15147 (SOME_MACHINE_LISP): Remove.
15148 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15149 Use just $shortlisp, not $SOME_MACHINE_LISP too.
15150
a28d4396
KH
151512011-05-18 Kenichi Handa <handa@m17n.org>
15152
15153 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
15154 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
15155 (find_automatic_composition): Mostly rewrite for efficiency.
15156
a2b1fa8e
JB
151572011-05-18 Juanma Barranquero <lekktu@gmail.com>
15158
15159 * makefile.w32-in: Update dependencies.
15160
8e1f5610
CS
151612011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
15162
15163 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 15164 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 15165
7025ee00 151662011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 15167
cdfa6eab
PE
15168 Fix some integer overflow issues, such as string length overflow.
15169
06d6db33
PE
15170 * insdel.c (count_size_as_multibyte): Check for string overflow.
15171
2b4560a8
PE
15172 * character.c (lisp_string_width): Check for string overflow.
15173 Use EMACS_INT, not int, for string indexes and lengths; in
15174 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
15175 the resulting string length overflows an EMACS_INT; instead,
15176 report a string overflow if no precision given. When checking for
15177 precision exhaustion, use a check that cannot possibly have
15178 integer overflow. (Bug#8675)
15179 * character.h (lisp_string_width): Adjust to new signature.
15180
cb93f9be
PE
15181 * alloc.c (string_overflow): New function.
15182 (Fmake_string): Use it. This doesn't change behavior, but saves
15183 a few bytes and will simplify future changes.
15184 * character.c (string_escape_byte8): Likewise.
15185 * lisp.h (string_overflow): New decl.
15186
1a1f3366
PE
15187 Fixups, following up to the user-interface timestamp change.
15188 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
15189 for UI timestamps, instead of unsigned long.
9fbd6841
PE
15190 * msdos.c (mouse_get_pos): Likewise.
15191 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
15192 * w32gui.h (Time): Define by including "systime.h" rather than by
15193 declaring it ourselves. (Bug#8664)
15194
d4e3e4d3
PE
15195 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
15196 * image.c (clear_image_cache): Likewise.
15197
f6a24d19
PE
15198 * term.c (term_mouse_position): Don't assume time_t wraparound.
15199
08dc5ae6
PE
15200 Be more systematic about user-interface timestamps.
15201 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
15202 and sometimes 'EMACS_UINT', to represent these timestamps.
15203 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
15204 This makes the code easier to follow, and makes it easier to catch
15205 integer overflow bugs such as Bug#8664.
15206 * frame.c (Fmouse_position, Fmouse_pixel_position):
15207 Use Time, not unsigned long, for user-interface timestamps.
15208 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
15209 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
15210 * keyboard.h (last_event_timestamp): Likewise.
15211 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15212 * menu.h (xmenu_show): Likewise.
15213 * term.c (term_mouse_position): Likewise.
15214 * termhooks.h (struct input_event.timestamp): Likewise.
15215 (struct terminal.mouse_position_hook): Likewise.
15216 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15217 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15218 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
15219 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15220 what it was before.
15221 * menu.h, termhooks.h: Include "systime.h", for Time.
15222
8e55734a
PE
15223 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15224 Don't assume that the difference between two unsigned long values
15225 can fit into an integer. At this point, we know button_down_time
15226 <= event->timestamp, so the difference must be nonnegative, so
15227 there's no need to cast the result if double-click-time is
15228 nonnegative, as it should be; check that it's nonnegative, just in
15229 case. This bug is triggered when events are more than 2**31 ms
86db42d2 15230 apart (about 25 days). (Bug#8664)
8e55734a 15231
841f1b75 15232 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 15233 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 15234
3e26f69c
PE
15235 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15236 that always fit in int. Use a sentinel instead of a counter, to
15237 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
15238 * frame.h (struct frame): Use int for menu_bar_items_used
15239 instead of EMACS_INT, since it always fits in int.
3e26f69c 15240
5cc152c0
PE
15241 * menu.c (grow_menu_items): Check for int overflow.
15242
d89eb65e
PE
15243 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15244
5235bd3e
PE
15245 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15246 Before, the code was not consistent. These values cannot exceed
15247 2**31 - 1 so there's no need to make them unsigned.
15248 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15249 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15250 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15251 as modifiers.
15252 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15253
bc827e23
PE
15254 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15255 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15256 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15257 presumably because the widths might not match.
15258
78eb494e
PE
15259 * window.c (size_window): Avoid needless test at loop start.
15260
04f2d78b
CB
152612011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
15262
15263 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15264
d2fc7e3d 152652011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
15266
15267 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15268
d2fc7e3d 152692011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
15270
15271 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15272 `width' to `bar_area_x' and `bar_area_width', respectively.
15273 (x_scroll_run): Take account of fringe background extension.
15274
04f2d78b
CB
15275 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15276 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
15277 `bar_area_width', respectively.
15278 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15279 background extension.
15280
79b70037
GM
152812011-05-10 Jim Meyering <meyering@redhat.com>
15282
15283 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15284
2f142cc5
JB
152852011-05-10 Juanma Barranquero <lekktu@gmail.com>
15286
15287 * image.c (Finit_image_library): Return t for built-in image types,
15288 like pbm and xbm. (Bug#8640)
15289
57679c86
AS
152902011-05-09 Andreas Schwab <schwab@linux-m68k.org>
15291
15292 * w32menu.c (set_frame_menubar): Fix submenu allocation.
15293
888c9e86
EZ
152942011-05-07 Eli Zaretskii <eliz@gnu.org>
15295
b0512a1d
EZ
15296 * w32console.c (Fset_screen_color): Doc fix.
15297 (Fget_screen_color): New function.
15298 (syms_of_ntterm): Defsubr it.
15299
7285dc67
EZ
15300 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15301 unlink the temporary file if Fcall_process didn't create it in the
15302 first place.
15303 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15304 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
15305 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
15306 cue to call_process_cleanup not to close that handle.
15307
4d3fcc8e
BK
153082011-05-07 Ben Key <bkey76@gmail.com>
15309
15310 * makefile.w32-in: The bootstrap-temacs rule now makes use of
15311 one of two shell specific rules, either bootstrap-temacs-CMD or
15312 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
15313 to the previous implementation of the bootstrap-temacs rule.
15314 The bootstrap-temacs-CMD rule is similar to the previous
15315 implementation of the bootstrap-temacs rule except that it
15316 makes use of the ESC_CFLAGS variable instead of the CFLAGS
15317 variable.
15318
15319 These changes, along with some changes to nt/configure.bat,
15320 nt/gmake.defs, and nt/nmake.defs, are required to extend my
15321 earlier fix to add support for --cflags and --ldflags options
15322 that include quotes so that it works whether make uses cmd or
15323 sh as the shell.
15324
b4289b64
MA
153252011-05-06 Michael Albinus <michael.albinus@gmx.de>
15326
15327 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
15328 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
15329 is a constant.
15330 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
15331 a string. Handle both cases.
15332 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
15333 (Fdbus_register_method): Use Qinvalid_function.
15334
af4c0e28
JB
153352011-05-06 Juanma Barranquero <lekktu@gmail.com>
15336
15337 * makefile.w32-in: Update dependencies.
15338 (LISP_H): Add inttypes.h and stdin.h.
15339 (PROCESS_H): Add unistd.h.
15340
c51453d9
EZ
153412011-05-06 Eli Zaretskii <eliz@gnu.org>
15342
15343 * lread.c: Include limits.h (fixes the MS-Windows build broken by
15344 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15345
8ff0ac3c 153462011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 15347
4c4b566b
PE
15348 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15349
aab2b9b5
PE
15350 * term.c (vfatal): Remove stray call to va_end.
15351 It's not needed and the C Standard doesn't allow it here anyway.
15352
c378da0b
PE
15353 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15354 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
15355
288b08c7
PE
15356 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15357 bytes.
15358
e3601888
PE
15359 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15360
db6c0e74
PE
15361 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15362
dd5963ea
PE
15363 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15364
88c9450f
PE
15365 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15366
2f9442b8
PE
15367 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15368
c032b5f8
PE
15369 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15370 * charset.c (Fdefine_charset_internal): Don't initialize
15371 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 15372 32-bit int (Bug#8600).
a108c10b
PE
15373
15374 * lread.c (read_integer): Be more consistent with string-to-number.
15375 Use string_to_number to do the actual conversion; this avoids
15376 rounding errors and fixes some other screwups. Without this fix,
15377 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15378 (digit_to_number): Move earlier, for benefit of read_integer.
15379 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 15380 not a digit in any supported base. (Bug#8602)
a108c10b 15381
ad5f9eea
PE
15382 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15383
aec1708a
PE
15384 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15385 to match comment at start of function. This also removes a
15386 GCC warning about overflow in a 32+64-bit port.
15387
47be4ab5
PE
15388 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15389
371cac43
PE
15390 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15391 Reported by Stefan Monnier in
15392 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
15393 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15394 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 15395
d01a7826
PE
15396 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15397 (EMACS_UINTPTR): Likewise, with uintptr_t.
15398
7fd47d5c
PE
15399 * lisp.h: Prefer 64-bit EMACS_INT if available.
15400 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15401 on 32-bit hosts that have 64-bit int, so that they can access
15402 large files.
122b0c86
PE
15403 However, temporarily disable this change unless the temporary
15404 symbol WIDE_EMACS_INT is defined.
7fd47d5c 15405
8727937b
PE
15406 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15407
8ac068ac
PE
15408 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15409 This removes an assumption that EMACS_INT and long are the same
15410 width as pointers. The assumption is true for Emacs porting targets
15411 now, but we want to make other targets possible.
15412 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15413 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15414 In the rest of the code, change types of integers that hold casted
15415 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15416 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15417 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15418 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15419 No need to cast type when ORing.
15420 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15421 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15422 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15423 assume EMACS_INT is the same width as char *.
15424 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15425 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15426 Remove no-longer-needed casts.
15427 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15428 (xg_tool_bar_help_callback, xg_make_tool_item):
15429 Use EMACS_INTPTR to hold an integer
15430 that will be cast to void *; this can avoid a GCC warning
15431 if EMACS_INT is not the same width as void *.
15432 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15433 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15434 (current_message_1, set_message_1):
15435 Use a local to convert to proper width without a cast.
15436 * xmenu.c (dialog_selection_callback): Likewise.
15437
ede49d71
PE
15438 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15439 Also, don't assume VALBITS / RAND_BITS is less than 5,
15440 and don't rely on undefined behavior when shifting a 1 left into
15441 the sign bit.
15442 * lisp.h (get_random): Change signature to match.
15443
2f30ecd0
PE
15444 * lread.c (hash_string): Use size_t, not int, for hash computation.
15445 Normally we prefer signed values; but hashing is special, because
15446 it's better to use unsigned division on hash table sizes so that
15447 the remainder is nonnegative. Also, size_t is the natural width
15448 for hashing into memory. The previous code used 'int', which doesn't
15449 retain enough info to hash well into very large tables.
15450 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15451
2a866e7b
PE
15452 * dbusbind.c: Don't possibly lose pointer info when converting.
15453 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15454 Use XPNTR rather than XHASH, so that the high-order bits of
15455 the pointer aren't lost when converting through void *.
15456
51639eac
PE
15457 * eval.c (Fautoload): Don't double-shift a pointer.
15458
92394119
PE
15459 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15460
dbdb9a7c
JB
154612011-05-06 Juanma Barranquero <lekktu@gmail.com>
15462
15463 * gnutls.c (DEF_GNUTLS_FN):
15464 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15465
db7a0b4f
AS
154662011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15467
15468 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15469 marker. (Bug#8610)
15470
cd394be1 154712011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
15472
15473 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15474 New version that can reserve upto 2GB of heap space.
15475
f7ff1b0f 154762011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
15477
15478 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15479
639c109b
TZ
154802011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15481
15482 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15483 `gnutls_certificate_set_x509_key_file'.
15484
d2127135
JB
154852011-05-05 Juanma Barranquero <lekktu@gmail.com>
15486
15487 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15488 Update dependencies.
15489
e968f4f3
JB
154902011-05-04 Juanma Barranquero <lekktu@gmail.com>
15491
15492 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15493 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15494 Remove unused parameter `fildes'.
15495 * process.c (read_process_output, send_process): Don't pass it.
15496
84d358f0
JB
154972011-05-04 Juanma Barranquero <lekktu@gmail.com>
15498
15499 Fix previous change: the library cache is defined in w32.c.
15500 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15501 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15502
0898ca10
JB
155032011-05-04 Juanma Barranquero <lekktu@gmail.com>
15504
15505 Implement dynamic loading of GnuTLS on Windows.
15506
15507 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15508 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15509 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15510 Declare.
15511
15512 * gnutls.c (Qgnutls_dll): Define.
15513 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15514 (gnutls_*): Declare function pointers.
15515 (init_gnutls_functions): New function to initialize function pointers.
15516 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15517 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15518 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15519 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15520 (emacs_gnutls_write, emacs_gnutls_read)
15521 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15522 (Fgnutls_available_p): New function.
15523 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15524 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15525 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15526
15527 * image.c: Include w32.h.
15528 (Vimage_type_cache): Delete.
15529 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15530 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15531 (w32_delayed_load): Move to w32.c.
15532
15533 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15534
15535 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15536 (w32_delayed_load): Move from image.c. When loading a library, record
15537 its filename in the :loaded-from property of the library id.
15538 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15539 Initialize and staticpro them.
15540 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15541
15542 * process.c: Include lisp.h before w32.h, not after.
15543 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15544 instead of gnutls_record_check_pending.
15545
15546 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15547
ff4de4aa
TZ
155482011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15549
15550 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15551 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15552 as passed in.
15553
abe95abb
JD
155542011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15555
15556 * xterm.c (x_set_frame_alpha): Do not set property on anything
15557 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15558
e16e55d4
JB
155592011-05-02 Juanma Barranquero <lekktu@gmail.com>
15560
15561 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15562
bafcf6a5
JB
155632011-05-02 Juanma Barranquero <lekktu@gmail.com>
15564
15565 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15566 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15567 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15568 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15569 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15570 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15571 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15572 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15573 (Qgnutls_bootprop_callbacks_verify): Make static.
15574
e7a6747f
AS
155752011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15576
19ed11ba
AS
15577 * callproc.c: Indentation fixup.
15578
e7a6747f 15579 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
15580 (wait_for_termination, interruptible_wait_for_termination):
15581 Move after wait_for_termination_1.
e7a6747f 15582
1ef14cb4
LMI
155832011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15584
15585 * sysdep.c (interruptible_wait_for_termination): New function
15586 which is like wait_for_termination, but allows keyboard
15587 interruptions.
15588
15589 * callproc.c (Fcall_process): Add (:file "file") as an option for
15590 the STDOUT buffer.
15591 (Fcall_process_region): Ditto.
15592
330d880c
EZ
155932011-04-30 Eli Zaretskii <eliz@gnu.org>
15594
8db90b73
EZ
15595 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15596 rather than `XVECTOR (FOO)->size'.
15597
330d880c
EZ
15598 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15599 inttypes.h, as a gnulib replacement is used if it not available in
15600 system headers.
15601
15cbd324
EZ
156022011-04-21 Eli Zaretskii <eliz@gnu.org>
15603
15604 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15605 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15606 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15607
15608 * coding.c (coding_alloc_by_realloc): Error out if destination
15609 will grow beyond MOST_POSITIVE_FIXNUM.
15610 (decode_coding_emacs_mule): Abort if there isn't enough place in
15611 charbuf for the composition carryover bytes. Reserve an extra
15612 space for up to 2 characters produced in a loop.
15613 (decode_coding_iso_2022): Abort if there isn't enough place in
15614 charbuf for the composition carryover bytes.
15615
156162011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 15617
ae940cca
EZ
15618 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15619 aborting when %lld or %lll format is passed.
15620 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15621 %llo or %llx format is passed. (Bug#8545)
15622
03ab8921
EZ
15623 * window.c (window_scroll_line_based): Use a marker instead of
15624 simple variables to record original value of point. (Bug#7952)
15625
afda1437
EZ
15626 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15627 produced by %s or %c overflows available buffer space. (Bug#8545)
15628
f76dee0c
PE
156292011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15630
15631 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 15632 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 15633
fdc5744d
JB
156342011-04-28 Juanma Barranquero <lekktu@gmail.com>
15635
15636 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15637
638f053a
JB
156382011-04-28 Juanma Barranquero <lekktu@gmail.com>
15639
15640 * keyboard.c (Qdelayed_warnings_hook): Define.
15641 (command_loop_1): Run `delayed-warnings-hook'
15642 if Vdelayed_warnings_list is non-nil.
15643 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15644 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15645
d178f871
EZ
156462011-04-28 Eli Zaretskii <eliz@gnu.org>
15647
15648 * doprnt.c (doprnt): Don't return value smaller than the buffer
15649 size if the message was truncated. (Bug#8545).
15650
b124fd93
JB
156512011-04-28 Juanma Barranquero <lekktu@gmail.com>
15652
15653 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15654 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15655
e810457d
PE
156562011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15657
15658 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15659
ea51cceb
JB
156602011-04-27 Juanma Barranquero <lekktu@gmail.com>
15661
15662 * makefile.w32-in: Update dependencies.
15663
94dcfacf
EZ
156642011-04-27 Eli Zaretskii <eliz@gnu.org>
15665
15666 Improve `doprnt' and its usage. (Bug#8545)
15667 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15668 `format_end'. Remove support for %l as a conversion specifier.
15669 Don't use xrealloc. Improve diagnostics when the %l size modifier
15670 is used. Update the commentary.
15671
15672 * eval.c (verror): Simplify calculation of size_t.
15673
15674 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15675 messages.
15676
f61f41d7
PE
156772011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15678
15679 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15680 change.
15681
96fb4434
PE
156822011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15683
15684 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15685 This makes this file independent of the recent pseudovector change.
15686
671875da 156872011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 15688
69e9b5a3
PE
15689 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15690
b5f869a7 15691 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 15692 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 15693 Remove unused local.
c8926152 15694 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 15695
841a1577 15696 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
15697 GCC 4.6.0 optimizes based on type-based alias analysis.
15698 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
15699 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15700 != &v->size, and therefore "v->size = 1; b->size = 2; return
15701 v->size;" must therefore return 1. This assumption is incorrect
15702 for Emacs, since it type-puns struct Lisp_Vector * with many other
15703 types. To fix this problem, this patch adds a new type struct
f904488f 15704 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
15705 and pseudovectors, and helps optimizing compilers not get fooled
15706 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15707 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
15708 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15709 the size member.
eab3844f
PE
15710 (XSETPVECTYPE): Rewrite in terms of new macro.
15711 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15712 This is a bit clearer, and further avoids the possibility of
15713 undesirable aliasing.
15714 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 15715 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
15716 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15717 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
15718 (ASIZE): Now uses header.size rather than size.
15719 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
15720 to avoid the hassle of writing XVECTOR (foo)->header.size.
15721 (struct vectorlike_header): New type.
eab3844f
PE
15722 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15723 object, to help avoid aliasing.
15724 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15725 (SUBRP): Likewise, since Lisp_Subr is a special case.
15726 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15727 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15728 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 15729 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
15730 changed to be "header.size" and "header.next".
15731 * buffer.h (struct buffer): Likewise.
15732 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15733 * frame.h (struct frame): Likewise.
15734 * process.h (struct Lisp_Process): Likewise.
15735 * termhooks.h (struct terminal): Likewise.
15736 * window.c (struct save_window_data, struct saved_window): Likewise.
15737 * window.h (struct window): Likewise.
15738 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15739 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15740 * buffer.c (init_buffer_once): Likewise.
15741 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15742 special case.
15743 * process.c (Fformat_network_address): Use local var for size,
15744 for brevity.
15745
0df1eac5
PE
15746 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15747
847ab9d1 15748 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
15749 * data.c (atof): Remove decl; no longer used or needed.
15750 (digit_to_number): Move to lread.c.
15751 (Fstring_to_number): Use new string_to_number function, to be
15752 consistent with how the Lisp reader treats infinities and NaNs.
15753 Do not assume that floating-point numbers represent EMACS_INT
15754 without losing information; this is not true on most 64-bit hosts.
15755 Avoid double-rounding errors, by insisting on integers when
15756 parsing non-base-10 numbers, as the documentation specifies.
15757 * lisp.h (string_to_number): New decl, replacing ...
15758 (isfloat_string): Remove.
bc0a5c13 15759 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 15760 (read1): Do not accept +. and -. as integers; this
452f4150
PE
15761 appears to have been a coding error. Similarly, do not accept
15762 strings like +-1e0 as floating point numbers. Do not report
15763 overflow for integer overflows unless the base is not 10 which
15764 means we have no simple and reliable way to continue.
15765 Break out the floating-point parsing into a new
15766 function string_to_number, so that Fstring_to_number parses
15767 floating point numbers consistently with the Lisp reader.
04f2d78b 15768 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
15769 (E_CHAR, EXP_INT): Remove, replacing with ...
15770 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15771 (string_to_number): New function, replacing isfloat_string.
15772 This function checks for valid syntax and produces the resulting
15773 Lisp float number too. Rework it so that string-to-number
bc0a5c13 15774 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
15775 so that overflow for non-base-10 numbers is reported only when
15776 there's no portable and simple way to convert to floating point.
452f4150 15777
67769ffc
PE
15778 * textprop.c (set_text_properties_1): Rewrite for clarity,
15779 and to avoid GCC warning about integer overflow.
15780
c20db43f
PE
15781 * intervals.h (struct interval): Use EMACS_INT for members
15782 where EMACS_UINT might cause problems. See
15783 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15784 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15785 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15786 All uses changed.
37aa2f85
PE
15787 (offset_intervals): Tell GCC not to worry about length overflow
15788 when negating a negative length.
c20db43f 15789
2538aa2f
PE
15790 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15791 (overrun_check_free): Likewise.
15792
f2d3008d
PE
15793 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15794 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15795 word size.
15796
ec8df744
PE
15797 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15798 (gnutls_make_error): Rename local to avoid shadowing.
15799 (gnutls_emacs_global_deinit): ifdef out; not used.
15800 (Fgnutls_boot): Use const for pointer to readonly storage.
15801 Comment out unused local. Fix pointer signedness problems.
15802
640ee02d
PE
15803 * lread.c (openp): Don't stuff size_t into an 'int'.
15804 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15805 about possible signed overflow.
15806
6048fb2a
PE
15807 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15808 (GDK_KEY_g): Don't define if already defined.
15809 (xg_prepare_tooltip): Avoid pointer signedness problem.
15810 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15811
fa3c87e1
PE
15812 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15813 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15814
2172544b
PE
15815 * xfns.c (Fx_window_property): Simplify a bit,
15816 to make a bit faster and to avoid GCC 4.6.0 warning.
15817 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15818
9b821a21
PE
15819 * fns.c (internal_equal): Don't assume size_t fits in int.
15820
3c616cfa
PE
15821 * alloc.c (compact_small_strings): Tighten assertion a little.
15822
c2982e87
PE
15823 Replace pEd with more-general pI, and fix some printf arg casts.
15824 * lisp.h (pI): New macro, generalizing old pEd macro to other
15825 conversion specifiers. For example, use "...%"pI"d..." rather
15826 than "...%"pEd"...".
15827 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 15828 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
15829 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15830 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15831 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15832 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15833 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15834 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15835 64-bit hosts.
15836 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15837 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15838 * print.c (safe_debug_print, print_object): Likewise.
15839 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15840 to int.
6f04d126
PE
15841 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15842 avoiding the 0 flag, which is not portable.
c2982e87
PE
15843 * process.c (Fmake_network_process): Use pI to avoid cast.
15844 * region-cache.c (pp_cache): Likewise.
15845 * xdisp.c (decode_mode_spec): Likewise.
15846 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15847 behavior on 64-bit hosts with printf arg.
6f04d126 15848 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
15849 (x_stop_queuing_selection_requests): Likewise.
15850 (x_get_window_property): Don't truncate byte count to an 'int'
15851 when tracing.
0b432f21 15852
5e073ec7
PE
15853 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15854 here, since it parses constructs like leading '-' and spaces,
15855 which are not wanted; and it overflows with large numbers.
15856 Instead, simply match F[0-9]+, which is what is wanted anyway.
15857
36372bf9
PE
15858 * alloc.c: Remove unportable assumptions about struct layout.
15859 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15860 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15861 (allocate_vectorlike, make_pure_vector): Use the new macros,
15862 plus offsetof, to remove unportable assumptions about struct layout.
15863 These assumptions hold on all porting targets that I know of, but
15864 they are not guaranteed, they're easy to remove, and removing them
15865 makes further changes easier.
15866
0b432f21
PE
15867 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15868 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
15869 (string_overrun_cookie): Now const. Use initializers that
15870 don't formally overflow signed char, to avoid warnings.
000098c1
PE
15871 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15872 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
15873 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15874 multiple of sizeof (EMACS_INT); it need not be, if
15875 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 15876 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 15877
895009e1
JB
158782011-04-26 Juanma Barranquero <lekktu@gmail.com>
15879
15880 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15881
6a7a1b0b
TZ
158822011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15883
15884 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 15885 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
15886 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15887
841a1577 158882011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
15889
15890 * lisp.h (Qdebug): List symbol.
895009e1 15891 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
15892 * keyboard.c (debug-on-event): New variable.
15893 (handle_user_signal): Break into debugger when debug-on-event
15894 matches the current signal symbol.
15895
f2d3ba6f
DN
158962011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15897
15898 * alloc.c (check_sblock, check_string_bytes)
15899 (check_string_free_list): Convert to standard C.
15900
42ce4c63
TZ
159012011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15902
15903 * w32.c (emacs_gnutls_push): Fix typo.
15904
825cd63c
EZ
159052011-04-25 Eli Zaretskii <eliz@gnu.org>
15906
fb11d64d
EZ
15907 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15908 "cast to pointer from integer of different size".
15909
825cd63c
EZ
15910 Improve doprnt and its use in verror. (Bug#8545)
15911 * doprnt.c (doprnt): Document the set of format control sequences
15912 supported by the function. Use SAFE_ALLOCA instead of always
15913 using `alloca'.
15914
15915 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15916 is one byte too soon. Don't use xrealloc; instead xfree and
15917 xmalloc anew.
15918
e061a11b
TZ
159192011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15920
15921 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15922 callbacks stage.
15923
15924 * gnutls.c: Renamed global_initialized to
15925 gnutls_global_initialized. Added internals for the
15926 :verify-hostname-error, :verify-error, and :verify-flags
15927 parameters of `gnutls-boot' and documented those parameters in the
15928 docstring. Start callback support.
9173deec
JB
15929 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15930 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15931 on error. Return error code.
e061a11b
TZ
15932 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15933 (emacs_gnutls_read): Likewise.
15934 (Fgnutls_boot): Return handshake error code.
15935 (emacs_gnutls_handle_error): New function.
15936 (wsaerror_to_errno): Likewise.
15937
15938 * w32.h (emacs_gnutls_pull): Add prototype.
15939 (emacs_gnutls_push): Likewise.
15940
15941 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15942 (emacs_gnutls_push): Likewise.
15943
159442011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15945
15946 * process.c (wait_reading_process_output): Check if GnuTLS
15947 buffered some data internally if no FDs are set for TLS
15948 connections.
15949
15950 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15951 (LIBS): Link to USER_LIBS.
15952 ($(BLD)/gnutls.$(0)): New target.
15953
fa6996bc
EZ
159542011-04-24 Eli Zaretskii <eliz@gnu.org>
15955
eb35682e
EZ
15956 * xdisp.c (handle_single_display_spec): Rename the
15957 display_replaced_before_p argument into display_replaced_p, to
15958 make it consistent with the commentary. Fix typos in the
15959 commentary.
15960
e2ad650c
EZ
15961 * textprop.c (syms_of_textprop): Remove dead code.
15962 (copy_text_properties): Delete obsolete commentary about an
15963 interface that was deleted long ago. Fix typos in the description
15964 of arguments.
15965
1b2de274
EZ
15966 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15967 to changes in oldXMenu/XMenu.h from 2011-04-16.
15968 <menu_help_message, prev_menu_help_message>: Constify.
15969 (IT_menu_make_room): menu->help_text is now `const char **';
15970 adjust.
15971
15972 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15973 to changes in oldXMenu/XMenu.h from 2011-04-16.
15974 (struct XMenu): Declare `help_text' `const char **'.
15975
15976 * xfaces.c <Qunspecified>: Make extern again.
15977
15978 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 15979 required by POSIX.
1b2de274 15980
762b15be
EZ
15981 * doc.c (get_doc_string): Improve the format passed to `error'.
15982
15983 * doprnt.c (doprnt): Improve commentary.
15984
15985 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15986
15987 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15988 them with etags.
15989
f1052e5d
EZ
15990 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15991 changes in globals.h immediately force recompilation.
762b15be
EZ
15992 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15993 $(CURDIR)/s/ms-w32.h.
15994 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 15995
fa6996bc
EZ
15996 * character.c (Fchar_direction): Function deleted.
15997 (syms_of_character): Don't defsubr it.
15998 <char-direction-table>: Deleted.
15999
e6c3da20
EZ
160002011-04-23 Eli Zaretskii <eliz@gnu.org>
16001
16002 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
16003 * doprnt.c: Include limits.h.
16004 (SIZE_MAX): New macro.
04f2d78b
CB
16005 (doprnt): Return a size_t value. 2nd arg is now size_t.
16006 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
16007 Improve overflow protection. Support `l' modifier for integer
16008 conversions. Support %l conversion. Don't assume an EMACS_INT
16009 argument for integer conversions and for %c.
16010
16011 * lisp.h (doprnt): Restore prototype.
16012
16013 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16014 $(SRC)/character.h.
16015
16016 * Makefile.in (base_obj): Add back doprnt.o.
16017
16018 * deps.mk (doprnt.o): Add back prerequisites.
16019 (callint.o): Depend on character.h.
16020
16021 * eval.c (internal_lisp_condition_case): Include the handler
16022 representation in the error message.
16023 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
16024 when breaking from the loop.
16025
16026 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
16027
16028 * callint.c (Fcall_interactively): When displaying error message
16029 about invalid control letter, pass the character's codepoint, not
16030 a pointer to its multibyte form. Improve display of the character
16031 in octal and display also its hex code.
16032
16033 * character.c (char_string): Use %x to display the (unsigned)
16034 codepoint of an invalid character, to avoid displaying a bogus
16035 negative value.
16036
16037 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16038 `error', not SYMBOL_NAME itself.
16039
16040 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16041 character arguments to `error'.
16042
16043 * charset.c (check_iso_charset_parameter): Fix incorrect argument
16044 to `error' in error message about FINAL_CHAR argument. Make sure
16045 FINAL_CHAR is a character, and use %c when it is passed as
16046 argument to `error'.
16047
4ffd0d6b 160482011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
16049
16050 * s/ms-w32.h (localtime): Redirect to sys_localtime.
16051
16052 * w32.c: Include <time.h>.
16053 (sys_localtime): New function.
16054
4ffd0d6b 160552011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
16056
16057 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16058
4ffd0d6b 16059 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 16060
4ffd0d6b 160612011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 16062
4ffd0d6b
GM
16063 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16064 zombies (Bug#8467).
aac0c6e3 16065
04c56954
EZ
160662011-04-19 Eli Zaretskii <eliz@gnu.org>
16067
16068 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16069 gl_state.e_property when gl_state.object is Qt.
16070
16071 * insdel.c (make_gap_larger): Remove limitation of buffer size
16072 to <= INT_MAX.
16073
16a43933
CY
160742011-04-18 Chong Yidong <cyd@stupidchicken.com>
16075
16076 * xdisp.c (lookup_glyphless_char_display)
16077 (produce_glyphless_glyph): Handle cons cell entry in
16078 glyphless-char-display.
16079 (Vglyphless_char_display): Document it.
16080
16081 * term.c (produce_glyphless_glyph): Handle cons cell entry in
16082 glyphless-char-display.
16083
4581706e
CY
160842011-04-17 Chong Yidong <cyd@stupidchicken.com>
16085
16086 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16087
16088 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16089
16090 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16091 definition for no-X builds.
16092
4887c6e2 160932011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 16094
fd35b6f9
PE
16095 Static checks with GCC 4.6.0 and non-default toolkits.
16096
5c1ccb01
PE
16097 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16098
006c5daa
PE
16099 * process.c (keyboard_bit_set): Define only if SIGIO.
16100 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16101 (send_process): Repair possible setjmp clobbering.
16102
efc736d3
PE
16103 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16104
4e2fe2e6
PE
16105 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16106
f97334a2
PE
16107 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16108
4e75f29d
PE
16109 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16110 Define only if needed.
16111
90efadd1
PE
16112 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16113 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 16114 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 16115
3c647824
PE
16116 * dispextern.h (struct redisplay_interface): Rename param
16117 to avoid shadowing.
e264f262 16118 * termhooks.h (struct terminal): Likewise.
761383f4 16119 * xterm.c (xembed_send_message): Likewise.
3c647824 16120
b58c5c4a
PE
16121 * insdel.c (make_gap_smaller): Define only if
16122 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16123
cad59032
PE
16124 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16125 it.
16126
c339dc2e
PE
16127 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16128 so that we aren't warned about unused symbols.
16129
91a3e27b
PE
16130 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16131
399c71d3 16132 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 16133
8ffc96f5
PE
16134 * xfns.c (x_real_positions): Mark locals as initialized.
16135
eef9bc79
PE
16136 * xmenu.c (xmenu_show): Don't use uninitialized vars.
16137
098db9dd
PE
16138 * xterm.c: Fix problems found by static analysis with other toolkits.
16139 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
16140 (x_dispatch_event): Declare static if USE_GTK, and
16141 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 16142 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 16143 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
16144 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16145 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 16146
eb18f6cc
PE
16147 * xmenu.c (menu_help_callback): Pointer type fixes.
16148 Use const pointers when pointing at readonly data. Avoid pointer
16149 signedness clashes.
16150 (FALSE): Remove unused macro.
16151 (update_frame_menubar): Remove unused decl.
16152
1fe72bf8
PE
16153 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
16154
60d9e1db
PE
16155 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
16156 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
16157 (single_menu_item): Rename local to avoid shadowing.
16158
39261c26
PE
16159 * keyboard.c (make_lispy_event): Remove unused local var.
16160
018c5e19
PE
16161 * frame.c, frame.h (x_get_resource_string): Bring this back, but
16162 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
16163
63d2b86e
PE
16164 * bitmaps: Change bitmaps from unsigned char back to the X11
16165 compatible char. Avoid the old compiler warnings about
16166 out-of-range initializers by using, for example, '\xab' rather
16167 than 0xab.
16168
aefd87e1
PE
16169 * xgselect.c (xgselect_initialize): Check vs interface
16170 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
16171
bf501fb9
PE
16172 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
16173
e9829fdf
PE
16174 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
16175 to read-only memory.
16176
1086c095
PE
16177 * fns.c (vector): Remove; this old hack is no longer needed.
16178
2baccd04 16179 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 16180 Remove unused var.
dde42981 16181 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 16182
72391843 16183 * xrdb.c (x_load_resources): Omit unused local.
3565b346 16184
436c16df 16185 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 16186 (x_window): Rename locals to avoid shadowing.
dc5ddd85 16187 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 16188
92bb796d 16189 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 16190 (x_term_init): Remove local to avoid shadowing.
92bb796d 16191
764430a3 16192 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
16193
16194 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
16195 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
16196
d1dfb56c
EZ
161972011-04-16 Eli Zaretskii <eliz@gnu.org>
16198
c4354cb4
EZ
16199 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
16200
d1dfb56c
EZ
16201 Fix regex.c, syntax.c and friends for buffers > 2GB.
16202 * syntax.h (struct gl_state_s): Declare character position members
16203 EMACS_INT.
16204
16205 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
16206
04f2d78b
CB
16207 * textprop.c (verify_interval_modification, interval_of):
16208 Declare arguments EMACS_INT.
d1dfb56c
EZ
16209
16210 * intervals.c (adjust_intervals_for_insertion): Declare arguments
16211 EMACS_INT.
16212
16213 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
16214
16215 * indent.c (Fvertical_motion): Local variable it_start is now
16216 EMACS_INT.
16217
16218 * regex.c (re_match, re_match_2, re_match_2_internal)
16219 (bcmp_translate, regcomp, regexec, print_double_string)
16220 (group_in_compile_stack, re_search, re_search_2, regex_compile)
16221 (re_compile_pattern, re_exec): Declare arguments and local
16222 variables `size_t' and `ssize_t' and return values `regoff_t', as
16223 appropriate.
16224 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16225 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16226 <compile_stack_type>: `size' and `avail' are now `size_t'.
16227
16228 * regex.h <regoff_t>: Use ssize_t, not int.
16229 (re_search, re_search_2, re_match, re_match_2): Arguments that
16230 specify buffer/string position and length are now ssize_t and
16231 size_t. Return type is regoff_t.
16232
613052cd
BK
162332011-04-16 Ben Key <bkey76@gmail.com>
16234
16235 * nsfont.m: Fixed bugs in ns_get_family and
16236 ns_descriptor_to_entity that were caused by using free to
16237 deallocate memory blocks that were allocated by xmalloc (via
16238 xstrdup). This caused Emacs to crash when compiled with
16239 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16240 --enable-checking=xmallocoverrun). xfree is now used to
16241 deallocate these memory blocks.
16242
4170f62f 162432011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 16244
71b41406
PE
16245 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16246
9587a89d
PE
16247 emacs_write: Accept and return EMACS_INT for sizes.
16248 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16249 et seq.
16250 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16251 Accept and return EMACS_INT.
16252 (emacs_gnutls_write): Return the number of bytes written on
16253 partial writes.
16254 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
16255 (emacs_read, emacs_write): Remove check for negative size, as the
16256 Emacs source code has been audited now.
9587a89d
PE
16257 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16258 (emacs_read, emacs_write): Use it.
273a5f82
PE
16259 * process.c (send_process): Adjust to the new signatures of
16260 emacs_write and emacs_gnutls_write. Do not attempt to store
16261 a byte offset into an 'int'; it might overflow.
9587a89d 16262 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 16263
3e047f51
PE
16264 * sound.c: Don't assume sizes fit in 'int'.
16265 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 16266 Return EMACS_INT, not int.
3e047f51 16267 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
16268 Accept EMACS_INT, not int.
16269 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
16270 record read return values.
16271
cc39a9db
BK
162722011-04-15 Ben Key <bkey76@gmail.com>
16273
c9d0ec6d
JB
16274 * keyboard.c (Qundefined): Don't declare static since it is used
16275 in nsfns.m.
16276 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16277 static since they are used in nsfont.m.
cc39a9db 16278
6c60eb9f
SM
162792011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
16280
16281 * process.c (Qprocessp): Don't declare static.
16282 * lisp.h (Qprocessp): Declare again.
16283
7990b61a
JB
162842011-04-15 Juanma Barranquero <lekktu@gmail.com>
16285
16286 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16287
5d4cb038
PE
162882011-04-14 Paul Eggert <eggert@cs.ucla.edu>
16289
8bd7b830 16290 Improve C-level modularity by making more things 'static'.
cd64ea1d 16291
e3b27b31
PE
16292 Don't publish debugger-only interfaces to other modules.
16293 * lisp.h (safe_debug_print, debug_output_compilation_hack):
16294 (verify_bytepos, count_markers): Move decls to the only modules
16295 that need them.
16296 * region-cache.h (pp_cache): Likewise.
16297 * window.h (check_all_windows): Likewise.
16298 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16299
5d4cb038
PE
16300 * sysdep.c (croak): Now static, if
16301 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16302 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
16303
16304 * alloc.c (refill_memory_reserve): Now static if
16305 !defined REL_ALLOC || defined SYSTEM_MALLOC.
16306 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 16307
e87b6180
PE
16308 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
16309 Define only if USE_LUCID.
16310
ac64929e
PE
16311 * xrdb.c (x_customization_string, x_rm_string): Now static.
16312
6f37259d
PE
16313 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
16314 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
16315
1683e3ab
PE
16316 * xdisp.c (draw_row_with_mouse_face): Now static.
16317 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
16318
de9c2632
PE
16319 * window.h (check_all_windows): Mark externally visible.
16320
2b96acb7
PE
16321 * window.c (window_deletion_count): Now static.
16322
16323 * undo.c: Make symbols static if they're not exported.
16324 (last_undo_buffer, last_boundary_position, pending_boundary):
16325 Now static.
16326
50436f33
PE
16327 * textprop.c (interval_insert_behind_hooks): Now static.
16328 (interval_insert_in_front_hooks): Likewise.
16329
64520e5c
PE
16330 * term.c: Make symbols static if they're not exported.
16331 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
16332 (max_frame_lines, tty_set_terminal_modes):
16333 (tty_reset_terminal_modes, tty_turn_off_highlight):
16334 (get_tty_terminal): Now static.
16335 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
16336 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 16337 HAVE_WINDOW_SYSTEM.
64520e5c
PE
16338 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16339 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16340
1fa53021
PE
16341 * sysdep.c: Make symbols static if they're not exported.
16342 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16343 Now static.
16344 (sigprocmask_set, full_mask): Remove; unused.
16345 (wait_debugging): Mark as visible.
16346 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16347 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16348
d4b43b22
PE
16349 * syntax.c (syntax_temp): Define only if !__GNUC__.
16350
b7c513d0
PE
16351 * sound.c (current_sound_device, current_sound): Now static.
16352
989b29ad
PE
16353 * search.c (searchbufs, searchbuf_head): Now static.
16354
13a55a78
PE
16355 * scroll.c (scroll_cost): Remove; unused.
16356 * dispextern.h (scroll_cost): Remove decl.
16357
de68a1fc
PE
16358 * region-cache.h (pp_cache): Mark as externally visible.
16359
40ccffa6
PE
16360 * process.c: Make symbols static if they're not exported.
16361 (process_tick, update_tick, create_process, chan_process):
16362 (Vprocess_alist, proc_buffered_char, datagram_access):
16363 (fd_callback_data, send_process_frame, process_sent_to): Now static.
16364 (deactivate_process): Mark defn as static, as well as decl.
16365 * lisp.h (create_process): Remove decl.
16366 * process.h (chan_process, Vprocess_alist): Remove decls.
16367
ad64fc97
PE
16368 * print.c: Make symbols static if they're not exported.
16369 (print_depth, new_backquote_output, being_printed, print_buffer):
16370 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16371 (print_interval, print_number_index, initial_stderr_stream):
16372 Now static.
16373 * lisp.h (Fprinc): Remove decl.
16374 (debug_output_compilation_hack): Mark as externally visible.
16375
adddb265
PE
16376 * sysdep.c (croak): Move decl from here to syssignal.h.
16377 * syssignal.h (croak): Put it here, so the API can be checked when
16378 'croak' is called from dissociate_if_controlling_tty.
16379
1717ede2
PE
16380 * minibuf.c: Make symbols static if they're not exported.
16381 (minibuf_save_list, choose_minibuf_frame): Now static.
16382 * lisp.h (choose_minibuf_frame): Remove decl.
16383
fa5fb2bc
PE
16384 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16385
1e3890d1
PE
16386 * lread.c: Make symbols static if they're not exported.
16387 (read_objects, initial_obarray, oblookup_last_bucket_number):
16388 Now static.
16389 (make_symbol): Remove; unused.
16390 * lisp.h (initial_obarray, make_symbol): Remove decls.
16391
8a1414fa
PE
16392 * keyboard.c: Make symbols static if they're not exported.
16393 (single_kboard, recent_keys_index, total_keys, recent_keys):
16394 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16395 (this_single_command_key_start, echoing, last_auto_save):
16396 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16397 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16398 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16399 (Vlispy_mouse_stem, double_click_count):
16400 Now static.
16401 (force_auto_save_soon): Define only if SIGDANGER.
16402 (ignore_mouse_drag_p): Now static if
16403 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16404 (print_help): Remove; unused.
16405 (stop_character, last_timer_event): Mark as externally visible.
16406 * keyboard.h (ignore_mouse_drag_p): Declare only if
16407 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16408 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16409 * lisp.h (echoing): Remove decl.
16410 (force_auto_save_soon): Declare only if SIGDANGER.
16411 * xdisp.c (redisplay_window): Simplify code, to make it more
16412 obvious that ignore_mouse_drag_p is not accessed if !defined
16413 USE_GTK && !defined HAVE_NS.
16414
93ea6e8f
PE
16415 * intervals.c: Make symbols static if they're not exported.
16416 (merge_properties_sticky, merge_interval_right, delete_interval):
16417 Now static.
16418 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16419
77382fcc
PE
16420 * insdel.c: Make symbols static if they're not exported.
16421 However, leave prepare_to_modify_buffer alone. It's never
16422 called from outside this function, but that appears to be a bug.
16423 (combine_after_change_list, combine_after_change_buffer):
4889fc82 16424 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
16425 (adjust_after_replace_noundo): Remove; unused.
16426 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 16427 (signal_before_change): Remove decls.
77382fcc 16428
9306c32e
PE
16429 * indent.c (val_compute_motion, val_vmotion): Now static.
16430
cd44d2eb
PE
16431 * image.c: Make symbols static if they're not exported.
16432 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16433 if USE_GTK.
16434 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16435 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16436
ad9a7a06
PE
16437 * fringe.c (standard_bitmaps): Now static.
16438 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16439
81626931
PE
16440 * frame.c: Make symbols static if they're not exported.
16441 (x_report_frame_params, make_terminal_frame): Now static.
16442 (get_frame_param): Now static, unless HAVE_NS.
16443 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16444 (x_get_resource_string): Remove; not used.
16445 * frame.h (make_terminal_frame, x_report_frame_params):
16446 (x_get_resource_string); Remove decls.
16447 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16448 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16449
239f9db9
PE
16450 * font.c, fontset.c: Make symbols static if they're not exported.
16451 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16452 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16453 * font.c (font_close_object): Now static.
16454 * font.h (font_close_object): Remove.
16455 * fontset.c (FONTSET_OBJLIST): Remove.
16456 (free_realized_fontset) #if-0 the body, which does nothing.
16457 (face_suitable_for_char_p): #if-0, as it's never called.
16458 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
16459 * xfaces.c (face_at_string_position):
16460 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
16461 since 0 is always ASCII.
16462
dfcf3579
PE
16463 * fns.c (weak_hash_tables): Now static.
16464
5045092b
PE
16465 * fileio.c: Make symbols static if they're not exported.
16466 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16467 (Vwrite_region_annotation_buffers): Now static.
16468
57a96f5c
PE
16469 * eval.c: Make symbols static if they're not exported.
16470 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16471 * lisp.h (backtrace_list): Remove decl.
16472
35f08c38
PE
16473 * emacs.c: Make symbols static if they're not exported.
16474 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16475 (fatal_error_code, fatal_error_signal_hook, standard_args):
16476 Now static.
16477 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16478 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16479 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16480 * lisp.h (fatal_error_signal_hook): Remove decl.
16481 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16482
f44bd759
PE
16483 * editfns.c: Move a (normally-unused) function to its only use.
16484 * editfns.c, lisp.h (get_operating_system_release): Remove.
16485 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16486 worth the hassle of breaking this out.
16487
b532497d
PE
16488 * xterm.c: Make symbols static if they're not exported.
16489 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16490 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16491 (x_destroy_window, x_delete_display):
16492 Now static.
16493 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16494 (x_mouse_leave): Remove; unused.
16495 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16496 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16497 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16498 Remove decls.
16499 (x_mouse_leave): Declare only if WINDOWSNT.
16500 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16501 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16502 USE_X_TOOLKIT.
16503
1675728f
PE
16504 * ftxfont.c: Make symbols static if they're not exported.
16505 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16506 HAVE_FREETYPE.
16507 * font.h (ftxfont_driver): Likewise.
16508
e4cebfca
PE
16509 * xfns.c: Make symbols static if they're not exported.
16510 (x_last_font_name, x_display_info_for_name):
16511 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16512 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16513 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16514 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16515 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16516 (last_show_tip_args): Now static.
16517 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16518 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16519 (x_screen_planes): Remove; unused.
16520 * dispextern.h (x_screen_planes): Remove decl.
16521
5bf46f05
PE
16522 * dispnew.c: Make symbols static if they're not exported.
16523 * dispextern.h (redraw_garbaged_frames, scrolling):
16524 (increment_row_positions): Remove.
16525 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16526 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16527 Now static.
16528 (redraw_garbaged_frames): Remove; unused.
16529
435f4c28
PE
16530 * xfaces.c: Make symbols static if they're not exported.
16531 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16532 Remove decls.
16533 * xterm.h (defined_color): Remove decls.
16534 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16535 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16536 (menu_face_changed_default, defined_color, free_realized_face):
16537 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16538 (ascii_face_of_lisp_face): Remove; unused.
16539
8524aef3
PE
16540 * xdisp.c: Make symbols static if they're not exported.
16541 * dispextern.h (scratch_glyph_row, window_box_edges):
16542 (glyph_to_pixel_coords, set_cursor_from_row):
16543 (get_next_display_element, set_iterator_to_next):
16544 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16545 (show_mouse_face): Remove decls
16546 * frame.h (message_buf_print): Likewise.
16547 * lisp.h (pop_message, set_message, check_point_in_composition):
16548 Likewise.
16549 * xterm.h (set_vertical_scroll_bar): Likewise.
16550 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16551 (message_buf_print, scratch_glyph_row, displayed_buffer):
16552 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16553 (get_next_display_element, show_mouse_face, window_box_edges):
16554 (frame_to_window_pixel_xy, check_point_in_composition):
16555 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16556 (glyph_to_pixel_coords): Remove; unused.
16557
16390cd2
PE
16558 * dired.c (file_name_completion): Now static.
16559
16560 * dbusbind.c (xd_in_read_queued_messages): Now static.
16561
a25f4dfa
PE
16562 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16563 * data.c (circular_list_error): Remove.
16564
14a9c8df
PE
16565 * commands.h (last_point_position, last_point_position_buffer):
16566 (last_point_position_window): Remove decls.
16567 * keyboard.c: Make these variables static.
16568
04f2d78b
CB
16569 * coding.h (coding, code_convert_region, encode_coding_gap):
16570 Remove decls.
74ab6df5
PE
16571 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16572 (iso_code_class, detect_coding, code_convert_region): Now static.
16573 (encode_coding_gap): Remove; unused.
16574
38dfbee1
PE
16575 * chartab.c (chartab_chars, chartab_bits): Now static.
16576
a2cb4e63
PE
16577 * charset.h (charset_iso_8859_1): Remove decl.
16578 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16579 Now static.
16580
127198fd
PE
16581 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16582 * ccl.c (Vccl_program_table): Now static.
16583 (check_ccl_update): Remove; unused.
16584
d85b608f
PE
16585 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16586 * category.h: ... from here.
16587 * category.c (check_category_table, set_category_set): Now static.
16588
31cd66f3
PE
16589 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16590 * lisp.h: Remove these decls.
16591
c358e587
PE
16592 * buffer.c (buffer_count): Remove unused var.
16593
e78aecca
PE
16594 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16595 so that it's not optimized away.
16596 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16597 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16598 exported only to the debugger.
16599
e192d7d3 16600 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 16601 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 16602
92470028
PE
16603 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16604 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16605 was inaccessible from Lisp.
16606 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16607 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16608
244ed907
PE
16609 alloc.c: Import and export fewer symbols, and remove unused items.
16610 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16611 is defined.
16612 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16613 it's not optimized away by whole-program optimization.
16614 (message_enable_multibyte, free_misc): Remove.
16615 (catchlist, handlerlist, mark_backtrace):
16616 Declare only if BYTE_MARK_STACK.
16617 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16618 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16619 (message_enable_multibyte): Remove decl.
16620 (free_misc, interval_free_list, float_block, float_block_index):
16621 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16622 (cons_free_list, last_marked_index):
16623 Now static.
16624 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16625 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16626 (mark_backtrace): Define only if BYTE_MARK_STACK.
16627 * xdisp.c (message_enable_multibyte): Now static.
16628
61c2b50e 16629 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
16630 This makes it easier for human readers (and static analyzers)
16631 to see whether these variables are used from other modules.
16632 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16633 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16634 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16635 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16636 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16637 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16638 * xmenu.c, xselect.c:
16639 Declare Q* vars static if they are not used in other modules.
16640 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16641 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16642 Remove decls of unexported vars.
16643 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16644
95c82688
PE
16645 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16646
16a97296
PE
16647 Make Emacs functions such as Fatom 'static' by default.
16648 This makes it easier for human readers (and static analyzers)
16649 to see whether these functions can be called from other modules.
16650 DEFUN now defines a static function. To make the function external
16651 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
16652 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16653 (Finit_image_library):
16a97296
PE
16654 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16655 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16656 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16657 Remove decls, since these functions are now static.
16658 (Funintern, Fget_internal_run_time): New decls, since these functions
16659 were already external.
95c82688 16660
16a97296
PE
16661 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16662 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16663 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16664 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16665 * keyboard.c, keymap.c, lread.c:
16666 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16667 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16668 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16669 Mark functions with DEFUE instead of DEFUN,
16670 if they are used in other modules.
16671 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16672 decls for now-static functions.
16673 * buffer.h (Fdelete_overlay): Remove decl.
16674 * callproc.c (Fgetenv_internal): Mark as internal.
16675 * composite.c (Fremove_list_of_text_properties): Remove decl.
16676 (Fcomposition_get_gstring): New forward static decl.
16677 * composite.h (Fcomposite_get_gstring): Remove decl.
16678 * dired.c (Ffile_attributes): New forward static decl.
16679 * doc.c (Fdocumntation_property): New forward static decl.
16680 * eval.c (Ffetch_bytecode): New forward static decl.
16681 (Funintern): Remove extern decl; now in .h file where it belongs.
16682 * fileio.c (Fmake_symbolic_link): New forward static decl.
16683 * image.c (Finit_image_library): New forward static decl.
16684 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16685 * intervals.h (Fprevious_property_change):
16686 (Fremove_list_of_text_properties): Remove decls.
16687 * keyboard.c (Fthis_command_keys): Remove decl.
16688 (Fcommand_execute): New forward static decl.
16689 * keymap.c (Flookup_key): New forward static decl.
16690 (Fcopy_keymap): Now static.
16691 * keymap.h (Flookup_key): Remove decl.
16692 * process.c (Fget_process): New forward static decl.
16693 (Fprocess_datagram_address): Mark as internal.
16694 * syntax.c (Fsyntax_table_p): New forward static decl.
16695 (skip_chars): Remove duplicate decl.
16696 * textprop.c (Fprevious_property_change): New forward static decl.
16697 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16698 Now internal.
16699 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16700 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16701
785bbd42
PE
16702 * editfns.c (Fformat): Remove unreachable code.
16703
8b913b57
AS
167042011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16705
16706 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16707 change. (Bug#8496)
16708
a6744a35
EZ
167092011-04-13 Eli Zaretskii <eliz@gnu.org>
16710
16711 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16712 when at ZV. (Bug#8487)
16713
e7974947
AS
167142011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16715
baad03f0
AS
16716 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16717 (Bug#8437)
16718 * keyboard.c (parse_tool_bar_item): Likewise.
16719 * sound.c (sound_cleanup, alsa_close): Likewise.
16720 * termcap.c (tgetent): Likewise.
16721 * xfns.c (x_default_font_parameter): Likewise.
16722 * xsettings.c (read_and_apply_settings): Likewise.
16723
e7974947
AS
16724 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16725 (overrun_check_free): Protoize.
16726
28272684
PE
167272011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16728
16729 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16730 since callers should never pass a negative size.
16731 Change the signature to match that of plain 'read' and 'write'; see
16732 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16733 * lisp.h: Update prototypes of emacs_write and emacs_read.
16734
11997c76
EZ
167352011-04-11 Eli Zaretskii <eliz@gnu.org>
16736
16737 * xdisp.c (redisplay_window): Don't try to determine the character
16738 position of the scroll margin if the window start point w->startp
e896f03c 16739 is outside the buffer's accessible region. (Bug#8468)
11997c76 16740
8a2cbd72
EZ
167412011-04-10 Eli Zaretskii <eliz@gnu.org>
16742
16743 Fix write-region and its subroutines for buffers > 2GB.
16744 * fileio.c (a_write, e_write): Modify declaration of arguments and
16745 local variables to support buffers larger than 2GB.
16746 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16747
16748 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16749 argument, local variables, and return value.
16750
16751 * lisp.h: Update prototypes of emacs_write and emacs_read.
16752
16753 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16754
4073e537 167552011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 16756
1ebfdcb6
PE
16757 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16758
b2ded58d
PE
16759 Fix more problems found by GCC 4.6.0's static checks.
16760
7d66342c
PE
16761 * xdisp.c (vmessage): Use a better test for character truncation.
16762
bbf47d44
PE
16763 * charset.c (load_charset_map): <, not <=, for optimization,
16764 and to avoid potential problems with integer overflow.
9248994d 16765 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 16766 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 16767 * editfns.c (Fformat): Likewise.
1e69125e 16768 * syntax.c (skip_chars): Likewise.
3befa583 16769
e3019616
PE
16770 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16771 This also lets GCC 4.6.0 generate slightly better loop code.
16772
becfa255
PE
16773 * callint.c (Fcall_interactively): <, not <=, for optimization.
16774 (Fcall_interactively): Count the number of arguments produced,
16775 not the number of arguments given. This is simpler and lets GCC
16776 4.6.0 generate slightly better code.
16777
dae0cd48
PE
16778 * ftfont.c: Distingish more carefully between FcChar8 and char.
16779 The previous code passed unsigned char * to a functions like
16780 strlen and xstrcasecmp that expect char *, which does not
16781 conform to the C standard.
16782 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16783 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16784 char * when the C standard requires it.
16785
76032d70
PE
16786 * keyboard.c (read_char): Remove unused var.
16787
eb3f1cc8
PE
16788 * eval.c: Port to Windows vsnprintf (Bug#8435).
16789 Include <limits.h>.
16790 (SIZE_MAX): Define if the headers do not.
16791 (verror): Do not give up if vsnprintf returns a negative count.
16792 Instead, grow the buffer. This ports to Windows vsnprintf, which
16793 does not conform to C99. Problem reported by Eli Zaretskii.
16794 Also, simplify the allocation scheme, by avoiding the need for
16795 calling realloc, and removing the ALLOCATED variable.
16796
70476b54
PE
16797 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16798
12020a9e
PE
16799 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16800 But keep the doprint source code for now, as we might revamp it
16801 and use it again (Bug#8435).
ea6c7ae6
PE
16802 * lisp.h (doprnt): Remove.
16803 * Makefile.in (base_obj): Remove doprnt.o.
16804 * deps.mk (doprnt.o): Remove.
16805
5fdb398c
PE
16806 error: Print 32- and 64-bit integers portably (Bug#8435).
16807 Without this change, on typical 64-bit hosts error ("...%d...", N)
16808 was used to print both 32- and 64-bit integers N, which relied on
16809 undefined behavior.
61bdb816 16810 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
16811 * lisp.h (error, verror): Mark as printf-like functions.
16812 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16813 Report overflow in size calculations when allocating printf buffer.
16814 Do not truncate output string at its first null byte.
16815 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16816 Truncate the output at a character boundary, since vsnprintf does not
16817 do that.
16818 * charset.c (check_iso_charset_parameter): Convert internal
16819 character to string before calling 'error', since %c now has the
16820 printf meaning.
16821 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16822 overflow when computing char to be passed to 'error'. Do not
16823 pass Lisp_Object to 'error'; pass the integer instead.
16824 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16825 formatted with plain %d.
16826
b189fa66
PE
16827 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16828
bff87ef0
PE
16829 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16830
7e2cac20
PE
16831 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16832
ce4d90b5
PE
16833 * xterm.c (x_catch_errors): Remove duplicate declaration.
16834
266c9547
PE
16835 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16836
79c49ad2
PE
16837 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16838
368f4090
JM
168392011-04-10 Jim Meyering <meyering@redhat.com>
16840
16841 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16842 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16843 return ssize_t not "int", and use size_t as the buffer length.
16844 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16845 * gnutls.h: Update declarations.
16846 * process.c (read_process_output): Use ssize_t, to match.
16847 (send_process): Likewise.
16848
a32d4040
CY
168492011-04-09 Chong Yidong <cyd@stupidchicken.com>
16850
16851 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16852
8546720e 168532011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 16854
04f2d78b
CB
16855 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16856 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 16857
8546720e
GM
16858 * xterm.c (handle_one_xevent):
16859 * xmenu.c (create_and_show_popup_menu):
16860 * xselect.c (x_decline_selection_request)
16861 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 16862
0a2f5c1a 168632011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
16864
16865 Fix some uses of `int' instead of EMACS_INT.
16866 * search.c (string_match_1, fast_string_match)
16867 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16868 (scan_buffer, find_next_newline_no_quit)
16869 (find_before_next_newline, search_command, Freplace_match)
16870 (Fmatch_data): Make some `int' variables be EMACS_INT.
16871
16872 * xdisp.c (display_count_lines): 3rd argument and return value now
16873 EMACS_INT. All callers changed.
16874 (pint2hrstr): Last argument is now EMACS_INT.
16875
16876 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16877 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16878 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16879 (decode_coding_utf_16, decode_coding_emacs_mule)
16880 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16881 (decode_coding_ccl, decode_coding_charset)
16882 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16883 (decode_coding_iso_2022, decode_coding_emacs_mule)
16884 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16885 <char_offset, last_offset>: Declare EMACS_INT.
16886 (encode_coding_utf_8, encode_coding_utf_16)
16887 (encode_coding_emacs_mule, encode_invocation_designation)
16888 (encode_designation_at_bol, encode_coding_iso_2022)
16889 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16890 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16891 Declare EMACS_INT.
16892 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16893 (encode_invocation_designation): Last argument P_NCHARS is now
16894 EMACS_INT.
16895 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16896 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16897
16898 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16899 All users changed.
16900
16901 * ccl.c (Fccl_execute_on_string): Declare some variables
16902 EMACS_INT.
16903
8546720e 169042011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
16905
16906 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16907
4e19a977
CS
169082011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16909
16910 * process.c (Fformat_network_address): Doc fix.
16911
87302331
R
169122011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16913
ee7683eb 16914 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 16915
cbb59342
CY
169162011-04-08 Chong Yidong <cyd@stupidchicken.com>
16917
16918 * keyboard.c (read_char): Call Lisp function help-form-show,
16919 instead of using internal_with_output_to_temp_buffer.
16920 (Qhelp_form_show): New var.
e0d38eeb 16921 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
16922
16923 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16924
16925 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16926
e67a13ab
CY
169272011-04-06 Chong Yidong <cyd@stupidchicken.com>
16928
04f2d78b
CB
16929 * process.c (Flist_processes): Remove to Lisp.
16930 (list_processes_1): Delete.
e67a13ab 16931
973f782d
EZ
169322011-04-06 Eli Zaretskii <eliz@gnu.org>
16933
7c106b1e
EZ
16934 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16935
973f782d
EZ
16936 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16937
41cf7d1a 169382011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 16939
ca23cc88
PE
16940 Fix more problems found by GCC 4.6.0's static checks.
16941
f390e2d5
PE
16942 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16943
42eea0d0
PE
16944 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16945
b69769da 16946 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 16947
f9541e84
PE
16948 * xdisp.c (vmessage): Mark as a printf-like function.
16949
13841b55
PE
16950 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16951
c136c10f
PE
16952 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16953
5e2d4a30
PE
16954 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16955 printf-like functions.
16956 (tiff_load): Add casts to remove these marks before passing them
16957 to system-supplied API.
16958
583f48b9
PE
16959 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16960
b25d760e
PE
16961 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16962 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
16963 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16964 directly, rather than having caller test rule sign. This avoids
16965 some unnecessary tests.
16966 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16967 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16968 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 16969
bc7b6697 16970 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 16971 (xfont_open): Avoid unnecessary tests.
bc7b6697 16972
27ccc379
PE
16973 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16974
dcd5c89a
PE
16975 * composite.h, composite.c (composition_gstring_put_cache):
16976 Use EMACS_INT, not int, for length.
16977
b13a45c6
PE
16978 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16979 breaking out part of COMPOSITION_DECODE_RULE.
16980 (COMPOSITION_DECODE_RULE): Use it.
16981 * composite.c (get_composition_id): Remove unused local vars,
16982 by using the new macro.
16983
1e792e4d
PE
16984 * textprop.c (set_text_properties_1): Change while to do-while,
16985 since the condition is always true at first.
16986
dc6c6455 16987 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
16988 (interval_deletion_adjustment): Return unsigned value.
16989 All uses changed.
dc6c6455 16990
aba7731a
PE
16991 * process.c (list_processes_1, create_pty, read_process_output):
16992 (exec_sentinel): Remove vars that were set but not used.
afd4052b 16993 (create_pty): Remove unnecessary "volatile"s.
bc57d757 16994 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 16995 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 16996 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 16997
fdfc4bf3
PE
16998 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16999
fca8fe46 17000 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 17001 (update_syntax_table): Use unsigned instead of int.
fca8fe46 17002
06a0259a 17003 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 17004 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 17005 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 17006
e7b9e80f
PE
17007 * print.c (print_error_message): Avoid int overflow.
17008
56201685
PE
17009 * font.c (font_list_entities): Redo for clarity,
17010 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17011
78834453 17012 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 17013 (font_score): Avoid potential overflow in diff calculation.
78834453 17014
0bc0b309 17015 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 17016 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 17017
e610eaca
PE
17018 * eval.c (funcall_lambda): Rename local to avoid shadowing.
17019
b895abce
PE
17020 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
17021 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
17022 can always succeed if overflow has undefined behavior.
17023
1f1d9321 17024 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 17025 (wordify): Omit three unnecessary tests.
1f1d9321 17026
c59478bc
PE
17027 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
17028 All callers changed. This avoids the need for an unused var.
17029
79b73827
PE
17030 * casefiddle.c (casify_region): Remove var that is set but not used.
17031
a4db5dfe
PE
17032 * dired.c (file_name_completion): Remove var that is set but not used.
17033
43aae36e
PE
17034 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17035
2a47c44d 17036 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 17037 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 17038
a37c69bf
PE
17039 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17040 Check for integer overflow on size calculations.
17041
328ab8e7
PE
17042 * buffer.c (Fprevious_overlay_change): Remove var that is set
17043 but not used.
17044
e5a2a5cb
PE
17045 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17046 Remove vars that are set but not used.
8d84a6eb 17047 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 17048 (timer_check_2): Mark vars as initialized.
e5a2a5cb 17049
a60e5f68
PE
17050 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17051
f661cb61 17052 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 17053 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 17054
f0397f5a
PE
17055 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17056 that are set but not used.
17057
8664db06 17058 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 17059 if XCreateBitmapFromData fails (Bug#8410).
8664db06 17060
6abdaa4a
PE
17061 * xselect.c (x_get_local_selection, x_handle_property_notify):
17062 Remove vars that are set but not used.
17063
0ce7538d 17064 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 17065 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 17066
9ae848fc
PE
17067 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17068 Remove var that is set but not used.
0b918413
PE
17069 (scroll_bar_windows_size): Now size_t, not int.
17070 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
17071 Check for overflow.
9ae848fc 17072
a5a62657
PE
17073 * xfaces.c (realize_named_face): Remove vars that are set but not used.
17074 (map_tty_color) [!defined MSDOS]: Likewise.
17075
5c5cdd39
PE
17076 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17077
66ebf983
PE
17078 * coding.c: Remove vars that are set but not used.
17079 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17080 All callers changed.
17081 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17082 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17083 (decode_coding_charset): Remove vars that are set but not used.
17084
1be4d761
PE
17085 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17086 that is set but not used.
17087
47553fa8
PE
17088 * print.c (print_object): Remove var that is set but not used.
17089
1f7196bf 17090 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
17091 The gnulib version avoids calling malloc in the usual case,
17092 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17093 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17094 * filelock.c (current_lock_owner): Likewise.
17095 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17096 * sysdep.c: Include allocator.h, careadlinkat.h.
17097 (emacs_no_realloc_allocator): New static constant.
17098 (emacs_readlink): New function.
fdb61804
PE
17099 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17100 ../lib/careadlinkat.h.
d1fdcab7 17101
f84c17c7
SM
171022011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
17103
17104 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17105 first non-nil return value).
17106
ef3862ad
JD
171072011-04-03 Jan Djärv <jan.h.d@swipnet.se>
17108
17109 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17110 if not defined (Bug#8403).
17111
376a7006
JB
171122011-04-02 Juanma Barranquero <lekktu@gmail.com>
17113
17114 * xdisp.c (display_count_lines): Remove parameter `start',
17115 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17116 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17117 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17118 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17119 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17120 and thereabouts. All callers changed.
17121 (get_per_char_metric): Remove parameter `f', unused since
17122 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17123
6ca3801d
JM
171242011-04-02 Jim Meyering <meyering@redhat.com>
17125
17126 do not dereference NULL upon failed strdup
17127 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17128 (ns_get_family): Likewise.
17129
d8e2b5ba
JB
171302011-04-02 Juanma Barranquero <lekktu@gmail.com>
17131
17132 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17133
8c74fcbd
JD
171342011-04-02 Jan Djärv <jan.h.d@swipnet.se>
17135
17136 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17137 later (Bug#8403).
17138
7200d79c
SM
171392011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
17140
03408648 17141 Add lexical binding.
7200d79c 17142
03408648
SM
17143 * window.c (Ftemp_output_buffer_show): New fun.
17144 (Fsave_window_excursion):
17145 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17146
17147 * lread.c (lisp_file_lexically_bound_p): New function.
17148 (Fload): Bind Qlexical_binding.
17149 (readevalloop): Remove `evalfun' arg.
17150 Bind Qinternal_interpreter_environment.
17151 (Feval_buffer): Bind Qlexical_binding.
17152 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
17153 Mark as dynamic.
17154 (syms_of_lread): Declare `lexical-binding'.
17155
17156 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
17157
17158 * keyboard.c (eval_dyn): New fun.
17159 (menu_item_eval_property): Use it.
ca105506
SM
17160
17161 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 17162
03408648
SM
17163 * fns.c (concat, mapcar1): Accept byte-code-functions.
17164
17165 * eval.c (Fsetq): Handle lexical vars.
17166 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
17167 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
17168 (FletX, Flet): Obey lexical binding.
17169 (Fcommandp): Handle closures.
17170 (Feval): New `lexical' arg.
17171 (eval_sub): New function extracted from Feval. Use it almost
17172 everywhere where Feval was used. Look up vars in lexical env.
17173 Handle closures.
17174 (Ffunctionp): Move from subr.el.
17175 (Ffuncall): Handle closures.
17176 (apply_lambda): Remove `eval_flags'.
17177 (funcall_lambda): Handle closures and new byte-code-functions.
17178 (Fspecial_variable_p): New function.
17179 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
17180 but without exporting it to Lisp.
23aba0ea 17181
23aba0ea 17182 * doc.c (Fdocumentation, store_function_docstring):
03408648 17183 * data.c (Finteractive_form): Handle closures.
23aba0ea 17184
03408648
SM
17185 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
17186 interactive spec.
ba83908c 17187
04f2d78b
CB
17188 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
17189 New byte-codes.
03408648
SM
17190 (exec_byte_code): New function extracted from Fbyte_code to handle new
17191 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 17192
03408648 17193 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 17194
03408648 17195 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 17196
e2abce01
JB
171972011-03-31 Juanma Barranquero <lekktu@gmail.com>
17198
17199 * xdisp.c (redisplay_internal): Fix prototype.
17200
63696a73 172012011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 17202
63696a73 17203 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
17204 (try_scrolling): Use it when setting scroll_limit.
17205 Limit scrolling to 100 screen lines.
63696a73
EZ
17206 (redisplay_window): Even when falling back on "recentering",
17207 position point in the window according to scroll-conservatively,
17208 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
17209
17210 (try_scrolling): When point is above the window, allow searching
17211 as far as scroll_max, or one screenful, to compute vertical
17212 distance from PT to the scroll margin position. This prevents
17213 try_scrolling from unnecessarily failing when
17214 scroll-conservatively is set to a value slightly larger than the
17215 window height. Clean up the case of PT below the margin at bottom
17216 of window: scroll_max can no longer be INT_MAX. When aggressive
17217 scrolling is in use, don't let point enter the opposite scroll
17218 margin as result of the scroll.
17219 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
17220 threshold of 100 lines for never-recentering scrolling.
17221
e4cc2dfc
JB
172222011-03-31 Juanma Barranquero <lekktu@gmail.com>
17223
17224 * dispextern.h (move_it_by_lines):
17225 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17226 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
17227 (message_log_check_duplicate): Remove parameters `prev_bol' and
17228 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17229 (redisplay_internal): Remove parameter `preserve_echo_area',
17230 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
17231
17232 * indent.c (Fvertical_motion):
17233 * window.c (window_scroll_pixel_based, Frecenter):
17234 Don't pass `need_y_p' to `move_it_by_lines'.
17235
1c470562
SM
172362011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
17237
44f230aa
SM
17238 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17239 steal a few bits to be more compact.
17240 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17241 Remove unneeded casts.
17242
1c470562
SM
17243 * bytecode.c (Fbyte_code): CAR and CDR can GC.
17244
888adce9
ZK
172452011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
17246
17247 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17248 binding" message (bug#7967).
17249
f838ed7b
PE
172502011-03-30 Paul Eggert <eggert@cs.ucla.edu>
17251
77861b95
PE
17252 Fix more problems found by GCC 4.6.0's static checks.
17253
de6dbc14
PE
17254 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17255 Remove unused local var.
17256
f838ed7b
PE
17257 * editfns.c (Fmessage_box): Remove unused local var.
17258
792c7b2b
PE
17259 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17260 (note_mode_line_or_margin_highlight, note_mouse_highlight):
17261 Omit unused local vars.
c499e557 17262 * window.c (shrink_windows): Omit unused local var.
b01a1c29 17263 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
17264 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17265 Omit unused local var.
17266
ba0165e1
PE
17267 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17268 Don't assume string length fits in int.
32ad8845 17269 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 17270 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 17271
3c59b4c9
PE
17272 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17273 instead of alloca (Bug#8344).
17274
a3eed478 17275 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 17276 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 17277
eb4d412d
PE
17278 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17279
1658b401
PE
17280 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17281 concerns.
17282
17283 * term.c (produce_glyphless_glyph): Remove unnecessary test.
17284
17285 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 17286
9a2c6e05
PE
17287 * keyboard.c (syms_of_keyboard): Use the same style as later
17288 in this function when indexing through an array. This also
17289 works around GCC bug 48267.
17290
03d0a109
PE
17291 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17292
44f730c8
PE
17293 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17294
fe75f926
PE
17295 * chartab.c (sub_char_table_ref_and_range): Redo for slight
17296 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17297
ffa8c828
PE
17298 * keyboard.c, keyboard.h (num_input_events): Now size_t.
17299 This avoids undefined behavior on integer overflow, and is a bit
17300 more convenient anyway since it is compared to a size_t variable.
17301
c5101a77
PE
17302 Variadic C functions now count arguments with size_t, not int.
17303 This avoids an unnecessary limitation on 64-bit machines, which
17304 caused (substring ...) to crash on large vectors (Bug#8344).
17305 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
17306 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 17307 All variadic functions and their callers changed accordingly.
c5101a77
PE
17308 (struct gcpro.nvars): Now size_t, not int. All uses changed.
17309 * data.c (arith_driver, float_arith_driver): Likewise.
17310 * editfns.c (general_insert_function): Likewise.
17311 * eval.c (struct backtrace.nargs, interactive_p)
17312 (internal_condition_case_n, run_hook_with_args, apply_lambda)
17313 (funcall_lambda, mark_backtrace): Likewise.
17314 * fns.c (concat): Likewise.
17315 * frame.c (x_set_frame_parameters): Likewise.
17316 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
17317 0 if not found, not -1. All callers changed.
17318
dd3f25f7
PE
17319 * alloc.c (garbage_collect): Don't assume stack size fits in int.
17320 (stack_copy_size): Now size_t, not int.
17321 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
17322
461c2ab9
JB
173232011-03-28 Juanma Barranquero <lekktu@gmail.com>
17324
17325 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
17326 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17327 All callers changed.
17328
17329 * lisp.h (multibyte_char_to_unibyte):
17330 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
17331 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17332 * character.h (CHAR_TO_BYTE8):
17333 * cmds.c (internal_self_insert):
17334 * editfns.c (general_insert_function):
17335 * keymap.c (push_key_description):
17336 * search.c (Freplace_match):
17337 * xdisp.c (message_dolog, set_message_1): All callers changed.
17338
f6d62986
SM
173392011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
17340
17341 * keyboard.c (safe_run_hook_funcall): New function.
17342 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17343 don't set the hook to nil, but remove the offending function instead.
17344 (Qcommand_hook_internal): Remove, unused.
17345 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17346 Vcommand_hook_internal.
17347
17348 * eval.c (enum run_hooks_condition): Remove.
17349 (funcall_nil, funcall_not): New functions.
17350 (run_hook_with_args): Call each function through a `funcall' argument.
17351 Remove `cond' argument, now redundant.
17352 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17353 (Frun_hook_with_args_until_failure): Adjust accordingly.
17354 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17355
1db5b1ad
JB
173562011-03-28 Juanma Barranquero <lekktu@gmail.com>
17357
17358 * dispextern.h (string_buffer_position): Remove declaration.
17359
17360 * print.c (strout): Remove parameter `multibyte', unused since
17361 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
17362
17363 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17364 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17365 All callers changed.
17366
17367 * w32.c (_wsa_errlist): Use braces for struct initializers.
17368
17369 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17370 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17371 All callers changed.
17372 (string_buffer_position): Likewise. Also, make static (it's never
17373 used outside xdisp.c).
17374 (cursor_row_p): Remove parameter `w', unused since
17375 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
17376 (decode_mode_spec): Remove parameter `precision', introduced during
17377 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17378 All callers changed.
17379
5ffb62aa
JD
173802011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17381
17382 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17383
461c2ab9 173842011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
17385
17386 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17387 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17388 (ns_update_auto_hide_menu_bar): New functions.
17389 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17390 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17391 ns_constrain_all_frames.
17392 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17393 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17394
5c380ffb
JD
173952011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17396
17397 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17398
9af30bdf
GM
173992011-03-27 Glenn Morris <rgm@gnu.org>
17400
17401 * syssignal.h: Replace RETSIGTYPE with void.
17402 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17403 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17404 Replace SIGTYPE with void everywhere.
17405 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17406 * s/template.h (SIGTYPE): Remove commented out definition.
17407
e2abce01
JB
174082011-03-26 Eli Zaretskii <eliz@gnu.org>
17409
17410 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17411 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17412
f868cd8a
JB
174132011-03-26 Juanma Barranquero <lekktu@gmail.com>
17414
59eb0929
JB
17415 * w32.c (read_unc_volume): Use parameter `henum', instead of
17416 global variable `wget_enum_handle'.
17417
17418 * keymap.c (describe_vector): Remove parameters `indices' and
17419 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17420 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17421
f868cd8a
JB
17422 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17423
17424 * keyboard.c (timer_check): Remove parameter `do_it_now',
17425 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17426 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17427 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17428
17429 * keyboard.c (read_char):
17430 * w32menu.c (w32_menu_display_help):
17431 * xmenu.c (show_help_event, menu_help_callback):
17432 Adjust calls to `show_help_echo'.
17433
17434 * gtkutil.c (xg_maybe_add_timer):
17435 * keyboard.c (readable_events):
17436 * process.c (wait_reading_process_output):
17437 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17438
17439 * insdel.c (adjust_markers_gap_motion):
17440 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17441 (gap_left, gap_right): Don't call it.
17442
2ecf6fdb
CY
174432011-03-25 Chong Yidong <cyd@stupidchicken.com>
17444
17445 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17446 incurred during fontification.
17447
6b1f9ba4
JB
174482011-03-25 Juanma Barranquero <lekktu@gmail.com>
17449
17450 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17451 (DEFVAR_PER_BUFFER): Don't pass it.
17452
17453 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17454 (scrolling_window): Don't pass it.
17455
0f4a96b5
JB
174562011-03-25 Juanma Barranquero <lekktu@gmail.com>
17457
17458 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17459
17460 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17461 and `suffix'.
17462 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17463 of variables specific to SELinux and computation of `encoded_absname'.
17464
17465 * image.c (XPutPixel): Remove unused variable `height'.
17466
17467 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17468
17469 * unexw32.c (get_section_info): Remove unused variable `section'.
17470
17471 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17472 (system_process_attributes): Remove unused variable `sess'.
17473 (sys_read): Remove unused variable `err'.
17474
17475 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17476 (w32_wnd_proc): Remove unused variable `isdead'.
17477 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17478 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17479 (x_create_tip_frame): Remove unused variable `tem'.
17480
17481 * w32inevt.c (w32_console_read_socket):
17482 Remove unused variable `no_events'.
17483
17484 * w32term.c (x_draw_composite_glyph_string_foreground):
17485 Remove unused variable `width'.
17486
1149507c
JB
174872011-03-24 Juanma Barranquero <lekktu@gmail.com>
17488
17489 * w32term.c (x_set_glyph_string_clipping):
17490 Don't pass uninitialized region to CombineRgn.
17491
9c88f339
JB
174922011-03-23 Juanma Barranquero <lekktu@gmail.com>
17493
17494 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17495 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17496 (Fx_close_connection): Remove unused variable `i'.
17497
17498 * w32font.c (w32font_draw): Return number of glyphs.
17499 (w32font_open_internal): Remove unused variable `i'.
17500 (w32font_driver): Add missing initializer.
17501
17502 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17503 (fill_in_menu): Remove unused variable `items_added'.
17504
17505 * w32term.c (last_mouse_press_frame): Remove static global variable.
17506 (w32_clip_to_row): Remove unused variable `f'.
17507 (x_delete_terminal): Remove unused variable `i'.
17508
17509 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17510 (NOTHING): Remove unused static global variable.
17511 (uniscribe_check_otf): Remove unused variable `table'.
17512 (uniscribe_font_driver): Add missing initializers.
17513
dee091a3
JD
175142011-03-23 Julien Danjou <julien@danjou.info>
17515
17516 * term.c (Fsuspend_tty, Fresume_tty):
17517 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17518 * window.c (temp_output_buffer_show):
17519 * insdel.c (signal_before_change):
17520 * frame.c (Fhandle_switch_frame):
17521 * fileio.c (Fdo_auto_save):
17522 * emacs.c (Fkill_emacs):
17523 * editfns.c (save_excursion_restore):
17524 * cmds.c (internal_self_insert):
17525 * callint.c (Fcall_interactively):
17526 * buffer.c (Fkill_all_local_variables):
17527 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17528 Use Frun_hooks.
0f4a96b5 17529 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 17530 unconditionally since it does the check itself.
dee091a3 17531
2c520ab5 175322011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 17533
c9c49752
PE
17534 Fix more problems found by GCC 4.5.2's static checks.
17535
8abc3f12
PE
17536 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17537 the first time through the loop, since we know p0 < p1 then.
17538 This also avoids a gcc -Wstrict-overflow warning.
17539
a2d26660
PE
17540 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17541 leading to a memory leak, possible in functions like
17542 load_charset_map_from_file that can allocate an unbounded number
b12ef411 17543 of objects (Bug#8318).
a2d26660 17544
916c72e9
PE
17545 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17546 that could (at least in theory) be that large.
17547
19ab8a18
PE
17548 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17549 This is less likely to overflow, and avoids undefined behavior if
17550 overflow does occur. All callers changed. Use strtoul to scan
17551 for the unsigned long integer.
b7cbbd6f
PE
17552 (pint2hrstr): Simplify and tune code slightly.
17553 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 17554
f0641eff
PE
17555 * scroll.c (do_scrolling): Work around GCC bug 48228.
17556 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17557
7f650bb9
PE
17558 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17559 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
17560 (validate_x_resource_name): Simplify count usage.
17561 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 17562
37dd57d1
PE
17563 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17564 fail (Bug#8306).
81e56e61 17565
699979fc 17566 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 17567
401bf9b4
PE
17568 * process.c (Fmake_network_process): Use socklen_t, not int,
17569 where POSIX says socklen_t is required in portable programs.
17570 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 17571 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
17572 (Fmake_network_process, server_accept_connection):
17573 (wait_reading_process_output, read_process_output):
17574 Likewise.
17575
b93aacde
PE
17576 * process.c: Rename or move locals to avoid shadowing.
17577 (list_processes_1, Fmake_network_process):
17578 (read_process_output_error_handler, exec_sentinel_error_handler):
17579 Rename or move locals.
4dc343ee 17580 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 17581 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 17582 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 17583 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 17584 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 17585
af8a867c 17586 Make tparam.h and terminfo.c consistent.
44f230aa
SM
17587 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17588 Include tparam.h instead, since it declares them.
af8a867c
PE
17589 * cm.h (PC): Remove extern decl; tparam.h now does this.
17590 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17591 * terminfo.c: Include tparam.h, to check interfaces.
17592 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17593 (tparam): Adjust signature to match interface in tparam.h;
17594 this removes some undefined behavior. Check that outstring and len
17595 are zero, which they always are with Emacs.
17596 * tparam.h (PC, BC, UP): New extern decls.
17597
0248044d 17598 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 17599 (xftfont_open): Rename locals to avoid shadowing.
0248044d 17600
8ff096c1 17601 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
17602 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17603 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 17604 (ftfont_list): Remove unused local.
49eaafba
PE
17605 (get_adstyle_property, ftfont_pattern_entity):
17606 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17607 Rename locals to avoid shadowing.
8ff096c1 17608
e2be39f6
PE
17609 * xfont.c (xfont_list_family): Mark var as initialized.
17610
c9735e30
PE
17611 * xml.c (make_dom): Now static.
17612
8f5201ae
PE
17613 * composite.c (composition_compute_stop_pos): Rename local to
17614 avoid shadowing.
b246f932
PE
17615 (composition_reseat_it): Remove unused locals.
17616 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 17617 (composition_update_it): Mark var as initialized.
11b61122
PE
17618 (find_automatic_composition): Mark vars as initialized,
17619 with a FIXME (Bug#8290).
8f5201ae 17620
760fbc2c
PE
17621 character.h: Rename locals to avoid shadowing.
17622 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17623 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17624 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17625 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17626 to avoid shadowing.
17627
ff08eb85
PE
17628 * textprop.c (property_change_between_p): Remove; unused.
17629
fc7bf025
PE
17630 * intervals.c (interval_start_pos): Now static.
17631
235d7abc
PE
17632 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17633
44f230aa
SM
17634 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17635 Rename locals to avoid shadowing.
3e7d6594 17636
50060332
PE
17637 * sound.c (wav_play, au_play, Fplay_sound_internal):
17638 Fix pointer signedness.
d01f234b 17639 (alsa_choose_format): Remove unused local var.
c83b8872
PE
17640 (wav_play): Initialize a variable to 0, to prevent undefined
17641 behavior (Bug#8278).
50060332 17642
c4fc4e30
PE
17643 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17644
918436ed
PE
17645 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17646
c939f91b
PE
17647 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17648 clobbering (Bug#8298).
b9c7f648
PE
17649 * sysdep.c (sys_subshell): Likewise.
17650 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 17651
6bd8c144
PE
17652 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17653 This should get cleaned up, so that child_setup has the
17654 same signature on all platforms.
17655
7710357c 17656 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 17657 (relocate_fd): Rename locals to avoid shadowing.
7710357c 17658
c59da222
CY
176592011-03-22 Chong Yidong <cyd@stupidchicken.com>
17660
17661 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17662 not to be necessary, and produces flickering.
17663
66b87493
GM
176642011-03-20 Glenn Morris <rgm@gnu.org>
17665
17666 * config.in: Remove file.
17667
45b6f6d5
JB
176682011-03-20 Juanma Barranquero <lekktu@gmail.com>
17669
17670 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17671 are now in src/globals.h.
17672 (syms_of_minibuf): Remove spurious & from previous change.
17673
cd394be1 176742011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
17675
17676 * minibuf.c (completing-read-function): New variable.
17677 (completing-read-default): Rename from completing-read.
17678 (completing-read): Call completing-read-function.
17679
b14e3e21
CY
176802011-03-19 Juanma Barranquero <lekktu@gmail.com>
17681
17682 * xfaces.c (Fx_load_color_file):
17683 Read color file from absolute filename (bug#8250).
17684
f2b726e6
JB
176852011-03-19 Juanma Barranquero <lekktu@gmail.com>
17686
17687 * makefile.w32-in: Update dependencies.
17688
09f6ff02
EZ
176892011-03-17 Eli Zaretskii <eliz@gnu.org>
17690
17691 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17692
29a6015a
PE
176932011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17694
a3a6c54e
PE
17695 Fix more problems found by GCC 4.5.2's static checks.
17696
b766f867
PE
17697 * process.c (make_serial_process_unwind, send_process_trap):
17698 (sigchld_handler): Now static.
17699
be02381c
PE
17700 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17701 That way, the code declares only the vars that it needs.
17702 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17703 * s/cygwin.h (PTY_ITERATION): Likewise.
17704 * s/darwin.h (PTY_ITERATION): Likewise.
17705 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17706
57048744
PE
17707 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17708 * process.c (allocate_pty): Don't declare stb unless it's needed.
17709
7914961c 17710 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
17711 (CONSTANTLIM): Remove; unused.
17712 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17713 Define only if needed.
7914961c 17714
b3967b18
PE
17715 * unexelf.c (unexec): Name an expression,
17716 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
17717 Use a different way to cause a compilation error if anyone uses
17718 n rather than nn, a way that does not involve shadowing.
73366a00 17719 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 17720
29a6015a
PE
17721 * deps.mk (unexalpha.o): Remove; unused.
17722
43cfc33e 17723 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 17724 * unexec.h: New file.
ce701a33
PE
17725 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17726 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17727 Depend on unexec.h.
17728 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17729 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17730 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 17731 Change as necessary to match prototype in unexec.h.
ce701a33 17732
01f44d5a
PE
17733 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17734 shadowing.
4f63c6bb 17735 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 17736
a6670b0b
PE
17737 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17738 Rename locals to avoid shadowing.
17739
cef2010d 17740 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 17741 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 17742
d4d7173a
PE
17743 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17744
f08b802a
PE
17745 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17746 warning when compiling print.c.
17747
3ddb0639
PE
17748 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17749 instead of using an uninitialized var.
5ad03b97 17750 (font_sort_entities): Mark var as initialized.
3ddb0639 17751
170a2692
PE
17752 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17753
e663c700
PE
17754 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17755 pointers to constants.
89bc529a 17756 (font_parse_fcname): Remove unused vars.
7b81e2d0 17757 (font_delete_unmatched): Now static.
ea838e10 17758 (font_get_spec): Remove; unused.
13a547c6
PE
17759 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17760 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17761 Rename or move locals to avoid shadowing.
e663c700 17762
2a80c887 17763 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 17764 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 17765
1384fa33 17766 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 17767 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 17768
8b2c52e9
PE
17769 * alloc.c (mark_backtrace): Move decl from here ...
17770 * lisp.h: ... to here, so that it can be checked.
17771
475545b5 17772 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 17773 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
17774 (lisp_indirect_variable): Name an expression,
17775 to avoid gcc -Wbad-function-cast warning.
1faed8ae 17776 (Fdefvar): Rename locals to avoid shadowing.
475545b5 17777
b1349114 17778 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 17779 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 17780 Use const pointer when appropriate.
b1349114 17781
a2928364
PE
17782 * lisp.h (get_system_name, get_operating_system_release):
17783 Move decls here, to check interfaces.
17784 * process.c (get_operating_system_release): Move decl to lisp.h.
17785 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
17786 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17787 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17788 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
17789 (Fformat_time_string, Fencode_time, Finsert_char):
17790 (Ftranslate_region_internal, Fformat):
17791 Rename or remove local vars to avoid shadowing.
9710023e 17792 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 17793
a415e694
PE
17794 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17795 avoid shadowing.
17796
8ef4622d
PE
17797 * lisp.h (eassert): Check that the argument compiles, even if
17798 ENABLE_CHECKING is not defined.
17799
946f9a5b
PE
17800 * data.c (Findirect_variable): Name an expression, to avoid
17801 gcc -Wbad-function-cast warning.
112396d6 17802 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 17803 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
17804 (Fmake_variable_buffer_local, Fmake_local_variable):
17805 Mark variables as initialized.
52746918 17806 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 17807
e5aab7e7 17808 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
17809 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17810 Rename locals to avoid shadowing.
dff45157
PE
17811 (mark_stack): Move local variables into the #ifdef region where
17812 they're used.
7bc26fdb
PE
17813 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17814 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17815 needed otherwise.
17816 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17817 (GC_STRING_CHARS): Remove; not used.
d40d4be1 17818 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 17819
e5aab7e7
PE
17820 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17821 avoids undefined behavior in theory.
17822
4da60324
PE
17823 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17824
88043301
PE
17825 Use functions, not macros, for up- and down-casing (Bug#8254).
17826 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17827 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17828 to use the following functions instead of these macros.
17829 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17830 EMACS_INT, since callers assume the returned value fits in int.
17831 (upcase1): Likewise, for UPCASE_TABLE.
17832 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 17833 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 17834 the race-condition problem in the old DOWNCASE.
88043301 17835
19ed5445
PE
17836 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17837 Rename locals to avoid shadowing.
17838 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
17839 (regex_compile, re_search_2, re_match_2_internal):
17840 Remove unused local vars.
952db0d7
PE
17841 (FREE_VAR): Rewrite so as not to use empty "else",
17842 which gcc can warn about.
da053e48 17843 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
17844 (RETALLOC_IF): Define only if needed.
17845 (WORDCHAR_P): Likewise. This one is never needed, but is used
17846 only in a comment talking about a compiler bug, so put inside
17847 the #if 0 of that comment.
17848 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17849 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17850 Remove; unused.
19ed5445 17851
1f3561e4 17852 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
17853 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17854 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 17855
ded6f8f7
PE
17856 * search.c (simple_search): Remove unused var.
17857
dbd37a95
PE
17858 * dired.c (compile_pattern): Move decl from here ...
17859 * lisp.h: ... to here, so that it can be checked.
17860 (struct re_registers): New forward decl.
17861
7e47afad
PE
17862 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17863
85f24f61
PE
17864 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17865 All uses changed.
17866 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17867 Rename locals to avoid shadowing.
5671df8f 17868 (Fvertical_motion): Mark locals as initialized.
85f24f61 17869
181aa2be 17870 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 17871 (casify_region): Mark local as initialized.
181aa2be 17872
930d429c
PE
17873 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17874
7082eac6
PE
17875 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17876 New macros, so that the caller can use some names other than
17877 gcpro1, gcpro2, etc.
17878 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17879 of the new macros.
17880 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17881 argument, for consistency with GCPRO2_VAR, etc: it is now the
17882 prefix of the variable, not the variable itself. All uses
17883 changed.
38b2c076
PE
17884 * dired.c (directory_files_internal, file_name_completion):
17885 Rename locals to avoid shadowing.
17886
15206ed9
PE
17887 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17888 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17889 dired.c's scmp function, had undefined behavior.
17890 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17891 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17892 * buffer.h: ... to here, because these macros use current_buffer,
17893 and the new implementation with inline functions needs to have
17894 current_buffer in scope now, rather than later when the macros
17895 are used.
17896 (downcase, upcase1): New static inline functions.
17897 (DOWNCASE, UPCASE1): Reimplement using these functions.
17898 This avoids undefined behavior in expressions like
17899 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17900 from race conditions in accessing the global variables
17901 case_temp1 and case_temp2.
17902 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17903 * lisp.h (case_temp1, case_temp2): Remove their decls.
17904 * character.h (ASCII_CHAR_P): Move from here ...
17905 * lisp.h: ... to here, so that the inline functions mentioned
17906 above can use them.
17907
4a6bea26
PE
17908 * dired.c (directory_files_internal_unwind): Now static.
17909
f14b7e14
PE
17910 * fileio.c (file_name_as_directory, directory_file_name):
17911 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17912 Now static.
2893f146
PE
17913 (file_name_as_directory): Use const pointers when appropriate.
17914 (Fexpand_file_name): Likewise. In particular, newdir might
17915 point at constant storage, so make it a const pointer.
fd4ead52 17916 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
17917 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17918 signedness issues.
f839df0c
PE
17919 (Fset_file_times, Finsert_file_contents, auto_save_error):
17920 Rename locals to avoid shadowing.
f14b7e14 17921
5716756e 17922 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
17923 (Ftry_completion, Fall_completions): Rename or remove locals
17924 to avoid shadowing.
5716756e 17925
b4c3046a
PE
17926 * marker.c (bytepos_to_charpos): Remove; unused.
17927
b45db522
PE
17928 * lisp.h (verify_bytepos, count_markers): New decls,
17929 so that gcc does not warn that these functions aren't declared.
17930
85876d07
PE
17931 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17932 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 17933 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 17934 (copy_text): Remove unused local var.
85876d07 17935
03d78a21 17936 * filelock.c (within_one_second): Now static.
b3dd38ab 17937 (lock_file_1): Rename local to avoid shadowing.
03d78a21 17938
5df8f01b
PE
17939 * buffer.c (fix_overlays_before): Mark locals as initialized.
17940 (fix_start_end_in_overlays): Likewise. This function should be
17941 simplified by using pointers-to-pointers, but that's a different
17942 matter.
b1d876f1 17943 (switch_to_buffer_1): Now static.
8f54f30a
PE
17944 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17945 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 17946
a70072c9 17947 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 17948 Fix pointer signedness issue.
edced198
PE
17949 (sys_subshell): Mark local as volatile if checking for lint,
17950 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 17951 (MAXPATHLEN): Define only if needed.
a70072c9 17952
a0977c44
PE
17953 * process.c (serial_open, serial_configure): Move decls from here ...
17954 * systty.h: ... to here, so that they can be checked.
17955
a884fdcc
PE
17956 * fns.c (get_random, seed_random): Move extern decls from here ...
17957 * lisp.h: ... to here, so that they can be checked.
17958
604efe86 17959 * sysdep.c (reset_io): Now static.
b8950c94 17960 (wait_for_termination_signal): Remove; unused.
604efe86 17961
38fc62d9
PE
17962 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17963 (copy_keymap_item, append_key, push_text_char_description):
17964 Now static.
1004a21a 17965 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 17966 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
17967 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17968 (describe_map_tree):
17969 Rename locals to avoid shadowing.
38fc62d9 17970
2f2650da
PE
17971 * keyboard.c: Declare functions static if they are not used elsewhere.
17972 (echo_char, echo_dash, cmd_error, top_level_2):
17973 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
17974 (read_char, kbd_buffer_get_event, make_lispy_position):
17975 (make_lispy_event, make_lispy_movement, apply_modifiers):
17976 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17977 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17978 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 17979 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 17980 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 17981
a053e86c 17982 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
17983 (mark_kboards): Move decl here ...
17984 * alloc.c (mark_kboards): ... from here.
a053e86c 17985
4752793e
PE
17986 * lisp.h (force_auto_save_soon): New decl.
17987
74f10ca7 17988 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
17989 (DEFINE_DUMMY_FUNCTION): New macro.
17990 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17991 Use it.
c03cd23f
PE
17992 (main): Add casts to avoid warnings
17993 if GCC considers string literals to be constants.
74f10ca7 17994
022e70d4
PE
17995 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17996
59d6fe83
PE
17997 * dbusbind.c: Pointer signedness fixes.
17998 (xd_signature, xd_append_arg, xd_initialize):
17999 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18000 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18001 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
18002 (Fdbus_register_signal): Use SSDATA when the context wants char *.
18003
78320123
PE
18004 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
18005 if GCC considers string literals to be constants.
49cebcca 18006 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 18007
35ac2a97
SM
180082011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
18009
fb103ca9
SM
18010 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18011 (print_preprocess, print_object): New macro to fix last change.
18012
35ac2a97
SM
18013 * print.c (print_preprocess): Don't forget font objects.
18014
62973b41
JB
180152011-03-16 Juanma Barranquero <lekktu@gmail.com>
18016
18017 * emacs.c (USAGE3): Doc fixes.
18018
0e48bb22
AS
180192011-03-15 Andreas Schwab <schwab@linux-m68k.org>
18020
18021 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
18022 structure.
18023
7684e57b
JB
180242011-03-14 Juanma Barranquero <lekktu@gmail.com>
18025
18026 * lisp.h (VWindow_system, Qfile_name_history):
18027 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
18028 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
18029 (w32_system_caret_x, w32_system_caret_y): Declare extern.
18030
18031 * w32select.c: Don't #include "keyboard.h".
c96bbc66 18032 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
18033
18034 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18035 * w32console.c (detect_input_pending, read_input_pending)
18036 (encode_terminal_code):
18037 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18038 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18039 (w32_system_caret_y, Qfile_name_history):
18040 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18041 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18042 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18043 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18044 * w32proc.c (Qlocal, report_file_error):
18045 * w32term.c (Vwindow_system, updating_frame):
18046 * w32uniscribe.c (initialized, uniscribe_font_driver):
18047 Remove unneeded extern declarations.
18048
2aa46d6c
CY
180492011-03-14 Chong Yidong <cyd@stupidchicken.com>
18050
c96bbc66 18051 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 18052
cffc6f3b
CY
180532011-03-13 Chong Yidong <cyd@stupidchicken.com>
18054
18055 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18056 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18057 These macros can no longer be used for assignment.
18058
44f230aa
SM
18059 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18060 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
18061 (record_buffer_markers, fetch_buffer_markers): New functions for
18062 recording and fetching special buffer markers.
18063 (set_buffer_internal_1, set_buffer_temp): Use them.
18064
18065 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18066
18067 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18068
18069 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18070 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
18071
18072 * xdisp.c (hscroll_window_tree):
18073 (reconsider_clip_changes): Use PT instead of BUF_PT.
18074
d251f04b
EZ
180752011-03-13 Eli Zaretskii <eliz@gnu.org>
18076
18077 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18078 $(EMACS_ROOT)/lib/intprops.h.
18079
f0c77cd1
PE
180802011-03-13 Paul Eggert <eggert@cs.ucla.edu>
18081
3eca4629
PE
18082 Fix more problems found by GCC 4.5.2's static checks.
18083
7c86ee98
PE
18084 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18085 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
18086 (xg_free_frame_widgets): Make it clear that a local variable is
18087 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
18088 (gdk_window_get_screen): Make it clear that this macro is needed
18089 only if USE_GTK_TOOLTIP.
1e5524e7
PE
18090 (int_gtk_range_get_value): New function, which avoids a diagnostic
18091 from gcc -Wbad-function-cast.
18092 (xg_set_toolkit_scroll_bar_thumb): Use it.
18093 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18094 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
18095 (get_utf8_string, xg_get_file_with_chooser):
18096 Rename locals to avoid shadowing.
18097 (create_dialog): Move locals to avoid shadowing.
7c86ee98 18098
41729b81
PE
18099 * xgselect.c (xg_select): Remove unused var.
18100
f0c77cd1
PE
18101 * image.c (four_corners_best): Mark locals as initialized.
18102 (gif_load): Initialize transparent_p to zero (Bug#8238).
18103 Mark another local as initialized.
ec6cf4c6 18104 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 18105
ce0ad53d 18106 * image.c (clear_image_cache): Now static.
d5d5a617 18107 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 18108 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
18109 (x_edge_detection): Remove unnecessary cast that
18110 gcc -Wbad-function-cast diagnoses.
2037898d 18111 (gif_load): Fix pointer signedness.
6ae141d6
PE
18112 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18113 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 18114
33383987 181152011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 18116
d32df629
PE
18117 Improve quality of tests for time stamp overflow.
18118 For example, without this patch (encode-time 0 0 0 1 1
18119 1152921504606846976) returns the obviously-bogus value (-948597
18120 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18121 reports time overflow. See
18122 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
18123 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18124 * editfns.c: Include limits.h and intprops.h.
18125 (TIME_T_MIN, TIME_T_MAX): New macros.
18126 (time_overflow): Move earlier, to before first use.
18127 (hi_time, lo_time): New functions, for an accurate test for
18128 out-of-range times.
18129 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18130 (Fget_internal_run_time): Don't assume time_t fits in int.
18131 (make_time): Use list2 instead of Fcons twice.
18132 (Fdecode_time): More accurate test for out-of-range times.
18133 (check_tm_member): New function.
18134 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
18135 (lisp_time_argument): Don't rely on undefined left-shift and
18136 right-shift behavior when checking for time stamp overflow.
8be6f318 18137
fe31d94c
PE
18138 * editfns.c (time_overflow): New function, refactoring common code.
18139 (Fformat_time_string, Fdecode_time, Fencode_time):
18140 (Fcurrent_time_string): Use it.
18141
8be6f318
PE
18142 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18143 * dired.c (make_time): Move to ...
18144 * editfns.c (make_time): ... here.
18145 * systime.h: Note the move.
18146
09d9db2c 181472011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 18148
126bc0dc
YM
18149 * fringe.c (update_window_fringes): Remove unused variables.
18150
c47cbdfd
YM
18151 * unexmacosx.c (copy_data_segment): Also copy __got section.
18152 (Bug#8223)
18153
7ac80be9
EZ
181542011-03-12 Eli Zaretskii <eliz@gnu.org>
18155
c96bbc66 18156 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
18157 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
18158 Constify `char *' arguments and their references according to
18159 prototypes in tparam.h.
18160
ecb0f94d 18161 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 18162
7ac80be9
EZ
18163 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
18164 Adapt all references accordingly.
18165
18166 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
18167
ef1fd07e
TT
181682011-03-11 Tom Tromey <tromey@redhat.com>
18169
18170 * buffer.c (syms_of_buffer): Remove obsolete comment.
18171
7ef4b50c
EZ
181722011-03-11 Eli Zaretskii <eliz@gnu.org>
18173
18174 * termhooks.h (encode_terminal_code): Declare prototype.
18175
18176 * msdos.c (encode_terminal_code): Don't declare prototype.
18177
18178 * term.c (encode_terminal_code): Now external again, used by
18179 w32console.c and msdos.c.
18180
44f230aa
SM
18181 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
18182 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 18183
4b1ec863 181842011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 18185
1714f52b 18186 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 18187
4b1ec863
PE
18188 * fringe.c (update_window_fringes): Mark locals as initialized
18189 (Bug#8227).
18190 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 18191
524c7aa6
PE
18192 * alloc.c (mark_fringe_data): Move decl from here ...
18193 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
18194 to check its interface.
18195 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
18196
a5c0af81 18197 * fontset.c (free_realized_fontset): Now static.
7519b8cd 18198 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 18199 (fontset_font): Mark local as initialized.
a9a06e0b 18200 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 18201
b4716021
PE
18202 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
18203
811e9bac 18204 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 18205 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
18206 (x_own_selection, Fx_disown_selection_internal): Rename locals
18207 to avoid shadowing.
18208 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 18209
7e3ab302
PE
18210 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
18211 so that the caller can use some name other than gcpro1.
18212 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
18213 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18214 (Fx_backspace_delete_keys_p):
18215 Use them to avoid shadowing, and rename vars to avoid shadowing.
18216 (x_decode_color, x_set_name, x_window): Now static.
6b437900 18217 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 18218 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
18219 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18220 Remove unused locals.
7e3ab302
PE
18221 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18222 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18223 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18224 macros.
f78faa98 18225
e2b13473
PE
18226 * xterm.h (x_mouse_leave): New decl.
18227
77f23912
PE
18228 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18229 Remove unused functions.
cdf4ba58
PE
18230 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18231 (x_calc_absolute_position): Now static.
7411c686 18232 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 18233 Don't declare local "event" unless it's used.
ed7bf3a5
PE
18234 (x_iconify_frame, x_free_frame_resources): Don't declare locals
18235 unless they are used.
38d0b34a
PE
18236 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18237 (x_fatal_error_signal): Remove; not used.
a6067996
PE
18238 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18239 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18240 (x_error_catcher, x_connection_closed, x_error_handler):
18241 (x_error_quitter, xembed_send_message, x_iconify_frame):
18242 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 18243 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 18244 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 18245
44f230aa
SM
18246 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18247 Rename or move locals to avoid shadowing.
6b463e58 18248 (tty_defined_color, merge_face_heights): Now static.
5967d051 18249 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
18250 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18251 does not deduce is never used uninitialized.
73719eba
PE
18252 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18253 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 18254
426994c3 18255 * terminal.c (store_terminal_param): Now static.
5489860b 18256
032f1620 18257 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 18258 (set_frame_menubar): Remove unused local.
d4323972 18259 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
18260 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18261 since they might point to immutable storage.
281585b0
PE
18262 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18263 since it's unused otherwise.
032f1620 18264
367c19e5 18265 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 18266 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
18267 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18268 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 18269 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
18270 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18271 does not deduce are never used uninitialized.
70739cbe 18272
07b48fa9
PE
18273 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18274
8868a238 18275 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
18276 * window.c (window_loop, size_window):
18277 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 18278
7e5cf297 18279 * window.c (display_buffer): Now static.
d6550a9f
PE
18280 (size_window): Mark variables that gcc -Wuninitialized
18281 does not deduce are never used uninitialized.
a586633d
PE
18282 * window.h (check_all_windows): New decl, to forestall
18283 gcc -Wmissing-prototypes diagnostic.
5b555da1 18284 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 18285
f6095868
PE
18286 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18287 shadowing.
18288 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
18289 Include <limits.h>.
18290 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18291 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
18292 (load_charset_map): Mark variables that gcc -Wuninitialized
18293 does not deduce are never used uninitialized.
53df7c11 18294 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 18295
f38b440c
PE
18296 * coding.c (coding_set_source, coding_set_destination):
18297 Use "else { /* comment */ }" rather than "else /* comment */;"
18298 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
18299 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18300 a block, when the outer 'i' will do.
18301 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18302 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18303 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18304 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
18305 (Fdecode_sjis_char, Fdefine_coding_system_internal):
18306 Rename locals to avoid shadowing.
18307 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
18308 * coding.c (emacs_mule_char, encode_invocation_designation):
18309 Now static, since they're not used elsewhere.
413bb2db 18310 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 18311 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
18312 (decode_coding_emacs_mule): Mark variables that gcc
18313 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
18314 (detect_coding_iso_2022): Initialize a local variable that might
18315 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 18316 this initialization is needed. (Bug#8211)
5f58e762
PE
18317 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
18318 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
18319 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
18320 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
18321 Remove unused macros.
f38b440c 18322
232b38b9 18323 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 18324 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 18325 * character.c (string_count_byte8): Likewise.
232b38b9 18326
fb90da1b
PE
18327 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
18328 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
18329
fb93dbc2
PE
18330 * chartab.c (copy_sub_char_table): Now static, since it's not used
18331 elsewhere.
5c156ace
PE
18332 (sub_char_table_ref_and_range, char_table_ref_and_range):
18333 Rename locals to avoid shadowing.
bbcd0949 18334 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 18335
7d3b3862 18336 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 18337 (BIDI_BOB): Remove unused macro.
7d3b3862 18338
6be7d3da
PE
18339 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18340 deduce are never used uninitialized.
c2ed9c8b 18341 * term.c (encode_terminal_code): Likewise.
6be7d3da 18342
75f8807f 18343 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 18344
50938595
PE
18345 * tparam.h: New file.
18346 * term.c, tparam.h: Include it.
18347 * deps.mk (term.o, tparam.o): Depend on tparam.h.
18348 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18349 Move these decls to tparam.h, and make them agree with what
18350 is actually in tparam.c. The previous trick of using incompatible
18351 decls in different modules does not conform to the C standard.
18352 All callers of tparam changed to use tparam's actual API.
18353 * tparam.c (tparam1, tparam, tgoto):
18354 Use const pointers where appropriate.
18355
fbceeba2
PE
18356 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18357 * cm.h (struct cm): Likewise.
18358 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18359 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18360 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18361 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18362 (turn_on_face, init_tty): Likewise.
18363 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 18364
7f3f1250
PE
18365 * term.c (term_mouse_position): Rename local to avoid shadowing.
18366
e6ca6543
PE
18367 * alloc.c (mark_ttys): Move decl from here ...
18368 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18369
c40f8d15
AS
183702011-03-11 Andreas Schwab <schwab@linux-m68k.org>
18371
18372 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18373
cfe0661d
JB
183742011-03-09 Juanma Barranquero <lekktu@gmail.com>
18375
18376 * search.c (compile_pattern_1): Remove argument regp, unused since
18377 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18378 (compile_pattern): Don't pass it.
18379
0afb4571
J
183802011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18381
18382 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18383 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18384 for ! HAVE_GTK3.
18385 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18386
18387 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18388
18389 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18390 gdk_window_get_screen, gdk_window_get_geometry,
18391 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18392 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18393 (xg_get_pixbuf_from_pixmap): New function.
18394 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18395 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18396 Call xg_get_pixbuf_from_pixmap instead of
18397 gdk_pixbuf_get_from_drawable.
18398 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18399 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18400 (xg_check_special_colors): Use GtkStyleContext and its functions
18401 for HAVE_GTK3.
18402 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18403 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18404 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
18405 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18406 Call gtk_widget_get_preferred_size.
0afb4571
J
18407 (xg_frame_resized): gdk_window_get_geometry only takes 5
18408 parameters.
44f230aa
SM
18409 (xg_win_to_widget, xg_event_is_for_menubar):
18410 Call gdk_x11_window_lookup_for_display.
0afb4571
J
18411 (xg_set_widget_bg): New function.
18412 (delete_cb): New function.
895009e1 18413 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 18414 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
18415 (xg_set_background_color): Call xg_set_widget_bg.
18416 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18417 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18418 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18419 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18420 if ! HAVE_GTK3.
18421 (update_frame_tool_bar): Call gtk_widget_hide.
18422 (xg_initialize): Use GDK_KEY_g.
18423
18424 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18425 if ! HAVE_GTK3
18426 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18427
18428 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18429 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18430 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18431
1c2cc4ef
JB
184322011-03-08 Juanma Barranquero <lekktu@gmail.com>
18433
18434 * w32xfns.c (select_palette): Check success of RealizePalette against
18435 GDI_ERROR, not zero.
18436
33383987 18437See ChangeLog.11 for earlier changes.
aac0c6e3
MR
18438
18439;; Local Variables:
18440;; coding: utf-8
aac0c6e3
MR
18441;; End:
18442
2f097256 18443 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
18444
18445 This file is part of GNU Emacs.
18446
18447 GNU Emacs is free software: you can redistribute it and/or modify
18448 it under the terms of the GNU General Public License as published by
18449 the Free Software Foundation, either version 3 of the License, or
18450 (at your option) any later version.
18451
18452 GNU Emacs is distributed in the hope that it will be useful,
18453 but WITHOUT ANY WARRANTY; without even the implied warranty of
18454 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18455 GNU General Public License for more details.
18456
18457 You should have received a copy of the GNU General Public License
18458 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.