* ffap.el (ffap-replace-file-component): Support Tramp file name
[bpt/emacs.git] / src / ChangeLog
CommitLineData
607446ba
JB
12012-10-08 Juanma Barranquero <lekktu@gmail.com>
2
3 * w32term.c: Remove leftover declaration of keyboard_codepage.
4
b6f4e300
EZ
52012-10-08 Eli Zaretskii <eliz@gnu.org>
6
c54ebba4
EZ
7 * makefile.w32-in (FONT_H): Add $(FRAME_H).
8 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
9 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
10 (GLOBAL_SOURCES): Add cygw32.c.
15c720a3
EZ
11 ($(BLD)/unexw32.$(O)):
12 ($(BLD)/w32.$(O)):
13 ($(BLD)/w32console.$(O)):
14 ($(BLD)/w32fns.$(O)):
15 ($(BLD)/w32heap.$(O)):
16 ($(BLD)/w32menu.$(O)):
17 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 18
b6f4e300
EZ
19 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
20 'const char *'.
21 (x_to_w32_color): Don't modify the argument, modify a copy instead.
22
501199a3
DC
232012-10-08 Daniel Colascione <dancol@dancol.org>
24
25 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
26 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
27 accidental message numbering hole. Change other messages to
28 match.
29
30 * w32select.h (HAVE_W32SELECT): Remove.
31
32 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
33 w32common.h instead of w32heap.h
34
35 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
36 (get_allocation_unit, get_processor_type, get_w32_major_version)
37 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
38 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
39 (OS_NT, os_subtype, cache_system_info): Move declarations to
40 w32common.
41
42 * w32heap.c: Include w32common.h.
43 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
44 (w32_minor_version, w32_build_number, w32_subtype): Remove
45 duplicate definitions.
46
47 * w32fns.c: Include w32common.h; include w32heap.h only in
48 WINDOWSNT.
49
50 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
51 Use `report_file_error' instead of `error' in order to better
52 inform users of what went wrong. Increase NTGUI_UNICODE file
53 dialog box file name length to 32k, the maximum allowed by the NT
54 kernel.
55
56 * w32common.h: New file.
57 (ROUND_UP, ROUND_DOWN, get_page_size)
58 (get_allocation_unit, get_processor_type, get_w32_major_version)
59 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
60 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
61 (OS_NT, os_subtype, cache_system_info): Move here.
62
63 * unexw32.c, unexcw.c: Include w32common.h.
64
65 * emacs.c (main): Use (defined (WINDOWSNT) || defined
66 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
67 to call syms_of_w32select.
68
69 * cygw32.h: Remove obsolete EXFUN declarations.
70
71 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
72
73 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
74 of w32inevt.o from SOME_MACHINE_OBJECTS.
75
93aa5c81
DC
762012-10-08 Daniel Colascione <dancol@dancol.org>
77
78 * image.c: Permanent fix for JPEG compilation issue --- limit
79 jpeglib `boolean' redefinition to Cygwin builds.
80
d424f3d8
EZ
812012-10-08 Eli Zaretskii <eliz@gnu.org>
82
8ee4c6ce
EZ
83 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
84
d424f3d8
EZ
85 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
86 Cygwin.
87
e08348a0
DC
882012-10-08 Daniel Colascione <dancol@dancol.org>
89
90 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
91 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
92 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
93 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
94 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
95 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
96 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
97 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
98 now a supported configuration.
99
100 * Makefile.in: consolidate image variables into LIBIMAGE; add
101 W32_OBJ and W32_LIBS. Compile new files.
102
103 * conf_post.h:
104 (_DebPrint) declare tracing facility for W32 debugging. We need
105 to unify tracing later.
106
107 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
108 unconditional use of W32 Unicode functions. Cygwin runs only on
109 100% Unicode operating systems.
110
111 * cygw32.c: New file. Define Cygwin-specific facilities.
112 (Fcygwin_convert_path_to_windows)
113 (Fcygwin_convert_path_from_windows): New user functions for
114 accessing Cygwin path-munging routines.
115
116 * cygw32.h: New file.
117 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
118 UTF-16LE strings temporarily inside non-Lisp-visible string
119 objects.
120
121 (w32_strerror): Just what it says on the tin.
122
123 * emacs.c: Make the NS fork-then-exec code for daemon-launching
124 also run for Cygwin; both systems have the same problem with using
125 GUI facilities in a forked child. Also call syms_of_cygw32,
126 syms_of_w32select in correct places.
127
128 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
129 needs fork-then-exec for daemon launching.
130
131 * font.h: Include frame.h.
132
133 * image.c: Use the image library cache machinery only when we're
134 compiling for native WINDOWSNT; Cygwin can use shared libraries
135 like any other Unixlike system.
136
137 * keyboard.c: Clarify a comment regarding the input loop.
138
139 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
140 functions directly instead of trying to detect at runtime that our
141 host operating system supports them. We make this change for two
142 reasons: Cygwin lacks support for the multibyte character
143 conversion functions used by the legacy menu code, and Cygwin
144 never needs to rely on non-Unicode APIs.
145
146 * unexw32.c (hinst): Declare extern.
147
148 * w32.c: Change header order;
149 (w32_strerror): Move to w32fns.c because we need it for
150 non-WINDOWSNT builds.
151
152 * w32.h: Add #error macro to make sure we don't include w32.h for
153 Cygwin builds. Remove w32select declarations.
154
155 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
156 w32fns.c. w32console.c is WINDOWSNT-only.
157
158 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
159 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
160 POSIXy alternative.
161 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
162 (w32_major_version, w32_minor_version, w32_build_number)
163 (os_subtype, sound_type): Define here
164 (w32_defined_color): Make color parameter const for consistency
165 with other _defined_color functions.
166 (w32_createwindow): Unconditionally call w32_init_class instead of
167 doing so only when hprevinst is non-NULL. Plumbing hprevinst
168 through the code is complex and unnecessary because class
169 registration is practically free.
170 (w32_name_of_message): New EMACSDEBUG-only function.
171 (Fset_message_beep): Move here
172 (Fx_open_connection): Require that the display name for Windows be
173 "w32" for consistency, emacsclient disambiguation, and maybe, one
174 day, multi-window-system support.
175 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
176 Cygwin files for W32 GUI facilities, since these clearly don't
177 expect Cygwin names.
178 (_DebPrint): Define.
179 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
180 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
181 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
182 (w32_last_error): Remove.
183
184 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
185
186 * w32heap.c (syspage_mask): Declare here.
187 (cache_system_info): Remove.
188
189 * w32inevt.c (faked_key): Define globally, not statically.
190 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
191 (w32_console_toggle_lock_key): Move to w32fns.c.
192
193 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
194
195 * w32proc.c (_DebPrint): Move to w32fns.c.
196 * w32select.c: Include string.h, stdio.h for Cygwin.
197 * w32select.h: New File.
198
199 * w32term.c: Include io.h for non-CYGWIN builds; needed for
200 get_osfhandle.
201 (w32_message_fd): New variable. Under Cygwin, holds the file
202 descriptor the system used to tell us about pending thread
203 messages.
204
205 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
206 that prevented compilation under non-WINDOWSNT systems.
207
208 (w32_initialize): Open /dev/windows and assign it to
209 w32_message_fd. Provide w32 feature.
210
211 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
212 (WM_EMACS_INPUT_READY): add.
213 (prepend_msg, w32_message_fd): Declare globally.
214
215 * w32xfns.c:
216 (keyboard_handle): Use only when WINDOWSNT.
217 (notify_msg_ready): New function. Posts a message to the main
218 thread's message queue under CYGWIN, which wakes up the main
219 thread from select(2) by making the /dev/windows file descriptor
220 ready. Under WINDOWSNT, it sets an event the same way the old
221 code did.
222
223 (post, prepend_msg): Actually call notify_msg_ready instead of
224 setting the input event directly.
225
98daa893
EZ
2262012-10-07 Eli Zaretskii <eliz@gnu.org>
227
228 * ralloc.c (relinquish): If a heap is ready to be relinquished,
229 but it still has blocs in it, don't return it to the system,
230 instead of aborting. (Bug#12402)
231
3bc0a2f7
JD
2322012-10-07 Jan Djärv <jan.h.d@swipnet.se>
233
8ad5b73b 234 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 235
335f5ae4
JD
236 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
237 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
238 (syms_of_nsterm): Remove comment about Panther and above for
239 ns-antialias-text.
335f5ae4
JD
240 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
241 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
242 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
243
244 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
245 MAC_OS_X_VERSION_10_4.
246
8ad5b73b
JD
247 * nsmenu.m (fillWithWidgetValue:): Remove code for <
248 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
249
250 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
251
252 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
253 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
254
3bc0a2f7
JD
255 * nsterm.m (ns_in_resize): Remove (Bug#12479).
256 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8ad5b73b
JD
257 (ns_clear_frame, sendEvent, windowDidResize, drawRect:): Remove
258 ns_in_resize check.
3bc0a2f7
JD
259 (ns_clear_frame_area): Remove resize handle code.
260
261 * nsfns.m (ns_in_resize): Remove.
8ad5b73b
JD
262 (x_set_icon_name, ns_set_name, ns_set_name_as_filename): Remove
263 ns_in_resize check.
3bc0a2f7 264
c622b48f
PE
2652012-10-07 Paul Eggert <eggert@cs.ucla.edu>
266
267 Improve sys_siglist detection.
268 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
269 defined as a macro, as is done in Solaris.
270 (sys_siglist_entries): New macro.
271 (save_strsignal): Use it.
272 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
273 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
274
04fafa46
JD
2752012-10-06 Jan Djärv <jan.h.d@swipnet.se>
276
277 * nsfns.m (Fx_create_frame): Call x_default_parameter with
278 fullscreen/Fullscreen.
279
280 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
281 tobar_height is new.
282
283 * nsterm.m (x_make_frame_visible): Check for fullscreen.
284 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
285 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
286 (windowDidResize:): Check for correct window if old style fullscreen.
287 Capitalize word in comment. Remove incorrect comment.
288 (initFrameFromEmacs:): tbar_height renamed tibar_height.
289 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
290 error in drawing background.
291 (toggleFullScreen:): Remove comment. Rearrange calls.
292 Set toolbar values to zero, save old height in tobar_height.
293 Restore tool bar height when leaving fullscreen.
294 (canBecomeMainWindow): New function.
295
c6e21c03
PE
2962012-10-06 Paul Eggert <eggert@cs.ucla.edu>
297
298 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
299
0d9f584b
EZ
3002012-10-05 Eli Zaretskii <eliz@gnu.org>
301
a65fbb5f
EZ
302 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
303
0d9f584b
EZ
304 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
305 that time stamps of directories could also be changed. Don't
306 request the too broad GENERIC_WRITE, only the more restrictive
307 FILE_WRITE_ATTRIBUTES access rights.
308
309 * fileio.c (Fset_file_times): Special-case ignoring errors for
310 directories only on MSDOS, not on MS-Windows.
311
e8757f09 3122012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
313
314 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
315
7604f298
EZ
3162012-10-04 Eli Zaretskii <eliz@gnu.org>
317
318 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
319 see whether CreateFile failed.
320
88d69b7d
PE
3212012-10-04 Paul Eggert <eggert@cs.ucla.edu>
322
323 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
324 to avoid similar races.
325 * keyboard.c (pending_signals): Now bool, not int.
326
7509f454
PE
327 Port timers to OpenBSD, plus check for timer failures.
328 OpenBSD problem reported by Han Boetes.
329 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
330 and/or setitimer.
331 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
332 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
333 like OpenBSD, which has timer_settime but does not declare it.
334 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
335 whether to use itimerspec-related primitives. All uses of
336 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
337
a3c5c0c5
PE
3382012-10-02 Paul Eggert <eggert@cs.ucla.edu>
339
340 * profiler.c (handle_profiler_signal): Fix a malloc race
341 that caused Emacs to hang on Fedora 17 when profiling Lisp.
342
914e743b
JD
3432012-10-02 Jan Djärv <jan.h.d@swipnet.se>
344
345 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
346
d8ab37a8
EZ
3472012-10-02 Eli Zaretskii <eliz@gnu.org>
348
349 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
350 consistent with the change in return value of 'safe_strsignal'.
351
b3ecad33
PE
3522012-10-02 Paul Eggert <eggert@cs.ucla.edu>
353
0a99eee1
PE
354 Prefer plain 'static' to 'static inline' (Bug#12541).
355 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
356 (bidi_set_sor_type, bidi_push_embedding_level)
357 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
358 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
359 (bidi_cache_search, bidi_cache_ensure_space)
360 (bidi_cache_iterator_state, bidi_cache_find)
361 (bidi_peek_at_next_level, bidi_set_paragraph_end)
362 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
363 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
364 Now 'static', not 'static inline'.
365
b3ecad33
PE
366 Count overruns when profiling; change units to ns.
367 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
368 Give extra weight to samples after overruns, to attempt to count
369 the time more accurately.
370 (setup_cpu_timer): Change sampling interval units from ms to ns, since
371 the underlying primitives nominally do ns.
372 (Fprofiler_cpu_start): Document the change. Mention that
373 the sampling intervals are only approximate.
374
090cf9db
SM
3752012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
376
377 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
378
379 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
380 case for the special 0 coding-system.
381
382 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
383 (Fmake_overlay): Remove redundant tests.
64edc777 384 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 385
81550bf4
JB
3862012-10-02 Juanma Barranquero <lekktu@gmail.com>
387
388 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
389 Update dependencies.
390
aa1ba90e
PE
3912012-10-01 Paul Eggert <eggert@cs.ucla.edu>
392
393 Fix a malloc race condition involving strsignal.
394 A signal can arrive in the middle of a malloc, and Emacs's signal
395 handler can invoke strsignal, which can invoke malloc, which is
396 not portable. This race condition bug makes Emacs hang on GNU/Linux.
397 Fix it by altering the signal handler so that it does not invoke
398 strsignal.
399 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
400 * process.c (status_message): Use const pointer, in case strsignal
401 is #defined to safe_strsignal.
402 * sysdep.c (sys_siglist, init_signals): Always define and
403 initialize a substitute sys_siglist if the system does not define
404 one, even if HAVE_STRSIGNAL.
405 (safe_strsignal): Rename from strsignal. Always define,
406 using sys_siglist. Return a const pointer.
407 * syssignal.h (safe_strsignal): New decl.
408 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
409
ace917bd
EZ
4102012-10-01 Eli Zaretskii <eliz@gnu.org>
411
412 * w32proc.c (timer_loop): Fix code that waits for timer
413 expiration, to avoid high CPU usage.
414
9eb71b9c
SM
4152012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
416
417 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
418 (sweep_weak_table): Remove redundant prototypes.
419
b3317662
FP
4202012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
421
422 * emacs.c: Move the inclusion of TERM_HEADER after including
423 windows.h on WINDOWSNT. This avoids compilation problems with
424 MSVC.
425
f0e5f225
EZ
4262012-10-01 Eli Zaretskii <eliz@gnu.org>
427
2d7d1608
EZ
428 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
429 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
430 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
431 as the previous version used 'void *'.
432
433 * ralloc.c (ROUNDUP): Fix last change.
434 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
435 'size_t'.
436
f0e5f225
EZ
437 * w32proc.c <disable_itimers>: New static flag.
438 (init_timers): Initialize it to zero, after creating the critical
439 sections used by the timer threads.
440 (term_timers): Set to 1 before deleting the critical sections.
441 (getitimer, setitimer): If disable_itimers is non-zero, return an
442 error indication without doing anything. Reported by Fabrice
443 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
444 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
445 return results.
446 [!HAVE_SETITIMER]: Behave as the previous version that didn't
447 support timers.
f0e5f225
EZ
448
449 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
450 term_ntproc after all the other bookkeeping, to get timers working
451 as long as possible.
452
82ef37c1
PE
4532012-10-01 Paul Eggert <eggert@cs.ucla.edu>
454
b3a4c387
PE
455 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
456 Suggested by Juri Linkov in
457 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
458
b0ab8123
PE
459 Prefer plain 'static' to 'static inline' (Bug#12541).
460 With static functions, modern compilers inline pretty well by
461 themselves; advice from programmers often hurts as much as it helps.
462 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
463 this change shrinks the text size of the Emacs executable by 1.1%
464 without affecting CPU significantly in my benchmark.
465 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
466 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
467 (mark_maybe_object, mark_maybe_pointer, bounded_number):
468 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
469 (bset_auto_fill_function, bset_auto_save_file_format)
470 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
471 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
472 (bset_cache_long_line_scans, bset_case_fold_search)
473 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
474 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
475 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
476 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
477 (bset_header_line_format, bset_indicate_buffer_boundaries)
478 (bset_indicate_empty_lines, bset_invisibility_spec)
479 (bset_left_fringe_width, bset_major_mode, bset_mark)
480 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
481 (bset_name, bset_overwrite_mode, bset_pt_marker)
482 (bset_right_fringe_width, bset_save_length)
483 (bset_scroll_bar_width, bset_scroll_down_aggressively)
484 (bset_scroll_up_aggressively, bset_selective_display)
485 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
486 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
487 (set_buffer_overlays_after):
488 * category.c (bset_category_table):
489 * charset.c (read_hex):
490 * coding.c (produce_composition, produce_charset)
491 (handle_composition_annotation, handle_charset_annotation)
492 (char_encodable_p):
493 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
494 (assign_row, set_frame_matrix_frame, make_current)
495 (add_row_entry):
496 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
497 * fns.c (maybe_resize_hash_table):
498 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
499 * gmalloc.c (register_heapinfo):
500 * image.c (lookup_image_type):
501 * intervals.c (set_interval_object, set_interval_left)
502 (set_interval_right, copy_interval_parent, rotate_right)
503 (rotate_left, balance_possible_root_interval):
504 * keyboard.c (kset_echo_string, kset_kbd_queue)
505 (kset_keyboard_translate_table, kset_last_prefix_arg)
506 (kset_last_repeatable_command, kset_local_function_key_map)
507 (kset_overriding_terminal_local_map, kset_real_last_command)
508 (kset_system_key_syms, clear_event, set_prop):
509 * lread.c (digit_to_number):
510 * marker.c (attach_marker, live_buffer, set_marker_internal):
511 * nsterm.m (ns_compute_glyph_string_overhangs):
512 * process.c (pset_buffer, pset_command)
513 (pset_decode_coding_system, pset_decoding_buf)
514 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
515 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
516 (pset_status, pset_tty_name, pset_type, pset_write_queue):
517 * syntax.c (bset_syntax_table, dec_bytepos):
518 * terminal.c (tset_param_alist):
519 * textprop.c (interval_has_some_properties)
520 (interval_has_some_properties_list):
521 * window.c (wset_combination_limit, wset_dedicated)
522 (wset_display_table, wset_hchild, wset_left_fringe_width)
523 (wset_left_margin_cols, wset_new_normal, wset_new_total)
524 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
525 (wset_right_fringe_width, wset_right_margin_cols)
526 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
527 (wset_vertical_scroll_bar_type, wset_window_parameters):
528 * xdisp.c (wset_base_line_number, wset_base_line_pos)
529 (wset_column_number_displayed, wset_region_showing)
530 (window_box_edges, run_window_scroll_functions)
531 (append_glyph_string_lists, prepend_glyph_string_lists)
532 (append_glyph_string, set_glyph_string_background_width)
533 (append_glyph, append_composite_glyph)
534 (take_vertical_position_into_account):
535 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
536 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
537 (lface_hash, lface_same_font_attributes_p, lookup_face):
538 * xml.c (libxml2_loaded_p):
539 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
540 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
541 Now 'static', not 'static inline'.
542
05584c31
PE
543 * bidi.c: Tune.
544 (bidi_copy_it): Do the whole copy with a single memcpy.
545 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
546
86ec63ba
PE
547 Revert the FOLLOW-SYMLINKS change for file-attributes.
548 Doing it right would require several changes to Tramp, and there's
549 not enough time to get that tested before the freeze today.
550 * dired.c (directory_files_internal, Ffile_attributes):
551 Undo last change.
552
82ef37c1
PE
553 * frame.c (x_report_frame_params): Port better to wider ints.
554 Do not assume that EMACS_UINT is the same width as uprintmax_t,
555 or that pointers can be printed in 15 decimal digits.
556 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
557
62aba0d4
FP
5582012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
559
560 Support x64 build on MS-Windows.
561 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
562 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
563 compatibility with x64.
5e4daaf3 564 (x_get_focus_frame): Add prototype.
62aba0d4
FP
565
566 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
567 defining an XRectangle structure.
568
569 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
570 arithmetics for compatibility with x64.
571
572 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
573 compatibility with x64.
574
575 * w32heap.h: Adjust prototypes and declarations.
576
577 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
578 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
579 DWORD, long, and unsigned long, for compatibility with x64.
580 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
581 (sbrk): Argument is now of type ptrdiff_t.
582
583 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
584 less than 0x0500.
585 (w32_msg_pump): Use WPARAM type for 'result'.
586
587 * w32.c (init_environment, get_emacs_configuration): Support AMD64
588 architecture.
589 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
590 compatibility with x64.
591
592 * vm-limit.c (lim_data): Now size_t.
593 (check_memory_limits): Adjust prototypes of real_morecore and
594 __morecore to receive argument of type ptrdiff_t. Use size_t for
595 five_percent and data_size.
596
597 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
598 variables, for compatibility with x64.
599 (rva_to_section, offset_to_section, relocate_offset)
600 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
601 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
602 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
603 for compatibility with x64.
604
605 * sysdep.c (STDERR_FILENO): Define if not already defined.
606
607 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
608 (__morecore): Argument type is now ptrdiff_t.
609 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
610 (relinquish): Use ptrdiff_t type for 'excess'.
611 (r_alloc_sbrk): Argument type is now ptrdiff_t.
612
613 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
614 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
615 instead of a literal number.
616
617 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
618 (min): Define only if not already defined.
619
620 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
621 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
622 hosts.
623
624 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
625 'bitmaps' is a pointer.
626
627 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
628
629 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
630
e7a2937b
PE
6312012-09-30 Paul Eggert <eggert@cs.ucla.edu>
632
633 file-attributes has a new optional arg FOLLOW-SYMLINKS.
634 * dired.c (directory_files_internal, Ffile_attributes):
635 New arg follow_symlinks. All uses changed.
636
b43d62ae
SM
6372012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
638
639 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
640
c06c382a
EZ
6412012-09-30 Eli Zaretskii <eliz@gnu.org>
642
643 Support atimers and CPU profiler via profile.c on MS-Windows.
644 * w32proc.c (sig_mask, crit_sig): New static variables.
645 (sys_signal): Support SIGALRM and SIGPROF.
646 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 647 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
648 sigfillset, and sigprocmask are no longer no-ops.
649 (sigismember): New function.
650 (struct itimer_data): New definition.
651 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
652 (crit_prof): New static variables.
653 (MAX_SINGLE_SLEEP): New definition.
654 (timer_loop, stop_timer_thread, term_timers, init_timers)
655 (start_timer_thread, getitimer, setitimer): New functions.
656 (alarm): No longer a no-op, calls setitimer.
657
658 * w32.c (term_ntproc): Call term_timers.
659 (init_ntproc): Make sure all signals are unblocked at startup, to
660 erase any traces of dumping. Call init_timers.
661
662 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
663 Windows-specific code to display the hourglass mouse pointer is no
664 longer used.
665 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
666 to hourglass timer expiration.
667 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
668 Remove, no longer used.
b43d62ae
SM
669 (w32_note_current_window, show_hourglass, hide_hourglass):
670 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
671 window systems.
672 (syms_of_w32fns): Don't initialize hourglass_timer.
673
674 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
675 WINDOWSNT as well.
676 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
677
678 * w32.h (init_timers, term_timers): Add prototypes.
679
95402d5f
KH
6802012-09-30 Kenichi Handa <handa@gnu.org>
681
682 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
683 to the buffer relocation which may be caused by ccl_driver.
684
dd946752
JD
6852012-09-30 Jan Djärv <jan.h.d@swipnet.se>
686
d7e642cc
JD
687 * xfns.c (Fx_file_dialog): Update comment.
688
689 * w32fns.c (Fx_file_dialog): Update comment.
690
691 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
692 Initialize panel name field if OSX >= 10.6.
693
694 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
695
dd946752
JD
696 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
697
698 * nsterm.m (NEW_STYLE_FS): New define.
699 (ns_fullscreen_hook, windowWillEnterFullScreen)
700 (windowDidEnterFullScreen, windowWillExitFullScreen)
701 (windowDidExitFullScreen, toggleFullScreen, handleFS)
702 (setFSValue): New functions.
703 (EmacsFSWindow): New implementation.
704 (canBecomeKeyWindow): New function for EmacsFSWindow.
705 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
706 (dealloc): Release nonfs_window if in fullscreen.
707 (updateFrameSize:): Call windowDidMove to update top/left.
708 (windowWillResize:toSize:): Check if frame is still maximized.
709 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
710 next_maximized, maximized_width, maximized_height and nonfs_window.
711 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
712 tbar_height.
713 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
714 fullscreen. Set maximized_width/height. Act on next_maximized.
715
716 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
717 (EmacsView): Add variables for fullscreen.
718 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
719 (EmacsFSWindow): New interface for fullscreen.
720
427730eb
JB
7212012-09-30 Juanma Barranquero <lekktu@gmail.com>
722
723 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
724
48de8b12
CY
7252012-09-30 Chong Yidong <cyd@gnu.org>
726
727 * fns.c (Frandom): Doc fix.
728
5938d519
MR
7292012-09-30 Martin Rudalics <rudalics@gmx.at>
730
731 * window.c (Vwindow_combination_limit): New default value.
732 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
733
cb5b0266
PE
7342012-09-30 Paul Eggert <eggert@cs.ucla.edu>
735
736 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
737 Suggested by Eli Zaretskii in
738 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
739
84f72efd
EZ
7402012-09-30 Eli Zaretskii <eliz@gnu.org>
741
742 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
743 HAVE_TIMER_SETTIME is defined.
744
9d4dcdc9
PE
7452012-09-30 Paul Eggert <eggert@cs.ucla.edu>
746
d89460ed
PE
747 Profiler improvements: more-accurate timers, overflow checks.
748 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
749 signal.h, setjmp.h. Include systime.h instead.
750 (saturated_add): New function.
751 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
752 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
753 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
754 New static vars.
84f72efd 755 (enum profiler_cpu_running): New enum.
d89460ed
PE
756 (profiler_cpu_running): Now of that enum type, not bool.
757 All uses changed to store the new value.
758 (handle_profiler_signal): Rename from sigprof_handler_1,
759 for consistency with other handlers. Do not check whether
760 cpu_log is a hash-table if garbage collecting, since it
761 doesn't matter in that case.
762 (deliver_profiler_signal): Rename from sigprof_handler,
763 for consistency with other handlers.
764 (setup_cpu_timer): New function, with much of what used to be in
765 Fprofiler_cpu_start. Check for out-of-range argument.
766 Prefer timer_settime if available, and prefer
767 thread cputime clocks, then process cputime clocks, then
768 monotonic clocks, to the old realtime clock. Use make_timeval
769 to round more-correctly when falling back to setitimer.
770 (Fprofiler_cpu_start): Use it.
771 (Fprofiler_cpu_stop): Prefer timer_settime if available.
772 Don't assume that passing NULL as the 2nd argument of setitimer
773 is the same as passing a pointer to all-zero storage.
774 Ignore SIGPROF afterwards.
775 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
776 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
777 non-fatal signal handlers. Ignore SIGPROF on startup.
778 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
779 in profiler.c, since sysdep.c now uses it.
780
9d4dcdc9
PE
781 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
782 Suggested by Eli Zaretskii in
783 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
784
8e5691a0
JB
7852012-09-29 Juanma Barranquero <lekktu@gmail.com>
786
787 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
788
e7c1b6ef
SM
7892012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
790
791 * lisp.h (struct backtrace): Remove indirection for `function' field.
792 * xdisp.c (redisplay_internal):
793 * profiler.c (record_backtrace, sigprof_handler_1):
794 * alloc.c (Fgarbage_collect):
795 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
796 (Fbacktrace_frame): Adjust accordingly.
797
e61d39cd 7982012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
799
800 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
801 (Frun_hook_with_args_until_failure): Doc fixes.
802
404043ea
EZ
8032012-09-28 Eli Zaretskii <eliz@gnu.org>
804
805 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
806 Qautomatic_redisplay and change the symbol name. All users changed.
807
704d3f45
TM
8082012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
809
810 * profiler.c (sigprof_handler): Fix race condition.
811
757140ff
GM
8122012-09-28 Glenn Morris <rgm@gnu.org>
813
814 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
815
a615a3ae
PE
8162012-09-27 Paul Eggert <eggert@cs.ucla.edu>
817
818 Check more robustly for timer_settime.
89d17fd0
PE
819 * Makefile.in (LIB_TIMER_TIME): New macro.
820 (LIBES): Add it.
a615a3ae
PE
821 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
822 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
823 call timer_settime.
824
3670daf7
TM
8252012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
826
827 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
828
6a586b7f
JB
8292012-09-26 Juanma Barranquero <lekktu@gmail.com>
830
831 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
832
41c8bfcf
PE
8332012-09-26 Paul Eggert <eggert@cs.ucla.edu>
834
835 * character.h (MAYBE_UNIFY_CHAR): Remove.
836 * charset.c, charset.h (maybe_unify_char): Now static.
837 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
838 Since this stuff is now private to charset.c, there's no need for
839 a public macro and no need to inline by hand.
840
3a880af4
SM
8412012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
842 Stefan Monnier <monnier@iro.umontreal.ca>
843 Juanma Barranquero <lekktu@gmail.com>
611b7507 844
3a880af4
SM
845 * profiler.c: New file.
846 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
847 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
848 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
849 * emacs.c (main): Call syms_of_profiler.
850 * alloc.c (Qautomatic_gc): New constant.
851 (MALLOC_PROBE): New macro.
852 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
853 (total_bytes_of_live_objects): New function.
854 (Fgarbage_collect): Use it. Record itself in backtrace_list.
855 Call malloc_probe for the memory profiler.
856 (syms_of_alloc): Define Qautomatic_gc.
857 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
858 race condition.
859 (struct backtrace): Move definition...
860 * lisp.h (struct backtrace): ..here.
861 (Qautomatic_gc, profiler_memory_running): Declare vars.
862 (malloc_probe, syms_of_profiler): Declare functions.
863 * xdisp.c (Qautomatic_redisplay): New constant.
864 (redisplay_internal): Record itself in backtrace_list.
865 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 866
5938d519 8672012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
8682012-09-25 Juanma Barranquero <lekktu@gmail.com>
869
870 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
871
e26fd2e4
PE
8722012-09-25 Paul Eggert <eggert@cs.ucla.edu>
873
874 Prefer POSIX timers if available.
875 They avoid a race if the timer is too close to the current time.
876 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
877 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 878 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 879
eedec3ee
EZ
8802012-09-25 Eli Zaretskii <eliz@gnu.org>
881
882 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
883 CHAR_STRING_ADVANCE.
884 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
885 STRING_CHAR_ADVANCE.
886
aa15c6bb
JB
8872012-09-25 Juanma Barranquero <lekktu@gmail.com>
888
889 Move Vlibrary_cache to emacs.c and reset before dumping.
890
891 * lisp.h (reset_image_types): Declare.
892 [WINDOWSNT] (Vlibrary_cache): Declare.
893
894 * image.c (reset_image_types): New function.
895
896 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
897 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
898 (Fdump_emacs): Reset Vlibrary_cache and image_types.
899
900 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
901 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
902
903 * w32.h (Vlibrary_cache): Do not declare.
904
54d629be
EZ
9052012-09-25 Eli Zaretskii <eliz@gnu.org>
906
16b22fef
EZ
907 * w32proc.c (sys_signal): Handle all signals defined by the
908 MS-Windows runtime, not just SIGCHLD. Actually install the signal
909 handlers for signals supported by Windows. Don't override
910 term_ntproc as the handler for SIGABRT.
911 (sigaction): Rewrite to call sys_signal instead of duplicating its
912 code.
913 (sys_kill): Improve commentary.
914
915 * w32.c (term_ntproc): Accept (and ignore) one argument, for
916 consistency with a signature of a signal handler. All callers
917 changed.
918 (init_ntproc): Accept an argument DUMPING. If dumping, don't
919 install term_ntproc as a signal handler for SIGABRT, as that
920 should be done by the dumped Emacs.
921
922 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
923
924 * w32select.c (term_w32select): Protect against repeated
925 invocation by setting clipboard_owner to NULL after calling
926 DestroyWindow.
927
928 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
929 and term_ntproc to their modified signatures.
930
54d629be
EZ
931 * character.c (char_string, string_char): Remove calls to
932 MAYBE_UNIFY_CHAR. See the discussion starting at
933 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
934 for the details.
935
59f7af81
CY
9362012-09-25 Chong Yidong <cyd@gnu.org>
937
938 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
939
22e8cf4a
SM
9402012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
941
942 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
943 when encountering an unknown bytecode.
944
578098f3
PE
9452012-09-24 Paul Eggert <eggert@cs.ucla.edu>
946
947 image.c, indent.c: Use bool for booleans.
948 * dispextern.h (struct image_type): Members valid_p, load, init
949 now return bool, not int. All uses changed.
950 * image.c: Omit unnecessary static decls.
951 (x_create_bitmap_mask, x_build_heuristic_mask):
952 Return void, not int, since callers don't care about the return value.
953 (x_create_bitmap_mask, define_image_type, valid_image_p)
954 (struct image_keyword, parse_image_spec, image_spec_value)
955 (check_image_size, image_background)
956 (image_background_transparent, x_clear_image_1)
957 (postprocess_image, lookup_image, x_check_image_size)
958 (x_create_x_image_and_pixmap, xbm_image_p)
959 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
960 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
961 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
962 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
963 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
964 (png_image_p, init_png_functions, png_load_body, png_load)
965 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
966 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
967 (init_gif_functions, gif_load, imagemagick_image_p)
968 (imagemagick_load_image, imagemagick_load, svg_image_p)
969 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
970 (gs_load):
971 * nsimage.m (ns_load_image):
972 * nsterm.m (ns_defined_color):
973 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
974 * xfns.c (x_defined_color):
975 * xterm.c (x_alloc_lighter_color_for_widget)
976 (x_alloc_nearest_color_1, x_alloc_nearest_color)
977 (x_alloc_lighter_color):
978 * indent.c (disptab_matches_widthtab, current_column)
979 (scan_for_column, string_display_width, indented_beyond_p)
980 (compute_motion, vmotion, Fvertical_motion):
981 Use bool for booleans.
982
a5f2b6ec
CY
9832012-09-24 Chong Yidong <cyd@gnu.org>
984
985 * chartab.c (Fset_char_table_default): Obsolete function removed.
986
18e27ea8
PE
9872012-09-23 Paul Eggert <eggert@cs.ucla.edu>
988
afea8a8a
PE
989 Move pid_t related decls out of lisp.h.
990 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
991 (interruptible_wait_for_termination):
992 Move these decls from lisp.h to syswait.h, since they use pid_t.
993 Needed on FreeBSD; see Herbert J. Skuhra in
994 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
995 * callproc.c: Include syswait.h.
996
18e27ea8
PE
997 gnutls.c, gtkutil.c: Use bool for boolean.
998 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
999 (emacs_gnutls_handle_error):
1000 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1001 (xg_hide_tooltip, xg_create_frame_widgets)
1002 (create_dialog, xg_uses_old_file_dialog)
1003 (xg_get_file_with_chooser, xg_get_file_with_selection)
1004 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1005 (xg_item_label_same_p, xg_update_menubar)
1006 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1007 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1008 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1009 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1010 (update_frame_tool_bar, free_frame_tool_bar):
1011 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1012 * nsmenu.m (ns_update_menubar):
1013 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1014 * xfns.c (Fx_show_tip) [USE_GTK]:
1015 Use bool for boolean.
1016 * gtkutil.c (xg_update_frame_menubar):
1017 * xmenu.c (update_frame_menubar):
1018 Return void, not int, since caller ignores return value.
1019 * gtkutil.c (xg_change_toolbar_position):
1020 Return void, not 1.
1021
af0e9f75
JB
10222012-09-23 Juanma Barranquero <lekktu@gmail.com>
1023
1024 * makefile.w32-in (BLOCKINPUT_H): Remove.
1025 (SYSSIGNAL_H): New macro.
1026 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1027 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1028 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1029 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1030 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1031 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1032 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1033 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1034 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1035 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1036 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1037 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1038 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1039 ($(BLD)/w32xfns.$(O)): Update dependencies.
1040
5101529e
EZ
10412012-09-23 Eli Zaretskii <eliz@gnu.org>
1042
1043 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1044 fatal_error_backtrace.
1045
1046 * w32proc.c (sys_kill): Undo last change: don't do anything when
1047 invoked to deliver SIGABRT to our own process. This is now
1048 handled by emacs_raise.
1049
2c3ee0ad
JB
10502012-09-23 Juanma Barranquero <lekktu@gmail.com>
1051
1052 * w32term.c (w32_read_socket): Remove leftover reference to
1053 interrupt_input_pending.
1054
62a1d661
PE
10552012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1056
1057 Do not use SA_NODEFER.
1058 Problem reported by Dani Moncayo in
1059 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1060 * alloc.c (die):
1061 * sysdep.c (emacs_abort): Do not reset signal handler.
1062 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1063 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1064 wanted even on POSIXish hosts, and it doesn't work on Windows.
1065
a0942b9a
JD
10662012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1067
1068 * xterm.c (x_term_init): Call fixup_locale before and after calling
1069 gtk_init (Bug#12392).
1070
d07ff9db
CY
10712012-09-23 Chong Yidong <cyd@gnu.org>
1072
1073 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1074 Vdynamic_library_alist.
1075
1076 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1077 (Fgnutls_available_p): Caller changed.
1078
1079 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1080 (Flibxml_parse_xml_region): Likewise.
1081
1082 * dispextern.h (struct image_type): Remove arg from init function.
1083
1084 * image.c (Finit_image_library, lookup_image_type)
1085 (define_image_type): Remove now-unneeded second arg.
1086 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1087 (init_tiff_functions, init_gif_functions, init_svg_functions):
1088 Arglist and w32_delayed_load calling convention changed.
1089 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 1090 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 1091
4d7e6e51
PE
10922012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1093
1094 Simplify and avoid signal-handling races (Bug#12471).
1095 * alloc.c (die):
1096 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1097 Avoid recursive loop if there's a fatal error in the function itself.
1098 * atimer.c (pending_atimers):
1099 * blockinput.h: Don't include "atimer.h"; no longer needed.
1100 (interrupt_input_pending): Remove. All uses removed.
1101 pending_signals now counts both atimers and ordinary interrupts.
1102 This is less racy than having three separate pending-signal flags.
1103 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1104 (input_blocked_p):
1105 Rename from their upper-case counterparts BLOCK_INPUT,
1106 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1107 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1108 This makes it easier to access volatile variables more accurately.
1109 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1110 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1111 that's more reliable if the code is buggy and sets
1112 interrupt_input_blocked to a negative value. All uses changed.
1113 * atimer.c (deliver_alarm_signal):
1114 Remove. No need to deliver this to the parent; any thread can
1115 handle this signal now. All uses replaced by underlying handler.
1116 * atimer.c (turn_on_atimers):
1117 * dispnew.c (handle_window_change_signal):
1118 * emacs.c (handle_danger_signal):
1119 * keyboard.c (kbd_buffer_get_event):
1120 Don't reestablish signal handler; not needed with sigaction.
1121 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1122 (UNBLOCK_INPUT_TO):
1123 Rework to avoid unnecessary accesses to volatile variables.
1124 (UNBLOCK_INPUT_TO): Now a function.
1125 (totally_unblock_input, unblock_input): New decls.
1126 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1127 (init_data): Remove. Necessary stuff now done in init_signal.
1128 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1129 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1130 (fatal_error_code): Remove; no longer needed.
1131 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1132 it doesn't always backtrace. All uses changed. No need to reset
1133 signal to default, since sigaction and/or die does that for us now.
1134 Use emacs_raise (FOO), not kill (getpid (), FOO).
1135 (main): Check more-accurately whether we're dumping.
1136 Move fatal-error setup to sysdep.c
1137 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1138 * gtkutil.c (xg_get_file_name, xg_get_font):
1139 Remove no-longer-needed signal-mask manipulation.
1140 * keyboard.c, process.c (POLL_FOR_INPUT):
1141 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1142 * keyboard.c (read_avail_input): Remove.
1143 All uses replaced by gobble_input.
1144 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1145 (kbd_buffer_store_event_hold, gobble_input):
1146 (record_asynch_buffer_change) [USABLE_SIGIO]:
1147 (store_user_signal_events):
1148 No need to mess with signal mask.
1149 (gobble_input): If blocking input and there are terminals, simply
1150 set pending_signals to 1 and return. All hooks changed to not
1151 worry about whether input is blocked.
1152 (process_pending_signals): Clear pending_signals before processing
1153 them, in case a signal comes in while we're processing.
1154 By convention callers now test pending_signals before calling us.
1155 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
1156 New functions, to support changes to blockinput.h.
1157 (handle_input_available_signal): Now extern.
1158 (reinvoke_input_signal): Remove. All uses replaced by
1159 handle_async_input.
1160 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
1161 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
1162 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
1163 Clear sigmask reliably, even if Fsignal returns, which it can.
1164 Omit unnecessary accesses to volatile var.
1165 (quit_throw_to_read_char): No need to restore sigmask.
1166 * keyboard.c (gobble_input, handle_user_signal):
1167 * process.c (wait_reading_process_output):
1168 Call signal-handling code rather than killing ourselves.
1169 * lisp.h: Include <float.h>, for...
1170 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
1171 (pending_signals): Now volatile.
1172 (syms_of_data): Now const if IEEE floating point.
1173 (handle_input_available_signal) [USABLE_SIGIO]:
1174 (terminate_due_to_signal, record_child_status_change): New decls.
1175 * process.c (create_process): Avoid disaster if memory is exhausted
1176 while we're processing a vfork, by tightening the critical section
1177 around the vfork.
1178 (send_process_frame, process_sent_to, handle_pipe_signal)
1179 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
1180 ignores SIGPIPE.
1181 (send_process): No need for setjmp/longjmp any more, since the
1182 SIGPIPE stuff is now gone. Instead, report an error if errno
1183 is EPIPE.
1184 (record_child_status_change): Now extern. PID and W are now args.
1185 Return void, not bool. All callers changed.
1186 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
1187 Remove. All uses removed. This bug should be fixed now in a
1188 different way.
1189 (wait_for_termination_1): Use waitpid rather than sigsuspend,
1190 and record the child status change directly. This avoids the
1191 need to futz with the signal mask.
1192 (process_fatal_action): Move here from emacs.c.
1193 (emacs_sigaction_flags): New function, containing
1194 much of what used to be in emacs_sigaction_init.
1195 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
1196 caught by emacs, to make races less likely.
1197 (deliver_process_signal): Rename from handle_on_main_thread.
1198 All uses changed.
1199 (BACKTRACE_LIMIT_MAX): Now at top level.
1200 (thread_backtrace_buffer, threadback_backtrace_pointers):
1201 New static vars.
1202 (deliver_thread_signal, deliver_fatal_thread_signal):
1203 New functions, for more-accurate delivery of thread-specific signals.
1204 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
1205 (deliver_arith_signal): Handle in this thread, not
1206 in the main thread, since it's triggered by this thread.
1207 (maybe_fatal_sig): New function.
1208 (init_signals): New arg DUMPING so that we can be more accurate
1209 about whether we're dumping. Caller changed.
1210 Treat thread-specific signals differently from process-general signals.
1211 Block all signals while handling fatal error; that's safer.
1212 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
1213 on IEEE hosts.
1214 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
1215 Ignore SIGPIPE unless batch.
1216 (emacs_backtrace): Output backtrace for the appropriate thread,
1217 which is not necessarily the main thread.
1218 * syssignal.h: Include <stdbool.h>.
1219 (emacs_raise): New macro.
1220 * xterm.c (x_connection_signal): Remove; no longer needed
1221 now that we use sigaction.
1222 (x_connection_closed): No need to mess with sigmask now.
1223 (x_initialize): No need to reset SIGPIPE handler here, since
1224 init_signals does this for us now.
1225
8f4635e9
JD
12262012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1227
1228 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 1229 background rect may be larger (Bug#12245).
8f4635e9 1230
3296976d
CY
12312012-09-23 Chong Yidong <cyd@gnu.org>
1232
1233 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
1234
d41e491e
PE
12352012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1236
1237 * .gdbinit: Just stop at fatal_error_backtrace.
1238 See Stefan Monnier's request in
1239 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
1240 Remove no-longer-used query of system type.
1241
c88b867f
CY
12422012-09-22 Chong Yidong <cyd@gnu.org>
1243
1244 * search.c (Freplace_match): Doc fix (Bug#12325).
1245
1246 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
1247
1248 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
1249 (Fline_end_position): Doc fix.
1250
1251 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
1252
bb4d86b4
CY
12532012-09-22 Chong Yidong <cyd@gnu.org>
1254
1255 * dispextern.h (struct image_type): Add new slot, storing a type
1256 initialization function.
1257
1258 * image.c (define_image_type): Call the image initializer function
1259 if it is defined. Arguments and return value changed.
1260 (valid_image_p, make_image): Callers changed.
1261 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
1262 (gif_type, imagemagick_type, svg_type, gs_type):
1263 Add initialization functions.
bb4d86b4
CY
1264 (Finit_image_library): Call lookup_image_type.
1265 (CHECK_LIB_AVAILABLE): Macro deleted.
1266 (lookup_image_type): Call define_image_type here, rather than via
1267 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
1268 (syms_of_image): Move define_image_type calls for xbm_type and
1269 pbm_type to lookup_image_type.
1270
df9685f3
EZ
12712012-09-22 Eli Zaretskii <eliz@gnu.org>
1272
1273 * keyboard.c (timer_check_2): Move calculation of 'timers' and
1274 'idle_timers' from here ...
1275 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
1276 lists, to avoid infloops when the timer does something stupid,
1277 like reinvoke itself with the same or smaller time-out.
1278 (Bug#12447)
1279
8e17c9ba
MR
12802012-09-22 Martin Rudalics <rudalics@gmx.at>
1281
1282 * window.c (Fsplit_window_internal): Handle only Qt value of
1283 Vwindow_combination_limit separately.
1284 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
1285 (Vwindow_combination_limit): New default value.
1286 Rewrite doc-string.
8e17c9ba 1287
589bd69b
EZ
12882012-09-22 Eli Zaretskii <eliz@gnu.org>
1289
1290 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
1291 the new overlay string. (Bug#10159)
1292
01108e3f
PE
12932012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1294
1295 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
1296 or that fprintf is async-signal-safe. POSIX doesn't require
1297 either assumption.
1298
82f8cd94
CY
12992012-09-22 Chong Yidong <cyd@gnu.org>
1300
1301 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
1302 (Bug#8207).
1303
3cccbd87
KH
13042012-09-22 Kenichi Handa <handa@gnu.org>
1305
1306 * composite.c (composition_reseat_it): Handle the case that a
1307 grapheme cluster is not covered by a single font (Bug#12352).
1308
09c01941
CY
13092012-09-21 Chong Yidong <cyd@gnu.org>
1310
1311 * image.c (define_image_type): Avoid adding duplicate types to
1312 image_types (Bug#12463). Suggested by Jörg Walter.
1313
acfa068f 13142012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
1315
1316 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
1317 (print_load_command_name): Add case LC_DATA_IN_CODE.
1318 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
1319
acfa068f 13202012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
1321
1322 * eval.c (Frun_hook_with_args_until_success)
1323 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
1324
acfa068f 13252012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
1326
1327 * fileio.c (Ffile_selinux_context): Only call freecon when
1328 lgetfilecon succeeded.
1329 (Fset_file_selinux_context): Likewise. (Bug#12444)
1330
acfa068f 13312012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
1332
1333 * xdisp.c (try_window_reusing_current_matrix): Under bidi
1334 reordering, locate the cursor by calling set_cursor_from_row; if
1335 that fails, clear the desired glyph matrix before returning a
1336 failure indication to the caller. Fixes leaving garbled display
1337 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
1338 (compute_stop_pos_backwards): Fix a typo that caused crashes while
1339 scrolling through multibyte text.
aa36e4d2 1340
e99f70c8
SM
13412012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
1342
1343 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
1344 calling mark_vectorlike since that's the one that marks the window.
1345 (mark_discard_killed_buffers): Mark the final cdr.
1346 * window.h (struct window): Move prev/next_buffers to the
1347 non-standard fields.
1348 * window.c (make_window): Initialize prev/next_buffers manually.
1349
f75beb47
PE
13502012-09-20 Paul Eggert <eggert@cs.ucla.edu>
1351
1352 Omit unused arg EXPECTED from socket hooks.
1353 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1354 * nsterm.m (ns_term_init):
1355 * termhooks.h (struct terminal.read_socket_hook):
1356 * w32inevt.c (w32_console_read_socket):
1357 * w32term.c (w32_read_socket):
1358 * xterm.c (XTread_socket):
1359 Omit unused arg EXPECTED. All callers changed.
1360 (store_user_signal_events): Return void, not int, since callers no
1361 longer care about the return value. All uses changed.
1362
b019b76a
JB
13632012-09-20 Juanma Barranquero <lekktu@gmail.com>
1364
1365 * w32gui.h (XParseGeometry): Do not declare.
1366
05642592
PE
13672012-09-19 Paul Eggert <eggert@cs.ucla.edu>
1368
e4bce92a
PE
1369 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1370 Ignore 'expected'. See Eli Zaretskii in
1371 <http://bugs.gnu.org/12471#8> (last line).
1372
05642592
PE
1373 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
1374 (XParseGeometry): Now static. Substitute extremal values for
1375 values that are out of range.
1376
e543ae91
JD
13772012-09-19 Jan Djärv <jan.h.d@swipnet.se>
1378
1379 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1380
1381 * nsfns.m (XParseGeometry): Remove.
1382 (Fx_create_frame): Call x_set_offset to correctly interpret
1383 top_pos in geometry.
1384
3a880af4 1385 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
1386 (Fx_parse_geometry): If there is a space in string, call
1387 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1388
45ba16c7
EZ
13892012-09-17 Eli Zaretskii <eliz@gnu.org>
1390
c8b9f1bc
EZ
1391 * search.c (scan_buffer): Use character positions in calls to
1392 region_cache_forward and region_cache_backward, not byte
1393 positions. (Bug#12196)
1394
b4c932a2
EZ
1395 * w32term.c (w32_read_socket): Set pending_signals to 1, like
1396 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
1397
45ba16c7
EZ
1398 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1399 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1400 emacs_blocked_malloc, now deleted.
1401
eeceac93
PE
14022012-09-17 Paul Eggert <eggert@cs.ucla.edu>
1403
1404 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1405 The workaround was for improving performance on Solaris 2.4, but
1406 is getting in the way now. Emacs will still work if someone is
1407 still running Solaris 2.4 in a museum somewhere; Sun dropped
1408 support for Solaris 2.4 in 2003.
1409 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1410 * process.c (create_process) [HAVE_WORKING_VFORK]:
1411 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1412 since Emacs no longer uses vfork on that platform.
1413
78f83752
GM
14142012-09-17 Glenn Morris <rgm@gnu.org>
1415
1416 * emacs.c: Use COPYRIGHT.
1417
634b8cac
PE
14182012-09-16 Paul Eggert <eggert@cs.ucla.edu>
1419
0caaedb1
PE
1420 Remove configure's --without-sync-input option (Bug#12450).
1421 When auditing signal-handling in preparation for cleaning it up,
1422 I found that SYNC_INPUT has race conditions and would be a real
1423 pain to fix. Since it's an undocumented and deprecated
1424 configure-time option, now seems like a good time to remove it.
1425 Also see <http://bugs.gnu.org/11080#16>.
1426 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1427 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1428 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1429 (malloc_hysteresis):
1430 (check_depth) [XMALLOC_OVERRUN_CHECK]:
1431 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1432 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1433 (dont_register_blocks, bytes_used_when_reconsidered)
1434 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1435 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1436 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1437 Remove. All uses removed.
1438 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1439 implementation, one that depends on whether the new macro
1440 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1441 is defined.
1442 * atimer.c (run_timers, handle_alarm_signal):
1443 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1444 (handle_async_input, process_pending_signals)
1445 (handle_input_available_signal, init_keyboard):
1446 * nsterm.m (ns_read_socket):
1447 * process.c (wait_reading_process_output):
1448 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1449 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1450 (emacs_write):
1451 * xterm.c (XTread_socket):
1452 Assume SYNC_INPUT.
1453 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1454 * eval.c (handling_signal): Remove. All uses removed.
1455 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1456 All uses replaced with the SYNC_INPUT version.
1457 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1458 Remove decls.
1459 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1460 Now static.
1461
634b8cac
PE
1462 * font.c (Ffont_shape_gstring): Remove unused local.
1463
83da1b55
GM
14642012-09-16 Glenn Morris <rgm@gnu.org>
1465
518650a5
GM
1466 * Makefile.in (clean): No longer run nextstep's clean.
1467
83da1b55
GM
1468 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1469 (ns_frag): Remove.
1470 (ns-app): Move here from ns.mk, and simplify.
1471 (clean): Simplify nextstep entry.
1472 * ns.mk: Remove file.
1473
85a43e2e
KH
14742012-09-17 Kenichi Handa <handa@gnu.org>
1475
1476 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1477 not covert the last few charactes.
1478
ba13e616 14792012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
1480
1481 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1482 here, but just check the validity of glyphs in the glyph-string.
1483
a8c729af
MR
14842012-09-16 Martin Rudalics <rudalics@gmx.at>
1485
3a880af4
SM
1486 * window.c (Fwindow_parameter, Fset_window_parameter):
1487 Accept any window as argument (Bug#12452).
a8c729af 1488
c077c059
JD
14892012-09-16 Jan Djärv <jan.h.d@swipnet.se>
1490
1491 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1492 to ns_term_init to avoid memory leak.
1493
1494 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
1495 explicit retain/release.
1496 (ns_term_init): Only allow one display. Initialize outerpool and
1497 ns_*_types.
1498
39a57ad0
PE
14992012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1500
1501 Port _setjmp fix to POSIXish hosts as well as Microsoft.
1502 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
1503 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
1504 the Microsoft problem in a different way, by altering ../nt/config.nt.
1505
7105c8cb
EZ
15062012-09-15 Eli Zaretskii <eliz@gnu.org>
1507
1508 * w32xfns.c:
1509 * w32uniscribe.c:
1510 * w32term.c:
1511 * w32select.c:
1512 * w32reg.c:
1513 * w32proc.c:
1514 * w32menu.c:
1515 * w32inevt.c:
1516 * w32heap.c:
1517 * w32font.c:
1518 * w32fns.c:
1519 * w32console.c:
1520 * w32.c:
1521 * w16select.c: Remove inclusion of setjmp.h, as it is now included
1522 by lisp.h. This completes removal of setjmp.h inclusion
1523 erroneously announced in the previous commit. (Bug#12446)
1524
1525 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
1526 more accurate.
1527
1528 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
1529 not defined as a macro. The latter happens on MS-Windows.
1530 (Bug#12446)
1531
0328b6de
PE
15322012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1533
1534 Port better to POSIX hosts lacking _setjmp (Bug#12446).
1535 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 1536 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
1537 only reason for the instance was because "lisp.h" was included.
1538 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
1539 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
1540 and _longjmp with the new symbols. Emacs already uses _setjmp if
1541 available, so this change affects only POSIXish hosts that have
1542 sigsetjmp but not _setjmp, such as some versions of Solaris and
1543 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
1544 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
1545 (png_load_body) [HAVE_PNG]:
1546 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
1547 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
1548 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
1549 since PNG requires jmp_buf. This is the only exception to the
1550 general rule that we now use sys_setjmp and sys_longjmp.
1551 This exception is OK since this code does not change the signal
1552 mask or longjmp out of a signal handler.
1553
2af03429
PE
15542012-09-14 Paul Eggert <eggert@cs.ucla.edu>
1555
1556 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1557 Include "syssignal.h", for 'main_thread'.
1558
2f294edf
DA
15592012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
1560
1561 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
1562 * insdel.c (replace_range, replace_range_2):
1563 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
1564 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1565 Remove redundant check before calling offset_intervals.
1566
6b533e9c
MR
15672012-09-14 Martin Rudalics <rudalics@gmx.at>
1568
1569 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1570 current buffer (Bug#12387).
1571
2a7931e3
JB
15722012-09-14 Juanma Barranquero <lekktu@gmail.com>
1573
1574 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1575
c18e885b
PE
15762012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1577
1578 Use a more backwards-compatible timer format (Bug#12430).
1579 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1580 vector element, not from the 4th, since PSECS is now at the end.
1581 (Fcurrent_idle_time): Doc fix.
1582
d59a1afb
DA
15832012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
1584
1585 Function to mark objects and remove killed buffers at once.
1586 * alloc.c (discard_killed_buffers): Rename to ...
1587 (mark_discard_killed buffers) ... new name. Add marking
1588 of remaining objects. Fix comment. Adjust users.
1589 (mark_object): Do not touch frame buffer lists here.
1590 * frame.c (delete_frame): Reset frame buffer lists here.
1591
5f0cb45a
PE
15922012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1593
8ea47e3a
PE
1594 Better workaround for GNOME bug when --enable-gcc-warnings.
1595 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1596 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
1597 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1598
4a4bbad2
PE
1599 Simplify SIGIO usage (Bug#12408).
1600 The code that dealt with SIGIO was crufty and confusing, e.g., it
1601 played tricks like "#undef SIGIO" but these tricks were not used
1602 consistently. Simplify mostly by not #undeffing standard symbols,
1603 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1604 or not as we please) rather than "defined SIGIO" (standard symbol
1605 that we probably shouldn't #undef).
1606 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1607 Modules that need it can include it.
1608 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1609 * dispextern.h (ignore_sigio): New decl.
1610 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1611 unconditionally, since it's now a no-op if !USABLE_SIGIO.
1612 * emacs.c (shut_down_emacs):
1613 * keyboard.c (kbd_buffer_store_event_hold):
1614 Use ignore_sigio rather than invoking 'signal' directly.
1615 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1616 for FIONREAD.
1617 (FIONREAD, SIGIO): Do not #undef.
1618 (tty_read_avail_input): Use #error rather than a syntax error.
1619 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1620 for I_PIPE, used by SETUP_SLAVE_PTY.
1621 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1622 * sysdep.c (croak): Remove; no longer needed. This bit of
1623 temporary code, with Fred N. Fish's comment that it's temporary,
1624 has been in Emacs since at least 1992!
1625 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1626 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1627 * syssignal.h (croak): Remove decl.
1628 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1629 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1630 now that we're termios-only.
1631 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1632 * term.c (dissociate_if_controlling_tty): Use #error rather than
1633 a run-time error.
1634
5f0cb45a
PE
1635 Work around GCC and GNOME bugs when --enable-gcc-warnings.
1636 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1637 to work around GNOME bug 683906.
1638 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1639 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1640 This works around GCC bug 54561.
1641
40bce90b
PE
16422012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1643
1644 More fixes for 'volatile' and setjmp/longjmp.
1645 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1646 * image.c (struct png_load_context) [HAVE_PNG]: New type.
1647 (png_load_body) [HAVE_PNG]:
1648 (jpeg_load_body) [HAVE_JPEG]:
1649 New function, with most of the old parent function's body.
1650 (png_load) [HAVE_PNG]:
1651 (jpeg_load) [HAVE_JPEG]:
1652 Invoke the new function, to avoid longjmp munging our locals.
1653 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
1654 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
1655 longjmp is passed 2, as the C standard doesn't guarantee this.
1656 Instead, store the failure code into mgr->failure_code.
1657
bfeae2cf
SM
16582012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1659
1660 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
1661 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
1662 (syms_of_keyboard): Remove support for unread-command-char.
1663
8099e36b
EZ
16642012-09-12 Eli Zaretskii <eliz@gnu.org>
1665
1666 * w32proc.c (sys_kill): If PID is our process ID and the signal is
1667 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
1668 violation. (Bug#12426)
1669
92547ff9
PE
16702012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1671
1672 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
1673
45b82ad0
SM
16742012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1675
1676 * eval.c: Add `inhibit-debugger'.
1677 (Qinhibit_debugger): New symbol.
1678 (call_debugger): Bind it instead of Qdebug_on_error.
1679 (maybe_call_debugger): Test Vinhibit_debugger.
1680 (syms_of_eval): Define inhibit-debugger.
1681 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1682 (syms_of_xdisp): Remove inhibit-debug-on-message.
1683
5779a1dc
PE
16842012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1685
50f2e553
PE
1686 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1687 If a nonvolatile local variable is written before a _longjmp to
1688 the frame containing the variable, and is read after the _longjmp,
1689 the value read is indeterminate. Some local variables of type
1690 'struct handler' and 'struct catchtag' are used in this way, so
1691 mark each of their slots as volatile if the slot can be set before
1692 _longjmp and read afterwards.
1693 * lisp.h (struct handler): var and chosen_clause are now volatile.
1694 (struct catchtag): val, next, and pdlcount are now volatile.
1695
ae1d87e2
PE
1696 * bidi.c (bidi_push_it, bidi_pop_it):
1697 * fns.c (copy_hash_table):
1698 * image.c (define_image_type):
1699 * keyboard.c (kbd_buffer_store_event_hold):
1700 * process.c (Fprocess_send_eof):
1701 * xfaces.c (x_create_gc) [HAVE_NS]:
1702 * xgselect.c (xg_select):
1703 Prefer assignment to memcpy when either will do.
1704
5779a1dc
PE
1705 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1706 Use pointer-to-a-pointer to simplify and avoid a NILP check each
1707 time an item is removed. No need to mark this function 'inline';
1708 the compiler knows better than we do.
1709
c4c9756b
JD
17102012-09-11 Jan Djärv <jan.h.d@swipnet.se>
1711
1712 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1713 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1714 to change_frame_size (Bug#12388).
1715 (windowDidResize:): Pass YES to updateFrameSize.
1716
1717 * nsterm.h: Add delay parameter to updateFrameSize.
1718
d73e321c
DA
17192012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1720
1721 Discard killed buffers from deleted window and frame objects.
1722 This reduces an amount of references to killed buffers and
1723 helps GC to reclaim them faster.
1724 * alloc.c (discard_killed_buffers): New function.
1725 (mark_object): Use it for deleted windows and frames.
1726 (mark_object): If symbol's value is set up for a killed buffer
1727 or deleted frame, restore it's global binding.
1728 * data.c (swap_in_global_binding): Add GC notice.
1729 (swap_in_symval_forwarding): Use convenient set_blv_where.
1730 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1731 * window.h: ... to here.
1732
e578f381
DA
17332012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1734
1735 Convenient macro to check whether the buffer is live.
1736 * buffer.h (BUFFER_LIVE_P): New macro.
1737 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1738 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1739
3057e615
YM
17402012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1741
1742 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1743 composition cases (Bug#12364).
1744
1745 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1746 overhang of succeeding glyphs overlapping box cursor.
1747
1748 * w32term.c (x_draw_glyph_string): Likewise.
1749
6fda35f2
PE
17502012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1751
c990426a
PE
1752 Simplify, document, and port floating-point (Bug#12381).
1753 The porting part of this patch fixes bugs on non-IEEE platforms
1754 with frexp, ldexp, logb.
1755 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1756 Now static.
1757 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1758 support, by removing commented-out code and briefly listing the
1759 C89 functions excluded. The commented-out stuff was confusing
1760 maintenance, e.g., we thought we needed cbrt but it was commented out.
1761 (logb): Remove decl; no longer needed.
1762 (isfinite): New macro, if not already supplied.
1763 (isnan): Don't replace any existing macro.
1764 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1765 are present on all C89 platforms.
1766 (Ffrexp): Do not special-case zero, as frexp does the right thing
1767 for that case.
1768 (Flogb): Do not use logb, as it doesn't have the desired meaning
1769 on hosts that use non-base-2 floating point. Instead, stick with
1770 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1771 frexp, to avoid getting an unspecified result.
1772
6fda35f2
PE
1773 * xdisp.c (Qinhibit_debug_on_message): Now static.
1774
16130a58
JD
17752012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1776
1777 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1778 NSBezierPath (Bug#12131).
1779
d105a573
CY
17802012-09-10 Chong Yidong <cyd@gnu.org>
1781
1782 * fns.c (Fdelq, Fdelete): Doc fix.
1783
ff55dfe8
PE
17842012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1785
1786 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1787 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1788
e7032e7c
SM
17892012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1790
1791 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1792 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1793 Use it.
1794
e9957956
EZ
17952012-09-09 Eli Zaretskii <eliz@gnu.org>
1796
aba05ce9
EZ
1797 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1798 left fringe if the window has a left margin. This avoids leaving
1799 traces of the cursor because its leftmost pixel is not drawn over.
1800
e9957956
EZ
1801 * dispnew.c (update_window_line): When the left margin area of a
1802 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1803 that screen line. (Bug#12277)
1804
f6196b87
PE
18052012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1806
1807 Assume C89 or later for math functions (Bug#12381).
1808 This simplifies the code, and makes it a bit smaller and faster,
1809 and (most important) makes it easier to clean up signal handling
1810 since we can stop worring about floating-point exceptions in
1811 library code. That was a problem before C89, but the problem
1812 went away many years ago on all practical Emacs targets.
1813 * data.c, image.c, lread.c, print.c:
1814 Don't include <math.h>; no longer needed.
1815 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1816 might be autoconfigured, as that never happens.
1817 * data.c (fmod):
1818 * doprnt.c (DBL_MAX_10_EXP):
1819 * print.c (DBL_DIG):
1820 Remove. C89 or later always defines these.
1821 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1822 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1823 (arith_error, domain_error, domain_error2):
1824 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1825 no longer needed -- we simply return what C returns. All uses removed.
1826 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1827 the wrapped code.
1828 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1829 Remove. All uses expanded, as these macros are no longer used
1830 more than once and are now more trouble than they're worth.
1831 (Ftan): Use tan, not sin / cos.
1832 (Flogb): Assume C89 frexp.
1833 (fmod_float): Assume C89 fmod.
1834 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1835 (init_floatfns): Remove. All uses removed.
1836
9d7f1863
JD
18372012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1838
1839 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1840 compositeToPoint for OSX < 10.6 (Bug#12390).
1841
eabf0404
PE
18422012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1843
1844 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1845 This produces more-accurate results.
1846
0b3b1d23
JD
18472012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1848
1849 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1850 changes (Bug#12088).
1851
6dcef6ec
CY
18522012-09-08 Chong Yidong <cyd@gnu.org>
1853
1854 * syntax.c (Fstring_to_syntax): Doc fix.
1855
aa7d57c5
JD
18562012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1857
1858 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1859 in the internal border.
1860 (x_set_window_size): Remove static variables and their usage.
1861 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
1862 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1863 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
1864 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1865 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1866 (ns_fix_rect_ibw): Remove.
1867 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1868 (ns_dumpglyphs_box_or_relief): Ditto.
1869 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1870 adjustment.
1871 (ns_dumpglyphs_image): Ditto.
fc0c31f8 1872 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
1873 border adjustment.
1874 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1875 their usage. Add fringe_extended_p and its use as in other terms.
1876 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1877 scroll bar was removed.
1878 (updateFrameSize): New function.
1879 (windowDidResize): Move code to updateFrameSize and call it.
1880
1881 * nsterm.h (EmacsView): Add updateFrameSize.
1882
1a5432bc
CY
18832012-09-07 Chong Yidong <cyd@gnu.org>
1884
b4f5313e
CY
1885 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1886
1a5432bc
CY
1887 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1888
1a4f1e9b
PE
18892012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1890
1891 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
1892 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1893 Problem introduced when merging patches. Noted by Eli Zaretskii in
1894 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
1895 * floatfns.c: Comment fix.
1896 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1897 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1898 and anyway the declaration is harmless even if SIGDANGER is not defined.
1899 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1900 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1901 source files not surprisingly expected syssignal.h to define, or
1902 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1903 Include <sys/ioctl.h>, for FIONREAD.
1904 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1905 This eliminates a problem whereby other files mysteriously had
1906 to include "syssignal.h" before including "systty.h" if they
1907 wanted to use "#ifdef SIGIO".
1908
bc8000ff
EZ
19092012-09-07 Eli Zaretskii <eliz@gnu.org>
1910
3e6d6928
EZ
1911 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1912
1913 * w32.c (sigemptyset): Empty the set.
1914 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1915
bc8000ff
EZ
1916 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1917
b4fa72f2
DA
19182012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1919
1920 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1921 (mark_object): Likewise for frame objects.
1922
30730c93
PE
19232012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1924
1925 * syssignal.h (handle_on_main_thread): Always declare,
1926 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1927 This ports to platforms without HAVE_PTHREAD.
1928
2fe28299
PE
19292012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1930
1931 Signal-handler cleanup (Bug#12327).
1932 Emacs's signal handlers were written in the old 4.2BSD style with
1933 sigblock and sigmask and so forth, and this led to some
1934 inefficiencies and confusion. Rewrite these to use
1935 pthread_sigmask etc. without copying signal sets around. Also,
1936 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1937 'signal', and instead use functions that do not attempt to take
1938 over the system name space. This patch causes Emacs's text
1939 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1940 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1941 Do not include <signal.h> or "syssignal.h", as these
1942 modules do not use signals.
1943 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1944 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1945 Do not include <signal.h>, as "syssignal.h" does that for us now.
1946 * atimer.c (sigmask_atimers): New function.
1947 (block_atimers, unblock_atimers): New functions,
1948 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1949 All uses replaced.
1950 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1951 no longer needed here.
1952 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 1953 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
1954 * sysdep.c (struct save_signal): New member 'action', replacing
1955 old member 'handler'.
1956 (save_signal_handlers, restore_signal_handlers):
1957 Use sigaction instead of 'signal' to save and restore.
1958 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1959 New function. All users of 'signal' modified to use set_sighandler
1960 if they're writeonly, and to use sys_signal if they're read+write.
1961 (emacs_sigaction_init, forwarded_signal): New functions.
1962 (sys_signal): Remove. All uses replaced by calls to sigaction
1963 and emacs_sigaction_init, or by direct calls to 'signal'.
1964 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1965 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1966 all uses replaced by pthread_sigmask etc. calls.
1967 * syssignal.h: Include <signal.h>.
1968 (emacs_sigaction_init, forwarded_signal): New decls.
1969 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1970 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1971 (sigmask, sys_sigmask): Remove; no longer needed.
1972 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1973 (sigblock, sigunblock, sigfree):
1974 (sigsetmask) [!defined sigsetmask]:
1975 Remove. All uses replaced by pthread_sigmask.
1976 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1977 no longer need to be replaced, and its typical old uses
1978 are now done via emacs_sigaction_init and sigaction.
1979 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1980 (sys_sigdel): Remove; unused.
1981 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1982
0216c128
EZ
19832012-09-06 Eli Zaretskii <eliz@gnu.org>
1984
1985 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1986 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1987
c752cfa9
DA
19882012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1989
1990 Explicitly mark buffer_defaults and buffer_local_symbols.
1991 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1992 mark_local_symbols here.
1993 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1994 since special buffers aren't marked here any more.
1995 (allocate_buffer): Chain new buffer with all_buffers here...
1996 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1997 not here.
1998 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1999 (syms_of_buffer): Remove staticpro of the above.
2000 (init_buffer_once): Set names for buffer_defaults and
2001 buffer_local_symbols.
2002
a864ef14
PE
20032012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2004
2005 Use bool for booleans in font-related modules.
2006 * font.c (font_intern_prop, font_style_to_value)
2007 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2008 (generate_otf_features, font_check_otf_features, font_check_otf)
2009 (font_match_p, font_list_entities, font_at):
2010 * fontset.c (fontset_id_valid_p, reorder_font_vector
2011 (fontset_find_font, Fset_fontset_font)
2012 (face_suitable_for_char_p) [0]:
2013 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2014 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2015 (m17n_flt_initialized, ftfont_shape_by_flt):
2016 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2017 * nsfont.m (nsfont_draw):
2018 * w32font.c (w32font_draw):
2019 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2020 Use bool for booleans.
2021 * font.h: Adjust to above API changes.
2022 (struct font, struct font_driver, struct font_driver_list):
2023 Use bool for booleans.
2024 (struct font): Remove useless member encoding_type.
2025 All users removed.
2026 * fontset.c, xftfont.c: Omit unnecessary static decls.
2027
0699fc18
DA
20282012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2029
2030 * alloc.c (mark_object): Revert window marking code
2031 since it's unsafe for the Fset_window_configuration.
2032
20ef56db
PE
20332012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2034
2fe28299 2035 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
2036 Be more systematic about preserving errno whenever a signal
2037 handler returns, even if it's not in the main thread. Do this by
2038 renaming signal handlers to distinguish between signal delivery
2039 and signal handling. All uses changed.
2040 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2041 * data.c (deliver_arith_signal): Rename from arith_error.
2042 * dispnew.c (deliver_window_change_signal): Rename from
2043 window_change_signal.
2044 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2045 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2046 * keyboard.c (deliver_input_available_signal): Rename from
2047 input_available_signal.
2048 (deliver_user_signal): Rename from handle_user_signal.
2049 (deliver_interrupt_signal): Rename from interrupt_signal.
2050 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2051 (deliver_child_signal): Rename from sigchld_handler.
2052 * atimer.c (handle_alarm_signal):
2053 * data.c (handle_arith_signal):
2054 * dispnew.c (handle_window_change_signal):
2055 * emacs.c (handle_fatal_signal, handle_danger_signal):
2056 * keyboard.c (handle_input_available_signal):
2057 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2058 * process.c (handle_pipe_signal, handle_child_signal):
2059 New functions, with the actual signal-handling code taken from the
2060 original respective signal handlers, sans the sporadic attempts to
2061 preserve errno, since that's now done by handle_on_main_thread.
2062 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2063 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2064 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2065 Move to sysdep.c.
2066 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2067 Move initialization of main_thread to sysdep.c's init_signals.
2068 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2069 our usage, and simplifies the mainline code.
2070 (record_child_status_change): New static function, as a helper
2071 for handle_child_signal, and with most of the old child handler's
2072 contents.
2073 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2074 (handle_child_signal): Use the above.
2075 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2076 Moved here from emacs.c.
2077 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2078 code moved here from emacs.c's main function.
2079 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
2080 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2081 This lets callers save and restore errno properly.
20ef56db 2082
e3ccf108
DA
20832012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2084
2085 Remove redundant or unused things here and there.
2086 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2087 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2088 * editfns.c (Fcompare_buffer_substrings): Likewise.
2089 * frame.h (struct terminal, struct font_driver_list):
2090 Remove redundant declarations.
2091 * window.h (Qleft, Qright): Likewise.
2092
697e1e39
DA
20932012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2094
2095 Do not mark objects from deleted buffers, windows and frames.
2096 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2097 (mark_object): Likewise for windows and frames.
2098
c1ca42ca
DA
20992012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2100
2101 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2102 buffer_defaults and buffer_local_symbols as valid objects.
2103 Return special value to denote them.
2104
014d93be
PE
21052012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2106
f75d7a91
PE
2107 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2108 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2109 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2110 (file_name_absolute_p, Fsubstitute_in_file_name):
2111 (check_executable, check_writable, Ffile_accessible_directory_p)
2112 (Fset_file_selinux_context, Fdefault_file_modes)
2113 (Finsert_file_contents, choose_write_coding_system)
2114 (Fwrite_region, build_annotations, a_write, e_write)
2115 (Fdo_auto_save):
2116 * filelock.c (boot_time_initialized, get_boot_time)
2117 (get_boot_time_1, lock_file_1, within_one_second):
2118 * floatfns.c (in_float):
2119 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2120 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2121 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2122 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2123 * window.c (compare_window_configurations):
2124 Use bool for booleans.
2125 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2126 (Fdefault_file_modes): Now mode_t, not int, for modes.
2127 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2128 (internal_delete_file): Now returns void, not a (boolean) int,
2129 since nobody was looking at the return value.
2130 * lisp.h, window.h: Adjust to above API changes.
2131
014d93be
PE
2132 * xdisp.c (set_message): Simplify and reindent last change.
2133
776f29e1
JB
21342012-09-05 Juanma Barranquero <lekktu@gmail.com>
2135
2136 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2137
7f7e0167
LI
21382012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2139
2140 * eval.c (call_debugger): Make the function non-static so that we
2141 can call it from set_message.
2142
2143 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2144 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2145
cf29dd84
PE
21462012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2147
2148 Give more-useful info on a fatal error (Bug#12328).
2149 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2150 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2151 of doing the work ourselves.
2152 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
2153 do most of the work.
2154 (fatal_error_backtrace): New function, taken from the guts
2155 of the old fatal_error_signal, but with a new option to output
2156 a backtrace.
2157 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
2158 info about the signal than just its number.
2159 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
2160 * sysdep.c: Include <execinfo.h>
2161 (emacs_backtrace): New function, taken partly from the previous
2162 code of the 'die' function.
2163 (emacs_abort): Call fatal_error_backtrace rather than abort.
2164
972debf2
SM
21652012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2166
2167 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
2168 eager (load-time) macro-expansion.
2169 * lisp.mk (lisp): Add macroexp.
2170
1088b922
PE
21712012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2172
2173 Simplify redefinition of 'abort' (Bug#12316).
2174 Do not try to redefine the 'abort' function. Instead, redo
2175 the code so that it calls 'emacs_abort' rather than 'abort'.
2176 This removes the need for the NO_ABORT configure-time macro
2177 and makes it easier to change the abort code to do a backtrace.
2178 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
2179 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
2180 Remove; sysdep.c's emacs_abort now takes its place.
2181 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
2182 'abort' changed to use 'emacs_abort'.
2183 * msdos.c (dos_abort) [defined abort]: Remove; not used.
2184 (abort) [!defined abort]: Rename to ...
2185 (emacs_abort): ... new name.
2186 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
2187 the place of the old 'abort' in emacs.c.
2188 * w32.c, w32fns.c (abort): Do not #undef.
2189 * w32.c (emacs_abort): Rename from w32_abort.
2190
30934d33
EZ
21912012-09-04 Eli Zaretskii <eliz@gnu.org>
2192
2193 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
2194 offsets[j].dv, since the y axis of the screen coordinates points
2195 down, while the y axis of the font definition coordinates points
2196 up. This fixes display of Arabic diacritics such as KASRA and
2197 KASRATAN. (Bug#11860)
2198
af26b72c
PE
21992012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2200
2201 Be more systematic about _setjmp vs setjmp.
2202 * alloc.c (test_setjmp, mark_stack):
2203 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
2204 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
2205 (png_load, my_error_exit, jpeg_load):
2206 * process.c (send_process_trap, send_process):
2207 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
2208 The underscored versions are up to 30x faster on some hosts.
2209 Formerly, the code used setjmp+longjmp sometimes and
2210 _setjmp+_longjmp at other times, with no particular reason to
2211 prefer setjmp+longjmp.
2212
26d4541d
PE
22132012-09-03 Paul Eggert <eggert@cs.ucla.edu>
2214
d42f4f0f 2215 Fix minor problem found by static checking.
26d4541d 2216 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 2217
c5e28e39
MR
22182012-09-03 Martin Rudalics <rudalics@gmx.at>
2219
2220 * buffer.c (Fdelete_all_overlays): New function.
2221
3eab3ca9
CY
22222012-09-03 Chong Yidong <cyd@gnu.org>
2223
2224 * gtkutil.c: Add extern decl for Qxft.
2225
c04889f8
PE
22262012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2227
1882aa38
PE
2228 * emacs.c, eval.c: Use bool for boolean.
2229 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
2230 (malloc_using_checking) [DOUG_LEA_MALLOC]:
2231 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
2232 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
2233 (main, decode_env_path, Fdaemon_initialized):
2234 * eval.c (call_debugger, Finteractive_p, interactive_p):
2235 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
2236 (maybe_call_debugger, Fbacktrace):
2237 * process.c (read_process_output, exec_sentinel):
2238 Use bool for booleans.
2239 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
2240 All callers changed.
2241 * eval.c (interactive_p): Omit always-true boolean argument
2242 EXCLUDE_SUBRS_P. All callers changed.
2243 * dispextern.h, lisp.h: Reflect above API changes.
2244 * firstfile.c (dummy): Use the address of 'main', whose signature
2245 won't change, instead of the address of 'initialize', whose
2246 signature just changed from int to bool.
2247 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
2248 * msdos.c (fatal_error_in_progress): ... from here.
2249 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
2250 of incrementing it.
2251 (redisplay_internal, unwind_redisplay): Simply clear
2252 REDISPLAYING_P when unwinding, instead of saving its previous,
2253 always-false value and then restoring it.
2254
a411ac43
PE
2255 Clean up some extern decls.
2256 Mostly, this hoists extern decls out of .c files and into .h files.
2257 That way, we're more likely to catch errors if the interfaces change.
2258 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
2259 declare xg_mark_data.
2260 * dispextern.h (x_frame_parm_handlers):
2261 * font.h (Qxft):
2262 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
2263 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
2264 (Qultra_bold, Qoblique, Qitalic):
2265 Move extern decl here from .c file.
2266 * alloc.c (xg_mark_data) [USE_GTK]:
2267 * doc.c (Qclosure):
2268 * eval.c (Qlexical_binding):
2269 * fns.c (time) [!HAVE_UNISTD_H]:
2270 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
2271 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
2272 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
2273 * lread.c (Qinternal_interpreter_environment):
2274 * minibuf.c (Qbuffer):
2275 * process.c (QCfamily, QCfilter):
2276 * widget.c (free_frame_faces):
2277 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
2278 * xfont.c (x_clear_errors):
2279 * xterm.c (x_frame_parm_handlers):
2280 Remove now-redundant extern decls.
2281 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
2282 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
2283 Now static.
2284 * xfaces.c: Remove unnecessary static decls.
2285 * xterm.c (updating_frame): Remove decl of nonexistent object.
2286
c04889f8
PE
2287 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
2288 when building globals.h, as the objects that are not built on
2289 this host are not needed to compile C files on this host.
2290
8b339673
JD
22912012-09-02 Jan Djärv <jan.h.d@swipnet.se>
2292
2293 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
2294
2295 * frame.h: Add missing prototype for x_wm_set_size_hint.
2296
a08d4ba7
PE
22972012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2298
2299 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
2300 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
2301 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
2302 (Fsubstitute_command_keys):
2303 * editfns.c (region_limit, find_field, Fconstrain_to_field)
2304 (save_excursion_save, save_excursion_restore)
2305 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
2306 (format_time_string, general_insert_function)
2307 (make_buffer_string, make_buffer_string_both)
2308 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
2309 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
2310 (copy_text, insert_1, insert_1_both, insert_from_string)
2311 (insert_from_string_before_markers, insert_from_string_1)
2312 (insert_from_buffer, insert_from_buffer_1, replace_range)
2313 (replace_range_2, del_range_1, del_range_byte, del_range_both)
2314 (del_range_2, modify_region):
2315 * intervals.c (intervals_equal, balance_possible_root_interval)
2316 (adjust_intervals_for_insertion, merge_properties_sticky)
2317 (graft_intervals_into_buffer, lookup_char_property)
2318 (adjust_for_invis_intang, set_point_both)
2319 (get_property_and_range, compare_string_intervals)
2320 (set_intervals_multibyte_1, set_intervals_multibyte):
2321 * keyboard.c (decode_timer):
2322 Use bool for boolean.
2323 * intervals.h, lisp.h, systime.h: Reflect above API changes.
2324 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
2325
48c948de
CY
23262012-09-02 Chong Yidong <cyd@gnu.org>
2327
2328 * keymap.c (push_key_description): Print M-TAB as C-M-i
2329 (Bug#11758).
2330
6c49a40b
JB
23312012-09-02 Juanma Barranquero <lekktu@gmail.com>
2332
2333 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
2334 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
2335 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
2336 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
2337 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
2338 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
2339 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2340
4dfbd238
EZ
23412012-09-01 Eli Zaretskii <eliz@gnu.org>
2342
7e510e28
EZ
2343 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
2344 more than one grapheme cluster passed to the shaper: compute the
2345 offset adjustment values separately for each cluster. (Bug#11860)
2346
4dfbd238
EZ
2347 * image.c: Restore mistakenly removed inclusion of w32.h. Without
2348 it, GCC doesn't see prototypes of w32_delayed_load, and complains
2349 about implicit conversions from integer to pointer.
2350
86571ae0
DC
23512012-09-01 Daniel Colascione <dancol@dancol.org>
2352
2353 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2354 system used too early.
2355
0e23ef9d
PE
23562012-09-01 Paul Eggert <eggert@cs.ucla.edu>
2357
2358 Better seed support for (random).
2359 * emacs.c (main): Call init_random.
2360 * fns.c (Frandom): Set the seed from a string argument, if given.
2361 Remove long-obsolete Gentzel cruft.
2362 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
2363 (init_random): New function.
2364
17a2cbbd
DC
23652012-09-01 Daniel Colascione <dancol@dancol.org>
2366
2367 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
2368 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
2369 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
2370 x_wm_set_size_hint, x_query_colors, x_real_positions,
2371 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
2372 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
2373 all of which have been moved to common code.
2374
2375 * xfaces.c: Include TERM_HEADER instead of listing all possible
2376 window-system headers.
2377
2378 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2379 to match header.
2380
2381 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2382 directly accessing frame internals.
2383
f18cbb28 2384 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
2385 globals_of_w32font.
2386
2387 * process.c: Include TERM_HEADER instead of listing all possible
2388 window-system headers.
2389
3a880af4
SM
2390 * nsterm.h: Remove declarations now in frame.h.
2391 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
2392
2393 * menu.c: Include TERM_HEADER instead of listing all possible
2394 window-system headers.
2395
2396 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2397 window system.
2398
2399 * keyboard.c: Include TERM_HEADER instead of listing all possible
2400 window-system headers.
2401
2402 * image.c: Include TERM_HEADER instead of listing all possible
2403 window-system headers. Declare Vlibrary_cache when compiling for
2404 Windows.
2405
2406 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2407 window system declarations.
2408
2409 * frame.h: Move common functions here: set_frame_menubar,
2410 x_set_window_size, x_sync, x_get_focus_frame,
2411 x_set_mouse_position, x_set_mouse_pixel_position,
2412 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
2413 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
2414 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
2415 x_activate_menubar, x_real_positions, x_bitmap_icon,
2416 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
2417 and x_query_colors.
2418
2419 * frame.c: Include TERM_HEADER instead of listing all possible
2420 window-system headers.
2421
2422 * font.c: Include TERM_HEADER instead of listing all possible
2423 window-system headers.
2424
2425 * emacs.c: Include TERM_HEADER.
2426
f18cbb28
EZ
2427 * dispnew.c: Include TERM_HEADER instead of listing all possible
2428 window-system headers.
17a2cbbd 2429
f18cbb28 2430 * ccl.h: Include character.h.
17a2cbbd
DC
2431
2432 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2433 the current window system; include in list of objects to link into
2434 Emacs.
2435
c650a5de
DA
24362012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2437
2438 Remove mark_ttys function and fix tty_display_info initialization.
2439 * lisp.h (mark_ttys): Remove prototype.
2440 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2441 to mark_ttys because all possible values of 'top_frame' slot are
2442 the frames which are reachable from Vframe_list.
2443 * term.c (mark_ttys): Remove.
2444 (init_tty): Safely initialize 'top_frame' slot with Qnil.
2445
4e0f6479
DA
24462012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2447
2448 Change struct frame bitfields from unsigned char to unsigned.
2449 * frame.h (struct frame): Change type of 'display_preempted',
2450 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2451 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2452 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2453 bitfields from unsigned char to unsigned.
2454
8b96a52c
DA
24552012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2456
2457 Remove unused member of struct x_output and struct w32_output.
2458 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2459 * w32term.h (struct w32_output): Likewise.
2460
b4444c8a
JD
24612012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2462
2463 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2464 does not become zero (Bug#12234).
2465
b98521db
PE
24662012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2467
2468 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2469 for GCC 4.7.1 x86-64.
2470
31d02438
GM
24712012-08-30 Glenn Morris <rgm@gnu.org>
2472
2473 * lread.c (init_lread): For out-of-tree builds, only add the
2474 source directory's site-lisp dir to the load-path if it exists,
2475 consistent with in-tree builds. (Bug#12302)
2476
7f8941d8
JD
24772012-08-28 Jan Djärv <jan.h.d@swipnet.se>
2478
2479 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 2480 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
2481 (windowShouldClose:): Set window_closed.
2482 (dealloc): New member, free button_values.
fc0c31f8
JB
2483 (process_dialog:): Make member function. Remove window argument,
2484 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
2485 in button_values.
2486 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 2487 with tag. Remove return self, declare return value as void.
7f8941d8
JD
2488 (addString:row:): Remove return self, declare return value as void.
2489 (addSplit): Remove return self, declare return value as void.
2490 (clicked:): Remove return self, declare return value as void.
fc0c31f8 2491 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
2492 (initFromContents:isQuestion:): Adjust call to process_dialog.
2493 Code formatting change.
2494 (timeout_handler:): Set timer_fired to YES.
2495 (runDialogAt:): Set timer_fired to NO.
2496 Handle click on close button as quit.
2497
2498 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
2499 Add window_closed and button_values. Add void as return value for
2500 add(Button|String|Split). addButton takes int instead of Lisp_Object.
2501 Add process_dialog as new member.
2502
eada0861 25032012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 2504
eada0861
GM
2505 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
2506 is not one of the heaps we manage. (Bug#12242)
2507
25082012-08-28 Glenn Morris <rgm@gnu.org>
2509
2510 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
2511
457294dd
MR
25122012-08-28 Martin Rudalics <rudalics@gmx.at>
2513
2514 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
2515 auto-buffer-name window parameter. Install revision of reverted
2516 fix.
457294dd 2517
4f2daf31
DA
25182012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2519
2520 Do not allow to set major mode for a dead buffer.
2521 * buffer.c (Fset_buffer_major_mode): Signal an error
2522 if the buffer is dead.
2523 (Fother_buffer, other_buffer_safely): Remove redundant
2524 nested declaration.
2525
66322887
DA
25262012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2527
2528 Always use set_buffer_if_live to restore original buffer at unwind.
2529 * buffer.h (record_unwind_current_buffer): New function.
2530 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
2531 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
2532 * undo.c, window.c: Adjust users.
2533 * buffer.c (set_buffer_if_live): Fix comment.
2534
a3d794a1
DA
25352012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2536
2537 Fix usage of set_buffer_internal.
2538 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
2539 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
2540 * coding.c (decode_coding): Omit redundant test.
2541 * fileio.c (decide_coding_unwind): Likewise.
2542 * fns.c (secure_hash): Likewise.
2543 * insdel.c (modify_region): Likewise.
2544 * keyboard.c (command_loop_1): Likewise.
2545 * print.c (PRINTFINISH): Likewise.
2546 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
2547
59ea14cd
PE
25482012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2549
2550 * dispnew.c: Use bool for boolean.
2551 (frame_garbaged, display_completed, delayed_size_change)
2552 (fonts_changed_p, add_window_display_history)
2553 (add_frame_display_history, verify_row_hash)
2554 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
2555 (row_equal_p, realloc_glyph_pool)
2556 (allocate_matrices_for_frame_redisplay)
2557 (showing_window_margins_p)
2558 (adjust_frame_glyphs_for_frame_redisplay)
2559 (build_frame_matrix_from_leaf_window, make_current)
2560 (mirrored_line_dance, mirror_line_dance, update_frame)
2561 (update_window_tree, update_single_window)
2562 (check_current_matrix_flags, update_window, update_text_area)
2563 (update_window_line, set_window_update_flags, scrolling_window)
2564 (update_frame_1, scrolling, buffer_posn_from_coords)
2565 (do_pending_window_change, change_frame_size)
2566 (change_frame_size_1, sit_for):
2567 Use bool for boolean.
2568 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2569 and remove last int (actually boolean) argument, which was always 0.
2570 All callers changed.
2571 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2572 * dispextern.h (struct composition_it): Use bool for boolean.
2573 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2574 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2575 * dired.c (file_name_completion):
2576 Use bool for boolean. (This was missed in an earlier change.)
2577
95072a94
MR
25782012-08-27 Martin Rudalics <rudalics@gmx.at>
2579
2580 * window.c (Fset_window_configuration): Revert first part of
2581 last change.
2582
0f19feff
JD
25832012-08-27 Jan Djärv <jan.h.d@swipnet.se>
2584
2585 * nsterm.h (NSPanel): New class variable dialog_return.
2586
3a880af4
SM
2587 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2588 Initialize dialog_return.
0f19feff
JD
2589 (windowShouldClose:): Use stop instead of stopModalWithCode.
2590 (clicked:): Ditto, and also set dialog_return (Bug#12258).
2591 (timeout_handler:): Use stop instead of abortModal. Send a dummy
2592 event.
2593 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
2594 modal loop returns.
2595
f10fe38f
PE
25962012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2597
de1339b0
PE
2598 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2599 * composite.c (find_composition, composition_gstring_p)
2600 (composition_reseat_it, find_automatic_composition):
2601 * data.c (let_shadows_buffer_binding_p)
2602 (let_shadows_global_binding_p, set_internal, make_blv)
2603 (Fmake_variable_buffer_local, Fmake_local_variable)
2604 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2605 (cons_to_signed, arith_driver):
2606 * dbusbind.c (xd_in_read_queued_messages):
2607 * dired.c (directory_files_internal, file_name_completion):
2608 Use bool for booleans.
2609 * dired.c (file_name_completion):
2610 * process.h (fd_callback):
2611 Omit int (actually boolean) argument. It wasn't being used.
2612 All uses changed.
2613 * composite.h, lisp.h: Reflect above API changes.
2614
f10fe38f
PE
2615 * cmds.c, coding.c: Use bool for booleans.
2616 * cmds.c (move_point, Fself_insert_command):
2617 * coding.h (struct composition status, struct coding_system):
2618 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2619 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2620 (emacs_mule_char, decode_coding_emacs_mule)
2621 (encode_coding_emacs_mule, detect_coding_iso_2022)
2622 (decode_coding_iso_2022, encode_invocation_designation)
2623 (encode_designation_at_bol, encode_coding_iso_2022)
2624 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2625 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2626 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2627 (encode_coding_raw_text, detect_coding_charset)
2628 (decode_coding_charset, encode_coding_charset, detect_eol)
2629 (detect_coding, get_translation_table, produce_chars)
2630 (consume_chars, reused_workbuf_in_use)
2631 (make_conversion_work_buffer, code_conversion_save)
2632 (decode_coding_object, encode_coding_object)
2633 (detect_coding_system, char_encodable_p)
2634 (Funencodable_char_position, code_convert_region)
2635 (code_convert_string, code_convert_string_norecord)
2636 (Fset_coding_system_priority):
2637 * fileio.c (Finsert_file_contents):
2638 Use bool for booleans.
2639 * coding.h, lisp.h: Reflect above API changes.
2640 * coding.c: Remove unnecessary static function decls.
2641 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2642 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2643 not a boolean 'int', since callers never look at the return value.
2644 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2645 * coding.h (decoding_buffer_size, encoding_buffer_size)
2646 (emacs_mule_string_char): Remove unused extern decls.
2647 (struct iso_2022_spec, struct coding_system):
2648 Use 'unsigned int : 1' for boolean fields, since there's more than one.
2649 (struct emacs_mule_spec): Remove unused field 'full_support'.
2650 All initializations removed.
2651 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2652
5474c384
DA
26532012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2654
f10fe38f 2655 Fix spare memory change (Bug#12286).
5474c384
DA
2656 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
2657 (valid_lisp_object_p): Likewise.
2658
c4b6914d
MR
26592012-08-27 Martin Rudalics <rudalics@gmx.at>
2660
2661 * window.c (Fset_window_configuration): Record any window's old
2662 buffer if it's replaced (see Bug#8789). If the new current
2663 buffer doesn't appear in the selected window, go to its old
2664 point (Bug#12208).
2665
35aaa1ea
DA
26662012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2667
2668 Special MEM_TYPE_SPARE to denote reserved memory.
2669 * alloc.c (enum mem_type): New memory type.
2670 (refill_memory_reserve): Use new type for spare memory.
2671 This prevents live_cons_p and live_string_p from incorrect
2672 detection of uninitialized objects from spare memory as live.
2673
6af64513
PE
26742012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2675
8b2e00a3
PE
2676 Spelling fixes.
2677 * Makefile.in (.PHONY): versioclean -> versionclean.
2678
b52d6985
PE
2679 Remove unused external symbols.
2680 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2681 * window.c (Qwindow_valid_p, decode_valid_window):
2682 Now static, not extern.
2683 * data.c (Qinterval): Remove; unused.
2684 (syms_of_data): Do not define 'interval'.
2685 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2686 * window.h (decode_valid_window):
2687 Remove decls.
2688
d5172d4f
PE
2689 * character.c, charset.c, chartab.c: Use bool for booleans.
2690 * character.c (lisp_string_width, string_count_byte8)
2691 (string_escape_byte8):
2692 * charset.c (charset_map_loaded, load_charset_map, read_hex):
2693 (load_charset_map_from_file, map_charset_chars)
2694 (Fdefine_charset_internal, define_charset_internal)
2695 (Fdeclare_equiv_charset, find_charsets_in_text)
2696 (Ffind_charset_region, char_charset, Fiso_charset):
2697 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2698 (sub_char_table_set, sub_char_table_set_range)
2699 (char_table_set_range, optimize_sub_char_table)
2700 (map_sub_char_table):
2701 Use bool for boolean.
2702 * character.c (str_to_unibyte): Omit last boolean argument; it was
2703 always 0. All callers changed.
2704 * character.h, charset.h: Adjust to match previous changes.
2705 * character.h (char_printable_p): Remove decl of nonexistent function.
2706 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2707 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2708 are all boolean, so make them single-bit bitfields.
2709
6af64513
PE
2710 * lisp.h (ASET): Remove attempt to detect side effects.
2711 It was meant to be temporary and it often doesn't work,
2712 because when IDX has side effects the behavior of IDX==IDX
2713 is undefined. See Stefan Monnier in
2714 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2715
e1f29348
BR
27162012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2717
2718 * lisp.h (functionp): New function (extracted from Ffunctionp).
2719 (FUNCTIONP): Use it.
2720 * eval.c (Ffunctionp): Use it.
2721
17c05d74
PE
27222012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2723
0f46bc75
PE
2724 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2725 as that's faster and simpler than static storage. Don't bother
2726 with the g_main_context_query overhead if g_main_context_pending
2727 says no events are pending.
2728 (gfds, gfds_size): Remove these static vars.
2729 (xgselect_initialize): Remove; no longer needed.
2730 All uses and decls removed.
2731
ee4c0f69
PE
2732 * emacs.c (fatal_error_signal_hook): Remove.
2733 All uses removed. This leftover from old code was always 0.
2734
17c05d74
PE
2735 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2736 * casefiddle.c (casify_object, casify_region):
2737 * casetab.c (set_case_table):
2738 * category.c, category.h (word_boundary_p):
2739 * category.h (CHAR_HAS_CATEGORY):
2740 Use bool for booleans, instead of int.
2741
391ceac5
EZ
27422012-08-25 Eli Zaretskii <eliz@gnu.org>
2743
2744 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2745
2f221583
PE
27462012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2747
f4a681b0
PE
2748 On assertion failure, print backtrace if available.
2749 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2750 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2751 * Makefile.in (LIB_EXECINFO): New macro.
2752 (LIBES): Use it.
2753
2f221583
PE
2754 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2755 * bytecode.c (exec_byte_code):
2756 * callint.c (check_mark, Fcall_interactively):
2757 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2758 (getenv_internal, sync_process_alive, call_process_exited):
2759 * lisp.h (USE_SAFE_ALLOCA):
2760 Use bool for booleans, instead of int.
2761 * lisp.h, process.h: Adjust prototypes to match above changes.
2762 * callint.c (Fcall_interactively): Don't assume the mark's
2763 offset fits in 'int'.
2764
37ef52bb
PE
27652012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2766
2767 * buffer.c, buffer.h: Use bool for boolean.
2768 * buffer.c (reset_buffer_local_variables)
2769 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2770 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2771 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2772 (overlay_touches_p, overlay_strings, Foverlay_put)
2773 (report_overlay_modification, call_overlay_mod_hooks):
2774 (mmap_enlarge, mmap_set_vars):
2775 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2776 Use bool for booleans, instead of int.
2777 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2778 since the 1-or-0 return value is always ignored anyway.
2779 (mmap_initialized_p):
2780 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2781 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2782
2cc21167
PE
27832012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2784
2785 * bidi.c: Use bool for boolean.
2786 This is a bit more readable, and makes the text segment of bidi.o
2787 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2788 Presumably it's faster too.
2789 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2790 Now bool.
2791 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2792 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2793 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2794 (bidi_explicit_dir_char, bidi_level_of_next_char)
2795 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2796 Use bool for booleans, instead of int.
2797 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2798 (bidi_unshelve_cache): Adjust decls to match code.
2799
7db4ddf4
MR
28002012-08-23 Martin Rudalics <rudalics@gmx.at>
2801
2802 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2803 argument.
2804
b1bb8011
PE
28052012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2806
2807 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2808 * atimer.h: Include <stdbool.h>.
2809
ff687885
DN
28102012-08-22 Dan Nicolaescu <dann@gnu.org>
2811
2812 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2813 compile time tests instead of run time tests on systems that do
2814 not use them.
2815 (FRAME_MAC_P): Remove leftover from deleted code.
2816 * frame.c (syms_of_frame): Remove leftover from deleted code.
2817
4ce7a138
JD
28182012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2819
2820 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2821
d733ec6d
PE
28222012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2823
2824 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2825 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 2826 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
2827 (fontset_add): Return void, for FONTSET_ADD.
2828
d0d2d26f
PE
28292012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2830
fce31d69
PE
2831 * alloc.c: Use bool for booleans.
2832 (gc_in_progress, abort_on_gc)
2833 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2834 (dont_register_blocks) [GC_MALLOC_CHECK]:
2835 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2836 (check_string_bytes, make_specified_string, memory_full)
2837 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2838 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2839 (mark_stack, valid_pointer_p, make_pure_string)
2840 (Fgarbage_collect, survives_gc_p, gc_sweep):
2841 Use bool for booleans, instead of int.
2842 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2843 Remove unused local.
2844 * alloc.c (PURE_POINTER_P):
2845 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2846 * editfns.c (Fformat):
2847 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2848 (Fdo_auto_save):
2849 * fns.c (sweep_weak_table):
2850 * lisp.h (suppress_checking, push_message, survives_gc_p)
2851 (make_pure_string, gc_in_progress, abort_on_gc):
2852 * lread.c (readchar, read1):
2853 * print.c (Fprin1_to_string):
2854 * xdisp.c (push_message):
2855 Use bool for booleans affected directly or indirectly by
2856 alloc.c's changes.
2857
d0d2d26f
PE
2858 Make recently-introduced setters macros.
2859 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2860 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2861 (set_fontset_default, set_fontset_fallback): Rename from their
2862 upper-case counterparts, and make them functions rather than macros.
2863 This is more consistent with the other recently-introduced setters.
2864 These don't need to be inline, since they're local.
2865
d18e2bb6
JD
28662012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2867
2868 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2869 the loop (Bug#12247).
2870
1b9d9d16
PE
28712012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2872
2873 * lisp.h (vcopy): Use memcpy rather than our own loop.
2874 This fixes a performance regression introduced by the recent
2875 addition of vcopy. This means 'vcopy' will need to be modified
2876 for a copying collector, but that's OK. Also, tighten the
2877 checking in the assertion.
2878
b2f09701
EZ
28792012-08-21 Eli Zaretskii <eliz@gnu.org>
2880
2881 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2882 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2883 non-base glyph for the width of the base character, according to
e1f29348
BR
2884 what x_draw_composite_glyph_string_foreground expects.
2885 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
2886 expectations, to produce correct width of the composed character.
2887 Reverse the sign of the DU offset produced by ScriptPlace.
2888
9b994fed
PE
28892012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2890
2891 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2892
086ca913
DA
28932012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2894
2895 Avoid direct writes to contents member of struct Lisp_Vector.
2896 * lisp.h (vcopy): New function to copy data into vector.
2897 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2898 * fns.c (Ffillarray): Use ASET.
2899 * keyboard.c (timer_check_2): Use AREF and ASET.
2900 (append_tool_bar_item, Frecent_keys): Use vcopy.
2901 * lread.c (read_vector): Use ASET.
2902 * msdos.c (Frecent_doskeys): Use vcopy.
2903 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2904 (Finternal_merge_in_global_face): Use ASET and vcopy.
2905 * xfont.c (xfont_list_pattern): Likewise.
2906
5481664a
MR
29072012-08-21 Martin Rudalics <rudalics@gmx.at>
2908
2909 * window.c (Fwindow_point): For the selected window always return
2910 the position of its buffer's point.
2911 (Fset_window_point): For the selected window always go in its
2912 buffer to the specified position.
2913
6d470bdd
DA
29142012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2915
2916 Setter macros for fontsets.
2917 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2918 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2919 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2920 Adjust users.
2921
24564fe1
GM
29222012-08-20 Glenn Morris <rgm@gnu.org>
2923
2924 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2925 Don't assume that `ln -f' works.
2926
0a05a035
EZ
29272012-08-20 Eli Zaretskii <eliz@gnu.org>
2928
2929 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2930 and later about non-assignments with no effect. See discussion at
2931 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2932 details.
2933
e46f2325
DA
29342012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2935
2936 Inline setter functions for Lisp_Objects slots of struct specbinding.
2937 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2938 Adjust users.
2939
734fbd86
MR
29402012-08-20 Martin Rudalics <rudalics@gmx.at>
2941
2942 * window.c (select_window): Always make selected window's buffer
2943 current.
2944
f1a95992
DA
29452012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2946
2947 Use AREF and ASET for docstrings of category tables.
2948 * category.h (CATEGORY_DOCSTRING): Use AREF.
2949 (SET_CATEGORY_DOCSTRING): Use ASET.
2950 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2951
e83064be
DA
29522012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2953
2954 Inline setter functions for hash table members.
2955 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2956 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2957 (set_hash_key_and_value, set_hash_index, set_hash_next)
2958 (set_hash_hash): New functions.
2959 * charset.c, fns.c: Adjust users.
2960
4ce60d2e
DA
29612012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2962
2963 Inline getter and setter functions for per-buffer values.
2964 * buffer.h (per_buffer_default, set_per_buffer_default)
2965 (per_buffer_value, set_per_buffer_value): New functions.
2966 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2967 * buffer.c, data.c: Adjust users.
2968
c06c9690
JB
29692012-08-20 Juanma Barranquero <lekktu@gmail.com>
2970
2971 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2972
32bd4250
PE
29732012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2974
bad03192 2975 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
2976 as gnulib does this if the system doesn't.
2977 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
2978 Remove declaration. MS-Windows declares it on stdlib.h which is
2979 included by conf_post.h.
b69a6d22
PE
2980 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2981 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2982 * vm-limit.c: Include <unistd.h>, for 'environ'.
2983
22d7feb2
PE
2984 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2985 (start_of_data): Remove decl; mem-limits.h provides it.
2986
32bd4250
PE
2987 * xdisp.c (handle_invisible_prop): Make it a bit faster
2988 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2989
450809af
CY
29902012-08-19 Chong Yidong <cyd@gnu.org>
2991
2992 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2993 ends (Bug#3874).
2994
9e677988
AS
29952012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2996
6b1319ce
AS
2997 * .gdbinit: Use call instead of set when calling a function in the
2998 inferior.
2999
9e677988
AS
3000 * data.c (set_internal): Don't use set_blv_found.
3001 (Fkill_local_variable): Likewise.
3002
d7191076
AA
30032012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3004
3005 * nsfont.m (ns_ascii_average_width): Ensure the string
3006 ascii_printable is initialized with a null-terminated character
3007 array. Otherwise, it can contain undesired extra characters.
3008
e757f1c6
PE
30092012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3010
3011 port new setting code to Sun C 5.8 2005/10/13
3012 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3013 Return void, not Lisp_Object. Otherwise, the compiler
3014 complains about (A?B:C) where B is void and C is Lisp_Object
3015 when compiling CHAR_TABLE_SET, due to the recent change to
3016 the API of sub_char_table_set_contents.
3017
a999ce26
CY
30182012-08-18 Chong Yidong <cyd@gnu.org>
3019
3020 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3021 for the string case (Bug#3874).
3022
3f22b86f
PE
30232012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3024
39eb03f1
PE
3025 * buffer.h (BSET): Remove (Bug#12215).
3026 Replace all uses with calls to new setter functions.
3027 (bset_bidi_paragraph_direction, bset_case_canon_table)
3028 (bset_case_eqv_table, bset_directory, bset_display_count)
3029 (bset_display_time, bset_downcase_table)
3030 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3031 (bset_last_selected_window, bset_local_var_alist)
3032 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3033 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3034 (bset_width_table):
3035 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3036 (bset_auto_fill_function, bset_auto_save_file_format)
3037 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3038 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3039 (bset_cache_long_line_scans, bset_case_fold_search)
3040 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3041 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3042 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3043 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3044 (bset_header_line_format, bset_indicate_buffer_boundaries)
3045 (bset_indicate_empty_lines, bset_invisibility_spec)
3046 (bset_left_fringe_width, bset_major_mode, bset_mark)
3047 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3048 (bset_name, bset_overwrite_mode, bset_pt_marker)
3049 (bset_right_fringe_width, bset_save_length)
3050 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3051 (bset_scroll_up_aggressively, bset_selective_display)
3052 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3053 (bset_word_wrap, bset_zv_marker):
3054 * category.c (bset_category_table):
3055 * syntax.c (bset_syntax_table):
3056 New setter functions.
3057
6a09a33b
PE
3058 * process.h (PSET): Remove (Bug#12215).
3059 Replace all uses with calls to new setter functions.
3060 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3061 (PROCESS_INLINE): New macro.
3062 (pset_childp): New setter function.
3063 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3064 * process.c (PROCESS_INLINE):
3065 Define to EXTERN_INLINE, so that the corresponding functions
3066 are compiled into code.
3067 (pset_buffer, pset_command, pset_decode_coding_system)
3068 (pset_decoding_buf, pset_encode_coding_system)
3069 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3070 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3071 (pset_type, pset_write_queue): New setter functions.
3072
e8c17b81
PE
3073 * window.h (WSET): Remove (Bug#12215).
3074 Replace all uses with calls to new setter functions.
3075 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3076 (WINDOW_INLINE): New macro.
3077 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3078 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3079 (wset_total_lines, wset_vertical_scroll_bar)
3080 (wset_window_end_pos, wset_window_end_valid)
3081 (wset_window_end_vpos): New setter functions.
3082 * window.c (WINDOW_INLINE):
3083 Define to EXTERN_INLINE, so that the corresponding functions
3084 are compiled into code.
3085 (wset_combination_limit, wset_dedicated, wset_display_table)
3086 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3087 (wset_new_normal, wset_new_total, wset_next_buffers)
3088 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3089 (wset_prev_buffers, wset_right_fringe_width)
3090 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3091 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3092 (wset_window_parameters):
3093 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3094 (wset_column_number_displayed, wset_region_showing):
3095 New setter functions.
3096
3f22b86f
PE
3097 * termhooks.h (TSET): Remove (Bug#12215).
3098 Replace all uses with calls to new setter functions.
3099 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3100 (TERMHOOKS_INLINE): New macro.
3101 (tset_charset_list, tset_selection_alist): New setter functions.
3102 * terminal.c (TERMHOOKS_INLINE):
3103 Define to EXTERN_INLINE, so that the corresponding functions
3104 are compiled into code.
3105 (tset_param_alist): New setter function.
3106
742af32f
PE
31072012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3108
15dbb4d6
PE
3109 * keyboard.h (KSET): Remove (Bug#12215).
3110 Replace all uses with calls to new setter functions.
3111 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3112 (KEYBOARD_INLINE): New macro.
3113 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3114 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3115 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3116 New setter functions.
3117 * keyboard.c (KEYBOARD_INLINE):
3118 Define to EXTERN_INLINE, so that the corresponding functions
3119 are compiled into code.
3120 (kset_echo_string, kset_kbd_queue)
3121 (kset_keyboard_translate_table, kset_last_prefix_arg)
3122 (kset_last_repeatable_command, kset_local_function_key_map)
3123 (kset_overriding_terminal_local_map, kset_real_last_command)
3124 (kset_system_key_syms): New setter functions.
3125
f00af5b1
PE
3126 * frame.h (FSET): Remove (Bug#12215).
3127 Replace all uses with calls to new setter functions.
3128 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3129 (FRAME_INLINE): New macro.
3130 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3131 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3132 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3133 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3134 (fset_param_alist, fset_root_window, fset_scroll_bars)
3135 (fset_selected_window, fset_title, fset_tool_bar_items)
3136 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3137 * frame.c (FRAME_INLINE):
3138 Define to EXTERN_INLINE, so that the corresponding functions
3139 are compiled into code.
3140 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3141
0c94c8d6
PE
3142 A few more naming-convention fixes for getters and setters.
3143 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3144 and rename from buffer_overlays_set_before.
3145 (set_buffer_overlays_after): Move here from buffer.h, and rename
3146 from buffer_overlays_set_after.
3147 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3148 All uses changed.
3149 (set_buffer_intervals): Rename from buffer_set_intervals.
3150 * intervals.c (set_interval_object): Move here from intervals.h,
3151 and rename from interval_set_object.
3152 (set_interval_left): Move here from intervals.h, and rename from
3153 interval_set_left.
3154 (set_interval_right): Move here from intervals.h, and rename from
3155 interval_set_right.
3156 (copy_interval_parent): Move here from intervals.h, and rename from
3157 interval_copy_parent.
3158 * intervals.h (set_interval_parent): Rename from interval_set_parent.
3159 (set_interval_plist): Rename from interval_set_plist.
3160 Return void, not Lisp_Object, since no caller uses the result.
3161 * lisp.h (string_intervals): Rename from string_get_intervals.
3162 (set_string_intervals): Rename from string_set_intervals.
3163
34dabdb7
PE
3164 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
3165 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 3166 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
3167 All uses changed. See the end of
3168 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
3169
742af32f
PE
3170 * lisp.h (CSET): Remove (Bug#12215).
3171 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
3172 (set_char_table_purpose): New functions,
3173 replacing CSET. All uses changed. For example, replace
3174 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 3175 "set_char_table_parent (char_table, parent);".
742af32f
PE
3176 The old version was confusing because it used the same name
3177 'parent' for two different things.
3178
a04e2c62
DA
31792012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3180
3181 Functions to get and set Lisp_Object fields of buffer-local variables.
3182 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
3183 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
3184 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
3185 * data.c, eval.c, frame.c: Adjust users.
3186
383dcbf9
CY
31872012-08-17 Chong Yidong <cyd@gnu.org>
3188
3189 * xfaces.c (merge_face_vectors): If the target font specfies a
3190 font spec, make the font's attributes take precedence over
3191 directly-specified attributes.
3192 (merge_face_ref): Recognize :font.
3193
44386687
DA
31942012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3195
3196 Do not use memcpy for copying intervals.
3197 * intervals.c (reproduce_interval): New function.
3198 (reproduce_tree, reproduce_tree_obj): Use it.
3199 (reproduce_tree_obj): Remove prototype.
3200
927c7216
PE
32012012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3202
3203 * lisp.h (duration_to_sec_usec): Remove unused decl.
3204
93044f7b
AA
32052012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
3206
3207 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
3208 to an allocated instance of NSString, not to the class itself.
3209
9851e4a5
JB
32102012-08-17 Juanma Barranquero <lekktu@gmail.com>
3211
3212 * makefile.w32-in (C_CTYPE_H): New macro.
3213 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
3214 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
3215 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3216
620f13b0
PE
32172012-08-16 Paul Eggert <eggert@cs.ucla.edu>
3218
3219 Use ASCII tests for character types.
3220 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
3221 * xfns.c, xterm.c:
3222 Don't include <ctype.h>; was not needed.
3223 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
3224 * sysdep.c, xfaces.c:
3225 Include <c-ctype.h> instead of <ctype.h>.
3226 * nsterm.m: Include <c-ctype.h>.
3227 * charset.c (read_hex):
3228 * doc.c (Fsnarf_documentation):
3229 * fileio.c (IS_DRIVE) [WINDOWSNT]:
3230 (DRIVE_LETTER) [DOS_NT]:
3231 (Ffile_name_directory, Fexpand_file_name)
3232 (Fsubstitute_in_file_name):
3233 * font.c (font_parse_xlfd, font_parse_fcname):
3234 * frame.c (x_set_font_backend):
3235 * gtkutil.c (xg_get_font):
3236 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
3237 * nsimage.m (hexchar):
3238 * nsterm.m (ns_xlfd_to_fontname):
3239 * sysdep.c (system_process_attributes):
3240 * xfaces.c (hash_string_case_insensitive):
3241 Use C-locale tests instead of locale-specific tests for character
3242 types, since we want the ASCII interpretation here, not the
3243 interpretation suitable for whatever happens to be the current locale.
3244
52162052
MR
32452012-08-16 Martin Rudalics <rudalics@gmx.at>
3246
3247 Consistently check windows for validity/liveness
3248 (Bug#11984, Bug#12025, Bug#12026).
3249 * lisp.h (CHECK_VALID_WINDOW): New macro.
3250 * window.c (decode_window): Rename to decode_live_window.
3251 (decode_valid_window, Fwindow_valid_p): New functions.
3252 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
3253 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
3254 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
3255 (Fwindow_prev_sibling, Fwindow_combination_limit)
3256 (Fset_window_combination_limit, Fwindow_use_time)
3257 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
3258 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
3259 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
3260 (Fwindow_hscroll, Fset_window_hscroll)
3261 (Fwindow_redisplay_end_trigger)
3262 (Fset_window_redisplay_end_trigger, Fwindow_edges)
3263 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
3264 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
3265 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
3266 (Fwindow_end, Fset_window_point, Fset_window_start)
3267 (Fpos_visible_in_window_p, Fwindow_line_height)
3268 (Fwindow_dedicated_p, Fset_window_dedicated_p)
3269 (Fwindow_prev_buffers, Fset_window_prev_buffers)
3270 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
3271 (Fset_window_parameter, Fwindow_display_table)
3272 (Fset_window_display_table, Fdelete_other_windows_internal)
3273 (Fset_window_buffer, Fset_window_new_total)
3274 (Fset_window_new_normal, Fdelete_window_internal)
3275 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
3276 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
3277 (Fwindow_scroll_bars): Check whether argument window is a valid or
3278 live window. Update doc-strings.
3279 (syms_of_window): New symbol Qwindow_valid_p.
3280 * keyboard.c (Fposn_at_x_y): Check whether argument
3281 frame_or_window denotes a valid window.
3282
2751c80f
DA
32832012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3284
3285 Fix previous char table change.
3286 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
3287 * chartab.c (optimize_sub_char_table): Likewise.
3288
032a42c8
CY
32892012-08-16 Chong Yidong <cyd@gnu.org>
3290
a2d19368
CY
3291 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
3292
032a42c8
CY
3293 * xfont.c (xfont_open):
3294 * xftfont.c (xftfont_open): Set the font's max_width field.
3295
3296 * nsfont.m (nsfont_open): Similar to the Xft backend, set
3297 min_width to space_width and average_width to the average over
3298 printable ASCII characters.
3299 (ns_char_width): Code cleanup.
3300 (ns_ascii_average_width): New utility function.
3301
3302 * font.h (struct font): Update comments.
3303
a098c930
DA
33042012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3305
032a42c8 3306 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
3307 * lisp.h (CSET): New macro.
3308 (char_table_set_extras, char_table_set_contents)
3309 (sub_char_table_set_contents): New function.
3310 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
3311 * syntax.c: Adjust users.
3312
8be3a09c
SM
33132012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
3314
3315 * eval.c (eval_sub): Bind lexical-binding.
3316 * lread.c (Qlexical_binding): Make non-static.
3317
ac4845a6
JD
33182012-08-15 Jan Djärv <jan.h.d@swipnet.se>
3319
ddee6515
JD
3320 * nsmenu.m (popupSession): Remove.
3321 (pop_down_menu): Remove endModalSession.
3322 (timeout_handler:): New method.
3323 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
3324 Call runModalForWindow. Check timer_fired when it returns.
3325 If not set, cancel timer and break out of loop.
3326 Otherwise loop again, with a new timeout.
3327
3328 * nsterm.m: Include fcntl.h if present.
3329 (fd_entry, t_readfds, inNsSelect): Remove.
3330 (select_writefds, select_valid, select_timeout, selfds)
3331 (select_mutex, apploopnr): Add.
3332 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
3333 Otherwise call kbd_buffer_store_event.
3334 (ns_send_appdefined): Remove release of fd_entry.
3335 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
3336 Increment and decrement apploopnr.
3337 (ns_select): If no file descriptors, just do a NSTimer.
3338 Otherwise copy read/write masks and start select thread (fd_handler).
3339 Start main loop and wait for application defined event.
3340 Inform select thread to stop selecting after main loop is exited.
3341 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 3342 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
3343 (fd_handler:): Loop forever, wait for info from the main thread
3344 to either start or stop selecting. When select returns, send
3345 and appdefined event.
3346 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
3347 If not call kbd_buffer_store_event.
3348
3349 * nsterm.h (EmacsApp): fd_handler takes id argument.
3350 (EmacsDialogPanel): Add timer_fired and timeout_handler.
3351
ac4845a6
JD
3352 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3353
eb424fe3
EZ
33542012-08-15 Eli Zaretskii <eliz@gnu.org>
3355
3356 * region-cache.c (move_cache_gap): Update gap_len using the actual
3357 growth of the boundaries array. Do not change cache_len.
3358 (Bug#12196)
3359
4e6a86c6
DA
33602012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3361
3362 Generalize and cleanup font subsystem checks.
3363 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
3364 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
3365 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 3366
5bf192ca
DA
33672012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3368
3369 * gtkutil.c (xg_get_font): Use pango_units_to_double.
3370
f2045622
CY
33712012-08-15 Chong Yidong <cyd@gnu.org>
3372
8be3a09c
SM
3373 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
3374 When using the new font chooser, use gtk_font_chooser_get_font_desc to
3375 extract the font descriptor instead of just the font name.
3376 In that case, return a font spec instead of a string.
f2045622
CY
3377 (x_last_font_name): Move to this file from xfns.c.
3378
3379 * xfns.c (Fx_select_font): The return value can also be a font
3380 spec. Move x_last_font_name management to gtkutil.c.
3381
3382 * xfaces.c: Make font weight and style symbols non-static.
3383
7f6feb56
SM
33842012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
3385
3386 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3387 (bug#12117).
3388
fecbd8ff
SM
33892012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
3390
3391 * alloc.c (Fgarbage_collect): Use plural form consistently.
3392
9b8d5165
EZ
33932012-08-14 Eli Zaretskii <eliz@gnu.org>
3394
3395 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3396 iteration through the command loop. Fixes a problem whereby mouse
3397 movements are ignored until the first mouse click.
3398
f5d9e83a
PE
33992012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3400
3401 Use bool, not int, for Lisp booleans.
3402 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3403 makes Emacs a bit smaller and presumably a bit faster.
3404 * lisp.h: Include <stdbool.h>.
3405 (struct Lisp_Boolfwd, defvar_bool):
3406 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3407 * regex.c [!emacs]: Include <stdbool.h>.
3408 (false, true): Remove; <stdbool.h> does this for us now.
3409
55802e4a
CY
34102012-08-14 Chong Yidong <cyd@gnu.org>
3411
4abcdac8
CY
3412 * character.c (Fcharacterp): Doc fix (Bug#12076).
3413
3414 * data.c (Findirect_variable): Doc fix (Bug#11040).
3415
55802e4a
CY
3416 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
3417
3418 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 3419 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 3420
8e99d072
BR
34212012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3422
3423 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3424 (bug#12022).
3425
08908aca
MR
34262012-08-14 Martin Rudalics <rudalics@gmx.at>
3427
3428 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3429 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3430 * minibuf.c (choose_minibuf_frame, read_minibuf):
3431 * w32fns.c (x_create_tip_frame):
3432 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3433 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3434
56120d6f
PE
34352012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3436
3437 * intervals.c (offset_intervals): Remove obsolete comment.
3438
67b77c0b
AS
34392012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3440
3441 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3442
f48b82fd
GR
34432012-08-14 Gergely Risko <gergely@risko.hu>
3444
3445 * coding.c (decode_coding): Record buffer modification before
3446 disabling undo_list (Bug#11773).
3447
fd318b54
DA
34482012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3449
3450 Revert and cleanup some recent overlay changes.
3451 * buffer.h (enum overlay_type): Remove.
3452 (buffer_get_overlays, buffer_set_overlays): Likewise.
3453 (buffer_set_overlays_before, buffer_set_overlays_after):
3454 New function. Adjust users.
3455 (unchain_both): Add eassert.
3456
41a62dd9
DA
34572012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3458
3459 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3460
5884c324
PE
34612012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3462
3463 * gtkutil.c (xg_mark_data): Don't assume C99.
3464
ca06f160
JD
34652012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3466
3467 * gtkutil.c (xg_frame_tb_info): New struct.
3468 (TB_INFO_KEY): New define.
3469 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3470 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3471 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3472 if not present.
3473 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 3474 is up to date. Otherwise store new data.
ca06f160
JD
3475 (free_frame_tool_bar): Free xg_frame_tb_info if present.
3476
7864a3f7
DA
34772012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3478
3479 Use KSET for write access to Lisp_Object members of struct kboard.
3480 * keyboard.h (KSET): New macro.
3481 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3482 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3483 * xterm.c: Adjust users.
3484
4c31be61
DA
34852012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3486
3487 Use BSET for write access to Lisp_Object members of struct buffer.
3488 * buffer.h (BSET): New macro.
3489 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3490 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3491 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3492 * window.c, xdisp.c, xfns.c: Adjust users.
3493
14ae4239
BT
34942012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
3495
3496 * lread.c (syms_of_lread): Initialize Vlexical_binding.
3497
32bcadb4
JD
34982012-08-11 Jan Djärv <jan.h.d@swipnet.se>
3499
3d29b2ce 3500 * nsterm.m (not_in_argv): New function.
fc0c31f8 3501 (application:openFile, application:openTempFile:):
3d29b2ce
JD
3502 (application:openFileWithoutUI:, application:openFiles:): Open file
3503 if not_in_argv returns non-zero (bug#12171).
3504
32bcadb4 3505 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
3506 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
3507 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
3508 (xg_get_font_name): Use those functions/macros here.
3509 Reported by Frans Oilinki <moilinki@gmail.com>.
3510
9ff9402d 35112012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
3512
3513 * unexmacosx.c (copy_data_segment): Copy initialized data in
3514 statically linked libraries from input file rather than memory.
3515
db74a5fc
YM
3516 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
3517 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
3518 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
3519
25e65510
GM
35202012-08-10 Glenn Morris <rgm@gnu.org>
3521
3522 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
3523 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
3524
7961135c
DA
35252012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3526
3527 Fix last change to allow compilation with low optimization levels.
3528 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
3529 Reported by Jan Djärv <jan.h.d@swipnet.se>.
3530
42b3a444
DA
35312012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3532
3533 Use common inline syntax in intervals.h.
3534 * intervals.h (INTERVALS_INLINE): New macro.
3535 Change all users from LISP_INLINE.
3536
9fb0c957
DA
35372012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3538
3539 Define Qnone once for all platforms.
3540 * frame.c (Qnone): Define here.
3541 (syms_of_frame): DEFSYM it.
3542 * lisp.h (Qnone): New declaration.
3543 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
3544 * xfns.c: Remove duplication. Adjust users.
3545
65e8ee52
DA
35462012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3547
3548 Remove unused macros from intervals.h.
3549 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
3550 * intervals.c: Adjust comment.
3551
9b855fd6
EZ
35522012-08-10 Eli Zaretskii <eliz@gnu.org>
3553
3554 * w32fns.c <w32_unicode_gui>: New static variable.
3555 (globals_of_w32fns): Initialize it according to os_subtype.
3556 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3557 testing os_subtype.
3558
39cb9e56 35592012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
3560 Eli Zaretskii <eliz@gnu.org>
3561
3562 Fix bug #10299 with Unicode characters sent by customized
3563 keyboards created by MSKLC.
3564 * w32fns.c (INIT_WINDOW_CLASS): New macro.
3565 (w32_init_class): Use it to initialize the Emacs class with either
3566 ANSI or Unicode API calls.
3567 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3568 later.
3569 (w32_wnd_proc): If the character code sent by WM_CHAR or
3570 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3571 original message. Call DefWindowProcW on NT and later.
3572
9374581a
GM
35732012-08-10 Glenn Morris <rgm@gnu.org>
3574
4b94e8cf
GM
3575 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3576
9374581a
GM
3577 * lisp.h (DIRECTORY_SEP): Let configure set it.
3578
a2752828
DA
35792012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
3580
3581 Use TSET for write access to Lisp_Object slots of struct terminal.
3582 * termhooks.h (TSET): New macro.
3583 * coding.c, terminal.c, xselect.c: Adjust users.
3584
cc92c454
SM
35852012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
3586
3587 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
3588 the failing expression, include them in the error message.
3589 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3590 * lisp.h (internal_condition_case_n): Update declaration.
3591
4cb3e6b3
DA
35922012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3593
3594 Inline functions to examine and change buffer overlays.
3595 * buffer.c (unchain_both): New function.
3596 * buffer.h (buffer_get_overlays, buffer_set_overlays):
3597 (buffer_has_overlays): New function.
3598 (enum overlay_type): New enum.
3599 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3600 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3601
8707c1e5
DA
36022012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3603
3604 Inline functions to examine and change buffer intervals.
3605 * alloc.c (mark_interval_tree): Remove.
3606 (MARK_INTERVAL_TREE): Simplify.
3607 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
3608 * intervals.c (buffer_balance_intervals): New function.
3609 (graft_intervals_into_buffer): Adjust indentation.
3610 (set_intervals_multibyte): Simplify.
3611 * buffer.h (BUF_INTERVALS): Remove.
3612 (buffer_get_intervals, buffer_set_intervals): New function.
3613 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3614 * intervals.c, textprop.c: Adjust users.
3615
ad8c997f
DA
36162012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3617
3618 Inline functions to examine and change string intervals.
3619 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3620 (string_get_intervals, string_set_intervals): New function.
3621 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3622 * lread.c, print.c, textprop.c: Adjust users.
3623
32ac3a6b
GM
36242012-08-08 Glenn Morris <rgm@gnu.org>
3625
3626 * lisp.mk (lisp): Remove language/persian.elc.
3627
77c7bcb1
DA
36282012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3629
3630 Cleanup intervals.
3631 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3632 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
3633 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3634 Adjust comment. Move under #if 0.
77c7bcb1
DA
3635 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3636 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3637
9c08a8d4
DA
36382012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3639
3640 Check total length of intervals with eassert.
3641 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3642 * intervals.c: Change all users to eassert.
3643
26d16b35
EZ
36442012-08-07 Eli Zaretskii <eliz@gnu.org>
3645
14ae4239
BT
3646 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
3647 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
3648 INTERNAL_FIELD in Lisp_Cons.
3649
c644523b
DA
36502012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3651
3652 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
3653 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
3654 name since all xname users are fixed long time ago. Do not
3655 use INTERNAL_FIELD.
3656 (set_symbol_name, set_symbol_function, set_symbol_plist):
3657 (set_symbol_next, set_overlay_plist): New function.
3658 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
3659 (struct Lisp_Overlay): Likewise.
3660 (CVAR, MVAR, SVAR): Remove.
3661 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
3662 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
3663 * xterm.c: Adjust users.
3664 * .gdbinit: Change to use name field of struct Lisp_Symbol
3665 where appropriate.
3666
6a3d20cc
DA
36672012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3668
3669 Basic functions to set Lisp_Object and pointer slots of intervals.
3670 * intervals.h (interval_set_parent, interval_set_object):
3671 (interval_set_left, interval_set_right, interval_set_plist):
3672 (interval_copy_parent): New function.
3673 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
3674 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
3675 Adjust indentation.
6a3d20cc
DA
3676 (INTERVAL_SIZE): Remove. Adjust users.
3677 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3678
4d2b044c
DA
36792012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3680
3681 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3682 * process.h (PGET): Remove.
3683 (struct Lisp_Process): Do not use INTERNAL_FIELD.
3684 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3685
d3d50620
DA
36862012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3687
3688 Drop WGET and revert read access to Lisp_Objects slots of struct window.
3689 * window.h (WGET): Remove.
3690 (struct window): Do not use INTERNAL_FIELD.
3691 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3692 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3693 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3694 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3695 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3696 Adjust users.
3697
d10a51dc
CY
36982012-08-07 Chong Yidong <cyd@gnu.org>
3699
3700 * window.c (Fwindow_edges, Fwindow_pixel_edges)
3701 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3702 (Fdelete_window_internal): Signal an error if the window is not on
3703 a live frame (Bug#12025).
3704
e69b0960
DA
37052012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3706
3707 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3708 * frame.h (FGET): Remove.
3709 (struct frame): Do not use INTERNAL_FIELD.
3710 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3711 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3712 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3713 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3714
25a20a3a
JB
37152012-08-06 Juanma Barranquero <lekktu@gmail.com>
3716
3717 * w32.c: Silence compiler warnings.
3718 (map_w32_filename): Remove unused variable `is_fat'.
3719 (chase_symlinks): Add parentheses around expression.
3720
1c6f11f4
GM
37212012-08-06 Glenn Morris <rgm@gnu.org>
3722
1db4583a
GM
3723 * sysdep.c: Respect BROKEN_GETWD.
3724
1c6f11f4
GM
3725 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3726 Let configure handle it.
3727 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3728
2b90362b
DA
37292012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3730
3731 Use GCALIGNMENT where appropriate.
3732 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3733 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3734 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3735
5f50daf2
EZ
37362012-08-06 Eli Zaretskii <eliz@gnu.org>
3737
14ae4239
BT
3738 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3739 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 3740
cbcc7007
SM
37412012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3742
3743 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3744 that should be sufficient for everyone.
3745
4d365fa4
JD
37462012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3747
3748 * keyboard.c (timer_check_2): Add break so timer_check returns next
3749 timeout.
3750
dd86bd82
DA
37512012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3752
3753 Fix Windows build errors introduced after converting to WGET and WSET.
3754 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3755 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3756
054e1668
JD
37572012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3758
3759 * nsterm.m (ns_frame_rehighlight): Use FSET.
3760
3761 * nsmenu.m (ns_update_menubar): Use FSET.
3762
21238f11
DA
37632012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3764
3765 Separate read and write access to Lisp_Object slots of Lisp_Process.
3766 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3767 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3768
077288cf
DA
37692012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3770
3771 Separate read and write access to Lisp_Object slots of struct window.
3772 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3773 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3774 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3775 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3776 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3777 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3778 Adjust users.
3779
71688bd7
DA
37802012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3781
3782 Fix Windows build errors introduced after converting to FGET and FSET.
3783 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3784 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3785 (w32_judge_scroll_bars): Change to use FSET.
3786 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3787
f99bac93
DA
37882012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3789
3790 Fix replacement typo.
3791 * window.c (replace_window): Set root_window instead of
3792 selected_window. This fixes a total window subsystem
3793 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3794
8c2a0f2d
GM
37952012-08-06 Glenn Morris <rgm@gnu.org>
3796
3797 * lisp.mk (lisp): Add language/persian.elc.
3798
edd74c35
DA
37992012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3800
3801 Separate read and write access to Lisp_Object slots of struct frame.
3802 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3803 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3804 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3805 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3806 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3807
8671676c
AS
38082012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3809
3810 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3811
663e2b3f
DA
38122012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3813
3814 Generalize common compile-time constants.
3815 * lisp.h (header_size, bool_header_size, word_size): Now here.
3816 (struct Lisp_Vector): Add comment.
3817 (struct Lisp_Bool_Vector): Move up to define handy constants.
3818 (VECSIZE, PSEUDOVECSIZE): Simplify.
3819 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3820 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3821 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3822 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3823 * xfont.c, xmenu.c: Use word_size where appropriate.
3824
d32e47af
LM
38252012-08-05 Lawrence Mitchell <wence@gmx.li>
3826
3827 * search.c (Freplace_match): Treat \? in the replacement text
3828 literally (Bug#8161).
3829
e5d9c0d1
CY
38302012-08-05 Chong Yidong <cyd@gnu.org>
3831
3832 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3833 * frame.c (Vdelete_frame_functions):
3834 * emacs.c (Vkill_emacs_hook): Doc fix.
3835
8da0576b
EZ
38362012-08-04 Eli Zaretskii <eliz@gnu.org>
3837
3838 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3839 --with-x-toolkit=no builds.
3840 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3841
02676e5d
CY
38422012-08-04 Chong Yidong <cyd@gnu.org>
3843
3844 * syntax.c (Fmodify_syntax_entry): Doc fix.
3845
97147da9
EZ
38462012-08-04 Eli Zaretskii <eliz@gnu.org>
3847
76151e2c
EZ
3848 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3849 * w32.c (init_environment): Change the default values of many
3850 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
3851 them into environment when they were not already defined.
3852 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 3853 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
3854 (check_windows_init_file): Now external, not static.
3855 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
3856 called when Vload_path is already set up.
3857
3858 * w32.h (check_windows_init_file): Add prototype.
3859
3860 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3861 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3862 compatibility with Posix platforms.
3863 (main): Move the call to check_windows_init_file to here from
3864 w32.c.
3865 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3866 any, in the DEFALT argument into the root of the Emacs build or
3867 installation tree, as appropriate.
3868
3869 * callproc.c (init_callproc_1): Call decode_env_path instead of
3870 doing its equivalent by hand.
3871 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3872 the code that sets Vexec_path run on MS-Windows.
3873
3874 * lread.c (init_lread): Add comments to #ifdef's.
3875
97147da9
EZ
3876 * msdos.c (dos_set_window_size, IT_update_begin)
3877 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3878 instead of direct references.
3879
185ee146
PE
38802012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3881
3882 Export DEFAULT_REHASH_* to GDB.
3883 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3884 Now constants, not macros.
3885
8834c57a
PE
38862012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3887
98c6f1e3
PE
3888 Remove unnecessary casts involving pointers.
3889 These casts are no longer needed now that we assume C89 or later,
3890 since they involve casting to or from void *.
3891 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3892 (make_pure_float, make_pure_vector):
3893 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3894 * macros.c (Fstart_kbd_macro):
3895 * menu.c (find_and_return_menu_selection):
3896 * minibuf.c (read_minibuf_noninteractive):
3897 * sysdep.c (closedir):
3898 * xdisp.c (x_produce_glyphs):
3899 * xfaces.c (compare_fonts_by_sort_order):
3900 * xfns.c (x_real_positions, select_visual):
3901 * xselect.c (x_stop_queuing_selection_requests)
3902 (x_get_window_property, x_get_window_property_as_lisp_data):
3903 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3904 Remove unnecessary pointer casts.
3905 * alloc.c (record_xmalloc): New function.
3906 * lisp.h (record_xmalloc): New decl.
3907 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3908 more like a function. This is because the pointer cast is not
3909 needed. All uses changed.
3910 * print.c (print_string, print_error_message): Avoid length recalc.
3911
8834c57a
PE
3912 Improve fix for macroexp crash with debugging (Bug#12118).
3913 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3914 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3915 not supposed to be invoked from the garbage collector.
3916 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3917 (gc_aset): New function, which is like ASET but can be
3918 used in the garbage collector.
3919 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3920 (set_hash_index): Use it instead of ASET.
3921
6dad7178
EZ
39222012-08-03 Eli Zaretskii <eliz@gnu.org>
3923
3924 Support symlinks on latest versions of MS-Windows.
3925 * w32.c: Include winioctl.h and aclapi.h.
3926 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3927 (revert_to_self): Forward declarations of static functions.
3928 <static BOOL g_b_init_get_security_info>:
3929 <g_b_init_create_symbolic_link>: New static flags.
3930 (globals_of_w32): Initialize them to zero.
3931 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3932 (map_w32_filename): Improve commentary. Simplify switch.
3933 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3934 headers (most versions of MinGW w32api don't).
3935 (get_security_info, create_symbolic_link)
3936 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3937 New functions.
3938 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3939 in the argument file name.
3940 (sys_access): Call unc_volume_file_attributes only if
3941 GetFileAttributes fails with network-related error codes.
3942 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3943 have the required privileges.
14ae4239 3944 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
3945 get_file_security_desc.
3946 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
3947 with addition of handling of symlinks and support for 'lstat'.
3948 If possible, get file's attributes and security information by
6dad7178
EZ
3949 handle, not by name. Produce S_IFLNK bit for symlinks, when
3950 called from 'lstat'.
3951 (stat, lstat): New functions, call 'stat_worker'.
3952 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3953 symlinks when the underlying filesystem supports them.
3954
f162bcc3
PE
39552012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3956
79ea6c20
PE
3957 Fix macroexp crash on Windows with debugging (Bug#12118).
3958 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3959 checking subscripts; problem introduced with the recent
3960 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3961 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3962 since it's used in non-static inline functions now.
3963
c0ce93fd
PE
3964 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3965 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 3966
f162bcc3
PE
3967 Use C99-style 'extern inline' if available.
3968 * buffer.h (BUFFER_INLINE):
3969 * category.h (CATEGORY_INLINE):
3970 * character.h (CHARACTER_INLINE):
3971 * charset.h (CHARSET_INLINE):
3972 * composite.h (COMPOSITE_INLINE):
3973 * dispextern.h (DISPEXTERN_INLINE):
3974 * lisp.h (LISP_INLINE):
3975 * systime.h (SYSTIME_INLINE):
3976 New macro, replacing 'static inline' in this header.
3977 * buffer.h, category.h, character.h, charset.h, composite.h:
3978 * dispextern.h, lisp.h, systime.h:
3979 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3980 * alloc.c (LISP_INLINE):
3981 * buffer.c (BUFFER_INLINE):
3982 * category.c (CATEGORY_INLINE):
3983 * character.c (CHARACTER_INLINE):
3984 * charset.c (CHARSET_INLINE):
3985 * composite.c (COMPOSITE_INLINE):
3986 * dispnew.c (DISPEXTERN_INLINE):
3987 * sysdep.c (SYSTIME_INLINE):
3988 Define to EXTERN_INLINE, so that the corresponding functions
3989 are compiled into code.
3990 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3991 (INLINE_HEADER_END): New macros.
3992 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3993 since it's used in non-static inline functions now.
a8333d03 3994 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 3995
837b365b
GM
39962012-08-02 Glenn Morris <rgm@gnu.org>
3997
d66b744d
GM
3998 * s/: Remove empty directory.
3999
837b365b
GM
4000 * s/ms-w32.h: Move to ../nt/inc.
4001 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4002 Update for new ms-w32.h location.
4003
13294f95
PE
40042012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4005
4006 Port to Solaris 8.
4007 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4008
90df0db3
GM
40092012-08-02 Glenn Morris <rgm@gnu.org>
4010
4011 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4012 hard-coding the path separator.
4013
4939150c
PE
40142012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4015
4016 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4017 This how ASET and AREF are supposed to work, and makes
4018 it easier to think about future improvements. See
4019 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4020 * charset.h (set_charset_attr): New function.
4021 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4022 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4023 (aref_addr): New function. All uses of &AREF(...) changed.
4024 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4025 (set_hash_index): New functions. All lvalue-style uses of
4026 HASH_KEY etc. changed.
4027 * keyboard.c (set_prop): New function. All lvalue-style uses
4028 of PROP changed.
4029
947b2afd
AA
40302012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4031
4032 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4033 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
4034 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
4035 * nsfns.m (ns_set_name_as_filename): Likewise.
4036 * nsmenu.m (ns_update_menubar): Likewise.
4037 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4038
4f5d0325
EZ
40392012-08-01 Eli Zaretskii <eliz@gnu.org>
4040
2008beae
EZ
4041 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4042 Adapt to latest changes in field names of the corresponding Lisp
288479f6 4043 objects.
2008beae 4044
4f5d0325
EZ
4045 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4046
fe3cc771
GM
40472012-08-01 Glenn Morris <rgm@gnu.org>
4048
4049 * s/msdos.h: Remove file.
4050 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4051 * Makefile.in (S_FILE): Remove.
4052 (config_h): Remove S_FILE.
4053
c90acc54
JB
40542012-08-01 Juanma Barranquero <lekktu@gmail.com>
4055
4056 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4057 Remove; moved to nt/config.nt.
4058
d8a05828
DA
40592012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4060
4061 Use INTERNAL_FIELD for conses and overlays.
4062 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4063 Remove obsolete comment.
4064 (MVAR): New macro.
4065 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4066 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4067
8271d590
DA
40682012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4069
4070 Use INTERNAL_FIELD for symbols.
4071 * lisp.h (SVAR): New macro. Adjust users.
4072 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4073 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4074
3193acd2
DA
40752012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4076
4077 Use INTERNAL_FIELD for processes.
4078 * process.h (PVAR): New macro. Adjust style.
4079 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4080 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4081
3a45383a
DA
40822012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4083
4084 Use INTERNAL_FIELD for windows.
4085 * window.h (WVAR): New macro.
4086 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4087 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4088 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4089 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4090 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4091 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4092
c1dbc63c
PE
40932012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4094
4095 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4096
5c0c0e8a
GM
40972012-08-01 Glenn Morris <rgm@gnu.org>
4098
4099 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4100 Move to configure.ac.
4101
552a99b4
JB
41022012-08-01 Juanma Barranquero <lekktu@gmail.com>
4103
4104 * makefile.w32-in (CONFIG_H): Update dependencies.
4105 (CONF_POST_H): New macro.
4106
4107 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4108
8d8e2dfe
GM
41092012-07-31 Glenn Morris <rgm@gnu.org>
4110
bc96620a
GM
4111 * Makefile.in (S_FILE): No longer set by configure.
4112
476b1b2d
GM
4113 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4114 is available.
4115 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4116
b2c7a106
GM
4117 * process.h (NULL_DEVICE):
4118 * emacs.c (SEPCHAR):
4119 * editfns.c (USER_FULL_NAME): Let configure set them.
4120
d53d062a
GM
4121 * s/README, s/template.h: Remove files.
4122
4515017f
GM
4123 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4124
8d8e2dfe
GM
4125 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4126 Move to configure.ac.
4127
5b20b3cc
EZ
41282012-07-31 Eli Zaretskii <eliz@gnu.org>
4129
1e0afd9a
EZ
4130 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4131 resulting renaming of 'struct frame' members.
4132
5b20b3cc
EZ
4133 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4134
4135 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4136 after introduction of FVAR.
4137
f1310128
JD
41382012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4139
79e721e0
JD
4140 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4141
4142 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4143 instead of compositeToPoint.
4144 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4145
8d7c7eed 4146 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 4147
e34f7f79
DA
41482012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4149
4150 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4151 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 4152 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
4153 (BVAR): Change to use INTERNAL_FIELD.
4154 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
4155 (KVAR): Change to use INTERNAL_FIELD.
4156 * frame.h (FVAR): New macro.
4157 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
4158 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
4159 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
4160 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
4161 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4162
c09bfb2f
DA
41632012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4164
4165 Miscellaneous fixes for non-default X toolkits.
4166 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
4167 * xterm.c (x_frame_of_widget): Remove redundant prototype.
4168 Move under #ifdef USE_LUCID.
4169 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
4170 definition and usage to avoid warnings.
4171
14c114ae
JD
41722012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4173
4174 * nsterm.m (openFiles): Fix previous checkin.
4175
3bd21e82
PE
41762012-07-31 Paul Eggert <eggert@cs.ucla.edu>
4177
4178 * indent.c (compute_motion): Remove unused local.
4179
c1529ded
GM
41802012-07-31 Glenn Morris <rgm@gnu.org>
4181
400d5621
GM
4182 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
4183
268e2432
GM
4184 * conf_post.h [USG5_4]:
4185 Move remaining contents of s/usg5-4-common.h here.
4186 * s/usg5-4-common.h: Remove file.
4187
7552f3ee
GM
4188 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
4189 * s/irix6-5.h: Remove file.
4190
6a381852
GM
4191 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
4192 * s/darwin.h: Remove file.
4193
c1529ded
GM
4194 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
4195 * s/hpux10-20.h: Remove file, which is now empty.
4196
b429a4ee
GM
41972012-07-30 Glenn Morris <rgm@gnu.org>
4198
4199 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
4200 * Makefile.in (config_h): Add conf_post.h.
4201 * makefile.w32-in (CONFIG_H): Add conf_post.h.
4202
adff3182
JD
42032012-07-30 Jan Djärv <jan.h.d@swipnet.se>
4204
4205 * nsterm.m (ns_do_open_file): New variable.
b9031d69 4206 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
4207 (openFile, openTempFile, openFileWithoutUI, openFiles):
4208 Open files only if ns_do_open_file.
adff3182 4209
c32af1e4
PE
42102012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4211
7393bcbb
PE
4212 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
4213 This no-op macro hasn't been needed for many years.
4214 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
4215
c32af1e4
PE
4216 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
4217 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
4218 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
4219 gdb_make_enums_visible.
4220 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
4221 (DIRECTORY_SEP): Now a constant, not a macro.
4222
302fc036
EZ
42232012-07-30 Eli Zaretskii <eliz@gnu.org>
4224
4225 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
4226 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
4227
4228 * w32term.c <w32_keyboard_codepage>: Renamed from
4229 keyboard_codepage and now external. All users changed.
4230
4231 * w32term.h: Add declaration of w32_keyboard_codepage.
4232
4233 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
4234 the codepage to translate keys to Unicode. If this argument is
4235 -1, use the value returned by GetConsoleCP. All callers changed.
4236
88fb40b4
PE
42372012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4238
0aee6912
PE
4239 Update .PHONY listings in makefiles.
4240 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
4241 bootstrap-clean, distclean, maintainer-clean, versioclean,
4242 extraclean, frc.
4243
88fb40b4
PE
4244 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
4245 This is a bit clearer. Fix some commentary typos.
4246
0a763bd1
GM
42472012-07-30 Glenn Morris <rgm@gnu.org>
4248
32bac6d6
GM
4249 * s/netbsd.h: Let configure include signal.h if needed.
4250 Remove file, which is now empty.
4251
b65e7c46
GM
4252 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
4253 Let configure set them.
4254 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
4255 No more need to undefine.
0a763bd1 4256
169304bd
AS
42572012-07-30 Andreas Schwab <schwab@linux-m68k.org>
4258
4259 * keymap.c (Fkey_description): Don't remove 0x80 bit from
4260 non-single-byte char when adding meta modifier. (Bug#12090)
4261
6cd7a139
DA
42622012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4263
4264 Convert safe_call to use variable number of arguments.
4265 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
4266 (safe_call2): Fix comment.
4267 * lisp.h (safe_call): Adjust prototype.
4268 * coding.c (encode_coding_object): Change to use safe_call2.
4269 * xfaces.c (merge_face_heights): Change to use safe_call1.
4270
d34d6ffc
GM
42712012-07-30 Glenn Morris <rgm@gnu.org>
4272
7b8a48e4 4273 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 4274 does that unconditionally. Remove file, which is now empty.
7b8a48e4 4275
d34d6ffc
GM
4276 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
4277 Remove empty files.
4278
03a660a6
PE
42792012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4280
4281 Export to GDB most of lisp.h's remaining object-like macros.
4282 * lisp.h (min, max): Move earlier, because they're used earlier now.
4283 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
4284 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
4285 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
4286 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
4287 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
4288 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
4289 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
4290 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
4291 Now constants, for GDB. They need not be macros.
4292 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
4293 Now constants, for GDB, as well as macros, for static initializers.
4294 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
4295 Move to after the definition of struct Lisp_Char_Table,
4296 since the former now needs that type defined.
4297 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
4298 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
4299 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
4300 New enums, for gdb_make_enums_visible.
4301 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 4302 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
4303 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
4304 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
4305 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
4306 enum maxargs, enum MAX_ALLOCA.
4307 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
4308 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
4309 no longer needed, now that they are done in lisp.h.
4310
e499d0ee
DA
43112012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4312
4313 Cleanup string bytes checking.
4314 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
4315 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
4316 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
4317 (check_sblock, compact_small_strings): Simplify.
4318
d5040d2d
PE
43192012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4320
4321 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
4322 These macros are confusing and no longer need to be defined, as
4323 the enum values now suffice. All uses replaced with definiens.
4324 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
4325
7f259ae6
JB
43262012-07-29 Juanma Barranquero <lekktu@gmail.com>
4327
4328 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
4329 ($(BLD)/w32console.$(O)): Update dependencies.
4330
7e63e0c3
DA
43312012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4332
4333 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
4334 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
4335 time. Adjust users.
4336 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
4337
ffd817eb
JD
43382012-07-29 Jan Djärv <jan.h.d@swipnet.se>
4339
4340 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
4341 setting sitelisp (Bug#12010).
4342
417a7a0e
EZ
43432012-07-29 Eli Zaretskii <eliz@gnu.org>
4344
14ae4239 4345 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
4346
4347 * w32heap.c (cache_system_info):
4348 * w32.c (sys_rename):
4349 * w32proc.c (find_child_console, sys_kill): All users changed.
4350
387d4d92
PE
43512012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4352
4353 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4354
55a6cca6
EZ
43552012-07-29 Eli Zaretskii <eliz@gnu.org>
4356
4357 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
4358
dbcf001c
DA
43592012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4360
4361 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
4362 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
4363 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 4364
e2688e4a
DA
43652012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4366
4367 Generalize marker debugging code under MARKER_DEBUG and use eassert.
4368 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
4369 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
4370 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
4371 (replace_range, replace_range_2, del_range_2): Change to eassert.
4372 * marker.c (byte_char_debug_check): Adjust style.
4373
b46a6a83
PE
43742012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4375
4376 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4377 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4378 long-ago-commented-out code that talks about "WIN32".
4379 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4380 All uses changed.
4381
e32a5799
PE
43822012-07-28 Paul Eggert <eggert@cs.ucla.edu>
4383
4384 Use Gnulib stdalign module (Bug#9772, Bug#9960).
4385 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4386 Simplify by using alignof.
4387 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4388 * lisp.h: Include <stdalign.h>.
4389 (GCALIGNMENT): New macro and constant.
4390 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
4391 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4392 (stdalign): New macro, if not already defined.
4393
df81cd29
EZ
43942012-07-28 Eli Zaretskii <eliz@gnu.org>
4395
01bd1b0d
EZ
4396 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
4397 * w32inevt.c: Include w32inevt.h.
4398 (w32_read_console_input): New inline function, calls either
4399 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4400 w32_console_unicode_input.
4401 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4402 (w32_kbd_patch_key, key_event): Use the codepage returned by
4403 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4404 (key_event): use uChar.UnicodeChar only if
4405 w32_console_unicode_input is non-zero.
4406
4407 * w32console.c: Include w32heap.h.
4408 <w32_console_unicode_input>: New global variable.
4409 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4410 family of Windows, zero otherwise.
4411
4412 * w32inevt.h: Declare w32_console_unicode_input.
4413
df81cd29
EZ
4414 * xdisp.c (init_iterator): Don't reference tip_frame in a build
4415 --without-x. (Bug#11742)
4416
c20fdd9e
PE
44172012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4418
4419 Adjust GDB to reflect pvec_type changes (Bug#12036).
4420 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
4421 2012-07-04 changes to pseudovector representation.
4422 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 4423
32770973 44242012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
4425
4426 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4427 bus address.
4428 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4429
3438fe21
EZ
44302012-07-27 Eli Zaretskii <eliz@gnu.org>
4431
bcfbc9de
EZ
4432 * alloc.c (listn): Fix the order the arguments are consed onto the
4433 list.
4434
3438fe21
EZ
4435 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4436 enumeration constants, as PURE and HEAP are too general, and clash
4437 with other headers and sources, such as gmalloc.c and the
4438 MS-Windows system headers. All users changed.
4439
eeaea515
DA
44402012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4441
4442 Revert last save_excursion_save and save_excursion_restore changes.
4443 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4444 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4445
073c88c2
DA
44462012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4447
4448 Fix recently-introduced typos in Windows port.
4449 Reported by Martin Rudalics <rudalics@gmx.at>.
4450 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 4451 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 4452
4706125e
PE
44532012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4454
4455 Improve GDB symbol export (Bug#12036).
4456 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4457 arms of an 'if', not using conditional expressions; otherwise GDB
4458 complains about the types in the unevaluated arm when the argument
4459 is an integer literal.
4460 (xgetint): Simplify expression.
4461 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4462 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4463 Zaretskii in <http://bugs.gnu.org/12036#13>.
4464 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4465 needed now that we have gdb_make_enums_visible.
4466 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4467 (enum enum_USE_LSB_TAG):
4468 New enum types, packaging up enums that need to be exported to GDB.
4469
694b6c97
DA
44702012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4471
4472 Utility function to make a list from specified amount of objects.
4473 * lisp.h (enum constype): New datatype.
4474 (listn): New prototype.
4475 * alloc.c (listn): New function.
4476 (Fmemory_use_count, syms_of_alloc): Use it.
4477 * buffer.c (syms_of_buffer): Likewise.
4478 * callint.c (syms_of_callint): Likewise.
4479 * charset.c (define_charset_internal): Likewise.
4480 * coding.c (syms_of_coding): Likewise.
4481 * keymap.c (syms_of_keymap): Likewise.
4482 * search.c (syms_of_search): Likewise.
4483 * syntax.c (syms_of_syntax): Likewise.
4484 * w32.c (init_environment): Likewise.
4485 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4486 * xdisp.c (syms_of_xdisp): Likewise.
4487 * xfns.c (syms_of_xfns): Likewise.
4488
6195f384
DA
44892012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4490
4491 Fast save_excursion_save and save_excursion_restore.
4492 * lisp.h (struct Lisp_Excursion): New data type.
4493 (PVEC_EXCURSION): New pseudovector type.
4494 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
4495 to deal with it. Adjust comments.
4496 (init_marker, attach_marker): New prototype.
4497 (unchain_marker): Adjust prototype.
4498 * marker.c (attach_marker): Change to global.
4499 (init_marker): New function.
4500 * alloc.c (Fmake_marker, build_marker): Use it.
4501 (build_marker): More easserts.
4502 (mark_object): Handle struct Lisp_Excursion.
4503 * editfns.c (save_excursion_save, save_excursion_restore):
4504 Reimplement to use struct Lisp_Excursion. Add comments.
4505
5eceb8fb
PE
45062012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4507
4508 Fix export of symbols to GDB (Bug#12036).
4509 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
4510 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
4511 emacs.c, as this is a more-suitable home. Had this been done earlier
4512 the fix for 12036 would have avoided some of the problems noted in
4513 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
4514 would have been more obvious.
562157c8
PE
4515 * emacs.c: Do not include <verify.h>; no longer needed.
4516 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
4517 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
4518 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4519 Remove; now done in lisp.h.
4520 * lisp.h (PUBLISH_TO_GDB): New macro.
4521 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
4522 (DATA_SEG_BITS): Use it.
4523 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
4524 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
4525 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
4526 not be usable in #if. This simplifies things.
4527
d6749401
JB
45282012-07-26 Juanma Barranquero <lekktu@gmail.com>
4529
4530 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
4531
1781b9e9
PE
45322012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4533
d89518db 4534 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
4535 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
4536 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
4537 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
4538 Adjust to changes in lisp.h and emacs.c, by using
4539 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
4540 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
4541 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
4542 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
4543 instead of gdb_valbits.
4544 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
4545 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
4546 instead of gdb_array_mark_flag.
4547 (xboolvector): Get size from $->size, not $->header.size.
4548 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
4549 (xreload, hook-run, hookpost-run): Remove.
4550 * emacs.c: Include <verify.h>.
4551 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
4552 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
4553 Remove.
4554 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
4555 (gdb_USE_LSB_TAG): New enum constants.
4556 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4557 Also define these as enum constants, so they're visible to GDB.
4558 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4559 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4560 as constants, so they're visible to GDB.
4561 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4562 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4563 Now enum constants, not macros, so they're visible to GDB.
4564 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4565 more convenient now. All uses changed.
4566 (VALMASK) [USE_LSB_TAG]: Also define in this case.
4567 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4568
3628596a
DA
45692012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
4570
4571 Explicitly free restriction data that are not needed anymore.
4572 * editfns.c (save_restriction_restore): Free restriction data.
4573
7abaf5cc
SM
45742012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
4575
4576 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4577 add argument, tune behavior, and adjust all callers.
4578
71f88e00
PE
45792012-07-25 Paul Eggert <eggert@cs.ucla.edu>
4580
4581 Use typedef for EMACS_INT, EMACS_UINT.
4582 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4583 than macros. This simplifies debugging in the usual case, since
4584 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4585 and it allows expressions involving EMACS_INT casts.
4586 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4587
57ec3034
JD
45882012-07-25 Jan Djärv <jan.h.d@swipnet.se>
4589
4590 * nsterm.m (ns_read_socket): Return early if there is a modal
4591 window (Bug#12043).
4592
8137e7b3
MR
45932012-07-25 Martin Rudalics <rudalics@gmx.at>
4594
4595 * frame.c (Fredirect_frame_focus): In doc-string don't mention
4596 that FOCUS-FRAME can be omitted.
4597
04e9897c
DA
45982012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
4599
4600 Adjust buffer text indirection counters at the end of Fkill_buffer.
4601 * buffer.c (Fkill_buffer): Adjust indirection counters when the
4602 buffer is definitely dead. This should really fix an issue reported
4603 by Christoph Scholtes again. (Bug#12007).
4604 (init_buffer_once): Initialize indirection counters of
4605 buffer_defaults and buffer_local_symbols (for sanity and safety).
4606
8a0484e1
EZ
46072012-07-24 Eli Zaretskii <eliz@gnu.org>
4608
4609 * xdisp.c (init_iterator): Don't compute dimensions of truncation
4610 and continuation glyphs on tooltip frames, leave them at zero.
4611 Avoids continued lines in tooltips. (Bug#11832)
4612
fa691a83
DA
46132012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
4614
4615 Simplify copy_overlay.
04e9897c 4616 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
4617 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4618
436bc8e0
EZ
46192012-07-23 Eli Zaretskii <eliz@gnu.org>
4620
4621 * print.c (print_object): Don't crash when a frame's name is nil
4622 or invalid. (Bug#12025)
4623
4624 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4625 it signals an error when a tooltip frame is being created.
4626
d7a7fda3
DA
46272012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4628
4629 Cleanup miscellaneous objects allocation and initialization.
4630 * alloc.c (allocate_misc): Change to static. Add argument to
4631 specify the subtype. Adjust comment and users.
4632 (build_overlay): New function.
4633 * buffer.c (copy_overlays, Fmake_overlay): Use it.
4634 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4635 (allocate_misc): Remove prototype.
4636 (build_overlay): Add prototype.
4637
46382012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
4639
4640 Swap buffer text indirection counters in Fbuffer_swap_text.
4641 * buffer.c (Fbuffer_swap_text): Swap indirections too.
4642 This avoids crash reported by Christoph Scholtes at
4643 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4644
9d7fa573
JD
46452012-07-22 Jan Djärv <jan.h.d@swipnet.se>
4646
4647 * nsmenu.m (Popdown_data): New struct.
4648 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
4649 free Popdown_data.
4650 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
4651 (initWithContentRect): Make imgView and contentView non-static
4652 and autorelease them. Also autorelease img and matrix (Bug#12005).
4653 (dealloc): Remove (Bug#12005).
4654
0dd6d66d
DA
46552012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4656
4657 Adjust consing_since_gc when objects are explicitly freed.
4658 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
4659 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
4660 (free_cons, free_misc): Subtract object size from consing_since_gc.
4661
d36d71df
DA
46622012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4663
4664 Simplify and cleanup markers positioning code.
4665 * marker.c (attach_marker): More useful eassert.
4666 (live_buffer, set_marker_internal): New function.
4667 (Fset_marker, set_marker_restricted): Use set_marker_internal.
4668 (set_marker_both, set_marker_restricted_both): Use live_buffer.
4669
fb9ea40f
PE
46702012-07-22 Paul Eggert <eggert@cs.ucla.edu>
4671
4672 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
4673 as it's limited by the amount of memory, not by INT_MAX.
4674
2d5c5f7d
EZ
46752012-07-21 Eli Zaretskii <eliz@gnu.org>
4676
07fb592e
EZ
4677 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
4678 in special-event-map. See the discussion at
4679 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4680 for the reasons.
4681
37a9eac8 4682 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
4683 info.dwItemData. Fixes crashes on 64-bit Windows.
4684 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 4685
c4328746
JD
46862012-07-21 Jan Djärv <jan.h.d@swipnet.se>
4687
fc0c31f8 4688 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 4689 (conversationIdentifier): Return value is NSInteger.
784051c4 4690 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 4691
6e5d1c12
CY
46922012-07-21 Chong Yidong <cyd@gnu.org>
4693
4694 * window.c (decode_any_window): Signal an error if the window is
4695 on a dead frame (Bug#11984).
4696
9928463d
DA
46972012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4698
4699 Add indirection counting to speed up Fkill_buffer.
4700 * buffer.h (struct buffer): New member.
4701 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4702 (Fmake_indirect_buffer): Set indirection counter to -1, increment
4703 base buffer indirection counter.
4704 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4705 (Fkill_buffer): Adjust indirection counters as needed, don't walk
4706 through buffer list if indirection counter is 0.
4707
f8643a6b
DA
47082012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4709
4710 Extend the value returned by Fgarbage_collect with heap statistics.
4711 * alloc.c (Qheap): New symbol.
4712 (syms_of_alloc): DEFSYM it.
4713 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4714 (Fmemory_free): Remove.
4715 (syms_of_alloc): Don't defsubr it.
4716 * buffer.c (Fcompact_buffer): Remove.
4717 (syms_of_buffer): Don't defsubr it.
4718
dac616ff
DA
47192012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4720
4721 Make maybe_gc inline.
4722 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4723 * lisp.h (consing_since_gc, gc_relative_threshold)
4724 (memory_full_cons_threshold): Revert declaration.
4725 (maybe_gc): Remove prototype, define as inline.
4726 * alloc.c: Remove old commented-out code.
4727 (consing_since_gc, gc_relative_threshold)
4728 (memory_full_cons_threshold): Revert to global.
4729 (maybe_gc): Remove.
4730
d7ea76b4
DA
47312012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4732
4733 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4734 * lisp.h (build_unibyte_string): New function.
4735 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4736 * sysdep.c, w32fns.c, xfns.c: Use it.
4737 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4738 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4739 Adjust users accordingly.
4740 * font.h (font_open_by_name): Adjust prototype.
4741
765e61e3
DA
47422012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4743
4744 Cleanup calls to Fgarbage_collect.
4745 * lisp.h (maybe_gc): New prototype.
4746 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4747 Remove declarations.
4748 * alloc.c (maybe_gc): New function.
4749 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4750 Make them static.
4751 * bytecode.c (MAYBE_GC): Use maybe_gc.
4752 * eval.c (eval_sub, Ffuncall): Likewise.
4753 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4754 to avoid dependency from auto-save feature.
4755
52b852c7
PE
47562012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4757
4758 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4759 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4760 'for_each_per_buffer_object_at'.
4761 All uses changed. It's better to use upper-case for macros that
4762 cannot be implemented as functions, to give the reader a clue
4763 that they're special.
4764
5db81e33
SM
47652012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4766
4767 * alloc.c (Fgarbage_collect): Tweak docstring.
4768
5b835e1d
DA
47692012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4770
4771 Tweak the value returned from Fgarbage_collect again.
4772 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4773 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4774 Adjust documentation.
4775 (total_vector_bytes): Rename to total_vector_slots, adjust
4776 accounting.
4777 (total_free_vector_bytes): Rename to total_free_vector_slots,
4778 adjust accounting.
4779 (Qstring_bytes, Qvector_slots): New symbols.
4780 (syms_of_alloc): DEFSYM them.
4781
9cd47b72
DA
47822012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4783
4784 Buffer compaction primitive which may be used from Lisp.
4785 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4786 (syms_of_buffer): Register Fcompact_buffer.
4787 * alloc.c (Fgarbage_collect): Use compact_buffer.
4788 * buffer.h (compact_buffer): New prototype.
4789 (struct buffer_text): New member.
4790
d17337e5
DA
47912012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4792
4793 New macro to iterate over all buffers, miscellaneous cleanups.
4794 * lisp.h (all_buffers): Remove declaration.
4795 * buffer.h (all_buffers): Add declaration, with comment.
4796 (for_each_buffer): New macro.
4797 * alloc.c (Fgarbage_collect, mark_object): Use it.
4798 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4799 (init_buffer): Likewise.
4800 * data.c (Fset_default): Likewise.
4801 * coding.c (code_conversion_restore): Remove redundant check
4802 for dead buffer.
4803 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4804
60cfd278
AS
48052012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4806
4807 Fix bug that created negative-length intervals.
4808 * intervals.c (merge_interval_right, merge_interval_left):
4809 Do not zero out this interval if it is absorbed by its children,
4810 as this interval's total length doesn't change in that case. See
4811 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4812
d06714cb
PE
48132012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4814
83713154
PE
4815 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4816 when invoking (make-bool-vector N t) and N is a positive
4817 multiple of 8 -- the last 8 bits were mistakenly cleared.
4818
d06714cb
PE
4819 Remove some struct layout assumptions in bool vectors.
4820 * alloc.c (bool_header_size): New constant.
4821 (header_size, word_size): Move earlier, as they're now used earlier.
4822 Use 'word_size' in a few more places, where it's appropriate.
4823 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4824 padding before the data member of a bool vector.
4825 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4826 than doing the check by hand with an abort ().
4827
464d5a5e
SM
48282012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4829
5fbc0409
SM
4830 * eval.c (Fdefvar): Don't check constants since we only set the var if
4831 it's not yet defined anyway (bug#11904).
4832
464d5a5e
SM
4833 * lisp.h (last_undo_boundary): Declare new var.
4834 * keyboard.c (command_loop_1): Set it.
4835 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4836 were auto-added by the command loop (bug#11774).
4837
8dc2e44a
AS
48382012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4839
4840 * w32font.c (Qsymbol): Remove local definition.
4841 (syms_of_w32font): Don't DEFSYM it.
4842
169925ec
DA
48432012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4844
4845 Fix sweep_vectors to handle large bool vectors correctly.
4846 * alloc.c (sweep_vectors): Account total_vector_bytes for
4847 bool vectors larger than VBLOCK_BYTES_MAX.
4848
5fbfb018
CY
48492012-07-18 Chong Yidong <cyd@gnu.org>
4850
4851 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4852 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4853
3ab6e069
DA
48542012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4855
4856 Return more descriptive data from Fgarbage_collect.
4857 Suggested by Stefan Monnier in
4858 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4859 * alloc.c (bounded_number): New function.
4860 (total_buffers, total_vectors): New variable.
4861 (total_string_size): Rename to total_string_bytes, adjust users.
4862 (total_vector_size): Rename to total_vector_bytes, adjust users.
4863 (sweep_vectors): Account total_vectors and total_vector_bytes.
4864 (Fgarbage_collect): New return value. Adjust documentation.
4865 (gc_sweep): Account total_buffers.
4866 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4867 (VECTOR_SIZE): Remove.
4868 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4869 (Qinterval, Qmisc): New symbols.
4870 (syms_of_data): Initialize them.
4871 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4872 (Qcons, Qbuffer): New declarations.
4873
6d02fe5b
PE
48742012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4875
4876 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4877 Round up, not down. Improve doc.
4878
b7ffe040
DA
48792012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4880
4881 Restore old code in allocate_string_data to avoid Faset breakage.
4882 Reported by Julien Danjou <julien@danjou.info> in
4883 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4884 * alloc.c (allocate_string_data): Restore old code with minor
4885 adjustments, fix comment to explain this subtle issue.
4886
4dc7c8d5
SM
48872012-07-17 Eli Zaretskii <eliz@gnu.org>
4888
4889 Remove FILE_SYSTEM_CASE.
4890 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4891
4892 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4893 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4894 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4895 call-process-region passes it through expand-file-name.
4896
4897 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4898
48992012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4900
4901 Fix crash when creating indirect buffer (Bug#11917)
4902 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4903 Don't handle unbound variables specially if non-zero.
4904 (Fbuffer_local_variables): Pass zero.
4905 (clone_per_buffer_values): Pass non-zero.
4906
49072012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4908
4909 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4910 to make the loop interruptible.
4911
49122012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4913
4914 * gnutls.c (emacs_gnutls_handshake): Only retry if
4915 GNUTLS_E_INTERRUPTED.
4916
cce7fefc
DA
49172012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4918
4919 Cleanup and convert miscellaneous checks to eassert.
4920 * alloc.c (mark_interval): Fix comment, partially rephrase
4921 old comment from intervals.h (see below).
4922 * intervals.c (find_interval, adjust_intervals_for_insertion)
4923 (delete_interval, adjust_intervals_for_deletion)
4924 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4925 Convert to eassert.
4926 (adjust_intervals_for_insertion, make_new_interval):
4927 Remove obsolete and unused code.
4928 * intervals.h (struct interval): Remove obsolete comment.
4929 * textprotp.c (erase_properties): Remove unused code.
4930 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4931 (Fremove_list_of_text_properties): Convert to eassert.
4932
9ea10cc3
CY
49332012-07-17 Chong Yidong <cyd@gnu.org>
4934
4935 * editfns.c (Finsert_char): Doc fix.
4936
3900d5de
DA
49372012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4938
4939 Fix previous change to make Fmemory_free always accurate.
4940 * alloc.c (make_interval): Update total_free_intervals.
4941 (make_float): Likewise for total_free_floats.
4942 (free_cons, Fcons): Likewise for total_free_conses.
4943 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4944 Likewise for total_free_vector_bytes.
4945 (Fmake_symbol): Likewise for total_free_symbols.
4946 (bytes_free): Remove.
4947
7098646f
DA
49482012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4949
4950 Simple free memory accounting feature.
4951 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4952 (sweep_vectors): Accumulate size of free vectors.
4953 (Fgarbage_collect): Setup bytes_free.
4954 (Fmemory_free): New function.
4955 (syms_of_alloc): Register it.
4956
22657b40
DA
49572012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4958
4959 Cleanup overlays checking.
4960 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4961 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4962 eassert and OVERLAYP.
4963 (sort_overlays): Change to use OVERLAYP.
4964
ddfc8813
RK
49652012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4966
4967 * editfns.c (Finsert_char): Make it interactive, and make the
4968 second arg optional. Copy interactive spec and docstring from
4969 ucs-insert.
4970
7c26cf3c
PE
49712012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4972
4973 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4974 Unlike the other wrapped functions, fabs has an unspecified
4975 effect on errno.
4976
5d127af9
JD
49772012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4978
4979 * nsterm.m (keyDown): Interpret flags without left/right bits
4980 as the left key (Bug#11670).
4981
6a0dd1d7
DA
49822012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4983
4984 Remove empty and useless init functions.
4985 * lisp.h (init_character_once, init_fns, init_image)
4986 (init_filelock, init_sound): Remove prototype.
4987 * character.c (init_character_once): Remove.
4988 * filelock.c (init_filelock): Likewise.
4989 * fns.c (init_fns): Likewise.
4990 * image.c (init_image): Likewise.
4991 * sound.c (init_sound): Likewise.
4992 * emacs.c (main): Adjust accordingly.
4993
7a6136fd
DA
49942012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4995
4996 * gtkutil.h: Tiny cleanups.
4997 (use_old_gtk_file_dialog): Remove useless declaration.
4998 (xg_uses_old_file_dialog): Add suggested const attribute.
4999
ce811ad9
EZ
50002012-07-15 Eli Zaretskii <eliz@gnu.org>
5001
5002 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5003 (bidi_paragraph_init): Use it to limit search forward for a strong
5004 directional character in abnormally large paragraphs full of
5005 neutral or weak characters. (Bug#11943)
5006
c9adfeaa
SF
50072012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5008
5009 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5010 the toolbar (Bug#9451).
5011 (xg_make_tool_item): Give the widget event box a transparent
5012 background.
5013
fff62aa9
DA
50142012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5015
5016 Cleanup basic allocation variables and functions.
5017 * alloc.c (ignore_warnings, init_intervals, init_float)
5018 (init_cons, init_symbol, init_marker): Remove.
5019 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5020 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5021 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5022 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5023 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5024 (staticidx, init_alloc_once, init_strings, free_ablock):
5025 Remove redundant initialization.
5026 * fns.c (init_weak_hash_tables): Remove.
5027 * lisp.h (init_weak_hash_tables): Remove prototype.
5028
9730daca
DA
50292012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5030
5031 Use zero_vector where appropriate.
5032 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5033 accordingly.
5034 * lisp.h (zero_vector): New declaration.
5035 * font.c (null_vector): Remove.
5036 (syms_of_font): Remove initialization and staticpro.
5037 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5038 * keymap.c (Faccessible_keymaps): Likewise.
5039
2e2d2a13
LL
50402012-07-15 Leo Liu <sdl.web@gmail.com>
5041
5042 * fringe.c: Fix typo in comments.
5043
cd276f6e
LL
50442012-07-14 Leo Liu <sdl.web@gmail.com>
5045
5046 * fringe.c: Add a new bitmap exclamation-mark.
5047
5a1131d9
EZ
50482012-07-14 Eli Zaretskii <eliz@gnu.org>
5049
5050 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5051
5052 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5053 (HAVE_MENUS): Don't define, defined by editing config.in with
5054 msdos/sed2v2.inp.
5055 (GMALLOC_INHIBIT_VALLOC): Don't define.
5056 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5057
22e983b7
JB
50582012-07-14 Juanma Barranquero <lekktu@gmail.com>
5059
5060 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5061
5b3f250f
GM
50622012-07-14 Glenn Morris <rgm@gnu.org>
5063
5064 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5065 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5066 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5067
33d63ff4
GM
50682012-07-13 Glenn Morris <rgm@gnu.org>
5069
5b633342
GM
5070 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5071
33d63ff4
GM
5072 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5073 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5074
b55b9f85
JD
50752012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5076
0dc8cf50
JD
5077 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5078 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5079 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5080 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5081 where appropriate.
5082 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5083 as boolean expression.
5084 (x_set_window_size): Remove unused variable toolbar.
5085 (ns_get_color_default, ns_mod_to_lisp): Remove.
5086 (ns_mouse_position): Remove unused variables xchar and ychar.
5087 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5088 (ns_set_vertical_scroll_bar): Remove unused variable count.
5089 (ns_delete_terminal): Remove unused variable i.
5090 (ns_term_init): Remove unused variables r, g and b.
5091 (mouseDown): Remove unused variable window.
5092 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5093 (initFrameFromEmacs): Remove unused variable vbextra.
5094 (mouseEntered): Remove unused variables p and dpyinfo.
5095 (mouseExited): Remove unused variables p and r.
5096 (ns_define_frame_cursor, ns_clear_frame_area)
5097 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5098 (menuDown): Assign [sender tag] to variable and cast the variable.
5099
5100 * nsterm.h (menuDown): Add id as type to argument sender.
5101 (ns_display_info_for_name): Add Lisp_Object argument.
5102 (ns_term_init): Add Lisp_Object argument.
5103 (ns_map_event_to_object): Add void argument.
5104 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5105 prototype with arguments and only declare if __OBJC__.
5106 (nxatoms_of_nsselect): Add void argument.
5107 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5108 (ns_alloc_autorelease_pool): Add void argument.
5109 (ns_release_autorelease_pool): Add void* argument.
5110 (ns_get_defaults_value): Add const char* argument.
5111
5112 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5113 (initFromContents): Use SSDATA where appropriate.
5114 (ns_update_menubar): Add braces to ambigous if-else.
5115 (initWithTitle): Put () around assignment in if statement.
5116 (ns_menu_show): Remove unused variables window and keymap.
5117 (update_frame_tool_bar): Remove unused variable selected_p.
5118 (initWithContentRect): Remove unused variable this_cmd_name.
5119
5120 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5121 appropriate.
5122 (setXBMColor): Remove unused variable len.
5123 (setPixmapData): Put () around assignment in loop statement.
5124
5125 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5126 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5127 where appropriate.
5128 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5129 around assignment in loop statement.
5130 (nsfont_open): Remove unused variable i.
5131 (nsfont_open): Remove unused variable len.
5132 (nsfont_draw): Remove unused variable cs.
5133
5134 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5135 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5136 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5137 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5138 (Fns_font_name, Fns_perform_service)
5139 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5140 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5141 (ns_set_name): Remove unused variable view.
5142 (x_set_menu_bar_lines): Remove unused variable olines.
5143 (x_set_tool_bar_lines): Remove unused variable root_window.
5144 (Fns_list_colors): Put () around assignment in while statement.
5145 (Fns_perform_service): Remove unused variable len.
5146 (Fns_display_usable_bounds): Remove unused variable top.
5147 (syms_of_nsfns): Remove unused variable i.
5148
b55b9f85
JD
5149 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5150 memcpy (Bug#11907).
5151
ed9265fc 51522012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
5153
5154 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
5155 and free it with DestroyExceptionInfo (Bug#11558).
5156
ef099b57
JB
51572012-07-13 Juanma Barranquero <lekktu@gmail.com>
5158
5159 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
5160 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5161 Set here, not in nt/config.nt.
5162
ea814a5d
EZ
51632012-07-13 Eli Zaretskii <eliz@gnu.org>
5164
5165 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
5166 cursor overflow into the last glyph on display line when the right
5167 fringe is off. (Bug#11832)
5168
1a952767
PE
51692012-07-13 Paul Eggert <eggert@cs.ucla.edu>
5170
5171 * xdisp.c (produce_special_glyphs): Now static.
5172 * dispextern.h (produce_special_glyphs): Remove decl.
5173
983188fd
GM
51742012-07-13 Glenn Morris <rgm@gnu.org>
5175
8d7c7eed 5176 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
5177 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5178
983188fd
GM
5179 * s/usg5-4-common.h (USG, USG5):
5180 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
5181 * s/sol2-6.h (SOLARIS2):
5182 * s/irix6-5.h (IRIX6_5):
5183 * s/hpux10-20.h (USG, USG5, HPUX):
5184 * s/gnu-linux.h (USG, GNU_LINUX):
5185 * s/freebsd.h (BSD_SYSTEM):
5186 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
5187 * s/cygwin.h (CYGWIN):
5188 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
5189 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
5190
d1e68667 51912012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
5192
5193 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 5194
6de0e799
GM
51952012-07-13 Glenn Morris <rgm@gnu.org>
5196
739ae010
GM
5197 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
5198
dbee5793
GM
5199 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
5200
6de0e799
GM
5201 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
5202 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
5203
b82da769
GM
52042012-07-12 Glenn Morris <rgm@gnu.org>
5205
4fae5a7a 5206 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
5207
5208 * process.c (init_process_emacs): Rename from init_process.
5209 The old name is also the name of a Mach system call.
5210 * lisp.h, emacs.c: Update for this name change.
5211 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
5212 longer needed.
5213
5a979817
EZ
52142012-07-12 Eli Zaretskii <eliz@gnu.org>
5215
5216 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
5217 memmove call that removes glyphs covered by the left truncation
5218 glyph. Improve commentary.
5219 (display_line): Fix display of continuation glyphs on GUI frames
5220 when the right fringe is turned off and variable-size fonts are
5221 used in the window. Move the code that appends a stretch glyph to
5222 produce_special_glyphs, so that it could be used for truncation
5223 and continuation glyphs alike.
5224 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
5225 glyph of a suitably computed width, to align the special glyphs at
5226 the window margin. Code moved from display_line. (Bug#11832)
5227
3e91a053
GM
52282012-07-12 Glenn Morris <rgm@gnu.org>
5229
ba9e4b84
GM
5230 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
5231
5232 * s/gnu-linux.h, s/hpux10-20.h:
5233 Do not unconditionally define HAVE_XRMSETDATABASE.
5234
3e91a053
GM
5235 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
5236
b300b1f4
PE
52372012-07-12 Paul Eggert <eggert@cs.ucla.edu>
5238
5239 Fix typos that broke OS X build.
5240 Reported by Randal L. Schwartz in
5241 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
5242 * nsterm.m (ns_timeout): Add missing local decl.
5243 (ns_get_color): snprintf -> sprintf, to fix typo.
5244
6e777848
GM
52452012-07-12 Glenn Morris <rgm@gnu.org>
5246
3f922c37
GM
5247 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
5248 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
5249 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
5250 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
5251
0ab7b23a
GM
5252 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
5253 Move PTY_OPEN to configure.
5254
6e777848
GM
5255 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5256 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
5257 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
5258
4a7edc24
DA
52592012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
5260
5261 Use empty_unibyte_string where applicable.
5262 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
5263 * lread.c (read1): Likewise.
5264 * xsettings.c (syms_of_xsettings): Likewise.
5265
308aab79
GM
52662012-07-12 Glenn Morris <rgm@gnu.org>
5267
42bd1719
GM
5268 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
5269 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
5270 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
5271 * s/hpux10-20.h (RUN_TIME_REMAP):
5272 * s/bsd-common.h (TABDLY): Move to configure.
5273
5274 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
5275
5276 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
5277
ea0bbd17 5278 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 5279 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
5280
5281 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 5282
308aab79
GM
5283 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
5284 * s/template.h: Move NARROWPROTO to configure.
5285
ee1cf5cf
GM
52862012-07-11 Glenn Morris <rgm@gnu.org>
5287
30fe9bf4
GM
5288 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
5289 unused since 2011-01-17 change to systty.h.
5290
ee1cf5cf
GM
5291 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
5292 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5293 Move HAVE_PTYS and HAVE_SOCKETS to configure.
5294
63e47e07
PE
52952012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5296
5297 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
5298
c43fb4c3
GM
52992012-07-11 Glenn Morris <rgm@gnu.org>
5300
5301 * s/darwin.h, s/gnu-linux.h, s/template.h:
5302 Move INTERRUPT_INPUT to configure.
5303
e8df9267
DA
53042012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5305
5306 Minor adjustments to interning code.
5307 * lisp.h (intern, intern_c_string): Redefine as static inline
5308 wrappers for intern_1 and intern_c_string_1, respectively.
5309 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
5310 * lread.c (intern_1, intern_c_string_1, oblookup):
5311 Simplify Vobarray checking.
e8df9267
DA
5312 * font.c (font_intern_prop): Likewise. Adjust comment.
5313 * w32font.c (intern_font_name): Likewise.
5314
34348bd4
AS
53152012-07-11 Andreas Schwab <schwab@linux-m68k.org>
5316
d96a1e0c
AS
5317 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
5318
34348bd4
AS
5319 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
5320 of Fcar/Fcdr if possible.
5321 * font.c (check_otf_features): Likewise.
5322 * fontset.c (Fnew_fontset): Likewise.
5323 * gnutls.c (Fgnutls_boot): Likewise.
5324 * minibuf.c (read_minibuf): Likewise.
5325 * msdos.c (IT_set_frame_parameters): Likewise.
5326 * xmenu.c (Fx_popup_dialog): Likewise.
5327 * w32menu.c (Fx_popup_dialog): Likewise.
5328
c8add24e
GM
53292012-07-11 Glenn Morris <rgm@gnu.org>
5330
4b575b3c
GM
5331 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
5332 since nothing has defined it on these platforms.
5333
09f4e3b0
GM
5334 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
5335 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
5336
172bedef
GM
5337 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5338 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5339 Move CLASH_DETECTION to configure.
5340
249685df
GM
5341 * s/gnu.h: Remove file, which is now empty.
5342
c8add24e
GM
5343 * s/gnu.h, s/gnu-linux.h:
5344 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
5345
b41253a3
JW
53462012-07-11 John Wiegley <johnw@newartisans.com>
5347
5348 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
5349 function attribute, so we only use it if it exists in the
5350 compiler.
5351
d923b542
DA
53522012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5353
5354 Avoid call to strlen in fast_c_string_match_ignore_case.
5355 * search.c (fast_c_string_match_ignore_case): Change to use
5356 length argument. Adjust users accordingly.
5357 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
5358
5ebbef1d
PE
53592012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5360
bb352260
PE
5361 Assume mkdir, rmdir.
5362 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
5363 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
5364
57054ddd
PE
5365 Assume rename.
5366 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
5367
b747d3f7
PE
5368 Assume perror.
5369 * s/hpux10-20.h (HAVE_PERROR): Remove.
5370 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
5371 Remove dummy definition, as this problem was obsolete long ago.
5372
5ebbef1d
PE
5373 Assume strerror.
5374 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5375
984e7f30
DA
53762012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5377
5378 Avoid calls to strlen in font processing functions.
5379 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
5380 (font_open_by_name): Change to use length argument.
5381 Adjust users accordingly.
d923b542
DA
5382 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5383 Adjust prototypes.
5384 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5385 Change to return ptrdiff_t.
984e7f30
DA
5386 (xfont_list_pattern, xfont_match): Use length returned by
5387 xfont_decode_coding_xlfd.
5388 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5389
20e94fdd
GM
53902012-07-11 Glenn Morris <rgm@gnu.org>
5391
9d596af3
GM
5392 * s/darwin.h, s/freebsd.h, s/netbsd.h:
5393 Move DONT_REOPEN_PTY to configure.
5394
20e94fdd
GM
5395 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5396 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5397
e99a530f
PE
53982012-07-10 Paul Eggert <eggert@cs.ucla.edu>
5399
22ffb973
PE
5400 Remove "#define unix" that is no longer needed (Bug#11905).
5401 * s/aix4-2.h (unix): Remove; no longer needed.
5402
e9a9ae03
PE
5403 EMACS_TIME simplification (Bug#11875).
5404 This replaces macros (which typically do not work in GDB)
5405 with functions, typedefs and enums, making the code easier to debug.
5406 The functional style also makes code easier to read and maintain.
5407 * systime.h: Include <sys/time.h> on all hosts, not just if
5408 WINDOWSNT, since 'struct timeval' is needed in general.
5409 (EMACS_TIME): Now a typedef, not a macro.
5410 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5411 not macros.
5412 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
5413 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
5414 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
5415 (EMACS_TIME_LE): Now functions, not macros.
5416 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
5417 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
5418 which are not functions. All uses rewritten to use:
5419 (make_emacs_time): New function.
5420 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5421 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5422 not functions. All uses rewritten to use the following, respectively:
5423 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5424 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 5425 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
5426 * fileio.c (Fcopy_file):
5427 * xterm.c (XTflash): Get the current time closer to when it's used.
5428 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5429
ffacb126
PE
5430 * bytecode.c (targets): Suppress -Woverride-init warnings.
5431
e99a530f
PE
5432 Simplify by avoiding confusing use of strncpy etc.
5433 * doc.c (Fsnarf_documentation):
5434 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5435 * frame.c (Fmake_terminal_frame):
5436 * gtkutil.c (get_utf8_string):
5437 * lread.c (openp):
5438 * nsmenu.m (ns_update_menubar):
5439 * regex.c (regerror):
5440 Prefer memcpy to strncpy and strncat when either will do.
5441 * fileio.c (Fsubstitute_in_file_name):
5442 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5443 (menu_separator_name_p):
5444 * nsmenu.m (ns_update_menubar):
5445 Prefer memcmp to strncmp when either will do.
5446 * nsterm.m: Include <ftoastr.h>.
5447 (ns_get_color):
5448 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5449 Prefer snprintf to strncpy.
5450 * nsterm.m (ns_term_init):
5451 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5452 * nsterm.m (ns_term_init):
5453 Avoid the need for strncpy, by using build_string or
5454 make_unibyte_string directly. Use dtoastr, not snprintf.
5455 * process.c (Fmake_network_process): Diagnose service names that
5456 are too long, rather than silently truncating them or creating
5457 non-null-terminated names.
5458 (Fnetwork_interface_info): Likewise, for interface names.
5459 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5460 Prefer sprintf to strncat.
5461 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5462 Prefer vsnprintf to vsprintf + strncpy.
5463
c59592b3
GM
54642012-07-10 Glenn Morris <rgm@gnu.org>
5465
5466 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5467 Clarify fallback case.
5468
7d7bbefd
DA
54692012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5470
5471 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5472 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5473 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 5474 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
5475 where argument type is known to be a Lisp_Cons.
5476
3a4c8000
TT
54772012-07-10 Tom Tromey <tromey@redhat.com>
5478
5479 * bytecode.c (BYTE_CODE_THREADED): New macro.
5480 (BYTE_CODES): New macro. Replaces all old byte-code defines.
5481 (enum byte_code_op): New type.
5482 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5483 (exec_byte_code): Use them. Use token threading when applicable.
5484
2a0213a6
DA
54852012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5486
5487 Optimize pure C strings initialization.
5488 * lisp.h (make_pure_string): Fix prototype.
5489 (build_pure_c_string): New function, defined as static inline. This
5490 provides a better opportunity to optimize away calls to strlen when
5491 the function is called with compile-time constant argument.
5492 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
5493 argument, adjust users accordingly. Use build_pure_c_string where
5494 appropriate.
5495 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
5496 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
5497 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
5498
cb1caeaf
DA
54992012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5500
5501 Avoid calls to strlen in miscellaneous functions.
5502 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
5503 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
5504 * lread.c (openp): Likewise.
5505
c293e30c
DA
55062012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5507
5508 Avoid calls to strlen in path processing functions.
5509 * fileio.c (file_name_as_directory): Add comment. Change to add
5510 srclen argument and return the length of result. Adjust users
5511 accordingly.
5512 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
5513 swap 1st and 2nd arguments to obey the common convention.
5514 Adjust users accordingly.
c293e30c
DA
5515 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
5516
9e059e3f
GM
55172012-07-10 Glenn Morris <rgm@gnu.org>
5518
d02eb359
GM
5519 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
5520 Move PENDING_OUTPUT_COUNT definition to configure.
5521
882cf227
GM
5522 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
5523 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
5524 * s/gnu.h (DATA_START): Move definitions to configure.
5525
af6e839f
GM
5526 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
5527 We include usg5-4-common.h, which defines them both.
5528
40289a12
GM
5529 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
5530 O_RDONLY already includes it).
5531
9e059e3f
GM
5532 Stop ns builds setting the EMACSLOADPATH environment variable.
5533 * nsterm.m (ns_load_path): Rename from ns_init_paths.
5534 Now it does not set EMACSLOADPATH, just returns the load-path string.
5535 * nsterm.h: Update accordingly.
5536 * lread.c [HAVE_NS]: Include nsterm.h.
5537 (init_lread) [HAVE_NS]: Use ns_load_path.
5538 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
5539
7c4e8ec0
GM
55402012-07-09 Glenn Morris <rgm@gnu.org>
5541
d4f600ff
GM
5542 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
5543 since the included bsd-common.h does so.
5544
cbb31951
GM
5545 Stop ns builds setting the EMACSPATH environment variable.
5546 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
5547 (ns_init_paths): Do not set EMACSPATH.
5548 * nsterm.h (ns_exec_path): Add it.
5549 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
5550 Use ns_exec_path.
5551
7c4e8ec0
GM
5552 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
5553
26bccfae
PE
55542012-07-09 Paul Eggert <eggert@cs.ucla.edu>
5555
a0bee46f
PE
5556 * process.c (wait_reading_process_output): 'waitchannels' was unset
5557 when read_kbd || !NILP (wait_for_cell); fix this.
5558
5994c183
PE
5559 Add GCC-style 'const' attribute to functions that can use it.
5560 * character.h (char_resolve_modifier_mask):
5561 * keyboard.h (make_ctrl_char):
5562 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5563 (init_character_once, next_almost_prime, init_fns, init_image)
5564 (flush_pending_output, init_sound):
5565 * mem-limits.h (start_of_data):
5566 * menu.h (finish_menu_items):
5567 Add ATTRIBUTE_CONST.
5568 * emacs.c (DEFINE_DUMMY_FUNCTION):
5569 Declare the dummy function with ATTRIBUTE_CONST.
5570 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5571 Add decls with ATTRIBUTE_CONST.
5572
26bccfae
PE
5573 Minor improvements to make_formatted_string.
5574 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5575 where int is good enough, as vsprintf returns an int.
5576 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5577
a8290ec3
DA
55782012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5579
5580 Use make_formatted_string to avoid double length calculation.
5581 * lisp.h (make_formatted_string): New prototype.
5582 * alloc.c (make_formatted_string): New function.
5583 * buffer.c (Fgenerate_new_buffer_name): Use it.
5584 * dbus.c (syms_of_dbusbind): Likewise.
5585 * editfns.c (Fcurrent_time_zone): Likewise.
5586 * filelock.c (get_boot_time): Likewise.
5587 * frame.c (make_terminal_frame, set_term_frame_name)
5588 (x_report_frame_params): Likewise.
5589 * image.c (gs_load): Likewise.
5590 * minibuf.c (get_minibuffer): Likewise.
5591 * msdos.c (dos_set_window_size): Likewise.
5592 * process.c (make_process): Likewise.
5593 * xdisp.c (ensure_echo_area_buffers): Likewise.
5594 * xsettings.c (apply_xft_settings): Likewise.
5595
d01ba2f1
GM
55962012-07-09 Glenn Morris <rgm@gnu.org>
5597
5598 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5599 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5600 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5601 * nsterm.h (ns_etc_directory): Add it.
5602 * callproc.c [HAVE_NS]: Include nsterm.h.
5603 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5604
f1f924b6
DA
56052012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5606
5607 Move marker debugging code under MARKER_DEBUG.
5608 * marker.c (MARKER_DEBUG): Move marker debugging code under
5609 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5610 for bootstrap with --enable-checking (~3x slowdown reported
5611 by Juanma Barranquero <lekktu@gmail.com>).
5612 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5613
ab531b66
PE
56142012-07-08 Paul Eggert <eggert@cs.ucla.edu>
5615
5616 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5617 See <http://bugs.gnu.org/11825#29>.
5618
c4b3bc8a
EZ
56192012-07-08 Eli Zaretskii <eliz@gnu.org>
5620
5621 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5622 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
5623 (display_line): Add commentary about displaying truncation glyphs
5624 on GUI frames.
5625 (produce_special_glyphs): Move here from term.c.
5626
5627 * term.c (produce_special_glyphs): Move to xdisp.c.
5628
5629 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5630 section.
c4b3bc8a 5631
b676b881
AS
56322012-07-07 Andreas Schwab <schwab@linux-m68k.org>
5633
f17c5273
AS
5634 * xdisp.c (display_line): Avoid warning about implicit declaration
5635 of FRAME_FONT.
5636
298819b9
AS
5637 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5638
b676b881
AS
5639 * lisp.h: Remove empty conditional.
5640
6045c4fd
PE
56412012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5642
b3350bf9
PE
5643 * lread.c (load_path_check): Now static.
5644
6045c4fd
PE
5645 Fix some minor --with-ns problems found by static checking.
5646 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
5647 (x_set_font) [!HAVE_X_WINDOWS]:
5648 * image.c (xpm_load_image) [HAVE_NS]:
5649 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
5650 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
5651 Remove unused local.
5652 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
5653 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
5654 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
5655 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
5656 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
5657 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
5658 Fix pointer signedness problem.
5659 * xfaces.c (FRAME_X_FONT_TABLE):
5660 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
5661
929e7845
GM
56622012-07-07 Glenn Morris <rgm@gnu.org>
5663
5664 * lread.c (load_path_check): New function, split from init_lread.
5665 (init_lread): Reorganize. Motivation:
5666 If EMACSLOADPATH is set, check/warn about that rather than the
5667 defaults, which we are not going to use. Hence we can remove
5668 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
5669 Don't warn if site-lisp directories are missing.
5670 If not installed, start from a blank load-path, since
5671 PATH_LOADSEARCH refers to the eventual installation directories.
5672
58dd0aa4
EZ
56732012-07-07 Eli Zaretskii <eliz@gnu.org>
5674
5675 Support truncation and continuation glyphs on GUI frames, when
5676 fringes are disabled. (Bug#11832)
5677 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
5678 continuation glyphs even if on GUI frames.
5679 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
5680 or both, are absent.
5681 (start_display, move_it_in_display_line_to): Handle the case of a
5682 GUI frame without a fringe to display continuation or truncation
5683 glyphs.
5684 (insert_left_trunc_glyphs): Support GUI frames: make sure
5685 truncation glyphs overwrite enough glyphs from the current line to
5686 have sufficient space in pixels.
5687 (display_line): Support truncation and continuation glyphs on GUI
5688 frames. If some spare pixels are left on the line after inserting
5689 the truncation glyphs, fill that space with a stretch glyph of a
5690 suitably computed width.
5691
5692 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5693 produce_glyphs, to support GUI sessions.
5694
31571fd7
PE
56952012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5696
5a16b9bc
PE
5697 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5698
f3047c75
PE
5699 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5700
31571fd7
PE
5701 Do not require float-time's arg to fit in time_t (Bug#11825).
5702 This works better on hosts where time_t is unsigned, and where
5703 float-time is applied to the (negative) difference between two times.
5704 * editfns.c (decode_time_components): Last arg is now double *,
5705 not int *, and means to store all the result as a double, without
5706 worrying about whether the seconds part fits in time_t.
5707 All callers changed.
5708 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5709 All callers changed.
5710 (Ffloat_time): Do not fail merely because the specified time falls
5711 outside of time_t range.
5712
4516fbef
GM
57132012-07-07 Glenn Morris <rgm@gnu.org>
5714
5715 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5716 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5717 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5718
07adc2c6
JB
57192012-07-07 Juanma Barranquero <lekktu@gmail.com>
5720
5721 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5722 Update dependencies.
5723
5724 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5725
fd573f31
PE
57262012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5727
fee5959d
PE
5728 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5729 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5730 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5731 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5732 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5733 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5734
fd573f31
PE
5735 * xfont.c (compare_font_names): Redo to omit the need for casts.
5736
ddadbc0e
AS
57372012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5738
fca8d6b6
AS
5739 * xfns.c (Fx_change_window_property): Doc fix.
5740 * w32fns.c (Fx_change_window_property): Doc fix.
5741
ddadbc0e
AS
5742 * w32fns.c (Fx_window_property): Accept the same arguments as the
5743 X Windows version. Doc fix.
5744 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5745
ed9265fc 57462012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
5747 Eli Zaretskii <eliz@gnu.org>
5748
5749 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5750 Windows-specific code from nt/config.nt moved here.
5751 Obsolete settings removed.
5752
216ee680
PE
57532012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5754
5755 * process.c: Avoid unnecessary calls to gettime.
5756 (wait_reading_process_output): Don't get the time of day
5757 when gobbling data immediately and not waiting, as there's no need
5758 for it in that case. This removes a FIXME.
5759
bdd091e4
JD
57602012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5761
5762 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5763 is defined (Bug#11768).
5764
9d44f8ce
DA
57652012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5766
5767 Fix marker debugging code.
5768 * marker.c (byte_char_debug_check): Do not perform the check
5769 if buffer is not multibyte.
090bd7cb
JB
5770 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5771 Call byte_char_debug_check with correct arguments.
9d44f8ce 5772
90fc4786
DA
57732012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5774
5775 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
5776 * marker.c (byte_char_debug_check, count_markers):
5777 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
5778 (byte_debug_flag): Remove.
5779 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5780 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5781
7b7ae965
DA
57822012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5783
4e57b342
DA
5784 Avoid code repetition in marker-related functions.
5785 * marker.c (attach_marker): New function.
5786 (Fset_marker, set_marker_restricted, set_marker_both)
5787 (set_marker_restricted_both): Use it.
5788 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5789 Consistently rename charno to charpos.
5790 (marker_position): Add eassert.
5791 (marker_byte_position): Convert to eassert.
5792
57932012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5794
5795 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 5796 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 5797 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 5798
657924ff
DA
57992012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5800
5801 Introduce fast path for the widely used marker operation.
5802 * alloc.c (build_marker): New function.
5803 * lisp.h (build_marker): New prototype.
5804 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5805 * composite.c (autocmp_chars): Likewise.
5806 * editfns.c (buildmark): Remove.
5807 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5808 (save_restriction_save): Use build_marker.
5809 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5810 * window.c (save_window_save): Likewise.
5811
041a49a6
DA
58122012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5813
5814 Do not use Fdelete_overlay in delete_all_overlays
5815 to avoid redundant calls to unchain_overlay.
5816 * buffer.c (drop_overlay): New function.
5817 (delete_all_overlays, Fdelete_overlay): Use it.
5818 * minibuf.c (get_minibuffer): Fix comment.
5819
7dca65a4
PE
58202012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5821
5822 Port to OpenBSD 5.1 amd64.
5823 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5824 This is needed for OpenBSD, and should be harmless on all BSD systems.
5825 Also, include <sys/sysctl.h>, as it should be available on all
5826 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5827 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5828 use p_pid member, not kp_proc.pid.
5829
8eb876e2
GM
58302012-07-06 Glenn Morris <rgm@gnu.org>
5831
5832 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5833
38182d90
PE
58342012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5835
5836 More xmalloc and related cleanup.
5837 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5838 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5839 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5840 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5841 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5842 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5843 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5844 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5845 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5846 * xterm.c:
5847 Omit needless casts involving void * pointers and allocation.
5848 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5849 as the former is more robust if P's type is changed.
5850 Prefer xzalloc to xmalloc + memset 0.
5851 Simplify malloc-or-realloc to realloc.
5852 Don't worry about xmalloc returning a null pointer.
5853 Prefer xstrdup to xmalloc + strcpy.
5854 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5855 growing it.
5856 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5857 alloca of a constant.
5858
6dd5a677
EZ
58592012-07-05 Eli Zaretskii <eliz@gnu.org>
5860
5861 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5862 hscroll is larger than the line width. Fixes long and futile
5863 looping inside extend_face_to_end_of_line (on a TTY) producing
5864 glyphs that are not needed and thrown away.
5865
6b312f0f
DA
58662012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5867
5868 * marker.c (set_marker_restricted_both): Simplify by using
5869 clip_to_bounds.
5870
f520ef9b
PE
58712012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5872
5873 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5874
383b7c95
JD
58752012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5876
5877 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5878 not defined (Bug#11768).
5879 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5880 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5881 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5882 followed by gtk_box_set_homogeneous (Bug#11768).
5883 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
5884 (update_theme_scrollbar_width, xg_create_scroll_bar):
5885 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
5886 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5887 (is_box_type): New function (Bug#11768).
5888 (xg_tool_item_stale_p): Call is_box_type.
5293d758 5889 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
5890 with default display (Bug#11768).
5891
d6e7bf45
EZ
58922012-07-05 Eli Zaretskii <eliz@gnu.org>
5893
5894 * xdisp.c (window_hscroll_limited): New function.
5895 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5896 coordinates when window's hscroll is set to insanely large
5897 values. (Bug#11857)
5898
431391ec
JB
58992012-07-05 Juanma Barranquero <lekktu@gmail.com>
5900
5901 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5902 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5903
23f86fce
DA
59042012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5905
5906 Cleanup xmalloc.
5907 * lisp.h (xzalloc): New prototype. Omit needless casts.
5908 * alloc.c (xzalloc): New function. Omit needless casts.
5909 * charset.c: Omit needless casts. Convert all calls to
5910 xmalloc with following memset to xzalloc.
5911 * dispnew.c: Likewise.
5912 * fringe.c: Likewise.
5913 * image.c: Likewise.
5914 * sound.c: Likewise.
5915 * term.c: Likewise.
5916 * w32fns.c: Likewise.
5917 * w32font.c: Likewise.
5918 * w32term.c: Likewise.
5919 * xfaces.c: Likewise.
5920 * xfns.c: Likewise.
5921 * xterm.c: Likewise.
5922 * atimer.c: Omit needless casts.
5923 * buffer.c: Likewise.
5924 * callproc.c: Likewise.
5925 * ccl.c: Likewise.
5926 * coding.c: Likewise.
5927 * composite.c: Likewise.
5928 * doc.c: Likewise.
5929 * doprnt.c: Likewise.
5930 * editfns.c: Likewise.
5931 * emacs.c: Likewise.
5932 * eval.c: Likewise.
5933 * filelock.c: Likewise.
5934 * fns.c: Likewise.
5935 * gtkutil.c: Likewise.
5936 * keyboard.c: Likewise.
5937 * lisp.h: Likewise.
5938 * lread.c: Likewise.
5939 * minibuf.c: Likewise.
5940 * msdos.c: Likewise.
5941 * print.c: Likewise.
5942 * process.c: Likewise.
5943 * region-cache.c: Likewise.
5944 * search.c: Likewise.
5945 * sysdep.c: Likewise.
5946 * termcap.c: Likewise.
5947 * terminal.c: Likewise.
5948 * tparam.c: Likewise.
5949 * w16select.c: Likewise.
5950 * w32.c: Likewise.
5951 * w32reg.c: Likewise.
5952 * w32select.c: Likewise.
5953 * w32uniscribe.c: Likewise.
5954 * widget.c: Likewise.
5955 * xdisp.c: Likewise.
5956 * xmenu.c: Likewise.
5957 * xrdb.c: Likewise.
5958 * xselect.c: Likewise.
5959
0497dc44
PE
59602012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5961
5962 * fileio.c (time_error_value): Check the right error number.
5963 Problem reported by Troels Nielsen in
5964 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5965
356e7178
PE
59662012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5967
4e71fd89
PE
5968 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5969 This should be fixed in a better way; see Eli Zaretskii in
5970 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5971 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5972
f0941253
PE
5973 * fileio.c (time_error_value): Rename from special_mtime.
5974 The old name's problems were noted by Eli Zaretskii in
5975 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5976
065c9eb4
PE
5977 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5978 This variable's comment says Emacs needs at least one GDB-visible
5979 symbol of type enum pvec_type, to work around GDB problems.
5980 The symbol's value doesn't matter.
5981
356e7178
PE
5982 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5983 that causes compilation to fail on pre-C99 compilers.
5984
ed9265fc 59852012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
5986
5987 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5988 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5989
3884d954
DA
59902012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5991
d209e2fb 5992 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
5993 headers for buffer_defaults and buffer_local_symbols.
5994 Reported by Juanma Barranquero <lekktu@gmail.com>.
5995
ee28be33
SM
59962012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5997
5998 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5999 * lisp.h (enum pvec_type): Use fewer bits.
6000 (PSEUDOVECTOR_SIZE_BITS): New constant.
6001 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6002 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6003 change in pvec_type.
6004 (PSEUDOVECTOR_TYPEP): New macro.
6005 (TYPED_PSEUDOVECTORP): Use it.
6006 * fns.c (internal_equal): Adapt code to extract pvectype.
6007 * emacs.c (gdb_pvec_type): Update type.
6008 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6009 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6010 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6011 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6012 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6013 abusing vector->header.next.nbytes.
6014 (live_vector_p): Use PVEC_TYPE.
6015 (mark_object): Adapt code to extract pvectype. Use switch.
6016
c7f2cd7f
PE
60172012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6018
6019 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6020 Tighten new eassert a bit.
6021
8ce70ed2
DA
60222012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6023
6024 Fix compilation with --enable-gcc-warnings and -O1
6025 optimization level.
6026 * doprnt.c (doprnt): Change type of tem to int, initialize
6027 to avoid compiler warning. Add eassert.
6028 * search.c (simple_search): Initialize match_byte to avoid
6029 compiler warning. Add eassert.
6030
dea7f1e5
PE
60312012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6032
24a212eb
PE
6033 Avoid weird behavior with large horizontal scrolls.
6034 Without this change, for example, large hscroll values would
6035 mess up Emacs's display on Fedora 15 x86, presumably due to
6036 overflows in int calculations in the display code.
6037 Also, if buffers had long lines, Emacs would freeze.
6038 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6039 (set_window_hscroll): New function, containing the old guts of
6040 Fset_window_hscroll. Return the clipped value.
6041 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6042 This avoids the need to check against PTRDIFF_MAX.
6043
dea7f1e5
PE
6044 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6045
76046526
DA
60462012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6047
6048 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6049
39adff0d
PE
60502012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6051
63807d47
PE
6052 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6053 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6054 since GCC 4.4.6 issues a bogus warning for them.
6055
39adff0d
PE
6056 Fix bugs in file timestamp newness comparisons.
6057 * fileio.c (Ffile_newer_than_file_p):
6058 * lread.c (Fload): Use full timestamp resolution of files,
6059 not just the 1-second resolution, so that files that are only
6060 slightly newer still count as newer.
6061 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6062 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6063
dbeed9a6
PE
60642012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6065
6066 * fileio.c: Improve handling of file time marker. (Bug#11852)
6067 (special_mtime): New function.
6068 (Finsert_file_contents, Fverify_visited_file_modtime):
6069 Use it to set special mtime values consistently.
6070
636334d6
AS
60712012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6072
6073 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6074 marker for non-existing file. (Bug#11852)
6075
e2017fe2
GM
60762012-07-03 Glenn Morris <rgm@gnu.org>
6077
6078 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6079 and did not make it into globals.h).
6080
404dbd37
TT
60812012-07-03 Tom Tromey <tromey@redhat.com>
6082
6083 * window.c (Fset_window_margins, Fset_window_fringes)
6084 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6085 * textprop.c (Fprevious_property_change): No longer static.
6086 * syntax.c (Fsyntax_table_p): No longer static.
6087 * process.c (Fget_process, Fprocess_datagram_address): No longer
6088 static.
6089 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6090 * keyboard.c (Fcommand_execute): No longer static.
6091 Remove EXFUN.
6092 * insdel.c (Fcombine_after_change_execute): No longer static.
6093 * image.c (Finit_image_library): No longer static.
6094 * fileio.c (Fmake_symbolic_link): No longer static.
6095 * eval.c (Ffetch_bytecode): No longer static.
6096 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
6097 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6098 No longer static.
404dbd37
TT
6099 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6100 static.
6101 * dired.c (Ffile_attributes): No longer static.
6102 * composite.c (Fcomposition_get_gstring): No longer static.
6103 * callproc.c (Fgetenv_internal): No longer static.
6104
6105 * ccl.h: Remove EXFUNs.
6106 * buffer.h: Remove EXFUNs.
6107 * dispextern.h: Remove EXFUNs.
6108 * intervals.h: Remove EXFUNs.
6109 * fontset.h: Remove EXFUN.
6110 * font.h: Remove EXFUNs.
6111 * dosfns.c (system_process_attributes): Remove EXFUN.
6112 * keymap.h: Remove EXFUNs.
6113 * lisp.h: Remove EXFUNs.
6114 * w32term.h: Remove EXFUNs.
6115 * window.h: Remove EXFUNs.
6116 * xsettings.h: Remove EXFUN.
6117 * xterm.h: Remove EXFUN.
6118
8e4fd1e1
GM
61192012-07-03 Glenn Morris <rgm@gnu.org>
6120
6121 * lisp.h (Frandom): Make it visible to C.
6122 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6123 buffer for invisible buffers. (Bug#1229)
6124
ca95b3eb
DA
61252012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6126
6127 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6128 values which aren't power of 2.
14ae4239
BT
6129 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
6130 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
6131 accordingly.
6132
7555c33f
SM
61332012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6134
6135 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6136
6137 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6138
d12e8f5a
DA
61392012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6140
6141 * alloc.c (allocate_vector_block): Remove redundant
6142 calls to mallopt if DOUG_LEA_MALLOC is defined.
6143 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6144 avoid calls to mallopt if zero_vector is returned.
6145
296094c3
DA
61462012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6147
6148 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6149 is enabled, avoid dereferencing NULL current_sblock if
6150 running undumped.
6151
36429c89
DA
61522012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6153
6154 Cleanup basic buffer management.
6155 * buffer.h (struct buffer): Change layout to use generic vector
6156 marking code. Fix some comments. Change type of 'clip_changed'
6157 to bitfield. Remove unused #ifndef old.
6158 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
6159 (GET_OVERLAYS_AT): Fix indentation.
6160 (for_each_per_buffer_object_at): New macro.
6161 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
6162 (Fbuffer_local_variables): Use it.
6163 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
6164 * alloc.c (allocate_buffer): Adjust to match new layout of
6165 struct buffer. Fix comment.
6166 (mark_overlay): New function.
6167 (mark_buffer): Use it. Use mark_vectorlike to mark normal
6168 Lisp area of struct buffer.
6169 (mark_object): Use it. Adjust marking of misc objects
6170 and related comments.
6171
3b3e4cac
PE
61722012-07-02 Paul Eggert <eggert@cs.ucla.edu>
6173
6174 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
6175 wrapper that is not needed because the wrapped code is a no-op (zero
6176 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
6177 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
6178
cf5c0175
DA
61792012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
6180
6181 * alloc.c (mark_buffer): Simplify. Remove prototype.
6182 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 6183 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
6184 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
6185 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 6186
ca26824c
GM
61872012-06-30 Glenn Morris <rgm@gnu.org>
6188
2e4c5312
GM
6189 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
6190
ca26824c
GM
6191 * epaths.in (PATH_SITELOADSEARCH): New.
6192 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
6193 This is rather than relying on --enable-locallisppath elements
6194 having "site-lisp" in their names. (Bug#10208#25, 11658)
6195
0d23c240
EZ
61962012-06-30 Eli Zaretskii <eliz@gnu.org>
6197
c9240d7a
EZ
6198 * w32proc.c (sys_select): Accept and ignore one more argument.
6199
6200 * w32.c (emacs_gnutls_pull): Call select with one more argument.
6201
0d23c240 6202 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 6203 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
6204
6205 * sysdep.c: Don't include dos.h and dosfns.h.
6206
6207 * process.c (sys_select):
6208 * msdos.c (sys_select): Accept one more argument and ignore it.
6209
6210 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
6211 adapt data types and code to that.
6212
6213 * dosfns.c:
6214 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
6215 which clashes with the gnulib function of the same name.
6216
af5a5a98
AS
62172012-06-30 Andreas Schwab <schwab@linux-m68k.org>
6218
c5e4379c
AS
6219 * font.c (font_style_to_value, font_style_symbolic)
6220 (font_prop_validate_style): Add type checks for values in
6221 font_style_table.
6222
af5a5a98
AS
6223 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
6224 argument.
6225 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
6226 uses.
6227
8d38f461
EZ
62282012-06-29 Eli Zaretskii <eliz@gnu.org>
6229
2e5a6631
EZ
6230 * xdisp.c (try_window_id): Undo last change.
6231
8d38f461
EZ
6232 * w32.c (getwd): Adjust commentary about startup_dir.
6233 (init_environment): Always call sys_access, even in non-MSVC
6234 builds. Don't chdir to the directory of the Emacs executable.
6235 This undoes code from 1997 which was justified by the need to
6236 "avoid conflicts when removing and renaming directories". But its
6237 downside was that every relative file name was being interpreted
6238 relative to the directory of the Emacs executable, which can never
6239 be TRT. In particular, it broke sys_access when called with
6240 relative file names.
6241 (sys_access): Map GetLastError to errno.
6242
2af3565e
DA
62432012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6244
6245 * window.h (struct window): Change type of 'fringes_outside_margins'
6246 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 6247 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
6248 Adjust comment.
6249 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
6250 to ptrdiff_t.
6251
c8d3a25c 62522012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 6253
c8d3a25c
GM
6254 * gnutls.c (emacs_gnutls_handshake):
6255 Add QUIT to make the loop interruptible.
57570cd3 6256
c8d3a25c 62572012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 6258
c8d3a25c
GM
6259 * charset.c (init_charset): Make lack of etc/charsets fatal.
6260
3e984ee8
DA
62612012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6262
6263 * editfns.c (region_limit): Fix type mismatch.
6264
ef884f23
DA
62652012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6266
6267 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
6268 undefined. Convert from xassert to eassert.
6269 * nsmenu.m: Convert from xassert to eassert.
6270 * nsterm.m: Likewise.
6271
7d7e0027
SM
62722012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
6273
6274 * editfns.c (region_limit): Clip to narrowing (bug#11770).
6275
aa754e6a
PE
62762012-06-28 Paul Eggert <eggert@cs.ucla.edu>
6277
6278 Avoid integer overflow on scroll-left and scroll-right.
6279 * window.c (HSCROLL_MAX): New macro.
6280 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
6281 overflow when requested scroll falls outside ptrdiff_t range.
6282
80b00b08
DA
62832012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6284
6285 * window.h (struct window): Change type of 'hscroll',
6286 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
6287 'last_modified' and 'last_overlay_modified' to EMACS_INT.
6288 Adjust users accordingly.
6289 * xdisp.c (try_cursor_movement): Replace type check with eassert.
6290 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
6291 from EMACS_INT to ptrdiff_t.
6292 (make_window): Omit redundant initialization.
6293
62b2bcf6
JB
62942012-06-28 Juanma Barranquero <lekktu@gmail.com>
6295
6296 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
6297
45942c7d
DA
62982012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6299
6300 * window.h (struct window): Change type of 'use_time' and
6301 'sequence_number' from Lisp_Object to int.
6302 * frame.c (make_frame): Adjust users accordingly.
6303 * print.c (print_object): Likewise.
6304 * window.c (select_window, Fwindow_use_time, make_parent_window)
6305 (make_window): Likewise.
6306
e509cfa6
DA
63072012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6308
6309 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
6310 enabled with --enable-checking=[all,glyphs] configure option.
6311 Fix GLYPH_DEBUG usage assuming that it may be undefined,
6312 adjust comments accordingly.
6313 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
6314 undefined, adjust comments accordingly.
6315 * image.c: Likewise.
6316 * scroll.c: Likewise.
6317 * w32fns.c: Likewise.
6318 * w32term.c: Likewise.
6319 * xdisp.c: Likewise.
6320 * xfaces.c: Likewise.
6321 * xfns.c: Likewise.
6322 * xterm.c: Likewise.
6323
a54e2c05
DA
63242012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6325
6326 Generalize run-time debugging checks.
6327 * dispextern.h (XASSERTS): Remove.
6328 * fontset.c (xassert): Remove.
6329 Convert from xassert to eassert.
6330 * alloc.c: Convert from xassert to eassert.
6331 * bidi.c: Likewise.
6332 * dispnew.c: Likewise.
6333 * fns.c: Likewise.
6334 * fringe.c: Likewise.
6335 * ftfont.c: Likewise.
6336 * gtkutil.c: Likewise.
6337 * image.c: Likewise.
6338 * keyboard.c: Likewise.
6339 * menu.c: Likewise.
6340 * process.c: Likewise.
6341 * scroll.c: Likewise.
6342 * sound.c: Likewise.
6343 * term.c: Likewise.
6344 * w32console.c: Likewise.
6345 * w32fns.c: Likewise.
6346 * w32term.c: Likewise.
6347 * window.c: Likewise.
6348 * xdisp.c: Likewise.
6349 * xfaces.c: Likewise.
6350 * xfns.c: Likewise.
6351 * xselect.c: Likewise.
6352 * xterm.c: Likewise.
6353
1ec4b7b2
SM
63542012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
6355
6356 * fns.c (maybe_resize_hash_table): Output message when growing the
6357 purify-hashtable.
6358
2014308a
DA
63592012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6360
6361 * alloc.c (allocate_string_data): Remove dead code.
6362 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
6363 avoid GCC warning about unused macro.
6364
246155eb
DA
63652012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6366
6367 * alloc.c (allocate_string): Omit intervals initialization.
6368 * alloc.c (make_uninit_multibyte_string): Initialize intervals
6369 as in make_pure_string and make_pure_c_string.
6370
43184b7b
DA
63712012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6372
d209e2fb 6373 * alloc.c (allocate_string): Fix last change.
43184b7b 6374
3fe6dd74
DA
63752012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6376
d209e2fb 6377 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
6378 to memset, add explicit initialization where appropriate.
6379
1ba6038a
GM
63802012-06-27 Glenn Morris <rgm@gnu.org>
6381
6382 * lisp.mk (lisp): Remove paths.elc.
6383
c89926a5
CY
63842012-06-27 Chong Yidong <cyd@gnu.org>
6385
6386 * doc.c (Fsubstitute_command_keys): Fix punctuation.
6387
ed6b3510
JW
63882012-06-26 John Wiegley <johnw@newartisans.com>
6389
1ec4b7b2 6390 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
6391 on Mac OS X Lion: __mod_init_func and __mod_term_func.
6392
ed6b3510
JW
6393 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6394 when building with Clang.
6395
8edd4a2b
SM
63962012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
6397
6398 * eval.c (Fapply): Allow calling it with a single argument.
6399
f6f62d1b
EZ
64002012-06-26 Eli Zaretskii <eliz@gnu.org>
6401
6402 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6403 _stricmp and _strnicmp.
6404 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6405
62efea5e
DA
64062012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6407
6408 * alloc.c (allocate_window): Zero out non-Lisp part of newly
6409 allocated window.
6410 (allocate_process): Likewise for new process.
8edd4a2b 6411 (allocate_terminal): Change to use offsetof.
62efea5e
DA
6412 (allocate_frame): Likewise.
6413 * frame.c (make_frame): Omit redundant initialization.
6414 * window.c (make_parent_window): Use memset.
6415 (make_window): Omit redundant initialization.
6416 * process.c (make_process): Omit redundant initialization.
6417 * terminal.c (create_terminal): Likewise.
6418
42997f4d
DA
64192012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6420
6421 * term.c (delete_tty): Remove redundant call to memset.
6422
1130ecfc
DA
64232012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6424
6425 * alloc.c: Remove build_string.
6426 * lisp.h: Define build_string as static inline. This provides
6427 a better opportunity to optimize away calls to strlen when the
6428 function is called with compile-time constant argument.
6429 * image.c (imagemagick_error): Convert to build_string.
6430 * w32proc.c (sys_spawnve): Likewise.
6431 * xterm.c (x_term_init): Likewise.
6432
cf38a720
PE
64332012-06-26 Paul Eggert <eggert@cs.ucla.edu>
6434
99027bdd
PE
6435 Use sprintf return value instead of invoking strlen on result.
6436 In the old days this wasn't portable, since some sprintf
6437 implementations returned char *. But they died out years ago and
6438 Emacs already assumes sprintf returns int.
6439 Similarly for float_to_string.
6440 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6441 * ccl.c (ccl_driver):
6442 * character.c (string_escape_byte8):
6443 * data.c (Fnumber_to_string):
6444 * doprnt.c (doprnt):
6445 * print.c (print_object):
6446 * xdisp.c (message_dolog):
6447 * xfns.c (syms_of_xfns):
6448 Use sprintf or float_to_string result to avoid need to call strlen.
6449 * data.c (Fnumber_to_string):
6450 Use make_unibyte_string, since the string must be ASCII.
6451 * lisp.h, print.c (float_to_string): Now returns int length.
6452 * term.c (produce_glyphless_glyph):
6453 Use sprintf result rather than recomputing it.
6454
cf38a720
PE
6455 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6456 * Makefile.in (ALL_CFLAGS):
6457 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6458 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6459
3511c784
DA
64602012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6461
0a08eb21 6462 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
6463 strcasecmp if available.
6464 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6465
fb7da12e
AS
64662012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6467
6468 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6469 Avoid comma operator.
6470 * menu.c (push_submenu_start, push_submenu_end)
6471 (push_left_right_boundary, push_menu_pane): Likewise.
6472 * msdos.c (dos_rawgetc): Likewise.
6473
afa2ffd8
DA
64742012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6475
6476 * xfns.c (xic_create_fontsetname): Remove redundant calls
6477 to memset.
6478
b3b4476b
PE
64792012-06-25 Paul Eggert <eggert@cs.ucla.edu>
6480
4495ff38
PE
6481 * gtkutil.c (get_utf8_string): Remove redundant assignment.
6482 sprintf already null-terminates its output.
6483
b3b4476b
PE
6484 * xfns.c (x_window): Remove redundant cast.
6485
b00876c9
DA
64862012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6487
6488 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6489 `const char *' to `char *' to avoid compiler warning.
6490
d188e26b
PE
64912012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6492
885d1d74
PE
6493 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6494 instead of truncating it to 63 (admittedly a generous limit).
6495
d188e26b
PE
6496 * process.c: Fix spelling and caps in comments.
6497
e2f560b1
DN
64982012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
6499
e86db54b 6500 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
6501 * sysdep.c (setpgrp): Remove definition, not used in this file.
6502
7583a3a1
JB
65032012-06-24 Juanma Barranquero <lekktu@gmail.com>
6504
6505 * makefile.w32-in: Update dependencies.
6506
696056c2
EZ
65072012-06-24 Eli Zaretskii <eliz@gnu.org>
6508
6509 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
6510 (SYSTIME_H): Add nt/inc/sys/time.h.
6511
6512 * systime.h [WINDOWSNT]: Include sys/time.h.
6513
6514 * s/ms-w32.h (struct timespec): Definition moved from
6515 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
6516
845ca893
PE
65172012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6518
6519 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
6520 * buffer.h (buffer_slot_type_mismatch):
6521 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6522 * eval.c (unwind_to_catch):
6523 * image.c (my_png_error, my_error_exit):
6524 * keyboard.c (quit_throw_to_read_char, user_error)
6525 (Fexit_recursive_edit, Fabort_recursive_edit):
6526 * lisp.h (die, args_out_of_range, args_out_of_range_3)
6527 (wrong_type_argument, buffer_overflow, __executable_start)
6528 (memory_full, buffer_memory_full, string_overflow, Fthrow)
6529 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
6530 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
6531 (fatal):
6532 (child_setup) [!DOS_NT]:
6533 * lread.c (end_of_file_error, invalid_syntax):
6534 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6535 * puresize.h (pure_write_error):
6536 * search.c (matcher_overflow):
6537 * sound.c (sound_perror, alsa_sound_perror):
6538 * sysdep.c, syssignal.h (croak):
6539 * term.c (maybe_fatal, vfatal):
6540 * textprop.c (text_read_only):
6541 * undo.c (user_error):
6542 * unexmacosx.c (unexec_error):
6543 * xterm.c (x_ins_del_lines, x_delete_glyphs):
6544 Use _Noreturn rather than NO_RETURN.
6545 No need for separate decl merely because of _Noreturn.
6546 * sound.c (sound_warning, parse_sound):
6547 Remove unnecessary forward decls.
6548
f1dd8073
PE
65492012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6550
6551 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
6552 * lisp.h (WAIT_READING_MAX): New macro.
6553 * dispnew.c (Fsleep_for, sit_for):
6554 * keyboard.c (kbd_buffer_get_event):
6555 * process.c (Faccept_process_output):
6556 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6557 This improves on the previous patch, which introduced a bug
6558 when time_t is unsigned and as wide as intmax_t.
6559 See <http://bugs.gnu.org/9000#51>.
6560
b82c1755
EZ
65612012-06-23 Eli Zaretskii <eliz@gnu.org>
6562
6563 * dispnew.c (sit_for, Fsleep_for):
6564 * keyboard.c (kbd_buffer_get_event):
6565 * process.c (Faccept_process_output): Avoid compiler warnings when
6566 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6567
ca300656
JB
65682012-06-23 Juanma Barranquero <lekktu@gmail.com>
6569
049ec95b
JB
6570 * makefile.w32-in: Update dependencies.
6571
ca300656
JB
6572 * w32.c (ltime): Add return type and declare static.
6573 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6574
db7b8d06
PE
65752012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6576
6577 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6578 Privately reported by Herbert J. Skuhra.
6579 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6580 All uses changed.
6581 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6582 not make_lisp_timeval, when the argument is of type EMACS_TIME.
6583
0bd8297f
EZ
65842012-06-23 Eli Zaretskii <eliz@gnu.org>
6585
96512555
EZ
6586 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6587 last argument of make_unibyte_string.
6588
0bd8297f
EZ
6589 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6590 language ID in the event parameters.
6591
6592 * w32term.c (w32_read_socket): Put the new keyboard codepage into
6593 event.code, not the obscure "character set ID".
6594
63def6b6
CY
65952012-06-23 Chong Yidong <cyd@gnu.org>
6596
6597 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6598
e8a02204
EZ
65992012-06-23 Eli Zaretskii <eliz@gnu.org>
6600
388cdec0
EZ
6601 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6602 * w32.c (fdutimens): New function.
6603
6604 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6605
6606 * s/ms-w32.h (pselect): Redirect to sys_select.
6607
6608 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6609
e8a02204
EZ
6610 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6611 in the logic of incrementing and decrementing the value of
6612 use_relocatable_buffers.
6613
d054f3fb
PE
66142012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6615
6616 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6617 Privately reported by Herbert J. Skuhra.
6618 [__FreeBSD__]: Remove "*/" typo after "#include".
6619 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6620 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6621 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6622 Don't assume EMACS_TIME and struct timeval are the same type.
6623
d35af63c
PE
66242012-06-22 Paul Eggert <eggert@cs.ucla.edu>
6625
6626 Support higher-resolution time stamps (Bug#9000).
6627 The time stamps are only nanosecond-resolution at the C level,
6628 since that's the best that any real-world system supports now.
6629 But they are picosecond-resolution at the Lisp level, as that's
6630 easy, and leaves room for future OS improvements.
6631
6632 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6633 (LIBES): Use it.
6634
6635 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6636 Don't get current time unless it's needed.
6637
6638 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6639 now provides it if it's absent.
6640 (start_atimer): Port to higher-res time stamps.
6641 Check for time stamp overflow. Don't get current time more
6642 often than is needed.
6643
6644 * buffer.h (struct buffer): Buffer modtime now has high resolution.
6645 Include systime.h, not time.h.
6646 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
6647
6648 * dired.c: Include stat-time.h.
6649 (Ffile-attributes): File times now have higher resolution.
6650
6651 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
6652 (struct image): Timestamp now has higher resolution.
6653
6654 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
6655 has at least microseconds now. All uses removed.
6656 (update_frame, update_single_window, update_window, update_frame_1)
6657 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 6658 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
6659
6660 * editfns.c (time_overflow): Now extern.
6661 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
6662 (float-time, Fformat_time_string, Fcurrent_time_string)
6663 (Fcurrent_time_zone): Accept and generate higher-resolution
6664 time stamps.
6665 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
6666 (decode_time_components, lisp_seconds_argument): New functions.
6667 (make_time): Now static.
6668 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
6669 Report an error if the time is invalid, rather than having the caller
6670 do that.
6671
6672 * fileio.c: Include <stat-time.h>
6673 (Fcopy_file): Copy higher-resolution time stamps.
6674 Prefer to set the time stamp via a file descriptor if that works.
6675 (Fset_file_times, Finsert_file_contents, Fwrite_region)
6676 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
6677 (Fvisited_file_modtime, Fset_visited_file_modtime):
6678 Support higher-resolution time stamps.
6679
6680 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6681
6682 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6683
6684 * image.c (prepare_image_for_display, clear_image_cache)
6685 (lookup_image): Port to higer-resolution time stamps.
6686
6687 * keyboard.c (start_polling, bind_polling_period):
6688 Check for time stamp overflow.
6689 (read_char, kbd_buffer_get_event, timer_start_idle)
6690 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6691 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6692 Port to higher-resolution time stamps. Do not assume time_t is signed.
6693 (decode_timer): New function. Timers are now vectors of length 9,
6694 not 8, to accommodate the picosecond component.
6695 (timer_check_2): Use it.
6696
6697 * nsterm.m (select_timeout, timeval_subtract): Remove.
6698 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6699 as they're a bit more accurate and handle overflow better.
6700 (ns_select): Change prototype to be compatible with pselect.
6701 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6702 * nsterm.h (ns_select): Adjust prototype.
6703
6704 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6705 us-resolution time stamps.
6706 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6707
6708 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6709
6710 * lisp.h (time_overflow): New decl.
6711 (wait_reading_process_output): First arg is now intmax_t, not int,
6712 to accommodate larger waits.
6713
6714 * process.h (struct Lisp_Process.read_output_delay):
6715 Now counts nanoseconds, not microseconds.
6716 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6717 EMACS_HAS_USECS.
6718 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6719 (wait_reading_process_output):
6720 Port to ns-resolution time stamps.
6721 (Faccept_process_output, wait_reading_process_output):
6722 Check for time stamp overflow. Do not assume time_t is signed.
6723 (select_wrapper): Remove; we now use pselect.
6724 (Fprocess_attributes): Now generates ns-resolution time stamps.
6725
6726 * sysdep.c: Include utimens.h. Don't include utime.h
6727 or worry about struct utimbuf; gnulib does that for us now.
6728 (gettimeofday): Remove; gnulib provides a substitute.
6729 (make_timeval): New function.
6730 (set_file_times): Now sets ns-resolution time stamps.
6731 New arg FD; all uses changed.
6732 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6733 (system_process_attributes):
6734 Now returns ns-resolution time stamp. All uses changed.
6735 Check for time stamp overflow.
6736
6737 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6738 provides a substitute now.
6739
6740 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6741 since it guarantees struct timespec.
6742 (EMACS_TIME): Now struct timespec, so that we can support
6743 ns-resolution time stamps.
6744 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6745 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6746 (EMACS_USECS): Remove.
6747 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6748 so multiply the arg by 1000 before storing it.
6749 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6750 New macros.
6751 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6752 Port to ns-resolution time stamps.
6753 (EMACS_TIME_NEG_P): Remove; replaced by....
6754 (EMACS_TIME_SIGN): New macro.
6755 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6756 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6757 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6758 (make_timeval, make_lisp_time, decode_time_components): New decls.
6759 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6760 that it mishandled time_t overflow. You can't compare by subtracting!
6761 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6762 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6763
6764 * term.c: Include <sys/time.h>.
6765 (timeval_to_Time): New function, for proper overflow wraparound.
6766 (term_mouse_position, term_mouse_click): Use it.
6767
6768 * undo.c (record_first_change): Support higher-resolution time stamps
6769 in the undo buffer.
6770 (Fprimitive_undo): Use them when restoring time stamps.
6771
6772 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6773 (w32_get_internal_run_time):
6774 Port to higher-resolution Emacs time stamps.
6775 (ltime): Now accepts single 64-bit integer, as that's more convenient
6776 for callers.
6777
6778 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6779
6780 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6781 for compatibility with pselect. Support ns-resolution time stamps.
6782
6783 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6784
6785 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6786 Check for time stamp overflow, and support ns-resolution time stamps.
6787
6788 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6789 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6790 (timeval_subtract): Remove; no longer needed.
6791 (XTflash, XTring_bell, x_wait_for_event):
6792 Port to ns-resolution time stamps. Don't assume time_t is signed.
6793
b6a92dfe
CY
67942012-06-22 Chong Yidong <cyd@gnu.org>
6795
6796 * xdisp.c (x_consider_frame_title): Revert last change.
6797
d251c37c
EZ
67982012-06-22 Eli Zaretskii <eliz@gnu.org>
6799
6800 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6801 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6802 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6803 staticidx goes up to 1597 out of 1600 = 0x640.)
6804
f10deafb
PE
68052012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6806
6807 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6808 Otherwise, the umask might be mistakenly 0 while handling input signals.
6809
ec6de1e2
SM
68102012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6811
6812 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6813
28be1ada
DA
68142012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6815
6816 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6817 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6818 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6819 access to `contents' member of Lisp_Vector objects with AREF and ASET
6820 where appropriate.
6821
c6bf3022
CY
68222012-06-19 Chong Yidong <cyd@gnu.org>
6823
6824 * frame.c (delete_frame): When selecting a frame on a different
6825 text terminal, do not alter the terminal's top-frame.
6826
6827 * xdisp.c (format_mode_line_unwind_data): Record the target
6828 frame's selected window and its terminal's top-frame.
6829 (unwind_format_mode_line): Restore them.
6830 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6831 Callers changed.
6832 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6833 since tty frames can be explicitly named.
6834 (prepare_menu_bars): Likewise.
6835
6836 * term.c (Ftty_top_frame): New function.
6837
defd4196
PE
68382012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6839
6840 Port byte-code-meter to modern targets.
6841 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6842 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 6843 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
6844 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6845 (METER_1, METER_2): Simplify.
6846
1053a871
SM
68472012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6848
6849 * data.c (Fdefalias): Return `symbol' (bug#11686).
6850
b7e8d081
MR
68512012-06-18 Martin Rudalics <rudalics@gmx.at>
6852
6853 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
6854 gets killed during executing of this function (Bug#11665).
6855 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
6856 (Vkill_buffer_query_functions): In doc-string say that functions
6857 run by this hook should not change the current buffer.
6858
7ea2b339
PE
68592012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6860
6861 Fix recently-introduced process.c problems found by static checking.
6862 * process.c (write_queue_push, write_queue_pop, send_process):
6863 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6864 (write_queue_pop): Fix pointer signedness problem.
6865 (send_process): Remove unused local.
6866
96a313a1
CY
68672012-06-17 Chong Yidong <cyd@gnu.org>
6868
6869 * xdisp.c (redisplay_internal): No need to redisplay terminal
6870 frames that are not on top.
6871
20ca2e94
TN
68722012-06-17 Troels Nielsen <bn.troels@gmail.com>
6873
6874 * process.c (make_process): Initialize write_queue.
6875 (write_queue_push, write_queue_pop): New functions.
6876 (send_process): Use them to maintain correct ordering of process
6877 writes (Bug#10815).
6878
9a900ca9
PE
68792012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6880
310fbfa8
PE
6881 * lisp.h (eassert): Assume C89 or later.
6882 This removes the need for CHECK.
6883 (CHECK): Remove. Its comments about always evaluating its
6884 argument were confusing, as 'eassert' typically does not evaluate
6885 its argument.
6886
27bb1ca4
PE
6887 * coding.c (produce_chars): Use ptrdiff_t, not int.
6888
9a900ca9
PE
6889 * xterm.c (x_draw_underwave): Check for integer overflow.
6890 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6891
41b7f8bc 68922012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
6893
6894 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6895 referenced (Bug#11583).
6896
9b0e3eba
AA
68972012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6898
6899 Implement wave-style variant of underlining.
6900 * dispextern.h (face_underline_type): New enum.
6901 (face): Add field for underline type.
6902 * nsterm.m (ns_draw_underwave): New function.
6903 (ns_draw_text_decoration): Use it.
6904 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6905 New functions.
6906 (x_draw_glyph_string): Use them.
6907 * xfaces.c (Qline, Qwave): New Lisp objects.
6908 (check_lface_attrs, merge_face_ref)
1053a871
SM
6909 (Finternal_set_lisp_face_attribute, realize_x_face):
6910 Handle wave-style underline face attributes.
9b0e3eba
AA
6911 * xterm.c (x_draw_underwave): New function.
6912 (x_draw_glyph_string): Use it.
6913
0fb52f11
JB
69142012-06-16 Juanma Barranquero <lekktu@gmail.com>
6915
6916 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6917 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6918 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6919 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6920 ($(BLD)/w32select.$(O)): Update dependencies.
6921
e5560ff7
AS
69222012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6923
6924 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6925 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6926 * character.c (_fetch_multibyte_char_p): Remove.
6927 * alloc.c: Include "character.h" before "buffer.h".
6928 * bidi.c: Likewise.
6929 * buffer.c: Likewise.
6930 * bytecode.c: Likewise.
6931 * callint.c: Likewise.
6932 * callproc.c: Likewise.
6933 * casefiddle.c: Likewise.
6934 * casetab.c: Likewise.
6935 * category.c: Likewise.
6936 * cmds.c: Likewise.
6937 * coding.c: Likewise.
6938 * composite.c: Likewise.
6939 * dired.c: Likewise.
6940 * dispnew.c: Likewise.
6941 * doc.c: Likewise.
6942 * dosfns.c: Likewise.
6943 * editfns.c: Likewise.
6944 * emacs.c: Likewise.
6945 * fileio.c: Likewise.
6946 * filelock.c: Likewise.
6947 * font.c: Likewise.
6948 * fontset.c: Likewise.
6949 * fringe.c: Likewise.
6950 * indent.c: Likewise.
6951 * insdel.c: Likewise.
6952 * intervals.c: Likewise.
6953 * keyboard.c: Likewise.
6954 * keymap.c: Likewise.
6955 * lread.c: Likewise.
6956 * macros.c: Likewise.
6957 * marker.c: Likewise.
6958 * minibuf.c: Likewise.
6959 * nsfns.m: Likewise.
6960 * nsmenu.m: Likewise.
6961 * print.c: Likewise.
6962 * process.c: Likewise.
6963 * regex.c: Likewise.
6964 * region-cache.c: Likewise.
6965 * search.c: Likewise.
6966 * syntax.c: Likewise.
6967 * term.c: Likewise.
6968 * textprop.c: Likewise.
6969 * undo.c: Likewise.
6970 * unexsol.c: Likewise.
6971 * w16select.c: Likewise.
6972 * w32fns.c: Likewise.
6973 * w32menu.c: Likewise.
6974 * window.c: Likewise.
6975 * xdisp.c: Likewise.
6976 * xfns.c: Likewise.
6977 * xmenu.c: Likewise.
6978 * xml.c: Likewise.
6979 * xselect.c: Likewise.
6980
2f07e6af
EZ
69812012-06-16 Eli Zaretskii <eliz@gnu.org>
6982
1053a871
SM
6983 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6984 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 6985 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
6986 row.
6987 (handle_face_prop): Use chunk-relative overlay string index when
6988 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
6989 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6990 the rightmost. (Bug#11720)
2f07e6af 6991
29b83cec
AS
69922012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6993
6994 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6995 (CATEGORY_MEMBER): Enforce 1/0 value.
6996 * category.c (_temp_category_set): Remove.
6997
4c5501e9
EZ
69982012-06-16 Eli Zaretskii <eliz@gnu.org>
6999
7000 * window.c (Fdelete_other_windows_internal)
7001 (Fdelete_window_internal): Don't access frame's mouse highlight
7002 info of the initial frame. (Bug#11677)
7003
2b570124
PE
70042012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7005
e93864f9
PE
7006 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7007 Assume USE_2_TAGS_FOR_INTS.
7008 (xreload): Adjust $tagmask width to match recent lisp.h change.
7009
2b570124
PE
7010 Simplify lisp.h in minor ways that should not affect code.
7011 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7012 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7013 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7014 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7015 (INTTYPEBITS): New macro, for clarity.
7016 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
7017 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7018 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
7019 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7020 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7021
81755f69
JB
70222012-06-13 Juanma Barranquero <lekktu@gmail.com>
7023
7024 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7025
16192a57
GM
70262012-06-13 Glenn Morris <rgm@gnu.org>
7027
7028 * s/bsd-common.h (BSD4_3):
7029 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7030
646b5f55
AS
70312012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7032
7033 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7034 instead of union.
7035 (XLI, XIL): Define.
1053a871
SM
7036 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7037 Use them.
7038 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 7039 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 7040 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
7041 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7042 * frame.c (delete_frame): Remove outdated comment.
7043 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7044 USE_LISP_UNION_TYPE.
7045 (Fw32_unregister_hot_key): Likewise.
7046 (Fw32_toggle_lock_key): Likewise.
7047 * w32menu.c (add_menu_item): Likewise.
7048 (w32_menu_display_help): Use XIL instead of checking
7049 USE_LISP_UNION_TYPE.
7050 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7051 (init_heap): Likewise.
7052 * w32term.c (w32_read_socket): Update comment.
7053
1d3823c9
GM
70542012-06-13 Glenn Morris <rgm@gnu.org>
7055
c62ff706
GM
7056 * s/usg5-4-common.h, src/s/unixware.h:
7057 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7058
1d3823c9
GM
7059 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7060
bfe3e0a2
PE
70612012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7062
7063 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7064 * alloc.c (make_number) [!defined make_number]:
7065 Remove, as lisp.h always defines this now.
7066 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7067 (roundup_size): Verify that it is a power of 2.
7068 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7069 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7070 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7071 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7072 USE_LSB_TAG now is always defined to be either 0 or 1.
7073 All uses changed.
7074 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7075 code works fine either way, and efficiency is not a concern here,
7076 as the union type is for debugging, not for production.
7077 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7078 Use an inline function on all platforms when using the union type,
7079 since this is simpler and 'static inline' can be used portably
7080 within Emacs now.
7081 (LISP_INITIALLY_ZERO): New macro.
7082 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7083 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7084
45fa9c0f
GM
70852012-06-12 Glenn Morris <rgm@gnu.org>
7086
b4492cba
GM
7087 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7088
7089 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 7090
45fa9c0f
GM
7091 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7092 Move BROKEN_SIGIO to configure.
7093
7094 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7095 Move NO_TERMIO to configure.
7096
0e25d334
CY
70972012-06-12 Chong Yidong <cyd@gnu.org>
7098
7099 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7100 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7101 MagickExportImagePixels is undefined.
7102
43682bb6
PE
71032012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7104
7105 * image.c (imagemagick_load_image): Remove unused label.
7106
a9be7d2b
GM
71072012-06-11 Glenn Morris <rgm@gnu.org>
7108
7109 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7110 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7111 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7112 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7113
3017f87f
SM
71142012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7115
7116 * alloc.c (make_byte_code): New function.
7117 (Fmake_byte_code): Use it. Don't purify here.
7118 * lread.c (read1): Use it as well to avoid extra allocation.
7119
1b9b4cf4
CY
71202012-06-11 Chong Yidong <cyd@gnu.org>
7121
7122 * image.c (imagemagick_load_image): Implement transparency.
7123
95988fcf
AS
71242012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7125
7126 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7127 account for preceding backslashes. (Bug#11663)
7128
cd4eb164
CY
71292012-06-09 Chong Yidong <cyd@gnu.org>
7130
7131 * term.c: Support italics in capable terminals (Bug#9652).
7132 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7133 (turn_on_face): Output using TS_enter_italic_mode if available.
7134 Don't handle unused blinking and alt-charset cases.
7135 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7136 and tty_alt_charset_p cases.
7137 (tty_capable_p, init_tty): Support italics.
7138
7139 * termchar.h (struct tty_display_info): Add field for italics.
7140 Remove unused blink field.
7141
7142 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7143 Handle slant.
7144
7145 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7146 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7147 tty_alt_charset_p. Add tty_italic_p.
7148
ff88beb8
MA
71492012-06-09 Michael Albinus <michael.albinus@gmx.de>
7150
7151 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
7152 dbus_type_is_basic if available.
7153 (xd_extract_signed, xd_extract_unsigned): Rename from
7154 extract_signed and extract_unsigned, respectively. Adapt callers.
7155
44286096
CY
71562012-06-09 Chong Yidong <cyd@gnu.org>
7157
1682701f
CY
7158 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
7159
44286096
CY
7160 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
7161 case (Bug#9752).
7162
d86feb17
PE
71632012-06-08 Paul Eggert <eggert@cs.ucla.edu>
7164
7165 * xdisp.c (vmessage): Treat frame message as multibyte.
7166 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
7167 would generate the diagnostic "Making \302\247 buffer-local while
7168 let-bound!".
7169
d5c20fe8
EZ
71702012-06-08 Eli Zaretskii <eliz@gnu.org>
7171
7172 * dispnew.c (showing_window_margins_p): Undo last change, which
7173 was done due to an inadvertent commit.
7174 (adjust_frame_glyphs_for_frame_redisplay): Do call
7175 showing_window_margins_p.
7176
513749ee
SM
71772012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7178
7179 * eval.c (Fmake_var_non_special): New primitive.
7180 (syms_of_eval): Defsubr it.
7181 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
7182
d4a8f5c1
JB
71832012-06-08 Juanma Barranquero <lekktu@gmail.com>
7184
7185 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
7186 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
7187
8bbbc977
EZ
71882012-06-08 Eli Zaretskii <eliz@gnu.org>
7189
7190 * alloc.c (allocate_vectorlike): Fix last change.
7191
f3372c87
DA
71922012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
7193
7194 Block-based vector allocation of small vectors.
7195 * lisp.h (struct vectorlike_header): New field `nbytes',
7196 adjust comment accordingly.
7197 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 7198 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
7199 mark_maybe_pointer, valid_lisp_object_p) accordingly.
7200 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
7201 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
7202 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
7203 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
7204 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
7205 (roundup_size): New constant.
7206 (struct vector_block): New data type.
7207 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 7208 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
7209 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
7210 (sweep_vectors): New functions.
7211 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 7212 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
7213 or equal to VBLOCK_BYTES_MAX.
7214 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
7215 (init_alloc_once): Add call to init_vectors.
7216
4f18a4ed
SM
72172012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7218
7219 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
7220
86f158bc
PE
72212012-06-07 Paul Eggert <eggert@cs.ucla.edu>
7222
7223 * doprnt.c (doprnt): Truncate multibyte char correctly.
7224 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
7225 would mishandle a string argument "Xc" if X was a multibyte
7226 character of length 2: it would truncate after X's first byte
7227 rather than including all of X.
7228
c5cfcbe0
CY
72292012-06-06 Chong Yidong <cyd@gnu.org>
7230
7231 * buffer.c (word_wrap): Doc fix.
7232
c05cf390
PE
72332012-06-04 Paul Eggert <eggert@cs.ucla.edu>
7234
7235 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
7236
0c3461de
GM
72372012-06-03 Glenn Morris <rgm@gnu.org>
7238
7239 * xdisp.c (tool-bar-style): Doc fix.
7240
c71232db
UM
72412012-06-03 Ulrich Müller <ulm@gentoo.org>
7242
7243 * Makefile.in (PAXCTL): Define.
7244 (temacs$(EXEEXT)): Disable memory randomization for the temacs
7245 binary via PaX flags if the paxctl utility is available.
7246 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7247 Restore PaX flags to their default. (Bug#11398)
7248
383f7350
CY
72492012-06-03 Chong Yidong <cyd@gnu.org>
7250
7251 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
7252 buffer (Bug#11226).
7253
5f2c76c6
CY
72542012-06-03 Chong Yidong <cyd@gnu.org>
7255
7256 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
7257 (note_mode_line_or_margin_highlight): If there is no help echo,
7258 use mode-line-default-help-echo. Handle the case where the mouse
7259 position is past the end of the mode line string.
7260
7261 * buffer.c (buffer_local_value_1): New function, split from
7262 Fbuffer_local_value; can return Qunbound.
7263 (Fbuffer_local_value): Use it.
7264 (Vmode_line_format): Docstring tweaks.
7265
773d47f6
PE
72662012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7267
7268 * sysdep.c (system_process_attributes): Improve comment.
7269
f2d6a3df
SM
72702012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
7271
7272 * keyboard.c: Export real-this-command to Elisp.
7273 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
7274 and DEFVAR it. Update all users.
7275
63810350
PE
72762012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7277
7bd5c1f4
PE
7278 * minibuf.c (Fassoc_string): Remove duplicate declaration.
7279
63810350
PE
7280 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
7281 Convert pctcpu and pctmem to Lisp float properly.
7282 Let the compiler fold better, as 100.0/0x8000 is exact.
7283
a2821611
AS
72842012-06-02 Andreas Schwab <schwab@linux-m68k.org>
7285
7286 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
7287 cons_block.
7288
5fceba1d
PE
72892012-06-01 Paul Eggert <eggert@cs.ucla.edu>
7290
7291 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
7292
c98ff5dd
DA
72932012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
7294
7295 For a 'struct window', replace some Lisp_Object fields to
7296 bitfields where appropriate, remove unused fields.
7297 * window.h (struct window): Remove unused 'last_mark_x' and
7298 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
7299 change it's type from Lisp_Object to bitfield.
7300 Change type of 'force_start', 'optional_new_start',
7301 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 7302 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 7303
ca34e0be
PE
73042012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7305
7306 Pacify gcc -Wdouble-precision when using Xaw.
7307 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
7308 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
7309 Use 'float' consistently, rather than 'float' in most places
7310 and 'double' in a couple of places.
7311
efc00ab1 73122012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
7313
7314 * xdisp.c (handle_stop): Detect whether we have overlay strings
7315 loaded by testing it->current.overlay_string_index to be
7316 non-negative, instead of checking whether n_overlay_strings is
7317 positive. (Bug#11587)
7318
efc00ab1 73192012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
7320
7321 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
7322
7323 * doc.c (Fsubstitute_command_keys): Doc fix.
7324
efc00ab1 73252012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
7326
7327 * search.c (search_buffer): Remove calls to
7328 r_alloc_inhibit_buffer_relocation, as it is now called by
7329 maybe_unify_char, which was the cause of relocation of buffer text
7330 in bug#11519.
7331
efc00ab1 73322012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
7333
7334 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
7335 for the duration of call to load_charset, to avoid problems with
7336 callers of maybe_unify_char that access buffer text through C
7337 pointers.
7338
7339 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
7340 decrement the inhibition flag, instead of just setting or
7341 resetting it.
7342
ba93a187
PE
73432012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7344
7345 Remove obsolete '#define static' cruft.
7346 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
7347 This #undef was "temporary" in 2000; it is no longer needed
7348 now that '#define static' has gone away.
7349 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
7350 (gray_bitmap_bits): Remove; no longer needed.
7351 All uses replaced with definiens.
7352 * xterm.c: Include "bitmaps/gray.xbm".
7353
9e4bf381
PE
73542012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7355
7356 Clean up __executable_start, monstartup when --enable-profiling.
7357 The following changes affect the code only when profiling.
7358 * dispnew.c (__executable_start): Rename from safe_bcopy.
7359 Define only on platforms that need it.
7360 * emacs.c: Include <sys/gmon.h> when profiling.
7361 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
7362 (__executable_start): Remove decl, since lisp.h does it now.
7363 (safe_bcopy): Remove decl; no longer has that name.
7364 (main): Coalesce #if into single bit of code, for simplicity.
7365 Cast pointers to uintptr_t, since standard libraries want integers
7366 and not pointers.
7367 * lisp.h (__executable_start): New decl.
7368
32d72c2f
GM
73692012-05-31 Glenn Morris <rgm@gnu.org>
7370
7371 * image.c (Fimagemagick_types): Doc fix.
7372
baac5bc7
JM
73732012-05-30 Jim Meyering <meyering@redhat.com>
7374
7375 * callproc.c (Fcall_process_region): Include directory component
7376 in mkstemp error message (Bug#11586).
7377
72cb32cf
PE
73782012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7379
7380 * alloc.c, lisp.h (make_pure_vector): Now static.
7381
61b108cc
SM
73822012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
7383
7384 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7385 Move to byte-run.el.
7386 (Fautoload): Do the hash-doc more carefully.
7387 * data.c (Fdefalias): Purify definition, except for keymaps.
7388 (Qdefun): Move from eval.c.
7389 * lisp.h (Qdefun): Remove.
7390 * lread.c (read1): Tiny simplification.
7391
471fe23d
TN
73922012-05-29 Troels Nielsen <bn.troels@gmail.com>
7393
934f3f58 7394 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
7395 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7396 Bug#9642, but explicitly check that the buffer the overlay would
7397 be moved to is live and rearrange lines to make sure that errors
7398 will not put the overlay in an inconsistent state.
7399 (Fdelete_overlay): Cosmetics.
7400
85d0efd1
EZ
74012012-05-28 Eli Zaretskii <eliz@gnu.org>
7402
7403 * w32term.c (my_bring_window_to_top): New function.
7404 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
7405 could be different from the original one.
7406 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
7407 (Bug#11513)
7408
7409 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7410 by calling BringWindowToTop.
7411
7412 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
7413 (WM_EMACS_END): Increase by one.
7414
da92a98c
PE
74152012-05-28 Paul Eggert <eggert@cs.ucla.edu>
7416
7417 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
7418 This avoids undefined behavior that might cause the eassert
7419 to not catch an out-of-range value.
7420
74d1f848
JB
74212012-05-28 Juanma Barranquero <lekktu@gmail.com>
7422
7423 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7424 Update dependencies.
7425
9e1a06fc
EZ
74262012-05-27 Eli Zaretskii <eliz@gnu.org>
7427
7428 * bidi.c (bidi_mirror_char): Fix last change.
7429
f3dd7312
AS
74302012-05-27 Andreas Schwab <schwab@linux-m68k.org>
7431
7432 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7433 when referring to sectname field in printf format.
7434
81899c91
PE
74352012-05-27 Paul Eggert <eggert@cs.ucla.edu>
7436
57b81a9f
PE
7437 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7438 Only r_alloc_inhibit_buffer_relocation needed to be added;
7439 the others were already declared.
7440
81899c91
PE
7441 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7442 before checking whether it's out of range. Put the check inside
7443 eassert. See
7444 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7445
33017faf 74462012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
7447
7448 * callproc.c (Fcall_process): Restore a line that was accidentally
7449 commented out in the 2011-02-13 change (bug#11547).
7450
33017faf 74512012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
7452
7453 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7454 defined on ralloc.c.
7455
7456 * buffer.c [REL_ALLOC]: Remove prototypes of
7457 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7458 they are now on lisp.h.
7459
7460 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7461
7462 * search.c (search_buffer): Use it to inhibit relocation of buffer
7463 text while re_search_2 is doing its job, because re_search_2 is
7464 passed C pointers to buffer text. (Bug#11519)
7465
23415acf
EZ
7466 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7467 Update value to 24.
7468
44e27368
EZ
7469 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7470 state after an additional call to move_it_in_display_line_to, keep
7471 the values of it->max_ascent and it->max_descent found for the
7472 entire line.
7473 (pos_visible_p): Revert the comparison against bottom_y to what it
7474 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7475 (Bug#11464)
7476
c1892f11
PE
74772012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7478
7479 Fix coding-related core dumps with gcc -ftrapv.
7480 The code was computing A - B, where A and B are pointers, and B is
7481 random garbage. This can lead to core dumps on platforms that
7482 have special pointer registers, and it also leads to core dumps on
7483 x86-64 when compiled with gcc -ftrapv. The fix is to compute
7484 A - B only when B is initialized properly.
7485 * coding.c (coding_set_source, coding_set_destination): Return void.
7486 (coding_change_source, coding_change_destinations): New functions,
7487 with the old behaviors of coding_set_source and coding_set_destination.
7488 All callers that need an offset changed to use these new functions.
7489
eb7afdad
GM
74902012-05-26 Glenn Morris <rgm@gnu.org>
7491
7492 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
7493
f12fdf02
EZ
74942012-05-26 Eli Zaretskii <eliz@gnu.org>
7495
53a63be6 7496 Extend mouse support on W32 text-mode console.
61b108cc
SM
7497 * xdisp.c (draw_row_with_mouse_face):
7498 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 7499
eb3f6f01 7500 * w32console.c: Include window.h.
61b108cc
SM
7501 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
7502 New functions.
eb3f6f01
EZ
7503 (initialize_w32_display): Initialize mouse-highlight data.
7504
53a63be6
EZ
7505 * w32inevt.c: Include termchar.h and window.h.
7506 (do_mouse_event): Support mouse-autoselect-window. When the mouse
7507 moves, call note_mouse_highlight. If help_echo changed, call
7508 gen_help_event to produce help-echo message in the echo area.
7509 Call clear_mouse_face if mouse_face_hidden is set in the mouse
7510 highlight info.
7511
4cfd81f6
PE
75122012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7513
7514 * lread.c (read1): Simplify slightly to avoid an overflow warning
7515 with GCC 4.7.0 on x86-64.
7516
4446092a
EZ
75172012-05-26 Eli Zaretskii <eliz@gnu.org>
7518
7519 * bidi.c (bidi_mirror_char): Revert last change: an int is
7520 definitely wide enough here.
7521
42b2a986 75222012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 7523
42b2a986 7524 Fix integer width and related bugs (Bug#9874).
eb106a49 7525 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
7526 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
7527 (string_bytes, check_sblock, allocate_string_data):
7528 (compact_small_strings, Fmake_bool_vector, make_string)
7529 (make_unibyte_string, make_multibyte_string)
7530 (make_string_from_bytes, make_specified_string)
7531 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
7532 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
7533 (mark_vectorlike):
7534 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7535 (allocate_pseudovector):
7536 Use int, not EMACS_INT, where int is wide enough.
7537 (inhibit_garbage_collection, Fgarbage_collect):
7538 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7539 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
7540 int might not be wide enough.
7541 (bidi_cache_search, bidi_cache_find, bidi_init_it)
7542 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
7543 (bidi_at_paragraph_end, bidi_find_paragraph_start)
7544 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7545 (bidi_level_of_next_char, bidi_move_to_visually_next):
7546 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7547 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
7548 (Fkill_buffer, Fset_buffer_major_mode)
7549 (advance_to_char_boundary, Fbuffer_swap_text)
7550 (Fset_buffer_multibyte, overlays_at, overlays_in)
7551 (overlay_touches_p, struct sortvec, record_overlay_string)
7552 (overlay_strings, recenter_overlay_lists)
7553 (adjust_overlays_for_insert, adjust_overlays_for_delete)
7554 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
7555 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
7556 (Foverlay_recenter, last_overlay_modification_hooks_used)
7557 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7558 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
7559 (validate_region): Omit unnecessary test for b <= e,
7560 since that's guaranteed by the previous test.
d311d28c
PE
7561 (adjust_overlays_for_delete): Avoid pos + length overflow.
7562 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7563 (report_overlay_modification):
7564 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7565 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7566 Omit pointer cast, which isn't needed anyway, and doesn't work
7567 after the EMACS_INT -> ptrdiff_t change.
02481186 7568 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
7569 * buffer.h: Adjust decls to match defn changes elsewhere.
7570 (struct buffer_text, struct buffer):
7571 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7572 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
7573 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7574 not int, to avoid needless 32-bit limit on 64-bit hosts.
7575 (exec_byte_code): Use tighter memory-full test, one that checks
7576 for alloca overflow. Don't compute the address of the object just
7577 before an array, as that's not portable. Use EMACS_INT, not
7578 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
7579 * callint.c (Fcall_interactively):
7580 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7581 * callproc.c (call_process_kill, Fcall_process):
7582 Don't assume pid_t fits into an Emacs fixnum.
7583 (call_process_cleanup, Fcall_process, child_setup):
7584 Don't assume pid_t fits into int.
7585 (call_process_cleanup, Fcall_process, delete_temp_file)
7586 (Fcall_process_region):
7587 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7588 (Fcall_process): Simplify handling of volatile integers.
7589 Use int, not EMACS_INT, where int will do.
7590 * casefiddle.c (casify_object, casify_region, operate_on_word)
7591 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7592 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7593 (casify_object): Avoid integer overflow when overallocating buffer.
7594 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 7595 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
7596 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7597 * category.h (CATEGORYP): Don't assume arg is nonnegative.
7598 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7599 integers are now checked earlier. All uses replaced with XINT.
7600 (ccl_driver):
7601 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7602 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
7603 (ccl_driver, Fregister_code_conversion_map):
7604 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
7605 (resolve_symbol_ccl_program): Check that vector header is in range.
7606 Always copy the vector, so that we can check its contents reliably
7607 now rather than having to recheck each instruction as it's being
7608 executed. Check that vector words fit in 'int'.
7609 (ccl_get_compiled_code, Fregister_ccl_program)
7610 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7611 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7612 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7613 contents are in range.
7614 (Fccl_execute_on_string): Check that status is in range.
7615 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7616 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7617 Accept and return EMACS_INT, not int, because callers can pass values
7618 out of 'int' range.
7619 (c_string_width, strwidth, lisp_string_width, chars_in_text)
7620 (multibyte_chars_in_text, parse_str_as_multibyte)
7621 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7622 (str_as_unibyte, str_to_unibyte, string_count_byte8)
7623 (string_escape_byte8, Fget_byte):
7624 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 7625 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
7626 avoid mishandling large integers.
7627 * character.h: Adjust decls to match defn changes elsewhere.
7628 * charset.c (load_charset_map_from_file, find_charsets_in_text)
7629 (Ffind_charset_region):
7630 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7631 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7632 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 7633 Don't assume fixnum fits in int.
d311d28c
PE
7634 (load_charset_map_from_vector, Fmap_charset_chars):
7635 Remove now-unnecessary CHECK_NATNUMs.
7636 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
7637 Don't rely on undefined behavior with signed left shift overflow.
7638 Don't assume unsigned int fits into fixnum, or that fixnum fits
7639 into unsigned int. Don't require max_code to be a valid fixnum;
7640 that's not true for gb10830 4-byte on a 32-bit host. Allow
7641 invalid_code to be a cons, for the same reason. Require code_offset
7642 to be a character. Avoid int overflow if max_char is close
7643 to INT_MAX.
7644 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7645 this is intended anyway and avoids some undefined behavior.
7646 (load_charset_map): Pass unsigned, not int, as 2nd arg of
7647 INDEX_TO_CODE_POINT, as that's what it expects.
7648 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
7649 * charset.h (DECODE_CHAR): Return int, not unsigned;
7650 this is what was intended anyway, and it avoids undefined behavior.
7651 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
7652 integer-overflow issues.
7653 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
7654 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
7655 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
7656 * chartab.c (Fmake_char_table, Fset_char_table_range)
7657 (uniprop_get_decoder, uniprop_get_encoder):
7658 Don't assume fixnum fits in int.
7659 * cmds.c (move_point): New function, that does the gist of
7660 Fforward_char and Fbackward_char, but does so while checking
7661 for integer overflow more accurately.
c96e5d6a 7662 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
7663 (Fforward_line, Fend_of_line, internal_self_insert)
7664 (internal_self_insert):
7665 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7666 Fix a FIXME, by checking for integer overflow when calculating
7667 target_clm and actual_clm.
7668 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 7669 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
7670 (ASSURE_DESTINATION, coding_alloc_by_realloc)
7671 (coding_alloc_by_making_gap, alloc_destination)
7672 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
7673 (encode_coding_utf_16, detect_coding_emacs_mule)
7674 (decode_coding_emacs_mule, encode_coding_emacs_mule)
7675 (detect_coding_iso_2022, decode_coding_iso_2022)
7676 (encode_invocation_designation, encode_designation_at_bol)
7677 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7678 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7679 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7680 (encode_coding_ccl, encode_coding_raw_text)
7681 (detect_coding_charset, decode_coding_charset)
7682 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7683 (produce_composition, produce_charset, produce_annotation)
7684 (decode_coding, handle_composition_annotation)
7685 (handle_charset_annotation, consume_chars, decode_coding_gap)
7686 (decode_coding_object, encode_coding_object, detect_coding_system)
7687 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7688 (code_convert_region, code_convert_string)
8f50130c
PE
7689 (Fdefine_coding_system_internal)
7690 (coding_set_source, coding_set_destination):
d311d28c
PE
7691 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7692 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7693 (Fdefine_coding_system_internal):
7694 Don't assume fixnums fit in int.
7695 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 7696 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
7697 (Funencodable_char_position, Fcheck_coding_systems_region)
7698 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 7699 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 7700 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 7701 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 7702 Don't access memory outside of the args array.
d311d28c 7703 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
7704 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7705 result of ENCODE_CHAR.
d311d28c
PE
7706 * coding.h: Adjust decls to match defn changes elsewhere.
7707 (struct coding_system):
7708 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7709 * composite.c (get_composition_id, find_composition)
7710 (run_composition_function, update_compositions)
7711 (compose_text, composition_gstring_put_cache)
7712 (composition_gstring_p, composition_gstring_width)
7713 (fill_gstring_header, fill_gstring_body, autocmp_chars)
7714 (composition_compute_stop_pos, composition_reseat_it)
7715 (composition_update_it, struct position_record)
7716 (find_automatic_composition, composition_adjust_point)
7717 (Fcomposition_get_gstring, Ffind_composition_internal):
7718 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7719 (update_compositions):
7720 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7721 * composite.h: Adjust decls to match defn changes elsewhere.
7722 (struct composition):
7723 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7724 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7725 Do not attempt to compute the address of the object just before a
7726 buffer; this is not portable.
7727 (Faref, Faset):
7728 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7729 (Faset): Use int, not EMACS_INT, where int is wide enough.
7730 (Fstring_to_number): Don't assume fixnums fit in int.
7731 (Frem): Don't assume arg is nonnegative.
7732 * dbusbind.c (xd_append_arg): Check for integers out of range.
7733 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 7734 (extract_signed, extract_unsigned): New functions.
243e0530
PE
7735 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7736 (xd_get_connection_references): Return ptrdiff_t, not int.
7737 All uses changed.
7738 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7739 (xd_read_message_1):
7740 Use int, not unsigned, where the dbus API uses int.
7741 (Fdbus_message_internal): Don't overflow mtype.
7742 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
7743 * dired.c (directory_files_internal, file_name_completion, scmp)
7744 (file_name_completion_stat):
7745 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7746 (file_name_completion): Don't overflow matchcount.
7747 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7748 * dispextern.h: Adjust decls to match defn changes elsewhere.
7749 (struct text_pos, struct glyph, struct bidi_saved_info)
7750 (struct bidi_string_data, struct bidi_it, struct composition_it)
7751 (struct it):
7752 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7753 (struct display_pos, struct composition_it, struct it):
7754 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7755 * dispnew.c (increment_matrix_positions)
7756 (increment_row_positions, mode_line_string)
7757 (marginal_area_string):
7758 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 7759 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
7760 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7761 (duration_to_sec_usec): New function, to check for overflow better.
7762 (Fsleep_for, sit_for): Use it.
7763 * doc.c (get_doc_string, store_function_docstring):
7764 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7765 (get_doc_string, Fsnarf_documentation):
7766 Use int, not EMACS_INT, where int is wide enough.
7767 (get_doc_string):
7768 Use SAFE_ALLOCA, not alloca.
7769 Check for overflow when converting EMACS_INT to off_t.
7770 * doprnt.c (doprnt):
7771 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7772 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7773 Don't assume uid_t fits into fixnum.
7774 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7775 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7776 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7777 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7778 (general_insert_function)
7779 (Finsert_char, make_buffer_string, make_buffer_string_both)
7780 (update_buffer_properties, Fbuffer_substring)
7781 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7782 (Fsubst_char_in_region, check_translation)
7783 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7784 (transpose_markers, Ftranspose_regions):
7785 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7786 (clip_to_bounds): Move to lisp.h as an inline function).
7787 (Fconstrain_to_field): Don't assume integers are nonnegative.
7788 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7789 (Fsubst_char_in_region, Fsave_restriction):
7790 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7791 (Femacs_pid): Don't assume pid_t fits into fixnum.
7792 (lo_time): Use int, not EMACS_INT, when int suffices.
7793 (lisp_time_argument): Check for usec out of range.
7794 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
7795 (Fuser_login_name, Fuser_full_name): Signal an error
7796 if a uid argument is out of range, rather than relying on
7797 undefined behavior.
c8d5c857
PE
7798 (Fformat_time_string): Remove now-unnecessary check.
7799 lisp_time_argument checks for out-of-range usec now.
243e0530 7800 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
7801 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7802 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7803 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7804 (init_cmdargs, Fdump_emacs):
7805 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7806 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7807 the bottom (typically) 32 bits of the fixnum.
7808 * eval.c (specpdl_size, call_debugger):
7809 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7810 (when_entered_debugger, Fbacktrace_debug):
7811 Don't assume fixnum can fit in int.
7812 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7813 the object just before a buffer; this is not portable.
7814 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7815 (grow_specpdl, unbind_to):
7816 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7817 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7818 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 7819 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
7820 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7821 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7822 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7823 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7824 (a_write, e_write):
7825 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7826 (Fcopy_file, non_regular_nbytes, read_non_regular)
7827 (Finsert_file_contents):
7828 Use int, not EMACS_INT, where int is wide enough.
7829 (READ_BUF_SIZE): Verify that it fits in int.
7830 (Finsert_file_contents): Check that counts are in proper range,
7831 rather than assuming fixnums fit into ptrdiff_t etc.
7832 Don't assume fixnums fit into int.
125b3835 7833 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
7834 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7835 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
7836 (string_char_to_byte, string_byte_to_char)
7837 (string_make_multibyte, string_to_multibyte)
7838 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7839 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7840 (substring_both, Fdelete, internal_equal, Ffillarray)
7841 (Fclear_string, mapcar1)
7842 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7843 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7844 (larger_vector, make_hash_table, maybe_resize_hash_table)
7845 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7846 (Fmaphash, secure_hash):
7847 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7848 (concat): Check for string index and length overflow.
7849 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7850 (Frequire):
7851 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7852 (larger_vector): New API (vec, incr_min, size_max) replaces old
7853 one (vec, new_size, init). This catches size overflow.
7854 INIT was removed because it was always Qnil.
7855 All callers changed.
7856 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7857 the upper bound on a hash table index size.
7858 (make_hash_table, maybe_resize_hash_table): Use it.
7859 (secure_hash): Computer start_byte and end_byte only after
7860 they're known to be in ptrdiff_t range.
7861 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7862 (Ffont_get_glyphs, Ffont_at):
7863 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7864 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7865 (Flist_fonts, Fopen_font):
7866 Don't assume fixnum can fit in int.
7867 (check_gstring): Don't assume index can fit in int.
7868 (font_match_p): Check that fixnum is a character, not a nonnegative
7869 fixnum, since the later code needs to stuff it into an int.
7870 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7871 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7872 conversion overflow issues.
7873 (Fopen_font): Check for integer out of range.
7874 (Ffont_get_glyphs): Don't assume index can fit in int.
7875 * font.h: Adjust decls to match defn changes elsewhere.
7876 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7877 integer overflow.
7878 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7879 printmax_t, where ptrdiff_t is wide enough.
7880 (Finternal_char_font):
7881 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7882 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7883 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7884 (Fset_frame_position, x_set_frame_parameters)
7885 (x_set_line_spacing, x_set_border_width)
7886 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7887 Check that fixnums are in proper range for system types.
7888 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7889 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7890 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7891 Use SAFE_ALLOCA_LISP, not alloca.
7892 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7893 intptr_t is wide enough.
7894 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7895 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7896 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7897 Check for fixnum out of range.
7898 * ftfont.c (ftfont_list): Don't assume index fits in int.
7899 Check that fixnums are in proper range for system types.
7900 (ftfont_shape_by_flt):
7901 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
7902 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7903 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7904 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7905 Check that fixnums are in proper range for system types.
7906 * gnutls.h: Adjust decls to match defn changes elsewhere.
7907 * gtkutil.c (xg_dialog_run):
7908 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7909 (update_frame_tool_bar):
7910 Check that fixnums are in proper range for system types.
7911 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 7912 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
7913 * indent.c (last_known_column, last_known_column_point):
7914 (current_column_bol_cache):
7915 (skip_invisible, current_column, check_display_width):
7916 (check_display_width, scan_for_column, current_column_1)
7917 (Findent_to, Fcurrent_indentation, position_indentation)
7918 (indented_beyond_p, Fmove_to_column, compute_motion):
7919 (Fcompute_motion, Fvertical_motion):
7920 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7921 (last_known_column_modified): Use EMACS_INT, not int.
7922 (check_display_width):
7923 (Fcompute_motion):
7924 Check that fixnums and floats are in proper range for system types.
7925 (compute_motion): Don't assume index or fixnum fits in int.
7926 (compute_motion, Fcompute_motion):
7927 Use int, not EMACS_INT, when it is wide enough.
7928 (vmotion): Omit local var start_hpos that is always 0; that way
7929 we don't need to worry about overflow in expressions involving it.
7930 * indent.h: Adjust decls to match defn changes elsewhere.
7931 (struct position):
7932 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7933 Use int, not EMACS_INT, where int is wide enough.
7934 Remove unused members ovstring_chars_done and tab_offset;
7935 all uses removed.
7936 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7937 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7938 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7939 (make_gap, copy_text, insert, insert_and_inherit)
7940 (insert_before_markers, insert_before_markers_and_inherit)
7941 (insert_1, count_combining_before, count_combining_after)
7942 (insert_1_both, insert_from_string)
7943 (insert_from_string_before_markers, insert_from_string_1)
7944 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7945 (adjust_after_replace, adjust_after_insert, replace_range)
7946 (replace_range_2, del_range, del_range_1, del_range_byte)
7947 (del_range_both, del_range_2, modify_region)
7948 (prepare_to_modify_buffer, signal_before_change)
7949 (signal_after_change, Fcombine_after_change_execute):
7950 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7951 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7952 (balance_an_interval, split_interval_right, split_interval_left)
7953 (find_interval, next_interval, update_interval)
7954 (adjust_intervals_for_insertion, delete_node, delete_interval)
7955 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7956 (static_offset_intervals, offset_intervals)
7957 (merge_interval_right, merge_interval_left, make_new_interval)
7958 (graft_intervals_into_buffer, temp_set_point_both)
7959 (temp_set_point, set_point, adjust_for_invis_intang)
7960 (set_point_both, move_if_not_intangible, get_property_and_range)
7961 (get_local_map, copy_intervals, copy_intervals_to_string)
7962 (compare_string_intervals, set_intervals_multibyte_1):
7963 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7964 * intervals.h: Adjust decls to match defn changes elsewhere.
7965 (struct interval):
7966 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7967 * keyboard.c (this_command_key_count, this_single_command_key_start)
7968 (before_command_key_count, before_command_echo_length, echo_now)
7969 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7970 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7971 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7972 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7973 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7974 (last_non_minibuf_size, last_point_position, echo_truncate)
7975 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7976 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7977 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7978 (stuff_buffered_input):
7979 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7980 (last_auto_save, command_loop_1, read_char):
7981 Use EMACS_INT, not int, to avoid integer overflow.
7982 (record_char): Avoid overflow in total_keys computation.
7983 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7984 * keyboard.h: Adjust decls to match defn changes elsewhere.
7985 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7986 (Fkey_description, Fdescribe_vector, Flookup_key):
7987 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7988 (click_position): New function, to check that positions are in range.
7989 (Fcurrent_active_maps):
7990 (describe_command):
7991 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7992 (Faccessible_keymaps, Fkey_description):
7993 (preferred_sequence_p):
7994 Don't assume fixnum can fit into int.
7995 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7996 Check for integer overflow in size calculations.
7997 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7998 avoid mishandling large integers.
7999 * lisp.h: Adjust decls to match defn changes elsewhere.
8000 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8001 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8002 (struct Lisp_Marker):
8003 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8004 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
8005 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8006 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8007 All callers changed.
8008 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8009 Assume the arg has valid form, since it always does.
8010 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8011 unsigned integer system type.
8012 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8013 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8014 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8015 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8016 (duration_to_sec_usec): New decl.
8017 * lread.c (read_from_string_index, read_from_string_index_byte)
8018 (read_from_string_limit, readchar, unreadchar, openp)
8019 (read_internal_start, read1, oblookup):
8020 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8021 (Fload, readevalloop, Feval_buffer, Feval_region):
8022 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8023 (openp): Check for out-of-range argument to 'access'.
8024 (read1): Use int, not EMACS_INT, where int is wide enough.
8025 Don't assume fixnum fits into int.
6efdadfd 8026 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
8027 (read_filtered_event): Use duration_to_sec_usec
8028 to do proper overflow checking on durations.
d311d28c
PE
8029 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8030 in size calculation.
8031 (Fexecute_kbd_macro):
8032 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8033 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8034 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8035 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8036 (set_marker_both, set_marker_restricted_both, marker_position)
8037 (marker_byte_position, Fbuffer_has_markers_at):
8038 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8039 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 8040 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
8041 It now merely ensures that the menu is large enough, without
8042 necessarily growing it, as this avoids some integer overflow issues.
8043 All callers changed.
8044 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8045 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8046 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8047 Use SAFE_ALLOCA_LISP, not alloca.
8048 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8049 to EMACS_INT. Check that fixnums are in proper range for system types.
8050 * minibuf.c (minibuf_prompt_width, string_to_object)
8051 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8052 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8053 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8054 (get_minibuffer, read_minibuf_unwind):
8055 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8056 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8057 this simplifies overflow checking. All callers changed.
8058 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8059 (Ftest_completion):
8060 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8061 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8062 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8063 Check that fixnums are in proper range for system types.
8064 (Fx_create_frame, Fx_show_tip):
8065 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8066 * nsfont.m (ns_findfonts, nsfont_list_family):
8067 Don't assume fixnum fits in long.
8068 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8069 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8070 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8071 wide enough.
17fdb222 8072 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
8073 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8074 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8075 (PRINTDECLARE, PRINTPREPARE):
8076 (strout, print_string):
8077 (print, print_preprocess, print_check_string_charset_prop)
8078 (print_object):
8079 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8080 (PRINTDECLARE):
8081 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8082 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8083 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 8084 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 8085 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
8086 (print_error_message): Use SAFE_ALLOCA, not alloca.
8087 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
8088 (print_depth, new_backquote_output, print_number_index):
8089 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
8090 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8091 (Fset_process_window_size, Fformat_network_address)
8092 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 8093 (sigchld_handler):
d311d28c 8094 Check that fixnums are in proper range for system types.
d44287d4 8095 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
8096 Check for process-ids out of pid_t range rather than relying on
8097 undefined behavior.
e4d81efc 8098 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
8099 (Fformat_network_address, read_process_output, send_process)
8100 (Fprocess_send_region, status_notify):
8101 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8102 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8103 (wait_reading_process_output, read_process_output, exec_sentinel):
8104 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8105 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8106 (Faccept_process_output): Use duration_to_sec_usec to do proper
8107 overflow checking on durations.
dde14581
PE
8108 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8109 Don't assume pid_t fits in int.
02481186
PE
8110 * process.h (struct Lisp_Process): Members tick and update_tick
8111 are now of type EMACS_INT, not int.
b62b53e8
PE
8112 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8113 configured --with-wide-int.
d311d28c
PE
8114 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8115 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8116 * search.c (looking_at_1, string_match_1):
8117 (fast_string_match, fast_c_string_match_ignore_case)
8118 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8119 (scan_newline, find_before_next_newline, search_command)
8120 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8121 (set_search_regs, wordify):
8122 (Freplace_match):
8123 (Fmatch_data):
8124 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8125 (string_match_1, search_buffer, set_search_regs):
8126 (Fmatch_data):
8127 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8128 (wordify): Check for overflow in size calculation.
8129 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8130 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8131 Check that fixnums are in proper range for system types.
8132 * sound.c (struct sound_device)
8133 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8134 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8135 (Fplay_sound_internal):
8136 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 8137 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
8138 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8139 (Fparse_partial_sexp):
8140 Don't assume fixnums can fit in int.
8141 (struct lisp_parse_state, find_start_pos, find_start_value)
8142 (find_start_value_byte, find_start_begv)
8143 (update_syntax_table, char_quoted, dec_bytepos)
8144 (find_defun_start, prev_char_comend_first, back_comment):
8145 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8146 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8147 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8148 (Finternal_describe_syntax_value): Check that match_lisp is a
8149 character, not an integer, since the code stuffs it into int.
8150 (scan_words, scan_sexps_forward):
8151 Check that fixnums are in proper range for system types.
8152 (Fforward_word):
8153 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8154 (scan_sexps_forward):
8155 Use CHARACTERP, not INTEGERP, since the value must fit into int.
8156 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
8157 * syntax.h: Adjust decls to match defn changes elsewhere.
8158 (struct gl_state_s):
8159 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
8160 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
8161 MOST_POSITIVE_FIXNUM.
d311d28c
PE
8162 * sysdep.c (wait_for_termination_1, wait_for_termination)
8163 (interruptible_wait_for_termination, mkdir):
8164 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
8165 (emacs_read, emacs_write):
8166 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
8167 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
8168 and double all fit in int.
d311d28c
PE
8169 * term.c (set_tty_color_mode):
8170 Check that fixnums are in proper range for system types.
8171 * termhooks.h (struct input_event):
8172 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8173 * textprop.c (validate_interval_range, interval_of)
8174 (Fadd_text_properties, set_text_properties_1)
8175 (Fremove_text_properties, Fremove_list_of_text_properties)
8176 (Ftext_property_any, Ftext_property_not_all)
8177 (copy_text_properties, text_property_list, extend_property_ranges)
8178 (verify_interval_modification):
8179 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8180 (Fnext_single_char_property_change)
8181 (Fprevious_single_char_property_change):
8182 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
8183 (copy_text_properties):
8184 Check for integer overflow in index calculation.
d311d28c
PE
8185 * undo.c (last_boundary_position, record_point, record_insert)
8186 (record_delete, record_marker_adjustment, record_change)
8187 (record_property_change):
8188 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8189 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
8190 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8191 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8192 (Fx_hide_tip, Fx_file_dialog):
8193 * w32menu.c (set_frame_menubar):
8194 Use ptrdiff_t, not int, for consistency with rest of code.
8195 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
8196 (select_window, Fdelete_other_windows_internal)
8197 (window_scroll_pixel_based, window_scroll_line_based)
8198 (Frecenter, Fset_window_configuration):
8199 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8200 (Fset_window_hscroll, run_window_configuration_change_hook)
8201 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 8202 (Fscroll_other_window, Frecenter):
d311d28c
PE
8203 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8204 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
8205 Don't assume fixnum fits in int.
8206 (Fset_window_scroll_bars):
8207 Check that fixnums are in proper range for system types.
8208 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
8209 (string_pos, c_string_pos, number_of_chars, init_iterator)
8210 (in_ellipses_for_invisible_text_p, init_from_display_pos)
8211 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
8212 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
8213 (face_before_or_after_it_pos, handle_invisible_prop)
8214 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
8215 (display_prop_intangible_p, string_buffer_position_lim)
8216 (string_buffer_position, handle_composition_prop, load_overlay_strings)
8217 (get_overlay_strings_1, get_overlay_strings)
8218 (iterate_out_of_display_property, forward_to_next_line_start)
8219 (back_to_previous_visible_line_start, reseat, reseat_to_string)
8220 (get_next_display_element, set_iterator_to_next)
8221 (get_visually_first_element, compute_stop_pos_backwards)
8222 (handle_stop_backwards, next_element_from_buffer)
8223 (move_it_in_display_line_to, move_it_in_display_line)
8224 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8225 (add_to_log, message_dolog, message_log_check_duplicate)
8226 (message2, message2_nolog, message3, message3_nolog
8227 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
8228 (current_message_1, truncate_echo_area, truncate_message_1)
8229 (set_message, set_message_1, store_mode_line_noprop)
8230 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
8231 (text_outside_line_unchanged_p, check_point_in_composition)
8232 (reconsider_clip_changes)
8233 (redisplay_internal, set_cursor_from_row, try_scrolling)
8234 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
8235 (redisplay_window, find_last_unchanged_at_beg_row)
8236 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
8237 (trailing_whitespace_p, find_row_edges, display_line)
8238 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
8239 (display_mode_element, store_mode_line_string)
8240 (pint2str, pint2hrstr, decode_mode_spec)
8241 (display_count_lines, display_string, draw_glyphs)
8242 (x_produce_glyphs, x_insert_glyphs)
8243 (rows_from_pos_range, mouse_face_from_buffer_pos)
8244 (fast_find_string_pos, mouse_face_from_string_pos)
8245 (note_mode_line_or_margin_highlight, note_mouse_highlight):
8246 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8247 (safe_call, init_from_display_pos, handle_fontified_prop)
8248 (handle_single_display_spec, load_overlay_strings)
8249 (with_echo_area_buffer, setup_echo_area_for_printing)
8250 (display_echo_area, echo_area_display)
8251 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
8252 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
8253 (redisplay_window, dump_glyph_row, display_mode_line)
8254 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 8255 (handle_display_spec, display_prop_string_p):
d311d28c
PE
8256 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8257 (handle_single_display_spec, build_desired_tool_bar_string)
8258 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
8259 (get_specified_cursor_type):
8260 Check that fixnums are in proper range for system types.
8261 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
8262 (Flookup_image_map):
8263 Don't assume fixnums fit in int.
8264 (compare_overlay_entries):
8265 Avoid mishandling comparisons due to subtraction overflow.
8266 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
8267 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
8268 (handle_tool_bar_click):
8269 Use int, not unsigned, since we prefer signed and the signedness
8270 doesn't matter here.
8271 (get_next_display_element, next_element_from_display_vector):
8272 Use int, not EMACS_INT, when int is wide enough.
8273 (start_hourglass): Use duration_to_sec_usec to do proper
8274 overflow checking on durations.
8275 * xfaces.c (Fbitmap_spec_p):
8276 Check that fixnums are in proper range for system types.
8277 (compare_fonts_by_sort_order):
8278 Avoid mishandling comparisons due to subtraction overflow.
8279 (Fx_family_fonts, realize_basic_faces):
8280 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8281 (Fx_family_fonts):
8282 Don't assume fixnum fits in int.
8283 Use SAFE_ALLOCA_LISP, not alloca.
8284 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
8285 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
8286 (face_at_buffer_position, face_for_overlay_string)
8287 (face_at_string_position):
8288 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8289 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
8290 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
8291 (Fx_show_tip):
8292 Check that fixnums are in proper range for system types.
8293 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8294 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
8295 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8296 (Fx_change_window_property): Don't assume fixnums fit in int.
8297 * xfont.c (xfont_chars_supported):
8298 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8299 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
8300 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
8301 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8302 * xml.c (parse_region):
8303 * xrdb.c (magic_file_p):
8304 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8305 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
8306 (x_get_local_selection, x_reply_selection_request)
8307 (x_handle_selection_request, wait_for_property_change):
8308 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8309 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
8310 short is wide enough.
8311 (x_send_client_event): Don't assume fixnum fits in int.
8312 * xterm.c (x_x_to_emacs_modifiers):
8313 Don't assume EMACS_INT overflows nicely into int.
8314 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
8315 may come from Lisp.
8316 (handle_one_xevent): NATNUMP can eval its arg twice.
8317 (x_connection_closed):
8318 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8319 * xterm.h: Adjust decls to match defn changes elsewhere.
8320 (struct scroll_bar): Use struct vectorlike_header
8321 rather than rolling our own approximation.
8322 (SCROLL_BAR_VEC_SIZE): Remove; not used.
8323
c6574eb5
GM
83242012-05-25 Glenn Morris <rgm@gnu.org>
8325
8326 * lisp.mk (lisp): Update for more files being compiled now.
8327
e8d32c7e
SM
83282012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
8329
48def666
SM
8330 * lread.c: Remove `read_pure' which makes no difference.
8331 (read_pure): Remove var.
8332 (unreadpure): Remove function.
8333 (readevalloop): Don't call read_list with -1 flag.
8334 (read1, read_vector): Don't test read_pure any more.
8335 (read_list): Simplify.
8336
e8d32c7e
SM
8337 * fileio.c, character.h: Minor style tweaks.
8338
4b2addb7
DA
83392012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
8340
8341 * window.h (clip_changed): Remove useless declaration.
8342
584461b2
JB
83432012-05-22 Juanma Barranquero <lekktu@gmail.com>
8344
8345 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
8346 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
8347
34374650
PE
83482012-05-22 Paul Eggert <eggert@cs.ucla.edu>
8349
8350 Remove src/m/*.
8351 This directory predates autoconf and is no longer needed nowadays.
8352 Move its few remaining bits of functionality to where they're needed.
8353 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8354 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8355 * m/template.h: Remove.
8356 * Makefile.in (M_FILE): Remove. All uses removed.
8357 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
8358 * lisp.h (USE_LSB_TAG):
8359 * mem-limits.h (EXCEEDS_LISP_PTR):
8360 Use VAL_MAX, not VALBITS, in #if.
8361 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
8362 (EMACS_UINT): Define unconditionally now.
8363 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
8364 (BITS_PER_EMACS_INT): New constants, replacing
8365 what used to be in config.h, but not useful in #if.
8366 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
8367 define them any more.
8368 (VAL_MAX): New macro.
8369 (VALMASK): Use it.
8370 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
8371 BITS_PER_EMACS_INT, in #if.
8372 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8373 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
8374 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8375 * s/ms-w32.h (DATA_START):
8376 Move here from removed file m/intel386.h.
8377 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8378 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8379
261cb4bb
PE
83802012-05-21 Paul Eggert <eggert@cs.ucla.edu>
8381
8382 Assume C89 or later.
8383 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8384 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8385 (xrealloc):
8386 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8387 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8388 * textprop.c, tparam.c (NULL): Remove.
8389 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8390 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8391 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
8392 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8393 * xterm.c (input_signal_count): Assume volatile works.
8394
ff23cd9f
KB
83952012-05-21 Ken Brown <kbrown@cornell.edu>
8396
8397 * xgselect.c (xg_select): Fix first argument in call to 'select'
8398 (bug#11508).
8399
1b170bc6
KB
84002012-05-20 Ken Brown <kbrown@cornell.edu>
8401
8402 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 8403 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 8404
b2f4d39f
KB
84052012-05-19 Ken Brown <kbrown@cornell.edu>
8406
8407 * xfns.c (x_in_use): Remove `static' qualifier.
8408 * xterm.h (x_in_use): Declare.
8409 * xgselect.c: Include xterm.h.
8410 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8411 and `display_arg' (bug#9754).
8412
003fdae2
PE
84132012-05-19 Paul Eggert <eggert@cs.ucla.edu>
8414
9232a6d9
PE
8415 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
8416
003fdae2
PE
8417 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
8418 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8419
784b56e2
EZ
84202012-05-18 Eli Zaretskii <eliz@gnu.org>
8421
8422 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8423
8424 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 8425 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
8426
8427 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8428 reference to image_cache->refcount.
8429 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8430
a0a79cde
JL
84312012-05-17 Juri Linkov <juri@jurta.org>
8432
8433 * search.c (Fword_search_regexp, Fword_search_backward)
8434 (Fword_search_forward, Fword_search_backward_lax)
8435 (Fword_search_forward_lax): Move functions to isearch.el
8436 (bug#10145, bug#11381).
8437
b0572523
PE
84382012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8439
8440 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8441
9660f5fc
SM
84422012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8443
8444 * lread.c (init_obarray): Declare Qt and Qnil as special.
8445
4374de83
GM
84462012-05-14 Glenn Morris <rgm@gnu.org>
8447
8448 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 8449 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 8450
dc44c39a
PE
84512012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8452
078c97cb
PE
8453 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8454
dc44c39a
PE
8455 * unexaix.c: Port to more-recent AIX compilers.
8456 (report_error, report_error_1, make_hdr, copy_sym)
8457 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8458 Make arguments const char *, not char *, to avoid violations of C
8459 standard and to fix some AIX warnings reported by Gilles Pion.
8460
e18afed7 84612012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
8462
8463 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8464 already have overlays loaded.
8465 (handle_single_display_spec): Before returning without displaying
8466 fringe bitmap, synchronize the bidi iterator with the main display
8467 iterator, by calling iterate_out_of_display_property.
8468 (iterate_out_of_display_property): Detect buffer iteration by
8469 testing that it->string is a Lisp string.
8470 (get_next_display_element): When the current object is exhausted,
8471 and there's something on it->stack, call set_iterator_to_next to
8472 proceed with what's on the stack, instead of returning zero.
8473 (set_iterator_to_next): If called at the end of a Lisp string,
8474 proceed to consider_string_end without incrementing string
8475 position. Don't increment display vector index past the end of
8476 the display vector. (Bug#11417)
c8fb9dc6
EZ
8477 (pos_visible_p): Don't report a position visible when move_it_to
8478 stopped at the last line of window, which happens to be scanned
8479 backwards by the bidi iteration. (Bug#11464)
ac268e67 8480
e18afed7 84812012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
8482
8483 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8484 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
8485 are on a TTY, and thus unable to display on the fringes.
8486 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
8487 so we need to signal to the caller that this is a "replacing"
8488 display spec. This fixes display when the spec is invalid or we
8489 are on a TTY.
8490
e18afed7 84912012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
8492
8493 * unexaix.c (make_hdr): Fix typo in prototype.
8494 This bug broke the build on AIX. Problem reported by Gilles Pion.
8495
9d0a235a
MA
84962012-05-14 Michael Albinus <michael.albinus@gmx.de>
8497
8498 * keyboard.c (kbd_buffer_get_event): Read special events also in
8499 batch mode. (Bug#11415)
8500
9e6b06ed
GM
85012012-05-12 Glenn Morris <rgm@gnu.org>
8502
8503 * ns.mk: Update for ns_appbindir no longer having trailing "/".
8504
c1a1d7a3
EZ
85052012-05-12 Eli Zaretskii <eliz@gnu.org>
8506
8507 * lisp.mk (lisp): Add newcomment.elc.
8508
3fe7cdc8
GM
85092012-05-12 Glenn Morris <rgm@gnu.org>
8510
8511 * Makefile.in (MKDIR_P): New, set by configure.
8512 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
8513
53f7d2c0
PE
85142012-05-11 Paul Eggert <eggert@cs.ucla.edu>
8515
8516 Remove unused function hourglass_started.
8517 * dispextern.h (hourglass_started):
8518 * w32fns.c (hourglass_started):
8519 * xdisp.c (hourglass_started): Remove.
8520
75aafb17
JB
85212012-05-10 Juanma Barranquero <lekktu@gmail.com>
8522
8523 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
8524 Update dependencies.
8525
12959e8e
PE
85262012-05-10 Paul Eggert <eggert@cs.ucla.edu>
8527
97107e2e
PE
8528 * xgselect.c (xg_select): Put maxfds+1 into a var.
8529 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
8530
12959e8e
PE
8531 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
8532
836d29b3
DA
85332012-05-10 Dave Abrahams <dave@boostpro.com>
8534
8535 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
8536 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
8537
5cb67954
MA
85382012-05-09 Michael Albinus <michael.albinus@gmx.de>
8539
8540 * dbusbind.c (xd_registered_buses): New internal Lisp object.
8541 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
8542 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
8543 Initialize xd_registered_buses.
8544
3478ec45
PE
85452012-05-09 Paul Eggert <eggert@cs.ucla.edu>
8546
b263a6b0
PE
8547 Untag more efficiently if USE_LSB_TAG.
8548 This is based on a proposal by YAMAMOTO Mitsuharu in
8549 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
8550 For an admittedly artificial (nth 8000 longlist) benchmark on
8551 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
8552 Emacs's overall text size by 1%.
8553 * lisp.h (XUNTAG): New macro.
8554 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
8555 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
8556 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8557 * eval.c (Fautoload):
8558 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8559 * frame.h (XFRAME): Use XUNTAG.
8560
3478ec45
PE
8561 Port recent dbusbind.c changes to 32-bit --with-wide-int.
8562 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8563 Remove unportable assumptions about print widths of types like
8564 dbus_uint32_t.
8565 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8566 intptr_t when converting between pointer and integer, to avoid GCC
8567 warnings about wrong width.
8568
666b903b 85692012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
8570
8571 * w32proc.c (new_child): Force Windows to reserve only 64KB of
8572 stack for each reader_thread, instead of defaulting to 8MB
8573 determined by the linker. This avoids failures in creating
8574 subprocesses on Windows 7, see the discussion in this thread:
8575 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8576
b120cc17
JC
85772012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
8578
8579 Fix up display of the *Minibuf-0* buffer in the mini window.
8580 * keyboard.c (read_char): Don't clear the echo area if there's no
8581 message to clear.
8582 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 8583 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 8584
9a4b36f8
MA
85852012-05-07 Michael Albinus <michael.albinus@gmx.de>
8586
8587 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8588 batch mode.
8589
e5f9458f
CY
85902012-05-06 Chong Yidong <cyd@gnu.org>
8591
8592 * lisp.mk (lisp): Update.
8593
eceeb5fc 85942012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
8595
8596 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8597
71873e2b
SM
85982012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
8599
8600 * data.c (PUT_ERROR): New macro.
8601 (syms_of_data): Use it. Add new error type `user-error'.
8602 * undo.c (user_error): New function.
8603 (Fprimitive_undo): Use it.
8604 * print.c (print_error_message): Adjust print style for `user-error'.
8605 * keyboard.c (user_error): New function.
8606 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8607
ab0fa4e4
PE
86082012-05-03 Paul Eggert <eggert@cs.ucla.edu>
8609
8610 Do not limit current-time-string to years 1000..9999.
8611 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8612 (Fcurrent_time_string): Support any year that is supported by the
8613 underlying localtime representation. Don't use asctime, as it
8614 has undefined behavior for years outside the range -999..9999.
8615
7ed806a7
PE
86162012-05-02 Paul Eggert <eggert@cs.ucla.edu>
8617
8618 Fix race conditions involving setenv, gmtime, localtime, asctime.
8619 Without this fix, interrupts could mess up code that uses these
8620 nonreentrant functions, since setting TZ invalidates existing
8621 tm_zone or tzname values, and since most of these functions return
8622 pointers to static storage.
8623 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8624 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8625 Grow the critical sections to include not just invoking
8626 localtime/gmtime, but also accessing these functions' results
8627 including their tm_zone values if any, and any related TZ setting.
8628 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
8629 so that the struct tm is saved in the critical section.
8630 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
8631 motivated by the fact that memory allocation needs to be outside
8632 the critical section.
8633
0c16dfed
DA
86342012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
8635
8636 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8637 with RESET_INTERVAL.
8638
8639 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8640 Remove duplicated buffer name initialization.
8641
3f83ace8
JM
86422012-05-02 Jim Meyering <jim@meyering.net>
8643
8644 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8645
c7b8541e
JM
8646 * xfns.c (x_window): Use xstrdup (Bug#11375).
8647
90207a15 86482012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
8649
8650 * xdisp.c (pos_visible_p): If already at a newline from the
8651 display string before the 'while' loop, don't walk back the glyphs
8652 from it3.glyph_row. Solves assertion violation when the display
8653 string begins with a newline (egg.el). (Bug#11367)
8654
b593d6a9
AH
86552012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
8656
8657 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
8658 Move to simple.el.
8659
4737362e
GM
86602012-05-01 Glenn Morris <rgm@gnu.org>
8661
99cf43f9
GM
8662 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
8663 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
8664 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
8665 All were removed before 23.1.
8666
9311dcff
GM
8667 * dispnew.c: Remove HAVE_LIBNCURSES test;
8668 it is always true on relevant platforms.
8669
4d5c6349
GM
8670 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
8671 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
8672
4737362e
GM
8673 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
8674
74dd3a6b
AS
86752012-04-30 Andreas Schwab <schwab@linux-m68k.org>
8676
8677 * .gdbinit (xpr): Remove checks for no longer existing misc types.
8678 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8679 Remove.
8680
13c379ee
PE
86812012-04-28 Paul Eggert <eggert@cs.ucla.edu>
8682
8683 Do not avoid creating empty evaporating overlays (Bug#9642).
8684 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8685 That is, do not delete an evaporating overlay if it becomes
8686 empty after its bounds are adjusted to fit within its buffer.
8687 This fix caused other problems, and I'm reverting it until we get
8688 to the bottom of them.
8689
a8e7d6d7 86902012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
8691
8692 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8693
a8e7d6d7 86942012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
8695
8696 * xdisp.c (pos_visible_p): If the window start position is beyond
8697 ZV, start the display from buffer beginning. Prevents assertion
8698 violation in init_iterator when the minibuffer window is scrolled
8699 via the scroll bar.
8700
8701 * window.c (window_scroll_pixel_based): Likewise.
8702
a8e7d6d7 87032012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
8704
8705 * keymap.c (where_is_internal): Doc fix (Bug#10872).
8706
a8e7d6d7 87072012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
8708
8709 * fileio.c (Fcopy_file, Fset_file_selinux_context):
8710 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
8711
a8e7d6d7 87122012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 8713
b593d6a9
AH
8714 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8715 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 8716
1c6900d9
EZ
87172012-04-26 Eli Zaretskii <eliz@gnu.org>
8718
4c3fa1d9
EZ
8719 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8720 display element, check also the underlying string or buffer
8721 character. (Bug#11341)
8722
1c6900d9
EZ
8723 * w32menu.c: Include w32heap.h.
8724 (add_menu_item): If the call to AppendMenuW (via
8725 unicode_append_menu) fails, disable Unicode menus only if we are
8726 running on Windows 9X/Me.
8727
42bf8205
AS
87282012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8729
8730 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8731 (xgetint): Add missing shift for LSB tags.
8732
b1bac16e
MR
87332012-04-24 Martin Rudalics <rudalics@gmx.at>
8734
8735 * keyboard.c (read_char): Don't wipe echo area for select window
8736 events: These might get delayed via `mouse-autoselect-window'
8737 (Bug#11304).
8738
d69621cc
JB
87392012-04-24 Juanma Barranquero <lekktu@gmail.com>
8740
8741 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8742 manipulation of :loaded-from data.
8743
02fd101b
JB
87442012-04-23 Juanma Barranquero <lekktu@gmail.com>
8745
8746 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8747 now a cons (bug#11311).
8748
888bec30
PE
87492012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8750
89a438bd
PE
8751 Do not create empty overlays with the evaporate property (Bug#9642).
8752 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8753 if it becomes empty after its bounds are adjusted to fit within
8754 its buffer. Without this fix, in a nonempty buffer (let ((o
8755 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8756 yields an empty overlay that has the evaporate property, which is
8757 not supposed to happen.
8758
1068fe4d
PE
8759 Fix minor GTK3 problems found by static checking.
8760 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8761 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8762 (struct _EmacsFixedClass, emacs_fixed_get_type):
8763 Move decls here from emacsgtkfixed.h, since they needn't be public.
8764 (emacs_fixed_get_type): Now static.
8765 (emacs_fixed_class_init): Omit unused local.
8766 (emacs_fixed_child_type): Remove; unused.
8767 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8768 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8769 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8770 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8771 (EMACS_FIXED_GET_CLASS): Remove; unused.
8772 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8773
888bec30
PE
8774 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8775 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8776
de85e130
PE
87772012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8778
d0baac98 8779 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 8780 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
8781 (__malloc_size_t, __malloc_ptrdiff_t):
8782 Remove. All uses removed, replaced by the definiens if needed,
8783 since we can assume C89 or better now.
8784 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8785 (protect_malloc_state, align, get_contiguous_space)
8786 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8787 (malloc_atfork_handler_child, malloc_enable_thread)
8788 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8789 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8790 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8791 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8792 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8793 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8794 Define using prototypes, not old style.
8795 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8796 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8797 (align): Don't assume that signed integer overflow wraps around.
8798 Omit unused local var.
8799 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8800 (_free_internal_nolock, memalign, mallochook, reallochook):
8801 Omit no-longer-needed casts.
8802 (valloc): Use getpagesize, not __getpagesize.
8803 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8804 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8805
de85e130
PE
8806 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8807
dcbf5805
MA
88082012-04-22 Michael Albinus <michael.albinus@gmx.de>
8809
8810 Move functions from C to Lisp. Make non-blocking method calls
8811 the default. Implement further D-Bus standard interfaces.
8812
8813 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8814 (QCdbus_request_name_allow_replacement)
8815 (QCdbus_request_name_replace_existing)
8816 (QCdbus_request_name_do_not_queue)
8817 (QCdbus_request_name_reply_primary_owner)
8818 (QCdbus_request_name_reply_in_queue)
8819 (QCdbus_request_name_reply_exists)
8820 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8821 (QCdbus_registered_serial, QCdbus_registered_method)
8822 (QCdbus_registered_signal): New Lisp objects.
8823 (XD_DEBUG_MESSAGE): Use sizeof.
8824 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8825 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8826 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8827 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8828 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8829 (xd_signature, xd_append_arg): Allow float for integer types.
8830 (xd_get_connection_references): New function.
b593d6a9
AH
8831 (xd_get_connection_address): Rename from xd_initialize.
8832 Return cached address.
dcbf5805
MA
8833 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8834 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8835 level.
8836 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 8837 Return number of refcounts.
dcbf5805
MA
8838 (Fdbus_get_unique_name): Make stronger parameter check.
8839 (Fdbus_message_internal): New defun.
8840 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8841 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8842 (Fdbus_send_signal, Fdbus_register_service)
8843 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8844 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8845 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8846 (Vdbus_compiled_version, Vdbus_runtime_version)
8847 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8848 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8849 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
8850 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8851 Adapt docstring.
dcbf5805 8852
52828e02
PE
88532012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8854
da05bc4c
PE
8855 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8856 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8857 Do not assume ptrdiff_t is the same width as 'int'.
8858
52828e02
PE
8859 * alloc.c: Handle unusual debugging option combinations.
8860 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8861 since the two debugging options are incompatible.
8862 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8863 is defined.
8864 (mem_init, mem_insert, mem_insert_fixup):
8865 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8866 (NEED_MEM_INSERT): Remove; no longer needed.
8867
f01769f9
LL
88682012-04-22 Leo Liu <sdl.web@gmail.com>
8869
8870 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8871
5790543d
PE
88722012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8873
8874 * sysdep.c [__FreeBSD__]: Minor cleanups.
8875 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8876 Use Emacs indenting style more consistently. Avoid some casts.
8877 Use 'double' consistently rather than mixing 'float' and 'double'.
8878
b91b7e4d
EW
88792012-04-21 Eduard Wiebe <usenet@pusto.de>
8880
b593d6a9
AH
8881 * sysdep.c (list_system_processes, system_process_attributes):
8882 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 8883
6114eb15
AS
88842012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8885
8886 * lisp.mk (lisp): Update.
8887
2f38dff7
PE
88882012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8889
8890 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8891 It is never used otherwise.
8892
4ae29f89
SM
88932012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8894
8895 * print.c (print_preprocess): Only check print_depth if print-circle
8896 is nil.
8897 (print_object): Check for cycles even when print-circle is nil and
8898 print-gensym is t, but only check print_depth if print-circle is nil.
8899
f30d612a
CY
89002012-04-20 Chong Yidong <cyd@gnu.org>
8901
8902 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8903 set the status to "failed" and ensure that sentinel is run.
8904
c07a4c0b 89052012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
8906
8907 * process.c (Fset_process_inherit_coding_system_flag)
8908 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 8909 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 8910
c07a4c0b 89112012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
8912
8913 * xdisp.c (string_buffer_position_lim): Limit starting position to
8914 BEGV.
8915 (set_cursor_from_row): If called for a mode-line or header-line
8916 row, return zero immediately.
8917 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
8918 farther than the first row after the header line, if any.
8919 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
8920 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8921
c07a4c0b 89222012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8923
4ae29f89
SM
8924 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8925 (bug#11238).
ad3a2b41 8926
c07a4c0b 89272012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 89282012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
8929
8930 configure: new option --enable-gcc-warnings (Bug#11207)
8931 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8932 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8933 (ALL_CFLAGS): Use new macros rather than old.
8934 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8935 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8936 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8937 -Wunused-result, -Wunused-variable. This should go away once
8938 the Emacs and Gnulib regex code is merged.
8939 (xmalloc, xrealloc): Now static.
8940
aba027e8
PE
89412012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8942
8943 * dired.c (Fsystem_groups): Remove unused local.
8944
e5a36063
GM
89452012-04-17 Glenn Morris <rgm@gnu.org>
8946
8947 * dired.c (Fsystem_users): Doc fix.
8948
316411f0
DA
89492012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8950
8951 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8952 (syms_of_dired): Add them.
8953
9426aba4
PE
89542012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8955
b62a57be
PE
8956 Fix minor alloc.c problems found by static checking.
8957 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8958 New extern decls, to avoid calling undeclared functions.
8959 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8960 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8961 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8962 (NEED_MEM_INSERT): New macro.
8963 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 8964 Remove one incorrect comment and fix another.
b62a57be 8965
3539f31f
PE
8966 Fix minor ralloc.c problems found by static checking.
8967 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8968 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8969 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8970 (r_alloc_sbrk): Now static.
8971
a041960a
PE
8972 Improve ralloc.c interface checking.
8973 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8974 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8975 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8976 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8977 [REL_ALLOC]: ... to here, to check interface.
8978 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8979 Remove decls. This fixes an "It stinks!".
8980
9426aba4
PE
8981 * alloc.c (which_symbols): Fix alignment issue / type clash.
8982
d55c12ed
AS
89832012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8984
8985 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8986 (struct Lisp_Misc_Any): Likewise.
8987 (struct Lisp_Free): Likewise.
8988 * alloc.c (union aligned_Lisp_Symbol): Define.
8989 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8990 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8991 (union aligned_Lisp_Misc): Define.
8992 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8993 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 8994 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 8995
b948ce8b
PE
89962012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8997
8998 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8999 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9000 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9001 * s/netbsd.h, s/sol2-6.h:
9002 Remove definition of GC_MARK_STACK, since the default now works.
9003 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9004 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9005 no longer the default.
9006 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9007
35dc09a1 90082012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 9009
35dc09a1
GM
9010 * lread.c (lisp_file_lexically_bound_p):
9011 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 9012
35dc09a1
GM
90132012-04-14 Eli Zaretskii <eliz@gnu.org>
9014
9015 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9016 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9017
90182012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9019
9020 * nsterm.m (constrainFrameRect): Always constrain when there is only
9021 one screen (Bug#10962).
9022
bcd86815
KB
90232012-04-13 Ken Brown <kbrown@cornell.edu>
9024
9025 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9026
c25df26e
RT
90272012-04-13 Reuben Thomas <rrt@sc3d.org>
9028
9029 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9030
0fc59f1e
DC
90312012-04-11 Daniel Colascione <dancol@dancol.org>
9032
9033 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9034 against is gone. It's better to use vfork now so that when Cygwin
9035 gains a new, working vfork, we use it automatically (bug#10398).
9036
de8c03dc
SM
90372012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9038
9039 * window.c (save_window_save): Obey window-point-insertion-type.
9040
2f097256
GM
90412012-04-11 Glenn Morris <rgm@gnu.org>
9042
9043 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9044
453b951e
SM
90452012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9046
9047 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9048
75f1671a 90492012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
9050
9051 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9052 (force_quit_count): New var.
9053 (handle_interrupt): Use it.
9054
2a8ce227
JB
90552012-04-10 Juanma Barranquero <lekktu@gmail.com>
9056
9057 * w32.c (w32_delayed_load): Record the full path of the library
9058 being loaded (bug#10424).
9059
935396c0
GM
90602012-04-09 Glenn Morris <rgm@gnu.org>
9061
05920a43
GM
9062 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9063 not just in the obarray, before snarfing them. (Bug#11036)
9064
935396c0
GM
9065 * Makefile.in ($(leimdir)/leim-list.el):
9066 Pass EMACS rather than BUILT_EMACS.
9067
a18ecafa
TZ
90682012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9069
9070 * process.c (make_process):
9071 * process.h: Add integer `gnutls_handshakes_tried' member to
9072 process struct.
9073
6bbef4e5
JC
9074 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9075 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
9076
9077 * gnutls.c (gnutls_log_function2i): Convenience log function.
9078 (emacs_gnutls_read): Use new log functions,
9079 `gnutls_handshakes_tried' process member, and
9080 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9081 attempts per process (connection).
9082
b4d3bc10
CY
90832012-04-09 Chong Yidong <cyd@gnu.org>
9084
9085 * eval.c (Fuser_variable_p, user_variable_p_eh)
9086 (lisp_indirect_variable): Functions deleted.
9087 (Fdefvar): Caller changed.
9088
9089 * callint.c (Finteractive, Fcall_interactively):
9090 * minibuf.c (Fread_variable): Callers changed.
9091
70f4d973
EZ
90922012-04-09 Eli Zaretskii <eliz@gnu.org>
9093
9094 * xdisp.c (set_cursor_from_row): If the display string appears in
9095 the buffer at position that is closer to point than the position
9096 after the display string, display the cursor on the first glyph of
9097 the display string. Fixes cursor display when a 'display' text
9098 property immediately follows invisible text. (Bug#11094)
9099
cb3c2e3e
PE
91002012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9101
9102 composite.c: use 'double' consistently
9103 * composite.c (get_composition_id): Use 'double' consistently
9104 instead of converting 'float' to 'double' and vice versa; this is
9105 easier to understand and avoids a GCC warning.
9106
fd06db5d
GM
91072012-04-09 Glenn Morris <rgm@gnu.org>
9108
50fe702a
GM
9109 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9110 preparation for dumping it with emacs. (Bug#4789)
9111 (leimdir): New variable.
9112 ($(leimdir)/leim-list.el): New rule.
9113 (emacs$(EXEEXT)): Depend on leim-list.el.
9114
fd06db5d
GM
9115 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9116 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9117 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9118
55c131ee
AS
91192012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9120
9121 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9122 proper alignment.
9123
9209588f
JB
91242012-04-07 Juanma Barranquero <lekktu@gmail.com>
9125
9126 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9127 Remove unused local variable.
9128
e3fb2efb
PE
91292012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9130
9131 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9132 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9133 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9134 objects, as mark_maybe_pointer will catch them otherwise.
9135 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9136 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9137
b5385551
PE
91382012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9139
9140 Fix typo that broke non-Windows builds.
9141 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9142
9078ead6
EZ
91432012-04-07 Eli Zaretskii <eliz@gnu.org>
9144
9145 Support building on MS-Windows with libxml2.
9146
9147 * makefile.w32-in (OBJ2): Add xml.$(O).
9148 (GLOBAL_SOURCES): Add xml.c.
9149 ($(BLD)/xml.$(O)): New dependency list.
9150
9151 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
9152 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
9153 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
9154 [!WINDOWSNT]: New macros.
9155 (init_libxml2_functions, libxml2_loaded_p): New functions.
9156 (parse_region): Call fn_xmlCheckVersion instead of using the macro
9157 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
9158 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
9159 Calls xmlCleanupParser only if libxml2 was loaded (or statically
9160 linked in).
6bbef4e5
JC
9161 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
9162 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
9163 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
9164
9165 * emacs.c: Don't include libxml/parser.h.
9166 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
9167 xmlCleanupParser directly.
9168
9169 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
9170
3811fdf3
EZ
91712012-04-07 Eli Zaretskii <eliz@gnu.org>
9172
9173 * indent.c (Fvertical_motion): If there is a display string at
9174 point, use it.vpos to compute how many lines to backtrack after
9175 move_it_to point. (Bug#11133)
9176
2f8e16b2
EZ
91772012-04-06 Eli Zaretskii <eliz@gnu.org>
9178
9179 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
9180 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
9181 about subtle differences between FETCH_CHAR* and STRING_CHAR*
9182 macros related to unification of CJK characters. For the details,
9183 see the discussion following the message here:
9184 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
9185
3d439cd1
CY
91862012-04-04 Chong Yidong <cyd@gnu.org>
9187
9188 * keyboard.c (Vdelayed_warnings_list): Doc fix.
9189
8bc53d00
EZ
91902012-04-01 Eli Zaretskii <eliz@gnu.org>
9191
9192 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
9193 instead of alloca. (Bug#11138)
9194
3b0512a3
AS
91952012-04-01 Andreas Schwab <schwab@linux-m68k.org>
9196
9197 * w32menu.c (is_simple_dialog): Properly check lisp types.
9198 (Bug#11141)
9199
8427ddd2
EZ
92002012-03-31 Eli Zaretskii <eliz@gnu.org>
9201
979022ef
EZ
9202 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
9203 position we get to after a call to move_it_to fails the
9204 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
9205 only if we wind up in a string from display property. (Bug#11063)
9206
a6b1c7cc
EZ
9207 * window.c (Fdelete_other_windows_internal): Invalidate the row
9208 and column information about mouse highlight, so that redisplay
9209 restores it after reallocating the glyph matrices. (Bug#7464)
9210
8427ddd2
EZ
9211 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
9212 string comes from a `display' text property, use the buffer
9213 position of that property as if we actually saw that position in
9214 the row's glyphs.
697ba24b
EZ
9215 (move_it_by_lines): Remove the assertion that
9216 "it->current_x == 0 && it->hpos == 0" which can be legitimately
9217 violated when there's a before-string at the beginning of a line.
9218 (Bug#11063)
8427ddd2 9219
65a0a738
EZ
92202012-03-30 Eli Zaretskii <eliz@gnu.org>
9221
9222 * xdisp.c (append_space_for_newline): If the default face was
9223 remapped, use the remapped face for the appended newline.
9224 (extend_face_to_end_of_line): Use the remapped default face for
9225 extending the face to the end of the line.
9226 (display_line): Call extend_face_to_end_of_line when the default
9227 face was remapped. (Bug#11068)
9228
581355cc
EZ
92292012-03-29 Eli Zaretskii <eliz@gnu.org>
9230
9231 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
9232
e8fc049f
SM
92332012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9234
9235 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
9236
4fb9a543
GM
92372012-03-27 Glenn Morris <rgm@gnu.org>
9238
9239 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
9240 Doc fixes.
9241
679910f1
KH
92422012-03-26 Kenichi Handa <handa@m17n.org>
9243
9244 * dispextern.h (struct glyph): Fix previous change. Change the
9245 bit length of glyphless.ch to 25 (Bug#11082).
9246
90d49b7f
CY
92472012-03-26 Chong Yidong <cyd@gnu.org>
9248
9249 * keyboard.c (Vselection_inhibit_update_commands): New variable.
9250 (command_loop_1): Use it; inhibit selection update for
9251 handle-select-window too (Bug#8996).
9252
f514f6f0
FP
92532012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
9254
e8fc049f 9255 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 9256
bf43fa51
KH
92572012-03-25 Kenichi Handa <handa@m17n.org>
9258
9259 * dispextern.h (struct glyph): Change the bit length of
9260 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
9261
8a0c01dd
EZ
92622012-03-24 Eli Zaretskii <eliz@gnu.org>
9263
9264 * s/ms-w32.h (tzname): Include time.h before redirecting to
9265 _tzname. Fixes the MSVC build. (Bug#9960)
9266
7d1c3a76
AS
92672012-03-24 Andreas Schwab <schwab@linux-m68k.org>
9268
8ed79523
AS
9269 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
9270 characters.
9271
7d1c3a76
AS
9272 * xterm.c (XTread_socket): Only modify handling_signal if
9273 !SYNC_INPUT. (Bug#11080)
9274
e99a9b8b
EZ
92752012-03-23 Eli Zaretskii <eliz@gnu.org>
9276
9277 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
9278 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
9279 when fetching a multibyte character consumes more bytes than
9280 CHAR_BYTES returns, due to unification of CJK characters in
9281 string_char. (Bug#11073)
9282
5063c0e1
TN
92832012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
9284
9285 * process.c (wait_reading_process_output): Handle pty disconnect
9286 by refraining from sending oneself a SIGCHLD (bug#10933).
9287
9f851fbd
CY
92882012-03-22 Chong Yidong <cyd@gnu.org>
9289
9290 * dispextern.h (struct it): New member string_from_prefix_prop_p.
9291
5063c0e1 9292 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
9293 Mark string as coming from a prefix property.
9294 (handle_face_prop): Use default face for prefix strings (Bug#4281).
9295 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
9296
fb5b8aca
CY
92972012-03-21 Chong Yidong <cyd@gnu.org>
9298
9299 * xfaces.c (Vface_remapping_alist): Doc fix.
9300
62356a1b
EZ
93012012-03-20 Eli Zaretskii <eliz@gnu.org>
9302
9303 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
9304 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
9305 Doc fixes.
62356a1b 9306
025de85b
CY
93072012-03-20 Chong Yidong <cyd@gnu.org>
9308
9309 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
9310 to reflect default non-nil value of redisplay-dont-pause.
9311
4827f94e
KH
93122012-03-19 Kenichi Handa <handa@m17n.org>
9313
9314 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
9315 it fit in a valid range (Bug#11003).
9316
e50a24a2
EZ
93172012-03-18 Eli Zaretskii <eliz@gnu.org>
9318
9319 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
9320 that is not from display property, accept the row as a "cursor
9321 row" if one of the string's character has a non-nil `cursor'
9322 property. Fixes cursor positioning when there are newlines in
9323 overlay strings, e.g. in icomplete.el. (Bug#11035)
9324
9af5ed87
PE
93252012-03-12 Paul Eggert <eggert@cs.ucla.edu>
9326
9327 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
9328
d1f55f16
CY
93292012-03-12 Chong Yidong <cyd@gnu.org>
9330
9331 * eval.c (inhibit_lisp_code): Rename from
9332 inhibit_window_configuration_change_hook; move from window.c.
9333
9334 * xfns.c (unwind_create_frame_1, Fx_create_frame):
9335 * window.c (run_window_configuration_change_hook)
9336 (syms_of_window): Callers changed.
9337
66c5eebd
CY
93382012-03-11 Chong Yidong <cyd@gnu.org>
9339
413df973
CY
9340 * keymap.c (Fkey_description): Doc fix (Bug#9700).
9341
66c5eebd
CY
9342 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
9343
1de11f56
CY
93442012-03-10 Chong Yidong <cyd@gnu.org>
9345
9346 * frame.c (other_visible_frames): Don't assume the selected frame
9347 is visible (Bug#10955).
9348
cae07000
SM
93492012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
9350
9351 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9352
89c94350
JD
93532012-03-08 Jan Djärv <jan.h.d@swipnet.se>
9354
9355 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9356 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
9357 zero (Bug#10954).
9358
999dd333
GM
93592012-03-03 Glenn Morris <rgm@gnu.org>
9360
01a6dcc8 9361 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 9362
de0100f2
EZ
93632012-03-02 Eli Zaretskii <eliz@gnu.org>
9364
9365 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
9366 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
9367 (redisplay_window, next_element_from_string): Fix typos in
9368 comments.
3e441275
EZ
9369 (redisplay_window): Pass to move_it_vertically the margin in
9370 pixels, not in screen lines.
de0100f2 9371
96a72ee9
GM
93722012-03-02 Glenn Morris <rgm@gnu.org>
9373
9374 * buffer.c (buffer-list-update-hook): Doc fix.
9375
312508d7
EZ
93762012-02-29 Eli Zaretskii <eliz@gnu.org>
9377
9378 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9379 push_it before setting up the iterator for the first overlay
9380 string, even if we have an empty string loaded.
9381 (next_overlay_string): If there's an empty string on the iterator
9382 stack, pop the stack. (Bug#10903)
9383
27f3c637
PE
93842012-02-25 Paul Eggert <eggert@cs.ucla.edu>
9385
9386 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9387 Suggested by Stefan Monnier in
9388 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9389 * alloc.c (widen_to_Lisp_Object): New static function.
9390 (mark_memory): Also mark Lisp_Objects by fetching pointer words
9391 and widening them to Lisp_Objects. This would work even if
9392 USE_LSB_TAG is defined and wide integers are used, which might
9393 happen in a future version of Emacs.
9394
3c9dfce6
CY
93952012-02-25 Chong Yidong <cyd@gnu.org>
9396
fa74b241
CY
9397 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9398 Doc fix.
9399
3c9dfce6
CY
9400 * xselect.c (Fx_selection_exists_p): Doc fix.
9401 (x_clipboard_manager_save_all): Print an informative message
9402 before saving to clipboard manager.
9403
9486df08
CY
94042012-02-24 Chong Yidong <cyd@gnu.org>
9405
9406 * keyboard.c (process_special_events): Handle all X selection
9407 requests in kbd_buffer, not just the next one (Bug#8869).
9408
f01d3321
CY
94092012-02-23 Chong Yidong <cyd@gnu.org>
9410
9411 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9412 call when setting menu-bar-lines and tool-bar-lines parameters.
9413 (unwind_create_frame_1): New helper function.
9414
9415 * window.c (inhibit_window_configuration_change_hook): New var.
9416 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 9417 (syms_of_window): Initialize it.
f01d3321 9418
86b847b6
CY
94192012-02-22 Chong Yidong <cyd@gnu.org>
9420
9421 * xterm.c (x_draw_image_relief): Add missing type check for
9422 Vtool_bar_button_margin (Bug#10743).
9423
a59225b1
CY
94242012-02-21 Chong Yidong <cyd@gnu.org>
9425
9426 * fileio.c (Vfile_name_handler_alist): Doc fix.
9427
9428 * buffer.c (Fget_file_buffer): Protect against invalid file
9429 handler return value.
9430
310f5bd4
PE
94312012-02-20 Paul Eggert <eggert@cs.ucla.edu>
9432
cb3a28cc
PE
9433 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9434 when computing $valmask.
9435
310f5bd4
PE
9436 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9437 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9438 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9439 It's useless in that case, and it can cause problems on hosts
9440 that allocate halves of EMACS_INT values separately.
9441 Reported by Dan Horák. Diagnosed by Andreas Schwab in
9442 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9443 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9444 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
9445 it avoids undefined behavior on hosts where shifting right by more
9446 than the word width has undefined behavior.
9447
2375c96a
CY
94482012-02-19 Chong Yidong <cyd@gnu.org>
9449
9450 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9451 (Funhandled_file_name_directory, Ffile_name_as_directory)
9452 (Fdirectory_file_name, Fexpand_file_name)
9453 (Fsubstitute_in_file_name): Protect against invalid file handler
9454 return values (Bug#10845).
9455
3eb49e71
EZ
94562012-02-18 Eli Zaretskii <eliz@gnu.org>
9457
9458 * .gdbinit (pitx): Fix incorrect references to fields of the
9459 iterator stack.
9460
7b926f3f
CY
94612012-02-17 Chong Yidong <cyd@gnu.org>
9462
9463 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9464
11273115
PE
94652012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9466
9467 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9468 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9469
c3a70e2b
CY
94702012-02-15 Chong Yidong <cyd@gnu.org>
9471
9472 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9473 marked as special. Also, starting docstrings with * is obsolete.
9474
0ca43699
AS
94752012-02-13 Andreas Schwab <schwab@linux-m68k.org>
9476
9477 * gnutls.c (emacs_gnutls_write): Fix last change.
9478
2e8f3c56
LI
94792012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
9480
9481 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9482 send_process.
9483
af70074f
SM
94842012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
9485
9486 * keymap.c (Fsingle_key_description): Handle char ranges.
9487
95986d52
CY
94882012-02-12 Chong Yidong <cyd@gnu.org>
9489
afd83bd1
CY
9490 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9491 as that creates a dangerous corner case.
9492
95986d52
CY
9493 * window.c (Fdelete_window_internal): Invalidate the mouse
9494 highlight (Bug#9904).
9495
bd7da63e
GM
94962012-02-12 Glenn Morris <rgm@gnu.org>
9497
9498 * xselect.c (Fx_own_selection_internal)
9499 (Fx_get_selection_internal, Fx_disown_selection_internal)
9500 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
9501 * nsselect.m (Fx_own_selection_internal)
9502 (Fx_disown_selection_internal, Fx_selection_exists_p)
9503 (Fx_selection_owner_p, Fx_get_selection_internal):
9504 Sync docs and argument specs with the xselect.c versions.
9505
77abcbc2
LI
95062012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
9507
9508 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
9509
90b671e2
EZ
95102012-02-11 Eli Zaretskii <eliz@gnu.org>
9511
1c0ca0b7
EZ
9512 * w32select.c (Fx_selection_exists_p): Sync doc string and
9513 argument list with xselect.c. (Bug#10783)
9514
9515 * w16select.c (Fx_selection_exists_p): Sync doc string and
9516 argument list with xselect.c. (Bug#10783)
90b671e2 9517
49241268
GM
95182012-02-10 Glenn Morris <rgm@gnu.org>
9519
9520 * fns.c (Fsecure_hash): Doc fix.
9521
f998bbe7 95222012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
9523
9524 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
9525
0992bd9c
CY
95262012-02-07 Chong Yidong <cyd@gnu.org>
9527
9528 * buffer.c (Fbuffer_local_variables)
9529 (buffer_lisp_local_variables): Handle unbound vars correctly;
9530 don't let Qunbound leak into Lisp.
9531
af008560
GM
95322012-02-07 Glenn Morris <rgm@gnu.org>
9533
dd605cc4
GM
9534 * image.c (Fimagemagick_types): Doc fix.
9535
af008560
GM
9536 * image.c (imagemagick-render-type): Change it from a lisp object
9537 to an integer. Move the doc here from the lisp manual.
9538 Treat all values not equal to 0 the same.
9539
1449fa1d
CY
95402012-02-06 Chong Yidong <cyd@gnu.org>
9541
9542 * doc.c (store_function_docstring): Avoid applying docstring of
9543 alias to base function (Bug#2603).
9544
3723ec07
AS
95452012-02-04 Andreas Schwab <schwab@linux-m68k.org>
9546
9547 * .gdbinit (pp1, pv1): Remove redundant defines.
9548 (pr): Use pp.
9549
79c1cc1e
CY
95502012-02-04 Chong Yidong <cyd@gnu.org>
9551
9552 * nsterm.m: Declare a global (Bug#10694).
9553
d7f29f8e
EZ
95542012-02-04 Eli Zaretskii <eliz@gnu.org>
9555
cae07000
SM
9556 * w32.c (get_emacs_configuration_options):
9557 Include --enable-checking, if specified, in the return value.
d7f29f8e 9558
3b95a6f9
MR
95592012-02-04 Martin Rudalics <rudalics@gmx.at>
9560
9561 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9562 after rounding frame sizes. (Bug#9723)
9563
d6fa96a6
EZ
95642012-02-04 Eli Zaretskii <eliz@gnu.org>
9565
9566 * keyboard.c (adjust_point_for_property): Don't position point
9567 before BEGV. (Bug#10696)
9568
df0b2940
PE
95692012-02-03 Paul Eggert <eggert@cs.ucla.edu>
9570
9571 Handle overflow when computing char display width (Bug#9496).
9572 * character.c (char_width): Return EMACS_INT, not int.
9573 (char_width, c_string_width): Check for overflow when
9574 computing the width; this is possible now that individual
9575 characters can have unbounded width. Problem introduced
9576 by merge from Emacs 23 on 2012-01-19.
9577
6bee44d6
MA
95782012-02-02 Michael Albinus <michael.albinus@gmx.de>
9579
9580 * dbusbind.c (Fdbus_register_method): Mention the return value
9581 :ignore in the docstring.
9582
44f92739
GM
95832012-02-02 Glenn Morris <rgm@gnu.org>
9584
1b9f60cc
GM
9585 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9586
44f92739
GM
9587 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9588 Unconditionally set to t. (Bug#10673)
9589 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9590 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9591 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9592
c5d3843c
KH
95932012-02-02 Kenichi Handa <handa@m17n.org>
9594
9595 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
9596 0, do not call append_composite_glyph.
9597
159462d4 95982012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
9599
9600 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9601 NULL (Bug#6988).
9602 (x_produce_glyphs): If the component of a composition is a null
9603 string, set it->pixel_width to 1 to avoid zero-width glyph.
9604
78cef877
EZ
96052012-02-01 Eli Zaretskii <eliz@gnu.org>
9606
9607 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9608 first 2 arguments are identical. This makes inserting large
9609 output from a subprocess an order of magnitude faster on
9610 MS-Windows, where all sbrk'ed memory is always contiguous.
9611
97897668
GM
96122012-01-31 Glenn Morris <rgm@gnu.org>
9613
9614 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 9615 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
9616 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9617
31fd3586
GM
96182012-01-29 Glenn Morris <rgm@gnu.org>
9619
9620 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9621
0e24a8b2
CY
96222012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
9623
9624 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9625
cc0adcb0
CY
96262012-01-28 Chong Yidong <cyd@gnu.org>
9627
9628 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9629
acc28cb9
CY
96302012-01-26 Chong Yidong <cyd@gnu.org>
9631
9c69cfb7
CY
9632 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9633
acc28cb9
CY
9634 * search.c (Fsearch_forward, Fsearch_backward): Document negative
9635 repeat counts (Bug#10507).
9636
48da7392
GM
96372012-01-26 Glenn Morris <rgm@gnu.org>
9638
9639 * lread.c (syms_of_lread): Doc fix.
9640
14af5f7f
CY
96412012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
9642
9643 * coding.c (encode_designation_at_bol): Change return value to
9644 EMACS_INT.
9645
0b21c100
CY
96462012-01-25 Chong Yidong <cyd@gnu.org>
9647
9648 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
9649
3c2907f7
CY
96502012-01-21 Chong Yidong <cyd@gnu.org>
9651
9652 * floatfns.c (Fcopysign): Make the second argument non-optional,
9653 since nil is not allowed anyway.
9654
959ad23f
AS
96552012-01-21 Andreas Schwab <schwab@linux-m68k.org>
9656
9657 * process.c (read_process_output): Use p instead of XPROCESS (proc).
9658 (send_process): Likewise.
9659
34a02f46
MR
96602012-01-19 Martin Rudalics <rudalics@gmx.at>
9661
9662 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
9663 (Vwindow_persistent_parameters): Do not use Qstate.
9664 Rewrite doc-strings.
34a02f46 9665
1259009a 96662012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
9667
9668 * character.c (char_width): New function.
70d4fdf6
GM
9669 (Fchar_width, c_string_width, lisp_string_width):
9670 Use char_width (Bug#9496).
25ed9e61 9671
6a6ee00d
MR
96722012-01-16 Martin Rudalics <rudalics@gmx.at>
9673
9674 * window.c (Vwindow_persistent_parameters): New variable.
9675 (Fset_window_configuration, save_window_save): Handle persistent
9676 window parameters.
9677
c85efaf7
EZ
96782012-01-14 Eli Zaretskii <eliz@gnu.org>
9679
9680 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9681 thrashing the stack of the thread. (Bug#9087)
9682
5944709e
PE
96832012-01-12 Paul Eggert <eggert@cs.ucla.edu>
9684
9685 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9686
e71f5d99
EZ
96872012-01-11 Eli Zaretskii <eliz@gnu.org>
9688
9689 * xdisp.c (rows_from_pos_range): Handle the case where the
9690 highlight ends on a newline. (Bug#10464)
9691 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9692 he end column for display of highlight that ends on a newline
9693 before a R2L line.
9694
ce316182
GM
96952012-01-11 Glenn Morris <rgm@gnu.org>
9696
9697 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9698 from load-path also when installation-directory is nil. (Bug#10208)
9699
5b43da69
GM
97002012-01-10 Glenn Morris <rgm@gnu.org>
9701
74cc8ff9
GM
9702 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9703
7d8d6e4e
GM
9704 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9705 Update template values to be closer to their typical values these days.
5b43da69 9706
a0db8d43
EZ
97072012-01-09 Eli Zaretskii <eliz@gnu.org>
9708
9709 * xdisp.c (rows_from_pos_range): Accept additional argument
9710 DISP_STRING, and accept any glyph in a row whose object is that
9711 string as eligible for mouse highlight. Fixes mouse highlight of
9712 display strings from overlays. (Bug#10464)
9713
9a0115ab 97142012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 9715
b9110d6a 9716 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
9717 * fileio.c (auto_saving_dir_umask): New static var.
9718 (Fmake_directory_internal): Use it.
9719 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9720 creating the directory. The old code temporarily assigns
9721 too-generous permissions to the directory.
9722 (do_auto_save_eh): Clear it.
b9110d6a 9723 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
9724 that the var is always cleared.
9725
6c1bd3f3
EZ
97262012-01-07 Eli Zaretskii <eliz@gnu.org>
9727
9728 * search.c (scan_buffer): Pass character positions to
9729 know_region_cache, not byte positions. (Bug#6540)
9730
069d2b50
L
97312012-01-07 LynX <_LynX@bk.ru> (tiny change)
9732
9733 * w32.c (sys_rename): Report EXDEV when rename of a directory
9734 fails because the target is on another logical disk. (Bug#10284)
9735
75bf0d33
DB
97362012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9737
9738 * xterm.c (x_embed_request_focus): New function.
9739
9740 * xterm.h: Add prototype.
9741
9742 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9743
1c6e5a32
GM
97442012-01-05 Glenn Morris <rgm@gnu.org>
9745
9746 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9747
651e947e
EZ
97482012-01-01 Eli Zaretskii <eliz@gnu.org>
9749
9750 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9751 Load gnutls_transport_set_lowat only if GnuTLS version is below
9752 2.11.1.
9753 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9754 GnuTLS versions below 2.11.1.
9755
3778cdd8
AL
97562011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9757
9758 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9759 to the doc string advising against its use for altering the way
9760 windows are scrolled.
9761
0e5317f7
KH
97622011-12-28 Kenichi Handa <handa@m17n.org>
9763
9764 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9765 coding-system ASCII compatible only when it does not produce BOM
9766 on encoding (Bug#10383).
9767
93d5ca1f
JD
97682011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9769
9770 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9771 can scroll.
9772 (create_and_show_popup_menu): Always use menu_position_func for
9773 Gtk3 (Bug#10361).
9774
ca22b785
AS
97752011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9776
9777 * callint.c (Fcall_interactively): Don't truncate prompt string.
9778
d048e1e6
EZ
97792011-12-23 Eli Zaretskii <eliz@gnu.org>
9780
9781 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9782 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 9783 resumed from there (after widening). (Bug#10360)
d048e1e6 9784
5ccaba1f
JD
97852011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9786
9787 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9788
204ee57f
JD
97892011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9790
b81d40f0
JB
9791 * nsterm.m (x_free_frame_resources):
9792 Release f->output_data.ns->miniimage.
204ee57f
JD
9793 (ns_index_color): Fix indentation. Do not retain
9794 color_table->colors[i].
9795
9796 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9797 before returning.
9798
9799 * nsfns.m (x_set_background_color): Assign return value from
9800 ns_index_color to face-background instead of NSColor*.
9801 (ns_implicitly_set_icon_type): Fix indentation.
9802 Change assignment in for loop to comparison.
9803
9804 * emacs.c (ns_pool): New variable.
9805 (main): Assign ns_pool.
9806 (Fkill_emacs): Call ns_release_autorelease_pool.
9807
9808 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9809 autorelease fdesc, release fdAttrs and tdict.
9810 (ns_get_covering_families): Release charset.
9811 (ns_findfonts): Release NSFontDescriptor created with new.
9812 (ns_uni_to_glyphs): Fix indentation.
9813 (setString): Release attrStr before assigning new value.
9814
c803b2b7
JD
98152011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9816
678f4426
JD
9817 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9818 and NS_IMPL_COCOA.
9819 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9820 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9821
cd394be1 98222011-12-18 David Reitter <reitter@cmu.edu>
678f4426 9823
5fecd5fc
JD
9824 * nsterm.m (ns_term_init): Subscribe for notifications
9825 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9826 to method trackingNotification in EmacsMenu.
9827
9828 * nsmenu.m (trackingMenu): New variable.
3771cb17 9829 (trackingNotification): New method (from Aquamacs).
5fecd5fc 9830 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 9831 from Aquamacs (Bug#7030).
678f4426
JD
9832
98332011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 9834
c803b2b7
JD
9835 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9836 (symbol_to_nsstring): Fix indentation.
9837 (ns_symbol_to_pb): New function.
cae07000
SM
9838 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9839 (Fns_rotate_cut_buffers_internal): Remove.
9840 (Fns_store_selection_internal): Rename from
c803b2b7
JD
9841 Fns_store_cut_buffer_internal.
9842 (ns_get_foreign_selection, Fx_own_selection_internal)
9843 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
9844 (Fns_get_selection_internal, Fns_store_selection_internal):
9845 Use ns_symbol_to_pb and check if return value is nil.
9846 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9847 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
9848 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9849 renamed to Sns_store_selection_internal.
9850 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9851 and remove this function.
9852 (ns_handle_selection_clear): Remove, never used.
9853 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9854 here.
9855
e1b01a3a
KB
98562011-12-17 Ken Brown <kbrown@cornell.edu>
9857
9858 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9859 GID is unknown (Bug#10257).
9860
2adb6e85
PE
98612011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9862
9863 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9864 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9865 which caused a build failure on GNU/Linux IA-64. This problem was
9866 introduced by my 2011-10-07 patch.
9867
d1d7b339
JL
98682011-12-15 Juri Linkov <juri@jurta.org>
9869
9870 * image.c (imagemagick_error): New function. (Bug#10112)
9871 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9872 Use `imagemagick_error' where ImageMagick functions return
9873 `MagickFalse'.
9874 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9875 proper order.
9876
100d5755
KH
98772011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9878
9879 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9880 fill background (Bug#8992).
9881
454592a6
MR
98822011-12-13 Martin Rudalics <rudalics@gmx.at>
9883
9884 * window.c (Vwindow_combination_resize)
9885 (Vwindow_combination_limit): Use t instead of non-nil in
9886 doc-strings.
61d4b438
MR
9887 (Vrecenter_redisplay): Add first sentence of doc-string on
9888 separate line.
53524d93 9889 (Frecenter): Fix doc-string typo.
454592a6 9890
3633e3aa
KH
98912011-12-11 Kenichi Handa <handa@m17n.org>
9892
9893 * coding.c (Funencodable_char_position): Pay attention to the
9894 buffer text relocation (Bug#9389).
9895
7b9d523a 98962011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 9897
7b9d523a
JD
9898 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9899 gtk_init (Bug#10100).
9900
b73189c6
EZ
99012011-12-10 Eli Zaretskii <eliz@gnu.org>
9902
9903 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9904 IT->string is nil. (Bug#10263)
9905
f7dfe5d6
JD
99062011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9907
83faebb4
JD
9908 * nsterm.h (x_free_frame_resources): Declare.
9909
f7dfe5d6
JD
9910 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9911 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9912
9913 * nsterm.h (ns_get_defaults_value): Declare.
9914
9915 * nsterm.m (ns_default): Call ns_get_defaults_value.
9916
7cd4e72c
EZ
99172011-12-09 Eli Zaretskii <eliz@gnu.org>
9918
9919 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9920 (Bug#10170)
9921
b34d7317
YM
99222011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9923
9924 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9925 that where the value of an _OBJC_* symbol points to is in the .bss
9926 section (Bug#10240).
9927
76470ad1
KH
99282011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9929
9930 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 9931 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 9932
745fff94
KH
99332011-12-08 Kenichi Handa <handa@m17n.org>
9934
9935 * ftfont.c (get_adstyle_property): Fix previous change
9936 (Bug#10233).
9937
6e44397c
JB
99382011-12-07 Juanma Barranquero <lekktu@gmail.com>
9939
9940 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9941 dirs from the default value of EMACSLOADPATH (bug#10208).
9942
7efa6272
GM
99432011-12-07 Glenn Morris <rgm@gnu.org>
9944
9945 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9946 installation and source directories as well. (Bug#10208)
9947
f6fc4d87
CY
99482011-12-06 Chong Yidong <cyd@gnu.org>
9949
9950 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9951
2bf26180
GM
99522011-12-06 Glenn Morris <rgm@gnu.org>
9953
9954 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9955 as an error, not just -1. (Bug#10217)
9956
3a6ad4f0
CY
99572011-12-05 Chong Yidong <cyd@gnu.org>
9958
9959 * keyboard.c (process_special_events): New function.
9960 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9961
75a3b399
PE
99622011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9963
9964 * coding.c (encode_designation_at_bol): Don't use uninitialized
9965 local variable (Bug#9318).
9966
c3c9e25e
KH
99672011-12-05 Kenichi Handa <handa@m17n.org>
9968
9969 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9970 return Qnil (Bug#8046, Bug#10193).
9971
5eb05ea3
KH
99722011-12-05 Kenichi Handa <handa@m17n.org>
9973
9974 * coding.c (encode_designation_at_bol): New args charbuf_end and
9975 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
9976 (coding_set_source): Return how many bytes coding->source was
9977 relocated.
9978 (coding_set_destination): Return how many bytes
9979 coding->destination was relocated.
9980 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 9981 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
9982
99832011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9984
9985 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9986 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9987 macro (Bug#9318).
9988
99892011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9990
9991 The following changes are to fix Bug#9318.
9992
a79703f5 9993 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
9994 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9995 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 9996 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 9997
7dbda6df
JB
99982011-12-05 Juanma Barranquero <lekktu@gmail.com>
9999
10000 * lisp.h (process_quit_flag): Fix external declaration.
10001
6d5eb5b0
SM
100022011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10003
10004 Don't macro-inline non-performance-critical code.
10005 * eval.c (process_quit_flag): New function.
10006 * lisp.h (QUIT): Use it.
10007
a0c3fad0
JD
100082011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10009
10010 * nsfns.m (get_geometry_from_preferences): New function.
10011 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10012
6c07aac2
AS
100132011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10014
10015 * emacs.c (Qkill_emacs): Define.
10016 (syms_of_emacs): Initialize it.
10017 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10018 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
10019 (quit_throw_to_read_char): Add parameter `from_signal'.
10020 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
10021 * lisp.h (QUIT): Call Fkill_emacs if requested.
10022
c052ead4
JD
100232011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10024
10025 * widget.c (update_wm_hints): Return if wmshell is null.
10026 (widget_update_wm_size_hints): New function.
10027
10028 * widget.h (widget_update_wm_size_hints): Declare.
10029
10030 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10031 widget_update_wm_size_hints (Bug#10104).
10032
9e49252b
EZ
100332011-12-03 Eli Zaretskii <eliz@gnu.org>
10034
10035 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10036 before a newline, prepare the bidi iterator for consuming the
10037 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 10038 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 10039
02b16839
JL
100402011-12-02 Juri Linkov <juri@jurta.org>
10041
10042 * search.c (Fword_search_regexp): New Lisp function created from
10043 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10044 (Fword_search_backward, Fword_search_forward)
10045 (Fword_search_backward_lax, Fword_search_forward_lax):
10046 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10047 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10048
0068070e
SM
100492011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10050
10051 * fileio.c (Finsert_file_contents): Move after-change-function call
10052 to before the "handled:" label, since all "goto handled" appear in
10053 cases where the *-change-functions have already been properly called
10054 (bug#10117).
10055
3360a3fc
AS
100562011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10057
10058 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10059 waiting for input. (Bug#10169)
10060
73d6c093
EZ
100612011-11-30 Eli Zaretskii <eliz@gnu.org>
10062
10063 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10064 verifies glyph row's hash code--we have just reallocated the
10065 glyphs, so their contents can be complete garbage. (Bug#10164)
10066
febe6bea
JB
100672011-11-30 Juanma Barranquero <lekktu@gmail.com>
10068
10069 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10070
801a4313
EZ
100712011-11-30 Eli Zaretskii <eliz@gnu.org>
10072
10073 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10074 attributes are tested _before_ calling verify_row_hash, to protect
10075 against GCC re-ordering of the tests. (Bug#10164)
10076
2b56b87e
JD
100772011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10078
10079 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10080
10081 * xterm.c (handle_one_xevent): Only set async_visible and friends
10082 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 10083 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
10084 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10085
dbf31225
PE
100862011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10087
10088 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10089 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10090 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10091 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10092 All uses changed to use GCPRO1 etc.
10093 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10094 Revert to old implementation (i.e., before 2011-03-11).
10095
1305621b
YM
100962011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10097
10098 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10099 of scroll runs so as to avoid assigning disabled bogus rows and
10100 unnecessary graphics copy operations.
10101
8c9afb46
EZ
101022011-11-27 Eli Zaretskii <eliz@gnu.org>
10103
10104 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10105 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10106 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10107 (malloc, free, realloc, calloc): Redirect to e_* only when
10108 compiling Emacs.
10109
10110 * lisp.h (GCTYPEBITS): Move before first use.
10111 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10112 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10113 this macro definition.
10114
10115 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10116 _MSC_VER.
10117
54e9e3bf
JD
101182011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10119
6d5eb5b0
SM
10120 * gtkutil.c (xg_create_frame_widgets):
10121 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
10122 present with Gtk+ 2.0.
10123
83aca1cb
PE
101242011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10125
10126 * fileio.c (Finsert_file_contents): Undo previous change; see
10127 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10128
5b76caa4
PE
101292011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10130
10131 Rename locals to avoid shadowing.
10132 * fileio.c (Finsert_file_contents):
10133 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10134 * process.c (wait_reading_process_output):
10135 Rename inner 'proc' to 'p' to avoid shadowing.
10136 Indent for consistency with usual Emacs style.
10137
8c535114
EZ
101382011-11-25 Eli Zaretskii <eliz@gnu.org>
10139
10140 * xdisp.c (redisplay_window): If cursor row is not fully visible
10141 after recentering, and scroll-conservatively is set to a large
10142 number, scroll window by a few more lines to make the cursor fully
10143 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
10144 (start_display): Don't move to the next line if the display should
10145 start at a newline that is part of a display vector or an overlay
10146 string. (Bug#10119)
8c535114 10147
fa4fdb5c
JL
101482011-11-24 Juri Linkov <juri@jurta.org>
10149
10150 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10151 after the `MagickPingImage' call. (Bug#10112)
10152
90ec88df
CY
101532011-11-23 Chong Yidong <cyd@gnu.org>
10154
10155 * window.c (Fcoordinates_in_window_p): Accept only live windows.
10156
56e2e794
MR
101572011-11-23 Martin Rudalics <rudalics@gmx.at>
10158
10159 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
10160 making another buffer current. (Bug#10114)
10161
b6e64c41
GM
101622011-11-23 Glenn Morris <rgm@gnu.org>
10163
10164 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
10165
6b21de18
CY
101662011-11-23 Chong Yidong <cyd@gnu.org>
10167
10168 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
10169 using it (Bug#5984).
10170
b12cd789
EZ
101712011-11-22 Eli Zaretskii <eliz@gnu.org>
10172
10173 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
10174 and header-lines, as they don't have one computed for them.
10175 (Bug#10098)
10176
10177 * .gdbinit (prow): Make displayed values more self-explaining.
10178 Add row's hash code.
10179
261b6fd4
LMI
101802011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
10181
10182 * process.c (wait_reading_process_output): Fix asynchrounous
10183 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 10184 (wait_reading_process_output): Add comment and URL.
261b6fd4 10185
e7cfd277
JD
101862011-11-21 Jan Djärv <jan.h.d@swipnet.se>
10187
10188 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
10189
a9b9b7f5
CY
101902011-11-21 Chong Yidong <cyd@gnu.org>
10191
10192 * window.c (Fnext_window, Fprevious_window): Doc fix.
10193
b0d15b4f
SM
101942011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10195
10196 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
10197
fe7a3057
JB
101982011-11-20 Juanma Barranquero <lekktu@gmail.com>
10199
10200 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
10201
d2999b1a
MR
102022011-11-20 Martin Rudalics <rudalics@gmx.at>
10203
10204 * window.c (Fset_window_combination_limit): Rename argument
10205 STATUS to LIMIT.
10206 (Vwindow_combination_limit): Remove "status" from doc-string.
10207
d5ff9cd0
AS
102082011-11-20 Andreas Schwab <schwab@linux-m68k.org>
10209
10210 * m/ibms390.h: Remove.
10211 * m/ibms390x.h: Don't include "ibms390.h".
10212
a5bb9bd3
SM
102132011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10214
10215 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
10216 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
10217
cd1181db
JB
102182011-11-20 Juanma Barranquero <lekktu@gmail.com>
10219
10220 * casetab.c (Fset_case_table):
10221 * charset.c (Fcharset_after): Fix typos.
10222
615a3b8d 102232011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 10224
17e845af
PE
10225 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
10226 Otherwise, valgrind does not work on some platforms.
10227 Problem reported by Andreas Schwab in
6a0bf43d
PE
10228 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
10229 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
10230 is set, removing the need for VIRT_ADDRESS_VARIES.
10231 (PURE_P): Use a more-efficient implementation that needs just one
10232 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
10233 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
10234 to 4 (xorl, subq, cmpq, setbe).
10235 * alloc.c (pure): Always extern now, since that's the
10236 VIRT_ADDR_VARIES behavior.
10237 (PURE_POINTER_P): Use a single comparison, not two, for
10238 consistency with the new puresize.h.
10239 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
10240 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
10241 Remove VIRT_ADDR_VARIES no longer needed.
10242
f8fe6f96
EZ
102432011-11-19 Eli Zaretskii <eliz@gnu.org>
10244
10245 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
10246 (erase_phys_cursor, update_window_cursor, show_mouse_face)
10247 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
10248 behave as if the cursor position were at the window margin.
10249
10250 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
10251 and the cursor position is out of bounds, behave as if the cursor
10252 position were at the window margin. (Bug#10075)
10253
df05a53c
CY
102542011-11-18 Chong Yidong <cyd@gnu.org>
10255
10256 * window.c (Fwindow_combination_limit): Make first argument
10257 non-optional, since it is meaningless for live windows like the
10258 selected window.
61ccba97 10259
2071918e
DA
102602011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
10261
10262 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
10263
b50a28de
SM
102642011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
10265
10266 * intervals.c: Fix grafting over the whole buffer (bug#10071).
10267 (graft_intervals_into_buffer): Simplify.
10268
015137db
EZ
102692011-11-18 Eli Zaretskii <eliz@gnu.org>
10270
10271 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
10272 hash values of the two rows.
10273 (copy_row_except_pointers): Preserve the used[] arrays and the
10274 hash values of the two rows. (Bug#10035)
68c95424 10275 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
10276
10277 * xdisp.c (row_hash): New function, body extracted from
10278 compute_line_metrics.
10279 (compute_line_metrics): Call row_hash, instead of computing the
10280 hash code inline.
10281
10282 * dispnew.c (verify_row_hash): Call row_hash for computing the
10283 hash code of a row, instead of duplicating code from xdisp.c.
10284
10285 * dispextern.h (row_hash): Add prototype.
10286
a2addb04
TH
102872011-11-18 Tassilo Horn <tassilo@member.fsf.org>
10288
10289 * frame.c (delete_frame): Don't delete the terminal when the last
10290 X frame is closed if emacs is built with GTK toolkit.
10291
df85d315
JB
102922011-11-17 Juanma Barranquero <lekktu@gmail.com>
10293
10294 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
10295
a0c2d0ae
MR
102962011-11-17 Martin Rudalics <rudalics@gmx.at>
10297
10298 * window.c (Vwindow_splits): Rename to
10299 Vwindow_combination_resize. Suggested by Juri Linkov.
10300 (Fsplit_window_internal): Use Vwindow_combination_resize instead
10301 of Vwindow_splits.
10302
58179cce
JB
103032011-11-16 Juanma Barranquero <lekktu@gmail.com>
10304
7877f373
JB
10305 * nsfns.m (Fns_font_name):
10306 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 10307
b6f67890
MR
103082011-11-16 Martin Rudalics <rudalics@gmx.at>
10309
10310 * window.h (window): Rename slot "nest" to "combination_limit".
10311 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
10312 (Fset_window_nest): Rename to Fset_window_combination_limit.
10313 (Vwindow_nest): Rename to Vwindow_combination_limit.
10314 (recombine_windows, make_parent_window, make_window)
10315 (Fsplit_window_internal, saved_window)
10316 (Fset_window_configuration, save_window_save): Rename all
10317 occurrences of window_nest to window_combination_limit.
10318
c7015153
JB
103192011-11-15 Juanma Barranquero <lekktu@gmail.com>
10320
10321 * image.c (imagemagick_load_image): Fix typo.
10322
322ad6ec
EZ
103232011-11-14 Eli Zaretskii <eliz@gnu.org>
10324
10325 * xdisp.c (display_line): Move the call to
10326 highlight_trailing_whitespace before the call to
10327 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
10328 faces of all the glyphs to compute ROW's hash value.
10329 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 10330
f067b8ec
JB
103312011-11-14 Juanma Barranquero <lekktu@gmail.com>
10332
10333 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
10334 just return (bug#10044).
10335
1e5b2111
EZ
103362011-11-12 Eli Zaretskii <eliz@gnu.org>
10337
7ef3cbd5
EZ
10338 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
10339 with user-defined heap size. Bump the default size of the temacs
10340 heap to 27MB, to avoid memory warning when running temacs.
10341 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
10342
1e5b2111
EZ
10343 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
10344 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
10345 (verify_row_hash) [XASSERTS]: New function.
10346 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
10347 that the hash value of glyph rows is correct.
1e5b2111 10348
89d61221
MR
103492011-11-12 Martin Rudalics <rudalics@gmx.at>
10350
10351 * window.h (window): Remove splits slot.
10352 * window.c (Fwindow_splits, Fset_window_splits): Remove.
10353 (Fdelete_other_windows_internal, make_parent_window)
10354 (make_window, Fsplit_window_internal, Fdelete_window_internal)
10355 (Fset_window_configuration, save_window_save): Don't deal with
10356 split status of windows.
10357 (saved_window): Remove splits slot.
10358 (Vwindow_splits): Rewrite doc-string.
10359
97f18cc8
JD
103602011-11-11 Jan Djärv <jan.h.d@swipnet.se>
10361
10362 * xfns.c (unwind_create_frame):
10363 * nsfns.m (unwind_create_frame):
10364 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
10365 Vframe_list (Bug#9999).
10366
22a648b4
DA
103672011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
10368
0b381c7e 10369 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 10370
659afede
KH
103712011-11-11 Kenichi Handa <handa@m17n.org>
10372
10373 * callproc.c (Fcall_process): Set the member dst_multibyte of
10374 process_coding.
10375
9ac0394b
KH
103762011-11-11 Johan Bockgård <bojohan@gnu.org>
10377
10378 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10379 avoid a crash (bug#9496).
10380
2fbdc249
CY
103812011-11-09 Chong Yidong <cyd@gnu.org>
10382
10383 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10384 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10385
ac6b1f81
PE
103862011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10387
10388 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10389
09db192c
PE
103902011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10391
10392 Avoid some portability problems by eschewing 'extern inline' functions.
10393 The trivial performance wins aren't worth the portability hassles; see
10394 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10395 et seq.
10396 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10397 (window_box_width, window_box_left, window_box_left_offset)
10398 (window_box_right, window_box_right_offset): Undo previous change,
10399 by removing the "extern"s.
10400 * intervals.c (adjust_intervals_for_insertion)
10401 (adjust_intervals_for_deletion): Undo previous change,
10402 making these static again.
10403 (offset_intervals, temp_set_point_both, temp_set_point)
10404 (copy_intervals_to_string): No longer inline.
10405 * xdisp.c (window_text_bottom_y, window_box_width)
10406 (window_box_height, window_box_left_offset)
10407 (window_box_right_offset, window_box_left, window_box_right)
10408 (window_box): No longer inline.
10409
105216ed
CY
104102011-11-08 Chong Yidong <cyd@gnu.org>
10411
10412 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
10413 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
10414 Signal an error if not a live window.
105216ed
CY
10415 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
10416 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
10417
ae9e237f
JB
104182011-11-07 Juanma Barranquero <lekktu@gmail.com>
10419
10420 * lisp.h (syms_of_abbrev): Remove declaration.
10421 Reported by CHENG Gao <chenggao@royau.me>.
10422
c7aa8333
EZ
104232011-11-07 Eli Zaretskii <eliz@gnu.org>
10424
10425 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10426 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
10427 of temacs in GUI mode.
10428
be7f5545
MR
104292011-11-07 Martin Rudalics <rudalics@gmx.at>
10430
10431 * window.h: Declare delete_all_child_windows instead of
10432 delete_all_subwindows.
10433 * window.c (Fwindow_nest, Fset_window_nest)
10434 (Fset_window_new_total, Fset_window_new_normal)
10435 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10436 (delete_all_subwindows): Rename to delete_all_child_windows.
10437 (Fdelete_other_windows_internal, Fset_window_configuration):
10438 Call delete_all_child_windows instead of delete_all_subwindows.
10439 * frame.c (delete_frame): Call delete_all_child_windows instead
10440 of delete_all_subwindows.
10441
ca78dc43
PE
104422011-11-07 Paul Eggert <eggert@cs.ucla.edu>
10443
10444 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10445 This is also needed for porting to any host where GC_MARK_STACK is
10446 not GC_MAKE_GCPROS_NOOPS.
10447 (which_symbols): Use it.
10448
a0241d01
KH
104492011-11-07 Kenichi Handa <handa@m17n.org>
10450
10451 * coding.c (coding_set_destination): Check coding->src_pos only
10452 when coding->src_object is a buffer (bug#9910).
10453
10454 * process.c (send_process): Set the member src_multibyte of coding
10455 to 0 (bug#9911) when sending a unibyte text.
10456
10457 * callproc.c (Fcall_process): Set the member src_multibyte of
10458 process_coding to 0 (bug#9912).
10459
a64bfdfa 104602011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
10461
10462 * xmenu.c (cleanup_widget_value_tree): New function.
10463 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10464 calling free_menubar_widget_value_tree directly (Bug#9830).
10465
cb41b32a
PE
104662011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10467
10468 Fix some portability problems with 'inline'.
10469 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10470 (window_box_width, window_box_left, window_box_left_offset)
10471 (window_box_right, window_box_right_offset): Declare extern.
10472 Otherwise, these inline functions do not conform to C99 and
10473 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
10474 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10475 * intervals.c (adjust_intervals_for_insertion)
10476 (adjust_intervals_for_deletion): Now extern, because otherwise the
10477 extern inline functions 'offset_intervals' couldn't refer to it.
10478 (static_offset_intervals): Remove.
10479 (offset_intervals): Rewrite using the old contents of
10480 static_offset_intervals. The old version didn't conform to C99
10481 because an extern inline function contained a reference to an
10482 identifier with static linkage.
10483
b7041366
AS
104842011-11-06 Andreas Schwab <schwab@linux-m68k.org>
10485
10486 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10487 GC.
10488
88a37c4d
EZ
104892011-11-06 Eli Zaretskii <eliz@gnu.org>
10490
10491 * xdisp.c (init_iterator, reseat_to_string): Don't set the
10492 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
10493 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10494 return Qleft_to_right.
10495
49745b39
CY
104962011-11-06 Chong Yidong <cyd@gnu.org>
10497
10498 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
10499 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
10500 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
10501 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
10502 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
10503 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
10504 (Fwindow_vscroll): Doc fix.
10505 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
10506 argument, since it makes no sense to pass a live window and for
10507 consistency with window-child.
10508
1f05cd82
CS
105092011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
10510
10511 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
10512 support MSVC.
10513
22610910
JR
105142011-11-05 Jason Rumney <jasonr@gnu.org>
10515
10516 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
10517 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
10518 fonts (Bug#6029).
10519 (add_font_entity_to_list): Fix logic errors in mixed boolean and
10520 bitwise arithmetic preventing use of unicode-sip and non-truetype
10521 opentype fonts.
10522
a06776b2
EZ
105232011-11-05 Eli Zaretskii <eliz@gnu.org>
10524
3ad924ba
EZ
10525 * s/ms-w32.h (fstat, stat, utime): Move redirections to
10526 "emacs"-only part.
10527
a06776b2
EZ
10528 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
10529 initialization code to keep similarity to xfns.c after changes
10530 from 2011-11-05.
10531
c9e7db78
JD
105322011-11-05 Jan Djärv <jan.h.d@swipnet.se>
10533
a97f8f3f
JD
10534 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
10535 (unwind_create_frame): New function (Bug#9943).
10536 (Fx_create_frame): Restructure code to be more similar to the one in
10537 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
10538 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
10539 Move terminal->reference_count++ just before making the frame official
10540 (Bug#9943).
10541
10542 * nsterm.m (x_free_frame_resources): New function.
10543 (x_destroy_window): Move code to x_free_frame_resources.
10544
c9e7db78 10545 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
10546 (Fx_create_frame, x_create_tip_frame):
10547 Move terminal->reference_count++ just before making the frame
75f1671a 10548 official. Move initialization of image_cache_refcount and
c9e7db78
JD
10549 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
10550
a6fc3b5c
EZ
105512011-11-05 Eli Zaretskii <eliz@gnu.org>
10552
10553 Support MSVC build with newer versions of Visual Studio.
10554 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
10555 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
10556 nt/gmake.defs.
10557
10558 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10559 which are not supported by MSVC.
10560 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10561 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10562 bitfields.
10563 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10564 types in bitfields.
10565 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10566
10567 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10568
58179cce 105692011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
10570
10571 Support MSVC build with newer versions of Visual Studio.
10572 * w32.c: Don't include w32api.h for MSVC.
10573 (init_environment) [_MSC_VER]: Call sys_access, not _access.
10574
10575 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10576 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10577 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10578 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10579 e_* cousins.
10580 (alloca) [_MSC_VER]: Define to _alloca.
10581
10582 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10583
10584 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10585
a58c13ed
EZ
105862011-11-04 Eli Zaretskii <eliz@gnu.org>
10587
10588 * xdisp.c (note_mouse_highlight): If either of
10589 previous/next-single-property-change returns nil, treat that as
10590 the beginning or the end of the buffer. (Bug#9955)
10591
fe0b6370
JD
105922011-11-04 Jan Djärv <jan.h.d@swipnet.se>
10593
a58c13ed 10594 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
10595 label is not null (Bug#9951).
10596 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10597 may be NULL.
10598
89bd5ee1
EZ
105992011-11-04 Eli Zaretskii <eliz@gnu.org>
10600
10601 * window.c (Fwindow_body_size): Mention in the doc string that the
10602 return value is in frame's canonical units. (Bug#9949)
10603
84c3edb9
EZ
106042011-11-03 Eli Zaretskii <eliz@gnu.org>
10605
4e2fb5c7
EZ
10606 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
10607
84c3edb9 10608 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 10609 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 10610 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 10611
bc17a887
EZ
106122011-11-01 Eli Zaretskii <eliz@gnu.org>
10613
10614 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10615 Don't stop backward scan on the continuation glyph, even though
10616 its CHARPOS is positive.
6d5eb5b0
SM
10617 (mouse_face_from_buffer_pos, note_mouse_highlight):
10618 Rename cover_string to disp_string.
bc17a887 10619
4ee88440
MR
106202011-11-01 Martin Rudalics <rudalics@gmx.at>
10621
10622 * window.c (temp_output_buffer_show): Don't use
10623 Vtemp_buffer_show_specifiers.
10624 (Vtemp_buffer_show_specifiers): Remove unused variable.
10625
c2ff3c02
EZ
106262011-10-30 Eli Zaretskii <eliz@gnu.org>
10627
10628 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10629 past the beginning of the current glyph matrix.
10630
58179cce 106312011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
10632
10633 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10634 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10635 HAVE_GTK3 (Bug#9869).
b77a6a7f 10636
3b574623
JD
10637 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10638 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10639
b77a6a7f
JD
10640 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10641
10642 * xterm.c: Declare x_handle_net_wm_state to return int.
10643 (handle_one_xevent): Check if we are iconified but don't have
10644 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
10645 (get_current_wm_state): Return non-zero if not hidden,
10646 check for _NET_WM_STATE_HIDDEN (Bug#9893).
10647 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
10648 (x_handle_net_wm_state): Return what get_current_wm_state returns.
10649 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
10650
196e41e4
PE
106512011-10-29 Paul Eggert <eggert@cs.ucla.edu>
10652
10653 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
10654 so that this new function doesn't get optimized away by a
10655 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
10656
021f2e1a
AS
106572011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10658
10659 * frame.h (MOUSE_HL_INFO): Remove excess parens.
10660
8b058d44
EZ
106612011-10-29 Eli Zaretskii <eliz@gnu.org>
10662
10663 Fix the `xbytecode' command.
10664 * .gdbinit (xprintbytestr): New command.
b50a28de 10665 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
10666 (xbytecode): Print the byte-code string as well.
10667
4452fb80
EZ
106682011-10-29 Kim Storm <storm@cua.dk>
10669
8b058d44
EZ
10670 * alloc.c (which_symbols): New function.
10671
21b72067
AS
106722011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10673
10674 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
10675 line. (Bug#9903)
10676
83ed7b5c
GM
106772011-10-29 Glenn Morris <rgm@gnu.org>
10678
10679 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10680 Not clear what it was for, and it causes various bugs. (Bug#9839)
10681
5a7a728b
EZ
106822011-10-28 Eli Zaretskii <eliz@gnu.org>
10683
10684 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10685 possible random value that matches one of those tested as
10686 condition to clear the mouse face.
10687
d3d0842f
CY
106882011-10-28 Chong Yidong <cyd@gnu.org>
10689
10690 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10691
31b39d13
DN
106922011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
10693
10694 * window.c (make_window): Initialize phys_cursor_on_p.
10695
9aba6043
SM
106962011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
10697
10698 * lisp.h (struct Lisp_Symbol): Update comments.
10699
c20992f4
JB
107002011-10-28 Juanma Barranquero <lekktu@gmail.com>
10701
10702 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10703
db4f02f2
EZ
107042011-10-28 Eli Zaretskii <eliz@gnu.org>
10705
10706 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
10707 <oslsachem@gmail.com> for helping to debug this.
10708
10709 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10710 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10711 (g_b_init_get_glyph_outline_w): New static variables.
10712 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10713 (GetGlyphOutlineW_Proc): New typedefs.
10714 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
10715 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10716 New functions.
10717 (w32font_open_internal, compute_metrics):
10718 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
10719 instead of calling the "wide" APIs directly.
10720
10721 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10722
10723 * w32.h (syms_of_w32font): Add prototype.
10724
87e68db4
JB
107252011-10-27 Juanma Barranquero <lekktu@gmail.com>
10726
10727 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10728 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10729 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10730 (Fmove_to_window_line): Doc fix.
10731
435c1d67
CY
107322011-10-27 Chong Yidong <cyd@gnu.org>
10733
10734 * process.c (make_process): Set gnutls_state to NULL.
10735
10736 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10737 non-NULL, regardless of GNUTLS_INITSTAGE.
10738 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10739 an error. Set process slots as soon as we allocate them.
10740
10741 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10742
9c6c6f49
CY
107432011-10-27 Chong Yidong <cyd@gnu.org>
10744
9aba6043
SM
10745 * gnutls.c (emacs_gnutls_deinit): New function.
10746 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
10747 (Fgnutls_deinit, Fgnutls_boot): Use it.
10748
10749 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10750 (deactivate_process): Call emacs_gnutls_deinit.
10751
657d08d3
JB
107522011-10-27 Juanma Barranquero <lekktu@gmail.com>
10753
10754 * image.c (x_create_x_image_and_pixmap):
10755 * w32.c (sys_rename, w32_delayed_load):
10756 * w32font.c (fill_in_logfont):
10757 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10758
5430d399
JB
107592011-10-26 Juanma Barranquero <lekktu@gmail.com>
10760
10761 * w32fns.c (w32_default_color_map): New function,
10762 extracted from Fw32_default_color_map.
a7ef684b 10763 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 10764
fe0055fa
PE
107652011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10766
10767 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10768
e6346438
SM
107692011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10770
10771 * keyboard.c (test_undefined): New function (bug#9751).
10772 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10773
e112cc37
ET
107742011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10775
10776 * sysdep.c (init_sys_modes): Fix the check for the controlling
10777 terminal (Bug#6649).
10778
7b5d6677
EZ
107792011-10-20 Eli Zaretskii <eliz@gnu.org>
10780
10781 * dispextern.h (struct bidi_it): New member next_en_type.
10782
10783 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10784 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10785 current character, check also for next_en_type being WEAK_EN.
10786 (bidi_resolve_weak): Don't enter the expensive loop if the current
10787 position is before next_en_pos. Record the bidi type of the first
10788 non-ET, non-BN character we find, in addition to its position.
10789 (bidi_level_of_next_char): Invalidate next_en_type when
10790 next_en_pos is over-stepped.
10791
7da0b018
PE
107922011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10793
10794 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10795 * editfns.c: Rewrite current-time-zone so that it invokes
10796 the equivalent of (format-time-string "%Z") to get the time zone name.
10797 This fixes a bug when the time zone name contains characters that
10798 need converting from the system time locale to Emacs internal format.
10799 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10800 that patch fixed format-time-string to do the conversion, but
10801 I forgot to fix current-time-zone.
10802 (format_time_string): New function, containing most of
10803 what Fformat_time_string used to contain.
10804 (Fformat_time_string): Rewrite in terms of format_time_string.
10805 This doesn't change this function's behavior.
10806 (current-time-zone): Rewrite to use format_time_string.
10807 This fixes the bug reported by Michael Schierl in
10808 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10809 Jason Rumney's 2007-06-07 change worked around this bug, but
10810 didn't fix it.
10811 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10812
8547b010
EZ
108132011-10-19 Eli Zaretskii <eliz@gnu.org>
10814
10815 * xdisp.c (start_display): If the character at POS is displayed
10816 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
10817 (try_window_reusing_current_matrix): If a line ends in a display
10818 vector or the next line starts in a display vector, continue
10819 redrawing the window even though the character position of
10820 start_row was reached.
8547b010
EZ
10821 (Bug#9771, part 2)
10822
4e948d15
CY
108232011-10-18 Chong Yidong <cyd@gnu.org>
10824
10825 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10826 with nobreak-char-display too.
10827
4787455f
EZ
108282011-10-18 Eli Zaretskii <eliz@gnu.org>
10829
10830 Fix part 3 of bug#9771.
10831 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10832 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10833 non-neutral characters if the current character is a paragraph
10834 separator (a.k.a. Newline). This avoids running the same
10835 expensive loop twice, once when we consume the preceding newline
10836 and the other time when the line actually needs to be displayed.
10837 Avoid the loop when we see neutrals on the base embedding level
10838 following a character whose directionality is the same as the
10839 paragraph's. This avoids running the expensive loop when a line
10840 ends in a long sequence of neutrals, like control characters.
10841 Add assertion against STRONG_AL type. Slightly rearrange code
10842 that determines the type of a neutral given the first non-neutral
10843 that follows it.
10844 (bidi_level_of_next_char): Set next_en_pos to zero when
10845 invalidating its info.
10846
2c91f553
EZ
108472011-10-17 Eli Zaretskii <eliz@gnu.org>
10848
10849 * xdisp.c (push_display_prop): Determine whether to record string
10850 or buffer position by IT->string, not by IT->method. Allow
10851 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
10852 (move_it_vertically_backward): Don't look for character position
10853 immediately after the newline when in a continuation line.
10854 (Bug#9771, part 1)
2c91f553 10855
c7b08b0d
MR
108562011-10-15 Martin Rudalics <rudalics@gmx.at>
10857
10858 * window.c (coordinates_in_window): Rewrite and delabelize
10859 vertical border check. (Bug#5357) (Bug#9618)
10860
6b02f655
SM
108612011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10862
10863 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10864 errors in XSetWindowBorder (bug#9310).
10865
81d40c92
DA
108662011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10867
10868 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10869 avoid crash when xmalloc overrun checking is enabled.
10870
d4172c3b
EZ
108712011-10-13 Eli Zaretskii <eliz@gnu.org>
10872
10873 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10874 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10875 cursor motion with <left> and <right> arrow keys.
10876
10877 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10878 some callers set that themselves.
10879
b00eea75
EZ
108802011-10-12 Eli Zaretskii <eliz@gnu.org>
10881
10882 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10883 display string and the previous row comes from the same string and
10884 is empty. (Bug#9739) (Bug#9738)
10885
8fe012c4
SM
108862011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10887
10888 * doc.c (get_doc_string): Encode file name (bug#9735).
10889
0074aef2
EZ
108902011-10-12 Eli Zaretskii <eliz@gnu.org>
10891
79beb178
EZ
10892 * bidi.c (bidi_level_of_next_char):
10893 * xdisp.c (get_visually_first_element): Remove old incorrect
10894 comments regarding the Unicode Line Separator character.
10895
0074aef2
EZ
10896 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10897
6e4b3fbe
DA
108982011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10899
10900 * alloc.c (Fgc_status): Do not access beyond zombies array
10901 boundary if nzombies > MAX_ZOMBIES.
10902 * alloc.c (dump_zombies): Add missing format specifier.
10903
0324f3af
PE
109042011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10905
b5525cac
PE
10906 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10907 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10908
0324f3af
PE
10909 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10910 Some packages use them to denote characters with modifiers.
10911
e9b5f888
AS
109122011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10913
10914 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10915 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10916 matching a pp-number. Rename parameter var to var1.
10917
127827c0
SM
109182011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10919
10920 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10921
c8fd3bd0
GM
109222011-10-08 Glenn Morris <rgm@gnu.org>
10923
10924 * callint.c (Fcall_interactively): Give a more explicit error for the
10925 'c' case with a non-character input. (Bug#8479)
10926
352ec8ff
EZ
109272011-10-08 Eli Zaretskii <eliz@gnu.org>
10928
03669ccb
EZ
10929 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10930 lines.
7061c986
EZ
10931 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10932 lines that are hscrolled on the left.
03669ccb 10933
352ec8ff
EZ
10934 * dispnew.c (buffer_posn_from_coords): Account for a possible
10935 presence of header-line. (Bug#4426)
10936
a66cfb1c
SM
109372011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10938
6b02f655
SM
10939 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10940 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 10941
7c5ee88e
PE
109422011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10943
10944 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10945 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10946 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10947 this makes Emacs dump core during garbage collection on rare
10948 occasions. sizeof is obviously inferior to offsetof here, so
10949 stick with offsetof.
10950 (GC_POINTER_ALIGNMENT): New macro.
10951 (mark_memory): Omit 3rd (offset) arg; caller changed.
10952 Don't assume EMACS_INT alignment is the same as pointer alignment.
10953
df1bbe5b
SM
109542011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10955
10956 * keyboard.c (read_key_sequence_remapped): New var.
10957 (read_key_sequence): Compute remapping in the right buffer.
10958 (command_loop_1): Use read_key_sequence's remapping directly.
10959
51553db6
SM
109602011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10961
32c1fffd
SM
10962 * dired.c (file_name_completion): Don't expand file name.
10963 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10964 before checking file name handler.
10965
51553db6
SM
10966 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10967 they've been requested explicitly (bug#9591).
10968
b6bd1599 109692011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
10970
10971 * keymap.c (Fsingle_key_description): Use make_specified_string
10972 instead of build_string to build string from push_key_description.
10973 (Bug#5193)
10974
f701dc2a
PE
109752011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10976
4222c55d
PE
10977 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10978 This fixes a Y2038 bug on 64-bit hosts.
10979 * buffer.c (reset_buffer):
10980 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10981 (Fclear_buffer_auto_save_failure):
10982 Use 0, not -1, to represent an unset failure time, since time_t
10983 might not be signed.
10984
f701dc2a
PE
10985 Remove dependency on glibc malloc internals.
10986 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10987 Move back here from lisp.h, but with their new implementations.
10988 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10989 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10990 * charset.c (charset_table_init): New static var.
10991 (syms_of_charset): Use it instead of xmalloc. This removes a
10992 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10993 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10994 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10995 Move back to alloc.c.
10996 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10997 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10998
9ceebf39
JD
109992011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11000
11001 * nsterm.m (windowDidResize): Call x_set_window_size only when
11002 ns_in_resize is true. Otherwise set pixelwidth/height and
11003 call change_frame_size (Bug#9628).
11004
cb993c58
PE
110052011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11006
3930c88b
PE
11007 Port --enable-checking=all to Fedora 14 x86-64.
11008 * charset.c (syms_of_charset): Also account for glibc malloc's
11009 internal overhead when calculating the initial malloc maximum.
11010
cb993c58
PE
11011 Port --enable-checking=all to Fedora 14 x86.
11012 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11013 Move to lisp.h.
11014 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11015 (overrun_check_realloc, overrun_check_free):
11016 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11017 That way, xmalloc returns a properly-aligned pointer even if
11018 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11019 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11020 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11021 into account when calculating the initial malloc maximum.
11022 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11023 Move here from alloc.c, so that charset.c can use it too.
11024 Properly align; the old code wasn't right for common 32-bit hosts
11025 when configured with --enable-checking=all.
11026 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11027 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11028
31bed486
EZ
110292011-09-29 Eli Zaretskii <eliz@gnu.org>
11030
04c70788 11031 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
11032 use EDOM.
11033
fbcaa2f3
EZ
110342011-09-28 Eli Zaretskii <eliz@gnu.org>
11035
11036 * xdisp.c (compute_display_string_end): If there's no display
11037 string at CHARPOS, return -1.
11038
11039 * bidi.c (bidi_fetch_char): When compute_display_string_end
11040 returns a negative value, treat the character as a normal
11041 character not covered by a display string. (Bug#9624)
11042
a239d4e9
JB
110432011-09-28 Juanma Barranquero <lekktu@gmail.com>
11044
11045 * lread.c (Fread_from_string): Fix typo in docstring.
11046
88652fd5
EZ
110472011-09-27 Eli Zaretskii <eliz@gnu.org>
11048
11049 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11050 newline, reseat the iterator instead of bidi-iterating there one
11051 character at a time. (Bug#9610)
32c1fffd
SM
11052 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11053 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 11054
ed497dd4
AS
110552011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11056
11057 * lread.c (readevalloop): Use correct code for NBSP.
11058 (read1): Likewise. (Bug#9608)
11059
b2bf61aa
MA
110602011-09-25 Michael Albinus <michael.albinus@gmx.de>
11061
11062 * dbusbind.c (Fdbus_register_signal): When service is not
11063 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11064
32bbb17c
GM
110652011-09-25 Glenn Morris <rgm@gnu.org>
11066
11067 * buffer.c (truncate-lines): Doc fix.
11068
94e0933e
CY
110692011-09-24 Chong Yidong <cyd@stupidchicken.com>
11070
11071 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11072 (Fset_window_next_buffers): Doc fix.
11073
cddde921
GM
110742011-09-24 Glenn Morris <rgm@gnu.org>
11075
11076 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11077
1260aef1
PE
110782011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11079
25b4bfa0
PE
11080 Fix minor problems found by static checking.
11081 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
11082 * indent.c (Fvertical_motion): Fix == vs = typo.
11083
e3cbd34b
EZ
110842011-09-24 Eli Zaretskii <eliz@gnu.org>
11085
a66cfb1c
SM
11086 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11087 Default value is now t. Doc fix.
6bf7006f 11088
e3cbd34b 11089 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 11090 logic when moving up, not only when moving down. Fix the
e3cbd34b 11091 confusing name and values of the it_overshoot_expected variable;
32c1fffd 11092 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
11093
11094 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11095 CHARPOS is covered by a display string which includes newlines.
11096 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11097 is covered by a display string with embedded newlines.
11098
a3de0cbd
MA
110992011-09-24 Michael Albinus <michael.albinus@gmx.de>
11100
11101 * dbusbind.c (Fdbus_register_signal): Add match rule to
11102 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
11103 (Fdbus_register_method, Vdbus_registered_objects_table):
11104 Fix docstring.
a3de0cbd 11105
b260039d
JM
111062011-09-24 Jim Meyering <meyering@redhat.com>
11107
32c1fffd 11108 do not ignore write error for any output size
b260039d
JM
11109 The previous change was incomplete.
11110 While it makes emacs --batch detect the vast majority of stdout
11111 write failures, errors were still ignored whenever the output size is
11112 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11113 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11114 && echo FAIL: ignored write error
11115 FAIL: ignored write error
11116 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11117 && echo FAIL: ignored write error
11118 FAIL: ignored write error
11119 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11120
8eca8a7c
AS
111212011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11122
11123 * emacs.c (Fkill_emacs): In noninteractive mode exit
11124 non-successfully if a write error occurred on stdout. (Bug#9574)
11125
3341db62
EZ
111262011-09-21 Eli Zaretskii <eliz@gnu.org>
11127
11128 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11129 the xassert test.
11130
11131 * dispextern.h (struct it): Update the comment documenting what
11132 can it->OBJECT be.
11133
8c203dbf
EZ
111342011-09-20 Eli Zaretskii <eliz@gnu.org>
11135
11136 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11137 a display string, extend search for cursor position to end of row.
11138 (find_row_edges): If the row ends in a newline from a display
11139 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11140 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
11141 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11142 non-empty line. Fixes confusing cursor motion with arrow keys at
11143 the beginning of a line that starts with whitespace.
8c203dbf 11144
a4824228
LMI
111452011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11146
11147 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11148 (bug#9493).
11149
33ed493b
CY
111502011-09-18 Chong Yidong <cyd@stupidchicken.com>
11151
11152 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
11153 boolean (Bug#9154).
11154
56cd55c8
EZ
111552011-09-18 Eli Zaretskii <eliz@gnu.org>
11156
11157 * xdisp.c (display_line): Record maximum and minimum buffer
11158 positions even if no glyphs were produced (e.g., by a zero-width
11159 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
11160 buffer positions that will be removed from the glyph row because
11161 they don't fit.
c02dcedf
EZ
11162 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
11163 column is beyond frame width: don't subtract 1 "pixel" when
11164 computing width of the stretch.
3e62b7e0
EZ
11165 (reseat_at_next_visible_line_start): Undo the change made on
11166 2011-09-17 that saved paragraph information and restored it after
11167 the call to `reseat'. (Bug#9545)
56cd55c8 11168
5ed99d36 111692011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
11170
11171 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
11172 and turn window cursor on if cleared (Bug#9415).
11173
5ed99d36 111742011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
11175
11176 * search.c (boyer_moore): Take unibyte characters from pattern
11177 literally. (Bug#9458)
11178
9bade7b2
EZ
111792011-09-18 Eli Zaretskii <eliz@gnu.org>
11180
11181 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
11182
e5e9d610
PE
111832011-09-18 Paul Eggert <eggert@cs.ucla.edu>
11184
87e4427a
PE
11185 Fix minor problem found by static checking.
11186 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
11187 initialized, to pacify gcc -Wuninitialized.
11188
e5e9d610
PE
11189 * fileio.c: Report proper errno when syscall falls.
11190 (Finsert_file_contents): Save and restore errno,
11191 so that report_file_error outputs the correct diagnostic.
11192 (Fwrite_region) [CLASH_DETECTION]: Likewise.
11193
a1674f0b
EZ
111942011-09-18 Eli Zaretskii <eliz@gnu.org>
11195
11196 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
11197
fbfb6dd4
EZ
111982011-09-17 Eli Zaretskii <eliz@gnu.org>
11199
11200 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
11201 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
11202
bb187662
EZ
112032011-09-17 Eli Zaretskii <eliz@gnu.org>
11204
1137e8b8 11205 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 11206 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
11207
11208 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
11209 (bidi_find_paragraph_start): Search back for paragraph beginning
11210 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
11211 (bidi_move_to_visually_next): Only trigger paragraph-related
11212 computations when the last character is a newline or at EOB, not
11213 just any NEUTRAL_B. (Bug#9470)
11214
bb187662
EZ
11215 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
11216 truncated lines if point is covered by a display string. (Bug#9524)
11217
2e621251
PE
112182011-09-16 Paul Eggert <eggert@cs.ucla.edu>
11219
11220 * xselect.c: Relax test for outgoing X longs (Bug#9498).
11221 (cons_to_x_long): New function.
11222 (lisp_data_to_selection_data): Use it. Correct the test for
11223 short-versus-long data; it was negated. Break out of vector
11224 loop, for efficiency, when a long datum is discovered.
11225
91a15bc6
SM
112262011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
11227
11228 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
11229
b41c3a35
EZ
112302011-09-16 Eli Zaretskii <eliz@gnu.org>
11231
11232 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
11233 GCC PR/17406) by declaring this function with external scope.
11234
7812ba2d
PE
112352011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11236
11237 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
11238 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
11239
cf7edc2a
AS
112402011-09-15 Andreas Schwab <schwab@linux-m68k.org>
11241
11242 * editfns.c (Fformat): Correctly handle text properties on "%%".
11243
bd01620e
EZ
112442011-09-15 Eli Zaretskii <eliz@gnu.org>
11245
11246 * xterm.c (x_draw_composite_glyph_string_foreground):
11247 * w32term.c (x_draw_composite_glyph_string_foreground):
11248 * term.c (encode_terminal_code):
11249 * composite.c (composition_update_it, get_composition_id):
11250 * xdisp.c (get_next_display_element)
11251 (fill_composite_glyph_string): Add comments about special meaning
11252 of TAB characters in a composition.
11253
a02719a3
PE
112542011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11255
11256 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
11257 This occurs when processing a multibyte format.
11258 Problem reported by Wolfgang Jenker.
a02719a3 11259
72589a3c
JB
112602011-09-15 Johan Bockgård <bojohan@gnu.org>
11261
11262 * xdisp.c (try_cursor_movement): Only check for exact match if
11263 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
11264
1c14176c
PE
112652011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11266
11267 Remove unused external symbols.
11268 * dispextern.h (calc_pixel_width_or_height): Remove decl.
11269 * xdisp.c (calc_pixel_width_or_height): Now static.
11270 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
11271 * indent.c (check_display_width):
11272 * w32term.c: Fix comment to match code.
11273 * xterm.c, xterm.h (x_catching_errors): Remove.
11274
d2eea5b5
PE
112752011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11276
11277 * xselect.c: Use signed conversions more consistently (Bug#9498).
11278 (selection_data_to_lisp_data): Assume incoming selection data are
11279 signed integers, not unsigned. This is to be consistent with
11280 outgoing selection data, which was modified to use signed integers
11281 in as part of the fix to Bug#9196 in response to Jan D.'s comment
11282 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
11283 expects long, not unsigned long.
11284
46888499
EZ
112852011-09-14 Eli Zaretskii <eliz@gnu.org>
11286
11287 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
11288 computation of loop end. Reported by Johan Bockgård
11289 <bojohan@gnu.org>.
11290
ef8ef9fb
CY
112912011-09-13 Chong Yidong <cyd@stupidchicken.com>
11292
11293 * frame.c (Fother_visible_frames_p): Function deleted.
11294
fa819fed
EZ
112952011-09-12 Eli Zaretskii <eliz@gnu.org>
11296
11297 * indent.c (compute_motion): Process display vector front to back
11298 rather than the other way around. (Bug#2496)
11299
2ba8e008
SM
113002011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
11301
11302 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
11303
20f53c69
CY
113042011-09-11 Chong Yidong <cyd@stupidchicken.com>
11305
11306 * minibuf.c (Fread_from_minibuffer): Doc fix.
11307
d562d7a4
EZ
113082011-09-11 Eli Zaretskii <eliz@gnu.org>
11309
11310 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
11311 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
11312
1c4d7f3d
LMI
113132011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11314
11315 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
11316 value for non-existent files.
11317
b885bf36
EZ
113182011-09-11 Eli Zaretskii <eliz@gnu.org>
11319
11320 * fileio.c (Finsert_file_contents): If the file cannot be opened,
11321 set its "size" to -1. This will set the modtime_size field of
11322 the corresponding buffer to -1, which is what
11323 verify-visited-file-modtime expects for files that do not exist.
11324 (Bug#9139)
11325
6612f0bf
PE
113262011-09-11 Paul Eggert <eggert@cs.ucla.edu>
11327
11328 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
11329 here ...
11330 * lisp.h: ... from here. push_key_description is no longer
11331 defined in keyboard.c, so its declaration should not be in
11332 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
11333 logically belongs with push_key_description.
11334
dfb3f755
PE
113352011-09-10 Paul Eggert <eggert@cs.ucla.edu>
11336
11337 * buffer.h: Include <sys/types.h> instead of <time.h>.
11338 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
11339 Problem reported by Herbert J. Skuhra.
11340
3134906c
LMI
113412011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
11342
11343 * xml.c (parse_region): Make the parsing work for
11344 non-comment-starting XML files again (bug#9144).
11345
8d903f4e
AS
113462011-09-10 Andreas Schwab <schwab@linux-m68k.org>
11347
11348 * image.c (gif_load): Fix calculation of bottom and right corner.
11349 (Bug#9468)
11350
80ad64f4
EZ
113512011-09-10 Eli Zaretskii <eliz@gnu.org>
11352
11353 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
11354 redisplay in small windows.
11355
208a048d
EZ
113562011-09-09 Eli Zaretskii <eliz@gnu.org>
11357
11358 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
11359
9b1c252e
MR
113602011-09-08 Martin Rudalics <rudalics@gmx.at>
11361
11362 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
11363 Operate on live windows only.
11364
2949f33b
JB
113652011-09-08 Juanma Barranquero <lekktu@gmail.com>
11366
11367 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
11368
e08dcafd
EZ
113692011-09-07 Eli Zaretskii <eliz@gnu.org>
11370
11371 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
11372 only under bidi iteration.
11373
115b96bd
JD
113742011-09-07 Jan Djärv <jan.h.d@swipnet.se>
11375
11376 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11377
c8199d0f
PE
113782011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11379
11380 isnan: Fix porting problem to Solaris 10 with bundled gcc.
11381 Without this fix, the command to link temacs failed due to an
11382 undefined symbol __builtin_isnan. This is because
11383 /usr/include/iso/math_c99.h #defines isnan(x) to
11384 __builtin_isnan(x), but the bundled gcc, which identifies itself
11385 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11386 a __builtin_isnan.
11387 * floatfns.c (isnan): #undef, and then #define to a clone of
11388 what's in data.c.
11389 (Fisnan): Always define, since it's always available now.
11390 (syms_of_floatfns): Always define isnan at the Lisp level.
11391
e39b275c 113922011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
11393
11394 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11395
b2db44d9 113962011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 11397
f4af5137 11398 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
11399 The previous code assumed that file offsets (off_t values) fit in
11400 EMACS_INT variables, which is not true on typical 32-bit hosts.
11401 The code messed up by falsely reporting buffer overflow in cases
11402 such as (insert-file-contents "big" nil 1 2) into an empty buffer
11403 when "big" contains more than 2**29 bytes, even though this
11404 inserts just one byte and does not overflow the buffer.
11405 (Finsert_file_contents): Store file offsets as off_t
11406 values, not as EMACS_INT values. Check for overflow when
11407 converting between EMACS_INT and off_t. When checking for
11408 buffer overflow or for overlap, take the offsets into account.
11409 Don't use EMACS_INT for small values where int suffices.
11410 When checking for overlap, fix a typo: ZV was used where
11411 ZV_BYTE was intended.
11412 (Fwrite_region): Don't assume off_t fits into 'long'.
11413 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
11414
ecfc0a49
MA
114152011-09-05 Michael Albinus <michael.albinus@gmx.de>
11416
11417 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
11418
6511acf2 114192011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 11420
0999621a 11421 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
11422
11423 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 11424 (esprintf, exprintf, evxprintf): New functions.
62f19c19 11425 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 11426 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
11427 (modify_event_symbol): Do not assume that the length of
11428 name_alist_or_stem is safe to alloca and fits in int.
11429 (Fexecute_extended_command): Likewise for function name and binding.
11430 (Frecursion_depth): Wrap around reliably on integer overflow.
11431 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11432 since some callers pass EMACS_INT values.
11433 (Fsingle_key_description): Don't crash if symbol name contains more
11434 than MAX_ALLOCA bytes.
11435 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11436 (get_minibuffer): Arg is now EMACS_INT, not int.
11437 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 11438 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
11439 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11440
2be7d702
PE
11441 * dbusbind.c (signature_cat): New function.
11442 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
11443 Do not overrun buffer; instead, report string overflow.
11444
9d1df220
PE
11445 * dispnew.c (add_window_display_history): Don't overrun buffer.
11446 Truncate instead; this is OK since it's just a log.
11447
33ef5c64
PE
11448 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11449 even if the time zone offset is outlandishly large.
11450 Don't mishandle offset == INT_MIN.
11451
66c6fdd5
PE
11452 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11453 when creating daemon; the previous buffer-overflow check was incorrect.
11454
d749b01b
PE
11455 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11456 which has the guts of the old verror function.
11457
b5cd1905
PE
11458 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11459 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11460
6e1a67fb
PE
11461 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11462 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 11463 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 11464 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
11465 length of string rather than counting it via multiple sprintfs;
11466 that's simpler and more reliable.
c21721cc
PE
11467 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11468 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11469 sprintf, in case result does not fit in int.
11470
c57b67fc
PE
11471 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11472 (fontset_from_font): Print it.
11473
8a401434
PE
11474 * frame.c (tty_frame_count): Now printmax_t, not int.
11475 (make_terminal_frame, set_term_frame_name): Print it.
11476 (x_report_frame_params): In X, window IDs are unsigned long,
11477 not signed long, so print them as unsigned.
11478 (validate_x_resource_name): Check for implausibly long names,
11479 and don't assume name length fits in 'int'.
11480 (x_get_resource_string): Don't blindly alloca invocation name;
11481 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
11482 not fit in int.
11483
6e1a67fb
PE
11484 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11485 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
11486 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11487
0df02bf3
PE
11488 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11489 Use esprintf, not sprintf, in case result does not fit in int.
11490
48e30793
PE
11491 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11492 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11493 it as a large positive number.
11494 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
11495 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11496
a66ff6d8
PE
11497 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
11498 in case result does not fit in int.
11499
aca216ff
PE
11500 * print.c (float_to_string): Detect width overflow more reliably.
11501 (print_object): Make sprintf buffer a bit bigger, to avoid potential
11502 buffer overrun. Don't assume list length fits in 'int'. Treat
11503 print length of 0 as 0, not as infinity; to be consistent with other
11504 uses of print length in this function. Don't overflow print length
11505 index. Don't assume hash table size fits in 'long', or that
11506 vectorlike size fits in 'unsigned long'.
11507
31c286f7
PE
11508 * process.c (make_process): Use printmax_t, not int, to format
11509 process-name gensyms.
11510
55e5faa1
PE
11511 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
11512
80f2e268
PE
11513 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
11514 to avoid potential buffer overrun.
11515
670741ab
PE
11516 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
11517 if X resource line is longer than 512 bytes.
11518
b7163a50
PE
11519 * xfns.c (x_window): Make sprintf buffer a bit bigger
11520 to avoid potential buffer overrun.
11521
ae58ff1f
PE
11522 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
11523
c43c8a6a
PE
11524 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
11525
3f8236f4
PE
115262011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11527
53e9fe90 11528 Integer overflow fixes for scrolling, etc.
6511acf2
PE
11529 Without these, Emacs silently mishandles large integers sometimes.
11530 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
11531 it were "C-u 1 M-x recenter" on a typical 64-bit host.
11532
6511acf2
PE
11533 * xdisp.c (try_window_id): Check Emacs fixnum range before
11534 converting to 'int'.
806add1d 11535
6511acf2 11536 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
11537 Check that an Emacs fixnum is in range before assigning it to 'int'.
11538 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
11539 values converted from Emacs fixnums.
11540 (Frecenter): Don't wrap around a line count if it is out of 'int'
11541 range; instead, treat it as an extreme value.
11542 (Fset_window_configuration, compare_window_configurations):
11543 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
11544
6511acf2
PE
11545 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
11546 that can exceed INT_MAX. Check that EMACS_INT value is in range
11547 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
11548 (match_limit): Don't assume that a fixnum can fit in 'int'.
11549
6511acf2 11550 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
11551 exceed INT_MAX.
11552
6511acf2 11553 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
11554 (Fvertical_motion): Don't wrap around LINES values that don't fit
11555 in 'int'. Instead, treat them as extreme values. This is good
11556 enough for windows, which can't have more than INT_MAX lines anyway.
11557
fcb901a7
LMI
115582011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11559
0f2f6b6d
LMI
11560 * Require libxml/parser.h to avoid compilation warning.
11561
fcb901a7
LMI
11562 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11563
11564 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11565 since this reportedly can destroy thread storage.
11566
6e20a0d4
CY
115672011-08-30 Chong Yidong <cyd@stupidchicken.com>
11568
11569 * syntax.c (find_defun_start): Update all cache variables if
11570 exiting early (Bug#9401).
11571
148ae00e
EZ
115722011-08-30 Eli Zaretskii <eliz@gnu.org>
11573
f6cfbd8f
EZ
11574 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11575
148ae00e
EZ
11576 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11577 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
11578 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
11579
11580 * term.c (tty_append_glyph): New function.
11581 (produce_stretch_glyph): Static function and its prototype deleted.
11582
a66cfb1c
SM
11583 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11584 Add prototypes.
148ae00e 11585
c4a07a4c
PE
115862011-08-29 Paul Eggert <eggert@cs.ucla.edu>
11587
11588 * image.c (parse_image_spec): Check for nonnegative, not for positive,
11589 when checking :margin (Bug#9390).
11590 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 11591 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
11592 so that the name doesn't mislead. All uses changed.
11593
6bc8cd65
JB
115942011-08-28 Johan Bockgård <bojohan@gnu.org>
11595
11596 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11597 set_tty_hooks.
11598
dca4927e
EZ
115992011-08-27 Eli Zaretskii <eliz@gnu.org>
11600
11601 * xdisp.c (move_it_to): Don't bail out early when reaching
11602 position beyond to_charpos, if we are scanning backwards.
11603 (move_it_vertically_backward): When DY == 0, make sure we get to
11604 the first character in the line after the newline.
11605
f2cad773
PE
116062011-08-27 Paul Eggert <eggert@cs.ucla.edu>
11607
11608 * ccl.c: Improve and simplify overflow checking (Bug#9196).
11609 (ccl_driver): Do not generate an out-of-range pointer.
11610 (Fccl_execute_on_string): Remove unnecessary check for
11611 integer overflow, noted by Stefan Monnier in
11612 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11613 Remove a FIXME that didn't need fixing.
11614 Simplify the newly-introduced buffer reallocation code.
11615
0cae2cdb
JB
116162011-08-27 Juanma Barranquero <lekktu@gmail.com>
11617
11618 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11619
5fc295a4 116202011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 11621
70c60eb2 11622 Integer and memory overflow issues (Bug#9196).
726e0ab1 11623
d31850da
PE
11624 * doc.c (get_doc_string): Rework so that
11625 get_doc_string_buffer_size is the actual buffer size, rather than
11626 being 1 less than the actual buffer size; this makes xpalloc more
11627 convenient.
11628
a69fbedb
PE
11629 * image.c (x_allocate_bitmap_record, cache_image):
11630 * xselect.c (Fx_register_dnd_atom):
11631 Simplify previous changes by using xpalloc.
11632
fe5c5d37
PE
11633 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11634 since either will do and ptrdiff_t is convenient with xpalloc.
11635
0065d054
PE
11636 * charset.c (charset_table_size)
11637 (struct charset_sort_data.priority): Now ptrdiff_t.
11638 (charset_compare): Don't overflow if priorities differ greatly.
11639 (Fsort_charsets): Don't assume list length fits in int.
11640 Check for size-calculation overflow when allocating sort data.
11641 (syms_of_charset): Allocate an initial charset table that is
11642 just under 64 KiB, to avoid problems with glibc malloc and mmap.
11643
11644 * cmds.c (internal_self_insert): Check for size-calculation overflow.
11645
11646 * composite.h (struct composition.glyph_len): Now int, not unsigned.
11647 The actual value is always <= INT_MAX, and leaving it unsigned made
11648 overflow checking harder.
11649
11650 * dispextern.h (struct glyph_matrix.rows_allocated)
11651 (struct face_cache.size): Now ptrdiff_t, for convenience in use
11652 with xpalloc. The values are still always <= INT_MAX.
11653
11654 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
11655
11656 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
11657 (SAFE_NALLOCA): New macro.
11658
11659 * region-cache.c (struct boundary.pos, find_cache_boundary)
11660 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
11661 (set_cache_region, invalidate_region_cache)
11662 (revalidate_region_cache, know_region_cache, region_cache_forward)
11663 (region_cache_backward, pp_cache):
11664 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
11665 so that ptrdiff_t * can be passed to xpalloc.
11666 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
11667 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
11668 (pp_cache): Don't assume cache_len fits in int.
11669 * region-cache.h: Adjust extern decls to match.
11670
11671 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
11672 EMACS_INT, since either will do, for xpalloc.
11673
11674 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
11675 (xnmalloc, xnrealloc, xpalloc): New functions.
11676
726e0ab1
PE
11677 * bidi.c (bidi_shelve_header_size): New constant.
11678 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11679 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11680
51f30bc5 11681 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
11682 * buffer.c (overlays_at, overlays_in, record_overlay_string)
11683 (overlay_strings):
11684 Don't update size of array until after memory allocation succeeds,
11685 because xmalloc/xrealloc may not return.
0065d054
PE
11686 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11687 now that we have proper integer overflow checking.
11688 (record_overlay_string, overlay_strings): Catch overflows when
11689 calculating size of overlay_str_buf.
726e0ab1 11690
0065d054
PE
11691 * callproc.c (Fcall_process): Check for size overflow when
11692 calculating size of args2.
11693 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11694 Normally we prefer signed values, but sticking with ptrdiff_t would
11695 require adding more-complicated checks.
726e0ab1
PE
11696
11697 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11698 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11699 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 11700 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
11701
11702 * character.c (Fstring): Check for size-calculation overflow.
11703
11704 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11705 unnecessary integer overflow. Check for size overflow.
11706 (encode_coding_object): Don't update size until xmalloc succeeds.
11707
11708 * composite.c (get_composition_id): Check for overflow in glyph
11709 length calculations.
11710
11711 Integer and memory overflow fixes for display code.
11712 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11713 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11714 (scrolling_window): Check for overflow in size calculations.
11715 (line_draw_cost, realloc_glyph_pool, add_row_entry):
11716 Don't assume glyph table len fits in int.
11717 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11718 (row_table_size): Now ptrdiff_t, not int.
11719 (scrolling_window): Avoid overflow in size calculations.
11720 Don't update size until allocation succeeds.
11721 * fns.c (concat): Check for overflow in size calculations.
11722 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11723 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11724 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11725
11726 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11727 (get_doc_string): Check for size calculation overflow.
11728 Don't update size until allocation succeeds.
11729 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11730 EMACS_INT, where ptrdiff_t will do.
11731 (Fsubstitute_command_keys): Check for string overflow.
11732
11733 * editfns.c (set_time_zone_rule): Don't assume environment length
11734 fits in int.
11735 (message_length): Now ptrdiff_t, not int.
11736 (Fmessage_box): Don't update size until allocation succeeds.
11737 Don't assume message length fits in int.
11738 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11739
0065d054
PE
11740 * emacs.c (main): Do not reallocate argv, since there is a null at
11741 the end that can be overwritten, and this way there's no need to
11742 worry about size-calculation overflow.
11743 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
11744
11745 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11746 alloc succeeds.
11747 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11748
11749 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11750 (x_set_scroll_bar_width, x_figure_window_size):
11751 Check for integer overflow.
11752 (x_set_alpha): Do not assume XINT fits in int.
11753
11754 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11755 This is for the members text_lines, text_cols, total_lines, total_cols,
11756 where the system imposes an 'int' limit.
11757
11758 * fringe.c (Fdefine_fringe_bitmap):
11759 Don't update size until alloc works.
11760
11761 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11762 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11763
11764 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11765 Check for size-calculation overflow.
11766 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11767 do, as we prefer signed integers.
11768 (id_to_widget.max_size, id_to_widget.used)
11769 (xg_store_widget_in_map, xg_remove_widget_from_map)
11770 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11771 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11772 Use and return ptrdiff_t, not int.
11773 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11774 * gtkutil.h: Change prototypes to match the above.
11775
11776 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11777 are duplicate now that they've been promoted to lisp.h.
11778 (x_allocate_bitmap_record, x_alloc_image_color)
11779 (make_image_cache, cache_image, xpm_load):
11780 Don't update size until alloc is done.
11781 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11782 (x_detect_edges):
3256efce 11783 Check for size calculation overflow.
726e0ab1
PE
11784 (ct_colors_allocated_max): New constant.
11785 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11786 overflow.
3256efce 11787
726e0ab1
PE
11788 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11789 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11790 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11791 Use ptrdiff_t, not int, to count maps.
11792 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
11793 calculations. Don't update size until allocation succeeds.
11794 Redo calculations to avoid overflow.
726e0ab1
PE
11795 * keyboard.h: Change prototypes to match the above.
11796
11797 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11798 to count maps.
11799 (current_minor_maps): Check for size calculation overflow.
11800 * keymap.h: Change prototypes to match the above.
11801
11802 * lread.c (read1, init_obarray): Don't update size until alloc done.
11803
11804 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11805 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11806
726e0ab1
PE
11807 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11808 Now ptrdiff_t, not int.
11809 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11810 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11811
11812 * process.c (Fnetwork_interface_list): Check for overflow
11813 in size calculation.
11814
11815 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11816
11817 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11818 overflow. Don't bother calling xmalloc when xrealloc will do.
11819
11820 * search.c (Freplace_match): Check for size calculation overflow.
11821 (Fset_match_data): Don't assume list lengths fit in 'int'.
11822
11823 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11824 for command line length. Do not attempt to address one before the
11825 beginning of an array, as that's not portable.
11826
11827 * term.c (max_frame_lines): Remove; unused.
11828 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11829 not int.
11830 (encode_terminal_code, calculate_costs): Check for size
11831 calculation overflow.
11832 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11833 table lengths and related sizes. Don't update size until alloc
11834 done. Redo calculations to avoid overflow.
11835 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11836
11837 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11838 subtracting pointers.
11839 (gobble_line): Check for overflow more carefully. Don't update size
11840 until alloc done.
11841
11842 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11843 Don't update size until alloc done.
11844 Redo size calculations to avoid overflow.
11845 Check for size calculation overflow.
0065d054 11846 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
11847
11848 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11849 Use ptrdiff_t, not int, for sizes.
11850 (store_mode_line_noprop_char): Don't update size until alloc done.
11851
0065d054
PE
11852 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11853 Use ptrdiff_t, not int, for sizes.
11854 (Finternal_make_lisp_face, cache_face):
11855 Check for size calculation overflow.
11856 (cache_face): Treat size calculation overflows as if they were
11857 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
11858
11859 * xfns.c (x_encode_text, x_set_name_internal)
11860 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11861 sizes, since they can exceed INT_MAX in size. Check for size
11862 calculation overflow.
11863
0065d054
PE
11864 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11865 (xg_select): Check for size calculation overflow.
726e0ab1
PE
11866 Don't update size until alloc done.
11867
0065d054 11868 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 11869 as sprintf is limited to int lengths.
1d526e2f 11870
252c5ee1
PE
11871 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11872 (X_LONG_MIN): New macros.
864d7ce7
PE
11873 Use them to make the following changes clearer.
11874 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11875 This change doesn't affect the value now, but it may help remind
11876 future maintainers not to raise the value too much later.
11877 (SELECTION_QUANTUM): Remove, replacing with ...
11878 (selection_quantum): ... new function, which avoids overflow.
11879 All uses changed.
11880 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11881 assumption that selection length fits in 'int'.
11882 (x_reply_selection_request, x_handle_selection_request)
11883 (x_get_window_property, receive_incremental_selection)
11884 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11885 (lisp_data_to_selection_data, clean_local_selection_data):
11886 Use ptrdiff_t, not int, to record length of selection.
11887 (x_reply_selection_request, x_get_window_property)
11888 (receive_incremental_selection, x_property_data_to_lisp):
11889 Redo calculations to avoid overflow.
11890 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 11891 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
11892 something.
11893 (x_get_window_property, receive_incremental_selection)
11894 (lisp_data_to_selection_data, x_property_data_to_lisp):
11895 Check for size-calculation overflow.
11896 (x_get_window_property, receive_incremental_selection)
11897 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11898 Don't store size until memory allocation succeeds.
11899 (x_get_window_property): Plug memory leak on memory exhaustion.
11900 Don't double-block input; malloc is safe here. Don't assume 2**34
11901 - 4 fits in unsigned long. Add an xassert to check
11902 XGetWindowProperty overflow. Be more careful about overflow
11903 calculations, and distinguish size from memory overflow better.
11904 (receive_incremental_selection): When tracing, don't assume
11905 unsigned int is less than INT_MAX.
11906 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11907 harmful) conversions of unsigned short to int.
11908 (lisp_data_to_selection_data): Don't assume that integers
11909 in the range -65535 through -1 fit in an X unsigned short.
11910 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11911 result parameters unless successful. Rely on cons_to_unsigned
11912 to report problems with elements; the old code wasn't right anyway.
11913 (x_check_property_data): Check for int overflow; we cannot use
11914 a wider type due to X limits.
11915 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11916
726e0ab1 11917 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 11918
0065d054
PE
11919 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11920 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
11921 (x_color_cells): Don't store size until memory allocation succeeds.
11922 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 11923 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
11924 (x_term_init): Don't assume length fits in int (sprintf is limited
11925 to int size).
bc18e09d 11926
ebfa62c0
PE
11927 Use ptrdiff_t for composition IDs.
11928 * character.c (lisp_string_width):
11929 * composite.c (composition_table_size, n_compositions)
11930 (get_composition_id, composition_gstring_from_id):
11931 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11932 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11933 * window.c (Frecenter):
11934 Use ptrdiff_t, not int, for composition IDs.
11935 * composite.c (get_composition_id): Check for integer overflow.
11936 * composite.h: Adjust prototypes to match the above changes.
11937
d3411f89
PE
11938 Use ptrdiff_t for hash table indexes.
11939 * category.c (hash_get_category_set):
11940 * ccl.c (ccl_driver):
11941 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11942 * coding.c (coding_system_charset_list, detect_coding_system):
11943 * coding.h (struct coding_system.id):
11944 * composite.c (get_composition_id, gstring_lookup_cache):
11945 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11946 * image.c (xpm_get_color_table_h):
11947 * lisp.h (hash_lookup, hash_put):
11948 * minibuf.c (Ftest_completion):
11949 Use ptrdiff_t for hash table indexes, not int (which is too
11950 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11951 32-bit --with-wide-int hosts).
11952
e097a6fa
PE
11953 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11954 Add a FIXME comment about memory leaks.
11955 (syms_of_charset): Don't assume xmalloc returns.
11956
5637687f
PE
11957 Don't assume that stated character widths fit in int.
11958 * character.c (Fchar_width, c_string_width, lisp_string_width):
11959 * character.h (CHAR_WIDTH):
11960 * indent.c (MULTIBYTE_BYTES_WIDTH):
11961 Use sanitize_char_width to avoid undefined and/or bad behavior
11962 with outlandish widths.
a66cfb1c 11963 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
11964 now that we have two such functions. All uses changed.
11965 (sanitize_char_width): New inline function.
11966
a2271ba2
PE
11967 Don't assume that tab-width fits in int.
11968 * character.h (sanitize_width): New inline function.
11969 (SANE_TAB_WIDTH): New macro.
11970 (ASCII_CHAR_WIDTH): Use it.
11971 * indent.c (sane_tab_width): Remove. All uses replaced by
11972 SANE_TAB_WIDTH (current_buffer).
11973 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11974
18c52557
PE
11975 * fileio.c: Integer overflow issues with file modes.
11976 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11977
caeeedc1
PE
11978 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11979 Remove unreachable code.
11980 (read_hex, load_charset_map_from_file): Check for integer overflow.
11981
6df6ae42 11982 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
11983 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11984 (x_send_scroll_bar_event): Likewise. Check that the size does not
11985 exceed limits imposed by XClientMessageEvent, as well as the usual
11986 ptrdiff_t and size_t limits.
11987
b13995db
PE
11988 * keyboard.c: Overflow, signedness and related fixes.
11989 (make_lispy_movement): Use same integer type in forward decl
11990 that is used in the definition.
11991 (read_key_sequence, keyremap_step):
11992 Change bufsize argument back to int, undoing my 2011-03-30 change.
11993 We prefer signed types, and int is wide enough here.
11994 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11995 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11996 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11997 length, not size_t. Use ptrdiff_t for index, not int.
11998 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11999 possibility of integer overflow.
12000
13464394
PE
12001 Overflow, signedness and related fixes for images.
12002
12003 * dispextern.h (struct it.stack[0].u.image.image_id)
12004 (struct_it.image_id, struct image.id, struct image_cache.size)
12005 (struct image_cache.used, struct image_cache.ref_count):
12006 * gtkutil.c (update_frame_tool_bar):
12007 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12008 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12009 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12010 * nsmenu.m (update_frame_tool_bar):
12011 * xdisp.c (calc_pixel_width_or_height):
12012 * xfns.c (image_cache_refcount):
12013 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12014 on typical 64-bit hosts.
12015
12016 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12017 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12018 Omit unnecessary casts to int.
12019 (parse_image_spec): Check that integers fall into 'int' range
12020 when the callers expect that.
12021 (image_ascent): Redo ascent calculation to avoid int overflow.
12022 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12023 (lookup_image): Remove unnecessary tests.
12024 (xbm_image_p): Locals are now of int, not EMACS_INT,
12025 since parse_image_check makes sure they fit into int.
12026 (png_load, gif_load, svg_load_image):
12027 Prefer int to unsigned where either will do.
12028 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
12029 old tiff_error_handler and tiff_warning_handler.
12030 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
12031 stack buffer overflows. It uses only the features of vsnprintf
12032 that are common to both POSIX and native Microsoft.
12033 (tiff_error_handler, tiff_warning_handler): Use it.
12034 (tiff_load, gif_load, imagemagick_load_image):
12035 Don't assume :index value fits in 'int'.
12036 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12037 (imagemagick_load_image): Check that crop parameters fit into
12038 the integer types that MagickCropImage accepts. Don't assume
12039 Vimagemagick_render_type has a nonnegative value. Don't assume
12040 size_t fits in 'long'.
12041 (gs_load): Use printmax_t to print the widest integers possible.
12042 Check for integer overflow when computing image height and width.
12043
c11821d4
EZ
120442011-08-26 Eli Zaretskii <eliz@gnu.org>
12045
12046 * xdisp.c (redisplay_window): Don't force window start if point
12047 will be invisible in the resulting window. (Bug#9324)
12048
0c95fcf7
EZ
120492011-08-25 Eli Zaretskii <eliz@gnu.org>
12050
12051 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12052 the display spec is of the form `(space ...)'.
12053 (handle_display_spec): Return the value returned by
12054 handle_single_display_spec, not just 1 or zero.
12055 (handle_single_display_spec): If the display spec is of the form
12056 `(space ...)', and specifies display in the text area, return 2
12057 rather than 1.
fee65a97 12058 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
12059 accurately, and prefer exact match for point under bidi.
12060 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
12061
12062 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12063 into disp_prop; all users changed.
12064
12065 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12066 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12067 for the text covered by the display property.
12068
e4ed06f1
CY
120692011-08-25 Chong Yidong <cyd@stupidchicken.com>
12070
12071 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12072 Change return value to nil.
12073 (Frecord_buffer): Delete unused function.
12074
f67cdd7f
EZ
120752011-08-24 Eli Zaretskii <eliz@gnu.org>
12076
5980d4c6
EZ
12077 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12078 buffers, return left-to-right.
8610fe8b
EZ
12079 (set_cursor_from_row): Consider candidate row a win if its glyph
12080 represents a newline and point is on that newline. Fixes cursor
12081 positioning on the newline at EOL of R2L text within L2R
12082 paragraph, and vice versa.
12083 (try_cursor_movement): Check continued rows, in addition to
12084 continuation rows. Fixes unwarranted scroll when point enters a
12085 continued line of R2L text within an L2R paragraph, or vice versa.
12086 (cursor_row_p): Consider the case of point being equal to
12087 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12088 from the end of a short line to the beginning of a continued line
12089 of R2L text within L2R paragraph.
12090 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12091 composed characters.
5980d4c6 12092
f67cdd7f
EZ
12093 * bidi.c (bidi_check_type): Use xassert.
12094 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12095 members.
12096
bca633fb
EZ
120972011-08-23 Eli Zaretskii <eliz@gnu.org>
12098
12099 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12100 a character.
12101
4a5885a7
CY
121022011-08-23 Chong Yidong <cyd@stupidchicken.com>
12103
12104 * nsfont.m (ns_otf_to_script): Fix typo.
12105
0902a04e
KH
121062011-08-22 Kenichi Handa <handa@m17n.org>
12107
12108 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12109 extra slot even if the purpose is char-code-property-table.
12110
1a2e6670
EZ
121112011-08-23 Eli Zaretskii <eliz@gnu.org>
12112
8ddde651
EZ
12113 * xdisp.c (redisplay_window): When computing centering_position,
12114 account for the height of the header line. (Bug#8874)
12115
425cc014
EZ
12116 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12117 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12118 candidate is selected by the mouse, and that candidate has a
12119 composed character under the mouse.
12120
1a2e6670
EZ
12121 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12122 coordinates reported by pos-visible-in-window-p for a composed
12123 character in column zero.
12124
8b76d6f8
SM
121252011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12126
12127 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12128
dac347dd
EZ
121292011-08-22 Eli Zaretskii <eliz@gnu.org>
12130
12131 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12132 consider it a hit if to_charpos is anywhere in the range of the
12133 composed buffer positions.
12134
e013fb34
CY
121352011-08-22 Chong Yidong <cyd@stupidchicken.com>
12136
12137 * image.c (gif_load): Don't assume that each subimage has the same
12138 dimensions as the base image. Handle disposal method that is
12139 "undefined" by the gif spec (Bug#9335).
12140
bd1ba3e8
CY
121412011-08-20 Chong Yidong <cyd@stupidchicken.com>
12142
12143 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 12144 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 12145
54a1215b
EZ
121462011-08-19 Eli Zaretskii <eliz@gnu.org>
12147
823564e5
EZ
12148 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12149 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12150 from an Org mode buffer to a Speedbar frame.
12151
54a1215b
EZ
12152 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
12153 a composition, take its buffer position from IT->cmp_it.charpos.
12154 Fixes cursor positioning at the beginning of a line that begins
12155 with a composed character.
12156
9778ebcc
EZ
121572011-08-18 Eli Zaretskii <eliz@gnu.org>
12158
0be6ee06
EZ
12159 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
12160 character bidirectional type, use STRONG_L instead. Fixes crashes
12161 in a buffer produced by `describe-categories'.
12162
9778ebcc
EZ
12163 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
12164 members before the level stack, so they would be saved and
12165 restored when copying iterator state. Fixes incorrect reordering
12166 around TABs covered by display properties.
12167
156bffbe
AS
121682011-08-18 Andreas Schwab <schwab@linux-m68k.org>
12169
6b02f655 12170 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 12171
72ad093b
CY
121722011-08-17 Chong Yidong <cyd@stupidchicken.com>
12173
12174 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
12175 (internal_condition_case_2, internal_condition_case_n):
12176 Remove unnecessary aborts (Bug#9081).
72ad093b 12177
35774242
EZ
121782011-08-17 Eli Zaretskii <eliz@gnu.org>
12179
12180 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
12181 has no `load' handler, try opening the file locally. (Bug#9311)
12182
db76dd85
KB
121832011-08-16 Ken Brown <kbrown@cornell.edu>
12184
12185 * gmalloc.c: Expand comment.
12186
b215eee5
EZ
121872011-08-16 Eli Zaretskii <eliz@gnu.org>
12188
12189 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
12190 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
12191
a4579d33
KB
121922011-08-16 Ken Brown <kbrown@cornell.edu>
12193
12194 Fix memory allocation problems in Cygwin build (Bug#9273).
12195
12196 * unexcw.c ( __malloc_initialized): Declare external variable.
12197 (fixup_executable): Force the dumped emacs to reinitialize malloc.
12198
8b76d6f8
SM
12199 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
12200 New variables.
a4579d33
KB
12201 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
12202 dumped emacs.
12203 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
12204 in the static heap.
12205 [CYGWIN] (special_realloc): New function.
12206 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
12207 requests to realloc storage in the static heap.
12208
3ebec551
PE
122092011-08-15 Paul Eggert <eggert@cs.ucla.edu>
12210
12211 * bidi.c (bidi_initialize): Remove unused local.
12212
9fd8be00
EZ
122132011-08-15 Eli Zaretskii <eliz@gnu.org>
12214
6b02f655
SM
12215 * bidimirror.h:
12216 * biditype.h: Remove file.
12217 * makefile.w32-in ($(BLD)/bidi.$(O)):
12218 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
12219
12220 * dispextern.h: Fix a typo in the comment to bidi_type_t.
12221
12222 * chartab.c: Improve commentary for the uniprop_table API.
12223
32413314
EZ
12224 * bidi.c (bidi_paragraph_init): Support zero value of
12225 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
12226 (bidi_initialize): Use uniprop_table instead of including
12227 biditype.h and bidimirror.h.
32413314 12228
9fd8be00
EZ
12229 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
12230 coordinates of the iterator when restoring from ppos_it.
12231 (Bug#9296)
12232
5cf2b69b
KH
122332011-08-14 Kenichi Handa <handa@m17n.org>
12234
12235 * process.c (create_process): Call setup_process_coding_systems
72ad093b 12236 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 12237
daf17d00
EZ
122382011-08-14 Eli Zaretskii <eliz@gnu.org>
12239
12240 * xdisp.c (move_it_in_display_line_to): Don't invoke
12241 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
12242 ppos_it. Fixes vertical cursor motion when line beginning is
12243 covered by an image. (Bug#9296)
12244
08e3161a
JD
122452011-08-14 Jan Djärv <jan.h.d@swipnet.se>
12246
12247 * nsterm.h (ns_run_ascript): Declare.
12248 (NSAPP_DATA2_RUNASSCRIPT): Define.
12249
12250 * nsfns.m (as_script, as_result, as_status): New static variables.
12251 (ns_run_ascript): New function.
5e617bc2 12252 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
12253 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
12254 the event loop. Get status from as_status (Bug#7276).
12255
12256 * nsterm.m (sendEvent): If event is NSApplicationDefined and
12257 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
12258 the event loop (Bug#7276).
12259
a3720aa2
AS
122602011-08-14 Andreas Schwab <schwab@linux-m68k.org>
12261
12262 * gnutls.c (QCgnutls_bootprop_priority)
12263 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
12264 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
12265 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
12266 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
12267 (QCgnutls_bootprop_verify_hostname_error)
12268 (QCgnutls_bootprop_callbacks_verify): Rename from
12269 Qgnutls_bootprop_..., all uses changed.
12270
12271 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
12272 uses changed.
12273
0a0d27fb
PE
122742011-08-14 Paul Eggert <eggert@cs.ucla.edu>
12275
19d5c50c
PE
12276 * xfaces.c (Qframe_set_background_mode): Now static.
12277 * dispextern.h (Qframe_set_background_mode): Remove decl.
12278
0a0d27fb
PE
12279 * process.c (Fnetwork_interface_info): Declare local only if needed.
12280
377538cb
JD
122812011-08-13 Jan Djärv <jan.h.d@swipnet.se>
12282
12283 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
12284 (Fnetwork_interface_list): Allocate in increments of bytes instead
12285 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
12286 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
12287 sockaddr.
12288 (struct ifflag_def): notrailers is smart on OSX.
12289 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
12290 Get hardware address with getifaddrs if available.
12291
08fff70c
EZ
122922011-08-12 Eli Zaretskii <eliz@gnu.org>
12293
12294 * xdisp.c (iterate_out_of_display_property): xassert that
12295 IT->position is set to within IT->object's boundaries. Break from
12296 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
12297 when IT->position is set up wrongly due to some bug.
12298 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
12299 (push_display_prop): Allow GET_FROM_STRING as IT->method on
12300 entry. Force push_it to save on the stack the current
12301 buffer/string position, to be restored by pop_it. Fix flags in
12302 the iterator structure wrt the object coming from a display
12303 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
12304 properties. (Bug#9284)
12305
7be1c708 123062011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 12307
7be1c708
CY
12308 * fontset.c (fontset_get_font_group): Add proper type checks.
12309 (Bug#9172)
aac0c6e3 12310
7be1c708 123112011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 12312
7be1c708
CY
12313 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
12314 and LC_VERSION_MIN_MACOSX.
12315 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
12316 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 12317
97bb72a6
EZ
123182011-08-08 Eli Zaretskii <eliz@gnu.org>
12319
12320 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
12321 no-display-properties-and-no-overlays under bidi display.
12322 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 12323 properties and overlays.
97bb72a6 12324
d5617611
CY
123252011-08-08 Chong Yidong <cyd@stupidchicken.com>
12326
37e11a63
CY
12327 * editfns.c (Fset_time_zone_rule): Document relationship with the
12328 setenv function.
12329
d5617611
CY
12330 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
12331 the font entity extracted from the cache (Bug#8109).
12332
58872834
CY
123332011-08-07 Chong Yidong <cyd@stupidchicken.com>
12334
12335 * composite.c (autocmp_chars): Don't reset point. That is done by
12336 restore_point_unwind (Bug#5984).
12337
75bfc667
JL
123382011-08-07 Juri Linkov <juri@jurta.org>
12339
12340 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
12341 to show the arg `TIME' instead of `TIMEVAL'.
12342
d1410150
EZ
123432011-08-06 Eli Zaretskii <eliz@gnu.org>
12344
12345 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
12346 display property strides EOL and includes a newline, as in
12347 longlines-mode. (Bug#9254)
75b771e4
EZ
12348 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
12349 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
12350
12351 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12352 is non-zero, even if the data buffer is NULL. Fixes a crash in
12353 vertical-motion with longlines-mode. (Bug#9254)
12354
35928349
EZ
123552011-08-05 Eli Zaretskii <eliz@gnu.org>
12356
ec7cc85b
EZ
12357 * bidi.c <bidi_cache_total_alloc>: Now static.
12358 (bidi_initialize): Initialize bidi_cache_total_alloc.
12359
8b76d6f8 12360 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
12361 cache. (Bug#9221)
12362
12363 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
12364 amount allocated this far in `bidi_cache_total_alloc'.
12365 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
12366 non-zero, only free the data buffer without restoring the cache
12367 contents. All callers changed.
12368
12369 * dispextern.h (bidi_unshelve_cache): Update prototype.
12370
12371 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
12372 (move_it_in_display_line, move_it_to)
12373 (move_it_vertically_backward, move_it_by_lines): Replace the call
12374 to xfree to an equivalent call to bidi_unshelve_cache.
12375 (move_it_in_display_line_to): Fix logic of returning
412b6358 12376 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 12377
e2e2423b
EZ
123782011-08-05 Eli Zaretskii <eliz@gnu.org>
12379
12380 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12381 came from a string character with a `cursor' property. (Bug#9229)
12382
ae9e757a
JD
123832011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12384
12385 * Makefile.in (LIB_PTHREAD): New variable.
12386 (LIBES): Add LIB_PTHREAD (Bug#9216).
12387
12388 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12389 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12390
213bd7f2
AS
123912011-08-04 Andreas Schwab <schwab@linux-m68k.org>
12392
6b02f655 12393 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 12394
99aaf75f
JD
123952011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12396
12397 * xterm.c (x_find_topmost_parent): New function.
12398 (x_set_frame_alpha): Find topmost parent window with
12399 x_find_topmost_parent and set the property there also (bug#9181).
12400 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12401
c74e9d86
PE
124022011-08-04 Paul Eggert <eggert@cs.ucla.edu>
12403
12404 * callproc.c (Fcall_process): Avoid vfork clobbering
12405 the local vars buffer, coding_systems, current_dir.
12406
640c8776
SM
124072011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
12408
12409 * keymap.c (Fmake_composed_keymap): Move to subr.el.
12410
f26d0e4c
PE
124112011-08-03 Paul Eggert <eggert@cs.ucla.edu>
12412
8a10d76c
PE
12413 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
12414 so that it is not optimized away.
12415
f26d0e4c
PE
12416 * xdisp.c (compute_display_string_pos): Remove unused local.
12417
55439c61
EZ
124182011-08-02 Eli Zaretskii <eliz@gnu.org>
12419
12420 Fix slow cursor motion and scrolling in large buffers with
12421 selective display, like Org Mode buffers. (Bug#9218)
12422
12423 * dispextern.h (struct bidi_it): New member disp_prop_p.
12424
12425 * xdisp.c: Remove one-slot cache of display string positions.
12426 (compute_display_string_pos): Accept an additional argument
5e617bc2 12427 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
12428 for a display string or property. If found, set DISP_PROP_P
12429 non-zero.
12430
12431 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
12432 DISP_PROP_P, and pass it to compute_display_string_pos.
12433 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
12434 non-zero. All callers of bidi_fetch_char changed.
12435
fb33fa43
SM
124362011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
12437
12438 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12439
b099e063
DM
124402010-12-03 Don March <don@ohspite.net>
12441
12442 * keymap.c (Fdefine_key): Fix non-prefix key error message when
12443 last character M-[char] is translated to ESC [char] (bug#7541).
12444
5cc7f7af
KH
124452011-08-02 Kenichi Handa <handa@m17n.org>
12446
d0fffa3f 12447 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
12448
12449 * chartab.c (uniprop_table): Make it non-static.
12450
525d5e6e
EZ
124512011-08-01 Eli Zaretskii <eliz@gnu.org>
12452
12453 * xdisp.c (forward_to_next_line_start): Accept additional argument
12454 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12455 on the newline.
12456 (reseat_at_next_visible_line_start): Use the bidi iterator state
12457 returned by forward_to_next_line_start to restore the state of
12458 it->bidi_it after backing up to previous newline. (Bug#9212)
12459
31011111
AS
124602011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12461
12462 * regex.c (re_comp): Protoize.
12463 (re_exec): Fix return type.
12464 (regexec): Fix type of `ret'. (Bug#9203)
12465
476371c4
PE
124662011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12467
e5d76069
PE
12468 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12469 This is needed if max-image-size is a floating-point number.
12470
9a79b20c
AS
124712011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12472
12473 * print.c (print_object): Print empty symbol as ##.
12474
12475 * lread.c (read1): Read ## as empty symbol.
12476
d8c2fa78
AA
124772011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12478
12479 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12480 setting frame foreground color (Bug#9175).
12481 (x_set_background_color): Likewise.
12482
ffe57a7a
AA
12483 * nsmenu.m (-setText): Size tooltip dimensions precisely to
12484 contents (Bug#9176).
12485 (EmacsTooltip -init): Remove bezels and add shadows to
12486 tooltip windows.
12487
bf3492a5
AA
12488 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12489 or scroll bar (Bug#8470).
12490
d55e9c53
AA
12491 * nsfont.m (nsfont_open): Remove assignment to voffset and
12492 unnecessary vars hshink, expand, hd, full_height, min_height.
12493 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12494
12495 * nsterm.h (nsfont_info): Remove voffset field.
12496
d8c2fa78 124972011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
12498
12499 Implement strike-through and overline on NextStep (Bug#8863).
12500
12501 * nsfont.m (nsfont_open): Use underline position provided by font,
12502 instead of hard-coded value of 2.
12503 (nsfont_draw): Call ns_draw_text_decoration instead.
12504
12505 * nsterm.h: Add declaration for ns_draw_text_decoration.
12506
12507 * nsterm.m (ns_draw_text_decoration): New function for drawing
12508 underline, overline, and strike-through.
12509 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
12510 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 12511 accommodate underlining, etc.
4843aac3 12512
4cc60b9b
EZ
125132011-07-28 Eli Zaretskii <eliz@gnu.org>
12514
bc7ece87
EZ
12515 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
12516 default.
4cc60b9b 12517
476371c4
PE
125182011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12519
66606eea
PE
12520 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
12521 Without this fix, if a signal arrives just after memory fills up,
12522 'malloc' might be invoked reentrantly.
12523
476371c4
PE
12524 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
12525 In other words, assume that every image size is allowed, on non-X
12526 hosts. This assumption is probably wrong, but it lets Emacs compile.
12527
f3fcc40d
AS
125282011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12529
12530 * regex.c (re_iswctype): Convert return values to boolean.
12531
350c992f
EZ
125322011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
12533
12534 * xdisp.c (compute_display_string_pos): Don't use cached display
12535 string position if the buffer had its restriction changed.
12536 (Bug#9184)
12537
5266b4bb
PE
125382011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12539
12540 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12541
2573a837 125422011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 12543
41f55ccd 12544 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 12545
39e378da
PE
12546 * bidi.c: Integer size and overflow fixes.
12547 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
12548 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
12549 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12550 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
12551 (bidi_find_other_level_edge):
12552 Use ptrdiff_t instead of EMACS_INT where either will do.
12553 This works better on 32-bit hosts configured --with-wide-int.
12554 (bidi_cache_ensure_space): Check for size-calculation overflow.
12555 Use % rather than repeated addition, for better worst-case speed.
12556 Don't set bidi_cache_size until after xrealloc returns, because it
12557 might not return.
12558 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
12559 (bidi_cache_ensure_space): Also check that the bidi cache size
12560 does not exceed that of the largest Lisp string or buffer. See Eli
12561 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 12562
5e927815
PE
12563 * alloc.c (__malloc_size_t): Remove.
12564 All uses replaced by size_t. See Andreas Schwab's note
12565 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12566
ca4aa935
PE
12567 * image.c: Improve checking for integer overflow.
12568 (check_image_size): Assume that f is nonnull, since
12569 it is always nonnull in practice. This is one less thing to
12570 worry about when checking for integer overflow later.
12571 (x_check_image_size): New function, which checks for integer
12572 overflow issues inside X.
12573 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12574 This removes the need for a memory_full check.
12575 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12576 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12577 (xbm_read_bitmap_data): Change locals back to 'int', since
12578 their values must fit in 'int'.
12579 (xpm_load_image, png_load, tiff_load):
12580 Invoke x_create_x_image_and_pixmap earlier,
12581 to avoid much needless work if the image is too large.
12582 (tiff_load): Treat overly large images as if
12583 x_create_x_image_and_pixmap failed, not as malloc failures.
12584 (gs_load): Use x_check_image_size.
12585
5f8f9cc2
PE
12586 * gtkutil.c: Omit integer casts.
12587 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12588 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12589
5adf60bc
PE
12590 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12591
c8907a93
PE
12592 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12593 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12594 would wrongly return t on a 64-bit host.
12595
e3c25c68
PE
12596 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12597 The plain *_OVERFLOW macros run afoul of GCC bug 49705
12598 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12599 and therefore cause GCC to emit a bogus diagnostic in some cases.
12600
3f791afe
PE
12601 * image.c: Integer signedness and overflow and related fixes.
12602 This is not an exhaustive set of fixes, but it's time to
12603 record what I've got.
12604 (lookup_pixel_color, check_image_size): Remove redundant decls.
12605 (check_image_size): Don't assume that arbitrary EMACS_INT values
12606 fit in 'int', or that arbitrary 'double' values fit in 'int'.
12607 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12608 (tiff_load, imagemagick_load_image):
12609 Check for overflow in size calculations.
12610 (x_create_x_image_and_pixmap): Remove unnecessary test for
12611 xmalloc returning NULL; that can't happen.
12612 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12613 (xpm_color_bucket): Use better integer hashing function.
12614 (xpm_cache_color): Don't possibly over-allocate memory.
12615 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12616 (gif_memory_source):
12617 Use ptrdiff_t, not int or size_t, to record sizes.
12618 (png_load): Don't assume values greater than 2**31 fit in 'int'.
12619 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12620 either works, as we prefer signed integers.
12621 (tiff_read_from_memory, tiff_write_from_memory):
12622 Return tsize_t, not size_t, since that's what the TIFF API wants.
12623 (tiff_read_from_memory): Don't fail simply because the read would
12624 go past EOF; instead, return a short read.
12625 (tiff_load): Omit no-longer-needed casts.
12626 (Fimagemagick_types): Don't assume size fits into 'int'.
12627
3cc5a532
PE
12628 Improve hashing quality when configured --with-wide-int.
12629 * fns.c (hash_string): New function, taken from sxhash_string.
12630 Do not discard information about ASCII character case; this
12631 discarding is no longer needed.
12632 (sxhash-string): Use it. Change sig to match it. Caller changed.
12633 * lisp.h: Declare it.
12634 * lread.c (hash_string): Remove, since we now use fns.c's version.
12635 The fns.c version returns a wider integer if --with-wide-int is
12636 specified, so this should help the quality of the hashing a bit.
12637
b312a492
PE
12638 * emacs.c: Integer overflow minor fix.
12639 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
12640 Define only if GNU_LINUX.
12641 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12642
dfd153ae
PE
12643 * dispnew.c: Integer signedness and overflow fixes.
12644 Remove unnecessary forward decls, that were a maintenance hassle.
12645 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12646 All uses changed.
12647 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
12648 (scrolling_window): Use ptrdiff_t, not int, for byte count.
12649 (prepare_desired_row, line_draw_cost):
12650 Use int, not unsigned, where either works.
12651 (save_current_matrix, restore_current_matrix):
12652 Use ptrdiff_t, not size_t, where either works.
12653 (init_display): Check for overflow more accurately, and without
12654 relying on undefined behavior.
12655
a81d11a3
PE
12656 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
12657 Remove, replacing with the new symbols in lisp.h. All uses changed.
12658 * fileio.c (make_temp_name):
12659 * filelock.c (lock_file_1, lock_file):
12660 * xdisp.c (message_dolog):
12661 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
12662 Use pMd etc. instead.
12663 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
12664 replacing the pWIDE etc. symbols removed from editfns.c.
12665
3300e6fd
PE
12666 * keyboard.h (num_input_events): Now uintmax_t.
12667 This is (very slightly) less likely to mess up due to wraparound.
12668 All uses changed.
12669
fd05c7e9
PE
12670 * buffer.c: Integer signedness fixes.
12671 (alloc_buffer_text, enlarge_buffer_text):
12672 Use ptrdiff_t rather than size_t when either will do, as we prefer
12673 signed integers.
12674
903fe15d
PE
12675 * alloc.c: Integer signedness and overflow fixes.
12676 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
12677 (__malloc_size_t): Default to size_t, not to int.
12678 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12679 (Fgarbage_collect, mark_object_loop_halt, mark_object):
12680 Prefer ptrdiff_t to size_t when either would do, as we prefer
12681 signed integers.
12682 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12683 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12684 Now const. Initialize with values that are in range even if char
12685 is signed.
12686 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12687 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
12688 These functions do the right thing with sizes > 2**32.
12689 (check_depth): Now ptrdiff_t, not int.
12690 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12691 Adjust to new way of storing sizes. Check for size overflow bugs
12692 in rest of code.
12693 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
12694 slightly wrong anyway, as it missed one instance of
12695 XMALLOC_OVERRUN_CHECK_OVERHEAD.
12696 (refill_memory_reserve): Omit needless cast to size_t.
12697 (mark_object_loop_halt): Mark as externally visible.
12698
ac82cc6a
PE
12699 * xselect.c: Integer signedness and overflow fixes.
12700 (Fx_register_dnd_atom, x_handle_dnd_message):
12701 Use ptrdiff_t, not size_t, since we prefer signed.
12702 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12703 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12704 x_dnd_atoms_size and x_dnd_atoms_length.
12705
c2d1e36d
PE
12706 * doprnt.c: Prefer signed to unsigned when either works.
12707 * eval.c (verror):
12708 * doprnt.c (doprnt):
12709 * lisp.h (doprnt):
12710 * xdisp.c (vmessage):
12711 Use ptrdiff_t, not size_t, when using or implementing doprnt,
12712 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12713 prefer signed arithmetic to avoid comparison confusion.
12714 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12715 but is a bit tricky.
12716
0e926e56
PE
12717 Assume freestanding C89 headers, string.h, stdlib.h.
12718 * data.c, doprnt.c, floatfns.c, print.c:
12719 Include float.h unconditionally.
12720 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12721 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12722 * regex.c: Likewise for stddef.h, string.h.
12723 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12724 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12725 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12726 (STDC_HEADERS): Remove obsolete defines.
12727 * sysdep.c: Include limits.h unconditionally.
12728
9cfdb3ec
PE
12729 Assume support for memcmp, memcpy, memmove, memset.
12730 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12731 * regex.c (memcmp, memcpy):
12732 Remove; we assume C89 now.
12733
12734 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12735 (__malloc_safe_bcopy): Remove; no longer needed.
12736
cf950e6b 12737 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
12738 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12739 well either way, and we prefer signed to unsigned.
12740
dbf38e02
LMI
127412011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12742
12743 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12744 closes the connection while we're reading (bug#9182).
12745
d6f0886c 127462011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 12747
d6f0886c
JD
12748 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12749 are specified (Bug#9168).
24e0f6b1 12750
2eb1f9e6
PE
127512011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12752
12753 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12754 Found by GCC static checking and --with-wide-int on a 32-bit host.
12755
22381272 127562011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
12757
12758 * xdisp.c (compute_display_string_pos): Fix logic of caching
12759 previous display string position. Initialize cached_prev_pos to
12760 -1. Fixes slow-down at the beginning of a buffer.
12761
f25e39b4
EZ
127622011-07-24 Eli Zaretskii <eliz@gnu.org>
12763
12764 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12765 for attrs[LFACE_FONTSET_INDEX].
12766
04c4b52e
PE
127672011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12768
12769 * xml.c (parse_region): Remove unused local
12770 that was recently introduced.
12771
c1734fbd
EZ
127722011-07-23 Eli Zaretskii <eliz@gnu.org>
12773
be18c5a5
EZ
12774 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12775 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12776
c1734fbd
EZ
12777 * xdisp.c (move_it_in_display_line_to): Record the best matching
12778 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
12779 exit if none of the characters scanned was an exact match.
12780 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
12781 when exact match is impossible due to invisible text, and the
12782 lines are truncated.
12783
a258d627
JD
127842011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12785
12786 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12787 for OSX >= 10.7.
12788
b6d5a689
EZ
127892011-07-22 Eli Zaretskii <eliz@gnu.org>
12790
0f74f785
EZ
12791 Fix a significant slow-down of cursor motion with C-n, C-p,
12792 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12793 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 12794 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
12795 (next_element_from_buffer): Call compute_stop_pos_backwards to
12796 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
12797 base_level_stop.
12798 (reseat): Don't look for prev_stop, as that could mean a very long
12799 run.
12800 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12801 <cached_disp_overlay_modiff>: Cache for last found display string
12802 position.
551918c1 12803 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
12804 about the same buffer in the same area of character positions, and
12805 the buffer wasn't changed since the time the display string
12806 position was cached.
551918c1 12807
b2d0c91a
EZ
128082011-07-22 Eli Zaretskii <eliz@gnu.org>
12809
12810 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12811 is an integer, which is important for empty lines. (Bug#9149)
12812
043604ee
CY
128132011-07-22 Chong Yidong <cyd@stupidchicken.com>
12814
12815 * frame.c (Fmodify_frame_parameters): In tty case, update the
12816 default face if necessary (Bug#4238).
12817
da4adb04
CY
128182011-07-21 Chong Yidong <cyd@stupidchicken.com>
12819
12820 * editfns.c (Fstring_to_char): No need to explain what a character
12821 is in the docstring (Bug#6576).
12822
9abd0532
LMI
128232011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12824
12825 * xml.c (parse_region): Make sure we always return a tree.
12826
36881d16
HK
128272011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12828
12829 * xml.c (parse_region): If a document contains only comments,
12830 return that, too.
12831
1e98674d
LMI
128322011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12833
12834 * xml.c (make_dom): Return comments, too.
12835
590bd467
PE
128362011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12837
12838 Port to OpenBSD.
12839 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12840 and the surrounding thread.
12841 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12842 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12843 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12844 timer goes off.
12845 * s/openbsd.h (BROKEN_SIGIO): Define.
12846 * unexelf.c (unexec) [__OpenBSD__]:
12847 Don't update the .mdebug section of the Alpha COFF symbol table.
12848
f41628b2
LMI
128492011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12850
12851 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12852 (bug#8460).
12853
b59b67c5
PE
128542011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12855
15e3a074
PE
12856 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12857 This fixes some race conditions on the permissions of any newly
12858 created file.
12859
41bed37d
PE
12860 * alloc.c (valid_pointer_p): Use pipe, not open.
12861 This fixes some permissions issues when debugging.
12862
b59b67c5
PE
12863 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12864 If fchown fails to set both uid and gid, try to set just gid,
12865 as that is sometimes allowed. Adjust the file's mode to eliminate
12866 setuid or setgid bits that are inappropriate if fchown fails.
12867
925a6be7
SM
128682011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12869
12870 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12871 to compare Lisp_Objects.
12872 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12873 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12874 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12875
52968808
AS
128762011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12877
0a6a104b
AS
12878 * lread.c (read_integer): Unread even EOF character.
12879 (read1): Likewise. Properly record start position of symbol.
12880
52968808
AS
12881 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12882 symbol character follows.
12883
9e381cdd
PE
128842011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12885
12886 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12887 This works around a problem with the previous change to Fcopy_file.
12888 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12889 and without this change, GCC might complain about discarding
12890 fchown's return value.
12891
b5641435
JB
128922011-07-16 Juanma Barranquero <lekktu@gmail.com>
12893
12894 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12895
a8031457
PE
128962011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12897
12898 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12899
dd889327
LMI
129002011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12901
750c33f7
LMI
12902 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12903 it's used from the C level.
12904
dd889327
LMI
12905 * process.c: Use the same condition for POLL_FOR_INPUT in both
12906 keyboard.c and process.c (bug#1858).
12907
87e86684
LM
129082011-07-09 Lawrence Mitchell <wence@gmx.li>
12909
12910 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12911 (Fgnutls_boot): Use it.
12912
64348f40
AS
129132011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12914
12915 * doc.c (Fsubstitute_command_keys): Revert last change.
12916
1d698799
LMI
129172011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12918
f863868c
LMI
12919 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12920 quotes the next character, and doesn't affect other longer
12921 sequences (bug#8935).
12922
1d698799
LMI
12923 * lread.c (syms_of_lread): Clarify that is isn't only
12924 `eval-buffer' and `eval-defun' that's affected by
12925 `lexical-binding' (bug#8460).
12926
aa4b6df6
EZ
129272011-07-15 Eli Zaretskii <eliz@gnu.org>
12928
12929 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 12930 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 12931
5d856da6
PE
129322011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12933
ad6042bb
PE
12934 Fix minor problems found by static checking.
12935 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12936 (elsz): Now a signed constant, not a size_t var. We prefer signed
12937 types to unsigned, to avoid integer comparison confusion. Without
12938 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12939 "cannot optimize loop, the loop counter may overflow", a symptom
12940 of the confusion.
f00bbb22 12941 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
12942 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12943
6468f31c
LMI
129442011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12945
49080b10
LMI
12946 * search.c (Fre_search_backward): Mention `case-fold-search' in
12947 all the re_search_* functions (bug#8138).
12948
6468f31c
LMI
12949 * keyboard.c (Fopen_dribble_file): Document when the file is
12950 closed (bug#8056).
12951
c965adc5
EZ
129522011-07-14 Eli Zaretskii <eliz@gnu.org>
12953
df9733bf
EZ
12954 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12955 bidi_cache_idx.
12956
0bb23927
EZ
12957 Support bidi reordering of display and overlay strings.
12958 * xdisp.c (compute_display_string_pos)
12959 (compute_display_string_end): Accept additional argument STRING.
12960 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12961 (reseat_to_string): Initialize bidi_it->string.s and
12962 bidi_it->string.schars.
12963 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
12964 NULL (avoids a crash in bidi_paragraph_init).
12965 Initialize itb.string.lstring.
0bb23927
EZ
12966 (init_iterator): Call bidi_init_it only of a valid
12967 buffer position was specified. Initialize paragraph_embedding to
12968 L2R.
12969 (reseat_to_string): Initialize the bidi iterator.
12970 (display_string): If we need to ignore text properties of
12971 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12972 original value of -1 will not work with bidi.)
12973 (compute_display_string_pos): First arg is now struct
12974 `text_pos *'; all callers changed. Support display properties on
12975 Lisp strings.
12976 (compute_display_string_end): Support display properties on Lisp
12977 strings.
12978 (init_iterator, reseat_1, reseat_to_string): Initialize the
12979 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12980 when iterating on a string not from display properties).
640c8776
SM
12981 (compute_display_string_pos, compute_display_string_end):
12982 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
12983 arrow keys.
12984 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
12985 base_level_stop; instead, set base_level_stop to BEGV.
12986 Fixes crashes in vertical-motion.
0bb23927
EZ
12987 (next_element_from_buffer): Improve commentary for when
12988 the iterator is before prev_stop.
12989 (init_iterator): Initialize bidi_p from the default value of
12990 bidi-display-reordering, not from buffer-local value. Use the
12991 buffer-local value only if initializing for buffer iteration.
12992 (handle_invisible_prop): Support invisible properties on strings
12993 that are being bidi-reordered.
12994 (set_iterator_to_next): Support bidi reordering of C strings and
12995 Lisp strings.
12996 (next_element_from_string): Support bidi reordering of Lisp
12997 strings.
12998 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
12999 (display_string): Support display of R2L glyph rows.
13000 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
13001 (init_iterator): Don't initialize it->bidi_p for strings
13002 here.
13003 (reseat_to_string): Initialize it->bidi_p for strings here.
13004 (next_element_from_string, next_element_from_c_string)
13005 (next_element_from_buffer): Add xassert's for correspondence
13006 between IT's object being iterated and it->bidi_it.string
13007 structure.
13008 (face_before_or_after_it_pos): Support bidi iteration.
13009 (next_element_from_c_string): Handle the case of the first string
13010 character that is not the first one in the visual order.
13011 (get_visually_first_element): New function, refactored from common
13012 parts of next_element_from_buffer, next_element_from_string, and
13013 next_element_from_c_string.
13014 (tool_bar_lines_needed, redisplay_tool_bar)
13015 (display_menu_bar): Force left-to-right direction. Add a FIXME
13016 comment for making that be controlled by a user option.
13017 (push_it, pop_it): Save and restore the state of the
13018 bidi iterator. Save and restore the bidi_p flag.
13019 (pop_it): Iterate out of display property for string iteration as
13020 well.
13021 (iterate_out_of_display_property): Support iteration over strings.
13022 (handle_single_display_spec): Set up it->bidi_it for iteration
13023 over a display string, and call bidi_init_it.
13024 (handle_single_display_spec, next_overlay_string)
13025 (get_overlay_strings_1, push_display_prop): Set up the bidi
13026 iterator for displaying display or overlay strings.
13027 (forward_to_next_line_start): Don't use the shortcut if
13028 bidi-iterating.
13029 (back_to_previous_visible_line_start): If handle_display_prop
13030 pushed the iterator stack, restore the internal state of the bidi
13031 iterator by calling bidi_pop_it same number of times.
13032 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13033 and we are bidi-iterating, don't decrement the iterator position;
13034 instead, set the first_elt flag in the bidi iterator, to produce
13035 the same effect.
13036 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13037 (push_display_prop): xassert that we are iterating a buffer.
13038 (push_it, pop_it): Save and restore paragraph_embedding member.
13039 (handle_single_display_spec, next_overlay_string)
13040 (get_overlay_strings_1, reseat_1, reseat_to_string)
13041 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13042 correctly. Don't assume unibyte strings are not bidi-reordered.
13043 (compute_display_string_pos)
13044 (compute_display_string_end): Fix handling the case of C string.
13045 (push_it, pop_it): Save and restore from_disp_prop_p.
13046 (handle_single_display_spec, push_display_prop): Set the
13047 from_disp_prop_p flag.
13048 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13049 (pop_it): Call iterate_out_of_display_property only if we are
13050 popping after iteration over a string that came from a display
13051 property. Fix a typo in popping stretch info. Add an assertion
13052 for verifying that the iterator position is in sync with the bidi
13053 iterator.
13054 (handle_single_display_spec, get_overlay_strings_1)
13055 (push_display_prop): Fix initialization of paragraph direction for
13056 string when that of the parent object is not yet determined.
13057 (reseat_1): Call bidi_init_it to resync the bidi
13058 iterator with IT's position. (Bug#7616)
13059 (find_row_edges): If ROW->start.pos gives position
13060 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13061 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13062 Reset the from_disp_prop_p flag.
13063 (SAVE_IT, RESTORE_IT): New macros.
13064 (pos_visible_p, face_before_or_after_it_pos)
13065 (back_to_previous_visible_line_start)
13066 (move_it_in_display_line_to, move_it_in_display_line)
13067 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13068 (try_scrolling, redisplay_window, display_line): Use them when
13069 saving a temporary copy of the iterator and restoring it back.
13070 (back_to_previous_visible_line_start, reseat_1)
13071 (init_iterator): Empty the bidi cache "stack".
13072 (move_it_in_display_line_to): If iterator ended up at
13073 EOL, but we never saw any buffer positions smaller than
13074 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13075 motion in bidi-reordered lines.
13076 (move_it_in_display_line_to): Record prev_method and prev_pos
13077 immediately before the call to set_iterator_to_next. Fixes cursor
13078 motion in bidi-reordered lines with stretch glyphs and strings
13079 displayed in margins. (Bug#8133) (Bug#8867)
13080 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13081 TO_CHARPOS.
640c8776
SM
13082 (pos_visible_p): Support positions in bidi-reordered lines.
13083 Save and restore bidi cache.
0bb23927
EZ
13084
13085 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13086 (bidi_paragraph_info): Delete unused struct.
13087 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13088 (bidi_cache_start): New variable.
13089 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13090 to zero.
13091 (bidi_cache_fetch_state, bidi_cache_search)
13092 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13093 (bidi_cache_find, bidi_peek_at_next_level)
13094 (bidi_level_of_next_char, bidi_find_other_level_edge)
13095 (bidi_move_to_visually_next): Compare cache index with
13096 bidi_cache_start rather than with zero.
13097 (bidi_fetch_char): Accept new argument STRING; all callers
13098 changed. Support iteration over a string. Support strings with
13099 display properties. Support unibyte strings. Fix the type of
13100 `len' according to what STRING_CHAR_AND_LENGTH expects.
13101 (bidi_paragraph_init, bidi_resolve_explicit_1)
13102 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
13103 (bidi_level_of_next_char, bidi_move_to_visually_next):
13104 Support iteration over a string.
0bb23927
EZ
13105 (bidi_set_sor_type, bidi_resolve_explicit_1)
13106 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13107 can now be zero (for strings); special values 0 and -1 were
13108 changed to -1 and -2, respectively.
13109 (bidi_char_at_pos): New function.
13110 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13111 Call it instead of FETCH_MULTIBYTE_CHAR.
13112 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13113 initialized to valid values.
13114 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13115 values.
13116 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13117 the test for valid cached positions. Fix the logic for looking up
13118 the sentinel state in the cache. GCPRO the Lisp string we are
13119 iterating.
13120 (bidi_push_it, bidi_pop_it): New functions.
13121 (bidi_initialize): Initialize the bidi cache start stack pointer.
13122 (bidi_cache_ensure_space): New function, refactored from part of
13123 bidi_cache_iterator_state. Don't assume the required size is just
13124 one BIDI_CACHE_CHUNK away.
13125 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13126 (bidi_count_bytes, bidi_char_at_pos): New functions.
13127 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13128 always valid if bidi_cache_idx is valid.
13129 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13130 is valid if it's going to be used.
13131 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13132 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
13133 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13134 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
13135 (bidi_find_other_level_edge, bidi_cache_start_stack):
13136 All variables related to cache indices are now EMACS_INT.
c965adc5 13137
0bb23927
EZ
13138 * dispextern.h (struct bidi_string_data): New structure.
13139 (struct bidi_it): New member `string'. Make flag members be 1-bit
13140 fields, and put them last in the struct.
640c8776
SM
13141 (compute_display_string_pos, compute_display_string_end):
13142 Update prototypes.
0bb23927
EZ
13143 (bidi_push_it, bidi_pop_it): Add prototypes.
13144 (struct iterator_stack_entry): New members bidi_p,
13145 paragraph_embedding, and from_disp_prop_p.
13146 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
13147 (bidi_shelve_cache, bidi_unshelve_cache):
13148 Declare prototypes.
0bb23927
EZ
13149
13150 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13151 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
13152 and vector-like objects.
13153
13154 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
13155 cache around display iteration.
13156
13157 * window.c (Fwindow_end, window_scroll_pixel_based)
13158 (displayed_window_lines, Frecenter): Save and restore the bidi
13159 cache around display iteration.
13160
3bbd2265
LMI
131612011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13162
13163 * editfns.c (Fdelete_region): Clarify the use of the named
13164 parameters (bug#6788).
13165
adc47434
MR
131662011-07-14 Martin Rudalics <rudalics@gmx.at>
13167
13168 * indent.c (Fvertical_motion): Set and restore w->pointm when
13169 saving and restoring the window's buffer (Bug#9006).
13170
837c31f8
LMI
131712011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13172
13173 * editfns.c (Fstring_to_char): Clarify just what is returned
13174 (bug#6576). Text by Eli Zaretskii.
13175
ac389d0c
JB
131762011-07-13 Juanma Barranquero <lekktu@gmail.com>
13177
13178 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
13179
0be0ce47
EZ
131802011-07-13 Eli Zaretskii <eliz@gnu.org>
13181
13182 * buffer.c (mmap_find): Fix a typo.
13183
cd18e7e3
JB
131842011-07-13 Johan Bockgård <bojohan@gnu.org>
13185
13186 Fix execution of x selection hooks.
13187 * xselect.c (Qx_lost_selection_functions)
13188 (Qx_sent_selection_functions): New vars.
13189 (syms_of_xselect): DEFSYM them.
13190 (x_handle_selection_request): Pass Qx_sent_selection_functions
13191 rather than Vx_sent_selection_functions to Frun_hook_with_args.
13192 (x_handle_selection_clear,x_clear_frame_selections):
13193 Pass Qx_lost_selection_functions rather than
13194 Vx_lost_selection_functions to Frun_hook_with_args.
13195
47ea7f44
PE
131962011-07-13 Paul Eggert <eggert@cs.ucla.edu>
13197
ac389d0c 13198 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
13199 The old code sometimes used this field without initializing it.
13200
47ea7f44
PE
13201 * alloc.c (gc_sweep): Don't read past end of array.
13202 In theory, the old code could also have corrupted Emacs internals,
13203 though it'd be very unlikely.
13204
bc985c87
AS
132052011-07-12 Andreas Schwab <schwab@linux-m68k.org>
13206
13207 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 13208 argument. (Bug#4026)
bc985c87 13209
0cf34688
LMI
132102011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
13211
b3dadd76
LMI
13212 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
13213 key" (bug#4257).
13214
0cf34688
LMI
13215 * window.c (Fset_window_start): Doc fix (bug#4199).
13216 (Fset_window_hscroll): Ditto.
13217
270768cd
PE
132182011-07-12 Paul Eggert <eggert@cs.ucla.edu>
13219
077e3dda 13220 Fix minor new problems caught by GCC 4.6.1.
270768cd 13221 * term.c (init_tty): Remove unused local.
490011a6 13222 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 13223 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 13224 not used otherwise.
270768cd 13225
b1f58454
CY
132262011-07-12 Chong Yidong <cyd@stupidchicken.com>
13227
13228 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
13229
22b9578d
LMI
132302011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13231
6e70ab07
LMI
13232 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
13233 are the mini-buffer and the echo area (bug#3320).
13234
22b9578d
LMI
13235 * term.c (init_tty): Remove support for supdup, c10 and perq
13236 terminals, which are no longer supported (bug#1482).
13237
8974cc9f
JB
132382011-07-10 Johan Bockgård <bojohan@gnu.org>
13239
13240 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
13241
a560d974
JD
132422011-07-10 Jan Djärv <jan.h.d@swipnet.se>
13243
13244 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
13245 for non-popups (Bug#3642).
13246
1dae0f0a
AS
132472011-07-10 Andreas Schwab <schwab@linux-m68k.org>
13248
268c2c36 13249 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 13250 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
13251 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
13252 * cm.c (losecursor): Likewise.
1dae0f0a
AS
13253 * data.c (fmod): Likewise.
13254 * dispnew.c (swap_glyphs_in_rows): Likewise.
13255 * emacs.c (memory_warning_signal): Likewise.
13256 * floatfns.c (float_error): Likewise.
13257 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
13258 (otf_open, font_otf_capability, generate_otf_features)
13259 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
13260 Likewise.
13261 * image.c (pbm_read_file): Likewise.
13262 * indent.c (string_display_width): Likewise.
13263 * intervals.c (check_for_interval, search_for_interval)
13264 (inc_interval_count, count_intervals, root_interval)
13265 (adjust_intervals_for_insertion, make_new_interval): Likewise.
13266 * lread.c (defalias): Likewise.
268c2c36 13267 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
13268 * regex.c (set_image_of_range_1, set_image_of_range)
13269 (regex_grow_registers): Likewise.
13270 * sysdep.c (strerror): Likewise.
13271 * termcap.c (valid_filename_p, tprint, main): Likewise.
13272 * tparam.c (main): Likewise.
13273 * unexhp9k800.c (run_time_remap, save_data_space)
13274 (update_file_ptrs, read_header, write_header, calculate_checksum)
13275 (copy_file, copy_rest, display_header): Likewise.
13276 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
13277 Likewise.
13278 * xdisp.c (check_it): Likewise.
13279 * xfaces.c (register_color, unregister_color, unregister_colors):
13280 Likewise.
13281 * xfns.c (print_fontset_result): Likewise.
13282 * xrdb.c (member, fatal, main): Likewise.
13283
99033785
PE
132842011-07-10 Paul Eggert <eggert@cs.ucla.edu>
13285
13286 Fix minor problems found by static checking (Bug#9031).
13287 * chartab.c (char_table_set_range, map_sub_char_table):
13288 Remove unused locals.
13289 (uniprop_table): Now static.
13290 * composite.c (_work_char): Remove unused static var.
13291
9cb2ac56
JB
132922011-07-09 Juanma Barranquero <lekktu@gmail.com>
13293
13294 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
13295
f25661f0
JD
132962011-07-09 Jan Djärv <jan.h.d@swipnet.se>
13297
13298 * gtkutil.c (qttip_cb): Remove code without function.
13299
8278c4fe
EZ
133002011-07-09 Eli Zaretskii <eliz@gnu.org>
13301
13302 * w32.c (pthread_sigmask): New stub.
13303
1692ae2d 133042011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 13305
8a6ebd58 13306 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
13307 sigprocmask is portable only for single-threaded applications, and
13308 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
13309 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
13310 (LIBES): Use it.
13311 * callproc.c (Fcall_process):
13312 * process.c (create_process):
13313 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
13314 Use pthread_sigmask, not sigprocmask.
123403e4 13315
1b854618
JD
133162011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13317
13318 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
13319 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
13320 wrong (Bug#8591).
13321
3fe4b549
JD
133222011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13323
0ce7e563
JD
13324 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
13325 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
13326 (xg_hide_tooltip): Fix comment.
13327
3fe4b549
JD
13328 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
13329 in registerServicesMenuSendTypes.
13330 (validRequestorForSendType): Don't check ns_return_types.
13331
13332 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
13333 ns_return_type.
13334
5df75e47
JR
133352011-07-08 Jason Rumney <jasonr@gnu.org>
13336
22610910
JR
13337 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
13338 SH_SHOW for hidden windows (Bug#5482).
13339
5df75e47
JR
13340 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
13341 frame struct members of non-existent frames (Bug#6284).
13342
699c10bd
JD
133432011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13344
4393663b
JD
13345 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
13346 variable firstTime not needed on OSX >= 10.6.
13347 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
13348 >= 10.5. Use setKnobProportion, setDoubleValue.
13349
13350 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13351 (MAC_OS_X_VERSION_10_5): Define if not defined.
13352 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13353 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13354 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13355
13356 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 13357 cString and lossyCString on OSX >= 10.4.
4393663b 13358
58179cce 13359 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
13360 sizeToFit on OSX >= 10.2.
13361
13362 * nsimage.m (allocInitFromFile): Don't use deprecated method
13363 bestRepresentationForDevice on OSX >= 10.6.
13364
13365 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
13366 to avoid warning.
13367
13368 * emacs.c: Declare unexec_init_emacs_zone.
13369
a63e0781
JD
13370 * nsgui.h: Fix compiler warning about gnulib redefining verify.
13371
699c10bd
JD
13372 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
13373
13374 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13375 on svcsMenu (Bug#8842).
13376
13377 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13378 ns_return_types.
13379 (Fns_list_services): Just return Qnil on 10.6, code not working there.
13380
13381 * nsterm.m (QUTF8_STRING): Declare.
13382 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13383 (validRequestorForSendType): Return type is (id).
13384 Change indexOfObjectIdenticalTo to indexOfObject.
13385 Check if we have local selection before returning self (Bug#8842).
13386 (writeSelectionToPasteboard): Put local selection into paste board
13387 if we have a local selection (Bug#8842).
13388 (syms_of_nsterm): DEFSYM QUTF8_STRING.
13389
13390 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13391 (ns_get_local_selection): Declare.
13392
54e10184
LMI
133932011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
13394
9888ff71
LMI
13395 * keymap.c (describe_map_tree): Don't insert a double newline at
13396 the end of the buffer (bug#1169) and return whether we inserted
13397 something.
13398
54e10184
LMI
13399 * callint.c (Fcall_interactively): Change "reading args" to
13400 "providing args" to try to clarify what it does (bug#1010).
13401
15fa4783
KH
134022011-07-07 Kenichi Handa <handa@m17n.org>
13403
13404 * composite.c (composition_compute_stop_pos): Ignore a static
13405 composition starting before CHARPOS (Bug#8915).
13406
13407 * xdisp.c (handle_composition_prop): Likewise.
13408
a8815b00
EZ
134092011-07-07 Eli Zaretskii <eliz@gnu.org>
13410
13411 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13412 (Bug#9015)
13413
ef7b981d 134142011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
13415
13416 * character.h (unicode_category_t): New enum type.
13417
13418 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13419 (Qchar_code_property_table): New variable.
13420 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13421 (UNIPROP_COMPRESSED_FORM_P): New macros.
13422 (char_table_ascii): Uncompress the compressed values.
13423 (sub_char_table_ref): New arg is_uniprop. Callers changed.
13424 Uncompress the compressed values.
ac389d0c 13425 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
13426 (char_table_ref_and_range): Uncompress the compressed values.
13427 (sub_char_table_set): New arg is_uniprop. Callers changed.
13428 Uncompress the compressed values.
13429 (sub_char_table_set_range): Args changed. Callers changed.
13430 (char_table_set_range): Adjuted for the above change.
13431 (map_sub_char_table): Delete args default_val and parent. Add arg
13432 top. Give decoded values to a Lisp function.
640c8776 13433 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
13434 values to a Lisp function. Gcpro more variables.
13435 (uniprop_table_uncompress)
13436 (uniprop_decode_value_run_length): New functions.
13437 (uniprop_decoder, uniprop_decoder_count): New variables.
13438 (uniprop_get_decoder, uniprop_encode_value_character)
13439 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13440 New functions.
13441 (uniprop_encoder, uniprop_encoder_count): New variables.
13442 (uniprop_get_encoder, uniprop_table)
13443 (Funicode_property_table_internal, Fget_unicode_property_internal)
13444 (Fput_unicode_property_internal): New functions.
13445 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13446 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 13447 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
13448 char-code-property-alist.
13449
640c8776 13450 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
13451 Vunicode_category_table.
13452
640c8776 13453 * font.c (font_range): Adjust for the change of
c805dec0
KH
13454 Vunicode_category_table.
13455
76b397fb
DN
134562011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13457
13458 * m/iris4d.h: Remove file, move contents ...
13459 * s/irix6-5.h: ... here.
13460
22b4128e
PE
134612011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13462
13463 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
13464 * alloc.c (mark_buffer):
13465 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13466 (clone_per_buffer_values): Don't assume that
22b4128e
PE
13467 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13468 This isn't true in general, and it's particularly not true
13469 if Emacs is configured with --with-wide-int.
13470 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13471 New macros, used in the buffer.c change.
13472
869795d6
JD
134732011-07-05 Jan Djärv <jan.h.d@swipnet.se>
13474
13475 * xsettings.c: Use both GConf and GSettings if both are available.
13476 (store_config_changed_event): Add comment.
13477 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13478 (store_tool_bar_style_changed): New functions.
5e617bc2 13479 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
13480 (struct xsettings): Move font inside HAVE_XFT.
13481 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 13482 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 13483 Move inside HAVE_XFT.
640c8776 13484 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
13485 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13486 also.
13487 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 13488 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 13489 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
13490 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13491 (parse_settings): Move check for font inside HAVE_XFT.
13492 (read_settings, apply_xft_settings): Add comment.
13493 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
13494 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
13495 call store_font_name_changed.
13496 (xft_settings_event): Add comment.
13497 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
13498 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
13499 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
13500 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
13501 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
13502 (xsettings_get_system_font, xsettings_get_system_normal_font):
13503 Add comment.
869795d6 13504
d8ed26bd
PE
135052011-07-05 Paul Eggert <eggert@cs.ucla.edu>
13506
13507 Random fixes. E.g., (random) never returned negative values.
13508 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
13509 subseconds part to the entropy, as that's a bit more random.
13510 Prefer signed to unsigned, since the signedness doesn't matter and
13511 in general we prefer signed. When given a limit, use a
13512 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
13513 latter isn't right if USE_2_TAGS_FOR_INTS.
13514 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
13515 not 0..VALMASK. Don't discard "excess" bits that random () returns.
13516
cabf1cac
SM
135172011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
13518
13519 * textprop.c (text_property_stickiness):
13520 Obey Vtext_property_default_nonsticky.
13521 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
13522 * w32fns.c (syms_of_w32fns):
13523 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
13524
6e9b2be9
PE
135252011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13526
13527 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
13528 This is more efficient than Ffile_directory_p and avoids a minor race.
13529
90186c68
LMI
135302011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
13531
7c301272
LMI
13532 * buffer.c (Foverlay_put): Say what the return value is
13533 (bug#7835).
13534
c4f2d8d4
LMI
13535 * fileio.c (barf_or_query_if_file_exists): Check first if the file
13536 is a directory before asking whether to use the file name
13537 (bug#7564).
ad637907
LMI
13538 (barf_or_query_if_file_exists): Make the "File is a directory"
13539 error be more correct.
c4f2d8d4 13540
90186c68
LMI
13541 * fns.c (Frequire): Remove the mention of the .gz files, since
13542 that's installation-specific, but keep the mention of
13543 `get-load-suffixes'.
13544
da64016e
PE
135452011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13546
13547 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
13548 Report string overflow if the output is too long.
13549
7d47b580
JB
135502011-07-04 Juanma Barranquero <lekktu@gmail.com>
13551
a555cb87
JB
13552 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
13553 (syms_of_gnutls): Remove duplicate DEFSYM for
13554 Qgnutls_bootprop_verify_hostname_error, an error for
13555 Qgnutls_bootprop_verify_error (which is no longer used).
13556
7d47b580
JB
13557 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13558 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
13559 Also (re)move comments that are misplaced or no longer relevant.
13560
1e49bfab
LMI
135612011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13562
13563 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13564
1485f4c0
CY
135652011-07-03 Chong Yidong <cyd@stupidchicken.com>
13566
13567 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13568 and background color parameters if they have been changed.
13569
a9ab721e
LMI
135702011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13571
13572 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13573
cf7cff57
PE
135742011-07-03 Paul Eggert <eggert@cs.ucla.edu>
13575
2e13213d
PE
13576 * xsettings.c (SYSTEM_FONT): Define only when used.
13577 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13578
cf7cff57
PE
13579 * keymap.c (access_keymap_1): Now static.
13580
7a8e04f7
CY
135812011-07-02 Chong Yidong <cyd@stupidchicken.com>
13582
13583 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13584 leave any prefix arg for the up event (Bug#1586).
13585
61352f62
LMI
135862011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
13587
69bb1ef7
LMI
13588 * lread.c (syms_of_lread): Mention single symbols defined by
13589 `defvar' or `defconst' (bug#7154).
13590
61352f62 13591 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 13592 (Frequire): Mention get-load-suffixes.
61352f62 13593
28545e04
MR
135942011-07-02 Martin Rudalics <rudalics@gmx.at>
13595
13596 * window.h (window): Remove clone_number slot.
13597 * window.c (Fwindow_clone_number, Fset_window_clone_number):
13598 Remove.
13599 (make_parent_window, make_window, saved_window)
13600 (Fset_window_configuration, save_window_save): Don't deal with
13601 clone numbers.
13602 * buffer.c (Qclone_number): Remove declaration.
13603 (sort_overlays, overlay_strings): Don't deal with clone numbers.
13604
3349e122
SM
136052011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
13606
13607 Add multiple inheritance to keymaps.
13608 * keymap.c (Fmake_composed_keymap): New function.
13609 (Fset_keymap_parent): Simplify.
13610 (fix_submap_inheritance): Remove.
13611 (access_keymap_1): New function extracted from access_keymap to handle
13612 embedded parents and handle lists of maps.
13613 (access_keymap): Use it.
13614 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13615 (Fcopy_keymap): Handle embedded parents.
13616 (Fcommand_remapping, define_as_prefix): Simplify.
13617 (Fkey_binding): Simplify.
13618 (syms_of_keymap): Move minibuffer-local-completion-map,
13619 minibuffer-local-filename-completion-map,
13620 minibuffer-local-must-match-map, and
13621 minibuffer-local-filename-must-match-map to Elisp.
13622 (syms_of_keymap): Defsubr make-composed-keymap.
13623 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13624 (parse_menu_item): Trivial simplification.
13625
3279eb87
GM
136262011-07-01 Glenn Morris <rgm@gnu.org>
13627
13628 * Makefile.in (SETTINGS_LIBS): Fix typo.
13629
39cb9e56 136302011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
13631
13632 * coding.c (Fencode_coding_string): Record the last coding system
13633 used, as the function doc string says (bug#8738).
13634
0949d2b6
JD
136352011-07-01 Jan Djärv <jan.h.d@swipnet.se>
13636
13637 * xsettings.c (store_monospaced_changed): Take new font as arg and
13638 check for change against current_mono_font.
13639 (EMACS_TYPE_SETTINGS): Remove this and related defines.
13640 (emacs_settings_constructor, emacs_settings_get_property)
13641 (emacs_settings_set_property, emacs_settings_class_init)
13642 (emacs_settings_init, gsettings_obj): Remove.
13643 (something_changedCB): New function for HAVE_GSETTINGS.
13644 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13645 with value as argument.
13646 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
13647 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 13648 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
13649 "changed".
13650
13651 * xgselect.c: Add defined (HAVE_GSETTINGS).
13652 (xgselect_initialize): Ditto.
13653
13654 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
13655 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
13656 xg_select.
13657
bbc6b304
PE
136582011-07-01 Paul Eggert <eggert@cs.ucla.edu>
13659
13660 * eval.c (struct backtrace): Simplify and port the data structure.
13661 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
13662 signed bit field, as this assumption is not portable and it makes
13663 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
13664 "char debug_on_exit : 1" as this is not portable either; instead,
13665 use the portable "unsigned int debug_on_exit : 1". Remove unused
13666 member evalargs. Remove obsolete comments about cc bombing out.
13667
9851bfc5
JD
136682011-06-30 Jan Djärv <jan.h.d@swipnet.se>
13669
51bb811f 13670 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
13671 Let HAVE_GSETTINGS override HAVE_GCONF.
13672 (store_monospaced_changed): New function.
13673 (EMACS_SETTINGS): A new type derived from GObject to handle
13674 GSettings notifications.
13675 (emacs_settings_constructor, emacs_settings_get_property)
13676 (emacs_settings_set_property, emacs_settings_class_init):
13677 New functions.
13678 (gsettings_client, gsettings_obj): New variables.
13679 (GSETTINGS_SCHEMA): New define.
13680 (something_changedCB): Call store_monospaced_changed.
13681 (init_gsettings): New function.
13682 (xsettings_initialize): Call init_gsettings.
13683 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13684 to NULL.
13685
640c8776 13686 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
13687 GCONF_CFLAGS/LIBS.
13688
5386012d
MR
136892011-06-29 Martin Rudalics <rudalics@gmx.at>
13690
13691 * window.c (resize_root_window, grow_mini_window)
13692 (shrink_mini_window): Rename Qresize_root_window to
13693 Qwindow_resize_root_window and Qresize_root_window_vertically to
13694 Qwindow_resize_root_window_vertically.
13695
f13e0b08
PE
136962011-06-28 Paul Eggert <eggert@cs.ucla.edu>
13697
13698 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13699
94515237
JB
137002011-06-27 Juanma Barranquero <lekktu@gmail.com>
13701
13702 * makefile.w32-in: Redesign dependencies so they reflect more
13703 clearly which files are directly included by each source file,
13704 and not through other includes.
13705
e43b6e43
MR
137062011-06-27 Martin Rudalics <rudalics@gmx.at>
13707
13708 * buffer.c (Qclone_number): Declare static and DEFSYM it.
13709 (sort_overlays, overlay_strings): When an overlay's clone number
13710 matches the window's clone number process the overlay even if
13711 the overlay's window property doesn't match the current window.
13712
d68443dc
MR
13713 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13714 (Fwindow_hchild): Rename to Fwindow_left_child.
13715 (Fwindow_next): Rename to Fwindow_next_sibling.
13716 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
13717 (resize_window_check): Rename to window_resize_check.
13718 (resize_window_apply): Rename to window_resize_apply.
13719 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13720 (Fdelete_other_windows_internal, resize_frame_windows)
13721 (Fsplit_window_internal, Fdelete_window_internal)
13722 (grow_mini_window, shrink_mini_window)
13723 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 13724
c7e73be5
JD
137252011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13726
13727 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13728 (emacs_fixed_set_min_size): Remove.
13729 (emacs_fixed_new): Take frame as argument.
13730
13731 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13732 (_EmacsFixedPrivate): Remove minwidth/height.
13733 Add struct frame *f.
13734 (emacs_fixed_init): Initialize priv->f.
13735 (get_parent_class, emacs_fixed_set_min_size): Remove.
13736 (emacs_fixed_new): Set priv->f to argument.
13737 (emacs_fixed_get_preferred_width)
13738 (emacs_fixed_get_preferred_height): Use min_width/height from
13739 frames size_hint to set minimum and natural (Bug#8919).
13740 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13741 and use min_width/height from frames size_hint to set
13742 min_width/height (Bug#8919).
13743
13744 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
13745 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13746 Fix indentation.
c7e73be5 13747
cf99dcf8
EZ
137482011-06-26 Eli Zaretskii <eliz@gnu.org>
13749
13750 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13751 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13752 called at ZV.
13753
029529ac
CY
137542011-06-26 Chong Yidong <cyd@stupidchicken.com>
13755
13756 * process.c (wait_reading_process_output): Bypass select if
13757 waiting for a cell while ignoring keyboard input, and input is
13758 pending. Suggested by Jan Djärv (Bug#8869).
13759
7a7ef429
PE
137602011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13761
13762 Use gnulib's dup2 module instead of rolling our own.
13763 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13764
11fdef7d 137652011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
13766
13767 * dispnew.c (scrolling_window): Before scrolling, turn off a
13768 mouse-highlight in the window being scrolled.
13769
cd3520a4
JB
137702011-06-24 Juanma Barranquero <lekktu@gmail.com>
13771
13772 Move DEFSYM to lisp.h and use everywhere.
13773
13774 * character.h (DEFSYM): Move declaration...
13775 * lisp.h (DEFSYM): ...here.
13776
13777 * gnutls.c:
13778 * minibuf.c:
13779 * w32menu.c:
13780 * w32proc.c:
13781 * w32select.c: Don't include character.h.
13782
13783 * alloc.c (syms_of_alloc):
13784 * buffer.c (syms_of_buffer):
13785 * bytecode.c (syms_of_bytecode):
13786 * callint.c (syms_of_callint):
13787 * casefiddle.c (syms_of_casefiddle):
13788 * casetab.c (init_casetab_once):
13789 * category.c (init_category_once, syms_of_category):
13790 * ccl.c (syms_of_ccl):
13791 * cmds.c (syms_of_cmds):
13792 * composite.c (syms_of_composite):
13793 * dbusbind.c (syms_of_dbusbind):
13794 * dired.c (syms_of_dired):
13795 * dispnew.c (syms_of_display):
13796 * doc.c (syms_of_doc):
13797 * editfns.c (syms_of_editfns):
13798 * emacs.c (syms_of_emacs):
13799 * eval.c (syms_of_eval):
13800 * fileio.c (syms_of_fileio):
13801 * fns.c (syms_of_fns):
13802 * frame.c (syms_of_frame):
13803 * fringe.c (syms_of_fringe):
13804 * insdel.c (syms_of_insdel):
13805 * keymap.c (syms_of_keymap):
13806 * lread.c (init_obarray, syms_of_lread):
13807 * macros.c (syms_of_macros):
13808 * msdos.c (syms_of_msdos):
13809 * print.c (syms_of_print):
13810 * process.c (syms_of_process):
13811 * search.c (syms_of_search):
13812 * sound.c (syms_of_sound):
13813 * syntax.c (init_syntax_once, syms_of_syntax):
13814 * terminal.c (syms_of_terminal):
13815 * textprop.c (syms_of_textprop):
13816 * undo.c (syms_of_undo):
13817 * w32.c (globals_of_w32):
13818 * window.c (syms_of_window):
13819 * xdisp.c (syms_of_xdisp):
13820 * xfaces.c (syms_of_xfaces):
13821 * xfns.c (syms_of_xfns):
13822 * xmenu.c (syms_of_xmenu):
13823 * xsettings.c (syms_of_xsettings):
13824 * xterm.c (syms_of_xterm): Use DEFSYM.
13825
4228cf16
TZ
138262011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13827
cd3520a4 13828 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 13829
7fcccf1e
PE
138302011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13831
7efb4e0e
PE
13832 Integer and buffer overflow fixes (Bug#8873).
13833
ff5844ad
PE
13834 * print.c (printchar, strout): Check for string overflow.
13835 (PRINTPREPARE, printchar, strout):
13836 Don't set size unless allocation succeeds.
13837
90532f02
PE
13838 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13839 for sizes. Check for string overflow more accurately.
13840 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13841
6d84508d
PE
13842 * macros.c: Integer and buffer overflow fixes.
13843 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13844 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13845 Use ptrdiff_t, not int, for sizes.
13846 Don't increment bufsize until after realloc succeeds.
13847 Check for size-calculation overflow.
13848 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13849
437b2cb4
PE
13850 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13851
8b9ac8b4
PE
13852 * lread.c: Integer overflow fixes.
13853 (read_integer): Radix is now EMACS_INT, not int,
13854 to improve quality of diagnostics for out-of-range radices.
13855 Calculate buffer size correctly for out-of-range radices.
13856 (read1): Check for integer overflow in radices, and in
13857 read-circle numbers.
82cb60d3
PE
13858 (read_escape): Avoid int overflow.
13859 (Fload, openp, read_buffer_size, read1)
13860 (substitute_object_recurse, read_vector, read_list, map_obarray):
13861 Use ptrdiff_t, not int, for sizes.
13862 (read1): Use EMACS_INT, not int, for sizes.
20270765 13863 Check for size overflow.
8b9ac8b4 13864
7fcccf1e
PE
13865 * image.c (cache_image): Check for size arithmetic overflow.
13866
bfbbd7e7
PE
13867 * lread.c: Integer overflow issues.
13868 (saved_doc_string_size, saved_doc_string_length)
13869 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13870 Now ptrdiff_t, not int.
13871 (read1): Don't assume doc string length fits in int. Check for
13872 out-of-range doc string lengths.
13873 (read_list): Don't assume file position fits in int.
39019e54 13874 (read_escape): Check for hex character overflow.
bfbbd7e7 13875
4e323265
LL
138762011-06-22 Leo Liu <sdl.web@gmail.com>
13877
13878 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13879 Move to minibuffer.el.
13880
85fece3e
PE
138812011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13882
20b84ce9 13883 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
13884 The following patches are for when GLYPH_DEBUG && !XASSERT.
13885 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13886 * dispnew.c (flush_stdout):
13887 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13888 Mark as externally visible.
13889 * dispnew.c (check_window_matrix_pointers): Now static.
13890 * dispnew.c (window_to_frame_vpos):
13891 * xfns.c (unwind_create_frame):
13892 * xterm.c (x_check_font): Remove unused local.
13893 * scroll.c (CHECK_BOUNDS):
13894 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13895 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13896 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13897 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13898 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13899 Now static.
13900 (debug_method_add): Use va_list and vsprintf rather than relying
13901 on undefined behavior with wrong number of arguments.
13902 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13903 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13904 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13905 since we're not interested in debugging glyphs with old libraries.
13906 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13907 GCC 4.6.0's static checking.
13908
0766b489
PE
139092011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13910
31fd4b32
PE
13911 Integer overflow and signedness fixes (Bug#8873).
13912 A few related buffer overrun fixes, too.
13913
b79e8648
PE
13914 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13915
0766b489
PE
13916 * dispextern.h (struct face.stipple):
13917 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13918 (x_bitmap_mask, x_allocate_bitmap_record)
13919 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13920 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13921 (x_create_bitmap_from_xpm_data):
13922 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13923 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13924 (.bitmaps_last):
13925 * xfaces.c (load_pixmap):
13926 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13927 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13928 (.bitmaps_last, struct x_output.icon_bitmap):
13929 Use ptrdiff_t, not int, for bitmap indexes.
13930 (x_allocate_bitmap_record): Check for size overflow.
13931 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13932
b081724f
PE
13933 Use ptrdiff_t, not int, for overlay counts.
13934 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13935 * editfns.c (overlays_around, get_pos_property):
13936 * textprop.c (get_char_property_and_overlay):
13937 * xdisp.c (next_overlay_change, note_mouse_highlight):
13938 * xfaces.c (face_at_buffer_position):
21514da7
PE
13939 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13940 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13941 (Fnext_overlay_change, Fprevious_overlay_change)
13942 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 13943 Use ptrdiff_t, not int, for sizes.
21514da7 13944 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 13945
3de73e5e
PE
13946 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13947
2606c57b
PE
13948 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13949 (x_session_initialize): Do not assume string length fits in int.
13950
aaafe47a
PE
13951 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13952 This is unlikely, but can occur if DPI is outlandish.
13953
2674ddc8 13954 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
13955 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13956
28154962
PE
13957 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13958 * xrdb.c (magic_file_p, search_magic_path):
13959 Omit last arg SUFFIX; it was always 0. All callers changed.
13960 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13961
7de51af5
PE
13962 * xfont.c (xfont_match): Avoid need for strlen.
13963
25ed6cc3
PE
13964 * xfns.c: Don't assume strlen fits in int.
13965 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13966
4eab31dd
PE
13967 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13968 not unsigned long, as we prefer signed integers. All callers changed.
13969 Detect integer overflow in repeat count.
13970 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 13971 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 13972
171e2a58
PE
13973 * termcap.c: Don't assume sizes fit in int and never overflow.
13974 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13975 (gobble_line): Check for size-calculation overflow.
13976
ad39faca 13977 * minibuf.c (Fread_buffer):
6e5bb2dc 13978 * lread.c (intern, intern_c_string):
74ca2eb3
PE
13979 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13980 Don't assume string length fits in int.
13981
52c61c22 13982 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
13983 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13984
b5b8c9e5
PE
13985 * font.c: Don't assume string length fits in int.
13986 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13987 Use ptrdiff_t, not int.
ccd6111c
PE
13988 (font_intern_prop): Don't assume string length fits in int.
13989 Don't assume integer property fits in fixnum.
13990 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 13991
882f0d81 13992 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 13993 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
13994 Reformulate so as not to need the command string.
13995 Invoke gzip -cd rather than gunzip, as it's more portable.
13996 (lock_info_type, lock_file_1, lock_file):
13997 Don't assume pid_t and time_t fit in unsigned long.
13998 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13999 (current_lock_owner): Prefer signed type for sizes.
14000 Use memcpy, not strncpy, where memcpy is what is really wanted.
14001 Don't assume (via atoi) that time_t and pid_t fit in int.
14002 Check for time_t and/or pid_t out of range, e.g., via a network share.
14003 Don't alloca where an auto var works fine.
14004
93f4cf88
PE
14005 * fileio.c: Fix some integer overflow issues.
14006 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14007 Don't assume string length fits in int.
14008 (directory_file_name): Don't assume string length fits in long.
14009 (make_temp_name): Don't assume pid fits in int, or that its print
14010 length is less than 20.
14011
f3e92b69
PE
14012 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14013
1bfdaf10
PE
14014 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14015
35016e9a
PE
14016 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14017
3d1e65a1
PE
14018 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14019 We prefer signed integers, even for size calculations.
14020
0b963a93
PE
14021 * emacs.c: Don't assume string length fits in 'int'.
14022 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14023 (main): Don't invoke strlen when not needed.
14024
573f4b54
PE
14025 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14026 (XD_DEBUG_MESSAGE): Don't waste a byte.
14027
989f33ba
PE
14028 * callproc.c (getenv_internal_1, getenv_internal)
14029 (Fgetenv_internal):
965d34eb
PE
14030 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14031
e4d29b33
PE
14032 * lread.c (invalid_syntax): Omit length argument.
14033 All uses changed. This doesn't fix a bug, but it simplifies the
14034 code away from its former Hollerith-constant appearance, and it's
14035 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 14036 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 14037
eb49b136
PE
14038 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14039 This didn't break anything, but it didn't help either.
14040 It's confusing to put a bogus integer in a place where the actual
14041 value does not matter.
9f62aeb1 14042 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 14043 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 14044
15375a22
PE
14045 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14046 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14047 implementation.
b61cc01c
PE
14048 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14049 We prefer signed types, and the value cannot exceed the EMACS_INT
14050 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
14051 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14052 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14053 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 14054
53b2623d
PE
14055 * indent.c (sane_tab_width): New function.
14056 (current_column, scan_for_column, Findent_to, position_indentation)
14057 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 14058 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 14059
51cab52b 14060 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 14061
f2ed8a70
PE
14062 * lisp.h (lint_assume): New macro.
14063 * composite.c (composition_gstring_put_cache):
14064 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14065
abe80cc6
PE
14066 * editfns.c, insdel.c:
14067 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 14068
b02c740e
PE
14069 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14070
ebc96716
PE
14071 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14072
b4e50fa0 14073 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 14074 Use much-faster test for byte-length change.
311d5d7c 14075 Don't assume string byte-length fits in 'int'.
a4cf38e4 14076 Check that character arg fits in 'int'.
85461888 14077 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 14078
c0c1ee9f
PE
14079 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14080
a498d7f4
PE
14081 * fns.c (concat): Catch string overflow earlier.
14082 Do not rely on integer wraparound.
14083
51cab52b
PE
14084 * dispextern.h (struct it.overlay_strings_charpos)
14085 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
14086 * xdisp.c (forward_to_next_line_start)
14087 (back_to_previous_visible_line_start)
14088 (reseat_at_next_visible_line_start, next_element_from_buffer):
14089 Don't arbitrarily truncate the value of 'selective' to int.
14090
76031fad
PE
14091 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14092
5eb55db9
PE
14093 * composite.c: Don't truncate sizes to 'int'.
14094 (composition_gstring_p, composition_reseat_it)
14095 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
14096 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14097 not EMACS_UINT, for indexes.
5eb55db9 14098
0703a717
PE
14099 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14100
d6202519
PE
14101 * buffer.c: Include <verify.h>.
14102 (struct sortvec.priority, struct sortstr.priority):
8961a454 14103 Now EMACS_INT, not int.
c20998a7 14104 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
14105 (struct sortstr.size, record_overlay_string)
14106 (struct sortstrlist.size, struct sortlist.used):
14107 Don't truncate size to int.
14108 (record_overlay_string): Check for size-calculation overflow.
d6202519 14109 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 14110
d5a19415
JM
141112011-06-22 Jim Meyering <meyering@redhat.com>
14112
029529ac 14113 Don't leak an XBM-image-sized buffer
d5a19415
JM
14114 * image.c (xbm_load): Free the image buffer after using it.
14115
a9041e6c
PE
141162011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14117
14118 Port to Sun C.
14119 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14120 that Sun C diagnosed.
14121 * fns.c (secure_hash): Fix pointer signedness issue.
14122 * intervals.c (static_offset_intervals): New function.
14123 (offset_intervals): Use it.
14124
7f3f739f
LL
141252011-06-21 Leo Liu <sdl.web@gmail.com>
14126
14127 * deps.mk (fns.o):
14128 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14129 sha512.h.
14130
14131 * fns.c (secure_hash): Rename from crypto_hash_function and change
14132 the first arg to accept symbols.
5b66d427 14133 (Fsecure_hash): New primitive.
7f3f739f
LL
14134 (syms_of_fns): New symbols.
14135
76147d94
DD
141362011-06-20 Deniz Dogan <deniz@dogan.se>
14137
14138 * process.c (Fset_process_buffer): Clarify return value in
14139 docstring.
14140
7d7d0045
CY
141412011-06-18 Chong Yidong <cyd@stupidchicken.com>
14142
14143 * dispnew.c (add_window_display_history): Use BVAR.
14144
14145 * xdisp.c (debug_method_add): Use BVAR.
14146 (check_window_end, dump_glyph_matrix, dump_glyph)
14147 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14148
14149 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14150 Likewise.
14151
14152 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
14153 check till after the cache is created in init_frame_faces.
14154
ff2bc410
SM
141552011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
14156
14157 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
14158
28177add
PE
141592011-06-16 Paul Eggert <eggert@cs.ucla.edu>
14160
dd3482fe
PE
14161 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
14162 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
14163 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
14164
393d71f3 14165 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
14166 * fileio.c (Finsert_file_contents):
14167 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
14168 Remove the old (too-loose) buffer overflow checks.
14169 They weren't needed, since make_gap checks for buffer overflow.
14170 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
14171 The old code merely checked for Emacs fixnum overflow, and relied
14172 on undefined (wraparound) behavior. The new code avoids undefined
14173 behavior, and also checks for ptrdiff_t and/or size_t overflow.
14174
2e6813b0 14175 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
14176 Tune. Don't use wider integers than needed. Don't use alloca.
14177 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 14178
599a9e4f
PE
14179 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
14180
99561444
PE
14181 * insdel.c, lisp.h (buffer_overflow): New function.
14182 (insert_from_buffer_1, replace_range, replace_range_2):
14183 * insdel.c (make_gap_larger):
14184 * editfns.c (Finsert_char):
14185 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
14186
28177add
PE
14187 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
14188
e69dafad
PE
141892011-06-15 Paul Eggert <eggert@cs.ucla.edu>
14190
4baa020d 14191 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 14192
b1c46f02
PE
14193 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
14194 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
14195
e69dafad
PE
14196 * fileio.c: Don't assume EMACS_INT fits in off_t.
14197 (emacs_lseek): New static function.
14198 (Finsert_file_contents, Fwrite_region): Use it.
14199 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
14200
566684ea
PE
14201 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
14202
e6966cd6
PE
14203 * fns.c: Don't overflow int when computing a list length.
14204 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
14205 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
14206 truncation on 64-bit hosts. Check for QUIT every
14207 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
14208 faster and is responsive enough.
14209 (Flength): Report an error instead of overflowing an integer.
14210 (Fsafe_length): Return a float if the value is not representable
14211 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 14212 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 14213 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 14214
dd0b0efb
PE
14215 * alloc.c: Check that resized vectors' lengths fit in fixnums.
14216 (header_size, word_size): New constants.
14217 (allocate_vectorlike): Don't check size overflow here.
14218 (allocate_vector): Check it here instead, since this is the only
14219 caller of allocate_vectorlike that could cause overflow.
14220 Check that the new vector's length is representable as a fixnum.
14221
86fe5cfe
PE
14222 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
14223 The previous code was bogus. For example, next_almost_prime (32)
14224 returned 39, which is undesirable as it is a multiple of 3; and
14225 next_almost_prime (24) returned 25, which is a multiple of 5 so
14226 why was the code bothering to check for multiples of 7?
14227
80e88859
PE
14228 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
14229
4a2f0ad6
PE
14230 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
14231
f66c7cf8
PE
14232 Variadic C functions now count arguments with ptrdiff_t.
14233 This partly undoes my 2011-03-30 change, which replaced int with size_t.
14234 Back then I didn't know that the Emacs coding style prefers signed int.
14235 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
14236 were being counted with int, which may truncate counts on 64-bit
14237 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
14238 * lisp.h (struct Lisp_Subr.function.aMANY)
14239 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
14240 Arg counts are now ptrdiff_t, not size_t.
14241 All variadic functions and their callers changed accordingly.
14242 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
14243 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
14244 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
14245 * callint.c (Fcall_interactively): Check arg count for overflow,
14246 to avoid potential buffer overrun. Use signed char, not 'int',
14247 for 'varies' array, so that we needn't bother to check its size
14248 calculation for overflow.
14249 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
14250 * eval.c (apply_lambda):
14251 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
14252 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
14253 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
14254
a1759b76
PE
14255 * callint.c (Fcall_interactively): Don't use index var as event count.
14256
d96be9fc
PE
14257 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
14258 * mem-limits.h (SIZE): Remove; no longer used.
14259
a690a978 14260 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 14261
578c21e6
PE
14262 Remove unnecessary casts.
14263 * xterm.c (x_term_init):
14264 * xfns.c (x_set_border_pixel):
14265 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
14266 These aren't needed now that we assume ANSI C.
14267
96f53c6c
PE
14268 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
14269 It's more likely to cause problems (due to unsigned overflow)
14270 than to cure them.
14271
83c77d31
PE
14272 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
14273
ee2079f1
PE
14274 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
14275
6da65536
PE
14276 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
14277
7147c4a4
PE
14278 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
14279
193e32d9
PE
14280 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
14281
e5533da6
PE
14282 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
14283
9910e595
PE
14284 GLYPH_CODE_FACE returns EMACS_INT, not int.
14285 * dispextern.h (merge_faces):
14286 * xfaces.c (merge_faces):
01103c44
PE
14287 * xdisp.c (get_next_display_element, next_element_from_display_vector):
14288 Don't assume EMACS_INT fits in int.
9910e595 14289
2638320e
PE
14290 * character.h (CHAR_VALID_P): Remove unused parameter.
14291 * fontset.c, lisp.h, xdisp.c: All uses changed.
14292
045eb8d9
PE
14293 * editfns.c (Ftranslate_region_internal): Omit redundant test.
14294
c1f134b5
PE
14295 * fns.c (concat): Minor tuning based on overflow analysis.
14296 This doesn't fix any bugs. Use int to hold character, instead
14297 of constantly refetching from Emacs object. Use XFASTINT, not
14298 XINT, for value known to be a character. Don't bother comparing
14299 a single byte to 0400, as it's always less.
14300
395fcb93 14301 * floatfns.c (Fexpt):
327eeec8
PE
14302 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
14303
abbd3d23
PE
14304 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
14305 for characters.
14306
684a03ef
PE
14307 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
14308
0fed43f3
PE
14309 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
14310 Without this fix, on a 64-bit host (aset S 0 4294967386) would
14311 incorrectly succeed when S was a string, because 4294967386 was
14312 truncated before it was used.
14313
8fd02eb7
PE
14314 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
14315 Otherwise, an out-of-range integer could cause undefined behavior
14316 on a 64-bit host.
14317
f8c86b69
PE
14318 * composite.c: Use int, not EMACS_INT, for characters.
14319 (fill_gstring_body, composition_compute_stop_pos): Use int, not
14320 EMACS_INT, for values that are known to be in character range.
14321 This doesn't fix any bugs but is the usual style inside Emacs and
14322 may generate better code on 32-bit machines.
14323
34206dd2
PE
14324 Make sure a 64-bit char is never passed to ENCODE_CHAR.
14325 This is for reasons similar to the recent CHAR_STRING fix.
14326 * charset.c (Fencode_char): Check that character arg is actually
14327 a character. Pass an int to ENCODE_CHAR.
14328 * charset.h (ENCODE_CHAR): Verify that the character argument is no
14329 wider than 'int', as a compile-time check to prevent future regressions
14330 in this area.
14331
c5958d4c 14332 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
14333
14334 Make sure a 64-bit char is never passed to CHAR_STRING.
14335 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
14336 by silently ignoring the top 32 bits, allowing some values
14337 that were far too large to be valid characters.
14338 * character.h: Include <verify.h>.
14339 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
14340 arguments are no wider than unsigned, as a compile-time check
14341 to prevent future regressions in this area.
14342 * data.c (Faset):
01103c44 14343 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
14344 (Fsubst_char_in_region):
14345 * fns.c (concat):
14346 * xdisp.c (decode_mode_spec_coding):
14347 Adjust to CHAR_STRING's new requirement.
14348 * editfns.c (Finsert_char, Fsubst_char_in_region):
14349 * fns.c (concat): Check that character args are actually
14350 characters. Without this test, these functions did the wrong
14351 thing with wildly out-of-range values on 64-bit hosts.
14352
d37ca623
PE
14353 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14354 These casts should not be needed on 32-bit hosts, either.
14355 * keyboard.c (read_char):
14356 * lread.c (Fload): Remove casts to unsigned.
14357
ea204efb
PE
14358 * lisp.h (UNSIGNED_CMP): New macro.
14359 This fixes comparison bugs on 64-bit hosts.
14360 (ASCII_CHAR_P): Use it.
14361 * casefiddle.c (casify_object):
01103c44 14362 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
14363 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
14364 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
14365 * dispextern.h (FACE_FROM_ID):
14366 * keyboard.c (read_char): Use UNSIGNED_CMP.
14367
41cb286c
PE
14368 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
14369 not to EMACS_INT, to avoid GCC warning.
14370
4a1b9832
PE
14371 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
14372
55daad71
PE
14373 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
14374 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14375 isn't needed on 32-bit machines.
8f95c75c 14376
01103c44
PE
14377 * buffer.c (Fgenerate_new_buffer_name):
14378 Use EMACS_INT for count, not int.
0ceccced 14379 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
14380
14381 * data.c (Qcompiled_function): Now static.
14382
c6f072e7
PE
14383 * window.c (window_body_lines): Now static.
14384
20ce5912
PE
14385 * image.c (gif_load): Rename local to avoid shadowing.
14386
9c4c5f81
PE
14387 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14388 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14389 * alloc.c (make_save_value): Integer argument is now of type
14390 ptrdiff_t, not int.
14391 (mark_object): Use ptrdiff_t, not int.
14392 * lisp.h (pD): New macro.
14393 * print.c (print_object): Use it.
14394
c0c5c8ae
PE
14395 * alloc.c: Use EMACS_INT, not int, to count objects.
14396 (total_conses, total_markers, total_symbols, total_vector_size)
14397 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
14398 (total_free_floats, total_floats, total_free_intervals)
14399 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
14400 Now EMACS_INT, not int. All uses changed.
14401 (Fgarbage_collect): Compute overall total using a double, so that
14402 integer overflow is less likely to be a problem. Check for overflow
14403 when converting back to an integer.
5a25e253
PE
14404 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14405 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14406 These were 'int' variables that could overflow on 64-bit hosts;
14407 they were never used, so remove them instead of repairing them.
211a0b2a 14408 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
14409 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14410 Previously, this ceilinged at INT_MAX, but that doesn't work on
14411 64-bit machines.
e46bb31a 14412 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 14413
c78baabf 14414 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 14415 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
14416 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
14417 when a (possibly-narrower) signed value would do just as well.
14418 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 14419
c9d624c6
PE
14420 * alloc.c: Catch some string size overflows that we were missing.
14421 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14422 for convenience in STRING_BYTES_MAX.
14423 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14424 The definition here is exact; the one in lisp.h was approximate.
14425 (allocate_string_data): Check for string overflow. This catches
14426 some instances we weren't catching before. Also, it catches
14427 size_t overflow on (unusual) hosts where SIZE_MAX <= min
14428 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14429 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 14430
c9d624c6
PE
14431 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14432 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 14433 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 14434
353032ce
PE
14435 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14436
2bccce07
PE
14437 * alloc.c (Fmake_string): Check for out-of-range init.
14438
0ac30604
SM
144392011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14440
14441 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14442
c195f2de
JD
144432011-06-14 Jan Djärv <jan.h.d@swipnet.se>
14444
14445 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14446 xg_get_default_scrollbar_width.
14447
14448 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14449 (int_gtk_range_get_value): Move to the scroll bar part of the file.
14450 (style_changed_cb): Call update_theme_scrollbar_width and call
14451 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14452 all frames (Bug#8505).
14453 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14454 Call gtk_window_set_resizable if HAVE_GTK3.
14455 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14456 and height if HAVE_GTK3 (Bug#8505).
14457 (scroll_bar_width_for_theme): New variable.
14458 (update_theme_scrollbar_width): New function.
14459 (xg_get_default_scrollbar_width): Move code to
14460 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14461 (xg_initialize): Call update_theme_scrollbar_width.
14462
14463 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14464
14465 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14466
e10ac9f1
MR
144672011-06-12 Martin Rudalics <rudalics@gmx.at>
14468
14469 * frame.c (make_frame): Call other_buffer_safely instead of
14470 other_buffer.
14471
14472 * window.c (temp_output_buffer_show): Call display_buffer with
14473 second argument Vtemp_buffer_show_specifiers and reset latter
14474 immediately after the call.
14475 (Vtemp_buffer_show_specifiers): New variable.
14476 (auto_window_vscroll_p, next_screen_context_lines)
14477 (Vscroll_preserve_screen_position): Remove leading asterisks from
14478 doc-strings.
14479
2d3c217e 144802011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 14481
7b7f97e8 14482 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
14483 * buffer.c (Qclone_number): Remove for now, as it's unused.
14484 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14485 (record_buffer): Remove unused local.
14486 * frame.c (other_visible_frames, frame_buffer_list): Now static.
14487 (set_frame_buffer_list): Remove; unused.
14488 * frame.h (other_visible_frames): Remove decl.
14489 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14490 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14491 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14492 if HAVE_GPM.
14493 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14494 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
14495 Define only if HAVE_GPM.
14496 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
14497 (update_hints_inhibit): Remove; never set. All uses removed.
14498 * widgetprv.h (emacsFrameClassRec): Remove decl.
14499 * window.c (delete_deletable_window): Now returns void, since it
14500 wasn't returning anything.
14501 (compare_window_configurations): Remove unused locals.
14502 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
14503 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
14504 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
14505 the same widths as pointers. This follows up on the 2011-05-06 patch.
14506 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
14507 * xterm.h: Likewise.
14508 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
14509
1384b89e
JB
145102011-06-12 Juanma Barranquero <lekktu@gmail.com>
14511
14512 * makefile.w32-in: Update dependencies.
14513 (LISP_H): Add lib/intprops.h.
14514
1100a63c
CY
145152011-06-11 Chong Yidong <cyd@stupidchicken.com>
14516
14517 * image.c (gif_load): Add animation frame delay to the metadata.
14518 (syms_of_image): Use DEFSYM. New symbol `delay'.
14519
6198ccd0
MR
145202011-06-11 Martin Rudalics <rudalics@gmx.at>
14521
14522 * window.c (delete_deletable_window): Re-add.
14523 (Fset_window_configuration): Rewrite to handle dead buffers and
14524 consequently deletable windows.
14525 (window_tree, Fwindow_tree): Remove. Supply functionality in
14526 window.el.
14527 (compare_window_configurations): Simplify code.
14528
b6e3633c
AS
145292011-06-11 Andreas Schwab <schwab@linux-m68k.org>
14530
1ab0dee5
AS
14531 * image.c (imagemagick_load_image): Fix type mismatch.
14532 (Fimagemagick_types): Likewise.
14533
b6e3633c
AS
14534 * window.h (replace_buffer_in_windows): Declare.
14535
9397e56f
MR
145362011-06-11 Martin Rudalics <rudalics@gmx.at>
14537
14538 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
14539 Qclone_number. Remove external declaration of Qdelete_window.
14540 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
14541 code.
640c8776
SM
14542 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
14543 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
14544 (Fother_buffer): Rewrite doc-string. Major rewrite for new
14545 buffer list implementation.
14546 (other_buffer_safely): New function.
14547 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
14548 calls to replace_buffer_in_windows and
14549 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
14550 if allowed.
14551 (record_buffer): Inhibit quitting and rewrite using quittable
14552 functions. Run Qbuffer_list_update_hook if allowed.
14553 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
14554 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
14555 Move switch-to-buffer to window.el.
9397e56f
MR
14556 (bury-buffer): Move to window.el.
14557 (Vbuffer_list_update_hook): New variable.
14558
14559 * lisp.h (other_buffer_safely): Add prototype in buffer.c
14560 section.
14561
14562 * window.h (resize_frame_windows): Move up in code.
14563 (Fwindow_frame): Remove EXFUN.
14564 (replace_buffer_in_all_windows): Remove prototype.
14565 (replace_buffer_in_windows_safely): Add prototype.
14566
14567 * window.c: Declare Qdelete_window static again. Move down
14568 declaration of select_count.
14569 (Fnext_window, Fprevious_window): Rewrite doc-strings.
14570 (Fother_window): Move to window.el.
14571 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14572 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14573 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14574 window.el.
14575 (replace_buffer_in_windows): Implement by calling
14576 Qreplace_buffer_in_windows.
14577 (replace_buffer_in_all_windows): Remove with some functionality
14578 moved into replace_buffer_in_windows_safely.
14579 (replace_buffer_in_windows_safely): New function.
14580 (select_window_norecord, select_frame_norecord): Move in front
14581 of run_window_configuration_change_hook. Remove now obsolete
14582 declarations.
640c8776
SM
14583 (Fset_window_buffer): Rewrite doc-string.
14584 Call Qrecord_window_buffer.
9397e56f
MR
14585 (keys_of_window): Move binding for other-window to window.el.
14586
b50691aa
CY
145872011-06-11 Chong Yidong <cyd@stupidchicken.com>
14588
14589 * dispextern.h (struct image): Replace data member, whose int_val
14590 and ptr_val fields were not used by anything, with a single
14591 lisp_val object.
14592
14593 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14594 (gif_clear_image, gif_load, imagemagick_load_image)
14595 (gs_clear_image, gs_load): Callers changed.
14596
3f754b86
PE
145972011-06-10 Paul Eggert <eggert@cs.ucla.edu>
14598
cca69397
PE
14599 * buffer.h: Include <time.h>, for time_t.
14600 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
14601
109e28d0
PE
14602 Fix minor problems found by static checking.
14603
60737f02
PE
14604 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14605
4b66faf3
PE
14606 Make identifiers static if they are not used in other modules.
14607 * data.c (Qcompiled_function, Qframe, Qvector):
14608 * image.c (QimageMagick, Qsvg):
14609 * minibuf.c (Qmetadata):
14610 * window.c (resize_window_check, resize_root_window): Now static.
14611 * window.h (resize_window_check, resize_root_window): Remove decls.
14612
109e28d0
PE
14613 * window.c (window_deletion_count, delete_deletable_window):
14614 Remove; unused.
46a4ce9e
PE
14615 (window_body_lines): Now static.
14616 (Fdelete_other_windows_internal): Mark vars as initialized.
14617 Make sure 'resize_failed' is initialized.
14618 (run_window_configuration_change_hook): Rename local to avoid shadowing.
14619 (resize_window_apply): Remove unused local.
14620 * window.h (delete_deletable_window): Remove decl.
14621
109e28d0 14622 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
14623 (imagemagick_load_image): Fix pointer signedness problem by changing
14624 last arg from unsigned char * to char *. All uses changed.
14625 Also, fix a local for similar reasons.
14626 Remove unused locals. Remove locals to avoid shadowing.
14627 (fn_rsvg_handle_free): Remove; unused.
14628 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 14629 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 14630
3f754b86
PE
14631 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14632
2547adb1
CY
146332011-06-10 Chong Yidong <cyd@stupidchicken.com>
14634
14635 * image.c (gif_load): Fix omitted cast error introduced by
14636 2011-06-06 change.
14637
2c8e37d4
MR
146382011-06-10 Martin Rudalics <rudalics@gmx.at>
14639
14640 * window.h (resize_proportionally, orig_total_lines)
14641 (orig_top_line): Remove from window structure.
14642 (set_window_height, set_window_width, change_window_heights)
14643 (Fdelete_window): Remove prototypes.
14644 (resize_frame_windows): Remove duplicate declaration.
14645
440a42e3
EZ
146462011-06-10 Eli Zaretskii <eliz@gnu.org>
14647
14648 * window.h (resize_frame_windows, resize_window_check)
14649 (delete_deletable_window, resize_root_window)
14650 (resize_frame_windows): Declare prototypes.
14651
14652 * window.c (resize_window_apply): Make definition be "static" to
14653 match the prototype.
14654
562dd5e9
MR
146552011-06-10 Martin Rudalics <rudalics@gmx.at>
14656
14657 * window.c: Remove declarations of Qwindow_size_fixed,
14658 window_min_size_1, window_min_size_2, window_min_size,
14659 size_window, window_fixed_size_p, enlarge_window, delete_window.
14660 Remove static from declaration of Qdelete_window, it's
14661 temporarily needed by Fbury_buffer.
14662 (replace_window): Don't assign orig_top_line and
14663 orig_total_lines.
14664 (Fdelete_window, delete_window): Remove. Window deletion is
14665 handled by window.el.
640c8776
SM
14666 (window_loop): Remove DELETE_OTHER_WINDOWS case.
14667 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
14668 (Fdelete_other_windows): Remove. Deleting other windows is
14669 handled by window.el.
14670 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
14671 handled in window.el.
14672 (window_min_size_2, window_min_size_1, window_min_size): Remove.
14673 Window minimum sizes are handled in window.el.
14674 (shrink_windows, size_window, set_window_height)
14675 (set_window_width, change_window_heights, window_height)
14676 (window_width, CURBEG, CURSIZE, enlarge_window)
14677 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
14678 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
14679 handled in window.el.
14680 (make_dummy_parent): Rename to make_parent_window and give it a
14681 second argument horflag.
14682 (make_window): Don't set resize_proportionally any more.
14683 (Fsplit_window): Remove. Windows are split in window.el.
14684 (save_restore_action, save_restore_orig_size)
14685 (shrink_window_lowest_first, save_restore_orig_size): Remove.
14686 Resize mini windows in window.el.
14687 (grow_mini_window, shrink_mini_window): Implement by calling
14688 Qresize_root_window_vertically, resize_window_check and
14689 resize_window_apply.
640c8776
SM
14690 (saved_window, Fset_window_configuration, save_window_save):
14691 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
14692 resize_proportionally.
14693 (window_min_height, window_min_width): Move to window.el.
14694 (keys_of_window): Move bindings for delete-other-windows,
14695 split-window, delete-window and enlarge-window to window.el.
14696
14697 * buffer.c: Temporarily extern Qdelete_window.
14698 (Fbury_buffer): Temporarily call Qdelete_window instead of
14699 Fdelete_window (Fbury_buffer will move to window.el soon).
14700
14701 * frame.c (set_menu_bar_lines_1): Remove code handling
14702 orig_top_line and orig_total_lines.
14703
14704 * dispnew.c (adjust_frame_glyphs_initially): Don't use
14705 set_window_height but set heights directly.
14706 (change_frame_size_1): Use resize_frame_windows.
14707
14708 * xdisp.c (init_xdisp): Don't use set_window_height but set
14709 heights directly.
14710
640c8776
SM
14711 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14712 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
14713 run_window_configuration_change_hook.
14714
14715 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14716 instead of change_window_heights and run
14717 run_window_configuration_change_hook.
14718
1a13852e
MR
147192011-06-09 Martin Rudalics <rudalics@gmx.at>
14720
14721 * window.c (replace_window): Rename second argument REPLACEMENT to
14722 NEW. New third argument SETFLAG. Rewrite.
14723 (delete_window, make_dummy_parent): Call replace_window with
14724 third argument 1.
14725 (window_list_1): Move down in code.
14726 (run_window_configuration_change_hook): Move set_buffer part
14727 before select_frame_norecord part in order to unwind correctly.
14728 Rename count1 to count.
14729 (recombine_windows, delete_deletable_window, resize_root_window)
14730 (Fdelete_other_windows_internal)
14731 (Frun_window_configuration_change_hook, make_parent_window)
14732 (resize_window_check, resize_window_apply, Fresize_window_apply)
14733 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
14734 (Fdelete_window_internal, Fresize_mini_window_internal):
14735 New functions.
1a13852e
MR
14736 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14737
f3d1777e
MR
147382011-06-08 Martin Rudalics <rudalics@gmx.at>
14739
496e208e
MR
14740 * window.h (window): Add some new members to window structure -
14741 normal_lines, normal_cols, new_total, new_normal, clone_number,
14742 splits, nest, prev_buffers, next_buffers.
14743 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 14744 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 14745
f3d1777e
MR
14746 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14747 Remove.
496e208e
MR
14748 (make_dummy_parent): Set new members of windows structure.
14749 (make_window): Move down in code. Handle new members of window
14750 structure.
14751 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14752 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14753 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14754 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
14755 (Fset_window_next_buffers, Fset_window_clone_number):
14756 New functions.
496e208e
MR
14757 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14758 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14759 Doc-string fixes.
14760 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14761 Argument WINDOW can be now internal window too.
14762 (Fwindow_use_time): Move up in code.
14763 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14764 Rewrite doc-string.
14765 (Fset_window_configuration, saved_window)
14766 (Fcurrent_window_configuration, save_window_save): Handle new
14767 members of window structure.
b9e809c2
MR
14768 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14769 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14770 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14771 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14772 Qget_mru_window, Qresize_root_window,
14773 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14774 Qauto_buffer_name; staticpro them.
f3d1777e 14775
abde8f8c
MR
147762011-06-07 Martin Rudalics <rudalics@gmx.at>
14777
14778 * window.c (Fwindow_total_size, Fwindow_left_column)
14779 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14780 (Fwindow_list_1): New functions.
14781 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
14782 (Fwindow_width, Fscroll_left, Fscroll_right):
14783 Use window_body_cols instead of window_box_text_cols.
14784 (delete_window, Fset_window_configuration):
14785 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
14786 (delete_all_subwindows): Take a window as argument and not a
14787 structure. Rewrite.
190b47e6
MR
14788 (window_loop): Remove handling of GET_LRU_WINDOW and
14789 GET_LARGEST_WINDOW.
14790 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
14791
14792 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
14793 window_box_text_cols. delete_all_subwindows now takes a
14794 Lisp_Object as argument.
abde8f8c 14795
640c8776
SM
14796 * indent.c (compute_motion, Fcompute_motion):
14797 Use window_body_cols instead of window_box_text_cols.
abde8f8c 14798
fa8a67e6
MR
14799 * frame.c (delete_frame): Call delete_all_subwindows with root
14800 window as argument.
14801
a54e3482
DC
148022011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14803
14804 * fns.c (Fputhash): Document return value.
14805
60002bf5
CY
148062011-06-06 Chong Yidong <cyd@stupidchicken.com>
14807
14808 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14809
0c671da6 148102011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 14811
b862a52a 14812 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 14813
be44ca6c
PE
14814 Check for overflow when converting integer to cons and back.
14815 * charset.c (Fdefine_charset_internal, Fdecode_char):
14816 Use cons_to_unsigned to catch overflow.
14817 (Fencode_char): Use INTEGER_TO_CONS.
14818 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14819 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14820 * data.c (long_to_cons, cons_to_long): Remove.
14821 (cons_to_unsigned, cons_to_signed): New functions.
14822 These signal an error for invalid or out-of-range values.
14823 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14824 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14825 * font.c (Ffont_variation_glyphs):
14826 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14827 * lisp.h: Include <intprops.h>.
14828 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14829 (cons_to_signed, cons_to_unsigned): New decls.
14830 (long_to_cons, cons_to_long): Remove decls.
14831 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14832 (Fprimitive_undo): Use CONS_TO_INTEGER.
14833 * xfns.c (Fx_window_property): Likewise.
14834 * xselect.c: Include <limits.h>.
14835 (x_own_selection, selection_data_to_lisp_data):
14836 Use INTEGER_TO_CONS.
14837 (x_handle_selection_request, x_handle_selection_clear)
14838 (x_get_foreign_selection, Fx_disown_selection_internal)
14839 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14840 (lisp_data_to_selection_data): Use cons_to_unsigned.
14841 (x_fill_property_data): Use cons_to_signed.
14842 Report values out of range.
14843
d1f3d2af
PE
14844 Check for buffer and string overflow more precisely.
14845 * buffer.h (BUF_BYTES_MAX): New macro.
14846 * lisp.h (STRING_BYTES_MAX): New macro.
14847 * alloc.c (Fmake_string):
14848 * character.c (string_escape_byte8):
14849 * coding.c (coding_alloc_by_realloc):
14850 * doprnt.c (doprnt):
14851 * editfns.c (Fformat):
14852 * eval.c (verror):
14853 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14854 since they may not be the same number.
14855 * editfns.c (Finsert_char):
14856 * fileio.c (Finsert_file_contents):
14857 Likewise for BUF_BYTES_MAX.
14858
dd52fcea
PE
14859 * image.c: Use ptrdiff_t, not int, for sizes.
14860 (slurp_file): Switch from int to ptrdiff_t.
14861 All uses changed.
14862 (slurp_file): Check that file size fits in both size_t (for
14863 malloc) and ptrdiff_t (for sanity and safety).
14864
7f9bbdbb
PE
14865 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14866 if b->modtime has its maximal value.
14867
dfe18f82
PE
14868 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14869
84acfcf0
PE
14870 Don't assume time_t can fit into int.
14871 * buffer.h (struct buffer.modtime): Now time_t, not int.
14872 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14873 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14874
ccd9a01a
PE
14875 Minor fixes for signed vs unsigned integers.
14876 * character.h (MAYBE_UNIFY_CHAR):
14877 * charset.c (maybe_unify_char):
14878 * keyboard.c (read_char, reorder_modifiers):
14879 XINT -> XFASTINT, since the integer must be nonnegative.
14880 * ftfont.c (ftfont_spec_pattern):
14881 * keymap.c (access_keymap, silly_event_symbol_error):
14882 XUINT -> XFASTINT, since the integer must be nonnegative.
14883 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14884 since it makes no difference and we prefer signed.
14885 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14886 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14887 nonnegative.
14888
d6d100dd
SM
148892011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14890
14891 * window.h (Fwindow_frame): Declare.
14892
2b6148e4
PE
148932011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14894
14895 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14896 (SPARE_MEMORY): Always define.
14897 (LARGE_REQUEST): Remove.
14898 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14899
f230ecc9
MR
149002011-06-06 Martin Rudalics <rudalics@gmx.at>
14901
727e958e
MR
14902 * lisp.h: Move EXFUNS for Fframe_root_window,
14903 Fframe_first_window and Fset_frame_selected_window to window.h.
14904
14905 * window.h: Move EXFUNS for Fframe_root_window,
14906 Fframe_first_window and Fset_frame_selected_window here from
14907 lisp.h.
14908
14909 * frame.c (Fwindow_frame, Fframe_first_window)
14910 (Fframe_root_window, Fframe_selected_window)
14911 (Fset_frame_selected_window): Move to window.c.
14912 (Factive_minibuffer_window): Move to minibuf.c.
14913 (Fother_visible_frames_p): New function.
14914
14915 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14916
f230ecc9
MR
14917 * window.c (decode_window, decode_any_window): Move up in code.
14918 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14919 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
14920 (Fwindow_buffer): Move up and rewrite doc-string.
14921 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14922 (Fwindow_prev): New functions.
727e958e
MR
14923 (Fwindow_frame): Move here from frame.c. Accept any window as
14924 argument.
14925 (Fframe_root_window, Fframe_first_window)
14926 (Fframe_selected_window): Move here from frame.c. Accept frame
14927 or arbitrary window as argument. Update doc-strings.
14928 (Fminibuffer_window): Move up in code.
14929 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
14930 (Fset_frame_selected_window): Move here from frame.c.
14931 Marginal rewrite.
727e958e
MR
14932 (Fselected_window, select_window, Fselect_window): Move up in
14933 code. Minor doc-string fixes.
f230ecc9 14934
4d09bcf6
PE
149352011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14936
14937 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14938 Do not assume that spare memory exists; that assumption is valid
14939 only if SYSTEM_MALLOC.
14940 (LARGE_REQUEST): New macro, so that the issue of large requests
14941 is separated from the issue of spare memory.
14942
810928a2
AS
149432011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14944
172418ad
AS
14945 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14946 format. (Bug#8806)
14947
43f862f7
AS
14948 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14949
810928a2
AS
14950 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14951 before statements.
14952
a059fe24
JD
149532011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14954
14955 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14956
14957 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14958
14959 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14960 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14961
989bf368
JB
149622011-06-05 Juanma Barranquero <lekktu@gmail.com>
14963
14964 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14965
4b80f674
CY
149662011-06-04 Chong Yidong <cyd@stupidchicken.com>
14967
14968 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14969 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
14970 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14971 New error handlers.
4b80f674
CY
14972 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14973 Obey Vx_select_enable_clipboard_manager. Catch errors in
14974 x_clipboard_manager_save (Bug#8779).
14975 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 14976 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 14977
99a33b77 149782011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
14979
14980 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14981
99a33b77 149822011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
14983
14984 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14985 in the current matrix if keep_current_p is non-zero.
14986
8264569d
EZ
149872011-06-04 Eli Zaretskii <eliz@gnu.org>
14988
14989 * bidi.c (bidi_level_of_next_char): Fix last change.
14990
57f97249
EZ
149912011-06-03 Eli Zaretskii <eliz@gnu.org>
14992
fec2107c 14993 Support bidi reordering of text covered by display properties.
57f97249 14994
fec2107c
EZ
14995 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14996 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14997 (bidi_cache_search, bidi_cache_iterator_state)
14998 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
14999 (bidi_level_of_next_char, bidi_move_to_visually_next):
15000 Support character positions inside a run of characters covered by a
fec2107c
EZ
15001 display string.
15002 (bidi_paragraph_init, bidi_resolve_explicit_1)
15003 (bidi_level_of_next_char): Call bidi_fetch_char and
15004 bidi_fetch_char_advance instead of FETCH_CHAR and
15005 FETCH_CHAR_ADVANCE.
15006 (bidi_init_it): Initialize new members.
15007 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15008 definitions.
15009 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15010 instead of using explicit *_CHAR codes.
d6d100dd
SM
15011 (bidi_resolve_explicit, bidi_resolve_weak):
15012 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
15013 bidirectional text is supported only in multibyte buffers.
15014 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15015 it to initialize the frame_window_p member of struct bidi_it.
15016 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15017 (bidi_resolve_explicit, bidi_resolve_weak)
15018 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15019 bidi_it->nchars is non-positive.
15020 (bidi_level_of_next_char): Don't try to lookup the cache for the
15021 next/previous character if nothing is cached there yet, or if we
15022 were just reseat()'ed to a new position.
c40e2fb2 15023
0e14fe90
EZ
15024 * xdisp.c (set_cursor_from_row): Set start and stop points
15025 according to the row's direction when priming the loop that looks
15026 for the glyph on which to display cursor.
15027 (single_display_spec_intangible_p): Function deleted.
15028 (display_prop_intangible_p): Reimplement to call
15029 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
15030 Accept 3 additional arguments needed by handle_display_spec.
15031 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
15032 values: lists, `(when COND...)' forms, etc.
15033 (single_display_spec_string_p): Support property values that are
15034 lists with the argument STRING its top-level element.
15035 (display_prop_string_p): Fix the condition for processing a
15036 property that is a list to be consistent with handle_display_spec.
fec2107c 15037 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
15038 last portion of handle_display_prop.
15039 (compute_display_string_pos): Accept additional argument
15040 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15041 value of a `display' property is a "replacing spec".
15042 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15043 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15044 the display property, but just return a value indicating whether
15045 the display property will replace the characters it covers.
15046 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15047 frame_window_p members of struct bidi_it.
d6d100dd
SM
15048 (compute_display_string_pos, compute_display_string_end):
15049 New functions.
fec2107c
EZ
15050 (push_it): Accept second argument POSITION, where pop_it should
15051 jump to continue iteration.
15052 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 15053
fec2107c
EZ
15054 * keyboard.c (adjust_point_for_property): Adjust the call to
15055 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
15056
15057 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
15058 (bidi_init_it): Update prototypes.
15059 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
15060 (compute_display_string_pos, compute_display_string_end):
15061 Declare prototypes.
fec2107c
EZ
15062 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15063 EMACS_INT.
fc6f18ce 15064
40087514 150652011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 15066
57f53182
PE
15067 Malloc failure behavior now depends on size of allocation.
15068 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15069 * lisp.h: Change signatures accordingly.
15070 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15071 All callers changed. (Bug#8762)
15072
15073 * gnutls.c: Use Emacs's memory allocators.
15074 Without this change, the gnutls library would invoke malloc etc.
15075 directly, which causes problems on non-SYNC_INPUT hosts, and which
15076 runs afoul of improving memory_full behavior. (Bug#8761)
15077 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15078 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15079 xfree instead of the default malloc, realloc, free.
15080 (Fgnutls_boot): No need to check for memory allocation failure,
15081 since xmalloc does that for us.
15082
ac32cd99 15083 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
15084 * category.c (hash_get_category_set):
15085 * ccl.c (ccl_driver):
15086 * charset.c (Fdefine_charset_internal):
15087 * charset.h (struct charset.hash_index):
15088 * composite.c (get_composition_id, gstring_lookup_cache)
15089 (composition_gstring_put_cache):
15090 * composite.h (struct composition.hash_index):
15091 * dispextern.h (struct image.hash):
15092 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15093 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15094 (hashfn_equal, hashfn_user_defined, make_hash_table)
15095 (maybe_resize_hash_table, hash_lookup, hash_put)
15096 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15097 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15098 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15099 * image.c (make_image, search_image_cache, lookup_image)
15100 (xpm_put_color_table_h):
15101 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 15102 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 15103 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 15104 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
15105 * alloc.c (allocate_vectorlike):
15106 Check for overflow in vector size calculations.
15107 * ccl.c (ccl_driver):
15108 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
15109 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15110 need to be updated by these changes.
40087514
PE
15111 * fns.c (make_hash_table, maybe_resize_hash_table):
15112 Check for integer overflow with large hash tables.
0de4bb68
PE
15113 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15114 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15115 (SXHASH_REDUCE): New macro.
15116 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15117 Use it instead of discarding useful hash info with large hash values.
15118 (sxhash_float): New function.
15119 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15120 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
15121 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15122 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
15123 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15124 Adjust signatures to match updated version of code.
15125 (consing_since_gc): Now EMACS_INT, since a single hash table can
15126 use more than INT_MAX bytes.
15127
698d32e2
DN
151282011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15129
15130 Make it possible to build with GCC-4.6+ -O2 -flto.
15131
15132 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15133
fd6fa53f
SM
151342011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15135
15136 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15137 Call minibuffer-inactive-mode.
15138
864db017
JB
151392011-05-31 Juanma Barranquero <lekktu@gmail.com>
15140
15141 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15142 Update dependencies.
15143
2ad0baf4
DN
151442011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15145
15146 * data.c (init_data): Remove code for UTS, this system is not
15147 supported anymore.
15148
4fcc2638
DN
151492011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15150
15151 Don't force ./temacs to start in terminal mode.
15152
15153 * frame.c (make_initial_frame): Initialize faces in all cases, not
15154 only when CANNOT_DUMP is defined.
15155 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
15156
c56e0fd5
DN
151572011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15158
15159 * dispnew.c (add_window_display_history): Use const for the string
15160 pointer. Remove declaration, not needed.
15161
333d54da 151622011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 15163
55d4c1b2 15164 Use 'inline', not 'INLINE'.
333d54da 15165 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
15166 * alloc.c, fontset.c (INLINE): Remove.
15167 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
15168 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
15169 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
15170 * gmalloc.c (register_heapinfo): Use inline unconditionally.
15171 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
15172
738db178
DN
151732011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15174
15175 Make it possible to run ./temacs.
15176
15177 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
15178 syms_of_callproc does the same thing. Remove test for
15179 "initialized", do it in the caller.
15180 * emacs.c (main): Avoid calling set_initial_environment when dumping.
15181
620c53a6
SM
151822011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
15183
15184 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
15185 (read_minibuf): Use get_minibuffer.
15186 (syms_of_minibuf): Use DEFSYM.
15187 (Qmetadata): New var.
15188 * data.c (Qbuffer): Don't make it static.
15189 (syms_of_data): Use DEFSYM.
15190
e003a292
PE
151912011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15192
15193 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
15194 (CCL_CODE_MIN): New macro.
15195
ed008a6d
PE
151962011-05-30 Paul Eggert <eggert@cs.ucla.edu>
15197
3687c2ef
PE
15198 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
15199
ed008a6d
PE
15200 * eval.c (Qdebug): Now static.
15201 * lisp.h (Qdebug): Remove decl. This reverts a part of the
15202 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
15203 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
15204
d66c4c7c
CY
152052011-05-29 Chong Yidong <cyd@stupidchicken.com>
15206
15207 * image.c: Various fixes to ImageMagick code comments.
15208 (Fimagemagick_types): Doc fix.
15209
5fbc2025
PE
152102011-05-29 Paul Eggert <eggert@cs.ucla.edu>
15211
0196f88a
PE
15212 Minor fixes prompted by GCC 4.6.0 warnings.
15213
15214 * xselect.c (converted_selections, conversion_fail_tag): Now static.
15215
5fbc2025
PE
15216 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
15217 (x_clipboard_manager_save_all): Move extern decl to ...
15218 * xterm.h: ... here, so that it can be checked for consistency.
15219
1dd3c2d9
CY
152202011-05-29 Chong Yidong <cyd@stupidchicken.com>
15221
15222 * xselect.c (x_clipboard_manager_save_frame)
15223 (x_clipboard_manager_save_all): New functions.
15224 (Fx_clipboard_manager_save): Lisp function deleted.
15225
15226 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
15227 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
15228
15229 * xterm.h: Update prototype.
15230
5ba6571d
WX
152312011-05-28 William Xu <william.xwl@gmail.com>
15232
15233 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
15234 exiting (Bug#8239).
15235
3eaff834
JM
152362011-05-28 Jim Meyering <meyering@redhat.com>
15237
e1900994 15238 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
15239 * fns.c (to_uchar): Define.
15240 (crypto_hash_function): Use it to convert some newly-signed
15241 variables to unsigned, to avoid sign-extension bugs. For example,
15242 without this change, (md5 "truc") would evaluate to
15243 45723a2aff78ff4fff7fff1114760e62 rather than the expected
15244 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 15245 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 15246
0f6990a7
PE
152472011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15248
15249 Integer overflow fixes.
c8a9ca5a 15250
08686060
PE
15251 * dbusbind.c: Serial number integer overflow fixes.
15252 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
15253 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
15254 to hold a serial number that is too large for a fixnum.
15255 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15256 Check for serial numbers out of range. Decode any serial number
59568bf0 15257 that was so large that it became a float. (Bug#8722)
08686060 15258
2d1fc3c7
PE
15259 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
15260 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15261 Use XFASTINT rather than XUINT when numbers are nonnegative.
15262 (xd_append_arg, Fdbus_method_return_internal):
15263 (Fdbus_method_error_internal): Likewise. Also, for unsigned
15264 arguments, check that Lisp number is nonnegative, rather than
59568bf0 15265 silently wrapping negative numbers around. (Bug#8722)
30217ff0 15266 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 15267 (Bug#8722)
2d1fc3c7 15268
c8a9ca5a
PE
15269 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
15270
519e1d69
PE
15271 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
15272
6df6ae42 15273 ccl: Add integer overflow checks.
30569699
PE
15274 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
15275 (IN_INT_RANGE): New macros.
15276 (ccl_driver): Use them to check for integer overflow when
15277 decoding a CCL program. Many of the new checks are whether XINT (x)
15278 fits in int; it doesn't always, on 64-bit hosts. The new version
15279 doesn't catch all possible integer overflows, but it's an
847044ea 15280 improvement. (Bug#8719)
30569699 15281
c11285dc
PE
15282 * alloc.c (make_event_array): Use XINT, not XUINT.
15283 There's no need for unsigned here.
15284
fdccd48e
PE
15285 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
15286 This follows up to the 2011-05-06 change that substituted uintptr_t
15287 for EMACS_INT. This case wasn't caught back then.
15288
37910ab2
PE
15289 Rework Fformat to avoid integer overflow issues.
15290 * editfns.c: Include <float.h> unconditionally, as it's everywhere
15291 now (part of C89). Include <verify.h>.
15292 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
15293 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
15294 (Fformat): Avoid the prepass trying to compute sizes; it was only
15295 approximate and thus did not catch overflow reliably. Instead, walk
15296 through the format just once, formatting and computing sizes as we go,
15297 checking for integer overflow at every step, and allocating a larger
15298 buffer as needed. Keep track separately whether the format is
15299 multibyte. Keep only the most-recently calculated precision, rather
15300 than them all. Record whether each argument has been converted to
15301 string. Use EMACS_INT, not int, for byte and char and arg counts.
15302 Support field widths and precisions larger than INT_MAX. Avoid
15303 sprintf's undefined behavior with conversion specifications such as %#d
15304 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
15305 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
15306 formatting out-of-range floating point numbers with int
9173deec 15307 formats. (Bug#8668)
37910ab2 15308
2e6578fb
PE
15309 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
15310
0ae6bdee
PE
15311 * data.c: Avoid integer truncation in expressions involving floats.
15312 * data.c: Include <intprops.h>.
15313 (arith_driver): When there's an integer overflow in an expression
15314 involving floating point, convert the integers to floating point
15315 so that the resulting value does not suffer from catastrophic
15316 integer truncation. For example, on a 64-bit host (* 4
15317 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
15318 Do not rely on undefined behavior after integer overflow.
15319
de883a70
PE
15320 merge count_size_as_multibyte, parse_str_to_multibyte
15321 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 15322 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
15323 Check for integer overflow.
15324 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
15325 since it's now a duplicate of the other. This is more of
15326 a character than a buffer op, so better that it's in character.c.
15327 * fns.c, print.c: Adjust to above changes.
15328
2ff916cb
PE
153292011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
15330
15331 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
15332
f1b54466
PE
153332011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15334
fb1ac845
PE
15335 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15336 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
15337 (x_clipboard_manager_save): Now static.
15338 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
15339
f1b54466
PE
15340 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15341 (crypto_hash_function): Now static.
15342 Fix pointer signedness problems. Avoid unnecessary initializations.
15343
a9f737ee
CY
153442011-05-27 Chong Yidong <cyd@stupidchicken.com>
15345
15346 * termhooks.h (Vselection_alist): Make it terminal-local.
15347
15348 * terminal.c (create_terminal): Initialize it.
15349
15350 * xselect.c: Support for clipboard managers.
15351 (Vselection_alist): Move to termhooks.h as terminal-local var.
15352 (LOCAL_SELECTION): New macro.
15353 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15354 (symbol_to_x_atom): Remove gratuitous arg.
15355 (x_handle_selection_request, lisp_data_to_selection_data)
15356 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
15357 (x_own_selection, x_get_local_selection, x_convert_selection):
15358 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
15359 (some_frame_on_display): Delete unused function.
15360 (Fx_own_selection_internal, Fx_get_selection_internal)
15361 (Fx_disown_selection_internal, Fx_selection_owner_p)
15362 (Fx_selection_exists_p): New optional frame arg.
15363 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
15364 (x_handle_selection_clear): Don't treat other terminals with the
15365 same keyboard specially. Use the terminal-local Vselection_alist.
15366 (x_clear_frame_selections): Use Frun_hook_with_args.
15367
15368 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
15369
15370 * xterm.h: Add support for those atoms.
15371
e067f0c1
CY
153722011-05-26 Chong Yidong <cyd@stupidchicken.com>
15373
15374 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15375 (converted_selections, conversion_fail_tag): New global variables.
15376 (x_selection_request_lisp_error): Free the above.
15377 (x_get_local_selection): Remove unnecessary code.
15378 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
15379 of converted selections stored in converted_selections.
15380 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
15381 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15382 (x_convert_selection): New function.
15383 (x_handle_selection_event): Simplify.
15384 (x_get_foreign_selection): Don't ignore incoming requests while
15385 waiting for an answer; this will fail when we implement
15386 SAVE_TARGETS, and seems unnecessary anyway.
15387 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15388 (Vx_sent_selection_functions): Doc fix.
15389
0f4aebc0
LL
153902011-05-26 Leo Liu <sdl.web@gmail.com>
15391
15392 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
15393
e61124cd
YM
153942011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15395
15396 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15397
15398 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15399 for fringe update if it has periodic bitmap.
ac389d0c 15400 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
15401 and fringe_bitmap_periodic_p.
15402
15403 * fringe.c (get_fringe_bitmap_data): New function.
15404 (draw_fringe_bitmap_1, update_window_fringes): Use it.
15405 (update_window_fringes): Record periodicity of fringe bitmap in glyph
15406 row. Mark glyph row for fringe update if periodicity changed.
15407
15408 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15409 for fringe update unless it has periodic bitmap.
15410
f16d9837
KH
154112011-05-25 Kenichi Handa <handa@m17n.org>
15412
15413 * xdisp.c (get_next_display_element): Set correct it->face_id for
15414 a static composition.
15415
e1b90ef6
LL
154162011-05-24 Leo Liu <sdl.web@gmail.com>
15417
15418 * deps.mk (fns.o):
15419 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15420
15421 * fns.c (crypto_hash_function, Fsha1): New function.
15422 (Fmd5): Use crypto_hash_function.
15423 (syms_of_fns): Add Ssha1.
15424
7400048f
PE
154252011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15426
15427 * gnutls.c: Remove unused macros.
15428 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15429 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15430 Remove macros that are defined and never used.
15431 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15432
abb71cf4
CY
154332011-05-22 Chong Yidong <cyd@stupidchicken.com>
15434
15435 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15436 (Fx_get_selection_internal): Minor cleanup.
15437 (Fx_own_selection_internal): Rename arguments for consistency with
15438 select.el.
15439
6307db39
PE
154402011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15441
15442 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15443
f3d4e0a4
CY
154442011-05-22 Chong Yidong <cyd@stupidchicken.com>
15445
15446 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15447
4d8ade89
YM
154482011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15449
15450 * dispnew.c (scrolling_window): Don't exclude the case that the
15451 last enabled row in the desired matrix touches the bottom boundary.
15452
32078c8d
GM
154532011-05-21 Glenn Morris <rgm@gnu.org>
15454
15455 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
15456 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15457 and add some more files.
32078c8d 15458
7285dc67
EZ
154592011-05-20 Eli Zaretskii <eliz@gnu.org>
15460
15461 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15462 report_file_error introduced by the change from 2011-05-07.
15463
89d1bd22
PE
154642011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15465
15466 * systime.h (Time): Define only if emacs is defined.
15467 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15468 where the include path doesn't have X11/X.h by default. See
15469 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15470
cd394be1 154712011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
15472
15473 * composite.c (find_automatic_composition): Fix previous change.
15474
b9704ad9
GM
154752011-05-20 Glenn Morris <rgm@gnu.org>
15476
15477 * lisp.mk: New file, split from Makefile.in.
15478 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15479 (shortlisp): Remove.
15480 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15481
4a720484
GM
154822011-05-19 Glenn Morris <rgm@gnu.org>
15483
15484 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15485 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15486 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15487 (lisp): Set the order to that of loadup.el.
15488 (shortlisp): Make it a copy of $lisp.
15489 (SOME_MACHINE_LISP): Remove.
15490 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15491 Use just $shortlisp, not $SOME_MACHINE_LISP too.
15492
a28d4396
KH
154932011-05-18 Kenichi Handa <handa@m17n.org>
15494
15495 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
15496 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
15497 (find_automatic_composition): Mostly rewrite for efficiency.
15498
a2b1fa8e
JB
154992011-05-18 Juanma Barranquero <lekktu@gmail.com>
15500
15501 * makefile.w32-in: Update dependencies.
15502
8e1f5610
CS
155032011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
15504
15505 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 15506 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 15507
7025ee00 155082011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 15509
cdfa6eab
PE
15510 Fix some integer overflow issues, such as string length overflow.
15511
06d6db33
PE
15512 * insdel.c (count_size_as_multibyte): Check for string overflow.
15513
2b4560a8
PE
15514 * character.c (lisp_string_width): Check for string overflow.
15515 Use EMACS_INT, not int, for string indexes and lengths; in
15516 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
15517 the resulting string length overflows an EMACS_INT; instead,
15518 report a string overflow if no precision given. When checking for
15519 precision exhaustion, use a check that cannot possibly have
15520 integer overflow. (Bug#8675)
15521 * character.h (lisp_string_width): Adjust to new signature.
15522
cb93f9be
PE
15523 * alloc.c (string_overflow): New function.
15524 (Fmake_string): Use it. This doesn't change behavior, but saves
15525 a few bytes and will simplify future changes.
15526 * character.c (string_escape_byte8): Likewise.
15527 * lisp.h (string_overflow): New decl.
15528
1a1f3366
PE
15529 Fixups, following up to the user-interface timestamp change.
15530 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
15531 for UI timestamps, instead of unsigned long.
9fbd6841
PE
15532 * msdos.c (mouse_get_pos): Likewise.
15533 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
15534 * w32gui.h (Time): Define by including "systime.h" rather than by
15535 declaring it ourselves. (Bug#8664)
15536
d4e3e4d3
PE
15537 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
15538 * image.c (clear_image_cache): Likewise.
15539
f6a24d19
PE
15540 * term.c (term_mouse_position): Don't assume time_t wraparound.
15541
08dc5ae6
PE
15542 Be more systematic about user-interface timestamps.
15543 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
15544 and sometimes 'EMACS_UINT', to represent these timestamps.
15545 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
15546 This makes the code easier to follow, and makes it easier to catch
15547 integer overflow bugs such as Bug#8664.
15548 * frame.c (Fmouse_position, Fmouse_pixel_position):
15549 Use Time, not unsigned long, for user-interface timestamps.
15550 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
15551 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
15552 * keyboard.h (last_event_timestamp): Likewise.
15553 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15554 * menu.h (xmenu_show): Likewise.
15555 * term.c (term_mouse_position): Likewise.
15556 * termhooks.h (struct input_event.timestamp): Likewise.
15557 (struct terminal.mouse_position_hook): Likewise.
15558 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15559 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15560 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
15561 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15562 what it was before.
15563 * menu.h, termhooks.h: Include "systime.h", for Time.
15564
8e55734a
PE
15565 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15566 Don't assume that the difference between two unsigned long values
15567 can fit into an integer. At this point, we know button_down_time
15568 <= event->timestamp, so the difference must be nonnegative, so
15569 there's no need to cast the result if double-click-time is
15570 nonnegative, as it should be; check that it's nonnegative, just in
15571 case. This bug is triggered when events are more than 2**31 ms
86db42d2 15572 apart (about 25 days). (Bug#8664)
8e55734a 15573
841f1b75 15574 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 15575 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 15576
3e26f69c
PE
15577 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15578 that always fit in int. Use a sentinel instead of a counter, to
15579 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
15580 * frame.h (struct frame): Use int for menu_bar_items_used
15581 instead of EMACS_INT, since it always fits in int.
3e26f69c 15582
5cc152c0
PE
15583 * menu.c (grow_menu_items): Check for int overflow.
15584
d89eb65e
PE
15585 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15586
5235bd3e
PE
15587 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15588 Before, the code was not consistent. These values cannot exceed
15589 2**31 - 1 so there's no need to make them unsigned.
15590 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15591 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15592 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15593 as modifiers.
15594 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15595
bc827e23
PE
15596 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15597 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15598 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15599 presumably because the widths might not match.
15600
78eb494e
PE
15601 * window.c (size_window): Avoid needless test at loop start.
15602
04f2d78b
CB
156032011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
15604
15605 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15606
d2fc7e3d 156072011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
15608
15609 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15610
d2fc7e3d 156112011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
15612
15613 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15614 `width' to `bar_area_x' and `bar_area_width', respectively.
15615 (x_scroll_run): Take account of fringe background extension.
15616
04f2d78b
CB
15617 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15618 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
15619 `bar_area_width', respectively.
15620 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15621 background extension.
15622
79b70037
GM
156232011-05-10 Jim Meyering <meyering@redhat.com>
15624
15625 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15626
2f142cc5
JB
156272011-05-10 Juanma Barranquero <lekktu@gmail.com>
15628
15629 * image.c (Finit_image_library): Return t for built-in image types,
15630 like pbm and xbm. (Bug#8640)
15631
57679c86
AS
156322011-05-09 Andreas Schwab <schwab@linux-m68k.org>
15633
15634 * w32menu.c (set_frame_menubar): Fix submenu allocation.
15635
888c9e86
EZ
156362011-05-07 Eli Zaretskii <eliz@gnu.org>
15637
b0512a1d
EZ
15638 * w32console.c (Fset_screen_color): Doc fix.
15639 (Fget_screen_color): New function.
15640 (syms_of_ntterm): Defsubr it.
15641
7285dc67
EZ
15642 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15643 unlink the temporary file if Fcall_process didn't create it in the
15644 first place.
15645 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15646 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
15647 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
15648 cue to call_process_cleanup not to close that handle.
15649
4d3fcc8e
BK
156502011-05-07 Ben Key <bkey76@gmail.com>
15651
15652 * makefile.w32-in: The bootstrap-temacs rule now makes use of
15653 one of two shell specific rules, either bootstrap-temacs-CMD or
15654 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
15655 to the previous implementation of the bootstrap-temacs rule.
15656 The bootstrap-temacs-CMD rule is similar to the previous
15657 implementation of the bootstrap-temacs rule except that it
15658 makes use of the ESC_CFLAGS variable instead of the CFLAGS
15659 variable.
15660
15661 These changes, along with some changes to nt/configure.bat,
15662 nt/gmake.defs, and nt/nmake.defs, are required to extend my
15663 earlier fix to add support for --cflags and --ldflags options
15664 that include quotes so that it works whether make uses cmd or
15665 sh as the shell.
15666
b4289b64
MA
156672011-05-06 Michael Albinus <michael.albinus@gmx.de>
15668
15669 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
15670 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
15671 is a constant.
15672 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
15673 a string. Handle both cases.
15674 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
15675 (Fdbus_register_method): Use Qinvalid_function.
15676
af4c0e28
JB
156772011-05-06 Juanma Barranquero <lekktu@gmail.com>
15678
15679 * makefile.w32-in: Update dependencies.
15680 (LISP_H): Add inttypes.h and stdin.h.
15681 (PROCESS_H): Add unistd.h.
15682
c51453d9
EZ
156832011-05-06 Eli Zaretskii <eliz@gnu.org>
15684
15685 * lread.c: Include limits.h (fixes the MS-Windows build broken by
15686 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15687
8ff0ac3c 156882011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 15689
4c4b566b
PE
15690 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15691
aab2b9b5
PE
15692 * term.c (vfatal): Remove stray call to va_end.
15693 It's not needed and the C Standard doesn't allow it here anyway.
15694
c378da0b
PE
15695 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15696 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
15697
288b08c7
PE
15698 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15699 bytes.
15700
e3601888
PE
15701 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15702
db6c0e74
PE
15703 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15704
dd5963ea
PE
15705 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15706
88c9450f
PE
15707 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15708
2f9442b8
PE
15709 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15710
c032b5f8
PE
15711 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15712 * charset.c (Fdefine_charset_internal): Don't initialize
15713 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 15714 32-bit int (Bug#8600).
a108c10b
PE
15715
15716 * lread.c (read_integer): Be more consistent with string-to-number.
15717 Use string_to_number to do the actual conversion; this avoids
15718 rounding errors and fixes some other screwups. Without this fix,
15719 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15720 (digit_to_number): Move earlier, for benefit of read_integer.
15721 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 15722 not a digit in any supported base. (Bug#8602)
a108c10b 15723
ad5f9eea
PE
15724 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15725
aec1708a
PE
15726 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15727 to match comment at start of function. This also removes a
15728 GCC warning about overflow in a 32+64-bit port.
15729
47be4ab5
PE
15730 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15731
371cac43
PE
15732 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15733 Reported by Stefan Monnier in
15734 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
15735 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15736 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 15737
d01a7826
PE
15738 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15739 (EMACS_UINTPTR): Likewise, with uintptr_t.
15740
7fd47d5c
PE
15741 * lisp.h: Prefer 64-bit EMACS_INT if available.
15742 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15743 on 32-bit hosts that have 64-bit int, so that they can access
15744 large files.
122b0c86
PE
15745 However, temporarily disable this change unless the temporary
15746 symbol WIDE_EMACS_INT is defined.
7fd47d5c 15747
8727937b
PE
15748 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15749
8ac068ac
PE
15750 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15751 This removes an assumption that EMACS_INT and long are the same
15752 width as pointers. The assumption is true for Emacs porting targets
15753 now, but we want to make other targets possible.
15754 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15755 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15756 In the rest of the code, change types of integers that hold casted
15757 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15758 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15759 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15760 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15761 No need to cast type when ORing.
15762 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15763 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15764 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15765 assume EMACS_INT is the same width as char *.
15766 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15767 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15768 Remove no-longer-needed casts.
15769 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15770 (xg_tool_bar_help_callback, xg_make_tool_item):
15771 Use EMACS_INTPTR to hold an integer
15772 that will be cast to void *; this can avoid a GCC warning
15773 if EMACS_INT is not the same width as void *.
15774 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15775 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15776 (current_message_1, set_message_1):
15777 Use a local to convert to proper width without a cast.
15778 * xmenu.c (dialog_selection_callback): Likewise.
15779
ede49d71
PE
15780 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15781 Also, don't assume VALBITS / RAND_BITS is less than 5,
15782 and don't rely on undefined behavior when shifting a 1 left into
15783 the sign bit.
15784 * lisp.h (get_random): Change signature to match.
15785
2f30ecd0
PE
15786 * lread.c (hash_string): Use size_t, not int, for hash computation.
15787 Normally we prefer signed values; but hashing is special, because
15788 it's better to use unsigned division on hash table sizes so that
15789 the remainder is nonnegative. Also, size_t is the natural width
15790 for hashing into memory. The previous code used 'int', which doesn't
15791 retain enough info to hash well into very large tables.
15792 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15793
2a866e7b
PE
15794 * dbusbind.c: Don't possibly lose pointer info when converting.
15795 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15796 Use XPNTR rather than XHASH, so that the high-order bits of
15797 the pointer aren't lost when converting through void *.
15798
51639eac
PE
15799 * eval.c (Fautoload): Don't double-shift a pointer.
15800
92394119
PE
15801 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15802
dbdb9a7c
JB
158032011-05-06 Juanma Barranquero <lekktu@gmail.com>
15804
15805 * gnutls.c (DEF_GNUTLS_FN):
15806 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15807
db7a0b4f
AS
158082011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15809
15810 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15811 marker. (Bug#8610)
15812
cd394be1 158132011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
15814
15815 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15816 New version that can reserve upto 2GB of heap space.
15817
f7ff1b0f 158182011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
15819
15820 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15821
639c109b
TZ
158222011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15823
15824 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15825 `gnutls_certificate_set_x509_key_file'.
15826
d2127135
JB
158272011-05-05 Juanma Barranquero <lekktu@gmail.com>
15828
15829 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15830 Update dependencies.
15831
e968f4f3
JB
158322011-05-04 Juanma Barranquero <lekktu@gmail.com>
15833
15834 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15835 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15836 Remove unused parameter `fildes'.
15837 * process.c (read_process_output, send_process): Don't pass it.
15838
84d358f0
JB
158392011-05-04 Juanma Barranquero <lekktu@gmail.com>
15840
15841 Fix previous change: the library cache is defined in w32.c.
15842 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15843 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15844
0898ca10
JB
158452011-05-04 Juanma Barranquero <lekktu@gmail.com>
15846
15847 Implement dynamic loading of GnuTLS on Windows.
15848
15849 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15850 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15851 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15852 Declare.
15853
15854 * gnutls.c (Qgnutls_dll): Define.
15855 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15856 (gnutls_*): Declare function pointers.
15857 (init_gnutls_functions): New function to initialize function pointers.
15858 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15859 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15860 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15861 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15862 (emacs_gnutls_write, emacs_gnutls_read)
15863 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15864 (Fgnutls_available_p): New function.
15865 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15866 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15867 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15868
15869 * image.c: Include w32.h.
15870 (Vimage_type_cache): Delete.
15871 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15872 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15873 (w32_delayed_load): Move to w32.c.
15874
15875 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15876
15877 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15878 (w32_delayed_load): Move from image.c. When loading a library, record
15879 its filename in the :loaded-from property of the library id.
15880 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15881 Initialize and staticpro them.
15882 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15883
15884 * process.c: Include lisp.h before w32.h, not after.
15885 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15886 instead of gnutls_record_check_pending.
15887
15888 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15889
ff4de4aa
TZ
158902011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15891
15892 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15893 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15894 as passed in.
15895
abe95abb
JD
158962011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15897
15898 * xterm.c (x_set_frame_alpha): Do not set property on anything
15899 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15900
e16e55d4
JB
159012011-05-02 Juanma Barranquero <lekktu@gmail.com>
15902
15903 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15904
bafcf6a5
JB
159052011-05-02 Juanma Barranquero <lekktu@gmail.com>
15906
15907 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15908 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15909 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15910 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15911 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15912 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15913 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15914 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15915 (Qgnutls_bootprop_callbacks_verify): Make static.
15916
e7a6747f
AS
159172011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15918
19ed11ba
AS
15919 * callproc.c: Indentation fixup.
15920
e7a6747f 15921 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
15922 (wait_for_termination, interruptible_wait_for_termination):
15923 Move after wait_for_termination_1.
e7a6747f 15924
1ef14cb4
LMI
159252011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15926
15927 * sysdep.c (interruptible_wait_for_termination): New function
15928 which is like wait_for_termination, but allows keyboard
15929 interruptions.
15930
15931 * callproc.c (Fcall_process): Add (:file "file") as an option for
15932 the STDOUT buffer.
15933 (Fcall_process_region): Ditto.
15934
330d880c
EZ
159352011-04-30 Eli Zaretskii <eliz@gnu.org>
15936
8db90b73
EZ
15937 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15938 rather than `XVECTOR (FOO)->size'.
15939
330d880c
EZ
15940 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15941 inttypes.h, as a gnulib replacement is used if it not available in
15942 system headers.
15943
15cbd324
EZ
159442011-04-21 Eli Zaretskii <eliz@gnu.org>
15945
15946 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15947 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15948 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15949
15950 * coding.c (coding_alloc_by_realloc): Error out if destination
15951 will grow beyond MOST_POSITIVE_FIXNUM.
15952 (decode_coding_emacs_mule): Abort if there isn't enough place in
15953 charbuf for the composition carryover bytes. Reserve an extra
15954 space for up to 2 characters produced in a loop.
15955 (decode_coding_iso_2022): Abort if there isn't enough place in
15956 charbuf for the composition carryover bytes.
15957
159582011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 15959
ae940cca
EZ
15960 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15961 aborting when %lld or %lll format is passed.
15962 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15963 %llo or %llx format is passed. (Bug#8545)
15964
03ab8921
EZ
15965 * window.c (window_scroll_line_based): Use a marker instead of
15966 simple variables to record original value of point. (Bug#7952)
15967
afda1437
EZ
15968 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15969 produced by %s or %c overflows available buffer space. (Bug#8545)
15970
f76dee0c
PE
159712011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15972
15973 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 15974 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 15975
fdc5744d
JB
159762011-04-28 Juanma Barranquero <lekktu@gmail.com>
15977
15978 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15979
638f053a
JB
159802011-04-28 Juanma Barranquero <lekktu@gmail.com>
15981
15982 * keyboard.c (Qdelayed_warnings_hook): Define.
15983 (command_loop_1): Run `delayed-warnings-hook'
15984 if Vdelayed_warnings_list is non-nil.
15985 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15986 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15987
d178f871
EZ
159882011-04-28 Eli Zaretskii <eliz@gnu.org>
15989
15990 * doprnt.c (doprnt): Don't return value smaller than the buffer
15991 size if the message was truncated. (Bug#8545).
15992
b124fd93
JB
159932011-04-28 Juanma Barranquero <lekktu@gmail.com>
15994
15995 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15996 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15997
e810457d
PE
159982011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15999
16000 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16001
ea51cceb
JB
160022011-04-27 Juanma Barranquero <lekktu@gmail.com>
16003
16004 * makefile.w32-in: Update dependencies.
16005
94dcfacf
EZ
160062011-04-27 Eli Zaretskii <eliz@gnu.org>
16007
16008 Improve `doprnt' and its usage. (Bug#8545)
16009 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16010 `format_end'. Remove support for %l as a conversion specifier.
16011 Don't use xrealloc. Improve diagnostics when the %l size modifier
16012 is used. Update the commentary.
16013
16014 * eval.c (verror): Simplify calculation of size_t.
16015
16016 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16017 messages.
16018
f61f41d7
PE
160192011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16020
16021 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16022 change.
16023
96fb4434
PE
160242011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16025
16026 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16027 This makes this file independent of the recent pseudovector change.
16028
671875da 160292011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 16030
69e9b5a3
PE
16031 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16032
b5f869a7 16033 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 16034 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 16035 Remove unused local.
c8926152 16036 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 16037
841a1577 16038 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
16039 GCC 4.6.0 optimizes based on type-based alias analysis.
16040 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
16041 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16042 != &v->size, and therefore "v->size = 1; b->size = 2; return
16043 v->size;" must therefore return 1. This assumption is incorrect
16044 for Emacs, since it type-puns struct Lisp_Vector * with many other
16045 types. To fix this problem, this patch adds a new type struct
f904488f 16046 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
16047 and pseudovectors, and helps optimizing compilers not get fooled
16048 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16049 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
16050 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16051 the size member.
eab3844f
PE
16052 (XSETPVECTYPE): Rewrite in terms of new macro.
16053 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16054 This is a bit clearer, and further avoids the possibility of
16055 undesirable aliasing.
16056 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 16057 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
16058 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16059 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
16060 (ASIZE): Now uses header.size rather than size.
16061 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
16062 to avoid the hassle of writing XVECTOR (foo)->header.size.
16063 (struct vectorlike_header): New type.
eab3844f
PE
16064 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16065 object, to help avoid aliasing.
16066 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16067 (SUBRP): Likewise, since Lisp_Subr is a special case.
16068 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16069 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16070 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 16071 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
16072 changed to be "header.size" and "header.next".
16073 * buffer.h (struct buffer): Likewise.
16074 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16075 * frame.h (struct frame): Likewise.
16076 * process.h (struct Lisp_Process): Likewise.
16077 * termhooks.h (struct terminal): Likewise.
16078 * window.c (struct save_window_data, struct saved_window): Likewise.
16079 * window.h (struct window): Likewise.
16080 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16081 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16082 * buffer.c (init_buffer_once): Likewise.
16083 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16084 special case.
16085 * process.c (Fformat_network_address): Use local var for size,
16086 for brevity.
16087
0df1eac5
PE
16088 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16089
847ab9d1 16090 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
16091 * data.c (atof): Remove decl; no longer used or needed.
16092 (digit_to_number): Move to lread.c.
16093 (Fstring_to_number): Use new string_to_number function, to be
16094 consistent with how the Lisp reader treats infinities and NaNs.
16095 Do not assume that floating-point numbers represent EMACS_INT
16096 without losing information; this is not true on most 64-bit hosts.
16097 Avoid double-rounding errors, by insisting on integers when
16098 parsing non-base-10 numbers, as the documentation specifies.
16099 * lisp.h (string_to_number): New decl, replacing ...
16100 (isfloat_string): Remove.
bc0a5c13 16101 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 16102 (read1): Do not accept +. and -. as integers; this
452f4150
PE
16103 appears to have been a coding error. Similarly, do not accept
16104 strings like +-1e0 as floating point numbers. Do not report
16105 overflow for integer overflows unless the base is not 10 which
16106 means we have no simple and reliable way to continue.
16107 Break out the floating-point parsing into a new
16108 function string_to_number, so that Fstring_to_number parses
16109 floating point numbers consistently with the Lisp reader.
04f2d78b 16110 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
16111 (E_CHAR, EXP_INT): Remove, replacing with ...
16112 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16113 (string_to_number): New function, replacing isfloat_string.
16114 This function checks for valid syntax and produces the resulting
16115 Lisp float number too. Rework it so that string-to-number
bc0a5c13 16116 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
16117 so that overflow for non-base-10 numbers is reported only when
16118 there's no portable and simple way to convert to floating point.
452f4150 16119
67769ffc
PE
16120 * textprop.c (set_text_properties_1): Rewrite for clarity,
16121 and to avoid GCC warning about integer overflow.
16122
c20db43f
PE
16123 * intervals.h (struct interval): Use EMACS_INT for members
16124 where EMACS_UINT might cause problems. See
16125 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16126 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16127 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16128 All uses changed.
37aa2f85
PE
16129 (offset_intervals): Tell GCC not to worry about length overflow
16130 when negating a negative length.
c20db43f 16131
2538aa2f
PE
16132 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16133 (overrun_check_free): Likewise.
16134
f2d3008d
PE
16135 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16136 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16137 word size.
16138
ec8df744
PE
16139 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16140 (gnutls_make_error): Rename local to avoid shadowing.
16141 (gnutls_emacs_global_deinit): ifdef out; not used.
16142 (Fgnutls_boot): Use const for pointer to readonly storage.
16143 Comment out unused local. Fix pointer signedness problems.
16144
640ee02d
PE
16145 * lread.c (openp): Don't stuff size_t into an 'int'.
16146 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16147 about possible signed overflow.
16148
6048fb2a
PE
16149 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16150 (GDK_KEY_g): Don't define if already defined.
16151 (xg_prepare_tooltip): Avoid pointer signedness problem.
16152 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
16153
fa3c87e1
PE
16154 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
16155 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
16156
2172544b
PE
16157 * xfns.c (Fx_window_property): Simplify a bit,
16158 to make a bit faster and to avoid GCC 4.6.0 warning.
16159 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
16160
9b821a21
PE
16161 * fns.c (internal_equal): Don't assume size_t fits in int.
16162
3c616cfa
PE
16163 * alloc.c (compact_small_strings): Tighten assertion a little.
16164
c2982e87
PE
16165 Replace pEd with more-general pI, and fix some printf arg casts.
16166 * lisp.h (pI): New macro, generalizing old pEd macro to other
16167 conversion specifiers. For example, use "...%"pI"d..." rather
16168 than "...%"pEd"...".
16169 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 16170 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
16171 * alloc.c (check_pure_size): Don't overflow by converting size to int.
16172 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
16173 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
16174 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
16175 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
16176 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
16177 64-bit hosts.
16178 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
16179 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
16180 * print.c (safe_debug_print, print_object): Likewise.
16181 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
16182 to int.
6f04d126
PE
16183 Use pI instead of if-then-else-abort. Use %p to avoid casts,
16184 avoiding the 0 flag, which is not portable.
c2982e87
PE
16185 * process.c (Fmake_network_process): Use pI to avoid cast.
16186 * region-cache.c (pp_cache): Likewise.
16187 * xdisp.c (decode_mode_spec): Likewise.
16188 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
16189 behavior on 64-bit hosts with printf arg.
6f04d126 16190 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
16191 (x_stop_queuing_selection_requests): Likewise.
16192 (x_get_window_property): Don't truncate byte count to an 'int'
16193 when tracing.
0b432f21 16194
5e073ec7
PE
16195 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
16196 here, since it parses constructs like leading '-' and spaces,
16197 which are not wanted; and it overflows with large numbers.
16198 Instead, simply match F[0-9]+, which is what is wanted anyway.
16199
36372bf9
PE
16200 * alloc.c: Remove unportable assumptions about struct layout.
16201 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
16202 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
16203 (allocate_vectorlike, make_pure_vector): Use the new macros,
16204 plus offsetof, to remove unportable assumptions about struct layout.
16205 These assumptions hold on all porting targets that I know of, but
16206 they are not guaranteed, they're easy to remove, and removing them
16207 makes further changes easier.
16208
0b432f21
PE
16209 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
16210 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
16211 (string_overrun_cookie): Now const. Use initializers that
16212 don't formally overflow signed char, to avoid warnings.
000098c1
PE
16213 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
16214 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
16215 (allocate_buffer): Don't assume sizeof (struct buffer) is a
16216 multiple of sizeof (EMACS_INT); it need not be, if
16217 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 16218 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 16219
895009e1
JB
162202011-04-26 Juanma Barranquero <lekktu@gmail.com>
16221
16222 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
16223
6a7a1b0b
TZ
162242011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
16225
16226 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 16227 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
16228 Reported by Paul Eggert <eggert@cs.ucla.edu>.
16229
841a1577 162302011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
16231
16232 * lisp.h (Qdebug): List symbol.
895009e1 16233 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
16234 * keyboard.c (debug-on-event): New variable.
16235 (handle_user_signal): Break into debugger when debug-on-event
16236 matches the current signal symbol.
16237
f2d3ba6f
DN
162382011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
16239
16240 * alloc.c (check_sblock, check_string_bytes)
16241 (check_string_free_list): Convert to standard C.
16242
42ce4c63
TZ
162432011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
16244
16245 * w32.c (emacs_gnutls_push): Fix typo.
16246
825cd63c
EZ
162472011-04-25 Eli Zaretskii <eliz@gnu.org>
16248
fb11d64d
EZ
16249 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
16250 "cast to pointer from integer of different size".
16251
825cd63c
EZ
16252 Improve doprnt and its use in verror. (Bug#8545)
16253 * doprnt.c (doprnt): Document the set of format control sequences
16254 supported by the function. Use SAFE_ALLOCA instead of always
16255 using `alloca'.
16256
16257 * eval.c (verror): Don't limit the buffer size at size_max-1, that
16258 is one byte too soon. Don't use xrealloc; instead xfree and
16259 xmalloc anew.
16260
e061a11b
TZ
162612011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
16262
16263 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
16264 callbacks stage.
16265
16266 * gnutls.c: Renamed global_initialized to
16267 gnutls_global_initialized. Added internals for the
16268 :verify-hostname-error, :verify-error, and :verify-flags
16269 parameters of `gnutls-boot' and documented those parameters in the
16270 docstring. Start callback support.
9173deec
JB
16271 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
16272 unless a fatal error occurred. Call gnutls_alert_send_appropriate
16273 on error. Return error code.
e061a11b
TZ
16274 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
16275 (emacs_gnutls_read): Likewise.
16276 (Fgnutls_boot): Return handshake error code.
16277 (emacs_gnutls_handle_error): New function.
16278 (wsaerror_to_errno): Likewise.
16279
16280 * w32.h (emacs_gnutls_pull): Add prototype.
16281 (emacs_gnutls_push): Likewise.
16282
16283 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
16284 (emacs_gnutls_push): Likewise.
16285
162862011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
16287
16288 * process.c (wait_reading_process_output): Check if GnuTLS
16289 buffered some data internally if no FDs are set for TLS
16290 connections.
16291
16292 * makefile.w32-in (OBJ2): Add gnutls.$(O).
16293 (LIBS): Link to USER_LIBS.
16294 ($(BLD)/gnutls.$(0)): New target.
16295
fa6996bc
EZ
162962011-04-24 Eli Zaretskii <eliz@gnu.org>
16297
eb35682e
EZ
16298 * xdisp.c (handle_single_display_spec): Rename the
16299 display_replaced_before_p argument into display_replaced_p, to
16300 make it consistent with the commentary. Fix typos in the
16301 commentary.
16302
e2ad650c
EZ
16303 * textprop.c (syms_of_textprop): Remove dead code.
16304 (copy_text_properties): Delete obsolete commentary about an
16305 interface that was deleted long ago. Fix typos in the description
16306 of arguments.
16307
1b2de274
EZ
16308 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
16309 to changes in oldXMenu/XMenu.h from 2011-04-16.
16310 <menu_help_message, prev_menu_help_message>: Constify.
16311 (IT_menu_make_room): menu->help_text is now `const char **';
16312 adjust.
16313
16314 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
16315 to changes in oldXMenu/XMenu.h from 2011-04-16.
16316 (struct XMenu): Declare `help_text' `const char **'.
16317
16318 * xfaces.c <Qunspecified>: Make extern again.
16319
16320 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 16321 required by POSIX.
1b2de274 16322
762b15be
EZ
16323 * doc.c (get_doc_string): Improve the format passed to `error'.
16324
16325 * doprnt.c (doprnt): Improve commentary.
16326
16327 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
16328
16329 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
16330 them with etags.
16331
f1052e5d
EZ
16332 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
16333 changes in globals.h immediately force recompilation.
762b15be
EZ
16334 (TAGS): Depend on $(CURDIR)/m/intel386.h and
16335 $(CURDIR)/s/ms-w32.h.
16336 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 16337
fa6996bc
EZ
16338 * character.c (Fchar_direction): Function deleted.
16339 (syms_of_character): Don't defsubr it.
16340 <char-direction-table>: Deleted.
16341
e6c3da20
EZ
163422011-04-23 Eli Zaretskii <eliz@gnu.org>
16343
16344 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
16345 * doprnt.c: Include limits.h.
16346 (SIZE_MAX): New macro.
04f2d78b
CB
16347 (doprnt): Return a size_t value. 2nd arg is now size_t.
16348 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
16349 Improve overflow protection. Support `l' modifier for integer
16350 conversions. Support %l conversion. Don't assume an EMACS_INT
16351 argument for integer conversions and for %c.
16352
16353 * lisp.h (doprnt): Restore prototype.
16354
16355 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16356 $(SRC)/character.h.
16357
16358 * Makefile.in (base_obj): Add back doprnt.o.
16359
16360 * deps.mk (doprnt.o): Add back prerequisites.
16361 (callint.o): Depend on character.h.
16362
16363 * eval.c (internal_lisp_condition_case): Include the handler
16364 representation in the error message.
16365 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
16366 when breaking from the loop.
16367
16368 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
16369
16370 * callint.c (Fcall_interactively): When displaying error message
16371 about invalid control letter, pass the character's codepoint, not
16372 a pointer to its multibyte form. Improve display of the character
16373 in octal and display also its hex code.
16374
16375 * character.c (char_string): Use %x to display the (unsigned)
16376 codepoint of an invalid character, to avoid displaying a bogus
16377 negative value.
16378
16379 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16380 `error', not SYMBOL_NAME itself.
16381
16382 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16383 character arguments to `error'.
16384
16385 * charset.c (check_iso_charset_parameter): Fix incorrect argument
16386 to `error' in error message about FINAL_CHAR argument. Make sure
16387 FINAL_CHAR is a character, and use %c when it is passed as
16388 argument to `error'.
16389
4ffd0d6b 163902011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
16391
16392 * s/ms-w32.h (localtime): Redirect to sys_localtime.
16393
16394 * w32.c: Include <time.h>.
16395 (sys_localtime): New function.
16396
4ffd0d6b 163972011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
16398
16399 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16400
4ffd0d6b 16401 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 16402
4ffd0d6b 164032011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 16404
4ffd0d6b
GM
16405 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16406 zombies (Bug#8467).
aac0c6e3 16407
04c56954
EZ
164082011-04-19 Eli Zaretskii <eliz@gnu.org>
16409
16410 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16411 gl_state.e_property when gl_state.object is Qt.
16412
16413 * insdel.c (make_gap_larger): Remove limitation of buffer size
16414 to <= INT_MAX.
16415
16a43933
CY
164162011-04-18 Chong Yidong <cyd@stupidchicken.com>
16417
16418 * xdisp.c (lookup_glyphless_char_display)
16419 (produce_glyphless_glyph): Handle cons cell entry in
16420 glyphless-char-display.
16421 (Vglyphless_char_display): Document it.
16422
16423 * term.c (produce_glyphless_glyph): Handle cons cell entry in
16424 glyphless-char-display.
16425
4581706e
CY
164262011-04-17 Chong Yidong <cyd@stupidchicken.com>
16427
16428 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16429
16430 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16431
16432 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16433 definition for no-X builds.
16434
4887c6e2 164352011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 16436
fd35b6f9
PE
16437 Static checks with GCC 4.6.0 and non-default toolkits.
16438
5c1ccb01
PE
16439 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16440
006c5daa
PE
16441 * process.c (keyboard_bit_set): Define only if SIGIO.
16442 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16443 (send_process): Repair possible setjmp clobbering.
16444
efc736d3
PE
16445 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16446
4e2fe2e6
PE
16447 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16448
f97334a2
PE
16449 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16450
4e75f29d
PE
16451 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16452 Define only if needed.
16453
90efadd1
PE
16454 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16455 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 16456 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 16457
3c647824
PE
16458 * dispextern.h (struct redisplay_interface): Rename param
16459 to avoid shadowing.
e264f262 16460 * termhooks.h (struct terminal): Likewise.
761383f4 16461 * xterm.c (xembed_send_message): Likewise.
3c647824 16462
b58c5c4a
PE
16463 * insdel.c (make_gap_smaller): Define only if
16464 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16465
cad59032
PE
16466 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16467 it.
16468
c339dc2e
PE
16469 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16470 so that we aren't warned about unused symbols.
16471
91a3e27b
PE
16472 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16473
399c71d3 16474 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 16475
8ffc96f5
PE
16476 * xfns.c (x_real_positions): Mark locals as initialized.
16477
eef9bc79
PE
16478 * xmenu.c (xmenu_show): Don't use uninitialized vars.
16479
098db9dd
PE
16480 * xterm.c: Fix problems found by static analysis with other toolkits.
16481 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
16482 (x_dispatch_event): Declare static if USE_GTK, and
16483 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 16484 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 16485 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
16486 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16487 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 16488
eb18f6cc
PE
16489 * xmenu.c (menu_help_callback): Pointer type fixes.
16490 Use const pointers when pointing at readonly data. Avoid pointer
16491 signedness clashes.
16492 (FALSE): Remove unused macro.
16493 (update_frame_menubar): Remove unused decl.
16494
1fe72bf8
PE
16495 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
16496
60d9e1db
PE
16497 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
16498 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
16499 (single_menu_item): Rename local to avoid shadowing.
16500
39261c26
PE
16501 * keyboard.c (make_lispy_event): Remove unused local var.
16502
018c5e19
PE
16503 * frame.c, frame.h (x_get_resource_string): Bring this back, but
16504 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
16505
63d2b86e
PE
16506 * bitmaps: Change bitmaps from unsigned char back to the X11
16507 compatible char. Avoid the old compiler warnings about
16508 out-of-range initializers by using, for example, '\xab' rather
16509 than 0xab.
16510
aefd87e1
PE
16511 * xgselect.c (xgselect_initialize): Check vs interface
16512 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
16513
bf501fb9
PE
16514 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
16515
e9829fdf
PE
16516 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
16517 to read-only memory.
16518
1086c095
PE
16519 * fns.c (vector): Remove; this old hack is no longer needed.
16520
2baccd04 16521 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 16522 Remove unused var.
dde42981 16523 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 16524
72391843 16525 * xrdb.c (x_load_resources): Omit unused local.
3565b346 16526
436c16df 16527 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 16528 (x_window): Rename locals to avoid shadowing.
dc5ddd85 16529 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 16530
92bb796d 16531 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 16532 (x_term_init): Remove local to avoid shadowing.
92bb796d 16533
764430a3 16534 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
16535
16536 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
16537 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
16538
d1dfb56c
EZ
165392011-04-16 Eli Zaretskii <eliz@gnu.org>
16540
c4354cb4
EZ
16541 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
16542
d1dfb56c
EZ
16543 Fix regex.c, syntax.c and friends for buffers > 2GB.
16544 * syntax.h (struct gl_state_s): Declare character position members
16545 EMACS_INT.
16546
16547 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
16548
04f2d78b
CB
16549 * textprop.c (verify_interval_modification, interval_of):
16550 Declare arguments EMACS_INT.
d1dfb56c
EZ
16551
16552 * intervals.c (adjust_intervals_for_insertion): Declare arguments
16553 EMACS_INT.
16554
16555 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
16556
16557 * indent.c (Fvertical_motion): Local variable it_start is now
16558 EMACS_INT.
16559
16560 * regex.c (re_match, re_match_2, re_match_2_internal)
16561 (bcmp_translate, regcomp, regexec, print_double_string)
16562 (group_in_compile_stack, re_search, re_search_2, regex_compile)
16563 (re_compile_pattern, re_exec): Declare arguments and local
16564 variables `size_t' and `ssize_t' and return values `regoff_t', as
16565 appropriate.
16566 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16567 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16568 <compile_stack_type>: `size' and `avail' are now `size_t'.
16569
16570 * regex.h <regoff_t>: Use ssize_t, not int.
16571 (re_search, re_search_2, re_match, re_match_2): Arguments that
16572 specify buffer/string position and length are now ssize_t and
16573 size_t. Return type is regoff_t.
16574
613052cd
BK
165752011-04-16 Ben Key <bkey76@gmail.com>
16576
16577 * nsfont.m: Fixed bugs in ns_get_family and
16578 ns_descriptor_to_entity that were caused by using free to
16579 deallocate memory blocks that were allocated by xmalloc (via
16580 xstrdup). This caused Emacs to crash when compiled with
16581 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16582 --enable-checking=xmallocoverrun). xfree is now used to
16583 deallocate these memory blocks.
16584
4170f62f 165852011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 16586
71b41406
PE
16587 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16588
9587a89d
PE
16589 emacs_write: Accept and return EMACS_INT for sizes.
16590 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16591 et seq.
16592 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16593 Accept and return EMACS_INT.
16594 (emacs_gnutls_write): Return the number of bytes written on
16595 partial writes.
16596 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
16597 (emacs_read, emacs_write): Remove check for negative size, as the
16598 Emacs source code has been audited now.
9587a89d
PE
16599 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16600 (emacs_read, emacs_write): Use it.
273a5f82
PE
16601 * process.c (send_process): Adjust to the new signatures of
16602 emacs_write and emacs_gnutls_write. Do not attempt to store
16603 a byte offset into an 'int'; it might overflow.
9587a89d 16604 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 16605
3e047f51
PE
16606 * sound.c: Don't assume sizes fit in 'int'.
16607 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 16608 Return EMACS_INT, not int.
3e047f51 16609 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
16610 Accept EMACS_INT, not int.
16611 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
16612 record read return values.
16613
cc39a9db
BK
166142011-04-15 Ben Key <bkey76@gmail.com>
16615
c9d0ec6d
JB
16616 * keyboard.c (Qundefined): Don't declare static since it is used
16617 in nsfns.m.
16618 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16619 static since they are used in nsfont.m.
cc39a9db 16620
6c60eb9f
SM
166212011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
16622
16623 * process.c (Qprocessp): Don't declare static.
16624 * lisp.h (Qprocessp): Declare again.
16625
7990b61a
JB
166262011-04-15 Juanma Barranquero <lekktu@gmail.com>
16627
16628 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16629
5d4cb038
PE
166302011-04-14 Paul Eggert <eggert@cs.ucla.edu>
16631
8bd7b830 16632 Improve C-level modularity by making more things 'static'.
cd64ea1d 16633
e3b27b31
PE
16634 Don't publish debugger-only interfaces to other modules.
16635 * lisp.h (safe_debug_print, debug_output_compilation_hack):
16636 (verify_bytepos, count_markers): Move decls to the only modules
16637 that need them.
16638 * region-cache.h (pp_cache): Likewise.
16639 * window.h (check_all_windows): Likewise.
16640 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16641
5d4cb038
PE
16642 * sysdep.c (croak): Now static, if
16643 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16644 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
16645
16646 * alloc.c (refill_memory_reserve): Now static if
16647 !defined REL_ALLOC || defined SYSTEM_MALLOC.
16648 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 16649
e87b6180
PE
16650 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
16651 Define only if USE_LUCID.
16652
ac64929e
PE
16653 * xrdb.c (x_customization_string, x_rm_string): Now static.
16654
6f37259d
PE
16655 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
16656 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
16657
1683e3ab
PE
16658 * xdisp.c (draw_row_with_mouse_face): Now static.
16659 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
16660
de9c2632
PE
16661 * window.h (check_all_windows): Mark externally visible.
16662
2b96acb7
PE
16663 * window.c (window_deletion_count): Now static.
16664
16665 * undo.c: Make symbols static if they're not exported.
16666 (last_undo_buffer, last_boundary_position, pending_boundary):
16667 Now static.
16668
50436f33
PE
16669 * textprop.c (interval_insert_behind_hooks): Now static.
16670 (interval_insert_in_front_hooks): Likewise.
16671
64520e5c
PE
16672 * term.c: Make symbols static if they're not exported.
16673 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
16674 (max_frame_lines, tty_set_terminal_modes):
16675 (tty_reset_terminal_modes, tty_turn_off_highlight):
16676 (get_tty_terminal): Now static.
16677 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
16678 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 16679 HAVE_WINDOW_SYSTEM.
64520e5c
PE
16680 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16681 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16682
1fa53021
PE
16683 * sysdep.c: Make symbols static if they're not exported.
16684 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16685 Now static.
16686 (sigprocmask_set, full_mask): Remove; unused.
16687 (wait_debugging): Mark as visible.
16688 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16689 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16690
d4b43b22
PE
16691 * syntax.c (syntax_temp): Define only if !__GNUC__.
16692
b7c513d0
PE
16693 * sound.c (current_sound_device, current_sound): Now static.
16694
989b29ad
PE
16695 * search.c (searchbufs, searchbuf_head): Now static.
16696
13a55a78
PE
16697 * scroll.c (scroll_cost): Remove; unused.
16698 * dispextern.h (scroll_cost): Remove decl.
16699
de68a1fc
PE
16700 * region-cache.h (pp_cache): Mark as externally visible.
16701
40ccffa6
PE
16702 * process.c: Make symbols static if they're not exported.
16703 (process_tick, update_tick, create_process, chan_process):
16704 (Vprocess_alist, proc_buffered_char, datagram_access):
16705 (fd_callback_data, send_process_frame, process_sent_to): Now static.
16706 (deactivate_process): Mark defn as static, as well as decl.
16707 * lisp.h (create_process): Remove decl.
16708 * process.h (chan_process, Vprocess_alist): Remove decls.
16709
ad64fc97
PE
16710 * print.c: Make symbols static if they're not exported.
16711 (print_depth, new_backquote_output, being_printed, print_buffer):
16712 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16713 (print_interval, print_number_index, initial_stderr_stream):
16714 Now static.
16715 * lisp.h (Fprinc): Remove decl.
16716 (debug_output_compilation_hack): Mark as externally visible.
16717
adddb265
PE
16718 * sysdep.c (croak): Move decl from here to syssignal.h.
16719 * syssignal.h (croak): Put it here, so the API can be checked when
16720 'croak' is called from dissociate_if_controlling_tty.
16721
1717ede2
PE
16722 * minibuf.c: Make symbols static if they're not exported.
16723 (minibuf_save_list, choose_minibuf_frame): Now static.
16724 * lisp.h (choose_minibuf_frame): Remove decl.
16725
fa5fb2bc
PE
16726 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16727
1e3890d1
PE
16728 * lread.c: Make symbols static if they're not exported.
16729 (read_objects, initial_obarray, oblookup_last_bucket_number):
16730 Now static.
16731 (make_symbol): Remove; unused.
16732 * lisp.h (initial_obarray, make_symbol): Remove decls.
16733
8a1414fa
PE
16734 * keyboard.c: Make symbols static if they're not exported.
16735 (single_kboard, recent_keys_index, total_keys, recent_keys):
16736 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16737 (this_single_command_key_start, echoing, last_auto_save):
16738 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16739 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16740 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16741 (Vlispy_mouse_stem, double_click_count):
16742 Now static.
16743 (force_auto_save_soon): Define only if SIGDANGER.
16744 (ignore_mouse_drag_p): Now static if
16745 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16746 (print_help): Remove; unused.
16747 (stop_character, last_timer_event): Mark as externally visible.
16748 * keyboard.h (ignore_mouse_drag_p): Declare only if
16749 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16750 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16751 * lisp.h (echoing): Remove decl.
16752 (force_auto_save_soon): Declare only if SIGDANGER.
16753 * xdisp.c (redisplay_window): Simplify code, to make it more
16754 obvious that ignore_mouse_drag_p is not accessed if !defined
16755 USE_GTK && !defined HAVE_NS.
16756
93ea6e8f
PE
16757 * intervals.c: Make symbols static if they're not exported.
16758 (merge_properties_sticky, merge_interval_right, delete_interval):
16759 Now static.
16760 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16761
77382fcc
PE
16762 * insdel.c: Make symbols static if they're not exported.
16763 However, leave prepare_to_modify_buffer alone. It's never
16764 called from outside this function, but that appears to be a bug.
16765 (combine_after_change_list, combine_after_change_buffer):
4889fc82 16766 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
16767 (adjust_after_replace_noundo): Remove; unused.
16768 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 16769 (signal_before_change): Remove decls.
77382fcc 16770
9306c32e
PE
16771 * indent.c (val_compute_motion, val_vmotion): Now static.
16772
cd44d2eb
PE
16773 * image.c: Make symbols static if they're not exported.
16774 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16775 if USE_GTK.
16776 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16777 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16778
ad9a7a06
PE
16779 * fringe.c (standard_bitmaps): Now static.
16780 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16781
81626931
PE
16782 * frame.c: Make symbols static if they're not exported.
16783 (x_report_frame_params, make_terminal_frame): Now static.
16784 (get_frame_param): Now static, unless HAVE_NS.
16785 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16786 (x_get_resource_string): Remove; not used.
16787 * frame.h (make_terminal_frame, x_report_frame_params):
16788 (x_get_resource_string); Remove decls.
16789 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16790 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16791
239f9db9
PE
16792 * font.c, fontset.c: Make symbols static if they're not exported.
16793 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16794 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16795 * font.c (font_close_object): Now static.
16796 * font.h (font_close_object): Remove.
16797 * fontset.c (FONTSET_OBJLIST): Remove.
16798 (free_realized_fontset) #if-0 the body, which does nothing.
16799 (face_suitable_for_char_p): #if-0, as it's never called.
16800 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
16801 * xfaces.c (face_at_string_position):
16802 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
16803 since 0 is always ASCII.
16804
dfcf3579
PE
16805 * fns.c (weak_hash_tables): Now static.
16806
5045092b
PE
16807 * fileio.c: Make symbols static if they're not exported.
16808 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16809 (Vwrite_region_annotation_buffers): Now static.
16810
57a96f5c
PE
16811 * eval.c: Make symbols static if they're not exported.
16812 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16813 * lisp.h (backtrace_list): Remove decl.
16814
35f08c38
PE
16815 * emacs.c: Make symbols static if they're not exported.
16816 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16817 (fatal_error_code, fatal_error_signal_hook, standard_args):
16818 Now static.
16819 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16820 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16821 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16822 * lisp.h (fatal_error_signal_hook): Remove decl.
16823 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16824
f44bd759
PE
16825 * editfns.c: Move a (normally-unused) function to its only use.
16826 * editfns.c, lisp.h (get_operating_system_release): Remove.
16827 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16828 worth the hassle of breaking this out.
16829
b532497d
PE
16830 * xterm.c: Make symbols static if they're not exported.
16831 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16832 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16833 (x_destroy_window, x_delete_display):
16834 Now static.
16835 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16836 (x_mouse_leave): Remove; unused.
16837 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16838 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16839 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16840 Remove decls.
16841 (x_mouse_leave): Declare only if WINDOWSNT.
16842 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16843 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16844 USE_X_TOOLKIT.
16845
1675728f
PE
16846 * ftxfont.c: Make symbols static if they're not exported.
16847 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16848 HAVE_FREETYPE.
16849 * font.h (ftxfont_driver): Likewise.
16850
e4cebfca
PE
16851 * xfns.c: Make symbols static if they're not exported.
16852 (x_last_font_name, x_display_info_for_name):
16853 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16854 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16855 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16856 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16857 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16858 (last_show_tip_args): Now static.
16859 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16860 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16861 (x_screen_planes): Remove; unused.
16862 * dispextern.h (x_screen_planes): Remove decl.
16863
5bf46f05
PE
16864 * dispnew.c: Make symbols static if they're not exported.
16865 * dispextern.h (redraw_garbaged_frames, scrolling):
16866 (increment_row_positions): Remove.
16867 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16868 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16869 Now static.
16870 (redraw_garbaged_frames): Remove; unused.
16871
435f4c28
PE
16872 * xfaces.c: Make symbols static if they're not exported.
16873 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16874 Remove decls.
16875 * xterm.h (defined_color): Remove decls.
16876 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16877 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16878 (menu_face_changed_default, defined_color, free_realized_face):
16879 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16880 (ascii_face_of_lisp_face): Remove; unused.
16881
8524aef3
PE
16882 * xdisp.c: Make symbols static if they're not exported.
16883 * dispextern.h (scratch_glyph_row, window_box_edges):
16884 (glyph_to_pixel_coords, set_cursor_from_row):
16885 (get_next_display_element, set_iterator_to_next):
16886 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16887 (show_mouse_face): Remove decls
16888 * frame.h (message_buf_print): Likewise.
16889 * lisp.h (pop_message, set_message, check_point_in_composition):
16890 Likewise.
16891 * xterm.h (set_vertical_scroll_bar): Likewise.
16892 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16893 (message_buf_print, scratch_glyph_row, displayed_buffer):
16894 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16895 (get_next_display_element, show_mouse_face, window_box_edges):
16896 (frame_to_window_pixel_xy, check_point_in_composition):
16897 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16898 (glyph_to_pixel_coords): Remove; unused.
16899
16390cd2
PE
16900 * dired.c (file_name_completion): Now static.
16901
16902 * dbusbind.c (xd_in_read_queued_messages): Now static.
16903
a25f4dfa
PE
16904 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16905 * data.c (circular_list_error): Remove.
16906
14a9c8df
PE
16907 * commands.h (last_point_position, last_point_position_buffer):
16908 (last_point_position_window): Remove decls.
16909 * keyboard.c: Make these variables static.
16910
04f2d78b
CB
16911 * coding.h (coding, code_convert_region, encode_coding_gap):
16912 Remove decls.
74ab6df5
PE
16913 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16914 (iso_code_class, detect_coding, code_convert_region): Now static.
16915 (encode_coding_gap): Remove; unused.
16916
38dfbee1
PE
16917 * chartab.c (chartab_chars, chartab_bits): Now static.
16918
a2cb4e63
PE
16919 * charset.h (charset_iso_8859_1): Remove decl.
16920 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16921 Now static.
16922
127198fd
PE
16923 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16924 * ccl.c (Vccl_program_table): Now static.
16925 (check_ccl_update): Remove; unused.
16926
d85b608f
PE
16927 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16928 * category.h: ... from here.
16929 * category.c (check_category_table, set_category_set): Now static.
16930
31cd66f3
PE
16931 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16932 * lisp.h: Remove these decls.
16933
c358e587
PE
16934 * buffer.c (buffer_count): Remove unused var.
16935
e78aecca
PE
16936 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16937 so that it's not optimized away.
16938 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16939 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16940 exported only to the debugger.
16941
e192d7d3 16942 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 16943 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 16944
92470028
PE
16945 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16946 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16947 was inaccessible from Lisp.
16948 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16949 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16950
244ed907
PE
16951 alloc.c: Import and export fewer symbols, and remove unused items.
16952 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16953 is defined.
16954 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16955 it's not optimized away by whole-program optimization.
16956 (message_enable_multibyte, free_misc): Remove.
16957 (catchlist, handlerlist, mark_backtrace):
16958 Declare only if BYTE_MARK_STACK.
16959 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16960 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16961 (message_enable_multibyte): Remove decl.
16962 (free_misc, interval_free_list, float_block, float_block_index):
16963 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16964 (cons_free_list, last_marked_index):
16965 Now static.
16966 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16967 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16968 (mark_backtrace): Define only if BYTE_MARK_STACK.
16969 * xdisp.c (message_enable_multibyte): Now static.
16970
61c2b50e 16971 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
16972 This makes it easier for human readers (and static analyzers)
16973 to see whether these variables are used from other modules.
16974 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16975 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16976 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16977 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16978 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16979 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16980 * xmenu.c, xselect.c:
16981 Declare Q* vars static if they are not used in other modules.
16982 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16983 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16984 Remove decls of unexported vars.
16985 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16986
95c82688
PE
16987 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16988
16a97296
PE
16989 Make Emacs functions such as Fatom 'static' by default.
16990 This makes it easier for human readers (and static analyzers)
16991 to see whether these functions can be called from other modules.
16992 DEFUN now defines a static function. To make the function external
16993 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
16994 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16995 (Finit_image_library):
16a97296
PE
16996 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16997 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16998 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16999 Remove decls, since these functions are now static.
17000 (Funintern, Fget_internal_run_time): New decls, since these functions
17001 were already external.
95c82688 17002
16a97296
PE
17003 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17004 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17005 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17006 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17007 * keyboard.c, keymap.c, lread.c:
17008 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17009 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17010 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17011 Mark functions with DEFUE instead of DEFUN,
17012 if they are used in other modules.
17013 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17014 decls for now-static functions.
17015 * buffer.h (Fdelete_overlay): Remove decl.
17016 * callproc.c (Fgetenv_internal): Mark as internal.
17017 * composite.c (Fremove_list_of_text_properties): Remove decl.
17018 (Fcomposition_get_gstring): New forward static decl.
17019 * composite.h (Fcomposite_get_gstring): Remove decl.
17020 * dired.c (Ffile_attributes): New forward static decl.
17021 * doc.c (Fdocumntation_property): New forward static decl.
17022 * eval.c (Ffetch_bytecode): New forward static decl.
17023 (Funintern): Remove extern decl; now in .h file where it belongs.
17024 * fileio.c (Fmake_symbolic_link): New forward static decl.
17025 * image.c (Finit_image_library): New forward static decl.
17026 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17027 * intervals.h (Fprevious_property_change):
17028 (Fremove_list_of_text_properties): Remove decls.
17029 * keyboard.c (Fthis_command_keys): Remove decl.
17030 (Fcommand_execute): New forward static decl.
17031 * keymap.c (Flookup_key): New forward static decl.
17032 (Fcopy_keymap): Now static.
17033 * keymap.h (Flookup_key): Remove decl.
17034 * process.c (Fget_process): New forward static decl.
17035 (Fprocess_datagram_address): Mark as internal.
17036 * syntax.c (Fsyntax_table_p): New forward static decl.
17037 (skip_chars): Remove duplicate decl.
17038 * textprop.c (Fprevious_property_change): New forward static decl.
17039 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17040 Now internal.
17041 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17042 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17043
785bbd42
PE
17044 * editfns.c (Fformat): Remove unreachable code.
17045
8b913b57
AS
170462011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17047
17048 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17049 change. (Bug#8496)
17050
a6744a35
EZ
170512011-04-13 Eli Zaretskii <eliz@gnu.org>
17052
17053 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17054 when at ZV. (Bug#8487)
17055
e7974947
AS
170562011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17057
baad03f0
AS
17058 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17059 (Bug#8437)
17060 * keyboard.c (parse_tool_bar_item): Likewise.
17061 * sound.c (sound_cleanup, alsa_close): Likewise.
17062 * termcap.c (tgetent): Likewise.
17063 * xfns.c (x_default_font_parameter): Likewise.
17064 * xsettings.c (read_and_apply_settings): Likewise.
17065
e7974947
AS
17066 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17067 (overrun_check_free): Protoize.
17068
28272684
PE
170692011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17070
17071 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17072 since callers should never pass a negative size.
17073 Change the signature to match that of plain 'read' and 'write'; see
17074 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17075 * lisp.h: Update prototypes of emacs_write and emacs_read.
17076
11997c76
EZ
170772011-04-11 Eli Zaretskii <eliz@gnu.org>
17078
17079 * xdisp.c (redisplay_window): Don't try to determine the character
17080 position of the scroll margin if the window start point w->startp
e896f03c 17081 is outside the buffer's accessible region. (Bug#8468)
11997c76 17082
8a2cbd72
EZ
170832011-04-10 Eli Zaretskii <eliz@gnu.org>
17084
17085 Fix write-region and its subroutines for buffers > 2GB.
17086 * fileio.c (a_write, e_write): Modify declaration of arguments and
17087 local variables to support buffers larger than 2GB.
17088 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17089
17090 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17091 argument, local variables, and return value.
17092
17093 * lisp.h: Update prototypes of emacs_write and emacs_read.
17094
17095 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17096
4073e537 170972011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 17098
1ebfdcb6
PE
17099 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17100
b2ded58d
PE
17101 Fix more problems found by GCC 4.6.0's static checks.
17102
7d66342c
PE
17103 * xdisp.c (vmessage): Use a better test for character truncation.
17104
bbf47d44
PE
17105 * charset.c (load_charset_map): <, not <=, for optimization,
17106 and to avoid potential problems with integer overflow.
9248994d 17107 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 17108 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 17109 * editfns.c (Fformat): Likewise.
1e69125e 17110 * syntax.c (skip_chars): Likewise.
3befa583 17111
e3019616
PE
17112 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17113 This also lets GCC 4.6.0 generate slightly better loop code.
17114
becfa255
PE
17115 * callint.c (Fcall_interactively): <, not <=, for optimization.
17116 (Fcall_interactively): Count the number of arguments produced,
17117 not the number of arguments given. This is simpler and lets GCC
17118 4.6.0 generate slightly better code.
17119
dae0cd48
PE
17120 * ftfont.c: Distingish more carefully between FcChar8 and char.
17121 The previous code passed unsigned char * to a functions like
17122 strlen and xstrcasecmp that expect char *, which does not
17123 conform to the C standard.
17124 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17125 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17126 char * when the C standard requires it.
17127
76032d70
PE
17128 * keyboard.c (read_char): Remove unused var.
17129
eb3f1cc8
PE
17130 * eval.c: Port to Windows vsnprintf (Bug#8435).
17131 Include <limits.h>.
17132 (SIZE_MAX): Define if the headers do not.
17133 (verror): Do not give up if vsnprintf returns a negative count.
17134 Instead, grow the buffer. This ports to Windows vsnprintf, which
17135 does not conform to C99. Problem reported by Eli Zaretskii.
17136 Also, simplify the allocation scheme, by avoiding the need for
17137 calling realloc, and removing the ALLOCATED variable.
17138
70476b54
PE
17139 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17140
12020a9e
PE
17141 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17142 But keep the doprint source code for now, as we might revamp it
17143 and use it again (Bug#8435).
ea6c7ae6
PE
17144 * lisp.h (doprnt): Remove.
17145 * Makefile.in (base_obj): Remove doprnt.o.
17146 * deps.mk (doprnt.o): Remove.
17147
5fdb398c
PE
17148 error: Print 32- and 64-bit integers portably (Bug#8435).
17149 Without this change, on typical 64-bit hosts error ("...%d...", N)
17150 was used to print both 32- and 64-bit integers N, which relied on
17151 undefined behavior.
61bdb816 17152 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
17153 * lisp.h (error, verror): Mark as printf-like functions.
17154 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
17155 Report overflow in size calculations when allocating printf buffer.
17156 Do not truncate output string at its first null byte.
17157 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
17158 Truncate the output at a character boundary, since vsnprintf does not
17159 do that.
17160 * charset.c (check_iso_charset_parameter): Convert internal
17161 character to string before calling 'error', since %c now has the
17162 printf meaning.
17163 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
17164 overflow when computing char to be passed to 'error'. Do not
17165 pass Lisp_Object to 'error'; pass the integer instead.
17166 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
17167 formatted with plain %d.
17168
b189fa66
PE
17169 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
17170
bff87ef0
PE
17171 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
17172
7e2cac20
PE
17173 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
17174
ce4d90b5
PE
17175 * xterm.c (x_catch_errors): Remove duplicate declaration.
17176
266c9547
PE
17177 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
17178
79c49ad2
PE
17179 * xdisp.c, lisp.h (message_nolog): Remove; unused.
17180
368f4090
JM
171812011-04-10 Jim Meyering <meyering@redhat.com>
17182
17183 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
17184 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
17185 return ssize_t not "int", and use size_t as the buffer length.
17186 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
17187 * gnutls.h: Update declarations.
17188 * process.c (read_process_output): Use ssize_t, to match.
17189 (send_process): Likewise.
17190
a32d4040
CY
171912011-04-09 Chong Yidong <cyd@stupidchicken.com>
17192
17193 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
17194
8546720e 171952011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 17196
04f2d78b
CB
17197 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
17198 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 17199
8546720e
GM
17200 * xterm.c (handle_one_xevent):
17201 * xmenu.c (create_and_show_popup_menu):
17202 * xselect.c (x_decline_selection_request)
17203 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 17204
0a2f5c1a 172052011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
17206
17207 Fix some uses of `int' instead of EMACS_INT.
17208 * search.c (string_match_1, fast_string_match)
17209 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
17210 (scan_buffer, find_next_newline_no_quit)
17211 (find_before_next_newline, search_command, Freplace_match)
17212 (Fmatch_data): Make some `int' variables be EMACS_INT.
17213
17214 * xdisp.c (display_count_lines): 3rd argument and return value now
17215 EMACS_INT. All callers changed.
17216 (pint2hrstr): Last argument is now EMACS_INT.
17217
17218 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
17219 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
17220 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
17221 (decode_coding_utf_16, decode_coding_emacs_mule)
17222 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
17223 (decode_coding_ccl, decode_coding_charset)
17224 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
17225 (decode_coding_iso_2022, decode_coding_emacs_mule)
17226 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
17227 <char_offset, last_offset>: Declare EMACS_INT.
17228 (encode_coding_utf_8, encode_coding_utf_16)
17229 (encode_coding_emacs_mule, encode_invocation_designation)
17230 (encode_designation_at_bol, encode_coding_iso_2022)
17231 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
17232 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
17233 Declare EMACS_INT.
17234 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
17235 (encode_invocation_designation): Last argument P_NCHARS is now
17236 EMACS_INT.
17237 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
17238 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
17239
17240 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
17241 All users changed.
17242
17243 * ccl.c (Fccl_execute_on_string): Declare some variables
17244 EMACS_INT.
17245
8546720e 172462011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
17247
17248 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
17249
4e19a977
CS
172502011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
17251
17252 * process.c (Fformat_network_address): Doc fix.
17253
87302331
R
172542011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
17255
ee7683eb 17256 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 17257
cbb59342
CY
172582011-04-08 Chong Yidong <cyd@stupidchicken.com>
17259
17260 * keyboard.c (read_char): Call Lisp function help-form-show,
17261 instead of using internal_with_output_to_temp_buffer.
17262 (Qhelp_form_show): New var.
e0d38eeb 17263 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
17264
17265 * print.c (internal_with_output_to_temp_buffer): Function deleted.
17266
17267 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
17268
e67a13ab
CY
172692011-04-06 Chong Yidong <cyd@stupidchicken.com>
17270
04f2d78b
CB
17271 * process.c (Flist_processes): Remove to Lisp.
17272 (list_processes_1): Delete.
e67a13ab 17273
973f782d
EZ
172742011-04-06 Eli Zaretskii <eliz@gnu.org>
17275
7c106b1e
EZ
17276 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
17277
973f782d
EZ
17278 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
17279
41cf7d1a 172802011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 17281
ca23cc88
PE
17282 Fix more problems found by GCC 4.6.0's static checks.
17283
f390e2d5
PE
17284 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
17285
42eea0d0
PE
17286 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
17287
b69769da 17288 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 17289
f9541e84
PE
17290 * xdisp.c (vmessage): Mark as a printf-like function.
17291
13841b55
PE
17292 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
17293
c136c10f
PE
17294 * sound.c (sound_warning): Don't crash if arg contains a printf format.
17295
5e2d4a30
PE
17296 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
17297 printf-like functions.
17298 (tiff_load): Add casts to remove these marks before passing them
17299 to system-supplied API.
17300
583f48b9
PE
17301 * eval.c (Fsignal): Remove excess argument to 'fatal'.
17302
b25d760e
PE
17303 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
17304 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
17305 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
17306 directly, rather than having caller test rule sign. This avoids
17307 some unnecessary tests.
17308 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
17309 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
17310 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 17311
bc7b6697 17312 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 17313 (xfont_open): Avoid unnecessary tests.
bc7b6697 17314
27ccc379
PE
17315 * composite.c (composition_gstring_put_cache): Use unsigned integer.
17316
dcd5c89a
PE
17317 * composite.h, composite.c (composition_gstring_put_cache):
17318 Use EMACS_INT, not int, for length.
17319
b13a45c6
PE
17320 * composite.h (COMPOSITION_DECODE_REFS): New macro,
17321 breaking out part of COMPOSITION_DECODE_RULE.
17322 (COMPOSITION_DECODE_RULE): Use it.
17323 * composite.c (get_composition_id): Remove unused local vars,
17324 by using the new macro.
17325
1e792e4d
PE
17326 * textprop.c (set_text_properties_1): Change while to do-while,
17327 since the condition is always true at first.
17328
dc6c6455 17329 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
17330 (interval_deletion_adjustment): Return unsigned value.
17331 All uses changed.
dc6c6455 17332
aba7731a
PE
17333 * process.c (list_processes_1, create_pty, read_process_output):
17334 (exec_sentinel): Remove vars that were set but not used.
afd4052b 17335 (create_pty): Remove unnecessary "volatile"s.
bc57d757 17336 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 17337 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 17338 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 17339
fdfc4bf3
PE
17340 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
17341
fca8fe46 17342 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 17343 (update_syntax_table): Use unsigned instead of int.
fca8fe46 17344
06a0259a 17345 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 17346 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 17347 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 17348
e7b9e80f
PE
17349 * print.c (print_error_message): Avoid int overflow.
17350
56201685
PE
17351 * font.c (font_list_entities): Redo for clarity,
17352 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17353
78834453 17354 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 17355 (font_score): Avoid potential overflow in diff calculation.
78834453 17356
0bc0b309 17357 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 17358 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 17359
e610eaca
PE
17360 * eval.c (funcall_lambda): Rename local to avoid shadowing.
17361
b895abce
PE
17362 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
17363 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
17364 can always succeed if overflow has undefined behavior.
17365
1f1d9321 17366 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 17367 (wordify): Omit three unnecessary tests.
1f1d9321 17368
c59478bc
PE
17369 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
17370 All callers changed. This avoids the need for an unused var.
17371
79b73827
PE
17372 * casefiddle.c (casify_region): Remove var that is set but not used.
17373
a4db5dfe
PE
17374 * dired.c (file_name_completion): Remove var that is set but not used.
17375
43aae36e
PE
17376 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17377
2a47c44d 17378 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 17379 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 17380
a37c69bf
PE
17381 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17382 Check for integer overflow on size calculations.
17383
328ab8e7
PE
17384 * buffer.c (Fprevious_overlay_change): Remove var that is set
17385 but not used.
17386
e5a2a5cb
PE
17387 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17388 Remove vars that are set but not used.
8d84a6eb 17389 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 17390 (timer_check_2): Mark vars as initialized.
e5a2a5cb 17391
a60e5f68
PE
17392 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17393
f661cb61 17394 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 17395 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 17396
f0397f5a
PE
17397 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17398 that are set but not used.
17399
8664db06 17400 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 17401 if XCreateBitmapFromData fails (Bug#8410).
8664db06 17402
6abdaa4a
PE
17403 * xselect.c (x_get_local_selection, x_handle_property_notify):
17404 Remove vars that are set but not used.
17405
0ce7538d 17406 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 17407 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 17408
9ae848fc
PE
17409 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17410 Remove var that is set but not used.
0b918413
PE
17411 (scroll_bar_windows_size): Now size_t, not int.
17412 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
17413 Check for overflow.
9ae848fc 17414
a5a62657
PE
17415 * xfaces.c (realize_named_face): Remove vars that are set but not used.
17416 (map_tty_color) [!defined MSDOS]: Likewise.
17417
5c5cdd39
PE
17418 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17419
66ebf983
PE
17420 * coding.c: Remove vars that are set but not used.
17421 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17422 All callers changed.
17423 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17424 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17425 (decode_coding_charset): Remove vars that are set but not used.
17426
1be4d761
PE
17427 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17428 that is set but not used.
17429
47553fa8
PE
17430 * print.c (print_object): Remove var that is set but not used.
17431
1f7196bf 17432 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
17433 The gnulib version avoids calling malloc in the usual case,
17434 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17435 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17436 * filelock.c (current_lock_owner): Likewise.
17437 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17438 * sysdep.c: Include allocator.h, careadlinkat.h.
17439 (emacs_no_realloc_allocator): New static constant.
17440 (emacs_readlink): New function.
fdb61804
PE
17441 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17442 ../lib/careadlinkat.h.
d1fdcab7 17443
f84c17c7
SM
174442011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
17445
17446 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17447 first non-nil return value).
17448
ef3862ad
JD
174492011-04-03 Jan Djärv <jan.h.d@swipnet.se>
17450
17451 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17452 if not defined (Bug#8403).
17453
376a7006
JB
174542011-04-02 Juanma Barranquero <lekktu@gmail.com>
17455
17456 * xdisp.c (display_count_lines): Remove parameter `start',
17457 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17458 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17459 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17460 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17461 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17462 and thereabouts. All callers changed.
17463 (get_per_char_metric): Remove parameter `f', unused since
17464 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17465
6ca3801d
JM
174662011-04-02 Jim Meyering <meyering@redhat.com>
17467
17468 do not dereference NULL upon failed strdup
17469 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17470 (ns_get_family): Likewise.
17471
d8e2b5ba
JB
174722011-04-02 Juanma Barranquero <lekktu@gmail.com>
17473
17474 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17475
8c74fcbd
JD
174762011-04-02 Jan Djärv <jan.h.d@swipnet.se>
17477
17478 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17479 later (Bug#8403).
17480
7200d79c
SM
174812011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
17482
03408648 17483 Add lexical binding.
7200d79c 17484
03408648
SM
17485 * window.c (Ftemp_output_buffer_show): New fun.
17486 (Fsave_window_excursion):
17487 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17488
17489 * lread.c (lisp_file_lexically_bound_p): New function.
17490 (Fload): Bind Qlexical_binding.
17491 (readevalloop): Remove `evalfun' arg.
17492 Bind Qinternal_interpreter_environment.
17493 (Feval_buffer): Bind Qlexical_binding.
17494 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
17495 Mark as dynamic.
17496 (syms_of_lread): Declare `lexical-binding'.
17497
17498 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
17499
17500 * keyboard.c (eval_dyn): New fun.
17501 (menu_item_eval_property): Use it.
ca105506
SM
17502
17503 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 17504
03408648
SM
17505 * fns.c (concat, mapcar1): Accept byte-code-functions.
17506
17507 * eval.c (Fsetq): Handle lexical vars.
17508 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
17509 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
17510 (FletX, Flet): Obey lexical binding.
17511 (Fcommandp): Handle closures.
17512 (Feval): New `lexical' arg.
17513 (eval_sub): New function extracted from Feval. Use it almost
17514 everywhere where Feval was used. Look up vars in lexical env.
17515 Handle closures.
17516 (Ffunctionp): Move from subr.el.
17517 (Ffuncall): Handle closures.
17518 (apply_lambda): Remove `eval_flags'.
17519 (funcall_lambda): Handle closures and new byte-code-functions.
17520 (Fspecial_variable_p): New function.
17521 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
17522 but without exporting it to Lisp.
23aba0ea 17523
23aba0ea 17524 * doc.c (Fdocumentation, store_function_docstring):
03408648 17525 * data.c (Finteractive_form): Handle closures.
23aba0ea 17526
03408648
SM
17527 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
17528 interactive spec.
ba83908c 17529
04f2d78b
CB
17530 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
17531 New byte-codes.
03408648
SM
17532 (exec_byte_code): New function extracted from Fbyte_code to handle new
17533 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 17534
03408648 17535 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 17536
03408648 17537 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 17538
e2abce01
JB
175392011-03-31 Juanma Barranquero <lekktu@gmail.com>
17540
17541 * xdisp.c (redisplay_internal): Fix prototype.
17542
63696a73 175432011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 17544
63696a73 17545 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
17546 (try_scrolling): Use it when setting scroll_limit.
17547 Limit scrolling to 100 screen lines.
63696a73
EZ
17548 (redisplay_window): Even when falling back on "recentering",
17549 position point in the window according to scroll-conservatively,
17550 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
17551
17552 (try_scrolling): When point is above the window, allow searching
17553 as far as scroll_max, or one screenful, to compute vertical
17554 distance from PT to the scroll margin position. This prevents
17555 try_scrolling from unnecessarily failing when
17556 scroll-conservatively is set to a value slightly larger than the
17557 window height. Clean up the case of PT below the margin at bottom
17558 of window: scroll_max can no longer be INT_MAX. When aggressive
17559 scrolling is in use, don't let point enter the opposite scroll
17560 margin as result of the scroll.
17561 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
17562 threshold of 100 lines for never-recentering scrolling.
17563
e4cc2dfc
JB
175642011-03-31 Juanma Barranquero <lekktu@gmail.com>
17565
17566 * dispextern.h (move_it_by_lines):
17567 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17568 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
17569 (message_log_check_duplicate): Remove parameters `prev_bol' and
17570 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17571 (redisplay_internal): Remove parameter `preserve_echo_area',
17572 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
17573
17574 * indent.c (Fvertical_motion):
17575 * window.c (window_scroll_pixel_based, Frecenter):
17576 Don't pass `need_y_p' to `move_it_by_lines'.
17577
1c470562
SM
175782011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
17579
44f230aa
SM
17580 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17581 steal a few bits to be more compact.
17582 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17583 Remove unneeded casts.
17584
1c470562
SM
17585 * bytecode.c (Fbyte_code): CAR and CDR can GC.
17586
888adce9
ZK
175872011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
17588
17589 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17590 binding" message (bug#7967).
17591
f838ed7b
PE
175922011-03-30 Paul Eggert <eggert@cs.ucla.edu>
17593
77861b95
PE
17594 Fix more problems found by GCC 4.6.0's static checks.
17595
de6dbc14
PE
17596 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17597 Remove unused local var.
17598
f838ed7b
PE
17599 * editfns.c (Fmessage_box): Remove unused local var.
17600
792c7b2b
PE
17601 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17602 (note_mode_line_or_margin_highlight, note_mouse_highlight):
17603 Omit unused local vars.
c499e557 17604 * window.c (shrink_windows): Omit unused local var.
b01a1c29 17605 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
17606 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17607 Omit unused local var.
17608
ba0165e1
PE
17609 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17610 Don't assume string length fits in int.
32ad8845 17611 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 17612 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 17613
3c59b4c9
PE
17614 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17615 instead of alloca (Bug#8344).
17616
a3eed478 17617 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 17618 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 17619
eb4d412d
PE
17620 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17621
1658b401
PE
17622 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17623 concerns.
17624
17625 * term.c (produce_glyphless_glyph): Remove unnecessary test.
17626
17627 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 17628
9a2c6e05
PE
17629 * keyboard.c (syms_of_keyboard): Use the same style as later
17630 in this function when indexing through an array. This also
17631 works around GCC bug 48267.
17632
03d0a109
PE
17633 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17634
44f730c8
PE
17635 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17636
fe75f926
PE
17637 * chartab.c (sub_char_table_ref_and_range): Redo for slight
17638 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17639
ffa8c828
PE
17640 * keyboard.c, keyboard.h (num_input_events): Now size_t.
17641 This avoids undefined behavior on integer overflow, and is a bit
17642 more convenient anyway since it is compared to a size_t variable.
17643
c5101a77
PE
17644 Variadic C functions now count arguments with size_t, not int.
17645 This avoids an unnecessary limitation on 64-bit machines, which
17646 caused (substring ...) to crash on large vectors (Bug#8344).
17647 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
17648 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 17649 All variadic functions and their callers changed accordingly.
c5101a77
PE
17650 (struct gcpro.nvars): Now size_t, not int. All uses changed.
17651 * data.c (arith_driver, float_arith_driver): Likewise.
17652 * editfns.c (general_insert_function): Likewise.
17653 * eval.c (struct backtrace.nargs, interactive_p)
17654 (internal_condition_case_n, run_hook_with_args, apply_lambda)
17655 (funcall_lambda, mark_backtrace): Likewise.
17656 * fns.c (concat): Likewise.
17657 * frame.c (x_set_frame_parameters): Likewise.
17658 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
17659 0 if not found, not -1. All callers changed.
17660
dd3f25f7
PE
17661 * alloc.c (garbage_collect): Don't assume stack size fits in int.
17662 (stack_copy_size): Now size_t, not int.
17663 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
17664
461c2ab9
JB
176652011-03-28 Juanma Barranquero <lekktu@gmail.com>
17666
17667 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
17668 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17669 All callers changed.
17670
17671 * lisp.h (multibyte_char_to_unibyte):
17672 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
17673 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17674 * character.h (CHAR_TO_BYTE8):
17675 * cmds.c (internal_self_insert):
17676 * editfns.c (general_insert_function):
17677 * keymap.c (push_key_description):
17678 * search.c (Freplace_match):
17679 * xdisp.c (message_dolog, set_message_1): All callers changed.
17680
f6d62986
SM
176812011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
17682
17683 * keyboard.c (safe_run_hook_funcall): New function.
17684 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17685 don't set the hook to nil, but remove the offending function instead.
17686 (Qcommand_hook_internal): Remove, unused.
17687 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17688 Vcommand_hook_internal.
17689
17690 * eval.c (enum run_hooks_condition): Remove.
17691 (funcall_nil, funcall_not): New functions.
17692 (run_hook_with_args): Call each function through a `funcall' argument.
17693 Remove `cond' argument, now redundant.
17694 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17695 (Frun_hook_with_args_until_failure): Adjust accordingly.
17696 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17697
1db5b1ad
JB
176982011-03-28 Juanma Barranquero <lekktu@gmail.com>
17699
17700 * dispextern.h (string_buffer_position): Remove declaration.
17701
17702 * print.c (strout): Remove parameter `multibyte', unused since
17703 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
17704
17705 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17706 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17707 All callers changed.
17708
17709 * w32.c (_wsa_errlist): Use braces for struct initializers.
17710
17711 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17712 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17713 All callers changed.
17714 (string_buffer_position): Likewise. Also, make static (it's never
17715 used outside xdisp.c).
17716 (cursor_row_p): Remove parameter `w', unused since
17717 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
17718 (decode_mode_spec): Remove parameter `precision', introduced during
17719 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17720 All callers changed.
17721
5ffb62aa
JD
177222011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17723
17724 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17725
461c2ab9 177262011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
17727
17728 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17729 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17730 (ns_update_auto_hide_menu_bar): New functions.
17731 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17732 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17733 ns_constrain_all_frames.
17734 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17735 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17736
5c380ffb
JD
177372011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17738
17739 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17740
9af30bdf
GM
177412011-03-27 Glenn Morris <rgm@gnu.org>
17742
17743 * syssignal.h: Replace RETSIGTYPE with void.
17744 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17745 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17746 Replace SIGTYPE with void everywhere.
17747 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17748 * s/template.h (SIGTYPE): Remove commented out definition.
17749
e2abce01
JB
177502011-03-26 Eli Zaretskii <eliz@gnu.org>
17751
17752 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17753 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17754
f868cd8a
JB
177552011-03-26 Juanma Barranquero <lekktu@gmail.com>
17756
59eb0929
JB
17757 * w32.c (read_unc_volume): Use parameter `henum', instead of
17758 global variable `wget_enum_handle'.
17759
17760 * keymap.c (describe_vector): Remove parameters `indices' and
17761 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17762 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17763
f868cd8a
JB
17764 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17765
17766 * keyboard.c (timer_check): Remove parameter `do_it_now',
17767 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17768 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17769 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17770
17771 * keyboard.c (read_char):
17772 * w32menu.c (w32_menu_display_help):
17773 * xmenu.c (show_help_event, menu_help_callback):
17774 Adjust calls to `show_help_echo'.
17775
17776 * gtkutil.c (xg_maybe_add_timer):
17777 * keyboard.c (readable_events):
17778 * process.c (wait_reading_process_output):
17779 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17780
17781 * insdel.c (adjust_markers_gap_motion):
17782 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17783 (gap_left, gap_right): Don't call it.
17784
2ecf6fdb
CY
177852011-03-25 Chong Yidong <cyd@stupidchicken.com>
17786
17787 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17788 incurred during fontification.
17789
6b1f9ba4
JB
177902011-03-25 Juanma Barranquero <lekktu@gmail.com>
17791
17792 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17793 (DEFVAR_PER_BUFFER): Don't pass it.
17794
17795 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17796 (scrolling_window): Don't pass it.
17797
0f4a96b5
JB
177982011-03-25 Juanma Barranquero <lekktu@gmail.com>
17799
17800 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17801
17802 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17803 and `suffix'.
17804 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17805 of variables specific to SELinux and computation of `encoded_absname'.
17806
17807 * image.c (XPutPixel): Remove unused variable `height'.
17808
17809 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17810
17811 * unexw32.c (get_section_info): Remove unused variable `section'.
17812
17813 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17814 (system_process_attributes): Remove unused variable `sess'.
17815 (sys_read): Remove unused variable `err'.
17816
17817 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17818 (w32_wnd_proc): Remove unused variable `isdead'.
17819 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17820 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17821 (x_create_tip_frame): Remove unused variable `tem'.
17822
17823 * w32inevt.c (w32_console_read_socket):
17824 Remove unused variable `no_events'.
17825
17826 * w32term.c (x_draw_composite_glyph_string_foreground):
17827 Remove unused variable `width'.
17828
1149507c
JB
178292011-03-24 Juanma Barranquero <lekktu@gmail.com>
17830
17831 * w32term.c (x_set_glyph_string_clipping):
17832 Don't pass uninitialized region to CombineRgn.
17833
9c88f339
JB
178342011-03-23 Juanma Barranquero <lekktu@gmail.com>
17835
17836 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17837 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17838 (Fx_close_connection): Remove unused variable `i'.
17839
17840 * w32font.c (w32font_draw): Return number of glyphs.
17841 (w32font_open_internal): Remove unused variable `i'.
17842 (w32font_driver): Add missing initializer.
17843
17844 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17845 (fill_in_menu): Remove unused variable `items_added'.
17846
17847 * w32term.c (last_mouse_press_frame): Remove static global variable.
17848 (w32_clip_to_row): Remove unused variable `f'.
17849 (x_delete_terminal): Remove unused variable `i'.
17850
17851 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17852 (NOTHING): Remove unused static global variable.
17853 (uniscribe_check_otf): Remove unused variable `table'.
17854 (uniscribe_font_driver): Add missing initializers.
17855
dee091a3
JD
178562011-03-23 Julien Danjou <julien@danjou.info>
17857
17858 * term.c (Fsuspend_tty, Fresume_tty):
17859 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17860 * window.c (temp_output_buffer_show):
17861 * insdel.c (signal_before_change):
17862 * frame.c (Fhandle_switch_frame):
17863 * fileio.c (Fdo_auto_save):
17864 * emacs.c (Fkill_emacs):
17865 * editfns.c (save_excursion_restore):
17866 * cmds.c (internal_self_insert):
17867 * callint.c (Fcall_interactively):
17868 * buffer.c (Fkill_all_local_variables):
17869 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17870 Use Frun_hooks.
0f4a96b5 17871 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 17872 unconditionally since it does the check itself.
dee091a3 17873
2c520ab5 178742011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 17875
c9c49752
PE
17876 Fix more problems found by GCC 4.5.2's static checks.
17877
8abc3f12
PE
17878 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17879 the first time through the loop, since we know p0 < p1 then.
17880 This also avoids a gcc -Wstrict-overflow warning.
17881
a2d26660
PE
17882 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17883 leading to a memory leak, possible in functions like
17884 load_charset_map_from_file that can allocate an unbounded number
b12ef411 17885 of objects (Bug#8318).
a2d26660 17886
916c72e9
PE
17887 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17888 that could (at least in theory) be that large.
17889
19ab8a18
PE
17890 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17891 This is less likely to overflow, and avoids undefined behavior if
17892 overflow does occur. All callers changed. Use strtoul to scan
17893 for the unsigned long integer.
b7cbbd6f
PE
17894 (pint2hrstr): Simplify and tune code slightly.
17895 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 17896
f0641eff
PE
17897 * scroll.c (do_scrolling): Work around GCC bug 48228.
17898 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17899
7f650bb9
PE
17900 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17901 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
17902 (validate_x_resource_name): Simplify count usage.
17903 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 17904
37dd57d1
PE
17905 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17906 fail (Bug#8306).
81e56e61 17907
699979fc 17908 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 17909
401bf9b4
PE
17910 * process.c (Fmake_network_process): Use socklen_t, not int,
17911 where POSIX says socklen_t is required in portable programs.
17912 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 17913 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
17914 (Fmake_network_process, server_accept_connection):
17915 (wait_reading_process_output, read_process_output):
17916 Likewise.
17917
b93aacde
PE
17918 * process.c: Rename or move locals to avoid shadowing.
17919 (list_processes_1, Fmake_network_process):
17920 (read_process_output_error_handler, exec_sentinel_error_handler):
17921 Rename or move locals.
4dc343ee 17922 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 17923 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 17924 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 17925 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 17926 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 17927
af8a867c 17928 Make tparam.h and terminfo.c consistent.
44f230aa
SM
17929 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17930 Include tparam.h instead, since it declares them.
af8a867c
PE
17931 * cm.h (PC): Remove extern decl; tparam.h now does this.
17932 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17933 * terminfo.c: Include tparam.h, to check interfaces.
17934 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17935 (tparam): Adjust signature to match interface in tparam.h;
17936 this removes some undefined behavior. Check that outstring and len
17937 are zero, which they always are with Emacs.
17938 * tparam.h (PC, BC, UP): New extern decls.
17939
0248044d 17940 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 17941 (xftfont_open): Rename locals to avoid shadowing.
0248044d 17942
8ff096c1 17943 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
17944 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17945 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 17946 (ftfont_list): Remove unused local.
49eaafba
PE
17947 (get_adstyle_property, ftfont_pattern_entity):
17948 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17949 Rename locals to avoid shadowing.
8ff096c1 17950
e2be39f6
PE
17951 * xfont.c (xfont_list_family): Mark var as initialized.
17952
c9735e30
PE
17953 * xml.c (make_dom): Now static.
17954
8f5201ae
PE
17955 * composite.c (composition_compute_stop_pos): Rename local to
17956 avoid shadowing.
b246f932
PE
17957 (composition_reseat_it): Remove unused locals.
17958 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 17959 (composition_update_it): Mark var as initialized.
11b61122
PE
17960 (find_automatic_composition): Mark vars as initialized,
17961 with a FIXME (Bug#8290).
8f5201ae 17962
760fbc2c
PE
17963 character.h: Rename locals to avoid shadowing.
17964 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17965 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17966 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17967 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17968 to avoid shadowing.
17969
ff08eb85
PE
17970 * textprop.c (property_change_between_p): Remove; unused.
17971
fc7bf025
PE
17972 * intervals.c (interval_start_pos): Now static.
17973
235d7abc
PE
17974 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17975
44f230aa
SM
17976 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17977 Rename locals to avoid shadowing.
3e7d6594 17978
50060332
PE
17979 * sound.c (wav_play, au_play, Fplay_sound_internal):
17980 Fix pointer signedness.
d01f234b 17981 (alsa_choose_format): Remove unused local var.
c83b8872
PE
17982 (wav_play): Initialize a variable to 0, to prevent undefined
17983 behavior (Bug#8278).
50060332 17984
c4fc4e30
PE
17985 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17986
918436ed
PE
17987 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17988
c939f91b
PE
17989 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17990 clobbering (Bug#8298).
b9c7f648
PE
17991 * sysdep.c (sys_subshell): Likewise.
17992 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 17993
6bd8c144
PE
17994 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17995 This should get cleaned up, so that child_setup has the
17996 same signature on all platforms.
17997
7710357c 17998 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 17999 (relocate_fd): Rename locals to avoid shadowing.
7710357c 18000
c59da222
CY
180012011-03-22 Chong Yidong <cyd@stupidchicken.com>
18002
18003 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18004 not to be necessary, and produces flickering.
18005
66b87493
GM
180062011-03-20 Glenn Morris <rgm@gnu.org>
18007
18008 * config.in: Remove file.
18009
45b6f6d5
JB
180102011-03-20 Juanma Barranquero <lekktu@gmail.com>
18011
18012 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18013 are now in src/globals.h.
18014 (syms_of_minibuf): Remove spurious & from previous change.
18015
cd394be1 180162011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
18017
18018 * minibuf.c (completing-read-function): New variable.
18019 (completing-read-default): Rename from completing-read.
18020 (completing-read): Call completing-read-function.
18021
b14e3e21
CY
180222011-03-19 Juanma Barranquero <lekktu@gmail.com>
18023
18024 * xfaces.c (Fx_load_color_file):
18025 Read color file from absolute filename (bug#8250).
18026
f2b726e6
JB
180272011-03-19 Juanma Barranquero <lekktu@gmail.com>
18028
18029 * makefile.w32-in: Update dependencies.
18030
09f6ff02
EZ
180312011-03-17 Eli Zaretskii <eliz@gnu.org>
18032
18033 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18034
29a6015a
PE
180352011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18036
a3a6c54e
PE
18037 Fix more problems found by GCC 4.5.2's static checks.
18038
b766f867
PE
18039 * process.c (make_serial_process_unwind, send_process_trap):
18040 (sigchld_handler): Now static.
18041
be02381c
PE
18042 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18043 That way, the code declares only the vars that it needs.
18044 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18045 * s/cygwin.h (PTY_ITERATION): Likewise.
18046 * s/darwin.h (PTY_ITERATION): Likewise.
18047 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18048
57048744
PE
18049 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18050 * process.c (allocate_pty): Don't declare stb unless it's needed.
18051
7914961c 18052 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
18053 (CONSTANTLIM): Remove; unused.
18054 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18055 Define only if needed.
7914961c 18056
b3967b18
PE
18057 * unexelf.c (unexec): Name an expression,
18058 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
18059 Use a different way to cause a compilation error if anyone uses
18060 n rather than nn, a way that does not involve shadowing.
73366a00 18061 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 18062
29a6015a
PE
18063 * deps.mk (unexalpha.o): Remove; unused.
18064
43cfc33e 18065 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 18066 * unexec.h: New file.
ce701a33
PE
18067 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18068 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18069 Depend on unexec.h.
18070 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18071 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18072 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 18073 Change as necessary to match prototype in unexec.h.
ce701a33 18074
01f44d5a
PE
18075 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18076 shadowing.
4f63c6bb 18077 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 18078
a6670b0b
PE
18079 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18080 Rename locals to avoid shadowing.
18081
cef2010d 18082 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 18083 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 18084
d4d7173a
PE
18085 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18086
f08b802a
PE
18087 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18088 warning when compiling print.c.
18089
3ddb0639
PE
18090 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18091 instead of using an uninitialized var.
5ad03b97 18092 (font_sort_entities): Mark var as initialized.
3ddb0639 18093
170a2692
PE
18094 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18095
e663c700
PE
18096 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18097 pointers to constants.
89bc529a 18098 (font_parse_fcname): Remove unused vars.
7b81e2d0 18099 (font_delete_unmatched): Now static.
ea838e10 18100 (font_get_spec): Remove; unused.
13a547c6
PE
18101 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18102 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18103 Rename or move locals to avoid shadowing.
e663c700 18104
2a80c887 18105 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 18106 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 18107
1384fa33 18108 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 18109 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 18110
8b2c52e9
PE
18111 * alloc.c (mark_backtrace): Move decl from here ...
18112 * lisp.h: ... to here, so that it can be checked.
18113
475545b5 18114 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 18115 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
18116 (lisp_indirect_variable): Name an expression,
18117 to avoid gcc -Wbad-function-cast warning.
1faed8ae 18118 (Fdefvar): Rename locals to avoid shadowing.
475545b5 18119
b1349114 18120 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 18121 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 18122 Use const pointer when appropriate.
b1349114 18123
a2928364
PE
18124 * lisp.h (get_system_name, get_operating_system_release):
18125 Move decls here, to check interfaces.
18126 * process.c (get_operating_system_release): Move decl to lisp.h.
18127 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
18128 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18129 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18130 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
18131 (Fformat_time_string, Fencode_time, Finsert_char):
18132 (Ftranslate_region_internal, Fformat):
18133 Rename or remove local vars to avoid shadowing.
9710023e 18134 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 18135
a415e694
PE
18136 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18137 avoid shadowing.
18138
8ef4622d
PE
18139 * lisp.h (eassert): Check that the argument compiles, even if
18140 ENABLE_CHECKING is not defined.
18141
946f9a5b
PE
18142 * data.c (Findirect_variable): Name an expression, to avoid
18143 gcc -Wbad-function-cast warning.
112396d6 18144 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 18145 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
18146 (Fmake_variable_buffer_local, Fmake_local_variable):
18147 Mark variables as initialized.
52746918 18148 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 18149
e5aab7e7 18150 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
18151 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
18152 Rename locals to avoid shadowing.
dff45157
PE
18153 (mark_stack): Move local variables into the #ifdef region where
18154 they're used.
7bc26fdb
PE
18155 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
18156 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
18157 needed otherwise.
18158 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
18159 (GC_STRING_CHARS): Remove; not used.
d40d4be1 18160 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 18161
e5aab7e7
PE
18162 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
18163 avoids undefined behavior in theory.
18164
4da60324
PE
18165 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
18166
88043301
PE
18167 Use functions, not macros, for up- and down-casing (Bug#8254).
18168 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18169 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
18170 to use the following functions instead of these macros.
18171 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
18172 EMACS_INT, since callers assume the returned value fits in int.
18173 (upcase1): Likewise, for UPCASE_TABLE.
18174 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 18175 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 18176 the race-condition problem in the old DOWNCASE.
88043301 18177
19ed5445
PE
18178 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
18179 Rename locals to avoid shadowing.
18180 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
18181 (regex_compile, re_search_2, re_match_2_internal):
18182 Remove unused local vars.
952db0d7
PE
18183 (FREE_VAR): Rewrite so as not to use empty "else",
18184 which gcc can warn about.
da053e48 18185 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
18186 (RETALLOC_IF): Define only if needed.
18187 (WORDCHAR_P): Likewise. This one is never needed, but is used
18188 only in a comment talking about a compiler bug, so put inside
18189 the #if 0 of that comment.
18190 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
18191 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
18192 Remove; unused.
19ed5445 18193
1f3561e4 18194 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
18195 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
18196 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 18197
ded6f8f7
PE
18198 * search.c (simple_search): Remove unused var.
18199
dbd37a95
PE
18200 * dired.c (compile_pattern): Move decl from here ...
18201 * lisp.h: ... to here, so that it can be checked.
18202 (struct re_registers): New forward decl.
18203
7e47afad
PE
18204 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
18205
85f24f61
PE
18206 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
18207 All uses changed.
18208 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
18209 Rename locals to avoid shadowing.
5671df8f 18210 (Fvertical_motion): Mark locals as initialized.
85f24f61 18211
181aa2be 18212 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 18213 (casify_region): Mark local as initialized.
181aa2be 18214
930d429c
PE
18215 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
18216
7082eac6
PE
18217 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
18218 New macros, so that the caller can use some names other than
18219 gcpro1, gcpro2, etc.
18220 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
18221 of the new macros.
18222 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
18223 argument, for consistency with GCPRO2_VAR, etc: it is now the
18224 prefix of the variable, not the variable itself. All uses
18225 changed.
38b2c076
PE
18226 * dired.c (directory_files_internal, file_name_completion):
18227 Rename locals to avoid shadowing.
18228
15206ed9
PE
18229 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
18230 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
18231 dired.c's scmp function, had undefined behavior.
18232 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18233 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
18234 * buffer.h: ... to here, because these macros use current_buffer,
18235 and the new implementation with inline functions needs to have
18236 current_buffer in scope now, rather than later when the macros
18237 are used.
18238 (downcase, upcase1): New static inline functions.
18239 (DOWNCASE, UPCASE1): Reimplement using these functions.
18240 This avoids undefined behavior in expressions like
18241 DOWNCASE (x) == DOWNCASE (y), which previously suffered
18242 from race conditions in accessing the global variables
18243 case_temp1 and case_temp2.
18244 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
18245 * lisp.h (case_temp1, case_temp2): Remove their decls.
18246 * character.h (ASCII_CHAR_P): Move from here ...
18247 * lisp.h: ... to here, so that the inline functions mentioned
18248 above can use them.
18249
4a6bea26
PE
18250 * dired.c (directory_files_internal_unwind): Now static.
18251
f14b7e14
PE
18252 * fileio.c (file_name_as_directory, directory_file_name):
18253 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
18254 Now static.
2893f146
PE
18255 (file_name_as_directory): Use const pointers when appropriate.
18256 (Fexpand_file_name): Likewise. In particular, newdir might
18257 point at constant storage, so make it a const pointer.
fd4ead52 18258 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
18259 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
18260 signedness issues.
f839df0c
PE
18261 (Fset_file_times, Finsert_file_contents, auto_save_error):
18262 Rename locals to avoid shadowing.
f14b7e14 18263
5716756e 18264 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
18265 (Ftry_completion, Fall_completions): Rename or remove locals
18266 to avoid shadowing.
5716756e 18267
b4c3046a
PE
18268 * marker.c (bytepos_to_charpos): Remove; unused.
18269
b45db522
PE
18270 * lisp.h (verify_bytepos, count_markers): New decls,
18271 so that gcc does not warn that these functions aren't declared.
18272
85876d07
PE
18273 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
18274 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 18275 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 18276 (copy_text): Remove unused local var.
85876d07 18277
03d78a21 18278 * filelock.c (within_one_second): Now static.
b3dd38ab 18279 (lock_file_1): Rename local to avoid shadowing.
03d78a21 18280
5df8f01b
PE
18281 * buffer.c (fix_overlays_before): Mark locals as initialized.
18282 (fix_start_end_in_overlays): Likewise. This function should be
18283 simplified by using pointers-to-pointers, but that's a different
18284 matter.
b1d876f1 18285 (switch_to_buffer_1): Now static.
8f54f30a
PE
18286 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
18287 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 18288
a70072c9 18289 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 18290 Fix pointer signedness issue.
edced198
PE
18291 (sys_subshell): Mark local as volatile if checking for lint,
18292 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 18293 (MAXPATHLEN): Define only if needed.
a70072c9 18294
a0977c44
PE
18295 * process.c (serial_open, serial_configure): Move decls from here ...
18296 * systty.h: ... to here, so that they can be checked.
18297
a884fdcc
PE
18298 * fns.c (get_random, seed_random): Move extern decls from here ...
18299 * lisp.h: ... to here, so that they can be checked.
18300
604efe86 18301 * sysdep.c (reset_io): Now static.
b8950c94 18302 (wait_for_termination_signal): Remove; unused.
604efe86 18303
38fc62d9
PE
18304 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
18305 (copy_keymap_item, append_key, push_text_char_description):
18306 Now static.
1004a21a 18307 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 18308 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
18309 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
18310 (describe_map_tree):
18311 Rename locals to avoid shadowing.
38fc62d9 18312
2f2650da
PE
18313 * keyboard.c: Declare functions static if they are not used elsewhere.
18314 (echo_char, echo_dash, cmd_error, top_level_2):
18315 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
18316 (read_char, kbd_buffer_get_event, make_lispy_position):
18317 (make_lispy_event, make_lispy_movement, apply_modifiers):
18318 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
18319 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
18320 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 18321 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 18322 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 18323
a053e86c 18324 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
18325 (mark_kboards): Move decl here ...
18326 * alloc.c (mark_kboards): ... from here.
a053e86c 18327
4752793e
PE
18328 * lisp.h (force_auto_save_soon): New decl.
18329
74f10ca7 18330 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
18331 (DEFINE_DUMMY_FUNCTION): New macro.
18332 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
18333 Use it.
c03cd23f
PE
18334 (main): Add casts to avoid warnings
18335 if GCC considers string literals to be constants.
74f10ca7 18336
022e70d4
PE
18337 * lisp.h (fatal_error_signal): Add decl, since it's exported.
18338
59d6fe83
PE
18339 * dbusbind.c: Pointer signedness fixes.
18340 (xd_signature, xd_append_arg, xd_initialize):
18341 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18342 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18343 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
18344 (Fdbus_register_signal): Use SSDATA when the context wants char *.
18345
78320123
PE
18346 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
18347 if GCC considers string literals to be constants.
49cebcca 18348 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 18349
35ac2a97
SM
183502011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
18351
fb103ca9
SM
18352 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18353 (print_preprocess, print_object): New macro to fix last change.
18354
35ac2a97
SM
18355 * print.c (print_preprocess): Don't forget font objects.
18356
62973b41
JB
183572011-03-16 Juanma Barranquero <lekktu@gmail.com>
18358
18359 * emacs.c (USAGE3): Doc fixes.
18360
0e48bb22
AS
183612011-03-15 Andreas Schwab <schwab@linux-m68k.org>
18362
18363 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
18364 structure.
18365
7684e57b
JB
183662011-03-14 Juanma Barranquero <lekktu@gmail.com>
18367
18368 * lisp.h (VWindow_system, Qfile_name_history):
18369 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
18370 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
18371 (w32_system_caret_x, w32_system_caret_y): Declare extern.
18372
18373 * w32select.c: Don't #include "keyboard.h".
c96bbc66 18374 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
18375
18376 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18377 * w32console.c (detect_input_pending, read_input_pending)
18378 (encode_terminal_code):
18379 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18380 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18381 (w32_system_caret_y, Qfile_name_history):
18382 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18383 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18384 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18385 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18386 * w32proc.c (Qlocal, report_file_error):
18387 * w32term.c (Vwindow_system, updating_frame):
18388 * w32uniscribe.c (initialized, uniscribe_font_driver):
18389 Remove unneeded extern declarations.
18390
2aa46d6c
CY
183912011-03-14 Chong Yidong <cyd@stupidchicken.com>
18392
c96bbc66 18393 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 18394
cffc6f3b
CY
183952011-03-13 Chong Yidong <cyd@stupidchicken.com>
18396
18397 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18398 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18399 These macros can no longer be used for assignment.
18400
44f230aa
SM
18401 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18402 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
18403 (record_buffer_markers, fetch_buffer_markers): New functions for
18404 recording and fetching special buffer markers.
18405 (set_buffer_internal_1, set_buffer_temp): Use them.
18406
18407 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18408
18409 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18410
18411 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18412 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
18413
18414 * xdisp.c (hscroll_window_tree):
18415 (reconsider_clip_changes): Use PT instead of BUF_PT.
18416
d251f04b
EZ
184172011-03-13 Eli Zaretskii <eliz@gnu.org>
18418
18419 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18420 $(EMACS_ROOT)/lib/intprops.h.
18421
f0c77cd1
PE
184222011-03-13 Paul Eggert <eggert@cs.ucla.edu>
18423
3eca4629
PE
18424 Fix more problems found by GCC 4.5.2's static checks.
18425
7c86ee98
PE
18426 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18427 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
18428 (xg_free_frame_widgets): Make it clear that a local variable is
18429 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
18430 (gdk_window_get_screen): Make it clear that this macro is needed
18431 only if USE_GTK_TOOLTIP.
1e5524e7
PE
18432 (int_gtk_range_get_value): New function, which avoids a diagnostic
18433 from gcc -Wbad-function-cast.
18434 (xg_set_toolkit_scroll_bar_thumb): Use it.
18435 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18436 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
18437 (get_utf8_string, xg_get_file_with_chooser):
18438 Rename locals to avoid shadowing.
18439 (create_dialog): Move locals to avoid shadowing.
7c86ee98 18440
41729b81
PE
18441 * xgselect.c (xg_select): Remove unused var.
18442
f0c77cd1
PE
18443 * image.c (four_corners_best): Mark locals as initialized.
18444 (gif_load): Initialize transparent_p to zero (Bug#8238).
18445 Mark another local as initialized.
ec6cf4c6 18446 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 18447
ce0ad53d 18448 * image.c (clear_image_cache): Now static.
d5d5a617 18449 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 18450 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
18451 (x_edge_detection): Remove unnecessary cast that
18452 gcc -Wbad-function-cast diagnoses.
2037898d 18453 (gif_load): Fix pointer signedness.
6ae141d6
PE
18454 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18455 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 18456
33383987 184572011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 18458
d32df629
PE
18459 Improve quality of tests for time stamp overflow.
18460 For example, without this patch (encode-time 0 0 0 1 1
18461 1152921504606846976) returns the obviously-bogus value (-948597
18462 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18463 reports time overflow. See
18464 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
18465 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18466 * editfns.c: Include limits.h and intprops.h.
18467 (TIME_T_MIN, TIME_T_MAX): New macros.
18468 (time_overflow): Move earlier, to before first use.
18469 (hi_time, lo_time): New functions, for an accurate test for
18470 out-of-range times.
18471 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18472 (Fget_internal_run_time): Don't assume time_t fits in int.
18473 (make_time): Use list2 instead of Fcons twice.
18474 (Fdecode_time): More accurate test for out-of-range times.
18475 (check_tm_member): New function.
18476 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
18477 (lisp_time_argument): Don't rely on undefined left-shift and
18478 right-shift behavior when checking for time stamp overflow.
8be6f318 18479
fe31d94c
PE
18480 * editfns.c (time_overflow): New function, refactoring common code.
18481 (Fformat_time_string, Fdecode_time, Fencode_time):
18482 (Fcurrent_time_string): Use it.
18483
8be6f318
PE
18484 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18485 * dired.c (make_time): Move to ...
18486 * editfns.c (make_time): ... here.
18487 * systime.h: Note the move.
18488
09d9db2c 184892011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 18490
126bc0dc
YM
18491 * fringe.c (update_window_fringes): Remove unused variables.
18492
c47cbdfd
YM
18493 * unexmacosx.c (copy_data_segment): Also copy __got section.
18494 (Bug#8223)
18495
7ac80be9
EZ
184962011-03-12 Eli Zaretskii <eliz@gnu.org>
18497
c96bbc66 18498 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
18499 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
18500 Constify `char *' arguments and their references according to
18501 prototypes in tparam.h.
18502
ecb0f94d 18503 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 18504
7ac80be9
EZ
18505 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
18506 Adapt all references accordingly.
18507
18508 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
18509
ef1fd07e
TT
185102011-03-11 Tom Tromey <tromey@redhat.com>
18511
18512 * buffer.c (syms_of_buffer): Remove obsolete comment.
18513
7ef4b50c
EZ
185142011-03-11 Eli Zaretskii <eliz@gnu.org>
18515
18516 * termhooks.h (encode_terminal_code): Declare prototype.
18517
18518 * msdos.c (encode_terminal_code): Don't declare prototype.
18519
18520 * term.c (encode_terminal_code): Now external again, used by
18521 w32console.c and msdos.c.
18522
44f230aa
SM
18523 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
18524 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 18525
4b1ec863 185262011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 18527
1714f52b 18528 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 18529
4b1ec863
PE
18530 * fringe.c (update_window_fringes): Mark locals as initialized
18531 (Bug#8227).
18532 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 18533
524c7aa6
PE
18534 * alloc.c (mark_fringe_data): Move decl from here ...
18535 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
18536 to check its interface.
18537 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
18538
a5c0af81 18539 * fontset.c (free_realized_fontset): Now static.
7519b8cd 18540 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 18541 (fontset_font): Mark local as initialized.
a9a06e0b 18542 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 18543
b4716021
PE
18544 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
18545
811e9bac 18546 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 18547 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
18548 (x_own_selection, Fx_disown_selection_internal): Rename locals
18549 to avoid shadowing.
18550 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 18551
7e3ab302
PE
18552 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
18553 so that the caller can use some name other than gcpro1.
18554 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
18555 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18556 (Fx_backspace_delete_keys_p):
18557 Use them to avoid shadowing, and rename vars to avoid shadowing.
18558 (x_decode_color, x_set_name, x_window): Now static.
6b437900 18559 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 18560 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
18561 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18562 Remove unused locals.
7e3ab302
PE
18563 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18564 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18565 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18566 macros.
f78faa98 18567
e2b13473
PE
18568 * xterm.h (x_mouse_leave): New decl.
18569
77f23912
PE
18570 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18571 Remove unused functions.
cdf4ba58
PE
18572 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18573 (x_calc_absolute_position): Now static.
7411c686 18574 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 18575 Don't declare local "event" unless it's used.
ed7bf3a5
PE
18576 (x_iconify_frame, x_free_frame_resources): Don't declare locals
18577 unless they are used.
38d0b34a
PE
18578 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18579 (x_fatal_error_signal): Remove; not used.
a6067996
PE
18580 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18581 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18582 (x_error_catcher, x_connection_closed, x_error_handler):
18583 (x_error_quitter, xembed_send_message, x_iconify_frame):
18584 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 18585 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 18586 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 18587
44f230aa
SM
18588 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18589 Rename or move locals to avoid shadowing.
6b463e58 18590 (tty_defined_color, merge_face_heights): Now static.
5967d051 18591 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
18592 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18593 does not deduce is never used uninitialized.
73719eba
PE
18594 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18595 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 18596
426994c3 18597 * terminal.c (store_terminal_param): Now static.
5489860b 18598
032f1620 18599 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 18600 (set_frame_menubar): Remove unused local.
d4323972 18601 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
18602 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18603 since they might point to immutable storage.
281585b0
PE
18604 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18605 since it's unused otherwise.
032f1620 18606
367c19e5 18607 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 18608 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
18609 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18610 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 18611 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
18612 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18613 does not deduce are never used uninitialized.
70739cbe 18614
07b48fa9
PE
18615 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18616
8868a238 18617 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
18618 * window.c (window_loop, size_window):
18619 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 18620
7e5cf297 18621 * window.c (display_buffer): Now static.
d6550a9f
PE
18622 (size_window): Mark variables that gcc -Wuninitialized
18623 does not deduce are never used uninitialized.
a586633d
PE
18624 * window.h (check_all_windows): New decl, to forestall
18625 gcc -Wmissing-prototypes diagnostic.
5b555da1 18626 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 18627
f6095868
PE
18628 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18629 shadowing.
18630 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
18631 Include <limits.h>.
18632 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18633 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
18634 (load_charset_map): Mark variables that gcc -Wuninitialized
18635 does not deduce are never used uninitialized.
53df7c11 18636 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 18637
f38b440c
PE
18638 * coding.c (coding_set_source, coding_set_destination):
18639 Use "else { /* comment */ }" rather than "else /* comment */;"
18640 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
18641 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18642 a block, when the outer 'i' will do.
18643 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18644 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18645 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18646 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
18647 (Fdecode_sjis_char, Fdefine_coding_system_internal):
18648 Rename locals to avoid shadowing.
18649 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
18650 * coding.c (emacs_mule_char, encode_invocation_designation):
18651 Now static, since they're not used elsewhere.
413bb2db 18652 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 18653 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
18654 (decode_coding_emacs_mule): Mark variables that gcc
18655 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
18656 (detect_coding_iso_2022): Initialize a local variable that might
18657 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 18658 this initialization is needed. (Bug#8211)
5f58e762
PE
18659 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
18660 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
18661 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
18662 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
18663 Remove unused macros.
f38b440c 18664
232b38b9 18665 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 18666 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 18667 * character.c (string_count_byte8): Likewise.
232b38b9 18668
fb90da1b
PE
18669 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
18670 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
18671
fb93dbc2
PE
18672 * chartab.c (copy_sub_char_table): Now static, since it's not used
18673 elsewhere.
5c156ace
PE
18674 (sub_char_table_ref_and_range, char_table_ref_and_range):
18675 Rename locals to avoid shadowing.
bbcd0949 18676 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 18677
7d3b3862 18678 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 18679 (BIDI_BOB): Remove unused macro.
7d3b3862 18680
6be7d3da
PE
18681 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18682 deduce are never used uninitialized.
c2ed9c8b 18683 * term.c (encode_terminal_code): Likewise.
6be7d3da 18684
75f8807f 18685 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 18686
50938595
PE
18687 * tparam.h: New file.
18688 * term.c, tparam.h: Include it.
18689 * deps.mk (term.o, tparam.o): Depend on tparam.h.
18690 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18691 Move these decls to tparam.h, and make them agree with what
18692 is actually in tparam.c. The previous trick of using incompatible
18693 decls in different modules does not conform to the C standard.
18694 All callers of tparam changed to use tparam's actual API.
18695 * tparam.c (tparam1, tparam, tgoto):
18696 Use const pointers where appropriate.
18697
fbceeba2
PE
18698 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18699 * cm.h (struct cm): Likewise.
18700 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18701 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18702 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18703 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18704 (turn_on_face, init_tty): Likewise.
18705 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 18706
7f3f1250
PE
18707 * term.c (term_mouse_position): Rename local to avoid shadowing.
18708
e6ca6543
PE
18709 * alloc.c (mark_ttys): Move decl from here ...
18710 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18711
c40f8d15
AS
187122011-03-11 Andreas Schwab <schwab@linux-m68k.org>
18713
18714 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18715
cfe0661d
JB
187162011-03-09 Juanma Barranquero <lekktu@gmail.com>
18717
18718 * search.c (compile_pattern_1): Remove argument regp, unused since
18719 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18720 (compile_pattern): Don't pass it.
18721
0afb4571
J
187222011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18723
18724 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18725 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18726 for ! HAVE_GTK3.
18727 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18728
18729 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18730
18731 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18732 gdk_window_get_screen, gdk_window_get_geometry,
18733 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18734 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18735 (xg_get_pixbuf_from_pixmap): New function.
18736 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18737 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18738 Call xg_get_pixbuf_from_pixmap instead of
18739 gdk_pixbuf_get_from_drawable.
18740 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18741 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18742 (xg_check_special_colors): Use GtkStyleContext and its functions
18743 for HAVE_GTK3.
18744 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18745 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18746 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
18747 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18748 Call gtk_widget_get_preferred_size.
0afb4571
J
18749 (xg_frame_resized): gdk_window_get_geometry only takes 5
18750 parameters.
44f230aa
SM
18751 (xg_win_to_widget, xg_event_is_for_menubar):
18752 Call gdk_x11_window_lookup_for_display.
0afb4571
J
18753 (xg_set_widget_bg): New function.
18754 (delete_cb): New function.
895009e1 18755 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 18756 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
18757 (xg_set_background_color): Call xg_set_widget_bg.
18758 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18759 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18760 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18761 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18762 if ! HAVE_GTK3.
18763 (update_frame_tool_bar): Call gtk_widget_hide.
18764 (xg_initialize): Use GDK_KEY_g.
18765
18766 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18767 if ! HAVE_GTK3
18768 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18769
18770 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18771 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18772 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18773
1c2cc4ef
JB
187742011-03-08 Juanma Barranquero <lekktu@gmail.com>
18775
18776 * w32xfns.c (select_palette): Check success of RealizePalette against
18777 GDI_ERROR, not zero.
18778
33383987 18779See ChangeLog.11 for earlier changes.
aac0c6e3
MR
18780
18781;; Local Variables:
18782;; coding: utf-8
aac0c6e3
MR
18783;; End:
18784
2f097256 18785 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
18786
18787 This file is part of GNU Emacs.
18788
18789 GNU Emacs is free software: you can redistribute it and/or modify
18790 it under the terms of the GNU General Public License as published by
18791 the Free Software Foundation, either version 3 of the License, or
18792 (at your option) any later version.
18793
18794 GNU Emacs is distributed in the hope that it will be useful,
18795 but WITHOUT ANY WARRANTY; without even the implied warranty of
18796 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18797 GNU General Public License for more details.
18798
18799 You should have received a copy of the GNU General Public License
18800 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.