Avoid shadowing a global variable by a local one in frame.c.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
cf5fc6db
EZ
12012-10-09 Eli Zaretskii <eliz@gnu.org>
2
3 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
4 'is_tooltip_frame', to avoid confusion with its global namesake.
5
f99714ce
DC
62012-10-08 Daniel Colascione <dancol@dancol.org>
7
8 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
9 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
10 build that caused Emacs to display the hourglass cursor forever.
f99714ce 11
fd59cb29
GM
12 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
13 which is broken under remote desktop, calculate the number of
14 colors available for a display based on the display's number of
15 planes and number of bits per pixel per plane. (bug#10397).
16
62c480c9 172012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 18
62c480c9
JD
19 * nsfont.m (Vfonts_in_cache): New variable.
20 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
21 are used. Add cached fonts to Vfonts_in_cache.
22 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
23
607446ba
JB
242012-10-08 Juanma Barranquero <lekktu@gmail.com>
25
fd5125ad
JB
26 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
27 in nt/config.nt.
46979e0b
JB
28 (FONT_H): Define after FRAME_H.
29 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
30 Update dependencies.
fd5125ad 31
607446ba
JB
32 * w32term.c: Remove leftover declaration of keyboard_codepage.
33
b6f4e300
EZ
342012-10-08 Eli Zaretskii <eliz@gnu.org>
35
c54ebba4
EZ
36 * makefile.w32-in (FONT_H): Add $(FRAME_H).
37 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
38 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
39 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
40 ($(BLD)/unexw32.$(O)):
41 ($(BLD)/w32.$(O)):
42 ($(BLD)/w32console.$(O)):
43 ($(BLD)/w32fns.$(O)):
44 ($(BLD)/w32heap.$(O)):
45 ($(BLD)/w32menu.$(O)):
15c720a3 46 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 47
b6f4e300
EZ
48 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
49 'const char *'.
50 (x_to_w32_color): Don't modify the argument, modify a copy instead.
51
501199a3
DC
522012-10-08 Daniel Colascione <dancol@dancol.org>
53
54 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
55 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
56 accidental message numbering hole. Change other messages to
57 match.
58
59 * w32select.h (HAVE_W32SELECT): Remove.
60
61 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
62 w32common.h instead of w32heap.h
63
64 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
65 (get_allocation_unit, get_processor_type, get_w32_major_version)
66 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
67 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
68 (OS_NT, os_subtype, cache_system_info): Move declarations to
69 w32common.
70
71 * w32heap.c: Include w32common.h.
72 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
73 (w32_minor_version, w32_build_number, w32_subtype): Remove
74 duplicate definitions.
75
76 * w32fns.c: Include w32common.h; include w32heap.h only in
77 WINDOWSNT.
78
79 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
80 Use `report_file_error' instead of `error' in order to better
81 inform users of what went wrong. Increase NTGUI_UNICODE file
82 dialog box file name length to 32k, the maximum allowed by the NT
83 kernel.
84
85 * w32common.h: New file.
86 (ROUND_UP, ROUND_DOWN, get_page_size)
87 (get_allocation_unit, get_processor_type, get_w32_major_version)
88 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
89 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
90 (OS_NT, os_subtype, cache_system_info): Move here.
91
92 * unexw32.c, unexcw.c: Include w32common.h.
93
94 * emacs.c (main): Use (defined (WINDOWSNT) || defined
95 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
96 to call syms_of_w32select.
97
98 * cygw32.h: Remove obsolete EXFUN declarations.
99
100 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
101
102 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
103 of w32inevt.o from SOME_MACHINE_OBJECTS.
104
93aa5c81
DC
1052012-10-08 Daniel Colascione <dancol@dancol.org>
106
107 * image.c: Permanent fix for JPEG compilation issue --- limit
108 jpeglib `boolean' redefinition to Cygwin builds.
109
d424f3d8
EZ
1102012-10-08 Eli Zaretskii <eliz@gnu.org>
111
8ee4c6ce
EZ
112 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
113
d424f3d8
EZ
114 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
115 Cygwin.
116
e08348a0
DC
1172012-10-08 Daniel Colascione <dancol@dancol.org>
118
119 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
120 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
121 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
122 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
123 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
124 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
125 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
126 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
127 now a supported configuration.
128
129 * Makefile.in: consolidate image variables into LIBIMAGE; add
130 W32_OBJ and W32_LIBS. Compile new files.
131
132 * conf_post.h:
133 (_DebPrint) declare tracing facility for W32 debugging. We need
134 to unify tracing later.
135
136 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
137 unconditional use of W32 Unicode functions. Cygwin runs only on
138 100% Unicode operating systems.
139
140 * cygw32.c: New file. Define Cygwin-specific facilities.
141 (Fcygwin_convert_path_to_windows)
142 (Fcygwin_convert_path_from_windows): New user functions for
143 accessing Cygwin path-munging routines.
144
145 * cygw32.h: New file.
146 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
147 UTF-16LE strings temporarily inside non-Lisp-visible string
148 objects.
149
150 (w32_strerror): Just what it says on the tin.
151
152 * emacs.c: Make the NS fork-then-exec code for daemon-launching
153 also run for Cygwin; both systems have the same problem with using
154 GUI facilities in a forked child. Also call syms_of_cygw32,
155 syms_of_w32select in correct places.
156
157 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
158 needs fork-then-exec for daemon launching.
159
160 * font.h: Include frame.h.
161
162 * image.c: Use the image library cache machinery only when we're
163 compiling for native WINDOWSNT; Cygwin can use shared libraries
164 like any other Unixlike system.
165
166 * keyboard.c: Clarify a comment regarding the input loop.
167
168 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
169 functions directly instead of trying to detect at runtime that our
170 host operating system supports them. We make this change for two
171 reasons: Cygwin lacks support for the multibyte character
172 conversion functions used by the legacy menu code, and Cygwin
173 never needs to rely on non-Unicode APIs.
174
175 * unexw32.c (hinst): Declare extern.
176
177 * w32.c: Change header order;
178 (w32_strerror): Move to w32fns.c because we need it for
179 non-WINDOWSNT builds.
180
181 * w32.h: Add #error macro to make sure we don't include w32.h for
182 Cygwin builds. Remove w32select declarations.
183
184 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
185 w32fns.c. w32console.c is WINDOWSNT-only.
186
187 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
188 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
189 POSIXy alternative.
190 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
191 (w32_major_version, w32_minor_version, w32_build_number)
192 (os_subtype, sound_type): Define here
193 (w32_defined_color): Make color parameter const for consistency
194 with other _defined_color functions.
195 (w32_createwindow): Unconditionally call w32_init_class instead of
196 doing so only when hprevinst is non-NULL. Plumbing hprevinst
197 through the code is complex and unnecessary because class
198 registration is practically free.
199 (w32_name_of_message): New EMACSDEBUG-only function.
200 (Fset_message_beep): Move here
201 (Fx_open_connection): Require that the display name for Windows be
202 "w32" for consistency, emacsclient disambiguation, and maybe, one
203 day, multi-window-system support.
204 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
205 Cygwin files for W32 GUI facilities, since these clearly don't
206 expect Cygwin names.
207 (_DebPrint): Define.
208 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
209 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
210 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
211 (w32_last_error): Remove.
212
213 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
214
215 * w32heap.c (syspage_mask): Declare here.
216 (cache_system_info): Remove.
217
218 * w32inevt.c (faked_key): Define globally, not statically.
219 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
220 (w32_console_toggle_lock_key): Move to w32fns.c.
221
222 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
223
224 * w32proc.c (_DebPrint): Move to w32fns.c.
225 * w32select.c: Include string.h, stdio.h for Cygwin.
226 * w32select.h: New File.
227
228 * w32term.c: Include io.h for non-CYGWIN builds; needed for
229 get_osfhandle.
230 (w32_message_fd): New variable. Under Cygwin, holds the file
231 descriptor the system used to tell us about pending thread
232 messages.
233
234 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
235 that prevented compilation under non-WINDOWSNT systems.
236
237 (w32_initialize): Open /dev/windows and assign it to
238 w32_message_fd. Provide w32 feature.
239
240 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
241 (WM_EMACS_INPUT_READY): add.
242 (prepend_msg, w32_message_fd): Declare globally.
243
244 * w32xfns.c:
245 (keyboard_handle): Use only when WINDOWSNT.
246 (notify_msg_ready): New function. Posts a message to the main
247 thread's message queue under CYGWIN, which wakes up the main
248 thread from select(2) by making the /dev/windows file descriptor
249 ready. Under WINDOWSNT, it sets an event the same way the old
250 code did.
251
252 (post, prepend_msg): Actually call notify_msg_ready instead of
253 setting the input event directly.
254
98daa893
EZ
2552012-10-07 Eli Zaretskii <eliz@gnu.org>
256
257 * ralloc.c (relinquish): If a heap is ready to be relinquished,
258 but it still has blocs in it, don't return it to the system,
259 instead of aborting. (Bug#12402)
260
3bc0a2f7
JD
2612012-10-07 Jan Djärv <jan.h.d@swipnet.se>
262
8ad5b73b 263 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 264
335f5ae4
JD
265 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
266 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
267 (syms_of_nsterm): Remove comment about Panther and above for
268 ns-antialias-text.
335f5ae4
JD
269 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
270 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
271 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
272
273 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
274 MAC_OS_X_VERSION_10_4.
275
8ad5b73b
JD
276 * nsmenu.m (fillWithWidgetValue:): Remove code for <
277 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
278
279 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
280
281 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
282 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
283
3bc0a2f7
JD
284 * nsterm.m (ns_in_resize): Remove (Bug#12479).
285 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8ad5b73b
JD
286 (ns_clear_frame, sendEvent, windowDidResize, drawRect:): Remove
287 ns_in_resize check.
3bc0a2f7
JD
288 (ns_clear_frame_area): Remove resize handle code.
289
290 * nsfns.m (ns_in_resize): Remove.
8ad5b73b
JD
291 (x_set_icon_name, ns_set_name, ns_set_name_as_filename): Remove
292 ns_in_resize check.
3bc0a2f7 293
c622b48f
PE
2942012-10-07 Paul Eggert <eggert@cs.ucla.edu>
295
296 Improve sys_siglist detection.
297 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
298 defined as a macro, as is done in Solaris.
299 (sys_siglist_entries): New macro.
300 (save_strsignal): Use it.
301 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
302 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
303
04fafa46
JD
3042012-10-06 Jan Djärv <jan.h.d@swipnet.se>
305
306 * nsfns.m (Fx_create_frame): Call x_default_parameter with
307 fullscreen/Fullscreen.
308
309 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
310 tobar_height is new.
311
312 * nsterm.m (x_make_frame_visible): Check for fullscreen.
313 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
314 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
315 (windowDidResize:): Check for correct window if old style fullscreen.
316 Capitalize word in comment. Remove incorrect comment.
317 (initFrameFromEmacs:): tbar_height renamed tibar_height.
318 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
319 error in drawing background.
320 (toggleFullScreen:): Remove comment. Rearrange calls.
321 Set toolbar values to zero, save old height in tobar_height.
322 Restore tool bar height when leaving fullscreen.
323 (canBecomeMainWindow): New function.
324
c6e21c03
PE
3252012-10-06 Paul Eggert <eggert@cs.ucla.edu>
326
327 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
328
0d9f584b
EZ
3292012-10-05 Eli Zaretskii <eliz@gnu.org>
330
a65fbb5f
EZ
331 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
332
0d9f584b
EZ
333 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
334 that time stamps of directories could also be changed. Don't
335 request the too broad GENERIC_WRITE, only the more restrictive
336 FILE_WRITE_ATTRIBUTES access rights.
337
338 * fileio.c (Fset_file_times): Special-case ignoring errors for
339 directories only on MSDOS, not on MS-Windows.
340
e8757f09 3412012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
342
343 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
344
7604f298
EZ
3452012-10-04 Eli Zaretskii <eliz@gnu.org>
346
347 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
348 see whether CreateFile failed.
349
88d69b7d
PE
3502012-10-04 Paul Eggert <eggert@cs.ucla.edu>
351
352 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
353 to avoid similar races.
354 * keyboard.c (pending_signals): Now bool, not int.
355
7509f454
PE
356 Port timers to OpenBSD, plus check for timer failures.
357 OpenBSD problem reported by Han Boetes.
358 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
359 and/or setitimer.
360 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
361 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
362 like OpenBSD, which has timer_settime but does not declare it.
363 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
364 whether to use itimerspec-related primitives. All uses of
365 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
366
a3c5c0c5
PE
3672012-10-02 Paul Eggert <eggert@cs.ucla.edu>
368
369 * profiler.c (handle_profiler_signal): Fix a malloc race
370 that caused Emacs to hang on Fedora 17 when profiling Lisp.
371
914e743b
JD
3722012-10-02 Jan Djärv <jan.h.d@swipnet.se>
373
374 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
375
d8ab37a8
EZ
3762012-10-02 Eli Zaretskii <eliz@gnu.org>
377
378 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
379 consistent with the change in return value of 'safe_strsignal'.
380
b3ecad33
PE
3812012-10-02 Paul Eggert <eggert@cs.ucla.edu>
382
0a99eee1
PE
383 Prefer plain 'static' to 'static inline' (Bug#12541).
384 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
385 (bidi_set_sor_type, bidi_push_embedding_level)
386 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
387 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
388 (bidi_cache_search, bidi_cache_ensure_space)
389 (bidi_cache_iterator_state, bidi_cache_find)
390 (bidi_peek_at_next_level, bidi_set_paragraph_end)
391 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
392 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
393 Now 'static', not 'static inline'.
394
b3ecad33
PE
395 Count overruns when profiling; change units to ns.
396 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
397 Give extra weight to samples after overruns, to attempt to count
398 the time more accurately.
399 (setup_cpu_timer): Change sampling interval units from ms to ns, since
400 the underlying primitives nominally do ns.
401 (Fprofiler_cpu_start): Document the change. Mention that
402 the sampling intervals are only approximate.
403
090cf9db
SM
4042012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
405
406 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
407
408 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
409 case for the special 0 coding-system.
410
411 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
412 (Fmake_overlay): Remove redundant tests.
64edc777 413 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 414
81550bf4
JB
4152012-10-02 Juanma Barranquero <lekktu@gmail.com>
416
417 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
418 Update dependencies.
419
aa1ba90e
PE
4202012-10-01 Paul Eggert <eggert@cs.ucla.edu>
421
422 Fix a malloc race condition involving strsignal.
423 A signal can arrive in the middle of a malloc, and Emacs's signal
424 handler can invoke strsignal, which can invoke malloc, which is
425 not portable. This race condition bug makes Emacs hang on GNU/Linux.
426 Fix it by altering the signal handler so that it does not invoke
427 strsignal.
428 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
429 * process.c (status_message): Use const pointer, in case strsignal
430 is #defined to safe_strsignal.
431 * sysdep.c (sys_siglist, init_signals): Always define and
432 initialize a substitute sys_siglist if the system does not define
433 one, even if HAVE_STRSIGNAL.
434 (safe_strsignal): Rename from strsignal. Always define,
435 using sys_siglist. Return a const pointer.
436 * syssignal.h (safe_strsignal): New decl.
437 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
438
ace917bd
EZ
4392012-10-01 Eli Zaretskii <eliz@gnu.org>
440
441 * w32proc.c (timer_loop): Fix code that waits for timer
442 expiration, to avoid high CPU usage.
443
9eb71b9c
SM
4442012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
445
446 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
447 (sweep_weak_table): Remove redundant prototypes.
448
b3317662
FP
4492012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
450
451 * emacs.c: Move the inclusion of TERM_HEADER after including
452 windows.h on WINDOWSNT. This avoids compilation problems with
453 MSVC.
454
f0e5f225
EZ
4552012-10-01 Eli Zaretskii <eliz@gnu.org>
456
2d7d1608
EZ
457 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
458 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
459 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
460 as the previous version used 'void *'.
461
462 * ralloc.c (ROUNDUP): Fix last change.
463 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
464 'size_t'.
465
f0e5f225
EZ
466 * w32proc.c <disable_itimers>: New static flag.
467 (init_timers): Initialize it to zero, after creating the critical
468 sections used by the timer threads.
469 (term_timers): Set to 1 before deleting the critical sections.
470 (getitimer, setitimer): If disable_itimers is non-zero, return an
471 error indication without doing anything. Reported by Fabrice
472 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
473 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
474 return results.
475 [!HAVE_SETITIMER]: Behave as the previous version that didn't
476 support timers.
f0e5f225
EZ
477
478 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
479 term_ntproc after all the other bookkeeping, to get timers working
480 as long as possible.
481
82ef37c1
PE
4822012-10-01 Paul Eggert <eggert@cs.ucla.edu>
483
b3a4c387
PE
484 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
485 Suggested by Juri Linkov in
486 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
487
b0ab8123
PE
488 Prefer plain 'static' to 'static inline' (Bug#12541).
489 With static functions, modern compilers inline pretty well by
490 themselves; advice from programmers often hurts as much as it helps.
491 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
492 this change shrinks the text size of the Emacs executable by 1.1%
493 without affecting CPU significantly in my benchmark.
494 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
495 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
496 (mark_maybe_object, mark_maybe_pointer, bounded_number):
497 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
498 (bset_auto_fill_function, bset_auto_save_file_format)
499 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
500 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
501 (bset_cache_long_line_scans, bset_case_fold_search)
502 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
503 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
504 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
505 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
506 (bset_header_line_format, bset_indicate_buffer_boundaries)
507 (bset_indicate_empty_lines, bset_invisibility_spec)
508 (bset_left_fringe_width, bset_major_mode, bset_mark)
509 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
510 (bset_name, bset_overwrite_mode, bset_pt_marker)
511 (bset_right_fringe_width, bset_save_length)
512 (bset_scroll_bar_width, bset_scroll_down_aggressively)
513 (bset_scroll_up_aggressively, bset_selective_display)
514 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
515 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
516 (set_buffer_overlays_after):
517 * category.c (bset_category_table):
518 * charset.c (read_hex):
519 * coding.c (produce_composition, produce_charset)
520 (handle_composition_annotation, handle_charset_annotation)
521 (char_encodable_p):
522 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
523 (assign_row, set_frame_matrix_frame, make_current)
524 (add_row_entry):
525 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
526 * fns.c (maybe_resize_hash_table):
527 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
528 * gmalloc.c (register_heapinfo):
529 * image.c (lookup_image_type):
530 * intervals.c (set_interval_object, set_interval_left)
531 (set_interval_right, copy_interval_parent, rotate_right)
532 (rotate_left, balance_possible_root_interval):
533 * keyboard.c (kset_echo_string, kset_kbd_queue)
534 (kset_keyboard_translate_table, kset_last_prefix_arg)
535 (kset_last_repeatable_command, kset_local_function_key_map)
536 (kset_overriding_terminal_local_map, kset_real_last_command)
537 (kset_system_key_syms, clear_event, set_prop):
538 * lread.c (digit_to_number):
539 * marker.c (attach_marker, live_buffer, set_marker_internal):
540 * nsterm.m (ns_compute_glyph_string_overhangs):
541 * process.c (pset_buffer, pset_command)
542 (pset_decode_coding_system, pset_decoding_buf)
543 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
544 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
545 (pset_status, pset_tty_name, pset_type, pset_write_queue):
546 * syntax.c (bset_syntax_table, dec_bytepos):
547 * terminal.c (tset_param_alist):
548 * textprop.c (interval_has_some_properties)
549 (interval_has_some_properties_list):
550 * window.c (wset_combination_limit, wset_dedicated)
551 (wset_display_table, wset_hchild, wset_left_fringe_width)
552 (wset_left_margin_cols, wset_new_normal, wset_new_total)
553 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
554 (wset_right_fringe_width, wset_right_margin_cols)
555 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
556 (wset_vertical_scroll_bar_type, wset_window_parameters):
557 * xdisp.c (wset_base_line_number, wset_base_line_pos)
558 (wset_column_number_displayed, wset_region_showing)
559 (window_box_edges, run_window_scroll_functions)
560 (append_glyph_string_lists, prepend_glyph_string_lists)
561 (append_glyph_string, set_glyph_string_background_width)
562 (append_glyph, append_composite_glyph)
563 (take_vertical_position_into_account):
564 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
565 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
566 (lface_hash, lface_same_font_attributes_p, lookup_face):
567 * xml.c (libxml2_loaded_p):
568 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
569 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
570 Now 'static', not 'static inline'.
571
05584c31
PE
572 * bidi.c: Tune.
573 (bidi_copy_it): Do the whole copy with a single memcpy.
574 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
575
86ec63ba
PE
576 Revert the FOLLOW-SYMLINKS change for file-attributes.
577 Doing it right would require several changes to Tramp, and there's
578 not enough time to get that tested before the freeze today.
579 * dired.c (directory_files_internal, Ffile_attributes):
580 Undo last change.
581
82ef37c1
PE
582 * frame.c (x_report_frame_params): Port better to wider ints.
583 Do not assume that EMACS_UINT is the same width as uprintmax_t,
584 or that pointers can be printed in 15 decimal digits.
585 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
586
62aba0d4
FP
5872012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
588
589 Support x64 build on MS-Windows.
590 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
591 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
592 compatibility with x64.
5e4daaf3 593 (x_get_focus_frame): Add prototype.
62aba0d4
FP
594
595 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
596 defining an XRectangle structure.
597
598 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
599 arithmetics for compatibility with x64.
600
601 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
602 compatibility with x64.
603
604 * w32heap.h: Adjust prototypes and declarations.
605
606 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
607 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
608 DWORD, long, and unsigned long, for compatibility with x64.
609 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
610 (sbrk): Argument is now of type ptrdiff_t.
611
612 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
613 less than 0x0500.
614 (w32_msg_pump): Use WPARAM type for 'result'.
615
616 * w32.c (init_environment, get_emacs_configuration): Support AMD64
617 architecture.
618 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
619 compatibility with x64.
620
621 * vm-limit.c (lim_data): Now size_t.
622 (check_memory_limits): Adjust prototypes of real_morecore and
623 __morecore to receive argument of type ptrdiff_t. Use size_t for
624 five_percent and data_size.
625
626 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
627 variables, for compatibility with x64.
628 (rva_to_section, offset_to_section, relocate_offset)
629 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
630 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
631 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
632 for compatibility with x64.
633
634 * sysdep.c (STDERR_FILENO): Define if not already defined.
635
636 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
637 (__morecore): Argument type is now ptrdiff_t.
638 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
639 (relinquish): Use ptrdiff_t type for 'excess'.
640 (r_alloc_sbrk): Argument type is now ptrdiff_t.
641
642 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
643 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
644 instead of a literal number.
645
646 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
647 (min): Define only if not already defined.
648
649 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
650 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
651 hosts.
652
653 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
654 'bitmaps' is a pointer.
655
656 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
657
658 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
659
e7a2937b
PE
6602012-09-30 Paul Eggert <eggert@cs.ucla.edu>
661
662 file-attributes has a new optional arg FOLLOW-SYMLINKS.
663 * dired.c (directory_files_internal, Ffile_attributes):
664 New arg follow_symlinks. All uses changed.
665
b43d62ae
SM
6662012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
667
668 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
669
c06c382a
EZ
6702012-09-30 Eli Zaretskii <eliz@gnu.org>
671
672 Support atimers and CPU profiler via profile.c on MS-Windows.
673 * w32proc.c (sig_mask, crit_sig): New static variables.
674 (sys_signal): Support SIGALRM and SIGPROF.
675 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 676 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
677 sigfillset, and sigprocmask are no longer no-ops.
678 (sigismember): New function.
679 (struct itimer_data): New definition.
680 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
681 (crit_prof): New static variables.
682 (MAX_SINGLE_SLEEP): New definition.
683 (timer_loop, stop_timer_thread, term_timers, init_timers)
684 (start_timer_thread, getitimer, setitimer): New functions.
685 (alarm): No longer a no-op, calls setitimer.
686
687 * w32.c (term_ntproc): Call term_timers.
688 (init_ntproc): Make sure all signals are unblocked at startup, to
689 erase any traces of dumping. Call init_timers.
690
691 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
692 Windows-specific code to display the hourglass mouse pointer is no
693 longer used.
694 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
695 to hourglass timer expiration.
696 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
697 Remove, no longer used.
b43d62ae
SM
698 (w32_note_current_window, show_hourglass, hide_hourglass):
699 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
700 window systems.
701 (syms_of_w32fns): Don't initialize hourglass_timer.
702
703 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
704 WINDOWSNT as well.
705 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
706
707 * w32.h (init_timers, term_timers): Add prototypes.
708
95402d5f
KH
7092012-09-30 Kenichi Handa <handa@gnu.org>
710
711 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
712 to the buffer relocation which may be caused by ccl_driver.
713
dd946752
JD
7142012-09-30 Jan Djärv <jan.h.d@swipnet.se>
715
d7e642cc
JD
716 * xfns.c (Fx_file_dialog): Update comment.
717
718 * w32fns.c (Fx_file_dialog): Update comment.
719
720 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
721 Initialize panel name field if OSX >= 10.6.
722
723 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
724
dd946752
JD
725 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
726
727 * nsterm.m (NEW_STYLE_FS): New define.
728 (ns_fullscreen_hook, windowWillEnterFullScreen)
729 (windowDidEnterFullScreen, windowWillExitFullScreen)
730 (windowDidExitFullScreen, toggleFullScreen, handleFS)
731 (setFSValue): New functions.
732 (EmacsFSWindow): New implementation.
733 (canBecomeKeyWindow): New function for EmacsFSWindow.
734 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
735 (dealloc): Release nonfs_window if in fullscreen.
736 (updateFrameSize:): Call windowDidMove to update top/left.
737 (windowWillResize:toSize:): Check if frame is still maximized.
738 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
739 next_maximized, maximized_width, maximized_height and nonfs_window.
740 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
741 tbar_height.
742 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
743 fullscreen. Set maximized_width/height. Act on next_maximized.
744
745 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
746 (EmacsView): Add variables for fullscreen.
747 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
748 (EmacsFSWindow): New interface for fullscreen.
749
427730eb
JB
7502012-09-30 Juanma Barranquero <lekktu@gmail.com>
751
752 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
753
48de8b12
CY
7542012-09-30 Chong Yidong <cyd@gnu.org>
755
756 * fns.c (Frandom): Doc fix.
757
5938d519
MR
7582012-09-30 Martin Rudalics <rudalics@gmx.at>
759
760 * window.c (Vwindow_combination_limit): New default value.
761 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
762
cb5b0266
PE
7632012-09-30 Paul Eggert <eggert@cs.ucla.edu>
764
765 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
766 Suggested by Eli Zaretskii in
767 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
768
84f72efd
EZ
7692012-09-30 Eli Zaretskii <eliz@gnu.org>
770
771 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
772 HAVE_TIMER_SETTIME is defined.
773
9d4dcdc9
PE
7742012-09-30 Paul Eggert <eggert@cs.ucla.edu>
775
d89460ed
PE
776 Profiler improvements: more-accurate timers, overflow checks.
777 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
778 signal.h, setjmp.h. Include systime.h instead.
779 (saturated_add): New function.
780 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
781 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
782 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
783 New static vars.
84f72efd 784 (enum profiler_cpu_running): New enum.
d89460ed
PE
785 (profiler_cpu_running): Now of that enum type, not bool.
786 All uses changed to store the new value.
787 (handle_profiler_signal): Rename from sigprof_handler_1,
788 for consistency with other handlers. Do not check whether
789 cpu_log is a hash-table if garbage collecting, since it
790 doesn't matter in that case.
791 (deliver_profiler_signal): Rename from sigprof_handler,
792 for consistency with other handlers.
793 (setup_cpu_timer): New function, with much of what used to be in
794 Fprofiler_cpu_start. Check for out-of-range argument.
795 Prefer timer_settime if available, and prefer
796 thread cputime clocks, then process cputime clocks, then
797 monotonic clocks, to the old realtime clock. Use make_timeval
798 to round more-correctly when falling back to setitimer.
799 (Fprofiler_cpu_start): Use it.
800 (Fprofiler_cpu_stop): Prefer timer_settime if available.
801 Don't assume that passing NULL as the 2nd argument of setitimer
802 is the same as passing a pointer to all-zero storage.
803 Ignore SIGPROF afterwards.
804 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
805 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
806 non-fatal signal handlers. Ignore SIGPROF on startup.
807 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
808 in profiler.c, since sysdep.c now uses it.
809
9d4dcdc9
PE
810 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
811 Suggested by Eli Zaretskii in
812 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
813
8e5691a0
JB
8142012-09-29 Juanma Barranquero <lekktu@gmail.com>
815
816 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
817
e7c1b6ef
SM
8182012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
819
820 * lisp.h (struct backtrace): Remove indirection for `function' field.
821 * xdisp.c (redisplay_internal):
822 * profiler.c (record_backtrace, sigprof_handler_1):
823 * alloc.c (Fgarbage_collect):
824 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
825 (Fbacktrace_frame): Adjust accordingly.
826
e61d39cd 8272012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
828
829 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
830 (Frun_hook_with_args_until_failure): Doc fixes.
831
404043ea
EZ
8322012-09-28 Eli Zaretskii <eliz@gnu.org>
833
834 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
835 Qautomatic_redisplay and change the symbol name. All users changed.
836
704d3f45
TM
8372012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
838
839 * profiler.c (sigprof_handler): Fix race condition.
840
757140ff
GM
8412012-09-28 Glenn Morris <rgm@gnu.org>
842
843 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
844
a615a3ae
PE
8452012-09-27 Paul Eggert <eggert@cs.ucla.edu>
846
847 Check more robustly for timer_settime.
89d17fd0
PE
848 * Makefile.in (LIB_TIMER_TIME): New macro.
849 (LIBES): Add it.
a615a3ae
PE
850 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
851 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
852 call timer_settime.
853
3670daf7
TM
8542012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
855
856 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
857
6a586b7f
JB
8582012-09-26 Juanma Barranquero <lekktu@gmail.com>
859
860 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
861
41c8bfcf
PE
8622012-09-26 Paul Eggert <eggert@cs.ucla.edu>
863
864 * character.h (MAYBE_UNIFY_CHAR): Remove.
865 * charset.c, charset.h (maybe_unify_char): Now static.
866 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
867 Since this stuff is now private to charset.c, there's no need for
868 a public macro and no need to inline by hand.
869
3a880af4
SM
8702012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
871 Stefan Monnier <monnier@iro.umontreal.ca>
872 Juanma Barranquero <lekktu@gmail.com>
611b7507 873
3a880af4
SM
874 * profiler.c: New file.
875 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
876 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
877 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
878 * emacs.c (main): Call syms_of_profiler.
879 * alloc.c (Qautomatic_gc): New constant.
880 (MALLOC_PROBE): New macro.
881 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
882 (total_bytes_of_live_objects): New function.
883 (Fgarbage_collect): Use it. Record itself in backtrace_list.
884 Call malloc_probe for the memory profiler.
885 (syms_of_alloc): Define Qautomatic_gc.
886 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
887 race condition.
888 (struct backtrace): Move definition...
889 * lisp.h (struct backtrace): ..here.
890 (Qautomatic_gc, profiler_memory_running): Declare vars.
891 (malloc_probe, syms_of_profiler): Declare functions.
892 * xdisp.c (Qautomatic_redisplay): New constant.
893 (redisplay_internal): Record itself in backtrace_list.
894 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 895
5938d519 8962012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
8972012-09-25 Juanma Barranquero <lekktu@gmail.com>
898
899 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
900
e26fd2e4
PE
9012012-09-25 Paul Eggert <eggert@cs.ucla.edu>
902
903 Prefer POSIX timers if available.
904 They avoid a race if the timer is too close to the current time.
905 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
906 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 907 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 908
eedec3ee
EZ
9092012-09-25 Eli Zaretskii <eliz@gnu.org>
910
911 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
912 CHAR_STRING_ADVANCE.
913 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
914 STRING_CHAR_ADVANCE.
915
aa15c6bb
JB
9162012-09-25 Juanma Barranquero <lekktu@gmail.com>
917
918 Move Vlibrary_cache to emacs.c and reset before dumping.
919
920 * lisp.h (reset_image_types): Declare.
921 [WINDOWSNT] (Vlibrary_cache): Declare.
922
923 * image.c (reset_image_types): New function.
924
925 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
926 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
927 (Fdump_emacs): Reset Vlibrary_cache and image_types.
928
929 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
930 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
931
932 * w32.h (Vlibrary_cache): Do not declare.
933
54d629be
EZ
9342012-09-25 Eli Zaretskii <eliz@gnu.org>
935
16b22fef
EZ
936 * w32proc.c (sys_signal): Handle all signals defined by the
937 MS-Windows runtime, not just SIGCHLD. Actually install the signal
938 handlers for signals supported by Windows. Don't override
939 term_ntproc as the handler for SIGABRT.
940 (sigaction): Rewrite to call sys_signal instead of duplicating its
941 code.
942 (sys_kill): Improve commentary.
943
944 * w32.c (term_ntproc): Accept (and ignore) one argument, for
945 consistency with a signature of a signal handler. All callers
946 changed.
947 (init_ntproc): Accept an argument DUMPING. If dumping, don't
948 install term_ntproc as a signal handler for SIGABRT, as that
949 should be done by the dumped Emacs.
950
951 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
952
953 * w32select.c (term_w32select): Protect against repeated
954 invocation by setting clipboard_owner to NULL after calling
955 DestroyWindow.
956
957 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
958 and term_ntproc to their modified signatures.
959
54d629be
EZ
960 * character.c (char_string, string_char): Remove calls to
961 MAYBE_UNIFY_CHAR. See the discussion starting at
962 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
963 for the details.
964
59f7af81
CY
9652012-09-25 Chong Yidong <cyd@gnu.org>
966
967 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
968
22e8cf4a
SM
9692012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
970
971 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
972 when encountering an unknown bytecode.
973
578098f3
PE
9742012-09-24 Paul Eggert <eggert@cs.ucla.edu>
975
976 image.c, indent.c: Use bool for booleans.
977 * dispextern.h (struct image_type): Members valid_p, load, init
978 now return bool, not int. All uses changed.
979 * image.c: Omit unnecessary static decls.
980 (x_create_bitmap_mask, x_build_heuristic_mask):
981 Return void, not int, since callers don't care about the return value.
982 (x_create_bitmap_mask, define_image_type, valid_image_p)
983 (struct image_keyword, parse_image_spec, image_spec_value)
984 (check_image_size, image_background)
985 (image_background_transparent, x_clear_image_1)
986 (postprocess_image, lookup_image, x_check_image_size)
987 (x_create_x_image_and_pixmap, xbm_image_p)
988 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
989 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
990 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
991 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
992 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
993 (png_image_p, init_png_functions, png_load_body, png_load)
994 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
995 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
996 (init_gif_functions, gif_load, imagemagick_image_p)
997 (imagemagick_load_image, imagemagick_load, svg_image_p)
998 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
999 (gs_load):
1000 * nsimage.m (ns_load_image):
1001 * nsterm.m (ns_defined_color):
1002 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1003 * xfns.c (x_defined_color):
1004 * xterm.c (x_alloc_lighter_color_for_widget)
1005 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1006 (x_alloc_lighter_color):
1007 * indent.c (disptab_matches_widthtab, current_column)
1008 (scan_for_column, string_display_width, indented_beyond_p)
1009 (compute_motion, vmotion, Fvertical_motion):
1010 Use bool for booleans.
1011
a5f2b6ec
CY
10122012-09-24 Chong Yidong <cyd@gnu.org>
1013
1014 * chartab.c (Fset_char_table_default): Obsolete function removed.
1015
18e27ea8
PE
10162012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1017
afea8a8a
PE
1018 Move pid_t related decls out of lisp.h.
1019 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1020 (interruptible_wait_for_termination):
1021 Move these decls from lisp.h to syswait.h, since they use pid_t.
1022 Needed on FreeBSD; see Herbert J. Skuhra in
1023 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1024 * callproc.c: Include syswait.h.
1025
18e27ea8
PE
1026 gnutls.c, gtkutil.c: Use bool for boolean.
1027 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1028 (emacs_gnutls_handle_error):
1029 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1030 (xg_hide_tooltip, xg_create_frame_widgets)
1031 (create_dialog, xg_uses_old_file_dialog)
1032 (xg_get_file_with_chooser, xg_get_file_with_selection)
1033 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1034 (xg_item_label_same_p, xg_update_menubar)
1035 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1036 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1037 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1038 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1039 (update_frame_tool_bar, free_frame_tool_bar):
1040 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1041 * nsmenu.m (ns_update_menubar):
1042 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1043 * xfns.c (Fx_show_tip) [USE_GTK]:
1044 Use bool for boolean.
1045 * gtkutil.c (xg_update_frame_menubar):
1046 * xmenu.c (update_frame_menubar):
1047 Return void, not int, since caller ignores return value.
1048 * gtkutil.c (xg_change_toolbar_position):
1049 Return void, not 1.
1050
af0e9f75
JB
10512012-09-23 Juanma Barranquero <lekktu@gmail.com>
1052
1053 * makefile.w32-in (BLOCKINPUT_H): Remove.
1054 (SYSSIGNAL_H): New macro.
1055 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1056 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1057 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1058 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1059 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1060 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1061 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1062 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1063 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1064 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1065 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1066 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1067 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1068 ($(BLD)/w32xfns.$(O)): Update dependencies.
1069
5101529e
EZ
10702012-09-23 Eli Zaretskii <eliz@gnu.org>
1071
1072 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1073 fatal_error_backtrace.
1074
1075 * w32proc.c (sys_kill): Undo last change: don't do anything when
1076 invoked to deliver SIGABRT to our own process. This is now
1077 handled by emacs_raise.
1078
2c3ee0ad
JB
10792012-09-23 Juanma Barranquero <lekktu@gmail.com>
1080
1081 * w32term.c (w32_read_socket): Remove leftover reference to
1082 interrupt_input_pending.
1083
62a1d661
PE
10842012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1085
1086 Do not use SA_NODEFER.
1087 Problem reported by Dani Moncayo in
1088 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1089 * alloc.c (die):
1090 * sysdep.c (emacs_abort): Do not reset signal handler.
1091 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1092 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1093 wanted even on POSIXish hosts, and it doesn't work on Windows.
1094
a0942b9a
JD
10952012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1096
1097 * xterm.c (x_term_init): Call fixup_locale before and after calling
1098 gtk_init (Bug#12392).
1099
d07ff9db
CY
11002012-09-23 Chong Yidong <cyd@gnu.org>
1101
1102 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1103 Vdynamic_library_alist.
1104
1105 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1106 (Fgnutls_available_p): Caller changed.
1107
1108 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1109 (Flibxml_parse_xml_region): Likewise.
1110
1111 * dispextern.h (struct image_type): Remove arg from init function.
1112
1113 * image.c (Finit_image_library, lookup_image_type)
1114 (define_image_type): Remove now-unneeded second arg.
1115 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1116 (init_tiff_functions, init_gif_functions, init_svg_functions):
1117 Arglist and w32_delayed_load calling convention changed.
1118 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 1119 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 1120
4d7e6e51
PE
11212012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1122
1123 Simplify and avoid signal-handling races (Bug#12471).
1124 * alloc.c (die):
1125 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1126 Avoid recursive loop if there's a fatal error in the function itself.
1127 * atimer.c (pending_atimers):
1128 * blockinput.h: Don't include "atimer.h"; no longer needed.
1129 (interrupt_input_pending): Remove. All uses removed.
1130 pending_signals now counts both atimers and ordinary interrupts.
1131 This is less racy than having three separate pending-signal flags.
1132 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1133 (input_blocked_p):
1134 Rename from their upper-case counterparts BLOCK_INPUT,
1135 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1136 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1137 This makes it easier to access volatile variables more accurately.
1138 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1139 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1140 that's more reliable if the code is buggy and sets
1141 interrupt_input_blocked to a negative value. All uses changed.
1142 * atimer.c (deliver_alarm_signal):
1143 Remove. No need to deliver this to the parent; any thread can
1144 handle this signal now. All uses replaced by underlying handler.
1145 * atimer.c (turn_on_atimers):
1146 * dispnew.c (handle_window_change_signal):
1147 * emacs.c (handle_danger_signal):
1148 * keyboard.c (kbd_buffer_get_event):
1149 Don't reestablish signal handler; not needed with sigaction.
1150 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1151 (UNBLOCK_INPUT_TO):
1152 Rework to avoid unnecessary accesses to volatile variables.
1153 (UNBLOCK_INPUT_TO): Now a function.
1154 (totally_unblock_input, unblock_input): New decls.
1155 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1156 (init_data): Remove. Necessary stuff now done in init_signal.
1157 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1158 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1159 (fatal_error_code): Remove; no longer needed.
1160 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1161 it doesn't always backtrace. All uses changed. No need to reset
1162 signal to default, since sigaction and/or die does that for us now.
1163 Use emacs_raise (FOO), not kill (getpid (), FOO).
1164 (main): Check more-accurately whether we're dumping.
1165 Move fatal-error setup to sysdep.c
1166 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1167 * gtkutil.c (xg_get_file_name, xg_get_font):
1168 Remove no-longer-needed signal-mask manipulation.
1169 * keyboard.c, process.c (POLL_FOR_INPUT):
1170 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1171 * keyboard.c (read_avail_input): Remove.
1172 All uses replaced by gobble_input.
1173 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1174 (kbd_buffer_store_event_hold, gobble_input):
1175 (record_asynch_buffer_change) [USABLE_SIGIO]:
1176 (store_user_signal_events):
1177 No need to mess with signal mask.
1178 (gobble_input): If blocking input and there are terminals, simply
1179 set pending_signals to 1 and return. All hooks changed to not
1180 worry about whether input is blocked.
1181 (process_pending_signals): Clear pending_signals before processing
1182 them, in case a signal comes in while we're processing.
1183 By convention callers now test pending_signals before calling us.
1184 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
1185 New functions, to support changes to blockinput.h.
1186 (handle_input_available_signal): Now extern.
1187 (reinvoke_input_signal): Remove. All uses replaced by
1188 handle_async_input.
1189 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
1190 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
1191 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
1192 Clear sigmask reliably, even if Fsignal returns, which it can.
1193 Omit unnecessary accesses to volatile var.
1194 (quit_throw_to_read_char): No need to restore sigmask.
1195 * keyboard.c (gobble_input, handle_user_signal):
1196 * process.c (wait_reading_process_output):
1197 Call signal-handling code rather than killing ourselves.
1198 * lisp.h: Include <float.h>, for...
1199 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
1200 (pending_signals): Now volatile.
1201 (syms_of_data): Now const if IEEE floating point.
1202 (handle_input_available_signal) [USABLE_SIGIO]:
1203 (terminate_due_to_signal, record_child_status_change): New decls.
1204 * process.c (create_process): Avoid disaster if memory is exhausted
1205 while we're processing a vfork, by tightening the critical section
1206 around the vfork.
1207 (send_process_frame, process_sent_to, handle_pipe_signal)
1208 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
1209 ignores SIGPIPE.
1210 (send_process): No need for setjmp/longjmp any more, since the
1211 SIGPIPE stuff is now gone. Instead, report an error if errno
1212 is EPIPE.
1213 (record_child_status_change): Now extern. PID and W are now args.
1214 Return void, not bool. All callers changed.
1215 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
1216 Remove. All uses removed. This bug should be fixed now in a
1217 different way.
1218 (wait_for_termination_1): Use waitpid rather than sigsuspend,
1219 and record the child status change directly. This avoids the
1220 need to futz with the signal mask.
1221 (process_fatal_action): Move here from emacs.c.
1222 (emacs_sigaction_flags): New function, containing
1223 much of what used to be in emacs_sigaction_init.
1224 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
1225 caught by emacs, to make races less likely.
1226 (deliver_process_signal): Rename from handle_on_main_thread.
1227 All uses changed.
1228 (BACKTRACE_LIMIT_MAX): Now at top level.
1229 (thread_backtrace_buffer, threadback_backtrace_pointers):
1230 New static vars.
1231 (deliver_thread_signal, deliver_fatal_thread_signal):
1232 New functions, for more-accurate delivery of thread-specific signals.
1233 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
1234 (deliver_arith_signal): Handle in this thread, not
1235 in the main thread, since it's triggered by this thread.
1236 (maybe_fatal_sig): New function.
1237 (init_signals): New arg DUMPING so that we can be more accurate
1238 about whether we're dumping. Caller changed.
1239 Treat thread-specific signals differently from process-general signals.
1240 Block all signals while handling fatal error; that's safer.
1241 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
1242 on IEEE hosts.
1243 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
1244 Ignore SIGPIPE unless batch.
1245 (emacs_backtrace): Output backtrace for the appropriate thread,
1246 which is not necessarily the main thread.
1247 * syssignal.h: Include <stdbool.h>.
1248 (emacs_raise): New macro.
1249 * xterm.c (x_connection_signal): Remove; no longer needed
1250 now that we use sigaction.
1251 (x_connection_closed): No need to mess with sigmask now.
1252 (x_initialize): No need to reset SIGPIPE handler here, since
1253 init_signals does this for us now.
1254
8f4635e9
JD
12552012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1256
1257 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 1258 background rect may be larger (Bug#12245).
8f4635e9 1259
3296976d
CY
12602012-09-23 Chong Yidong <cyd@gnu.org>
1261
1262 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
1263
d41e491e
PE
12642012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1265
1266 * .gdbinit: Just stop at fatal_error_backtrace.
1267 See Stefan Monnier's request in
1268 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
1269 Remove no-longer-used query of system type.
1270
c88b867f
CY
12712012-09-22 Chong Yidong <cyd@gnu.org>
1272
1273 * search.c (Freplace_match): Doc fix (Bug#12325).
1274
1275 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
1276
1277 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
1278 (Fline_end_position): Doc fix.
1279
1280 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
1281
bb4d86b4
CY
12822012-09-22 Chong Yidong <cyd@gnu.org>
1283
1284 * dispextern.h (struct image_type): Add new slot, storing a type
1285 initialization function.
1286
1287 * image.c (define_image_type): Call the image initializer function
1288 if it is defined. Arguments and return value changed.
1289 (valid_image_p, make_image): Callers changed.
1290 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
1291 (gif_type, imagemagick_type, svg_type, gs_type):
1292 Add initialization functions.
bb4d86b4
CY
1293 (Finit_image_library): Call lookup_image_type.
1294 (CHECK_LIB_AVAILABLE): Macro deleted.
1295 (lookup_image_type): Call define_image_type here, rather than via
1296 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
1297 (syms_of_image): Move define_image_type calls for xbm_type and
1298 pbm_type to lookup_image_type.
1299
df9685f3
EZ
13002012-09-22 Eli Zaretskii <eliz@gnu.org>
1301
1302 * keyboard.c (timer_check_2): Move calculation of 'timers' and
1303 'idle_timers' from here ...
1304 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
1305 lists, to avoid infloops when the timer does something stupid,
1306 like reinvoke itself with the same or smaller time-out.
1307 (Bug#12447)
1308
8e17c9ba
MR
13092012-09-22 Martin Rudalics <rudalics@gmx.at>
1310
1311 * window.c (Fsplit_window_internal): Handle only Qt value of
1312 Vwindow_combination_limit separately.
1313 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
1314 (Vwindow_combination_limit): New default value.
1315 Rewrite doc-string.
8e17c9ba 1316
589bd69b
EZ
13172012-09-22 Eli Zaretskii <eliz@gnu.org>
1318
1319 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
1320 the new overlay string. (Bug#10159)
1321
01108e3f
PE
13222012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1323
1324 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
1325 or that fprintf is async-signal-safe. POSIX doesn't require
1326 either assumption.
1327
82f8cd94
CY
13282012-09-22 Chong Yidong <cyd@gnu.org>
1329
1330 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
1331 (Bug#8207).
1332
3cccbd87
KH
13332012-09-22 Kenichi Handa <handa@gnu.org>
1334
1335 * composite.c (composition_reseat_it): Handle the case that a
1336 grapheme cluster is not covered by a single font (Bug#12352).
1337
09c01941
CY
13382012-09-21 Chong Yidong <cyd@gnu.org>
1339
1340 * image.c (define_image_type): Avoid adding duplicate types to
1341 image_types (Bug#12463). Suggested by Jörg Walter.
1342
acfa068f 13432012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
1344
1345 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
1346 (print_load_command_name): Add case LC_DATA_IN_CODE.
1347 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
1348
acfa068f 13492012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
1350
1351 * eval.c (Frun_hook_with_args_until_success)
1352 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
1353
acfa068f 13542012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
1355
1356 * fileio.c (Ffile_selinux_context): Only call freecon when
1357 lgetfilecon succeeded.
1358 (Fset_file_selinux_context): Likewise. (Bug#12444)
1359
acfa068f 13602012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
1361
1362 * xdisp.c (try_window_reusing_current_matrix): Under bidi
1363 reordering, locate the cursor by calling set_cursor_from_row; if
1364 that fails, clear the desired glyph matrix before returning a
1365 failure indication to the caller. Fixes leaving garbled display
1366 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
1367 (compute_stop_pos_backwards): Fix a typo that caused crashes while
1368 scrolling through multibyte text.
aa36e4d2 1369
e99f70c8
SM
13702012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
1371
1372 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
1373 calling mark_vectorlike since that's the one that marks the window.
1374 (mark_discard_killed_buffers): Mark the final cdr.
1375 * window.h (struct window): Move prev/next_buffers to the
1376 non-standard fields.
1377 * window.c (make_window): Initialize prev/next_buffers manually.
1378
f75beb47
PE
13792012-09-20 Paul Eggert <eggert@cs.ucla.edu>
1380
1381 Omit unused arg EXPECTED from socket hooks.
1382 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1383 * nsterm.m (ns_term_init):
1384 * termhooks.h (struct terminal.read_socket_hook):
1385 * w32inevt.c (w32_console_read_socket):
1386 * w32term.c (w32_read_socket):
1387 * xterm.c (XTread_socket):
1388 Omit unused arg EXPECTED. All callers changed.
1389 (store_user_signal_events): Return void, not int, since callers no
1390 longer care about the return value. All uses changed.
1391
b019b76a
JB
13922012-09-20 Juanma Barranquero <lekktu@gmail.com>
1393
1394 * w32gui.h (XParseGeometry): Do not declare.
1395
05642592
PE
13962012-09-19 Paul Eggert <eggert@cs.ucla.edu>
1397
e4bce92a
PE
1398 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1399 Ignore 'expected'. See Eli Zaretskii in
1400 <http://bugs.gnu.org/12471#8> (last line).
1401
05642592
PE
1402 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
1403 (XParseGeometry): Now static. Substitute extremal values for
1404 values that are out of range.
1405
e543ae91
JD
14062012-09-19 Jan Djärv <jan.h.d@swipnet.se>
1407
1408 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1409
1410 * nsfns.m (XParseGeometry): Remove.
1411 (Fx_create_frame): Call x_set_offset to correctly interpret
1412 top_pos in geometry.
1413
3a880af4 1414 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
1415 (Fx_parse_geometry): If there is a space in string, call
1416 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1417
45ba16c7
EZ
14182012-09-17 Eli Zaretskii <eliz@gnu.org>
1419
c8b9f1bc
EZ
1420 * search.c (scan_buffer): Use character positions in calls to
1421 region_cache_forward and region_cache_backward, not byte
1422 positions. (Bug#12196)
1423
b4c932a2
EZ
1424 * w32term.c (w32_read_socket): Set pending_signals to 1, like
1425 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
1426
45ba16c7
EZ
1427 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1428 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1429 emacs_blocked_malloc, now deleted.
1430
eeceac93
PE
14312012-09-17 Paul Eggert <eggert@cs.ucla.edu>
1432
1433 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1434 The workaround was for improving performance on Solaris 2.4, but
1435 is getting in the way now. Emacs will still work if someone is
1436 still running Solaris 2.4 in a museum somewhere; Sun dropped
1437 support for Solaris 2.4 in 2003.
1438 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1439 * process.c (create_process) [HAVE_WORKING_VFORK]:
1440 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1441 since Emacs no longer uses vfork on that platform.
1442
78f83752
GM
14432012-09-17 Glenn Morris <rgm@gnu.org>
1444
1445 * emacs.c: Use COPYRIGHT.
1446
634b8cac
PE
14472012-09-16 Paul Eggert <eggert@cs.ucla.edu>
1448
0caaedb1
PE
1449 Remove configure's --without-sync-input option (Bug#12450).
1450 When auditing signal-handling in preparation for cleaning it up,
1451 I found that SYNC_INPUT has race conditions and would be a real
1452 pain to fix. Since it's an undocumented and deprecated
1453 configure-time option, now seems like a good time to remove it.
1454 Also see <http://bugs.gnu.org/11080#16>.
1455 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1456 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1457 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1458 (malloc_hysteresis):
1459 (check_depth) [XMALLOC_OVERRUN_CHECK]:
1460 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1461 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1462 (dont_register_blocks, bytes_used_when_reconsidered)
1463 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1464 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1465 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1466 Remove. All uses removed.
1467 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1468 implementation, one that depends on whether the new macro
1469 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1470 is defined.
1471 * atimer.c (run_timers, handle_alarm_signal):
1472 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1473 (handle_async_input, process_pending_signals)
1474 (handle_input_available_signal, init_keyboard):
1475 * nsterm.m (ns_read_socket):
1476 * process.c (wait_reading_process_output):
1477 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1478 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1479 (emacs_write):
1480 * xterm.c (XTread_socket):
1481 Assume SYNC_INPUT.
1482 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1483 * eval.c (handling_signal): Remove. All uses removed.
1484 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1485 All uses replaced with the SYNC_INPUT version.
1486 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1487 Remove decls.
1488 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1489 Now static.
1490
634b8cac
PE
1491 * font.c (Ffont_shape_gstring): Remove unused local.
1492
83da1b55
GM
14932012-09-16 Glenn Morris <rgm@gnu.org>
1494
518650a5
GM
1495 * Makefile.in (clean): No longer run nextstep's clean.
1496
83da1b55
GM
1497 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1498 (ns_frag): Remove.
1499 (ns-app): Move here from ns.mk, and simplify.
1500 (clean): Simplify nextstep entry.
1501 * ns.mk: Remove file.
1502
85a43e2e
KH
15032012-09-17 Kenichi Handa <handa@gnu.org>
1504
1505 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1506 not covert the last few charactes.
1507
ba13e616 15082012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
1509
1510 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1511 here, but just check the validity of glyphs in the glyph-string.
1512
a8c729af
MR
15132012-09-16 Martin Rudalics <rudalics@gmx.at>
1514
3a880af4
SM
1515 * window.c (Fwindow_parameter, Fset_window_parameter):
1516 Accept any window as argument (Bug#12452).
a8c729af 1517
c077c059
JD
15182012-09-16 Jan Djärv <jan.h.d@swipnet.se>
1519
1520 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1521 to ns_term_init to avoid memory leak.
1522
1523 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
1524 explicit retain/release.
1525 (ns_term_init): Only allow one display. Initialize outerpool and
1526 ns_*_types.
1527
39a57ad0
PE
15282012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1529
1530 Port _setjmp fix to POSIXish hosts as well as Microsoft.
1531 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
1532 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
1533 the Microsoft problem in a different way, by altering ../nt/config.nt.
1534
7105c8cb
EZ
15352012-09-15 Eli Zaretskii <eliz@gnu.org>
1536
1537 * w32xfns.c:
1538 * w32uniscribe.c:
1539 * w32term.c:
1540 * w32select.c:
1541 * w32reg.c:
1542 * w32proc.c:
1543 * w32menu.c:
1544 * w32inevt.c:
1545 * w32heap.c:
1546 * w32font.c:
1547 * w32fns.c:
1548 * w32console.c:
1549 * w32.c:
1550 * w16select.c: Remove inclusion of setjmp.h, as it is now included
1551 by lisp.h. This completes removal of setjmp.h inclusion
1552 erroneously announced in the previous commit. (Bug#12446)
1553
1554 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
1555 more accurate.
1556
1557 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
1558 not defined as a macro. The latter happens on MS-Windows.
1559 (Bug#12446)
1560
0328b6de
PE
15612012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1562
1563 Port better to POSIX hosts lacking _setjmp (Bug#12446).
1564 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 1565 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
1566 only reason for the instance was because "lisp.h" was included.
1567 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
1568 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
1569 and _longjmp with the new symbols. Emacs already uses _setjmp if
1570 available, so this change affects only POSIXish hosts that have
1571 sigsetjmp but not _setjmp, such as some versions of Solaris and
1572 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
1573 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
1574 (png_load_body) [HAVE_PNG]:
1575 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
1576 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
1577 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
1578 since PNG requires jmp_buf. This is the only exception to the
1579 general rule that we now use sys_setjmp and sys_longjmp.
1580 This exception is OK since this code does not change the signal
1581 mask or longjmp out of a signal handler.
1582
2af03429
PE
15832012-09-14 Paul Eggert <eggert@cs.ucla.edu>
1584
1585 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1586 Include "syssignal.h", for 'main_thread'.
1587
2f294edf
DA
15882012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
1589
1590 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
1591 * insdel.c (replace_range, replace_range_2):
1592 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
1593 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1594 Remove redundant check before calling offset_intervals.
1595
6b533e9c
MR
15962012-09-14 Martin Rudalics <rudalics@gmx.at>
1597
1598 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1599 current buffer (Bug#12387).
1600
2a7931e3
JB
16012012-09-14 Juanma Barranquero <lekktu@gmail.com>
1602
1603 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1604
c18e885b
PE
16052012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1606
1607 Use a more backwards-compatible timer format (Bug#12430).
1608 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1609 vector element, not from the 4th, since PSECS is now at the end.
1610 (Fcurrent_idle_time): Doc fix.
1611
d59a1afb
DA
16122012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
1613
1614 Function to mark objects and remove killed buffers at once.
1615 * alloc.c (discard_killed_buffers): Rename to ...
1616 (mark_discard_killed buffers) ... new name. Add marking
1617 of remaining objects. Fix comment. Adjust users.
1618 (mark_object): Do not touch frame buffer lists here.
1619 * frame.c (delete_frame): Reset frame buffer lists here.
1620
5f0cb45a
PE
16212012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1622
8ea47e3a
PE
1623 Better workaround for GNOME bug when --enable-gcc-warnings.
1624 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1625 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
1626 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1627
4a4bbad2
PE
1628 Simplify SIGIO usage (Bug#12408).
1629 The code that dealt with SIGIO was crufty and confusing, e.g., it
1630 played tricks like "#undef SIGIO" but these tricks were not used
1631 consistently. Simplify mostly by not #undeffing standard symbols,
1632 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1633 or not as we please) rather than "defined SIGIO" (standard symbol
1634 that we probably shouldn't #undef).
1635 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1636 Modules that need it can include it.
1637 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1638 * dispextern.h (ignore_sigio): New decl.
1639 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1640 unconditionally, since it's now a no-op if !USABLE_SIGIO.
1641 * emacs.c (shut_down_emacs):
1642 * keyboard.c (kbd_buffer_store_event_hold):
1643 Use ignore_sigio rather than invoking 'signal' directly.
1644 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1645 for FIONREAD.
1646 (FIONREAD, SIGIO): Do not #undef.
1647 (tty_read_avail_input): Use #error rather than a syntax error.
1648 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1649 for I_PIPE, used by SETUP_SLAVE_PTY.
1650 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1651 * sysdep.c (croak): Remove; no longer needed. This bit of
1652 temporary code, with Fred N. Fish's comment that it's temporary,
1653 has been in Emacs since at least 1992!
1654 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1655 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1656 * syssignal.h (croak): Remove decl.
1657 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1658 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1659 now that we're termios-only.
1660 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1661 * term.c (dissociate_if_controlling_tty): Use #error rather than
1662 a run-time error.
1663
5f0cb45a
PE
1664 Work around GCC and GNOME bugs when --enable-gcc-warnings.
1665 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1666 to work around GNOME bug 683906.
1667 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1668 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1669 This works around GCC bug 54561.
1670
40bce90b
PE
16712012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1672
1673 More fixes for 'volatile' and setjmp/longjmp.
1674 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1675 * image.c (struct png_load_context) [HAVE_PNG]: New type.
1676 (png_load_body) [HAVE_PNG]:
1677 (jpeg_load_body) [HAVE_JPEG]:
1678 New function, with most of the old parent function's body.
1679 (png_load) [HAVE_PNG]:
1680 (jpeg_load) [HAVE_JPEG]:
1681 Invoke the new function, to avoid longjmp munging our locals.
1682 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
1683 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
1684 longjmp is passed 2, as the C standard doesn't guarantee this.
1685 Instead, store the failure code into mgr->failure_code.
1686
bfeae2cf
SM
16872012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1688
1689 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
1690 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
1691 (syms_of_keyboard): Remove support for unread-command-char.
1692
8099e36b
EZ
16932012-09-12 Eli Zaretskii <eliz@gnu.org>
1694
1695 * w32proc.c (sys_kill): If PID is our process ID and the signal is
1696 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
1697 violation. (Bug#12426)
1698
92547ff9
PE
16992012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1700
1701 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
1702
45b82ad0
SM
17032012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1704
1705 * eval.c: Add `inhibit-debugger'.
1706 (Qinhibit_debugger): New symbol.
1707 (call_debugger): Bind it instead of Qdebug_on_error.
1708 (maybe_call_debugger): Test Vinhibit_debugger.
1709 (syms_of_eval): Define inhibit-debugger.
1710 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1711 (syms_of_xdisp): Remove inhibit-debug-on-message.
1712
5779a1dc
PE
17132012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1714
50f2e553
PE
1715 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1716 If a nonvolatile local variable is written before a _longjmp to
1717 the frame containing the variable, and is read after the _longjmp,
1718 the value read is indeterminate. Some local variables of type
1719 'struct handler' and 'struct catchtag' are used in this way, so
1720 mark each of their slots as volatile if the slot can be set before
1721 _longjmp and read afterwards.
1722 * lisp.h (struct handler): var and chosen_clause are now volatile.
1723 (struct catchtag): val, next, and pdlcount are now volatile.
1724
ae1d87e2
PE
1725 * bidi.c (bidi_push_it, bidi_pop_it):
1726 * fns.c (copy_hash_table):
1727 * image.c (define_image_type):
1728 * keyboard.c (kbd_buffer_store_event_hold):
1729 * process.c (Fprocess_send_eof):
1730 * xfaces.c (x_create_gc) [HAVE_NS]:
1731 * xgselect.c (xg_select):
1732 Prefer assignment to memcpy when either will do.
1733
5779a1dc
PE
1734 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1735 Use pointer-to-a-pointer to simplify and avoid a NILP check each
1736 time an item is removed. No need to mark this function 'inline';
1737 the compiler knows better than we do.
1738
c4c9756b
JD
17392012-09-11 Jan Djärv <jan.h.d@swipnet.se>
1740
1741 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1742 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1743 to change_frame_size (Bug#12388).
1744 (windowDidResize:): Pass YES to updateFrameSize.
1745
1746 * nsterm.h: Add delay parameter to updateFrameSize.
1747
d73e321c
DA
17482012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1749
1750 Discard killed buffers from deleted window and frame objects.
1751 This reduces an amount of references to killed buffers and
1752 helps GC to reclaim them faster.
1753 * alloc.c (discard_killed_buffers): New function.
1754 (mark_object): Use it for deleted windows and frames.
1755 (mark_object): If symbol's value is set up for a killed buffer
1756 or deleted frame, restore it's global binding.
1757 * data.c (swap_in_global_binding): Add GC notice.
1758 (swap_in_symval_forwarding): Use convenient set_blv_where.
1759 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1760 * window.h: ... to here.
1761
e578f381
DA
17622012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1763
1764 Convenient macro to check whether the buffer is live.
1765 * buffer.h (BUFFER_LIVE_P): New macro.
1766 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1767 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1768
3057e615
YM
17692012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1770
1771 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1772 composition cases (Bug#12364).
1773
1774 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1775 overhang of succeeding glyphs overlapping box cursor.
1776
1777 * w32term.c (x_draw_glyph_string): Likewise.
1778
6fda35f2
PE
17792012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1780
c990426a
PE
1781 Simplify, document, and port floating-point (Bug#12381).
1782 The porting part of this patch fixes bugs on non-IEEE platforms
1783 with frexp, ldexp, logb.
1784 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1785 Now static.
1786 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1787 support, by removing commented-out code and briefly listing the
1788 C89 functions excluded. The commented-out stuff was confusing
1789 maintenance, e.g., we thought we needed cbrt but it was commented out.
1790 (logb): Remove decl; no longer needed.
1791 (isfinite): New macro, if not already supplied.
1792 (isnan): Don't replace any existing macro.
1793 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1794 are present on all C89 platforms.
1795 (Ffrexp): Do not special-case zero, as frexp does the right thing
1796 for that case.
1797 (Flogb): Do not use logb, as it doesn't have the desired meaning
1798 on hosts that use non-base-2 floating point. Instead, stick with
1799 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1800 frexp, to avoid getting an unspecified result.
1801
6fda35f2
PE
1802 * xdisp.c (Qinhibit_debug_on_message): Now static.
1803
16130a58
JD
18042012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1805
1806 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1807 NSBezierPath (Bug#12131).
1808
d105a573
CY
18092012-09-10 Chong Yidong <cyd@gnu.org>
1810
1811 * fns.c (Fdelq, Fdelete): Doc fix.
1812
ff55dfe8
PE
18132012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1814
1815 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1816 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1817
e7032e7c
SM
18182012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1819
1820 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1821 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1822 Use it.
1823
e9957956
EZ
18242012-09-09 Eli Zaretskii <eliz@gnu.org>
1825
aba05ce9
EZ
1826 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1827 left fringe if the window has a left margin. This avoids leaving
1828 traces of the cursor because its leftmost pixel is not drawn over.
1829
e9957956
EZ
1830 * dispnew.c (update_window_line): When the left margin area of a
1831 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1832 that screen line. (Bug#12277)
1833
f6196b87
PE
18342012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1835
1836 Assume C89 or later for math functions (Bug#12381).
1837 This simplifies the code, and makes it a bit smaller and faster,
1838 and (most important) makes it easier to clean up signal handling
1839 since we can stop worring about floating-point exceptions in
1840 library code. That was a problem before C89, but the problem
1841 went away many years ago on all practical Emacs targets.
1842 * data.c, image.c, lread.c, print.c:
1843 Don't include <math.h>; no longer needed.
1844 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1845 might be autoconfigured, as that never happens.
1846 * data.c (fmod):
1847 * doprnt.c (DBL_MAX_10_EXP):
1848 * print.c (DBL_DIG):
1849 Remove. C89 or later always defines these.
1850 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1851 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1852 (arith_error, domain_error, domain_error2):
1853 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1854 no longer needed -- we simply return what C returns. All uses removed.
1855 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1856 the wrapped code.
1857 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1858 Remove. All uses expanded, as these macros are no longer used
1859 more than once and are now more trouble than they're worth.
1860 (Ftan): Use tan, not sin / cos.
1861 (Flogb): Assume C89 frexp.
1862 (fmod_float): Assume C89 fmod.
1863 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1864 (init_floatfns): Remove. All uses removed.
1865
9d7f1863
JD
18662012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1867
1868 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1869 compositeToPoint for OSX < 10.6 (Bug#12390).
1870
eabf0404
PE
18712012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1872
1873 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1874 This produces more-accurate results.
1875
0b3b1d23
JD
18762012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1877
1878 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1879 changes (Bug#12088).
1880
6dcef6ec
CY
18812012-09-08 Chong Yidong <cyd@gnu.org>
1882
1883 * syntax.c (Fstring_to_syntax): Doc fix.
1884
aa7d57c5
JD
18852012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1886
1887 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1888 in the internal border.
1889 (x_set_window_size): Remove static variables and their usage.
1890 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
1891 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1892 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
1893 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1894 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1895 (ns_fix_rect_ibw): Remove.
1896 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1897 (ns_dumpglyphs_box_or_relief): Ditto.
1898 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1899 adjustment.
1900 (ns_dumpglyphs_image): Ditto.
fc0c31f8 1901 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
1902 border adjustment.
1903 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1904 their usage. Add fringe_extended_p and its use as in other terms.
1905 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1906 scroll bar was removed.
1907 (updateFrameSize): New function.
1908 (windowDidResize): Move code to updateFrameSize and call it.
1909
1910 * nsterm.h (EmacsView): Add updateFrameSize.
1911
1a5432bc
CY
19122012-09-07 Chong Yidong <cyd@gnu.org>
1913
b4f5313e
CY
1914 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1915
1a5432bc
CY
1916 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1917
1a4f1e9b
PE
19182012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1919
1920 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
1921 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1922 Problem introduced when merging patches. Noted by Eli Zaretskii in
1923 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
1924 * floatfns.c: Comment fix.
1925 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1926 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1927 and anyway the declaration is harmless even if SIGDANGER is not defined.
1928 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1929 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1930 source files not surprisingly expected syssignal.h to define, or
1931 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1932 Include <sys/ioctl.h>, for FIONREAD.
1933 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1934 This eliminates a problem whereby other files mysteriously had
1935 to include "syssignal.h" before including "systty.h" if they
1936 wanted to use "#ifdef SIGIO".
1937
bc8000ff
EZ
19382012-09-07 Eli Zaretskii <eliz@gnu.org>
1939
3e6d6928
EZ
1940 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1941
1942 * w32.c (sigemptyset): Empty the set.
1943 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1944
bc8000ff
EZ
1945 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1946
b4fa72f2
DA
19472012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1948
1949 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1950 (mark_object): Likewise for frame objects.
1951
30730c93
PE
19522012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1953
1954 * syssignal.h (handle_on_main_thread): Always declare,
1955 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1956 This ports to platforms without HAVE_PTHREAD.
1957
2fe28299
PE
19582012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1959
1960 Signal-handler cleanup (Bug#12327).
1961 Emacs's signal handlers were written in the old 4.2BSD style with
1962 sigblock and sigmask and so forth, and this led to some
1963 inefficiencies and confusion. Rewrite these to use
1964 pthread_sigmask etc. without copying signal sets around. Also,
1965 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1966 'signal', and instead use functions that do not attempt to take
1967 over the system name space. This patch causes Emacs's text
1968 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1969 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1970 Do not include <signal.h> or "syssignal.h", as these
1971 modules do not use signals.
1972 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1973 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1974 Do not include <signal.h>, as "syssignal.h" does that for us now.
1975 * atimer.c (sigmask_atimers): New function.
1976 (block_atimers, unblock_atimers): New functions,
1977 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1978 All uses replaced.
1979 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1980 no longer needed here.
1981 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 1982 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
1983 * sysdep.c (struct save_signal): New member 'action', replacing
1984 old member 'handler'.
1985 (save_signal_handlers, restore_signal_handlers):
1986 Use sigaction instead of 'signal' to save and restore.
1987 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1988 New function. All users of 'signal' modified to use set_sighandler
1989 if they're writeonly, and to use sys_signal if they're read+write.
1990 (emacs_sigaction_init, forwarded_signal): New functions.
1991 (sys_signal): Remove. All uses replaced by calls to sigaction
1992 and emacs_sigaction_init, or by direct calls to 'signal'.
1993 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1994 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1995 all uses replaced by pthread_sigmask etc. calls.
1996 * syssignal.h: Include <signal.h>.
1997 (emacs_sigaction_init, forwarded_signal): New decls.
1998 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1999 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2000 (sigmask, sys_sigmask): Remove; no longer needed.
2001 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2002 (sigblock, sigunblock, sigfree):
2003 (sigsetmask) [!defined sigsetmask]:
2004 Remove. All uses replaced by pthread_sigmask.
2005 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2006 no longer need to be replaced, and its typical old uses
2007 are now done via emacs_sigaction_init and sigaction.
2008 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2009 (sys_sigdel): Remove; unused.
2010 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2011
0216c128
EZ
20122012-09-06 Eli Zaretskii <eliz@gnu.org>
2013
2014 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2015 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2016
c752cfa9
DA
20172012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2018
2019 Explicitly mark buffer_defaults and buffer_local_symbols.
2020 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2021 mark_local_symbols here.
2022 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2023 since special buffers aren't marked here any more.
2024 (allocate_buffer): Chain new buffer with all_buffers here...
2025 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2026 not here.
2027 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2028 (syms_of_buffer): Remove staticpro of the above.
2029 (init_buffer_once): Set names for buffer_defaults and
2030 buffer_local_symbols.
2031
a864ef14
PE
20322012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2033
2034 Use bool for booleans in font-related modules.
2035 * font.c (font_intern_prop, font_style_to_value)
2036 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2037 (generate_otf_features, font_check_otf_features, font_check_otf)
2038 (font_match_p, font_list_entities, font_at):
2039 * fontset.c (fontset_id_valid_p, reorder_font_vector
2040 (fontset_find_font, Fset_fontset_font)
2041 (face_suitable_for_char_p) [0]:
2042 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2043 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2044 (m17n_flt_initialized, ftfont_shape_by_flt):
2045 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2046 * nsfont.m (nsfont_draw):
2047 * w32font.c (w32font_draw):
2048 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2049 Use bool for booleans.
2050 * font.h: Adjust to above API changes.
2051 (struct font, struct font_driver, struct font_driver_list):
2052 Use bool for booleans.
2053 (struct font): Remove useless member encoding_type.
2054 All users removed.
2055 * fontset.c, xftfont.c: Omit unnecessary static decls.
2056
0699fc18
DA
20572012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2058
2059 * alloc.c (mark_object): Revert window marking code
2060 since it's unsafe for the Fset_window_configuration.
2061
20ef56db
PE
20622012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2063
2fe28299 2064 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
2065 Be more systematic about preserving errno whenever a signal
2066 handler returns, even if it's not in the main thread. Do this by
2067 renaming signal handlers to distinguish between signal delivery
2068 and signal handling. All uses changed.
2069 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2070 * data.c (deliver_arith_signal): Rename from arith_error.
2071 * dispnew.c (deliver_window_change_signal): Rename from
2072 window_change_signal.
2073 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2074 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2075 * keyboard.c (deliver_input_available_signal): Rename from
2076 input_available_signal.
2077 (deliver_user_signal): Rename from handle_user_signal.
2078 (deliver_interrupt_signal): Rename from interrupt_signal.
2079 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2080 (deliver_child_signal): Rename from sigchld_handler.
2081 * atimer.c (handle_alarm_signal):
2082 * data.c (handle_arith_signal):
2083 * dispnew.c (handle_window_change_signal):
2084 * emacs.c (handle_fatal_signal, handle_danger_signal):
2085 * keyboard.c (handle_input_available_signal):
2086 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2087 * process.c (handle_pipe_signal, handle_child_signal):
2088 New functions, with the actual signal-handling code taken from the
2089 original respective signal handlers, sans the sporadic attempts to
2090 preserve errno, since that's now done by handle_on_main_thread.
2091 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2092 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2093 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2094 Move to sysdep.c.
2095 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2096 Move initialization of main_thread to sysdep.c's init_signals.
2097 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2098 our usage, and simplifies the mainline code.
2099 (record_child_status_change): New static function, as a helper
2100 for handle_child_signal, and with most of the old child handler's
2101 contents.
2102 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2103 (handle_child_signal): Use the above.
2104 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2105 Moved here from emacs.c.
2106 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2107 code moved here from emacs.c's main function.
2108 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
2109 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2110 This lets callers save and restore errno properly.
20ef56db 2111
e3ccf108
DA
21122012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2113
2114 Remove redundant or unused things here and there.
2115 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2116 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2117 * editfns.c (Fcompare_buffer_substrings): Likewise.
2118 * frame.h (struct terminal, struct font_driver_list):
2119 Remove redundant declarations.
2120 * window.h (Qleft, Qright): Likewise.
2121
697e1e39
DA
21222012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2123
2124 Do not mark objects from deleted buffers, windows and frames.
2125 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2126 (mark_object): Likewise for windows and frames.
2127
c1ca42ca
DA
21282012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2129
2130 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2131 buffer_defaults and buffer_local_symbols as valid objects.
2132 Return special value to denote them.
2133
014d93be
PE
21342012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2135
f75d7a91
PE
2136 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2137 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2138 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2139 (file_name_absolute_p, Fsubstitute_in_file_name):
2140 (check_executable, check_writable, Ffile_accessible_directory_p)
2141 (Fset_file_selinux_context, Fdefault_file_modes)
2142 (Finsert_file_contents, choose_write_coding_system)
2143 (Fwrite_region, build_annotations, a_write, e_write)
2144 (Fdo_auto_save):
2145 * filelock.c (boot_time_initialized, get_boot_time)
2146 (get_boot_time_1, lock_file_1, within_one_second):
2147 * floatfns.c (in_float):
2148 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2149 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2150 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2151 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2152 * window.c (compare_window_configurations):
2153 Use bool for booleans.
2154 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2155 (Fdefault_file_modes): Now mode_t, not int, for modes.
2156 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2157 (internal_delete_file): Now returns void, not a (boolean) int,
2158 since nobody was looking at the return value.
2159 * lisp.h, window.h: Adjust to above API changes.
2160
014d93be
PE
2161 * xdisp.c (set_message): Simplify and reindent last change.
2162
776f29e1
JB
21632012-09-05 Juanma Barranquero <lekktu@gmail.com>
2164
2165 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2166
7f7e0167
LI
21672012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2168
2169 * eval.c (call_debugger): Make the function non-static so that we
2170 can call it from set_message.
2171
2172 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2173 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2174
cf29dd84
PE
21752012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2176
2177 Give more-useful info on a fatal error (Bug#12328).
2178 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2179 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2180 of doing the work ourselves.
2181 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
2182 do most of the work.
2183 (fatal_error_backtrace): New function, taken from the guts
2184 of the old fatal_error_signal, but with a new option to output
2185 a backtrace.
2186 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
2187 info about the signal than just its number.
2188 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
2189 * sysdep.c: Include <execinfo.h>
2190 (emacs_backtrace): New function, taken partly from the previous
2191 code of the 'die' function.
2192 (emacs_abort): Call fatal_error_backtrace rather than abort.
2193
972debf2
SM
21942012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2195
2196 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
2197 eager (load-time) macro-expansion.
2198 * lisp.mk (lisp): Add macroexp.
2199
1088b922
PE
22002012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2201
2202 Simplify redefinition of 'abort' (Bug#12316).
2203 Do not try to redefine the 'abort' function. Instead, redo
2204 the code so that it calls 'emacs_abort' rather than 'abort'.
2205 This removes the need for the NO_ABORT configure-time macro
2206 and makes it easier to change the abort code to do a backtrace.
2207 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
2208 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
2209 Remove; sysdep.c's emacs_abort now takes its place.
2210 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
2211 'abort' changed to use 'emacs_abort'.
2212 * msdos.c (dos_abort) [defined abort]: Remove; not used.
2213 (abort) [!defined abort]: Rename to ...
2214 (emacs_abort): ... new name.
2215 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
2216 the place of the old 'abort' in emacs.c.
2217 * w32.c, w32fns.c (abort): Do not #undef.
2218 * w32.c (emacs_abort): Rename from w32_abort.
2219
30934d33
EZ
22202012-09-04 Eli Zaretskii <eliz@gnu.org>
2221
2222 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
2223 offsets[j].dv, since the y axis of the screen coordinates points
2224 down, while the y axis of the font definition coordinates points
2225 up. This fixes display of Arabic diacritics such as KASRA and
2226 KASRATAN. (Bug#11860)
2227
af26b72c
PE
22282012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2229
2230 Be more systematic about _setjmp vs setjmp.
2231 * alloc.c (test_setjmp, mark_stack):
2232 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
2233 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
2234 (png_load, my_error_exit, jpeg_load):
2235 * process.c (send_process_trap, send_process):
2236 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
2237 The underscored versions are up to 30x faster on some hosts.
2238 Formerly, the code used setjmp+longjmp sometimes and
2239 _setjmp+_longjmp at other times, with no particular reason to
2240 prefer setjmp+longjmp.
2241
26d4541d
PE
22422012-09-03 Paul Eggert <eggert@cs.ucla.edu>
2243
d42f4f0f 2244 Fix minor problem found by static checking.
26d4541d 2245 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 2246
c5e28e39
MR
22472012-09-03 Martin Rudalics <rudalics@gmx.at>
2248
2249 * buffer.c (Fdelete_all_overlays): New function.
2250
3eab3ca9
CY
22512012-09-03 Chong Yidong <cyd@gnu.org>
2252
2253 * gtkutil.c: Add extern decl for Qxft.
2254
c04889f8
PE
22552012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2256
1882aa38
PE
2257 * emacs.c, eval.c: Use bool for boolean.
2258 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
2259 (malloc_using_checking) [DOUG_LEA_MALLOC]:
2260 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
2261 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
2262 (main, decode_env_path, Fdaemon_initialized):
2263 * eval.c (call_debugger, Finteractive_p, interactive_p):
2264 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
2265 (maybe_call_debugger, Fbacktrace):
2266 * process.c (read_process_output, exec_sentinel):
2267 Use bool for booleans.
2268 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
2269 All callers changed.
2270 * eval.c (interactive_p): Omit always-true boolean argument
2271 EXCLUDE_SUBRS_P. All callers changed.
2272 * dispextern.h, lisp.h: Reflect above API changes.
2273 * firstfile.c (dummy): Use the address of 'main', whose signature
2274 won't change, instead of the address of 'initialize', whose
2275 signature just changed from int to bool.
2276 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
2277 * msdos.c (fatal_error_in_progress): ... from here.
2278 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
2279 of incrementing it.
2280 (redisplay_internal, unwind_redisplay): Simply clear
2281 REDISPLAYING_P when unwinding, instead of saving its previous,
2282 always-false value and then restoring it.
2283
a411ac43
PE
2284 Clean up some extern decls.
2285 Mostly, this hoists extern decls out of .c files and into .h files.
2286 That way, we're more likely to catch errors if the interfaces change.
2287 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
2288 declare xg_mark_data.
2289 * dispextern.h (x_frame_parm_handlers):
2290 * font.h (Qxft):
2291 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
2292 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
2293 (Qultra_bold, Qoblique, Qitalic):
2294 Move extern decl here from .c file.
2295 * alloc.c (xg_mark_data) [USE_GTK]:
2296 * doc.c (Qclosure):
2297 * eval.c (Qlexical_binding):
2298 * fns.c (time) [!HAVE_UNISTD_H]:
2299 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
2300 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
2301 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
2302 * lread.c (Qinternal_interpreter_environment):
2303 * minibuf.c (Qbuffer):
2304 * process.c (QCfamily, QCfilter):
2305 * widget.c (free_frame_faces):
2306 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
2307 * xfont.c (x_clear_errors):
2308 * xterm.c (x_frame_parm_handlers):
2309 Remove now-redundant extern decls.
2310 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
2311 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
2312 Now static.
2313 * xfaces.c: Remove unnecessary static decls.
2314 * xterm.c (updating_frame): Remove decl of nonexistent object.
2315
c04889f8
PE
2316 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
2317 when building globals.h, as the objects that are not built on
2318 this host are not needed to compile C files on this host.
2319
8b339673
JD
23202012-09-02 Jan Djärv <jan.h.d@swipnet.se>
2321
2322 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
2323
2324 * frame.h: Add missing prototype for x_wm_set_size_hint.
2325
a08d4ba7
PE
23262012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2327
2328 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
2329 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
2330 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
2331 (Fsubstitute_command_keys):
2332 * editfns.c (region_limit, find_field, Fconstrain_to_field)
2333 (save_excursion_save, save_excursion_restore)
2334 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
2335 (format_time_string, general_insert_function)
2336 (make_buffer_string, make_buffer_string_both)
2337 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
2338 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
2339 (copy_text, insert_1, insert_1_both, insert_from_string)
2340 (insert_from_string_before_markers, insert_from_string_1)
2341 (insert_from_buffer, insert_from_buffer_1, replace_range)
2342 (replace_range_2, del_range_1, del_range_byte, del_range_both)
2343 (del_range_2, modify_region):
2344 * intervals.c (intervals_equal, balance_possible_root_interval)
2345 (adjust_intervals_for_insertion, merge_properties_sticky)
2346 (graft_intervals_into_buffer, lookup_char_property)
2347 (adjust_for_invis_intang, set_point_both)
2348 (get_property_and_range, compare_string_intervals)
2349 (set_intervals_multibyte_1, set_intervals_multibyte):
2350 * keyboard.c (decode_timer):
2351 Use bool for boolean.
2352 * intervals.h, lisp.h, systime.h: Reflect above API changes.
2353 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
2354
48c948de
CY
23552012-09-02 Chong Yidong <cyd@gnu.org>
2356
2357 * keymap.c (push_key_description): Print M-TAB as C-M-i
2358 (Bug#11758).
2359
6c49a40b
JB
23602012-09-02 Juanma Barranquero <lekktu@gmail.com>
2361
2362 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
2363 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
2364 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
2365 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
2366 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
2367 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
2368 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2369
4dfbd238
EZ
23702012-09-01 Eli Zaretskii <eliz@gnu.org>
2371
7e510e28
EZ
2372 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
2373 more than one grapheme cluster passed to the shaper: compute the
2374 offset adjustment values separately for each cluster. (Bug#11860)
2375
4dfbd238
EZ
2376 * image.c: Restore mistakenly removed inclusion of w32.h. Without
2377 it, GCC doesn't see prototypes of w32_delayed_load, and complains
2378 about implicit conversions from integer to pointer.
2379
86571ae0
DC
23802012-09-01 Daniel Colascione <dancol@dancol.org>
2381
2382 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2383 system used too early.
2384
0e23ef9d
PE
23852012-09-01 Paul Eggert <eggert@cs.ucla.edu>
2386
2387 Better seed support for (random).
2388 * emacs.c (main): Call init_random.
2389 * fns.c (Frandom): Set the seed from a string argument, if given.
2390 Remove long-obsolete Gentzel cruft.
2391 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
2392 (init_random): New function.
2393
17a2cbbd
DC
23942012-09-01 Daniel Colascione <dancol@dancol.org>
2395
2396 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
2397 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
2398 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
2399 x_wm_set_size_hint, x_query_colors, x_real_positions,
2400 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
2401 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
2402 all of which have been moved to common code.
2403
2404 * xfaces.c: Include TERM_HEADER instead of listing all possible
2405 window-system headers.
2406
2407 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2408 to match header.
2409
2410 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2411 directly accessing frame internals.
2412
f18cbb28 2413 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
2414 globals_of_w32font.
2415
2416 * process.c: Include TERM_HEADER instead of listing all possible
2417 window-system headers.
2418
3a880af4
SM
2419 * nsterm.h: Remove declarations now in frame.h.
2420 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
2421
2422 * menu.c: Include TERM_HEADER instead of listing all possible
2423 window-system headers.
2424
2425 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2426 window system.
2427
2428 * keyboard.c: Include TERM_HEADER instead of listing all possible
2429 window-system headers.
2430
2431 * image.c: Include TERM_HEADER instead of listing all possible
2432 window-system headers. Declare Vlibrary_cache when compiling for
2433 Windows.
2434
2435 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2436 window system declarations.
2437
2438 * frame.h: Move common functions here: set_frame_menubar,
2439 x_set_window_size, x_sync, x_get_focus_frame,
2440 x_set_mouse_position, x_set_mouse_pixel_position,
2441 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
2442 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
2443 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
2444 x_activate_menubar, x_real_positions, x_bitmap_icon,
2445 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
2446 and x_query_colors.
2447
2448 * frame.c: Include TERM_HEADER instead of listing all possible
2449 window-system headers.
2450
2451 * font.c: Include TERM_HEADER instead of listing all possible
2452 window-system headers.
2453
2454 * emacs.c: Include TERM_HEADER.
2455
f18cbb28
EZ
2456 * dispnew.c: Include TERM_HEADER instead of listing all possible
2457 window-system headers.
17a2cbbd 2458
f18cbb28 2459 * ccl.h: Include character.h.
17a2cbbd
DC
2460
2461 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2462 the current window system; include in list of objects to link into
2463 Emacs.
2464
c650a5de
DA
24652012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2466
2467 Remove mark_ttys function and fix tty_display_info initialization.
2468 * lisp.h (mark_ttys): Remove prototype.
2469 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2470 to mark_ttys because all possible values of 'top_frame' slot are
2471 the frames which are reachable from Vframe_list.
2472 * term.c (mark_ttys): Remove.
2473 (init_tty): Safely initialize 'top_frame' slot with Qnil.
2474
4e0f6479
DA
24752012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2476
2477 Change struct frame bitfields from unsigned char to unsigned.
2478 * frame.h (struct frame): Change type of 'display_preempted',
2479 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2480 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2481 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2482 bitfields from unsigned char to unsigned.
2483
8b96a52c
DA
24842012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2485
2486 Remove unused member of struct x_output and struct w32_output.
2487 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2488 * w32term.h (struct w32_output): Likewise.
2489
b4444c8a
JD
24902012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2491
2492 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2493 does not become zero (Bug#12234).
2494
b98521db
PE
24952012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2496
2497 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2498 for GCC 4.7.1 x86-64.
2499
31d02438
GM
25002012-08-30 Glenn Morris <rgm@gnu.org>
2501
2502 * lread.c (init_lread): For out-of-tree builds, only add the
2503 source directory's site-lisp dir to the load-path if it exists,
2504 consistent with in-tree builds. (Bug#12302)
2505
7f8941d8
JD
25062012-08-28 Jan Djärv <jan.h.d@swipnet.se>
2507
2508 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 2509 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
2510 (windowShouldClose:): Set window_closed.
2511 (dealloc): New member, free button_values.
fc0c31f8
JB
2512 (process_dialog:): Make member function. Remove window argument,
2513 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
2514 in button_values.
2515 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 2516 with tag. Remove return self, declare return value as void.
7f8941d8
JD
2517 (addString:row:): Remove return self, declare return value as void.
2518 (addSplit): Remove return self, declare return value as void.
2519 (clicked:): Remove return self, declare return value as void.
fc0c31f8 2520 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
2521 (initFromContents:isQuestion:): Adjust call to process_dialog.
2522 Code formatting change.
2523 (timeout_handler:): Set timer_fired to YES.
2524 (runDialogAt:): Set timer_fired to NO.
2525 Handle click on close button as quit.
2526
2527 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
2528 Add window_closed and button_values. Add void as return value for
2529 add(Button|String|Split). addButton takes int instead of Lisp_Object.
2530 Add process_dialog as new member.
2531
eada0861 25322012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 2533
eada0861
GM
2534 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
2535 is not one of the heaps we manage. (Bug#12242)
2536
25372012-08-28 Glenn Morris <rgm@gnu.org>
2538
2539 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
2540
457294dd
MR
25412012-08-28 Martin Rudalics <rudalics@gmx.at>
2542
2543 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
2544 auto-buffer-name window parameter. Install revision of reverted
2545 fix.
457294dd 2546
4f2daf31
DA
25472012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2548
2549 Do not allow to set major mode for a dead buffer.
2550 * buffer.c (Fset_buffer_major_mode): Signal an error
2551 if the buffer is dead.
2552 (Fother_buffer, other_buffer_safely): Remove redundant
2553 nested declaration.
2554
66322887
DA
25552012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2556
2557 Always use set_buffer_if_live to restore original buffer at unwind.
2558 * buffer.h (record_unwind_current_buffer): New function.
2559 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
2560 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
2561 * undo.c, window.c: Adjust users.
2562 * buffer.c (set_buffer_if_live): Fix comment.
2563
a3d794a1
DA
25642012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2565
2566 Fix usage of set_buffer_internal.
2567 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
2568 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
2569 * coding.c (decode_coding): Omit redundant test.
2570 * fileio.c (decide_coding_unwind): Likewise.
2571 * fns.c (secure_hash): Likewise.
2572 * insdel.c (modify_region): Likewise.
2573 * keyboard.c (command_loop_1): Likewise.
2574 * print.c (PRINTFINISH): Likewise.
2575 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
2576
59ea14cd
PE
25772012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2578
2579 * dispnew.c: Use bool for boolean.
2580 (frame_garbaged, display_completed, delayed_size_change)
2581 (fonts_changed_p, add_window_display_history)
2582 (add_frame_display_history, verify_row_hash)
2583 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
2584 (row_equal_p, realloc_glyph_pool)
2585 (allocate_matrices_for_frame_redisplay)
2586 (showing_window_margins_p)
2587 (adjust_frame_glyphs_for_frame_redisplay)
2588 (build_frame_matrix_from_leaf_window, make_current)
2589 (mirrored_line_dance, mirror_line_dance, update_frame)
2590 (update_window_tree, update_single_window)
2591 (check_current_matrix_flags, update_window, update_text_area)
2592 (update_window_line, set_window_update_flags, scrolling_window)
2593 (update_frame_1, scrolling, buffer_posn_from_coords)
2594 (do_pending_window_change, change_frame_size)
2595 (change_frame_size_1, sit_for):
2596 Use bool for boolean.
2597 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2598 and remove last int (actually boolean) argument, which was always 0.
2599 All callers changed.
2600 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2601 * dispextern.h (struct composition_it): Use bool for boolean.
2602 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2603 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2604 * dired.c (file_name_completion):
2605 Use bool for boolean. (This was missed in an earlier change.)
2606
95072a94
MR
26072012-08-27 Martin Rudalics <rudalics@gmx.at>
2608
2609 * window.c (Fset_window_configuration): Revert first part of
2610 last change.
2611
0f19feff
JD
26122012-08-27 Jan Djärv <jan.h.d@swipnet.se>
2613
2614 * nsterm.h (NSPanel): New class variable dialog_return.
2615
3a880af4
SM
2616 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2617 Initialize dialog_return.
0f19feff
JD
2618 (windowShouldClose:): Use stop instead of stopModalWithCode.
2619 (clicked:): Ditto, and also set dialog_return (Bug#12258).
2620 (timeout_handler:): Use stop instead of abortModal. Send a dummy
2621 event.
2622 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
2623 modal loop returns.
2624
f10fe38f
PE
26252012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2626
de1339b0
PE
2627 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2628 * composite.c (find_composition, composition_gstring_p)
2629 (composition_reseat_it, find_automatic_composition):
2630 * data.c (let_shadows_buffer_binding_p)
2631 (let_shadows_global_binding_p, set_internal, make_blv)
2632 (Fmake_variable_buffer_local, Fmake_local_variable)
2633 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2634 (cons_to_signed, arith_driver):
2635 * dbusbind.c (xd_in_read_queued_messages):
2636 * dired.c (directory_files_internal, file_name_completion):
2637 Use bool for booleans.
2638 * dired.c (file_name_completion):
2639 * process.h (fd_callback):
2640 Omit int (actually boolean) argument. It wasn't being used.
2641 All uses changed.
2642 * composite.h, lisp.h: Reflect above API changes.
2643
f10fe38f
PE
2644 * cmds.c, coding.c: Use bool for booleans.
2645 * cmds.c (move_point, Fself_insert_command):
2646 * coding.h (struct composition status, struct coding_system):
2647 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2648 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2649 (emacs_mule_char, decode_coding_emacs_mule)
2650 (encode_coding_emacs_mule, detect_coding_iso_2022)
2651 (decode_coding_iso_2022, encode_invocation_designation)
2652 (encode_designation_at_bol, encode_coding_iso_2022)
2653 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2654 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2655 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2656 (encode_coding_raw_text, detect_coding_charset)
2657 (decode_coding_charset, encode_coding_charset, detect_eol)
2658 (detect_coding, get_translation_table, produce_chars)
2659 (consume_chars, reused_workbuf_in_use)
2660 (make_conversion_work_buffer, code_conversion_save)
2661 (decode_coding_object, encode_coding_object)
2662 (detect_coding_system, char_encodable_p)
2663 (Funencodable_char_position, code_convert_region)
2664 (code_convert_string, code_convert_string_norecord)
2665 (Fset_coding_system_priority):
2666 * fileio.c (Finsert_file_contents):
2667 Use bool for booleans.
2668 * coding.h, lisp.h: Reflect above API changes.
2669 * coding.c: Remove unnecessary static function decls.
2670 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2671 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2672 not a boolean 'int', since callers never look at the return value.
2673 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2674 * coding.h (decoding_buffer_size, encoding_buffer_size)
2675 (emacs_mule_string_char): Remove unused extern decls.
2676 (struct iso_2022_spec, struct coding_system):
2677 Use 'unsigned int : 1' for boolean fields, since there's more than one.
2678 (struct emacs_mule_spec): Remove unused field 'full_support'.
2679 All initializations removed.
2680 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2681
5474c384
DA
26822012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2683
f10fe38f 2684 Fix spare memory change (Bug#12286).
5474c384
DA
2685 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
2686 (valid_lisp_object_p): Likewise.
2687
c4b6914d
MR
26882012-08-27 Martin Rudalics <rudalics@gmx.at>
2689
2690 * window.c (Fset_window_configuration): Record any window's old
2691 buffer if it's replaced (see Bug#8789). If the new current
2692 buffer doesn't appear in the selected window, go to its old
2693 point (Bug#12208).
2694
35aaa1ea
DA
26952012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2696
2697 Special MEM_TYPE_SPARE to denote reserved memory.
2698 * alloc.c (enum mem_type): New memory type.
2699 (refill_memory_reserve): Use new type for spare memory.
2700 This prevents live_cons_p and live_string_p from incorrect
2701 detection of uninitialized objects from spare memory as live.
2702
6af64513
PE
27032012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2704
8b2e00a3
PE
2705 Spelling fixes.
2706 * Makefile.in (.PHONY): versioclean -> versionclean.
2707
b52d6985
PE
2708 Remove unused external symbols.
2709 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2710 * window.c (Qwindow_valid_p, decode_valid_window):
2711 Now static, not extern.
2712 * data.c (Qinterval): Remove; unused.
2713 (syms_of_data): Do not define 'interval'.
2714 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2715 * window.h (decode_valid_window):
2716 Remove decls.
2717
d5172d4f
PE
2718 * character.c, charset.c, chartab.c: Use bool for booleans.
2719 * character.c (lisp_string_width, string_count_byte8)
2720 (string_escape_byte8):
2721 * charset.c (charset_map_loaded, load_charset_map, read_hex):
2722 (load_charset_map_from_file, map_charset_chars)
2723 (Fdefine_charset_internal, define_charset_internal)
2724 (Fdeclare_equiv_charset, find_charsets_in_text)
2725 (Ffind_charset_region, char_charset, Fiso_charset):
2726 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2727 (sub_char_table_set, sub_char_table_set_range)
2728 (char_table_set_range, optimize_sub_char_table)
2729 (map_sub_char_table):
2730 Use bool for boolean.
2731 * character.c (str_to_unibyte): Omit last boolean argument; it was
2732 always 0. All callers changed.
2733 * character.h, charset.h: Adjust to match previous changes.
2734 * character.h (char_printable_p): Remove decl of nonexistent function.
2735 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2736 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2737 are all boolean, so make them single-bit bitfields.
2738
6af64513
PE
2739 * lisp.h (ASET): Remove attempt to detect side effects.
2740 It was meant to be temporary and it often doesn't work,
2741 because when IDX has side effects the behavior of IDX==IDX
2742 is undefined. See Stefan Monnier in
2743 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2744
e1f29348
BR
27452012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2746
2747 * lisp.h (functionp): New function (extracted from Ffunctionp).
2748 (FUNCTIONP): Use it.
2749 * eval.c (Ffunctionp): Use it.
2750
17c05d74
PE
27512012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2752
0f46bc75
PE
2753 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2754 as that's faster and simpler than static storage. Don't bother
2755 with the g_main_context_query overhead if g_main_context_pending
2756 says no events are pending.
2757 (gfds, gfds_size): Remove these static vars.
2758 (xgselect_initialize): Remove; no longer needed.
2759 All uses and decls removed.
2760
ee4c0f69
PE
2761 * emacs.c (fatal_error_signal_hook): Remove.
2762 All uses removed. This leftover from old code was always 0.
2763
17c05d74
PE
2764 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2765 * casefiddle.c (casify_object, casify_region):
2766 * casetab.c (set_case_table):
2767 * category.c, category.h (word_boundary_p):
2768 * category.h (CHAR_HAS_CATEGORY):
2769 Use bool for booleans, instead of int.
2770
391ceac5
EZ
27712012-08-25 Eli Zaretskii <eliz@gnu.org>
2772
2773 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2774
2f221583
PE
27752012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2776
f4a681b0
PE
2777 On assertion failure, print backtrace if available.
2778 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2779 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2780 * Makefile.in (LIB_EXECINFO): New macro.
2781 (LIBES): Use it.
2782
2f221583
PE
2783 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2784 * bytecode.c (exec_byte_code):
2785 * callint.c (check_mark, Fcall_interactively):
2786 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2787 (getenv_internal, sync_process_alive, call_process_exited):
2788 * lisp.h (USE_SAFE_ALLOCA):
2789 Use bool for booleans, instead of int.
2790 * lisp.h, process.h: Adjust prototypes to match above changes.
2791 * callint.c (Fcall_interactively): Don't assume the mark's
2792 offset fits in 'int'.
2793
37ef52bb
PE
27942012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2795
2796 * buffer.c, buffer.h: Use bool for boolean.
2797 * buffer.c (reset_buffer_local_variables)
2798 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2799 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2800 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2801 (overlay_touches_p, overlay_strings, Foverlay_put)
2802 (report_overlay_modification, call_overlay_mod_hooks):
2803 (mmap_enlarge, mmap_set_vars):
2804 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2805 Use bool for booleans, instead of int.
2806 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2807 since the 1-or-0 return value is always ignored anyway.
2808 (mmap_initialized_p):
2809 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2810 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2811
2cc21167
PE
28122012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2813
2814 * bidi.c: Use bool for boolean.
2815 This is a bit more readable, and makes the text segment of bidi.o
2816 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2817 Presumably it's faster too.
2818 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2819 Now bool.
2820 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2821 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2822 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2823 (bidi_explicit_dir_char, bidi_level_of_next_char)
2824 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2825 Use bool for booleans, instead of int.
2826 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2827 (bidi_unshelve_cache): Adjust decls to match code.
2828
7db4ddf4
MR
28292012-08-23 Martin Rudalics <rudalics@gmx.at>
2830
2831 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2832 argument.
2833
b1bb8011
PE
28342012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2835
2836 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2837 * atimer.h: Include <stdbool.h>.
2838
ff687885
DN
28392012-08-22 Dan Nicolaescu <dann@gnu.org>
2840
2841 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2842 compile time tests instead of run time tests on systems that do
2843 not use them.
2844 (FRAME_MAC_P): Remove leftover from deleted code.
2845 * frame.c (syms_of_frame): Remove leftover from deleted code.
2846
4ce7a138
JD
28472012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2848
2849 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2850
d733ec6d
PE
28512012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2852
2853 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2854 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 2855 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
2856 (fontset_add): Return void, for FONTSET_ADD.
2857
d0d2d26f
PE
28582012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2859
fce31d69
PE
2860 * alloc.c: Use bool for booleans.
2861 (gc_in_progress, abort_on_gc)
2862 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2863 (dont_register_blocks) [GC_MALLOC_CHECK]:
2864 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2865 (check_string_bytes, make_specified_string, memory_full)
2866 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2867 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2868 (mark_stack, valid_pointer_p, make_pure_string)
2869 (Fgarbage_collect, survives_gc_p, gc_sweep):
2870 Use bool for booleans, instead of int.
2871 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2872 Remove unused local.
2873 * alloc.c (PURE_POINTER_P):
2874 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2875 * editfns.c (Fformat):
2876 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2877 (Fdo_auto_save):
2878 * fns.c (sweep_weak_table):
2879 * lisp.h (suppress_checking, push_message, survives_gc_p)
2880 (make_pure_string, gc_in_progress, abort_on_gc):
2881 * lread.c (readchar, read1):
2882 * print.c (Fprin1_to_string):
2883 * xdisp.c (push_message):
2884 Use bool for booleans affected directly or indirectly by
2885 alloc.c's changes.
2886
d0d2d26f
PE
2887 Make recently-introduced setters macros.
2888 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2889 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2890 (set_fontset_default, set_fontset_fallback): Rename from their
2891 upper-case counterparts, and make them functions rather than macros.
2892 This is more consistent with the other recently-introduced setters.
2893 These don't need to be inline, since they're local.
2894
d18e2bb6
JD
28952012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2896
2897 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2898 the loop (Bug#12247).
2899
1b9d9d16
PE
29002012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2901
2902 * lisp.h (vcopy): Use memcpy rather than our own loop.
2903 This fixes a performance regression introduced by the recent
2904 addition of vcopy. This means 'vcopy' will need to be modified
2905 for a copying collector, but that's OK. Also, tighten the
2906 checking in the assertion.
2907
b2f09701
EZ
29082012-08-21 Eli Zaretskii <eliz@gnu.org>
2909
2910 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2911 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2912 non-base glyph for the width of the base character, according to
e1f29348
BR
2913 what x_draw_composite_glyph_string_foreground expects.
2914 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
2915 expectations, to produce correct width of the composed character.
2916 Reverse the sign of the DU offset produced by ScriptPlace.
2917
9b994fed
PE
29182012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2919
2920 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2921
086ca913
DA
29222012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2923
2924 Avoid direct writes to contents member of struct Lisp_Vector.
2925 * lisp.h (vcopy): New function to copy data into vector.
2926 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2927 * fns.c (Ffillarray): Use ASET.
2928 * keyboard.c (timer_check_2): Use AREF and ASET.
2929 (append_tool_bar_item, Frecent_keys): Use vcopy.
2930 * lread.c (read_vector): Use ASET.
2931 * msdos.c (Frecent_doskeys): Use vcopy.
2932 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2933 (Finternal_merge_in_global_face): Use ASET and vcopy.
2934 * xfont.c (xfont_list_pattern): Likewise.
2935
5481664a
MR
29362012-08-21 Martin Rudalics <rudalics@gmx.at>
2937
2938 * window.c (Fwindow_point): For the selected window always return
2939 the position of its buffer's point.
2940 (Fset_window_point): For the selected window always go in its
2941 buffer to the specified position.
2942
6d470bdd
DA
29432012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2944
2945 Setter macros for fontsets.
2946 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2947 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2948 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2949 Adjust users.
2950
24564fe1
GM
29512012-08-20 Glenn Morris <rgm@gnu.org>
2952
2953 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2954 Don't assume that `ln -f' works.
2955
0a05a035
EZ
29562012-08-20 Eli Zaretskii <eliz@gnu.org>
2957
2958 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2959 and later about non-assignments with no effect. See discussion at
2960 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2961 details.
2962
e46f2325
DA
29632012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2964
2965 Inline setter functions for Lisp_Objects slots of struct specbinding.
2966 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2967 Adjust users.
2968
734fbd86
MR
29692012-08-20 Martin Rudalics <rudalics@gmx.at>
2970
2971 * window.c (select_window): Always make selected window's buffer
2972 current.
2973
f1a95992
DA
29742012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2975
2976 Use AREF and ASET for docstrings of category tables.
2977 * category.h (CATEGORY_DOCSTRING): Use AREF.
2978 (SET_CATEGORY_DOCSTRING): Use ASET.
2979 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2980
e83064be
DA
29812012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2982
2983 Inline setter functions for hash table members.
2984 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2985 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2986 (set_hash_key_and_value, set_hash_index, set_hash_next)
2987 (set_hash_hash): New functions.
2988 * charset.c, fns.c: Adjust users.
2989
4ce60d2e
DA
29902012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2991
2992 Inline getter and setter functions for per-buffer values.
2993 * buffer.h (per_buffer_default, set_per_buffer_default)
2994 (per_buffer_value, set_per_buffer_value): New functions.
2995 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2996 * buffer.c, data.c: Adjust users.
2997
c06c9690
JB
29982012-08-20 Juanma Barranquero <lekktu@gmail.com>
2999
3000 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3001
32bd4250
PE
30022012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3003
bad03192 3004 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
3005 as gnulib does this if the system doesn't.
3006 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
3007 Remove declaration. MS-Windows declares it on stdlib.h which is
3008 included by conf_post.h.
b69a6d22
PE
3009 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3010 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3011 * vm-limit.c: Include <unistd.h>, for 'environ'.
3012
22d7feb2
PE
3013 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3014 (start_of_data): Remove decl; mem-limits.h provides it.
3015
32bd4250
PE
3016 * xdisp.c (handle_invisible_prop): Make it a bit faster
3017 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3018
450809af
CY
30192012-08-19 Chong Yidong <cyd@gnu.org>
3020
3021 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3022 ends (Bug#3874).
3023
9e677988
AS
30242012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3025
6b1319ce
AS
3026 * .gdbinit: Use call instead of set when calling a function in the
3027 inferior.
3028
9e677988
AS
3029 * data.c (set_internal): Don't use set_blv_found.
3030 (Fkill_local_variable): Likewise.
3031
d7191076
AA
30322012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3033
3034 * nsfont.m (ns_ascii_average_width): Ensure the string
3035 ascii_printable is initialized with a null-terminated character
3036 array. Otherwise, it can contain undesired extra characters.
3037
e757f1c6
PE
30382012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3039
3040 port new setting code to Sun C 5.8 2005/10/13
3041 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3042 Return void, not Lisp_Object. Otherwise, the compiler
3043 complains about (A?B:C) where B is void and C is Lisp_Object
3044 when compiling CHAR_TABLE_SET, due to the recent change to
3045 the API of sub_char_table_set_contents.
3046
a999ce26
CY
30472012-08-18 Chong Yidong <cyd@gnu.org>
3048
3049 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3050 for the string case (Bug#3874).
3051
3f22b86f
PE
30522012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3053
39eb03f1
PE
3054 * buffer.h (BSET): Remove (Bug#12215).
3055 Replace all uses with calls to new setter functions.
3056 (bset_bidi_paragraph_direction, bset_case_canon_table)
3057 (bset_case_eqv_table, bset_directory, bset_display_count)
3058 (bset_display_time, bset_downcase_table)
3059 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3060 (bset_last_selected_window, bset_local_var_alist)
3061 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3062 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3063 (bset_width_table):
3064 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3065 (bset_auto_fill_function, bset_auto_save_file_format)
3066 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3067 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3068 (bset_cache_long_line_scans, bset_case_fold_search)
3069 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3070 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3071 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3072 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3073 (bset_header_line_format, bset_indicate_buffer_boundaries)
3074 (bset_indicate_empty_lines, bset_invisibility_spec)
3075 (bset_left_fringe_width, bset_major_mode, bset_mark)
3076 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3077 (bset_name, bset_overwrite_mode, bset_pt_marker)
3078 (bset_right_fringe_width, bset_save_length)
3079 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3080 (bset_scroll_up_aggressively, bset_selective_display)
3081 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3082 (bset_word_wrap, bset_zv_marker):
3083 * category.c (bset_category_table):
3084 * syntax.c (bset_syntax_table):
3085 New setter functions.
3086
6a09a33b
PE
3087 * process.h (PSET): Remove (Bug#12215).
3088 Replace all uses with calls to new setter functions.
3089 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3090 (PROCESS_INLINE): New macro.
3091 (pset_childp): New setter function.
3092 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3093 * process.c (PROCESS_INLINE):
3094 Define to EXTERN_INLINE, so that the corresponding functions
3095 are compiled into code.
3096 (pset_buffer, pset_command, pset_decode_coding_system)
3097 (pset_decoding_buf, pset_encode_coding_system)
3098 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3099 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3100 (pset_type, pset_write_queue): New setter functions.
3101
e8c17b81
PE
3102 * window.h (WSET): Remove (Bug#12215).
3103 Replace all uses with calls to new setter functions.
3104 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3105 (WINDOW_INLINE): New macro.
3106 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3107 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3108 (wset_total_lines, wset_vertical_scroll_bar)
3109 (wset_window_end_pos, wset_window_end_valid)
3110 (wset_window_end_vpos): New setter functions.
3111 * window.c (WINDOW_INLINE):
3112 Define to EXTERN_INLINE, so that the corresponding functions
3113 are compiled into code.
3114 (wset_combination_limit, wset_dedicated, wset_display_table)
3115 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3116 (wset_new_normal, wset_new_total, wset_next_buffers)
3117 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3118 (wset_prev_buffers, wset_right_fringe_width)
3119 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3120 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3121 (wset_window_parameters):
3122 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3123 (wset_column_number_displayed, wset_region_showing):
3124 New setter functions.
3125
3f22b86f
PE
3126 * termhooks.h (TSET): Remove (Bug#12215).
3127 Replace all uses with calls to new setter functions.
3128 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3129 (TERMHOOKS_INLINE): New macro.
3130 (tset_charset_list, tset_selection_alist): New setter functions.
3131 * terminal.c (TERMHOOKS_INLINE):
3132 Define to EXTERN_INLINE, so that the corresponding functions
3133 are compiled into code.
3134 (tset_param_alist): New setter function.
3135
742af32f
PE
31362012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3137
15dbb4d6
PE
3138 * keyboard.h (KSET): Remove (Bug#12215).
3139 Replace all uses with calls to new setter functions.
3140 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3141 (KEYBOARD_INLINE): New macro.
3142 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3143 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3144 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3145 New setter functions.
3146 * keyboard.c (KEYBOARD_INLINE):
3147 Define to EXTERN_INLINE, so that the corresponding functions
3148 are compiled into code.
3149 (kset_echo_string, kset_kbd_queue)
3150 (kset_keyboard_translate_table, kset_last_prefix_arg)
3151 (kset_last_repeatable_command, kset_local_function_key_map)
3152 (kset_overriding_terminal_local_map, kset_real_last_command)
3153 (kset_system_key_syms): New setter functions.
3154
f00af5b1
PE
3155 * frame.h (FSET): Remove (Bug#12215).
3156 Replace all uses with calls to new setter functions.
3157 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3158 (FRAME_INLINE): New macro.
3159 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3160 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3161 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3162 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3163 (fset_param_alist, fset_root_window, fset_scroll_bars)
3164 (fset_selected_window, fset_title, fset_tool_bar_items)
3165 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3166 * frame.c (FRAME_INLINE):
3167 Define to EXTERN_INLINE, so that the corresponding functions
3168 are compiled into code.
3169 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3170
0c94c8d6
PE
3171 A few more naming-convention fixes for getters and setters.
3172 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3173 and rename from buffer_overlays_set_before.
3174 (set_buffer_overlays_after): Move here from buffer.h, and rename
3175 from buffer_overlays_set_after.
3176 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3177 All uses changed.
3178 (set_buffer_intervals): Rename from buffer_set_intervals.
3179 * intervals.c (set_interval_object): Move here from intervals.h,
3180 and rename from interval_set_object.
3181 (set_interval_left): Move here from intervals.h, and rename from
3182 interval_set_left.
3183 (set_interval_right): Move here from intervals.h, and rename from
3184 interval_set_right.
3185 (copy_interval_parent): Move here from intervals.h, and rename from
3186 interval_copy_parent.
3187 * intervals.h (set_interval_parent): Rename from interval_set_parent.
3188 (set_interval_plist): Rename from interval_set_plist.
3189 Return void, not Lisp_Object, since no caller uses the result.
3190 * lisp.h (string_intervals): Rename from string_get_intervals.
3191 (set_string_intervals): Rename from string_set_intervals.
3192
34dabdb7
PE
3193 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
3194 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 3195 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
3196 All uses changed. See the end of
3197 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
3198
742af32f
PE
3199 * lisp.h (CSET): Remove (Bug#12215).
3200 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
3201 (set_char_table_purpose): New functions,
3202 replacing CSET. All uses changed. For example, replace
3203 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 3204 "set_char_table_parent (char_table, parent);".
742af32f
PE
3205 The old version was confusing because it used the same name
3206 'parent' for two different things.
3207
a04e2c62
DA
32082012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3209
3210 Functions to get and set Lisp_Object fields of buffer-local variables.
3211 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
3212 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
3213 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
3214 * data.c, eval.c, frame.c: Adjust users.
3215
383dcbf9
CY
32162012-08-17 Chong Yidong <cyd@gnu.org>
3217
3218 * xfaces.c (merge_face_vectors): If the target font specfies a
3219 font spec, make the font's attributes take precedence over
3220 directly-specified attributes.
3221 (merge_face_ref): Recognize :font.
3222
44386687
DA
32232012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3224
3225 Do not use memcpy for copying intervals.
3226 * intervals.c (reproduce_interval): New function.
3227 (reproduce_tree, reproduce_tree_obj): Use it.
3228 (reproduce_tree_obj): Remove prototype.
3229
927c7216
PE
32302012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3231
3232 * lisp.h (duration_to_sec_usec): Remove unused decl.
3233
93044f7b
AA
32342012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
3235
3236 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
3237 to an allocated instance of NSString, not to the class itself.
3238
9851e4a5
JB
32392012-08-17 Juanma Barranquero <lekktu@gmail.com>
3240
3241 * makefile.w32-in (C_CTYPE_H): New macro.
3242 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
3243 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
3244 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3245
620f13b0
PE
32462012-08-16 Paul Eggert <eggert@cs.ucla.edu>
3247
3248 Use ASCII tests for character types.
3249 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
3250 * xfns.c, xterm.c:
3251 Don't include <ctype.h>; was not needed.
3252 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
3253 * sysdep.c, xfaces.c:
3254 Include <c-ctype.h> instead of <ctype.h>.
3255 * nsterm.m: Include <c-ctype.h>.
3256 * charset.c (read_hex):
3257 * doc.c (Fsnarf_documentation):
3258 * fileio.c (IS_DRIVE) [WINDOWSNT]:
3259 (DRIVE_LETTER) [DOS_NT]:
3260 (Ffile_name_directory, Fexpand_file_name)
3261 (Fsubstitute_in_file_name):
3262 * font.c (font_parse_xlfd, font_parse_fcname):
3263 * frame.c (x_set_font_backend):
3264 * gtkutil.c (xg_get_font):
3265 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
3266 * nsimage.m (hexchar):
3267 * nsterm.m (ns_xlfd_to_fontname):
3268 * sysdep.c (system_process_attributes):
3269 * xfaces.c (hash_string_case_insensitive):
3270 Use C-locale tests instead of locale-specific tests for character
3271 types, since we want the ASCII interpretation here, not the
3272 interpretation suitable for whatever happens to be the current locale.
3273
52162052
MR
32742012-08-16 Martin Rudalics <rudalics@gmx.at>
3275
3276 Consistently check windows for validity/liveness
3277 (Bug#11984, Bug#12025, Bug#12026).
3278 * lisp.h (CHECK_VALID_WINDOW): New macro.
3279 * window.c (decode_window): Rename to decode_live_window.
3280 (decode_valid_window, Fwindow_valid_p): New functions.
3281 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
3282 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
3283 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
3284 (Fwindow_prev_sibling, Fwindow_combination_limit)
3285 (Fset_window_combination_limit, Fwindow_use_time)
3286 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
3287 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
3288 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
3289 (Fwindow_hscroll, Fset_window_hscroll)
3290 (Fwindow_redisplay_end_trigger)
3291 (Fset_window_redisplay_end_trigger, Fwindow_edges)
3292 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
3293 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
3294 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
3295 (Fwindow_end, Fset_window_point, Fset_window_start)
3296 (Fpos_visible_in_window_p, Fwindow_line_height)
3297 (Fwindow_dedicated_p, Fset_window_dedicated_p)
3298 (Fwindow_prev_buffers, Fset_window_prev_buffers)
3299 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
3300 (Fset_window_parameter, Fwindow_display_table)
3301 (Fset_window_display_table, Fdelete_other_windows_internal)
3302 (Fset_window_buffer, Fset_window_new_total)
3303 (Fset_window_new_normal, Fdelete_window_internal)
3304 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
3305 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
3306 (Fwindow_scroll_bars): Check whether argument window is a valid or
3307 live window. Update doc-strings.
3308 (syms_of_window): New symbol Qwindow_valid_p.
3309 * keyboard.c (Fposn_at_x_y): Check whether argument
3310 frame_or_window denotes a valid window.
3311
2751c80f
DA
33122012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3313
3314 Fix previous char table change.
3315 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
3316 * chartab.c (optimize_sub_char_table): Likewise.
3317
032a42c8
CY
33182012-08-16 Chong Yidong <cyd@gnu.org>
3319
a2d19368
CY
3320 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
3321
032a42c8
CY
3322 * xfont.c (xfont_open):
3323 * xftfont.c (xftfont_open): Set the font's max_width field.
3324
3325 * nsfont.m (nsfont_open): Similar to the Xft backend, set
3326 min_width to space_width and average_width to the average over
3327 printable ASCII characters.
3328 (ns_char_width): Code cleanup.
3329 (ns_ascii_average_width): New utility function.
3330
3331 * font.h (struct font): Update comments.
3332
a098c930
DA
33332012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3334
032a42c8 3335 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
3336 * lisp.h (CSET): New macro.
3337 (char_table_set_extras, char_table_set_contents)
3338 (sub_char_table_set_contents): New function.
3339 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
3340 * syntax.c: Adjust users.
3341
8be3a09c
SM
33422012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
3343
3344 * eval.c (eval_sub): Bind lexical-binding.
3345 * lread.c (Qlexical_binding): Make non-static.
3346
ac4845a6
JD
33472012-08-15 Jan Djärv <jan.h.d@swipnet.se>
3348
ddee6515
JD
3349 * nsmenu.m (popupSession): Remove.
3350 (pop_down_menu): Remove endModalSession.
3351 (timeout_handler:): New method.
3352 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
3353 Call runModalForWindow. Check timer_fired when it returns.
3354 If not set, cancel timer and break out of loop.
3355 Otherwise loop again, with a new timeout.
3356
3357 * nsterm.m: Include fcntl.h if present.
3358 (fd_entry, t_readfds, inNsSelect): Remove.
3359 (select_writefds, select_valid, select_timeout, selfds)
3360 (select_mutex, apploopnr): Add.
3361 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
3362 Otherwise call kbd_buffer_store_event.
3363 (ns_send_appdefined): Remove release of fd_entry.
3364 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
3365 Increment and decrement apploopnr.
3366 (ns_select): If no file descriptors, just do a NSTimer.
3367 Otherwise copy read/write masks and start select thread (fd_handler).
3368 Start main loop and wait for application defined event.
3369 Inform select thread to stop selecting after main loop is exited.
3370 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 3371 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
3372 (fd_handler:): Loop forever, wait for info from the main thread
3373 to either start or stop selecting. When select returns, send
3374 and appdefined event.
3375 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
3376 If not call kbd_buffer_store_event.
3377
3378 * nsterm.h (EmacsApp): fd_handler takes id argument.
3379 (EmacsDialogPanel): Add timer_fired and timeout_handler.
3380
ac4845a6
JD
3381 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3382
eb424fe3
EZ
33832012-08-15 Eli Zaretskii <eliz@gnu.org>
3384
3385 * region-cache.c (move_cache_gap): Update gap_len using the actual
3386 growth of the boundaries array. Do not change cache_len.
3387 (Bug#12196)
3388
4e6a86c6
DA
33892012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3390
3391 Generalize and cleanup font subsystem checks.
3392 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
3393 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
3394 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 3395
5bf192ca
DA
33962012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3397
3398 * gtkutil.c (xg_get_font): Use pango_units_to_double.
3399
f2045622
CY
34002012-08-15 Chong Yidong <cyd@gnu.org>
3401
8be3a09c
SM
3402 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
3403 When using the new font chooser, use gtk_font_chooser_get_font_desc to
3404 extract the font descriptor instead of just the font name.
3405 In that case, return a font spec instead of a string.
f2045622
CY
3406 (x_last_font_name): Move to this file from xfns.c.
3407
3408 * xfns.c (Fx_select_font): The return value can also be a font
3409 spec. Move x_last_font_name management to gtkutil.c.
3410
3411 * xfaces.c: Make font weight and style symbols non-static.
3412
7f6feb56
SM
34132012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
3414
3415 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3416 (bug#12117).
3417
fecbd8ff
SM
34182012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
3419
3420 * alloc.c (Fgarbage_collect): Use plural form consistently.
3421
9b8d5165
EZ
34222012-08-14 Eli Zaretskii <eliz@gnu.org>
3423
3424 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3425 iteration through the command loop. Fixes a problem whereby mouse
3426 movements are ignored until the first mouse click.
3427
f5d9e83a
PE
34282012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3429
3430 Use bool, not int, for Lisp booleans.
3431 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3432 makes Emacs a bit smaller and presumably a bit faster.
3433 * lisp.h: Include <stdbool.h>.
3434 (struct Lisp_Boolfwd, defvar_bool):
3435 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3436 * regex.c [!emacs]: Include <stdbool.h>.
3437 (false, true): Remove; <stdbool.h> does this for us now.
3438
55802e4a
CY
34392012-08-14 Chong Yidong <cyd@gnu.org>
3440
4abcdac8
CY
3441 * character.c (Fcharacterp): Doc fix (Bug#12076).
3442
3443 * data.c (Findirect_variable): Doc fix (Bug#11040).
3444
55802e4a
CY
3445 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
3446
3447 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 3448 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 3449
8e99d072
BR
34502012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3451
3452 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3453 (bug#12022).
3454
08908aca
MR
34552012-08-14 Martin Rudalics <rudalics@gmx.at>
3456
3457 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3458 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3459 * minibuf.c (choose_minibuf_frame, read_minibuf):
3460 * w32fns.c (x_create_tip_frame):
3461 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3462 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3463
56120d6f
PE
34642012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3465
3466 * intervals.c (offset_intervals): Remove obsolete comment.
3467
67b77c0b
AS
34682012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3469
3470 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3471
f48b82fd
GR
34722012-08-14 Gergely Risko <gergely@risko.hu>
3473
3474 * coding.c (decode_coding): Record buffer modification before
3475 disabling undo_list (Bug#11773).
3476
fd318b54
DA
34772012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3478
3479 Revert and cleanup some recent overlay changes.
3480 * buffer.h (enum overlay_type): Remove.
3481 (buffer_get_overlays, buffer_set_overlays): Likewise.
3482 (buffer_set_overlays_before, buffer_set_overlays_after):
3483 New function. Adjust users.
3484 (unchain_both): Add eassert.
3485
41a62dd9
DA
34862012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3487
3488 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3489
5884c324
PE
34902012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3491
3492 * gtkutil.c (xg_mark_data): Don't assume C99.
3493
ca06f160
JD
34942012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3495
3496 * gtkutil.c (xg_frame_tb_info): New struct.
3497 (TB_INFO_KEY): New define.
3498 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3499 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3500 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3501 if not present.
3502 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 3503 is up to date. Otherwise store new data.
ca06f160
JD
3504 (free_frame_tool_bar): Free xg_frame_tb_info if present.
3505
7864a3f7
DA
35062012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3507
3508 Use KSET for write access to Lisp_Object members of struct kboard.
3509 * keyboard.h (KSET): New macro.
3510 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3511 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3512 * xterm.c: Adjust users.
3513
4c31be61
DA
35142012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3515
3516 Use BSET for write access to Lisp_Object members of struct buffer.
3517 * buffer.h (BSET): New macro.
3518 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3519 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3520 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3521 * window.c, xdisp.c, xfns.c: Adjust users.
3522
14ae4239
BT
35232012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
3524
3525 * lread.c (syms_of_lread): Initialize Vlexical_binding.
3526
32bcadb4
JD
35272012-08-11 Jan Djärv <jan.h.d@swipnet.se>
3528
3d29b2ce 3529 * nsterm.m (not_in_argv): New function.
fc0c31f8 3530 (application:openFile, application:openTempFile:):
3d29b2ce
JD
3531 (application:openFileWithoutUI:, application:openFiles:): Open file
3532 if not_in_argv returns non-zero (bug#12171).
3533
32bcadb4 3534 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
3535 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
3536 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
3537 (xg_get_font_name): Use those functions/macros here.
3538 Reported by Frans Oilinki <moilinki@gmail.com>.
3539
9ff9402d 35402012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
3541
3542 * unexmacosx.c (copy_data_segment): Copy initialized data in
3543 statically linked libraries from input file rather than memory.
3544
db74a5fc
YM
3545 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
3546 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
3547 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
3548
25e65510
GM
35492012-08-10 Glenn Morris <rgm@gnu.org>
3550
3551 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
3552 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
3553
7961135c
DA
35542012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3555
3556 Fix last change to allow compilation with low optimization levels.
3557 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
3558 Reported by Jan Djärv <jan.h.d@swipnet.se>.
3559
42b3a444
DA
35602012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3561
3562 Use common inline syntax in intervals.h.
3563 * intervals.h (INTERVALS_INLINE): New macro.
3564 Change all users from LISP_INLINE.
3565
9fb0c957
DA
35662012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3567
3568 Define Qnone once for all platforms.
3569 * frame.c (Qnone): Define here.
3570 (syms_of_frame): DEFSYM it.
3571 * lisp.h (Qnone): New declaration.
3572 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
3573 * xfns.c: Remove duplication. Adjust users.
3574
65e8ee52
DA
35752012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3576
3577 Remove unused macros from intervals.h.
3578 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
3579 * intervals.c: Adjust comment.
3580
9b855fd6
EZ
35812012-08-10 Eli Zaretskii <eliz@gnu.org>
3582
3583 * w32fns.c <w32_unicode_gui>: New static variable.
3584 (globals_of_w32fns): Initialize it according to os_subtype.
3585 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3586 testing os_subtype.
3587
39cb9e56 35882012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
3589 Eli Zaretskii <eliz@gnu.org>
3590
3591 Fix bug #10299 with Unicode characters sent by customized
3592 keyboards created by MSKLC.
3593 * w32fns.c (INIT_WINDOW_CLASS): New macro.
3594 (w32_init_class): Use it to initialize the Emacs class with either
3595 ANSI or Unicode API calls.
3596 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3597 later.
3598 (w32_wnd_proc): If the character code sent by WM_CHAR or
3599 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3600 original message. Call DefWindowProcW on NT and later.
3601
9374581a
GM
36022012-08-10 Glenn Morris <rgm@gnu.org>
3603
4b94e8cf
GM
3604 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3605
9374581a
GM
3606 * lisp.h (DIRECTORY_SEP): Let configure set it.
3607
a2752828
DA
36082012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
3609
3610 Use TSET for write access to Lisp_Object slots of struct terminal.
3611 * termhooks.h (TSET): New macro.
3612 * coding.c, terminal.c, xselect.c: Adjust users.
3613
cc92c454
SM
36142012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
3615
3616 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
3617 the failing expression, include them in the error message.
3618 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3619 * lisp.h (internal_condition_case_n): Update declaration.
3620
4cb3e6b3
DA
36212012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3622
3623 Inline functions to examine and change buffer overlays.
3624 * buffer.c (unchain_both): New function.
3625 * buffer.h (buffer_get_overlays, buffer_set_overlays):
3626 (buffer_has_overlays): New function.
3627 (enum overlay_type): New enum.
3628 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3629 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3630
8707c1e5
DA
36312012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3632
3633 Inline functions to examine and change buffer intervals.
3634 * alloc.c (mark_interval_tree): Remove.
3635 (MARK_INTERVAL_TREE): Simplify.
3636 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
3637 * intervals.c (buffer_balance_intervals): New function.
3638 (graft_intervals_into_buffer): Adjust indentation.
3639 (set_intervals_multibyte): Simplify.
3640 * buffer.h (BUF_INTERVALS): Remove.
3641 (buffer_get_intervals, buffer_set_intervals): New function.
3642 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3643 * intervals.c, textprop.c: Adjust users.
3644
ad8c997f
DA
36452012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3646
3647 Inline functions to examine and change string intervals.
3648 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3649 (string_get_intervals, string_set_intervals): New function.
3650 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3651 * lread.c, print.c, textprop.c: Adjust users.
3652
32ac3a6b
GM
36532012-08-08 Glenn Morris <rgm@gnu.org>
3654
3655 * lisp.mk (lisp): Remove language/persian.elc.
3656
77c7bcb1
DA
36572012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3658
3659 Cleanup intervals.
3660 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3661 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
3662 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3663 Adjust comment. Move under #if 0.
77c7bcb1
DA
3664 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3665 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3666
9c08a8d4
DA
36672012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3668
3669 Check total length of intervals with eassert.
3670 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3671 * intervals.c: Change all users to eassert.
3672
26d16b35
EZ
36732012-08-07 Eli Zaretskii <eliz@gnu.org>
3674
14ae4239
BT
3675 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
3676 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
3677 INTERNAL_FIELD in Lisp_Cons.
3678
c644523b
DA
36792012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3680
3681 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
3682 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
3683 name since all xname users are fixed long time ago. Do not
3684 use INTERNAL_FIELD.
3685 (set_symbol_name, set_symbol_function, set_symbol_plist):
3686 (set_symbol_next, set_overlay_plist): New function.
3687 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
3688 (struct Lisp_Overlay): Likewise.
3689 (CVAR, MVAR, SVAR): Remove.
3690 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
3691 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
3692 * xterm.c: Adjust users.
3693 * .gdbinit: Change to use name field of struct Lisp_Symbol
3694 where appropriate.
3695
6a3d20cc
DA
36962012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3697
3698 Basic functions to set Lisp_Object and pointer slots of intervals.
3699 * intervals.h (interval_set_parent, interval_set_object):
3700 (interval_set_left, interval_set_right, interval_set_plist):
3701 (interval_copy_parent): New function.
3702 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
3703 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
3704 Adjust indentation.
6a3d20cc
DA
3705 (INTERVAL_SIZE): Remove. Adjust users.
3706 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3707
4d2b044c
DA
37082012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3709
3710 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3711 * process.h (PGET): Remove.
3712 (struct Lisp_Process): Do not use INTERNAL_FIELD.
3713 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3714
d3d50620
DA
37152012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3716
3717 Drop WGET and revert read access to Lisp_Objects slots of struct window.
3718 * window.h (WGET): Remove.
3719 (struct window): Do not use INTERNAL_FIELD.
3720 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3721 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3722 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3723 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3724 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3725 Adjust users.
3726
d10a51dc
CY
37272012-08-07 Chong Yidong <cyd@gnu.org>
3728
3729 * window.c (Fwindow_edges, Fwindow_pixel_edges)
3730 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3731 (Fdelete_window_internal): Signal an error if the window is not on
3732 a live frame (Bug#12025).
3733
e69b0960
DA
37342012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3735
3736 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3737 * frame.h (FGET): Remove.
3738 (struct frame): Do not use INTERNAL_FIELD.
3739 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3740 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3741 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3742 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3743
25a20a3a
JB
37442012-08-06 Juanma Barranquero <lekktu@gmail.com>
3745
3746 * w32.c: Silence compiler warnings.
3747 (map_w32_filename): Remove unused variable `is_fat'.
3748 (chase_symlinks): Add parentheses around expression.
3749
1c6f11f4
GM
37502012-08-06 Glenn Morris <rgm@gnu.org>
3751
1db4583a
GM
3752 * sysdep.c: Respect BROKEN_GETWD.
3753
1c6f11f4
GM
3754 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3755 Let configure handle it.
3756 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3757
2b90362b
DA
37582012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3759
3760 Use GCALIGNMENT where appropriate.
3761 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3762 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3763 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3764
5f50daf2
EZ
37652012-08-06 Eli Zaretskii <eliz@gnu.org>
3766
14ae4239
BT
3767 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3768 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 3769
cbcc7007
SM
37702012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3771
3772 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3773 that should be sufficient for everyone.
3774
4d365fa4
JD
37752012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3776
3777 * keyboard.c (timer_check_2): Add break so timer_check returns next
3778 timeout.
3779
dd86bd82
DA
37802012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3781
3782 Fix Windows build errors introduced after converting to WGET and WSET.
3783 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3784 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3785
054e1668
JD
37862012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3787
3788 * nsterm.m (ns_frame_rehighlight): Use FSET.
3789
3790 * nsmenu.m (ns_update_menubar): Use FSET.
3791
21238f11
DA
37922012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3793
3794 Separate read and write access to Lisp_Object slots of Lisp_Process.
3795 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3796 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3797
077288cf
DA
37982012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3799
3800 Separate read and write access to Lisp_Object slots of struct window.
3801 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3802 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3803 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3804 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3805 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3806 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3807 Adjust users.
3808
71688bd7
DA
38092012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3810
3811 Fix Windows build errors introduced after converting to FGET and FSET.
3812 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3813 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3814 (w32_judge_scroll_bars): Change to use FSET.
3815 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3816
f99bac93
DA
38172012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3818
3819 Fix replacement typo.
3820 * window.c (replace_window): Set root_window instead of
3821 selected_window. This fixes a total window subsystem
3822 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3823
8c2a0f2d
GM
38242012-08-06 Glenn Morris <rgm@gnu.org>
3825
3826 * lisp.mk (lisp): Add language/persian.elc.
3827
edd74c35
DA
38282012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3829
3830 Separate read and write access to Lisp_Object slots of struct frame.
3831 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3832 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3833 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3834 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3835 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3836
8671676c
AS
38372012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3838
3839 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3840
663e2b3f
DA
38412012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3842
3843 Generalize common compile-time constants.
3844 * lisp.h (header_size, bool_header_size, word_size): Now here.
3845 (struct Lisp_Vector): Add comment.
3846 (struct Lisp_Bool_Vector): Move up to define handy constants.
3847 (VECSIZE, PSEUDOVECSIZE): Simplify.
3848 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3849 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3850 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3851 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3852 * xfont.c, xmenu.c: Use word_size where appropriate.
3853
d32e47af
LM
38542012-08-05 Lawrence Mitchell <wence@gmx.li>
3855
3856 * search.c (Freplace_match): Treat \? in the replacement text
3857 literally (Bug#8161).
3858
e5d9c0d1
CY
38592012-08-05 Chong Yidong <cyd@gnu.org>
3860
3861 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3862 * frame.c (Vdelete_frame_functions):
3863 * emacs.c (Vkill_emacs_hook): Doc fix.
3864
8da0576b
EZ
38652012-08-04 Eli Zaretskii <eliz@gnu.org>
3866
3867 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3868 --with-x-toolkit=no builds.
3869 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3870
02676e5d
CY
38712012-08-04 Chong Yidong <cyd@gnu.org>
3872
3873 * syntax.c (Fmodify_syntax_entry): Doc fix.
3874
97147da9
EZ
38752012-08-04 Eli Zaretskii <eliz@gnu.org>
3876
76151e2c
EZ
3877 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3878 * w32.c (init_environment): Change the default values of many
3879 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
3880 them into environment when they were not already defined.
3881 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 3882 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
3883 (check_windows_init_file): Now external, not static.
3884 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
3885 called when Vload_path is already set up.
3886
3887 * w32.h (check_windows_init_file): Add prototype.
3888
3889 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3890 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3891 compatibility with Posix platforms.
3892 (main): Move the call to check_windows_init_file to here from
3893 w32.c.
3894 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3895 any, in the DEFALT argument into the root of the Emacs build or
3896 installation tree, as appropriate.
3897
3898 * callproc.c (init_callproc_1): Call decode_env_path instead of
3899 doing its equivalent by hand.
3900 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3901 the code that sets Vexec_path run on MS-Windows.
3902
3903 * lread.c (init_lread): Add comments to #ifdef's.
3904
97147da9
EZ
3905 * msdos.c (dos_set_window_size, IT_update_begin)
3906 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3907 instead of direct references.
3908
185ee146
PE
39092012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3910
3911 Export DEFAULT_REHASH_* to GDB.
3912 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3913 Now constants, not macros.
3914
8834c57a
PE
39152012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3916
98c6f1e3
PE
3917 Remove unnecessary casts involving pointers.
3918 These casts are no longer needed now that we assume C89 or later,
3919 since they involve casting to or from void *.
3920 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3921 (make_pure_float, make_pure_vector):
3922 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3923 * macros.c (Fstart_kbd_macro):
3924 * menu.c (find_and_return_menu_selection):
3925 * minibuf.c (read_minibuf_noninteractive):
3926 * sysdep.c (closedir):
3927 * xdisp.c (x_produce_glyphs):
3928 * xfaces.c (compare_fonts_by_sort_order):
3929 * xfns.c (x_real_positions, select_visual):
3930 * xselect.c (x_stop_queuing_selection_requests)
3931 (x_get_window_property, x_get_window_property_as_lisp_data):
3932 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3933 Remove unnecessary pointer casts.
3934 * alloc.c (record_xmalloc): New function.
3935 * lisp.h (record_xmalloc): New decl.
3936 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3937 more like a function. This is because the pointer cast is not
3938 needed. All uses changed.
3939 * print.c (print_string, print_error_message): Avoid length recalc.
3940
8834c57a
PE
3941 Improve fix for macroexp crash with debugging (Bug#12118).
3942 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3943 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3944 not supposed to be invoked from the garbage collector.
3945 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3946 (gc_aset): New function, which is like ASET but can be
3947 used in the garbage collector.
3948 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3949 (set_hash_index): Use it instead of ASET.
3950
6dad7178
EZ
39512012-08-03 Eli Zaretskii <eliz@gnu.org>
3952
3953 Support symlinks on latest versions of MS-Windows.
3954 * w32.c: Include winioctl.h and aclapi.h.
3955 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3956 (revert_to_self): Forward declarations of static functions.
3957 <static BOOL g_b_init_get_security_info>:
3958 <g_b_init_create_symbolic_link>: New static flags.
3959 (globals_of_w32): Initialize them to zero.
3960 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3961 (map_w32_filename): Improve commentary. Simplify switch.
3962 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3963 headers (most versions of MinGW w32api don't).
3964 (get_security_info, create_symbolic_link)
3965 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3966 New functions.
3967 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3968 in the argument file name.
3969 (sys_access): Call unc_volume_file_attributes only if
3970 GetFileAttributes fails with network-related error codes.
3971 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3972 have the required privileges.
14ae4239 3973 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
3974 get_file_security_desc.
3975 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
3976 with addition of handling of symlinks and support for 'lstat'.
3977 If possible, get file's attributes and security information by
6dad7178
EZ
3978 handle, not by name. Produce S_IFLNK bit for symlinks, when
3979 called from 'lstat'.
3980 (stat, lstat): New functions, call 'stat_worker'.
3981 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3982 symlinks when the underlying filesystem supports them.
3983
f162bcc3
PE
39842012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3985
79ea6c20
PE
3986 Fix macroexp crash on Windows with debugging (Bug#12118).
3987 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3988 checking subscripts; problem introduced with the recent
3989 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3990 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3991 since it's used in non-static inline functions now.
3992
c0ce93fd
PE
3993 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3994 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 3995
f162bcc3
PE
3996 Use C99-style 'extern inline' if available.
3997 * buffer.h (BUFFER_INLINE):
3998 * category.h (CATEGORY_INLINE):
3999 * character.h (CHARACTER_INLINE):
4000 * charset.h (CHARSET_INLINE):
4001 * composite.h (COMPOSITE_INLINE):
4002 * dispextern.h (DISPEXTERN_INLINE):
4003 * lisp.h (LISP_INLINE):
4004 * systime.h (SYSTIME_INLINE):
4005 New macro, replacing 'static inline' in this header.
4006 * buffer.h, category.h, character.h, charset.h, composite.h:
4007 * dispextern.h, lisp.h, systime.h:
4008 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4009 * alloc.c (LISP_INLINE):
4010 * buffer.c (BUFFER_INLINE):
4011 * category.c (CATEGORY_INLINE):
4012 * character.c (CHARACTER_INLINE):
4013 * charset.c (CHARSET_INLINE):
4014 * composite.c (COMPOSITE_INLINE):
4015 * dispnew.c (DISPEXTERN_INLINE):
4016 * sysdep.c (SYSTIME_INLINE):
4017 Define to EXTERN_INLINE, so that the corresponding functions
4018 are compiled into code.
4019 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4020 (INLINE_HEADER_END): New macros.
4021 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4022 since it's used in non-static inline functions now.
a8333d03 4023 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 4024
837b365b
GM
40252012-08-02 Glenn Morris <rgm@gnu.org>
4026
d66b744d
GM
4027 * s/: Remove empty directory.
4028
837b365b
GM
4029 * s/ms-w32.h: Move to ../nt/inc.
4030 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4031 Update for new ms-w32.h location.
4032
13294f95
PE
40332012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4034
4035 Port to Solaris 8.
4036 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4037
90df0db3
GM
40382012-08-02 Glenn Morris <rgm@gnu.org>
4039
4040 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4041 hard-coding the path separator.
4042
4939150c
PE
40432012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4044
4045 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4046 This how ASET and AREF are supposed to work, and makes
4047 it easier to think about future improvements. See
4048 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4049 * charset.h (set_charset_attr): New function.
4050 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4051 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4052 (aref_addr): New function. All uses of &AREF(...) changed.
4053 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4054 (set_hash_index): New functions. All lvalue-style uses of
4055 HASH_KEY etc. changed.
4056 * keyboard.c (set_prop): New function. All lvalue-style uses
4057 of PROP changed.
4058
947b2afd
AA
40592012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4060
4061 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4062 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
4063 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
4064 * nsfns.m (ns_set_name_as_filename): Likewise.
4065 * nsmenu.m (ns_update_menubar): Likewise.
4066 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4067
4f5d0325
EZ
40682012-08-01 Eli Zaretskii <eliz@gnu.org>
4069
2008beae
EZ
4070 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4071 Adapt to latest changes in field names of the corresponding Lisp
288479f6 4072 objects.
2008beae 4073
4f5d0325
EZ
4074 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4075
fe3cc771
GM
40762012-08-01 Glenn Morris <rgm@gnu.org>
4077
4078 * s/msdos.h: Remove file.
4079 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4080 * Makefile.in (S_FILE): Remove.
4081 (config_h): Remove S_FILE.
4082
c90acc54
JB
40832012-08-01 Juanma Barranquero <lekktu@gmail.com>
4084
4085 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4086 Remove; moved to nt/config.nt.
4087
d8a05828
DA
40882012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4089
4090 Use INTERNAL_FIELD for conses and overlays.
4091 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4092 Remove obsolete comment.
4093 (MVAR): New macro.
4094 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4095 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4096
8271d590
DA
40972012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4098
4099 Use INTERNAL_FIELD for symbols.
4100 * lisp.h (SVAR): New macro. Adjust users.
4101 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4102 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4103
3193acd2
DA
41042012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4105
4106 Use INTERNAL_FIELD for processes.
4107 * process.h (PVAR): New macro. Adjust style.
4108 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4109 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4110
3a45383a
DA
41112012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4112
4113 Use INTERNAL_FIELD for windows.
4114 * window.h (WVAR): New macro.
4115 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4116 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4117 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4118 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4119 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4120 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4121
c1dbc63c
PE
41222012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4123
4124 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4125
5c0c0e8a
GM
41262012-08-01 Glenn Morris <rgm@gnu.org>
4127
4128 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4129 Move to configure.ac.
4130
552a99b4
JB
41312012-08-01 Juanma Barranquero <lekktu@gmail.com>
4132
4133 * makefile.w32-in (CONFIG_H): Update dependencies.
4134 (CONF_POST_H): New macro.
4135
4136 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4137
8d8e2dfe
GM
41382012-07-31 Glenn Morris <rgm@gnu.org>
4139
bc96620a
GM
4140 * Makefile.in (S_FILE): No longer set by configure.
4141
476b1b2d
GM
4142 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4143 is available.
4144 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4145
b2c7a106
GM
4146 * process.h (NULL_DEVICE):
4147 * emacs.c (SEPCHAR):
4148 * editfns.c (USER_FULL_NAME): Let configure set them.
4149
d53d062a
GM
4150 * s/README, s/template.h: Remove files.
4151
4515017f
GM
4152 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4153
8d8e2dfe
GM
4154 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4155 Move to configure.ac.
4156
5b20b3cc
EZ
41572012-07-31 Eli Zaretskii <eliz@gnu.org>
4158
1e0afd9a
EZ
4159 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4160 resulting renaming of 'struct frame' members.
4161
5b20b3cc
EZ
4162 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4163
4164 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4165 after introduction of FVAR.
4166
f1310128
JD
41672012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4168
79e721e0
JD
4169 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4170
4171 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4172 instead of compositeToPoint.
4173 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4174
8d7c7eed 4175 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 4176
e34f7f79
DA
41772012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4178
4179 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4180 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 4181 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
4182 (BVAR): Change to use INTERNAL_FIELD.
4183 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
4184 (KVAR): Change to use INTERNAL_FIELD.
4185 * frame.h (FVAR): New macro.
4186 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
4187 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
4188 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
4189 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
4190 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4191
c09bfb2f
DA
41922012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4193
4194 Miscellaneous fixes for non-default X toolkits.
4195 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
4196 * xterm.c (x_frame_of_widget): Remove redundant prototype.
4197 Move under #ifdef USE_LUCID.
4198 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
4199 definition and usage to avoid warnings.
4200
14c114ae
JD
42012012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4202
4203 * nsterm.m (openFiles): Fix previous checkin.
4204
3bd21e82
PE
42052012-07-31 Paul Eggert <eggert@cs.ucla.edu>
4206
4207 * indent.c (compute_motion): Remove unused local.
4208
c1529ded
GM
42092012-07-31 Glenn Morris <rgm@gnu.org>
4210
400d5621
GM
4211 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
4212
268e2432
GM
4213 * conf_post.h [USG5_4]:
4214 Move remaining contents of s/usg5-4-common.h here.
4215 * s/usg5-4-common.h: Remove file.
4216
7552f3ee
GM
4217 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
4218 * s/irix6-5.h: Remove file.
4219
6a381852
GM
4220 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
4221 * s/darwin.h: Remove file.
4222
c1529ded
GM
4223 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
4224 * s/hpux10-20.h: Remove file, which is now empty.
4225
b429a4ee
GM
42262012-07-30 Glenn Morris <rgm@gnu.org>
4227
4228 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
4229 * Makefile.in (config_h): Add conf_post.h.
4230 * makefile.w32-in (CONFIG_H): Add conf_post.h.
4231
adff3182
JD
42322012-07-30 Jan Djärv <jan.h.d@swipnet.se>
4233
4234 * nsterm.m (ns_do_open_file): New variable.
b9031d69 4235 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
4236 (openFile, openTempFile, openFileWithoutUI, openFiles):
4237 Open files only if ns_do_open_file.
adff3182 4238
c32af1e4
PE
42392012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4240
7393bcbb
PE
4241 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
4242 This no-op macro hasn't been needed for many years.
4243 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
4244
c32af1e4
PE
4245 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
4246 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
4247 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
4248 gdb_make_enums_visible.
4249 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
4250 (DIRECTORY_SEP): Now a constant, not a macro.
4251
302fc036
EZ
42522012-07-30 Eli Zaretskii <eliz@gnu.org>
4253
4254 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
4255 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
4256
4257 * w32term.c <w32_keyboard_codepage>: Renamed from
4258 keyboard_codepage and now external. All users changed.
4259
4260 * w32term.h: Add declaration of w32_keyboard_codepage.
4261
4262 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
4263 the codepage to translate keys to Unicode. If this argument is
4264 -1, use the value returned by GetConsoleCP. All callers changed.
4265
88fb40b4
PE
42662012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4267
0aee6912
PE
4268 Update .PHONY listings in makefiles.
4269 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
4270 bootstrap-clean, distclean, maintainer-clean, versioclean,
4271 extraclean, frc.
4272
88fb40b4
PE
4273 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
4274 This is a bit clearer. Fix some commentary typos.
4275
0a763bd1
GM
42762012-07-30 Glenn Morris <rgm@gnu.org>
4277
32bac6d6
GM
4278 * s/netbsd.h: Let configure include signal.h if needed.
4279 Remove file, which is now empty.
4280
b65e7c46
GM
4281 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
4282 Let configure set them.
4283 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
4284 No more need to undefine.
0a763bd1 4285
169304bd
AS
42862012-07-30 Andreas Schwab <schwab@linux-m68k.org>
4287
4288 * keymap.c (Fkey_description): Don't remove 0x80 bit from
4289 non-single-byte char when adding meta modifier. (Bug#12090)
4290
6cd7a139
DA
42912012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4292
4293 Convert safe_call to use variable number of arguments.
4294 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
4295 (safe_call2): Fix comment.
4296 * lisp.h (safe_call): Adjust prototype.
4297 * coding.c (encode_coding_object): Change to use safe_call2.
4298 * xfaces.c (merge_face_heights): Change to use safe_call1.
4299
d34d6ffc
GM
43002012-07-30 Glenn Morris <rgm@gnu.org>
4301
7b8a48e4 4302 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 4303 does that unconditionally. Remove file, which is now empty.
7b8a48e4 4304
d34d6ffc
GM
4305 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
4306 Remove empty files.
4307
03a660a6
PE
43082012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4309
4310 Export to GDB most of lisp.h's remaining object-like macros.
4311 * lisp.h (min, max): Move earlier, because they're used earlier now.
4312 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
4313 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
4314 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
4315 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
4316 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
4317 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
4318 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
4319 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
4320 Now constants, for GDB. They need not be macros.
4321 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
4322 Now constants, for GDB, as well as macros, for static initializers.
4323 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
4324 Move to after the definition of struct Lisp_Char_Table,
4325 since the former now needs that type defined.
4326 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
4327 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
4328 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
4329 New enums, for gdb_make_enums_visible.
4330 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 4331 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
4332 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
4333 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
4334 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
4335 enum maxargs, enum MAX_ALLOCA.
4336 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
4337 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
4338 no longer needed, now that they are done in lisp.h.
4339
e499d0ee
DA
43402012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4341
4342 Cleanup string bytes checking.
4343 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
4344 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
4345 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
4346 (check_sblock, compact_small_strings): Simplify.
4347
d5040d2d
PE
43482012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4349
4350 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
4351 These macros are confusing and no longer need to be defined, as
4352 the enum values now suffice. All uses replaced with definiens.
4353 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
4354
7f259ae6
JB
43552012-07-29 Juanma Barranquero <lekktu@gmail.com>
4356
4357 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
4358 ($(BLD)/w32console.$(O)): Update dependencies.
4359
7e63e0c3
DA
43602012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4361
4362 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
4363 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
4364 time. Adjust users.
4365 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
4366
ffd817eb
JD
43672012-07-29 Jan Djärv <jan.h.d@swipnet.se>
4368
4369 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
4370 setting sitelisp (Bug#12010).
4371
417a7a0e
EZ
43722012-07-29 Eli Zaretskii <eliz@gnu.org>
4373
14ae4239 4374 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
4375
4376 * w32heap.c (cache_system_info):
4377 * w32.c (sys_rename):
4378 * w32proc.c (find_child_console, sys_kill): All users changed.
4379
387d4d92
PE
43802012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4381
4382 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4383
55a6cca6
EZ
43842012-07-29 Eli Zaretskii <eliz@gnu.org>
4385
4386 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
4387
dbcf001c
DA
43882012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4389
4390 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
4391 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
4392 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 4393
e2688e4a
DA
43942012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4395
4396 Generalize marker debugging code under MARKER_DEBUG and use eassert.
4397 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
4398 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
4399 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
4400 (replace_range, replace_range_2, del_range_2): Change to eassert.
4401 * marker.c (byte_char_debug_check): Adjust style.
4402
b46a6a83
PE
44032012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4404
4405 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4406 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4407 long-ago-commented-out code that talks about "WIN32".
4408 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4409 All uses changed.
4410
e32a5799
PE
44112012-07-28 Paul Eggert <eggert@cs.ucla.edu>
4412
4413 Use Gnulib stdalign module (Bug#9772, Bug#9960).
4414 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4415 Simplify by using alignof.
4416 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4417 * lisp.h: Include <stdalign.h>.
4418 (GCALIGNMENT): New macro and constant.
4419 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
4420 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4421 (stdalign): New macro, if not already defined.
4422
df81cd29
EZ
44232012-07-28 Eli Zaretskii <eliz@gnu.org>
4424
01bd1b0d
EZ
4425 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
4426 * w32inevt.c: Include w32inevt.h.
4427 (w32_read_console_input): New inline function, calls either
4428 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4429 w32_console_unicode_input.
4430 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4431 (w32_kbd_patch_key, key_event): Use the codepage returned by
4432 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4433 (key_event): use uChar.UnicodeChar only if
4434 w32_console_unicode_input is non-zero.
4435
4436 * w32console.c: Include w32heap.h.
4437 <w32_console_unicode_input>: New global variable.
4438 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4439 family of Windows, zero otherwise.
4440
4441 * w32inevt.h: Declare w32_console_unicode_input.
4442
df81cd29
EZ
4443 * xdisp.c (init_iterator): Don't reference tip_frame in a build
4444 --without-x. (Bug#11742)
4445
c20fdd9e
PE
44462012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4447
4448 Adjust GDB to reflect pvec_type changes (Bug#12036).
4449 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
4450 2012-07-04 changes to pseudovector representation.
4451 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 4452
32770973 44532012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
4454
4455 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4456 bus address.
4457 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4458
3438fe21
EZ
44592012-07-27 Eli Zaretskii <eliz@gnu.org>
4460
bcfbc9de
EZ
4461 * alloc.c (listn): Fix the order the arguments are consed onto the
4462 list.
4463
3438fe21
EZ
4464 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4465 enumeration constants, as PURE and HEAP are too general, and clash
4466 with other headers and sources, such as gmalloc.c and the
4467 MS-Windows system headers. All users changed.
4468
eeaea515
DA
44692012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4470
4471 Revert last save_excursion_save and save_excursion_restore changes.
4472 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4473 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4474
073c88c2
DA
44752012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4476
4477 Fix recently-introduced typos in Windows port.
4478 Reported by Martin Rudalics <rudalics@gmx.at>.
4479 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 4480 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 4481
4706125e
PE
44822012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4483
4484 Improve GDB symbol export (Bug#12036).
4485 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4486 arms of an 'if', not using conditional expressions; otherwise GDB
4487 complains about the types in the unevaluated arm when the argument
4488 is an integer literal.
4489 (xgetint): Simplify expression.
4490 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4491 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4492 Zaretskii in <http://bugs.gnu.org/12036#13>.
4493 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4494 needed now that we have gdb_make_enums_visible.
4495 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4496 (enum enum_USE_LSB_TAG):
4497 New enum types, packaging up enums that need to be exported to GDB.
4498
694b6c97
DA
44992012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4500
4501 Utility function to make a list from specified amount of objects.
4502 * lisp.h (enum constype): New datatype.
4503 (listn): New prototype.
4504 * alloc.c (listn): New function.
4505 (Fmemory_use_count, syms_of_alloc): Use it.
4506 * buffer.c (syms_of_buffer): Likewise.
4507 * callint.c (syms_of_callint): Likewise.
4508 * charset.c (define_charset_internal): Likewise.
4509 * coding.c (syms_of_coding): Likewise.
4510 * keymap.c (syms_of_keymap): Likewise.
4511 * search.c (syms_of_search): Likewise.
4512 * syntax.c (syms_of_syntax): Likewise.
4513 * w32.c (init_environment): Likewise.
4514 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4515 * xdisp.c (syms_of_xdisp): Likewise.
4516 * xfns.c (syms_of_xfns): Likewise.
4517
6195f384
DA
45182012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4519
4520 Fast save_excursion_save and save_excursion_restore.
4521 * lisp.h (struct Lisp_Excursion): New data type.
4522 (PVEC_EXCURSION): New pseudovector type.
4523 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
4524 to deal with it. Adjust comments.
4525 (init_marker, attach_marker): New prototype.
4526 (unchain_marker): Adjust prototype.
4527 * marker.c (attach_marker): Change to global.
4528 (init_marker): New function.
4529 * alloc.c (Fmake_marker, build_marker): Use it.
4530 (build_marker): More easserts.
4531 (mark_object): Handle struct Lisp_Excursion.
4532 * editfns.c (save_excursion_save, save_excursion_restore):
4533 Reimplement to use struct Lisp_Excursion. Add comments.
4534
5eceb8fb
PE
45352012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4536
4537 Fix export of symbols to GDB (Bug#12036).
4538 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
4539 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
4540 emacs.c, as this is a more-suitable home. Had this been done earlier
4541 the fix for 12036 would have avoided some of the problems noted in
4542 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
4543 would have been more obvious.
562157c8
PE
4544 * emacs.c: Do not include <verify.h>; no longer needed.
4545 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
4546 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
4547 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4548 Remove; now done in lisp.h.
4549 * lisp.h (PUBLISH_TO_GDB): New macro.
4550 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
4551 (DATA_SEG_BITS): Use it.
4552 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
4553 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
4554 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
4555 not be usable in #if. This simplifies things.
4556
d6749401
JB
45572012-07-26 Juanma Barranquero <lekktu@gmail.com>
4558
4559 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
4560
1781b9e9
PE
45612012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4562
d89518db 4563 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
4564 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
4565 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
4566 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
4567 Adjust to changes in lisp.h and emacs.c, by using
4568 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
4569 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
4570 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
4571 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
4572 instead of gdb_valbits.
4573 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
4574 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
4575 instead of gdb_array_mark_flag.
4576 (xboolvector): Get size from $->size, not $->header.size.
4577 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
4578 (xreload, hook-run, hookpost-run): Remove.
4579 * emacs.c: Include <verify.h>.
4580 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
4581 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
4582 Remove.
4583 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
4584 (gdb_USE_LSB_TAG): New enum constants.
4585 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4586 Also define these as enum constants, so they're visible to GDB.
4587 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4588 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4589 as constants, so they're visible to GDB.
4590 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4591 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4592 Now enum constants, not macros, so they're visible to GDB.
4593 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4594 more convenient now. All uses changed.
4595 (VALMASK) [USE_LSB_TAG]: Also define in this case.
4596 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4597
3628596a
DA
45982012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
4599
4600 Explicitly free restriction data that are not needed anymore.
4601 * editfns.c (save_restriction_restore): Free restriction data.
4602
7abaf5cc
SM
46032012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
4604
4605 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4606 add argument, tune behavior, and adjust all callers.
4607
71f88e00
PE
46082012-07-25 Paul Eggert <eggert@cs.ucla.edu>
4609
4610 Use typedef for EMACS_INT, EMACS_UINT.
4611 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4612 than macros. This simplifies debugging in the usual case, since
4613 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4614 and it allows expressions involving EMACS_INT casts.
4615 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4616
57ec3034
JD
46172012-07-25 Jan Djärv <jan.h.d@swipnet.se>
4618
4619 * nsterm.m (ns_read_socket): Return early if there is a modal
4620 window (Bug#12043).
4621
8137e7b3
MR
46222012-07-25 Martin Rudalics <rudalics@gmx.at>
4623
4624 * frame.c (Fredirect_frame_focus): In doc-string don't mention
4625 that FOCUS-FRAME can be omitted.
4626
04e9897c
DA
46272012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
4628
4629 Adjust buffer text indirection counters at the end of Fkill_buffer.
4630 * buffer.c (Fkill_buffer): Adjust indirection counters when the
4631 buffer is definitely dead. This should really fix an issue reported
4632 by Christoph Scholtes again. (Bug#12007).
4633 (init_buffer_once): Initialize indirection counters of
4634 buffer_defaults and buffer_local_symbols (for sanity and safety).
4635
8a0484e1
EZ
46362012-07-24 Eli Zaretskii <eliz@gnu.org>
4637
4638 * xdisp.c (init_iterator): Don't compute dimensions of truncation
4639 and continuation glyphs on tooltip frames, leave them at zero.
4640 Avoids continued lines in tooltips. (Bug#11832)
4641
fa691a83
DA
46422012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
4643
4644 Simplify copy_overlay.
04e9897c 4645 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
4646 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4647
436bc8e0
EZ
46482012-07-23 Eli Zaretskii <eliz@gnu.org>
4649
4650 * print.c (print_object): Don't crash when a frame's name is nil
4651 or invalid. (Bug#12025)
4652
4653 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4654 it signals an error when a tooltip frame is being created.
4655
d7a7fda3
DA
46562012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4657
4658 Cleanup miscellaneous objects allocation and initialization.
4659 * alloc.c (allocate_misc): Change to static. Add argument to
4660 specify the subtype. Adjust comment and users.
4661 (build_overlay): New function.
4662 * buffer.c (copy_overlays, Fmake_overlay): Use it.
4663 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4664 (allocate_misc): Remove prototype.
4665 (build_overlay): Add prototype.
4666
46672012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
4668
4669 Swap buffer text indirection counters in Fbuffer_swap_text.
4670 * buffer.c (Fbuffer_swap_text): Swap indirections too.
4671 This avoids crash reported by Christoph Scholtes at
4672 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4673
9d7fa573
JD
46742012-07-22 Jan Djärv <jan.h.d@swipnet.se>
4675
4676 * nsmenu.m (Popdown_data): New struct.
4677 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
4678 free Popdown_data.
4679 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
4680 (initWithContentRect): Make imgView and contentView non-static
4681 and autorelease them. Also autorelease img and matrix (Bug#12005).
4682 (dealloc): Remove (Bug#12005).
4683
0dd6d66d
DA
46842012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4685
4686 Adjust consing_since_gc when objects are explicitly freed.
4687 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
4688 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
4689 (free_cons, free_misc): Subtract object size from consing_since_gc.
4690
d36d71df
DA
46912012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4692
4693 Simplify and cleanup markers positioning code.
4694 * marker.c (attach_marker): More useful eassert.
4695 (live_buffer, set_marker_internal): New function.
4696 (Fset_marker, set_marker_restricted): Use set_marker_internal.
4697 (set_marker_both, set_marker_restricted_both): Use live_buffer.
4698
fb9ea40f
PE
46992012-07-22 Paul Eggert <eggert@cs.ucla.edu>
4700
4701 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
4702 as it's limited by the amount of memory, not by INT_MAX.
4703
2d5c5f7d
EZ
47042012-07-21 Eli Zaretskii <eliz@gnu.org>
4705
07fb592e
EZ
4706 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
4707 in special-event-map. See the discussion at
4708 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4709 for the reasons.
4710
37a9eac8 4711 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
4712 info.dwItemData. Fixes crashes on 64-bit Windows.
4713 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 4714
c4328746
JD
47152012-07-21 Jan Djärv <jan.h.d@swipnet.se>
4716
fc0c31f8 4717 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 4718 (conversationIdentifier): Return value is NSInteger.
784051c4 4719 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 4720
6e5d1c12
CY
47212012-07-21 Chong Yidong <cyd@gnu.org>
4722
4723 * window.c (decode_any_window): Signal an error if the window is
4724 on a dead frame (Bug#11984).
4725
9928463d
DA
47262012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4727
4728 Add indirection counting to speed up Fkill_buffer.
4729 * buffer.h (struct buffer): New member.
4730 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4731 (Fmake_indirect_buffer): Set indirection counter to -1, increment
4732 base buffer indirection counter.
4733 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4734 (Fkill_buffer): Adjust indirection counters as needed, don't walk
4735 through buffer list if indirection counter is 0.
4736
f8643a6b
DA
47372012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4738
4739 Extend the value returned by Fgarbage_collect with heap statistics.
4740 * alloc.c (Qheap): New symbol.
4741 (syms_of_alloc): DEFSYM it.
4742 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4743 (Fmemory_free): Remove.
4744 (syms_of_alloc): Don't defsubr it.
4745 * buffer.c (Fcompact_buffer): Remove.
4746 (syms_of_buffer): Don't defsubr it.
4747
dac616ff
DA
47482012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4749
4750 Make maybe_gc inline.
4751 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4752 * lisp.h (consing_since_gc, gc_relative_threshold)
4753 (memory_full_cons_threshold): Revert declaration.
4754 (maybe_gc): Remove prototype, define as inline.
4755 * alloc.c: Remove old commented-out code.
4756 (consing_since_gc, gc_relative_threshold)
4757 (memory_full_cons_threshold): Revert to global.
4758 (maybe_gc): Remove.
4759
d7ea76b4
DA
47602012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4761
4762 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4763 * lisp.h (build_unibyte_string): New function.
4764 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4765 * sysdep.c, w32fns.c, xfns.c: Use it.
4766 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4767 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4768 Adjust users accordingly.
4769 * font.h (font_open_by_name): Adjust prototype.
4770
765e61e3
DA
47712012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4772
4773 Cleanup calls to Fgarbage_collect.
4774 * lisp.h (maybe_gc): New prototype.
4775 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4776 Remove declarations.
4777 * alloc.c (maybe_gc): New function.
4778 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4779 Make them static.
4780 * bytecode.c (MAYBE_GC): Use maybe_gc.
4781 * eval.c (eval_sub, Ffuncall): Likewise.
4782 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4783 to avoid dependency from auto-save feature.
4784
52b852c7
PE
47852012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4786
4787 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4788 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4789 'for_each_per_buffer_object_at'.
4790 All uses changed. It's better to use upper-case for macros that
4791 cannot be implemented as functions, to give the reader a clue
4792 that they're special.
4793
5db81e33
SM
47942012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4795
4796 * alloc.c (Fgarbage_collect): Tweak docstring.
4797
5b835e1d
DA
47982012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4799
4800 Tweak the value returned from Fgarbage_collect again.
4801 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4802 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4803 Adjust documentation.
4804 (total_vector_bytes): Rename to total_vector_slots, adjust
4805 accounting.
4806 (total_free_vector_bytes): Rename to total_free_vector_slots,
4807 adjust accounting.
4808 (Qstring_bytes, Qvector_slots): New symbols.
4809 (syms_of_alloc): DEFSYM them.
4810
9cd47b72
DA
48112012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4812
4813 Buffer compaction primitive which may be used from Lisp.
4814 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4815 (syms_of_buffer): Register Fcompact_buffer.
4816 * alloc.c (Fgarbage_collect): Use compact_buffer.
4817 * buffer.h (compact_buffer): New prototype.
4818 (struct buffer_text): New member.
4819
d17337e5
DA
48202012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4821
4822 New macro to iterate over all buffers, miscellaneous cleanups.
4823 * lisp.h (all_buffers): Remove declaration.
4824 * buffer.h (all_buffers): Add declaration, with comment.
4825 (for_each_buffer): New macro.
4826 * alloc.c (Fgarbage_collect, mark_object): Use it.
4827 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4828 (init_buffer): Likewise.
4829 * data.c (Fset_default): Likewise.
4830 * coding.c (code_conversion_restore): Remove redundant check
4831 for dead buffer.
4832 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4833
60cfd278
AS
48342012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4835
4836 Fix bug that created negative-length intervals.
4837 * intervals.c (merge_interval_right, merge_interval_left):
4838 Do not zero out this interval if it is absorbed by its children,
4839 as this interval's total length doesn't change in that case. See
4840 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4841
d06714cb
PE
48422012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4843
83713154
PE
4844 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4845 when invoking (make-bool-vector N t) and N is a positive
4846 multiple of 8 -- the last 8 bits were mistakenly cleared.
4847
d06714cb
PE
4848 Remove some struct layout assumptions in bool vectors.
4849 * alloc.c (bool_header_size): New constant.
4850 (header_size, word_size): Move earlier, as they're now used earlier.
4851 Use 'word_size' in a few more places, where it's appropriate.
4852 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4853 padding before the data member of a bool vector.
4854 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4855 than doing the check by hand with an abort ().
4856
464d5a5e
SM
48572012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4858
5fbc0409
SM
4859 * eval.c (Fdefvar): Don't check constants since we only set the var if
4860 it's not yet defined anyway (bug#11904).
4861
464d5a5e
SM
4862 * lisp.h (last_undo_boundary): Declare new var.
4863 * keyboard.c (command_loop_1): Set it.
4864 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4865 were auto-added by the command loop (bug#11774).
4866
8dc2e44a
AS
48672012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4868
4869 * w32font.c (Qsymbol): Remove local definition.
4870 (syms_of_w32font): Don't DEFSYM it.
4871
169925ec
DA
48722012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4873
4874 Fix sweep_vectors to handle large bool vectors correctly.
4875 * alloc.c (sweep_vectors): Account total_vector_bytes for
4876 bool vectors larger than VBLOCK_BYTES_MAX.
4877
5fbfb018
CY
48782012-07-18 Chong Yidong <cyd@gnu.org>
4879
4880 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4881 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4882
3ab6e069
DA
48832012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4884
4885 Return more descriptive data from Fgarbage_collect.
4886 Suggested by Stefan Monnier in
4887 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4888 * alloc.c (bounded_number): New function.
4889 (total_buffers, total_vectors): New variable.
4890 (total_string_size): Rename to total_string_bytes, adjust users.
4891 (total_vector_size): Rename to total_vector_bytes, adjust users.
4892 (sweep_vectors): Account total_vectors and total_vector_bytes.
4893 (Fgarbage_collect): New return value. Adjust documentation.
4894 (gc_sweep): Account total_buffers.
4895 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4896 (VECTOR_SIZE): Remove.
4897 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4898 (Qinterval, Qmisc): New symbols.
4899 (syms_of_data): Initialize them.
4900 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4901 (Qcons, Qbuffer): New declarations.
4902
6d02fe5b
PE
49032012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4904
4905 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4906 Round up, not down. Improve doc.
4907
b7ffe040
DA
49082012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4909
4910 Restore old code in allocate_string_data to avoid Faset breakage.
4911 Reported by Julien Danjou <julien@danjou.info> in
4912 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4913 * alloc.c (allocate_string_data): Restore old code with minor
4914 adjustments, fix comment to explain this subtle issue.
4915
4dc7c8d5
SM
49162012-07-17 Eli Zaretskii <eliz@gnu.org>
4917
4918 Remove FILE_SYSTEM_CASE.
4919 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4920
4921 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4922 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4923 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4924 call-process-region passes it through expand-file-name.
4925
4926 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4927
49282012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4929
4930 Fix crash when creating indirect buffer (Bug#11917)
4931 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4932 Don't handle unbound variables specially if non-zero.
4933 (Fbuffer_local_variables): Pass zero.
4934 (clone_per_buffer_values): Pass non-zero.
4935
49362012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4937
4938 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4939 to make the loop interruptible.
4940
49412012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4942
4943 * gnutls.c (emacs_gnutls_handshake): Only retry if
4944 GNUTLS_E_INTERRUPTED.
4945
cce7fefc
DA
49462012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4947
4948 Cleanup and convert miscellaneous checks to eassert.
4949 * alloc.c (mark_interval): Fix comment, partially rephrase
4950 old comment from intervals.h (see below).
4951 * intervals.c (find_interval, adjust_intervals_for_insertion)
4952 (delete_interval, adjust_intervals_for_deletion)
4953 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4954 Convert to eassert.
4955 (adjust_intervals_for_insertion, make_new_interval):
4956 Remove obsolete and unused code.
4957 * intervals.h (struct interval): Remove obsolete comment.
4958 * textprotp.c (erase_properties): Remove unused code.
4959 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4960 (Fremove_list_of_text_properties): Convert to eassert.
4961
9ea10cc3
CY
49622012-07-17 Chong Yidong <cyd@gnu.org>
4963
4964 * editfns.c (Finsert_char): Doc fix.
4965
3900d5de
DA
49662012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4967
4968 Fix previous change to make Fmemory_free always accurate.
4969 * alloc.c (make_interval): Update total_free_intervals.
4970 (make_float): Likewise for total_free_floats.
4971 (free_cons, Fcons): Likewise for total_free_conses.
4972 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4973 Likewise for total_free_vector_bytes.
4974 (Fmake_symbol): Likewise for total_free_symbols.
4975 (bytes_free): Remove.
4976
7098646f
DA
49772012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4978
4979 Simple free memory accounting feature.
4980 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4981 (sweep_vectors): Accumulate size of free vectors.
4982 (Fgarbage_collect): Setup bytes_free.
4983 (Fmemory_free): New function.
4984 (syms_of_alloc): Register it.
4985
22657b40
DA
49862012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4987
4988 Cleanup overlays checking.
4989 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4990 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4991 eassert and OVERLAYP.
4992 (sort_overlays): Change to use OVERLAYP.
4993
ddfc8813
RK
49942012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4995
4996 * editfns.c (Finsert_char): Make it interactive, and make the
4997 second arg optional. Copy interactive spec and docstring from
4998 ucs-insert.
4999
7c26cf3c
PE
50002012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5001
5002 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5003 Unlike the other wrapped functions, fabs has an unspecified
5004 effect on errno.
5005
5d127af9
JD
50062012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5007
5008 * nsterm.m (keyDown): Interpret flags without left/right bits
5009 as the left key (Bug#11670).
5010
6a0dd1d7
DA
50112012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5012
5013 Remove empty and useless init functions.
5014 * lisp.h (init_character_once, init_fns, init_image)
5015 (init_filelock, init_sound): Remove prototype.
5016 * character.c (init_character_once): Remove.
5017 * filelock.c (init_filelock): Likewise.
5018 * fns.c (init_fns): Likewise.
5019 * image.c (init_image): Likewise.
5020 * sound.c (init_sound): Likewise.
5021 * emacs.c (main): Adjust accordingly.
5022
7a6136fd
DA
50232012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5024
5025 * gtkutil.h: Tiny cleanups.
5026 (use_old_gtk_file_dialog): Remove useless declaration.
5027 (xg_uses_old_file_dialog): Add suggested const attribute.
5028
ce811ad9
EZ
50292012-07-15 Eli Zaretskii <eliz@gnu.org>
5030
5031 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5032 (bidi_paragraph_init): Use it to limit search forward for a strong
5033 directional character in abnormally large paragraphs full of
5034 neutral or weak characters. (Bug#11943)
5035
c9adfeaa
SF
50362012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5037
5038 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5039 the toolbar (Bug#9451).
5040 (xg_make_tool_item): Give the widget event box a transparent
5041 background.
5042
fff62aa9
DA
50432012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5044
5045 Cleanup basic allocation variables and functions.
5046 * alloc.c (ignore_warnings, init_intervals, init_float)
5047 (init_cons, init_symbol, init_marker): Remove.
5048 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5049 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5050 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5051 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5052 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5053 (staticidx, init_alloc_once, init_strings, free_ablock):
5054 Remove redundant initialization.
5055 * fns.c (init_weak_hash_tables): Remove.
5056 * lisp.h (init_weak_hash_tables): Remove prototype.
5057
9730daca
DA
50582012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5059
5060 Use zero_vector where appropriate.
5061 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5062 accordingly.
5063 * lisp.h (zero_vector): New declaration.
5064 * font.c (null_vector): Remove.
5065 (syms_of_font): Remove initialization and staticpro.
5066 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5067 * keymap.c (Faccessible_keymaps): Likewise.
5068
2e2d2a13
LL
50692012-07-15 Leo Liu <sdl.web@gmail.com>
5070
5071 * fringe.c: Fix typo in comments.
5072
cd276f6e
LL
50732012-07-14 Leo Liu <sdl.web@gmail.com>
5074
5075 * fringe.c: Add a new bitmap exclamation-mark.
5076
5a1131d9
EZ
50772012-07-14 Eli Zaretskii <eliz@gnu.org>
5078
5079 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5080
5081 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5082 (HAVE_MENUS): Don't define, defined by editing config.in with
5083 msdos/sed2v2.inp.
5084 (GMALLOC_INHIBIT_VALLOC): Don't define.
5085 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5086
22e983b7
JB
50872012-07-14 Juanma Barranquero <lekktu@gmail.com>
5088
5089 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5090
5b3f250f
GM
50912012-07-14 Glenn Morris <rgm@gnu.org>
5092
5093 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5094 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5095 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5096
33d63ff4
GM
50972012-07-13 Glenn Morris <rgm@gnu.org>
5098
5b633342
GM
5099 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5100
33d63ff4
GM
5101 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5102 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5103
b55b9f85
JD
51042012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5105
0dc8cf50
JD
5106 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5107 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5108 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5109 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5110 where appropriate.
5111 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5112 as boolean expression.
5113 (x_set_window_size): Remove unused variable toolbar.
5114 (ns_get_color_default, ns_mod_to_lisp): Remove.
5115 (ns_mouse_position): Remove unused variables xchar and ychar.
5116 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5117 (ns_set_vertical_scroll_bar): Remove unused variable count.
5118 (ns_delete_terminal): Remove unused variable i.
5119 (ns_term_init): Remove unused variables r, g and b.
5120 (mouseDown): Remove unused variable window.
5121 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5122 (initFrameFromEmacs): Remove unused variable vbextra.
5123 (mouseEntered): Remove unused variables p and dpyinfo.
5124 (mouseExited): Remove unused variables p and r.
5125 (ns_define_frame_cursor, ns_clear_frame_area)
5126 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5127 (menuDown): Assign [sender tag] to variable and cast the variable.
5128
5129 * nsterm.h (menuDown): Add id as type to argument sender.
5130 (ns_display_info_for_name): Add Lisp_Object argument.
5131 (ns_term_init): Add Lisp_Object argument.
5132 (ns_map_event_to_object): Add void argument.
5133 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5134 prototype with arguments and only declare if __OBJC__.
5135 (nxatoms_of_nsselect): Add void argument.
5136 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5137 (ns_alloc_autorelease_pool): Add void argument.
5138 (ns_release_autorelease_pool): Add void* argument.
5139 (ns_get_defaults_value): Add const char* argument.
5140
5141 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5142 (initFromContents): Use SSDATA where appropriate.
5143 (ns_update_menubar): Add braces to ambigous if-else.
5144 (initWithTitle): Put () around assignment in if statement.
5145 (ns_menu_show): Remove unused variables window and keymap.
5146 (update_frame_tool_bar): Remove unused variable selected_p.
5147 (initWithContentRect): Remove unused variable this_cmd_name.
5148
5149 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5150 appropriate.
5151 (setXBMColor): Remove unused variable len.
5152 (setPixmapData): Put () around assignment in loop statement.
5153
5154 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5155 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5156 where appropriate.
5157 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5158 around assignment in loop statement.
5159 (nsfont_open): Remove unused variable i.
5160 (nsfont_open): Remove unused variable len.
5161 (nsfont_draw): Remove unused variable cs.
5162
5163 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5164 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5165 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5166 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5167 (Fns_font_name, Fns_perform_service)
5168 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5169 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5170 (ns_set_name): Remove unused variable view.
5171 (x_set_menu_bar_lines): Remove unused variable olines.
5172 (x_set_tool_bar_lines): Remove unused variable root_window.
5173 (Fns_list_colors): Put () around assignment in while statement.
5174 (Fns_perform_service): Remove unused variable len.
5175 (Fns_display_usable_bounds): Remove unused variable top.
5176 (syms_of_nsfns): Remove unused variable i.
5177
b55b9f85
JD
5178 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5179 memcpy (Bug#11907).
5180
ed9265fc 51812012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
5182
5183 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
5184 and free it with DestroyExceptionInfo (Bug#11558).
5185
ef099b57
JB
51862012-07-13 Juanma Barranquero <lekktu@gmail.com>
5187
5188 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
5189 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5190 Set here, not in nt/config.nt.
5191
ea814a5d
EZ
51922012-07-13 Eli Zaretskii <eliz@gnu.org>
5193
5194 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
5195 cursor overflow into the last glyph on display line when the right
5196 fringe is off. (Bug#11832)
5197
1a952767
PE
51982012-07-13 Paul Eggert <eggert@cs.ucla.edu>
5199
5200 * xdisp.c (produce_special_glyphs): Now static.
5201 * dispextern.h (produce_special_glyphs): Remove decl.
5202
983188fd
GM
52032012-07-13 Glenn Morris <rgm@gnu.org>
5204
8d7c7eed 5205 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
5206 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5207
983188fd
GM
5208 * s/usg5-4-common.h (USG, USG5):
5209 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
5210 * s/sol2-6.h (SOLARIS2):
5211 * s/irix6-5.h (IRIX6_5):
5212 * s/hpux10-20.h (USG, USG5, HPUX):
5213 * s/gnu-linux.h (USG, GNU_LINUX):
5214 * s/freebsd.h (BSD_SYSTEM):
5215 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
5216 * s/cygwin.h (CYGWIN):
5217 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
5218 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
5219
d1e68667 52202012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
5221
5222 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 5223
6de0e799
GM
52242012-07-13 Glenn Morris <rgm@gnu.org>
5225
739ae010
GM
5226 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
5227
dbee5793
GM
5228 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
5229
6de0e799
GM
5230 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
5231 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
5232
b82da769
GM
52332012-07-12 Glenn Morris <rgm@gnu.org>
5234
4fae5a7a 5235 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
5236
5237 * process.c (init_process_emacs): Rename from init_process.
5238 The old name is also the name of a Mach system call.
5239 * lisp.h, emacs.c: Update for this name change.
5240 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
5241 longer needed.
5242
5a979817
EZ
52432012-07-12 Eli Zaretskii <eliz@gnu.org>
5244
5245 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
5246 memmove call that removes glyphs covered by the left truncation
5247 glyph. Improve commentary.
5248 (display_line): Fix display of continuation glyphs on GUI frames
5249 when the right fringe is turned off and variable-size fonts are
5250 used in the window. Move the code that appends a stretch glyph to
5251 produce_special_glyphs, so that it could be used for truncation
5252 and continuation glyphs alike.
5253 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
5254 glyph of a suitably computed width, to align the special glyphs at
5255 the window margin. Code moved from display_line. (Bug#11832)
5256
3e91a053
GM
52572012-07-12 Glenn Morris <rgm@gnu.org>
5258
ba9e4b84
GM
5259 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
5260
5261 * s/gnu-linux.h, s/hpux10-20.h:
5262 Do not unconditionally define HAVE_XRMSETDATABASE.
5263
3e91a053
GM
5264 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
5265
b300b1f4
PE
52662012-07-12 Paul Eggert <eggert@cs.ucla.edu>
5267
5268 Fix typos that broke OS X build.
5269 Reported by Randal L. Schwartz in
5270 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
5271 * nsterm.m (ns_timeout): Add missing local decl.
5272 (ns_get_color): snprintf -> sprintf, to fix typo.
5273
6e777848
GM
52742012-07-12 Glenn Morris <rgm@gnu.org>
5275
3f922c37
GM
5276 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
5277 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
5278 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
5279 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
5280
0ab7b23a
GM
5281 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
5282 Move PTY_OPEN to configure.
5283
6e777848
GM
5284 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5285 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
5286 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
5287
4a7edc24
DA
52882012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
5289
5290 Use empty_unibyte_string where applicable.
5291 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
5292 * lread.c (read1): Likewise.
5293 * xsettings.c (syms_of_xsettings): Likewise.
5294
308aab79
GM
52952012-07-12 Glenn Morris <rgm@gnu.org>
5296
42bd1719
GM
5297 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
5298 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
5299 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
5300 * s/hpux10-20.h (RUN_TIME_REMAP):
5301 * s/bsd-common.h (TABDLY): Move to configure.
5302
5303 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
5304
5305 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
5306
ea0bbd17 5307 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 5308 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
5309
5310 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 5311
308aab79
GM
5312 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
5313 * s/template.h: Move NARROWPROTO to configure.
5314
ee1cf5cf
GM
53152012-07-11 Glenn Morris <rgm@gnu.org>
5316
30fe9bf4
GM
5317 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
5318 unused since 2011-01-17 change to systty.h.
5319
ee1cf5cf
GM
5320 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
5321 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5322 Move HAVE_PTYS and HAVE_SOCKETS to configure.
5323
63e47e07
PE
53242012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5325
5326 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
5327
c43fb4c3
GM
53282012-07-11 Glenn Morris <rgm@gnu.org>
5329
5330 * s/darwin.h, s/gnu-linux.h, s/template.h:
5331 Move INTERRUPT_INPUT to configure.
5332
e8df9267
DA
53332012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5334
5335 Minor adjustments to interning code.
5336 * lisp.h (intern, intern_c_string): Redefine as static inline
5337 wrappers for intern_1 and intern_c_string_1, respectively.
5338 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
5339 * lread.c (intern_1, intern_c_string_1, oblookup):
5340 Simplify Vobarray checking.
e8df9267
DA
5341 * font.c (font_intern_prop): Likewise. Adjust comment.
5342 * w32font.c (intern_font_name): Likewise.
5343
34348bd4
AS
53442012-07-11 Andreas Schwab <schwab@linux-m68k.org>
5345
d96a1e0c
AS
5346 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
5347
34348bd4
AS
5348 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
5349 of Fcar/Fcdr if possible.
5350 * font.c (check_otf_features): Likewise.
5351 * fontset.c (Fnew_fontset): Likewise.
5352 * gnutls.c (Fgnutls_boot): Likewise.
5353 * minibuf.c (read_minibuf): Likewise.
5354 * msdos.c (IT_set_frame_parameters): Likewise.
5355 * xmenu.c (Fx_popup_dialog): Likewise.
5356 * w32menu.c (Fx_popup_dialog): Likewise.
5357
c8add24e
GM
53582012-07-11 Glenn Morris <rgm@gnu.org>
5359
4b575b3c
GM
5360 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
5361 since nothing has defined it on these platforms.
5362
09f4e3b0
GM
5363 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
5364 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
5365
172bedef
GM
5366 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5367 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5368 Move CLASH_DETECTION to configure.
5369
249685df
GM
5370 * s/gnu.h: Remove file, which is now empty.
5371
c8add24e
GM
5372 * s/gnu.h, s/gnu-linux.h:
5373 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
5374
b41253a3
JW
53752012-07-11 John Wiegley <johnw@newartisans.com>
5376
5377 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
5378 function attribute, so we only use it if it exists in the
5379 compiler.
5380
d923b542
DA
53812012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5382
5383 Avoid call to strlen in fast_c_string_match_ignore_case.
5384 * search.c (fast_c_string_match_ignore_case): Change to use
5385 length argument. Adjust users accordingly.
5386 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
5387
5ebbef1d
PE
53882012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5389
bb352260
PE
5390 Assume mkdir, rmdir.
5391 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
5392 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
5393
57054ddd
PE
5394 Assume rename.
5395 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
5396
b747d3f7
PE
5397 Assume perror.
5398 * s/hpux10-20.h (HAVE_PERROR): Remove.
5399 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
5400 Remove dummy definition, as this problem was obsolete long ago.
5401
5ebbef1d
PE
5402 Assume strerror.
5403 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5404
984e7f30
DA
54052012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5406
5407 Avoid calls to strlen in font processing functions.
5408 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
5409 (font_open_by_name): Change to use length argument.
5410 Adjust users accordingly.
d923b542
DA
5411 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5412 Adjust prototypes.
5413 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5414 Change to return ptrdiff_t.
984e7f30
DA
5415 (xfont_list_pattern, xfont_match): Use length returned by
5416 xfont_decode_coding_xlfd.
5417 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5418
20e94fdd
GM
54192012-07-11 Glenn Morris <rgm@gnu.org>
5420
9d596af3
GM
5421 * s/darwin.h, s/freebsd.h, s/netbsd.h:
5422 Move DONT_REOPEN_PTY to configure.
5423
20e94fdd
GM
5424 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5425 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5426
e99a530f
PE
54272012-07-10 Paul Eggert <eggert@cs.ucla.edu>
5428
22ffb973
PE
5429 Remove "#define unix" that is no longer needed (Bug#11905).
5430 * s/aix4-2.h (unix): Remove; no longer needed.
5431
e9a9ae03
PE
5432 EMACS_TIME simplification (Bug#11875).
5433 This replaces macros (which typically do not work in GDB)
5434 with functions, typedefs and enums, making the code easier to debug.
5435 The functional style also makes code easier to read and maintain.
5436 * systime.h: Include <sys/time.h> on all hosts, not just if
5437 WINDOWSNT, since 'struct timeval' is needed in general.
5438 (EMACS_TIME): Now a typedef, not a macro.
5439 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5440 not macros.
5441 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
5442 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
5443 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
5444 (EMACS_TIME_LE): Now functions, not macros.
5445 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
5446 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
5447 which are not functions. All uses rewritten to use:
5448 (make_emacs_time): New function.
5449 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5450 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5451 not functions. All uses rewritten to use the following, respectively:
5452 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5453 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 5454 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
5455 * fileio.c (Fcopy_file):
5456 * xterm.c (XTflash): Get the current time closer to when it's used.
5457 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5458
ffacb126
PE
5459 * bytecode.c (targets): Suppress -Woverride-init warnings.
5460
e99a530f
PE
5461 Simplify by avoiding confusing use of strncpy etc.
5462 * doc.c (Fsnarf_documentation):
5463 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5464 * frame.c (Fmake_terminal_frame):
5465 * gtkutil.c (get_utf8_string):
5466 * lread.c (openp):
5467 * nsmenu.m (ns_update_menubar):
5468 * regex.c (regerror):
5469 Prefer memcpy to strncpy and strncat when either will do.
5470 * fileio.c (Fsubstitute_in_file_name):
5471 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5472 (menu_separator_name_p):
5473 * nsmenu.m (ns_update_menubar):
5474 Prefer memcmp to strncmp when either will do.
5475 * nsterm.m: Include <ftoastr.h>.
5476 (ns_get_color):
5477 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5478 Prefer snprintf to strncpy.
5479 * nsterm.m (ns_term_init):
5480 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5481 * nsterm.m (ns_term_init):
5482 Avoid the need for strncpy, by using build_string or
5483 make_unibyte_string directly. Use dtoastr, not snprintf.
5484 * process.c (Fmake_network_process): Diagnose service names that
5485 are too long, rather than silently truncating them or creating
5486 non-null-terminated names.
5487 (Fnetwork_interface_info): Likewise, for interface names.
5488 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5489 Prefer sprintf to strncat.
5490 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5491 Prefer vsnprintf to vsprintf + strncpy.
5492
c59592b3
GM
54932012-07-10 Glenn Morris <rgm@gnu.org>
5494
5495 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5496 Clarify fallback case.
5497
7d7bbefd
DA
54982012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5499
5500 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5501 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5502 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 5503 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
5504 where argument type is known to be a Lisp_Cons.
5505
3a4c8000
TT
55062012-07-10 Tom Tromey <tromey@redhat.com>
5507
5508 * bytecode.c (BYTE_CODE_THREADED): New macro.
5509 (BYTE_CODES): New macro. Replaces all old byte-code defines.
5510 (enum byte_code_op): New type.
5511 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5512 (exec_byte_code): Use them. Use token threading when applicable.
5513
2a0213a6
DA
55142012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5515
5516 Optimize pure C strings initialization.
5517 * lisp.h (make_pure_string): Fix prototype.
5518 (build_pure_c_string): New function, defined as static inline. This
5519 provides a better opportunity to optimize away calls to strlen when
5520 the function is called with compile-time constant argument.
5521 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
5522 argument, adjust users accordingly. Use build_pure_c_string where
5523 appropriate.
5524 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
5525 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
5526 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
5527
cb1caeaf
DA
55282012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5529
5530 Avoid calls to strlen in miscellaneous functions.
5531 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
5532 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
5533 * lread.c (openp): Likewise.
5534
c293e30c
DA
55352012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5536
5537 Avoid calls to strlen in path processing functions.
5538 * fileio.c (file_name_as_directory): Add comment. Change to add
5539 srclen argument and return the length of result. Adjust users
5540 accordingly.
5541 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
5542 swap 1st and 2nd arguments to obey the common convention.
5543 Adjust users accordingly.
c293e30c
DA
5544 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
5545
9e059e3f
GM
55462012-07-10 Glenn Morris <rgm@gnu.org>
5547
d02eb359
GM
5548 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
5549 Move PENDING_OUTPUT_COUNT definition to configure.
5550
882cf227
GM
5551 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
5552 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
5553 * s/gnu.h (DATA_START): Move definitions to configure.
5554
af6e839f
GM
5555 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
5556 We include usg5-4-common.h, which defines them both.
5557
40289a12
GM
5558 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
5559 O_RDONLY already includes it).
5560
9e059e3f
GM
5561 Stop ns builds setting the EMACSLOADPATH environment variable.
5562 * nsterm.m (ns_load_path): Rename from ns_init_paths.
5563 Now it does not set EMACSLOADPATH, just returns the load-path string.
5564 * nsterm.h: Update accordingly.
5565 * lread.c [HAVE_NS]: Include nsterm.h.
5566 (init_lread) [HAVE_NS]: Use ns_load_path.
5567 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
5568
7c4e8ec0
GM
55692012-07-09 Glenn Morris <rgm@gnu.org>
5570
d4f600ff
GM
5571 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
5572 since the included bsd-common.h does so.
5573
cbb31951
GM
5574 Stop ns builds setting the EMACSPATH environment variable.
5575 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
5576 (ns_init_paths): Do not set EMACSPATH.
5577 * nsterm.h (ns_exec_path): Add it.
5578 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
5579 Use ns_exec_path.
5580
7c4e8ec0
GM
5581 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
5582
26bccfae
PE
55832012-07-09 Paul Eggert <eggert@cs.ucla.edu>
5584
a0bee46f
PE
5585 * process.c (wait_reading_process_output): 'waitchannels' was unset
5586 when read_kbd || !NILP (wait_for_cell); fix this.
5587
5994c183
PE
5588 Add GCC-style 'const' attribute to functions that can use it.
5589 * character.h (char_resolve_modifier_mask):
5590 * keyboard.h (make_ctrl_char):
5591 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5592 (init_character_once, next_almost_prime, init_fns, init_image)
5593 (flush_pending_output, init_sound):
5594 * mem-limits.h (start_of_data):
5595 * menu.h (finish_menu_items):
5596 Add ATTRIBUTE_CONST.
5597 * emacs.c (DEFINE_DUMMY_FUNCTION):
5598 Declare the dummy function with ATTRIBUTE_CONST.
5599 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5600 Add decls with ATTRIBUTE_CONST.
5601
26bccfae
PE
5602 Minor improvements to make_formatted_string.
5603 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5604 where int is good enough, as vsprintf returns an int.
5605 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5606
a8290ec3
DA
56072012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5608
5609 Use make_formatted_string to avoid double length calculation.
5610 * lisp.h (make_formatted_string): New prototype.
5611 * alloc.c (make_formatted_string): New function.
5612 * buffer.c (Fgenerate_new_buffer_name): Use it.
5613 * dbus.c (syms_of_dbusbind): Likewise.
5614 * editfns.c (Fcurrent_time_zone): Likewise.
5615 * filelock.c (get_boot_time): Likewise.
5616 * frame.c (make_terminal_frame, set_term_frame_name)
5617 (x_report_frame_params): Likewise.
5618 * image.c (gs_load): Likewise.
5619 * minibuf.c (get_minibuffer): Likewise.
5620 * msdos.c (dos_set_window_size): Likewise.
5621 * process.c (make_process): Likewise.
5622 * xdisp.c (ensure_echo_area_buffers): Likewise.
5623 * xsettings.c (apply_xft_settings): Likewise.
5624
d01ba2f1
GM
56252012-07-09 Glenn Morris <rgm@gnu.org>
5626
5627 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5628 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5629 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5630 * nsterm.h (ns_etc_directory): Add it.
5631 * callproc.c [HAVE_NS]: Include nsterm.h.
5632 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5633
f1f924b6
DA
56342012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5635
5636 Move marker debugging code under MARKER_DEBUG.
5637 * marker.c (MARKER_DEBUG): Move marker debugging code under
5638 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5639 for bootstrap with --enable-checking (~3x slowdown reported
5640 by Juanma Barranquero <lekktu@gmail.com>).
5641 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5642
ab531b66
PE
56432012-07-08 Paul Eggert <eggert@cs.ucla.edu>
5644
5645 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5646 See <http://bugs.gnu.org/11825#29>.
5647
c4b3bc8a
EZ
56482012-07-08 Eli Zaretskii <eliz@gnu.org>
5649
5650 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5651 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
5652 (display_line): Add commentary about displaying truncation glyphs
5653 on GUI frames.
5654 (produce_special_glyphs): Move here from term.c.
5655
5656 * term.c (produce_special_glyphs): Move to xdisp.c.
5657
5658 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5659 section.
c4b3bc8a 5660
b676b881
AS
56612012-07-07 Andreas Schwab <schwab@linux-m68k.org>
5662
f17c5273
AS
5663 * xdisp.c (display_line): Avoid warning about implicit declaration
5664 of FRAME_FONT.
5665
298819b9
AS
5666 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5667
b676b881
AS
5668 * lisp.h: Remove empty conditional.
5669
6045c4fd
PE
56702012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5671
b3350bf9
PE
5672 * lread.c (load_path_check): Now static.
5673
6045c4fd
PE
5674 Fix some minor --with-ns problems found by static checking.
5675 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
5676 (x_set_font) [!HAVE_X_WINDOWS]:
5677 * image.c (xpm_load_image) [HAVE_NS]:
5678 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
5679 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
5680 Remove unused local.
5681 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
5682 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
5683 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
5684 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
5685 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
5686 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
5687 Fix pointer signedness problem.
5688 * xfaces.c (FRAME_X_FONT_TABLE):
5689 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
5690
929e7845
GM
56912012-07-07 Glenn Morris <rgm@gnu.org>
5692
5693 * lread.c (load_path_check): New function, split from init_lread.
5694 (init_lread): Reorganize. Motivation:
5695 If EMACSLOADPATH is set, check/warn about that rather than the
5696 defaults, which we are not going to use. Hence we can remove
5697 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
5698 Don't warn if site-lisp directories are missing.
5699 If not installed, start from a blank load-path, since
5700 PATH_LOADSEARCH refers to the eventual installation directories.
5701
58dd0aa4
EZ
57022012-07-07 Eli Zaretskii <eliz@gnu.org>
5703
5704 Support truncation and continuation glyphs on GUI frames, when
5705 fringes are disabled. (Bug#11832)
5706 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
5707 continuation glyphs even if on GUI frames.
5708 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
5709 or both, are absent.
5710 (start_display, move_it_in_display_line_to): Handle the case of a
5711 GUI frame without a fringe to display continuation or truncation
5712 glyphs.
5713 (insert_left_trunc_glyphs): Support GUI frames: make sure
5714 truncation glyphs overwrite enough glyphs from the current line to
5715 have sufficient space in pixels.
5716 (display_line): Support truncation and continuation glyphs on GUI
5717 frames. If some spare pixels are left on the line after inserting
5718 the truncation glyphs, fill that space with a stretch glyph of a
5719 suitably computed width.
5720
5721 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5722 produce_glyphs, to support GUI sessions.
5723
31571fd7
PE
57242012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5725
5a16b9bc
PE
5726 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5727
f3047c75
PE
5728 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5729
31571fd7
PE
5730 Do not require float-time's arg to fit in time_t (Bug#11825).
5731 This works better on hosts where time_t is unsigned, and where
5732 float-time is applied to the (negative) difference between two times.
5733 * editfns.c (decode_time_components): Last arg is now double *,
5734 not int *, and means to store all the result as a double, without
5735 worrying about whether the seconds part fits in time_t.
5736 All callers changed.
5737 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5738 All callers changed.
5739 (Ffloat_time): Do not fail merely because the specified time falls
5740 outside of time_t range.
5741
4516fbef
GM
57422012-07-07 Glenn Morris <rgm@gnu.org>
5743
5744 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5745 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5746 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5747
07adc2c6
JB
57482012-07-07 Juanma Barranquero <lekktu@gmail.com>
5749
5750 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5751 Update dependencies.
5752
5753 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5754
fd573f31
PE
57552012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5756
fee5959d
PE
5757 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5758 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5759 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5760 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5761 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5762 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5763
fd573f31
PE
5764 * xfont.c (compare_font_names): Redo to omit the need for casts.
5765
ddadbc0e
AS
57662012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5767
fca8d6b6
AS
5768 * xfns.c (Fx_change_window_property): Doc fix.
5769 * w32fns.c (Fx_change_window_property): Doc fix.
5770
ddadbc0e
AS
5771 * w32fns.c (Fx_window_property): Accept the same arguments as the
5772 X Windows version. Doc fix.
5773 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5774
ed9265fc 57752012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
5776 Eli Zaretskii <eliz@gnu.org>
5777
5778 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5779 Windows-specific code from nt/config.nt moved here.
5780 Obsolete settings removed.
5781
216ee680
PE
57822012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5783
5784 * process.c: Avoid unnecessary calls to gettime.
5785 (wait_reading_process_output): Don't get the time of day
5786 when gobbling data immediately and not waiting, as there's no need
5787 for it in that case. This removes a FIXME.
5788
bdd091e4
JD
57892012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5790
5791 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5792 is defined (Bug#11768).
5793
9d44f8ce
DA
57942012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5795
5796 Fix marker debugging code.
5797 * marker.c (byte_char_debug_check): Do not perform the check
5798 if buffer is not multibyte.
090bd7cb
JB
5799 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5800 Call byte_char_debug_check with correct arguments.
9d44f8ce 5801
90fc4786
DA
58022012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5803
5804 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
5805 * marker.c (byte_char_debug_check, count_markers):
5806 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
5807 (byte_debug_flag): Remove.
5808 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5809 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5810
7b7ae965
DA
58112012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5812
4e57b342
DA
5813 Avoid code repetition in marker-related functions.
5814 * marker.c (attach_marker): New function.
5815 (Fset_marker, set_marker_restricted, set_marker_both)
5816 (set_marker_restricted_both): Use it.
5817 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5818 Consistently rename charno to charpos.
5819 (marker_position): Add eassert.
5820 (marker_byte_position): Convert to eassert.
5821
58222012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5823
5824 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 5825 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 5826 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 5827
657924ff
DA
58282012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5829
5830 Introduce fast path for the widely used marker operation.
5831 * alloc.c (build_marker): New function.
5832 * lisp.h (build_marker): New prototype.
5833 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5834 * composite.c (autocmp_chars): Likewise.
5835 * editfns.c (buildmark): Remove.
5836 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5837 (save_restriction_save): Use build_marker.
5838 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5839 * window.c (save_window_save): Likewise.
5840
041a49a6
DA
58412012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5842
5843 Do not use Fdelete_overlay in delete_all_overlays
5844 to avoid redundant calls to unchain_overlay.
5845 * buffer.c (drop_overlay): New function.
5846 (delete_all_overlays, Fdelete_overlay): Use it.
5847 * minibuf.c (get_minibuffer): Fix comment.
5848
7dca65a4
PE
58492012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5850
5851 Port to OpenBSD 5.1 amd64.
5852 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5853 This is needed for OpenBSD, and should be harmless on all BSD systems.
5854 Also, include <sys/sysctl.h>, as it should be available on all
5855 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5856 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5857 use p_pid member, not kp_proc.pid.
5858
8eb876e2
GM
58592012-07-06 Glenn Morris <rgm@gnu.org>
5860
5861 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5862
38182d90
PE
58632012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5864
5865 More xmalloc and related cleanup.
5866 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5867 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5868 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5869 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5870 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5871 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5872 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5873 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5874 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5875 * xterm.c:
5876 Omit needless casts involving void * pointers and allocation.
5877 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5878 as the former is more robust if P's type is changed.
5879 Prefer xzalloc to xmalloc + memset 0.
5880 Simplify malloc-or-realloc to realloc.
5881 Don't worry about xmalloc returning a null pointer.
5882 Prefer xstrdup to xmalloc + strcpy.
5883 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5884 growing it.
5885 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5886 alloca of a constant.
5887
6dd5a677
EZ
58882012-07-05 Eli Zaretskii <eliz@gnu.org>
5889
5890 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5891 hscroll is larger than the line width. Fixes long and futile
5892 looping inside extend_face_to_end_of_line (on a TTY) producing
5893 glyphs that are not needed and thrown away.
5894
6b312f0f
DA
58952012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5896
5897 * marker.c (set_marker_restricted_both): Simplify by using
5898 clip_to_bounds.
5899
f520ef9b
PE
59002012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5901
5902 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5903
383b7c95
JD
59042012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5905
5906 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5907 not defined (Bug#11768).
5908 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5909 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5910 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5911 followed by gtk_box_set_homogeneous (Bug#11768).
5912 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
5913 (update_theme_scrollbar_width, xg_create_scroll_bar):
5914 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
5915 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5916 (is_box_type): New function (Bug#11768).
5917 (xg_tool_item_stale_p): Call is_box_type.
5293d758 5918 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
5919 with default display (Bug#11768).
5920
d6e7bf45
EZ
59212012-07-05 Eli Zaretskii <eliz@gnu.org>
5922
5923 * xdisp.c (window_hscroll_limited): New function.
5924 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5925 coordinates when window's hscroll is set to insanely large
5926 values. (Bug#11857)
5927
431391ec
JB
59282012-07-05 Juanma Barranquero <lekktu@gmail.com>
5929
5930 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5931 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5932
23f86fce
DA
59332012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5934
5935 Cleanup xmalloc.
5936 * lisp.h (xzalloc): New prototype. Omit needless casts.
5937 * alloc.c (xzalloc): New function. Omit needless casts.
5938 * charset.c: Omit needless casts. Convert all calls to
5939 xmalloc with following memset to xzalloc.
5940 * dispnew.c: Likewise.
5941 * fringe.c: Likewise.
5942 * image.c: Likewise.
5943 * sound.c: Likewise.
5944 * term.c: Likewise.
5945 * w32fns.c: Likewise.
5946 * w32font.c: Likewise.
5947 * w32term.c: Likewise.
5948 * xfaces.c: Likewise.
5949 * xfns.c: Likewise.
5950 * xterm.c: Likewise.
5951 * atimer.c: Omit needless casts.
5952 * buffer.c: Likewise.
5953 * callproc.c: Likewise.
5954 * ccl.c: Likewise.
5955 * coding.c: Likewise.
5956 * composite.c: Likewise.
5957 * doc.c: Likewise.
5958 * doprnt.c: Likewise.
5959 * editfns.c: Likewise.
5960 * emacs.c: Likewise.
5961 * eval.c: Likewise.
5962 * filelock.c: Likewise.
5963 * fns.c: Likewise.
5964 * gtkutil.c: Likewise.
5965 * keyboard.c: Likewise.
5966 * lisp.h: Likewise.
5967 * lread.c: Likewise.
5968 * minibuf.c: Likewise.
5969 * msdos.c: Likewise.
5970 * print.c: Likewise.
5971 * process.c: Likewise.
5972 * region-cache.c: Likewise.
5973 * search.c: Likewise.
5974 * sysdep.c: Likewise.
5975 * termcap.c: Likewise.
5976 * terminal.c: Likewise.
5977 * tparam.c: Likewise.
5978 * w16select.c: Likewise.
5979 * w32.c: Likewise.
5980 * w32reg.c: Likewise.
5981 * w32select.c: Likewise.
5982 * w32uniscribe.c: Likewise.
5983 * widget.c: Likewise.
5984 * xdisp.c: Likewise.
5985 * xmenu.c: Likewise.
5986 * xrdb.c: Likewise.
5987 * xselect.c: Likewise.
5988
0497dc44
PE
59892012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5990
5991 * fileio.c (time_error_value): Check the right error number.
5992 Problem reported by Troels Nielsen in
5993 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5994
356e7178
PE
59952012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5996
4e71fd89
PE
5997 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5998 This should be fixed in a better way; see Eli Zaretskii in
5999 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6000 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6001
f0941253
PE
6002 * fileio.c (time_error_value): Rename from special_mtime.
6003 The old name's problems were noted by Eli Zaretskii in
6004 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6005
065c9eb4
PE
6006 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6007 This variable's comment says Emacs needs at least one GDB-visible
6008 symbol of type enum pvec_type, to work around GDB problems.
6009 The symbol's value doesn't matter.
6010
356e7178
PE
6011 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6012 that causes compilation to fail on pre-C99 compilers.
6013
ed9265fc 60142012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
6015
6016 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6017 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6018
3884d954
DA
60192012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6020
d209e2fb 6021 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
6022 headers for buffer_defaults and buffer_local_symbols.
6023 Reported by Juanma Barranquero <lekktu@gmail.com>.
6024
ee28be33
SM
60252012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6026
6027 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6028 * lisp.h (enum pvec_type): Use fewer bits.
6029 (PSEUDOVECTOR_SIZE_BITS): New constant.
6030 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6031 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6032 change in pvec_type.
6033 (PSEUDOVECTOR_TYPEP): New macro.
6034 (TYPED_PSEUDOVECTORP): Use it.
6035 * fns.c (internal_equal): Adapt code to extract pvectype.
6036 * emacs.c (gdb_pvec_type): Update type.
6037 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6038 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6039 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6040 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6041 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6042 abusing vector->header.next.nbytes.
6043 (live_vector_p): Use PVEC_TYPE.
6044 (mark_object): Adapt code to extract pvectype. Use switch.
6045
c7f2cd7f
PE
60462012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6047
6048 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6049 Tighten new eassert a bit.
6050
8ce70ed2
DA
60512012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6052
6053 Fix compilation with --enable-gcc-warnings and -O1
6054 optimization level.
6055 * doprnt.c (doprnt): Change type of tem to int, initialize
6056 to avoid compiler warning. Add eassert.
6057 * search.c (simple_search): Initialize match_byte to avoid
6058 compiler warning. Add eassert.
6059
dea7f1e5
PE
60602012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6061
24a212eb
PE
6062 Avoid weird behavior with large horizontal scrolls.
6063 Without this change, for example, large hscroll values would
6064 mess up Emacs's display on Fedora 15 x86, presumably due to
6065 overflows in int calculations in the display code.
6066 Also, if buffers had long lines, Emacs would freeze.
6067 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6068 (set_window_hscroll): New function, containing the old guts of
6069 Fset_window_hscroll. Return the clipped value.
6070 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6071 This avoids the need to check against PTRDIFF_MAX.
6072
dea7f1e5
PE
6073 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6074
76046526
DA
60752012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6076
6077 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6078
39adff0d
PE
60792012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6080
63807d47
PE
6081 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6082 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6083 since GCC 4.4.6 issues a bogus warning for them.
6084
39adff0d
PE
6085 Fix bugs in file timestamp newness comparisons.
6086 * fileio.c (Ffile_newer_than_file_p):
6087 * lread.c (Fload): Use full timestamp resolution of files,
6088 not just the 1-second resolution, so that files that are only
6089 slightly newer still count as newer.
6090 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6091 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6092
dbeed9a6
PE
60932012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6094
6095 * fileio.c: Improve handling of file time marker. (Bug#11852)
6096 (special_mtime): New function.
6097 (Finsert_file_contents, Fverify_visited_file_modtime):
6098 Use it to set special mtime values consistently.
6099
636334d6
AS
61002012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6101
6102 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6103 marker for non-existing file. (Bug#11852)
6104
e2017fe2
GM
61052012-07-03 Glenn Morris <rgm@gnu.org>
6106
6107 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6108 and did not make it into globals.h).
6109
404dbd37
TT
61102012-07-03 Tom Tromey <tromey@redhat.com>
6111
6112 * window.c (Fset_window_margins, Fset_window_fringes)
6113 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6114 * textprop.c (Fprevious_property_change): No longer static.
6115 * syntax.c (Fsyntax_table_p): No longer static.
6116 * process.c (Fget_process, Fprocess_datagram_address): No longer
6117 static.
6118 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6119 * keyboard.c (Fcommand_execute): No longer static.
6120 Remove EXFUN.
6121 * insdel.c (Fcombine_after_change_execute): No longer static.
6122 * image.c (Finit_image_library): No longer static.
6123 * fileio.c (Fmake_symbolic_link): No longer static.
6124 * eval.c (Ffetch_bytecode): No longer static.
6125 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
6126 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6127 No longer static.
404dbd37
TT
6128 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6129 static.
6130 * dired.c (Ffile_attributes): No longer static.
6131 * composite.c (Fcomposition_get_gstring): No longer static.
6132 * callproc.c (Fgetenv_internal): No longer static.
6133
6134 * ccl.h: Remove EXFUNs.
6135 * buffer.h: Remove EXFUNs.
6136 * dispextern.h: Remove EXFUNs.
6137 * intervals.h: Remove EXFUNs.
6138 * fontset.h: Remove EXFUN.
6139 * font.h: Remove EXFUNs.
6140 * dosfns.c (system_process_attributes): Remove EXFUN.
6141 * keymap.h: Remove EXFUNs.
6142 * lisp.h: Remove EXFUNs.
6143 * w32term.h: Remove EXFUNs.
6144 * window.h: Remove EXFUNs.
6145 * xsettings.h: Remove EXFUN.
6146 * xterm.h: Remove EXFUN.
6147
8e4fd1e1
GM
61482012-07-03 Glenn Morris <rgm@gnu.org>
6149
6150 * lisp.h (Frandom): Make it visible to C.
6151 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6152 buffer for invisible buffers. (Bug#1229)
6153
ca95b3eb
DA
61542012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6155
6156 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6157 values which aren't power of 2.
14ae4239
BT
6158 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
6159 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
6160 accordingly.
6161
7555c33f
SM
61622012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6163
6164 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6165
6166 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6167
d12e8f5a
DA
61682012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6169
6170 * alloc.c (allocate_vector_block): Remove redundant
6171 calls to mallopt if DOUG_LEA_MALLOC is defined.
6172 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6173 avoid calls to mallopt if zero_vector is returned.
6174
296094c3
DA
61752012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6176
6177 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6178 is enabled, avoid dereferencing NULL current_sblock if
6179 running undumped.
6180
36429c89
DA
61812012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6182
6183 Cleanup basic buffer management.
6184 * buffer.h (struct buffer): Change layout to use generic vector
6185 marking code. Fix some comments. Change type of 'clip_changed'
6186 to bitfield. Remove unused #ifndef old.
6187 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
6188 (GET_OVERLAYS_AT): Fix indentation.
6189 (for_each_per_buffer_object_at): New macro.
6190 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
6191 (Fbuffer_local_variables): Use it.
6192 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
6193 * alloc.c (allocate_buffer): Adjust to match new layout of
6194 struct buffer. Fix comment.
6195 (mark_overlay): New function.
6196 (mark_buffer): Use it. Use mark_vectorlike to mark normal
6197 Lisp area of struct buffer.
6198 (mark_object): Use it. Adjust marking of misc objects
6199 and related comments.
6200
3b3e4cac
PE
62012012-07-02 Paul Eggert <eggert@cs.ucla.edu>
6202
6203 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
6204 wrapper that is not needed because the wrapped code is a no-op (zero
6205 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
6206 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
6207
cf5c0175
DA
62082012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
6209
6210 * alloc.c (mark_buffer): Simplify. Remove prototype.
6211 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 6212 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
6213 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
6214 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 6215
ca26824c
GM
62162012-06-30 Glenn Morris <rgm@gnu.org>
6217
2e4c5312
GM
6218 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
6219
ca26824c
GM
6220 * epaths.in (PATH_SITELOADSEARCH): New.
6221 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
6222 This is rather than relying on --enable-locallisppath elements
6223 having "site-lisp" in their names. (Bug#10208#25, 11658)
6224
0d23c240
EZ
62252012-06-30 Eli Zaretskii <eliz@gnu.org>
6226
c9240d7a
EZ
6227 * w32proc.c (sys_select): Accept and ignore one more argument.
6228
6229 * w32.c (emacs_gnutls_pull): Call select with one more argument.
6230
0d23c240 6231 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 6232 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
6233
6234 * sysdep.c: Don't include dos.h and dosfns.h.
6235
6236 * process.c (sys_select):
6237 * msdos.c (sys_select): Accept one more argument and ignore it.
6238
6239 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
6240 adapt data types and code to that.
6241
6242 * dosfns.c:
6243 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
6244 which clashes with the gnulib function of the same name.
6245
af5a5a98
AS
62462012-06-30 Andreas Schwab <schwab@linux-m68k.org>
6247
c5e4379c
AS
6248 * font.c (font_style_to_value, font_style_symbolic)
6249 (font_prop_validate_style): Add type checks for values in
6250 font_style_table.
6251
af5a5a98
AS
6252 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
6253 argument.
6254 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
6255 uses.
6256
8d38f461
EZ
62572012-06-29 Eli Zaretskii <eliz@gnu.org>
6258
2e5a6631
EZ
6259 * xdisp.c (try_window_id): Undo last change.
6260
8d38f461
EZ
6261 * w32.c (getwd): Adjust commentary about startup_dir.
6262 (init_environment): Always call sys_access, even in non-MSVC
6263 builds. Don't chdir to the directory of the Emacs executable.
6264 This undoes code from 1997 which was justified by the need to
6265 "avoid conflicts when removing and renaming directories". But its
6266 downside was that every relative file name was being interpreted
6267 relative to the directory of the Emacs executable, which can never
6268 be TRT. In particular, it broke sys_access when called with
6269 relative file names.
6270 (sys_access): Map GetLastError to errno.
6271
2af3565e
DA
62722012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6273
6274 * window.h (struct window): Change type of 'fringes_outside_margins'
6275 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 6276 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
6277 Adjust comment.
6278 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
6279 to ptrdiff_t.
6280
c8d3a25c 62812012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 6282
c8d3a25c
GM
6283 * gnutls.c (emacs_gnutls_handshake):
6284 Add QUIT to make the loop interruptible.
57570cd3 6285
c8d3a25c 62862012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 6287
c8d3a25c
GM
6288 * charset.c (init_charset): Make lack of etc/charsets fatal.
6289
3e984ee8
DA
62902012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6291
6292 * editfns.c (region_limit): Fix type mismatch.
6293
ef884f23
DA
62942012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6295
6296 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
6297 undefined. Convert from xassert to eassert.
6298 * nsmenu.m: Convert from xassert to eassert.
6299 * nsterm.m: Likewise.
6300
7d7e0027
SM
63012012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
6302
6303 * editfns.c (region_limit): Clip to narrowing (bug#11770).
6304
aa754e6a
PE
63052012-06-28 Paul Eggert <eggert@cs.ucla.edu>
6306
6307 Avoid integer overflow on scroll-left and scroll-right.
6308 * window.c (HSCROLL_MAX): New macro.
6309 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
6310 overflow when requested scroll falls outside ptrdiff_t range.
6311
80b00b08
DA
63122012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6313
6314 * window.h (struct window): Change type of 'hscroll',
6315 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
6316 'last_modified' and 'last_overlay_modified' to EMACS_INT.
6317 Adjust users accordingly.
6318 * xdisp.c (try_cursor_movement): Replace type check with eassert.
6319 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
6320 from EMACS_INT to ptrdiff_t.
6321 (make_window): Omit redundant initialization.
6322
62b2bcf6
JB
63232012-06-28 Juanma Barranquero <lekktu@gmail.com>
6324
6325 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
6326
45942c7d
DA
63272012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6328
6329 * window.h (struct window): Change type of 'use_time' and
6330 'sequence_number' from Lisp_Object to int.
6331 * frame.c (make_frame): Adjust users accordingly.
6332 * print.c (print_object): Likewise.
6333 * window.c (select_window, Fwindow_use_time, make_parent_window)
6334 (make_window): Likewise.
6335
e509cfa6
DA
63362012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6337
6338 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
6339 enabled with --enable-checking=[all,glyphs] configure option.
6340 Fix GLYPH_DEBUG usage assuming that it may be undefined,
6341 adjust comments accordingly.
6342 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
6343 undefined, adjust comments accordingly.
6344 * image.c: Likewise.
6345 * scroll.c: Likewise.
6346 * w32fns.c: Likewise.
6347 * w32term.c: Likewise.
6348 * xdisp.c: Likewise.
6349 * xfaces.c: Likewise.
6350 * xfns.c: Likewise.
6351 * xterm.c: Likewise.
6352
a54e2c05
DA
63532012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6354
6355 Generalize run-time debugging checks.
6356 * dispextern.h (XASSERTS): Remove.
6357 * fontset.c (xassert): Remove.
6358 Convert from xassert to eassert.
6359 * alloc.c: Convert from xassert to eassert.
6360 * bidi.c: Likewise.
6361 * dispnew.c: Likewise.
6362 * fns.c: Likewise.
6363 * fringe.c: Likewise.
6364 * ftfont.c: Likewise.
6365 * gtkutil.c: Likewise.
6366 * image.c: Likewise.
6367 * keyboard.c: Likewise.
6368 * menu.c: Likewise.
6369 * process.c: Likewise.
6370 * scroll.c: Likewise.
6371 * sound.c: Likewise.
6372 * term.c: Likewise.
6373 * w32console.c: Likewise.
6374 * w32fns.c: Likewise.
6375 * w32term.c: Likewise.
6376 * window.c: Likewise.
6377 * xdisp.c: Likewise.
6378 * xfaces.c: Likewise.
6379 * xfns.c: Likewise.
6380 * xselect.c: Likewise.
6381 * xterm.c: Likewise.
6382
1ec4b7b2
SM
63832012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
6384
6385 * fns.c (maybe_resize_hash_table): Output message when growing the
6386 purify-hashtable.
6387
2014308a
DA
63882012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6389
6390 * alloc.c (allocate_string_data): Remove dead code.
6391 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
6392 avoid GCC warning about unused macro.
6393
246155eb
DA
63942012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6395
6396 * alloc.c (allocate_string): Omit intervals initialization.
6397 * alloc.c (make_uninit_multibyte_string): Initialize intervals
6398 as in make_pure_string and make_pure_c_string.
6399
43184b7b
DA
64002012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6401
d209e2fb 6402 * alloc.c (allocate_string): Fix last change.
43184b7b 6403
3fe6dd74
DA
64042012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6405
d209e2fb 6406 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
6407 to memset, add explicit initialization where appropriate.
6408
1ba6038a
GM
64092012-06-27 Glenn Morris <rgm@gnu.org>
6410
6411 * lisp.mk (lisp): Remove paths.elc.
6412
c89926a5
CY
64132012-06-27 Chong Yidong <cyd@gnu.org>
6414
6415 * doc.c (Fsubstitute_command_keys): Fix punctuation.
6416
ed6b3510
JW
64172012-06-26 John Wiegley <johnw@newartisans.com>
6418
1ec4b7b2 6419 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
6420 on Mac OS X Lion: __mod_init_func and __mod_term_func.
6421
ed6b3510
JW
6422 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6423 when building with Clang.
6424
8edd4a2b
SM
64252012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
6426
6427 * eval.c (Fapply): Allow calling it with a single argument.
6428
f6f62d1b
EZ
64292012-06-26 Eli Zaretskii <eliz@gnu.org>
6430
6431 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6432 _stricmp and _strnicmp.
6433 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6434
62efea5e
DA
64352012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6436
6437 * alloc.c (allocate_window): Zero out non-Lisp part of newly
6438 allocated window.
6439 (allocate_process): Likewise for new process.
8edd4a2b 6440 (allocate_terminal): Change to use offsetof.
62efea5e
DA
6441 (allocate_frame): Likewise.
6442 * frame.c (make_frame): Omit redundant initialization.
6443 * window.c (make_parent_window): Use memset.
6444 (make_window): Omit redundant initialization.
6445 * process.c (make_process): Omit redundant initialization.
6446 * terminal.c (create_terminal): Likewise.
6447
42997f4d
DA
64482012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6449
6450 * term.c (delete_tty): Remove redundant call to memset.
6451
1130ecfc
DA
64522012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6453
6454 * alloc.c: Remove build_string.
6455 * lisp.h: Define build_string as static inline. This provides
6456 a better opportunity to optimize away calls to strlen when the
6457 function is called with compile-time constant argument.
6458 * image.c (imagemagick_error): Convert to build_string.
6459 * w32proc.c (sys_spawnve): Likewise.
6460 * xterm.c (x_term_init): Likewise.
6461
cf38a720
PE
64622012-06-26 Paul Eggert <eggert@cs.ucla.edu>
6463
99027bdd
PE
6464 Use sprintf return value instead of invoking strlen on result.
6465 In the old days this wasn't portable, since some sprintf
6466 implementations returned char *. But they died out years ago and
6467 Emacs already assumes sprintf returns int.
6468 Similarly for float_to_string.
6469 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6470 * ccl.c (ccl_driver):
6471 * character.c (string_escape_byte8):
6472 * data.c (Fnumber_to_string):
6473 * doprnt.c (doprnt):
6474 * print.c (print_object):
6475 * xdisp.c (message_dolog):
6476 * xfns.c (syms_of_xfns):
6477 Use sprintf or float_to_string result to avoid need to call strlen.
6478 * data.c (Fnumber_to_string):
6479 Use make_unibyte_string, since the string must be ASCII.
6480 * lisp.h, print.c (float_to_string): Now returns int length.
6481 * term.c (produce_glyphless_glyph):
6482 Use sprintf result rather than recomputing it.
6483
cf38a720
PE
6484 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6485 * Makefile.in (ALL_CFLAGS):
6486 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6487 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6488
3511c784
DA
64892012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6490
0a08eb21 6491 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
6492 strcasecmp if available.
6493 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6494
fb7da12e
AS
64952012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6496
6497 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6498 Avoid comma operator.
6499 * menu.c (push_submenu_start, push_submenu_end)
6500 (push_left_right_boundary, push_menu_pane): Likewise.
6501 * msdos.c (dos_rawgetc): Likewise.
6502
afa2ffd8
DA
65032012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6504
6505 * xfns.c (xic_create_fontsetname): Remove redundant calls
6506 to memset.
6507
b3b4476b
PE
65082012-06-25 Paul Eggert <eggert@cs.ucla.edu>
6509
4495ff38
PE
6510 * gtkutil.c (get_utf8_string): Remove redundant assignment.
6511 sprintf already null-terminates its output.
6512
b3b4476b
PE
6513 * xfns.c (x_window): Remove redundant cast.
6514
b00876c9
DA
65152012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6516
6517 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6518 `const char *' to `char *' to avoid compiler warning.
6519
d188e26b
PE
65202012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6521
885d1d74
PE
6522 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6523 instead of truncating it to 63 (admittedly a generous limit).
6524
d188e26b
PE
6525 * process.c: Fix spelling and caps in comments.
6526
e2f560b1
DN
65272012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
6528
e86db54b 6529 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
6530 * sysdep.c (setpgrp): Remove definition, not used in this file.
6531
7583a3a1
JB
65322012-06-24 Juanma Barranquero <lekktu@gmail.com>
6533
6534 * makefile.w32-in: Update dependencies.
6535
696056c2
EZ
65362012-06-24 Eli Zaretskii <eliz@gnu.org>
6537
6538 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
6539 (SYSTIME_H): Add nt/inc/sys/time.h.
6540
6541 * systime.h [WINDOWSNT]: Include sys/time.h.
6542
6543 * s/ms-w32.h (struct timespec): Definition moved from
6544 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
6545
845ca893
PE
65462012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6547
6548 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
6549 * buffer.h (buffer_slot_type_mismatch):
6550 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6551 * eval.c (unwind_to_catch):
6552 * image.c (my_png_error, my_error_exit):
6553 * keyboard.c (quit_throw_to_read_char, user_error)
6554 (Fexit_recursive_edit, Fabort_recursive_edit):
6555 * lisp.h (die, args_out_of_range, args_out_of_range_3)
6556 (wrong_type_argument, buffer_overflow, __executable_start)
6557 (memory_full, buffer_memory_full, string_overflow, Fthrow)
6558 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
6559 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
6560 (fatal):
6561 (child_setup) [!DOS_NT]:
6562 * lread.c (end_of_file_error, invalid_syntax):
6563 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6564 * puresize.h (pure_write_error):
6565 * search.c (matcher_overflow):
6566 * sound.c (sound_perror, alsa_sound_perror):
6567 * sysdep.c, syssignal.h (croak):
6568 * term.c (maybe_fatal, vfatal):
6569 * textprop.c (text_read_only):
6570 * undo.c (user_error):
6571 * unexmacosx.c (unexec_error):
6572 * xterm.c (x_ins_del_lines, x_delete_glyphs):
6573 Use _Noreturn rather than NO_RETURN.
6574 No need for separate decl merely because of _Noreturn.
6575 * sound.c (sound_warning, parse_sound):
6576 Remove unnecessary forward decls.
6577
f1dd8073
PE
65782012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6579
6580 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
6581 * lisp.h (WAIT_READING_MAX): New macro.
6582 * dispnew.c (Fsleep_for, sit_for):
6583 * keyboard.c (kbd_buffer_get_event):
6584 * process.c (Faccept_process_output):
6585 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6586 This improves on the previous patch, which introduced a bug
6587 when time_t is unsigned and as wide as intmax_t.
6588 See <http://bugs.gnu.org/9000#51>.
6589
b82c1755
EZ
65902012-06-23 Eli Zaretskii <eliz@gnu.org>
6591
6592 * dispnew.c (sit_for, Fsleep_for):
6593 * keyboard.c (kbd_buffer_get_event):
6594 * process.c (Faccept_process_output): Avoid compiler warnings when
6595 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6596
ca300656
JB
65972012-06-23 Juanma Barranquero <lekktu@gmail.com>
6598
049ec95b
JB
6599 * makefile.w32-in: Update dependencies.
6600
ca300656
JB
6601 * w32.c (ltime): Add return type and declare static.
6602 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6603
db7b8d06
PE
66042012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6605
6606 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6607 Privately reported by Herbert J. Skuhra.
6608 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6609 All uses changed.
6610 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6611 not make_lisp_timeval, when the argument is of type EMACS_TIME.
6612
0bd8297f
EZ
66132012-06-23 Eli Zaretskii <eliz@gnu.org>
6614
96512555
EZ
6615 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6616 last argument of make_unibyte_string.
6617
0bd8297f
EZ
6618 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6619 language ID in the event parameters.
6620
6621 * w32term.c (w32_read_socket): Put the new keyboard codepage into
6622 event.code, not the obscure "character set ID".
6623
63def6b6
CY
66242012-06-23 Chong Yidong <cyd@gnu.org>
6625
6626 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6627
e8a02204
EZ
66282012-06-23 Eli Zaretskii <eliz@gnu.org>
6629
388cdec0
EZ
6630 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6631 * w32.c (fdutimens): New function.
6632
6633 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6634
6635 * s/ms-w32.h (pselect): Redirect to sys_select.
6636
6637 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6638
e8a02204
EZ
6639 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6640 in the logic of incrementing and decrementing the value of
6641 use_relocatable_buffers.
6642
d054f3fb
PE
66432012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6644
6645 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6646 Privately reported by Herbert J. Skuhra.
6647 [__FreeBSD__]: Remove "*/" typo after "#include".
6648 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6649 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6650 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6651 Don't assume EMACS_TIME and struct timeval are the same type.
6652
d35af63c
PE
66532012-06-22 Paul Eggert <eggert@cs.ucla.edu>
6654
6655 Support higher-resolution time stamps (Bug#9000).
6656 The time stamps are only nanosecond-resolution at the C level,
6657 since that's the best that any real-world system supports now.
6658 But they are picosecond-resolution at the Lisp level, as that's
6659 easy, and leaves room for future OS improvements.
6660
6661 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6662 (LIBES): Use it.
6663
6664 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6665 Don't get current time unless it's needed.
6666
6667 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6668 now provides it if it's absent.
6669 (start_atimer): Port to higher-res time stamps.
6670 Check for time stamp overflow. Don't get current time more
6671 often than is needed.
6672
6673 * buffer.h (struct buffer): Buffer modtime now has high resolution.
6674 Include systime.h, not time.h.
6675 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
6676
6677 * dired.c: Include stat-time.h.
6678 (Ffile-attributes): File times now have higher resolution.
6679
6680 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
6681 (struct image): Timestamp now has higher resolution.
6682
6683 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
6684 has at least microseconds now. All uses removed.
6685 (update_frame, update_single_window, update_window, update_frame_1)
6686 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 6687 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
6688
6689 * editfns.c (time_overflow): Now extern.
6690 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
6691 (float-time, Fformat_time_string, Fcurrent_time_string)
6692 (Fcurrent_time_zone): Accept and generate higher-resolution
6693 time stamps.
6694 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
6695 (decode_time_components, lisp_seconds_argument): New functions.
6696 (make_time): Now static.
6697 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
6698 Report an error if the time is invalid, rather than having the caller
6699 do that.
6700
6701 * fileio.c: Include <stat-time.h>
6702 (Fcopy_file): Copy higher-resolution time stamps.
6703 Prefer to set the time stamp via a file descriptor if that works.
6704 (Fset_file_times, Finsert_file_contents, Fwrite_region)
6705 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
6706 (Fvisited_file_modtime, Fset_visited_file_modtime):
6707 Support higher-resolution time stamps.
6708
6709 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6710
6711 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6712
6713 * image.c (prepare_image_for_display, clear_image_cache)
6714 (lookup_image): Port to higer-resolution time stamps.
6715
6716 * keyboard.c (start_polling, bind_polling_period):
6717 Check for time stamp overflow.
6718 (read_char, kbd_buffer_get_event, timer_start_idle)
6719 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6720 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6721 Port to higher-resolution time stamps. Do not assume time_t is signed.
6722 (decode_timer): New function. Timers are now vectors of length 9,
6723 not 8, to accommodate the picosecond component.
6724 (timer_check_2): Use it.
6725
6726 * nsterm.m (select_timeout, timeval_subtract): Remove.
6727 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6728 as they're a bit more accurate and handle overflow better.
6729 (ns_select): Change prototype to be compatible with pselect.
6730 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6731 * nsterm.h (ns_select): Adjust prototype.
6732
6733 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6734 us-resolution time stamps.
6735 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6736
6737 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6738
6739 * lisp.h (time_overflow): New decl.
6740 (wait_reading_process_output): First arg is now intmax_t, not int,
6741 to accommodate larger waits.
6742
6743 * process.h (struct Lisp_Process.read_output_delay):
6744 Now counts nanoseconds, not microseconds.
6745 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6746 EMACS_HAS_USECS.
6747 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6748 (wait_reading_process_output):
6749 Port to ns-resolution time stamps.
6750 (Faccept_process_output, wait_reading_process_output):
6751 Check for time stamp overflow. Do not assume time_t is signed.
6752 (select_wrapper): Remove; we now use pselect.
6753 (Fprocess_attributes): Now generates ns-resolution time stamps.
6754
6755 * sysdep.c: Include utimens.h. Don't include utime.h
6756 or worry about struct utimbuf; gnulib does that for us now.
6757 (gettimeofday): Remove; gnulib provides a substitute.
6758 (make_timeval): New function.
6759 (set_file_times): Now sets ns-resolution time stamps.
6760 New arg FD; all uses changed.
6761 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6762 (system_process_attributes):
6763 Now returns ns-resolution time stamp. All uses changed.
6764 Check for time stamp overflow.
6765
6766 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6767 provides a substitute now.
6768
6769 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6770 since it guarantees struct timespec.
6771 (EMACS_TIME): Now struct timespec, so that we can support
6772 ns-resolution time stamps.
6773 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6774 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6775 (EMACS_USECS): Remove.
6776 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6777 so multiply the arg by 1000 before storing it.
6778 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6779 New macros.
6780 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6781 Port to ns-resolution time stamps.
6782 (EMACS_TIME_NEG_P): Remove; replaced by....
6783 (EMACS_TIME_SIGN): New macro.
6784 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6785 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6786 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6787 (make_timeval, make_lisp_time, decode_time_components): New decls.
6788 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6789 that it mishandled time_t overflow. You can't compare by subtracting!
6790 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6791 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6792
6793 * term.c: Include <sys/time.h>.
6794 (timeval_to_Time): New function, for proper overflow wraparound.
6795 (term_mouse_position, term_mouse_click): Use it.
6796
6797 * undo.c (record_first_change): Support higher-resolution time stamps
6798 in the undo buffer.
6799 (Fprimitive_undo): Use them when restoring time stamps.
6800
6801 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6802 (w32_get_internal_run_time):
6803 Port to higher-resolution Emacs time stamps.
6804 (ltime): Now accepts single 64-bit integer, as that's more convenient
6805 for callers.
6806
6807 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6808
6809 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6810 for compatibility with pselect. Support ns-resolution time stamps.
6811
6812 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6813
6814 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6815 Check for time stamp overflow, and support ns-resolution time stamps.
6816
6817 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6818 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6819 (timeval_subtract): Remove; no longer needed.
6820 (XTflash, XTring_bell, x_wait_for_event):
6821 Port to ns-resolution time stamps. Don't assume time_t is signed.
6822
b6a92dfe
CY
68232012-06-22 Chong Yidong <cyd@gnu.org>
6824
6825 * xdisp.c (x_consider_frame_title): Revert last change.
6826
d251c37c
EZ
68272012-06-22 Eli Zaretskii <eliz@gnu.org>
6828
6829 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6830 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6831 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6832 staticidx goes up to 1597 out of 1600 = 0x640.)
6833
f10deafb
PE
68342012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6835
6836 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6837 Otherwise, the umask might be mistakenly 0 while handling input signals.
6838
ec6de1e2
SM
68392012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6840
6841 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6842
28be1ada
DA
68432012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6844
6845 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6846 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6847 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6848 access to `contents' member of Lisp_Vector objects with AREF and ASET
6849 where appropriate.
6850
c6bf3022
CY
68512012-06-19 Chong Yidong <cyd@gnu.org>
6852
6853 * frame.c (delete_frame): When selecting a frame on a different
6854 text terminal, do not alter the terminal's top-frame.
6855
6856 * xdisp.c (format_mode_line_unwind_data): Record the target
6857 frame's selected window and its terminal's top-frame.
6858 (unwind_format_mode_line): Restore them.
6859 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6860 Callers changed.
6861 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6862 since tty frames can be explicitly named.
6863 (prepare_menu_bars): Likewise.
6864
6865 * term.c (Ftty_top_frame): New function.
6866
defd4196
PE
68672012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6868
6869 Port byte-code-meter to modern targets.
6870 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6871 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 6872 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
6873 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6874 (METER_1, METER_2): Simplify.
6875
1053a871
SM
68762012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6877
6878 * data.c (Fdefalias): Return `symbol' (bug#11686).
6879
b7e8d081
MR
68802012-06-18 Martin Rudalics <rudalics@gmx.at>
6881
6882 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
6883 gets killed during executing of this function (Bug#11665).
6884 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
6885 (Vkill_buffer_query_functions): In doc-string say that functions
6886 run by this hook should not change the current buffer.
6887
7ea2b339
PE
68882012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6889
6890 Fix recently-introduced process.c problems found by static checking.
6891 * process.c (write_queue_push, write_queue_pop, send_process):
6892 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6893 (write_queue_pop): Fix pointer signedness problem.
6894 (send_process): Remove unused local.
6895
96a313a1
CY
68962012-06-17 Chong Yidong <cyd@gnu.org>
6897
6898 * xdisp.c (redisplay_internal): No need to redisplay terminal
6899 frames that are not on top.
6900
20ca2e94
TN
69012012-06-17 Troels Nielsen <bn.troels@gmail.com>
6902
6903 * process.c (make_process): Initialize write_queue.
6904 (write_queue_push, write_queue_pop): New functions.
6905 (send_process): Use them to maintain correct ordering of process
6906 writes (Bug#10815).
6907
9a900ca9
PE
69082012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6909
310fbfa8
PE
6910 * lisp.h (eassert): Assume C89 or later.
6911 This removes the need for CHECK.
6912 (CHECK): Remove. Its comments about always evaluating its
6913 argument were confusing, as 'eassert' typically does not evaluate
6914 its argument.
6915
27bb1ca4
PE
6916 * coding.c (produce_chars): Use ptrdiff_t, not int.
6917
9a900ca9
PE
6918 * xterm.c (x_draw_underwave): Check for integer overflow.
6919 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6920
41b7f8bc 69212012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
6922
6923 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6924 referenced (Bug#11583).
6925
9b0e3eba
AA
69262012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6927
6928 Implement wave-style variant of underlining.
6929 * dispextern.h (face_underline_type): New enum.
6930 (face): Add field for underline type.
6931 * nsterm.m (ns_draw_underwave): New function.
6932 (ns_draw_text_decoration): Use it.
6933 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6934 New functions.
6935 (x_draw_glyph_string): Use them.
6936 * xfaces.c (Qline, Qwave): New Lisp objects.
6937 (check_lface_attrs, merge_face_ref)
1053a871
SM
6938 (Finternal_set_lisp_face_attribute, realize_x_face):
6939 Handle wave-style underline face attributes.
9b0e3eba
AA
6940 * xterm.c (x_draw_underwave): New function.
6941 (x_draw_glyph_string): Use it.
6942
0fb52f11
JB
69432012-06-16 Juanma Barranquero <lekktu@gmail.com>
6944
6945 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6946 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6947 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6948 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6949 ($(BLD)/w32select.$(O)): Update dependencies.
6950
e5560ff7
AS
69512012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6952
6953 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6954 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6955 * character.c (_fetch_multibyte_char_p): Remove.
6956 * alloc.c: Include "character.h" before "buffer.h".
6957 * bidi.c: Likewise.
6958 * buffer.c: Likewise.
6959 * bytecode.c: Likewise.
6960 * callint.c: Likewise.
6961 * callproc.c: Likewise.
6962 * casefiddle.c: Likewise.
6963 * casetab.c: Likewise.
6964 * category.c: Likewise.
6965 * cmds.c: Likewise.
6966 * coding.c: Likewise.
6967 * composite.c: Likewise.
6968 * dired.c: Likewise.
6969 * dispnew.c: Likewise.
6970 * doc.c: Likewise.
6971 * dosfns.c: Likewise.
6972 * editfns.c: Likewise.
6973 * emacs.c: Likewise.
6974 * fileio.c: Likewise.
6975 * filelock.c: Likewise.
6976 * font.c: Likewise.
6977 * fontset.c: Likewise.
6978 * fringe.c: Likewise.
6979 * indent.c: Likewise.
6980 * insdel.c: Likewise.
6981 * intervals.c: Likewise.
6982 * keyboard.c: Likewise.
6983 * keymap.c: Likewise.
6984 * lread.c: Likewise.
6985 * macros.c: Likewise.
6986 * marker.c: Likewise.
6987 * minibuf.c: Likewise.
6988 * nsfns.m: Likewise.
6989 * nsmenu.m: Likewise.
6990 * print.c: Likewise.
6991 * process.c: Likewise.
6992 * regex.c: Likewise.
6993 * region-cache.c: Likewise.
6994 * search.c: Likewise.
6995 * syntax.c: Likewise.
6996 * term.c: Likewise.
6997 * textprop.c: Likewise.
6998 * undo.c: Likewise.
6999 * unexsol.c: Likewise.
7000 * w16select.c: Likewise.
7001 * w32fns.c: Likewise.
7002 * w32menu.c: Likewise.
7003 * window.c: Likewise.
7004 * xdisp.c: Likewise.
7005 * xfns.c: Likewise.
7006 * xmenu.c: Likewise.
7007 * xml.c: Likewise.
7008 * xselect.c: Likewise.
7009
2f07e6af
EZ
70102012-06-16 Eli Zaretskii <eliz@gnu.org>
7011
1053a871
SM
7012 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7013 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 7014 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
7015 row.
7016 (handle_face_prop): Use chunk-relative overlay string index when
7017 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
7018 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7019 the rightmost. (Bug#11720)
2f07e6af 7020
29b83cec
AS
70212012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7022
7023 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7024 (CATEGORY_MEMBER): Enforce 1/0 value.
7025 * category.c (_temp_category_set): Remove.
7026
4c5501e9
EZ
70272012-06-16 Eli Zaretskii <eliz@gnu.org>
7028
7029 * window.c (Fdelete_other_windows_internal)
7030 (Fdelete_window_internal): Don't access frame's mouse highlight
7031 info of the initial frame. (Bug#11677)
7032
2b570124
PE
70332012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7034
e93864f9
PE
7035 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7036 Assume USE_2_TAGS_FOR_INTS.
7037 (xreload): Adjust $tagmask width to match recent lisp.h change.
7038
2b570124
PE
7039 Simplify lisp.h in minor ways that should not affect code.
7040 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7041 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7042 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7043 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7044 (INTTYPEBITS): New macro, for clarity.
7045 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
7046 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7047 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
7048 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7049 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7050
81755f69
JB
70512012-06-13 Juanma Barranquero <lekktu@gmail.com>
7052
7053 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7054
16192a57
GM
70552012-06-13 Glenn Morris <rgm@gnu.org>
7056
7057 * s/bsd-common.h (BSD4_3):
7058 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7059
646b5f55
AS
70602012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7061
7062 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7063 instead of union.
7064 (XLI, XIL): Define.
1053a871
SM
7065 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7066 Use them.
7067 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 7068 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 7069 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
7070 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7071 * frame.c (delete_frame): Remove outdated comment.
7072 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7073 USE_LISP_UNION_TYPE.
7074 (Fw32_unregister_hot_key): Likewise.
7075 (Fw32_toggle_lock_key): Likewise.
7076 * w32menu.c (add_menu_item): Likewise.
7077 (w32_menu_display_help): Use XIL instead of checking
7078 USE_LISP_UNION_TYPE.
7079 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7080 (init_heap): Likewise.
7081 * w32term.c (w32_read_socket): Update comment.
7082
1d3823c9
GM
70832012-06-13 Glenn Morris <rgm@gnu.org>
7084
c62ff706
GM
7085 * s/usg5-4-common.h, src/s/unixware.h:
7086 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7087
1d3823c9
GM
7088 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7089
bfe3e0a2
PE
70902012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7091
7092 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7093 * alloc.c (make_number) [!defined make_number]:
7094 Remove, as lisp.h always defines this now.
7095 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7096 (roundup_size): Verify that it is a power of 2.
7097 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7098 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7099 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7100 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7101 USE_LSB_TAG now is always defined to be either 0 or 1.
7102 All uses changed.
7103 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7104 code works fine either way, and efficiency is not a concern here,
7105 as the union type is for debugging, not for production.
7106 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7107 Use an inline function on all platforms when using the union type,
7108 since this is simpler and 'static inline' can be used portably
7109 within Emacs now.
7110 (LISP_INITIALLY_ZERO): New macro.
7111 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7112 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7113
45fa9c0f
GM
71142012-06-12 Glenn Morris <rgm@gnu.org>
7115
b4492cba
GM
7116 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7117
7118 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 7119
45fa9c0f
GM
7120 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7121 Move BROKEN_SIGIO to configure.
7122
7123 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7124 Move NO_TERMIO to configure.
7125
0e25d334
CY
71262012-06-12 Chong Yidong <cyd@gnu.org>
7127
7128 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7129 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7130 MagickExportImagePixels is undefined.
7131
43682bb6
PE
71322012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7133
7134 * image.c (imagemagick_load_image): Remove unused label.
7135
a9be7d2b
GM
71362012-06-11 Glenn Morris <rgm@gnu.org>
7137
7138 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7139 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7140 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7141 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7142
3017f87f
SM
71432012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7144
7145 * alloc.c (make_byte_code): New function.
7146 (Fmake_byte_code): Use it. Don't purify here.
7147 * lread.c (read1): Use it as well to avoid extra allocation.
7148
1b9b4cf4
CY
71492012-06-11 Chong Yidong <cyd@gnu.org>
7150
7151 * image.c (imagemagick_load_image): Implement transparency.
7152
95988fcf
AS
71532012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7154
7155 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7156 account for preceding backslashes. (Bug#11663)
7157
cd4eb164
CY
71582012-06-09 Chong Yidong <cyd@gnu.org>
7159
7160 * term.c: Support italics in capable terminals (Bug#9652).
7161 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7162 (turn_on_face): Output using TS_enter_italic_mode if available.
7163 Don't handle unused blinking and alt-charset cases.
7164 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7165 and tty_alt_charset_p cases.
7166 (tty_capable_p, init_tty): Support italics.
7167
7168 * termchar.h (struct tty_display_info): Add field for italics.
7169 Remove unused blink field.
7170
7171 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7172 Handle slant.
7173
7174 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7175 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7176 tty_alt_charset_p. Add tty_italic_p.
7177
ff88beb8
MA
71782012-06-09 Michael Albinus <michael.albinus@gmx.de>
7179
7180 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
7181 dbus_type_is_basic if available.
7182 (xd_extract_signed, xd_extract_unsigned): Rename from
7183 extract_signed and extract_unsigned, respectively. Adapt callers.
7184
44286096
CY
71852012-06-09 Chong Yidong <cyd@gnu.org>
7186
1682701f
CY
7187 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
7188
44286096
CY
7189 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
7190 case (Bug#9752).
7191
d86feb17
PE
71922012-06-08 Paul Eggert <eggert@cs.ucla.edu>
7193
7194 * xdisp.c (vmessage): Treat frame message as multibyte.
7195 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
7196 would generate the diagnostic "Making \302\247 buffer-local while
7197 let-bound!".
7198
d5c20fe8
EZ
71992012-06-08 Eli Zaretskii <eliz@gnu.org>
7200
7201 * dispnew.c (showing_window_margins_p): Undo last change, which
7202 was done due to an inadvertent commit.
7203 (adjust_frame_glyphs_for_frame_redisplay): Do call
7204 showing_window_margins_p.
7205
513749ee
SM
72062012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7207
7208 * eval.c (Fmake_var_non_special): New primitive.
7209 (syms_of_eval): Defsubr it.
7210 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
7211
d4a8f5c1
JB
72122012-06-08 Juanma Barranquero <lekktu@gmail.com>
7213
7214 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
7215 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
7216
8bbbc977
EZ
72172012-06-08 Eli Zaretskii <eliz@gnu.org>
7218
7219 * alloc.c (allocate_vectorlike): Fix last change.
7220
f3372c87
DA
72212012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
7222
7223 Block-based vector allocation of small vectors.
7224 * lisp.h (struct vectorlike_header): New field `nbytes',
7225 adjust comment accordingly.
7226 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 7227 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
7228 mark_maybe_pointer, valid_lisp_object_p) accordingly.
7229 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
7230 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
7231 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
7232 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
7233 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
7234 (roundup_size): New constant.
7235 (struct vector_block): New data type.
7236 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 7237 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
7238 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
7239 (sweep_vectors): New functions.
7240 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 7241 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
7242 or equal to VBLOCK_BYTES_MAX.
7243 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
7244 (init_alloc_once): Add call to init_vectors.
7245
4f18a4ed
SM
72462012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7247
7248 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
7249
86f158bc
PE
72502012-06-07 Paul Eggert <eggert@cs.ucla.edu>
7251
7252 * doprnt.c (doprnt): Truncate multibyte char correctly.
7253 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
7254 would mishandle a string argument "Xc" if X was a multibyte
7255 character of length 2: it would truncate after X's first byte
7256 rather than including all of X.
7257
c5cfcbe0
CY
72582012-06-06 Chong Yidong <cyd@gnu.org>
7259
7260 * buffer.c (word_wrap): Doc fix.
7261
c05cf390
PE
72622012-06-04 Paul Eggert <eggert@cs.ucla.edu>
7263
7264 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
7265
0c3461de
GM
72662012-06-03 Glenn Morris <rgm@gnu.org>
7267
7268 * xdisp.c (tool-bar-style): Doc fix.
7269
c71232db
UM
72702012-06-03 Ulrich Müller <ulm@gentoo.org>
7271
7272 * Makefile.in (PAXCTL): Define.
7273 (temacs$(EXEEXT)): Disable memory randomization for the temacs
7274 binary via PaX flags if the paxctl utility is available.
7275 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7276 Restore PaX flags to their default. (Bug#11398)
7277
383f7350
CY
72782012-06-03 Chong Yidong <cyd@gnu.org>
7279
7280 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
7281 buffer (Bug#11226).
7282
5f2c76c6
CY
72832012-06-03 Chong Yidong <cyd@gnu.org>
7284
7285 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
7286 (note_mode_line_or_margin_highlight): If there is no help echo,
7287 use mode-line-default-help-echo. Handle the case where the mouse
7288 position is past the end of the mode line string.
7289
7290 * buffer.c (buffer_local_value_1): New function, split from
7291 Fbuffer_local_value; can return Qunbound.
7292 (Fbuffer_local_value): Use it.
7293 (Vmode_line_format): Docstring tweaks.
7294
773d47f6
PE
72952012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7296
7297 * sysdep.c (system_process_attributes): Improve comment.
7298
f2d6a3df
SM
72992012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
7300
7301 * keyboard.c: Export real-this-command to Elisp.
7302 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
7303 and DEFVAR it. Update all users.
7304
63810350
PE
73052012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7306
7bd5c1f4
PE
7307 * minibuf.c (Fassoc_string): Remove duplicate declaration.
7308
63810350
PE
7309 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
7310 Convert pctcpu and pctmem to Lisp float properly.
7311 Let the compiler fold better, as 100.0/0x8000 is exact.
7312
a2821611
AS
73132012-06-02 Andreas Schwab <schwab@linux-m68k.org>
7314
7315 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
7316 cons_block.
7317
5fceba1d
PE
73182012-06-01 Paul Eggert <eggert@cs.ucla.edu>
7319
7320 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
7321
c98ff5dd
DA
73222012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
7323
7324 For a 'struct window', replace some Lisp_Object fields to
7325 bitfields where appropriate, remove unused fields.
7326 * window.h (struct window): Remove unused 'last_mark_x' and
7327 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
7328 change it's type from Lisp_Object to bitfield.
7329 Change type of 'force_start', 'optional_new_start',
7330 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 7331 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 7332
ca34e0be
PE
73332012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7334
7335 Pacify gcc -Wdouble-precision when using Xaw.
7336 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
7337 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
7338 Use 'float' consistently, rather than 'float' in most places
7339 and 'double' in a couple of places.
7340
efc00ab1 73412012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
7342
7343 * xdisp.c (handle_stop): Detect whether we have overlay strings
7344 loaded by testing it->current.overlay_string_index to be
7345 non-negative, instead of checking whether n_overlay_strings is
7346 positive. (Bug#11587)
7347
efc00ab1 73482012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
7349
7350 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
7351
7352 * doc.c (Fsubstitute_command_keys): Doc fix.
7353
efc00ab1 73542012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
7355
7356 * search.c (search_buffer): Remove calls to
7357 r_alloc_inhibit_buffer_relocation, as it is now called by
7358 maybe_unify_char, which was the cause of relocation of buffer text
7359 in bug#11519.
7360
efc00ab1 73612012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
7362
7363 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
7364 for the duration of call to load_charset, to avoid problems with
7365 callers of maybe_unify_char that access buffer text through C
7366 pointers.
7367
7368 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
7369 decrement the inhibition flag, instead of just setting or
7370 resetting it.
7371
ba93a187
PE
73722012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7373
7374 Remove obsolete '#define static' cruft.
7375 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
7376 This #undef was "temporary" in 2000; it is no longer needed
7377 now that '#define static' has gone away.
7378 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
7379 (gray_bitmap_bits): Remove; no longer needed.
7380 All uses replaced with definiens.
7381 * xterm.c: Include "bitmaps/gray.xbm".
7382
9e4bf381
PE
73832012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7384
7385 Clean up __executable_start, monstartup when --enable-profiling.
7386 The following changes affect the code only when profiling.
7387 * dispnew.c (__executable_start): Rename from safe_bcopy.
7388 Define only on platforms that need it.
7389 * emacs.c: Include <sys/gmon.h> when profiling.
7390 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
7391 (__executable_start): Remove decl, since lisp.h does it now.
7392 (safe_bcopy): Remove decl; no longer has that name.
7393 (main): Coalesce #if into single bit of code, for simplicity.
7394 Cast pointers to uintptr_t, since standard libraries want integers
7395 and not pointers.
7396 * lisp.h (__executable_start): New decl.
7397
32d72c2f
GM
73982012-05-31 Glenn Morris <rgm@gnu.org>
7399
7400 * image.c (Fimagemagick_types): Doc fix.
7401
baac5bc7
JM
74022012-05-30 Jim Meyering <meyering@redhat.com>
7403
7404 * callproc.c (Fcall_process_region): Include directory component
7405 in mkstemp error message (Bug#11586).
7406
72cb32cf
PE
74072012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7408
7409 * alloc.c, lisp.h (make_pure_vector): Now static.
7410
61b108cc
SM
74112012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
7412
7413 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7414 Move to byte-run.el.
7415 (Fautoload): Do the hash-doc more carefully.
7416 * data.c (Fdefalias): Purify definition, except for keymaps.
7417 (Qdefun): Move from eval.c.
7418 * lisp.h (Qdefun): Remove.
7419 * lread.c (read1): Tiny simplification.
7420
471fe23d
TN
74212012-05-29 Troels Nielsen <bn.troels@gmail.com>
7422
934f3f58 7423 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
7424 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7425 Bug#9642, but explicitly check that the buffer the overlay would
7426 be moved to is live and rearrange lines to make sure that errors
7427 will not put the overlay in an inconsistent state.
7428 (Fdelete_overlay): Cosmetics.
7429
85d0efd1
EZ
74302012-05-28 Eli Zaretskii <eliz@gnu.org>
7431
7432 * w32term.c (my_bring_window_to_top): New function.
7433 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
7434 could be different from the original one.
7435 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
7436 (Bug#11513)
7437
7438 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7439 by calling BringWindowToTop.
7440
7441 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
7442 (WM_EMACS_END): Increase by one.
7443
da92a98c
PE
74442012-05-28 Paul Eggert <eggert@cs.ucla.edu>
7445
7446 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
7447 This avoids undefined behavior that might cause the eassert
7448 to not catch an out-of-range value.
7449
74d1f848
JB
74502012-05-28 Juanma Barranquero <lekktu@gmail.com>
7451
7452 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7453 Update dependencies.
7454
9e1a06fc
EZ
74552012-05-27 Eli Zaretskii <eliz@gnu.org>
7456
7457 * bidi.c (bidi_mirror_char): Fix last change.
7458
f3dd7312
AS
74592012-05-27 Andreas Schwab <schwab@linux-m68k.org>
7460
7461 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7462 when referring to sectname field in printf format.
7463
81899c91
PE
74642012-05-27 Paul Eggert <eggert@cs.ucla.edu>
7465
57b81a9f
PE
7466 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7467 Only r_alloc_inhibit_buffer_relocation needed to be added;
7468 the others were already declared.
7469
81899c91
PE
7470 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7471 before checking whether it's out of range. Put the check inside
7472 eassert. See
7473 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7474
33017faf 74752012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
7476
7477 * callproc.c (Fcall_process): Restore a line that was accidentally
7478 commented out in the 2011-02-13 change (bug#11547).
7479
33017faf 74802012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
7481
7482 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7483 defined on ralloc.c.
7484
7485 * buffer.c [REL_ALLOC]: Remove prototypes of
7486 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7487 they are now on lisp.h.
7488
7489 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7490
7491 * search.c (search_buffer): Use it to inhibit relocation of buffer
7492 text while re_search_2 is doing its job, because re_search_2 is
7493 passed C pointers to buffer text. (Bug#11519)
7494
23415acf
EZ
7495 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7496 Update value to 24.
7497
44e27368
EZ
7498 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7499 state after an additional call to move_it_in_display_line_to, keep
7500 the values of it->max_ascent and it->max_descent found for the
7501 entire line.
7502 (pos_visible_p): Revert the comparison against bottom_y to what it
7503 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7504 (Bug#11464)
7505
c1892f11
PE
75062012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7507
7508 Fix coding-related core dumps with gcc -ftrapv.
7509 The code was computing A - B, where A and B are pointers, and B is
7510 random garbage. This can lead to core dumps on platforms that
7511 have special pointer registers, and it also leads to core dumps on
7512 x86-64 when compiled with gcc -ftrapv. The fix is to compute
7513 A - B only when B is initialized properly.
7514 * coding.c (coding_set_source, coding_set_destination): Return void.
7515 (coding_change_source, coding_change_destinations): New functions,
7516 with the old behaviors of coding_set_source and coding_set_destination.
7517 All callers that need an offset changed to use these new functions.
7518
eb7afdad
GM
75192012-05-26 Glenn Morris <rgm@gnu.org>
7520
7521 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
7522
f12fdf02
EZ
75232012-05-26 Eli Zaretskii <eliz@gnu.org>
7524
53a63be6 7525 Extend mouse support on W32 text-mode console.
61b108cc
SM
7526 * xdisp.c (draw_row_with_mouse_face):
7527 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 7528
eb3f6f01 7529 * w32console.c: Include window.h.
61b108cc
SM
7530 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
7531 New functions.
eb3f6f01
EZ
7532 (initialize_w32_display): Initialize mouse-highlight data.
7533
53a63be6
EZ
7534 * w32inevt.c: Include termchar.h and window.h.
7535 (do_mouse_event): Support mouse-autoselect-window. When the mouse
7536 moves, call note_mouse_highlight. If help_echo changed, call
7537 gen_help_event to produce help-echo message in the echo area.
7538 Call clear_mouse_face if mouse_face_hidden is set in the mouse
7539 highlight info.
7540
4cfd81f6
PE
75412012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7542
7543 * lread.c (read1): Simplify slightly to avoid an overflow warning
7544 with GCC 4.7.0 on x86-64.
7545
4446092a
EZ
75462012-05-26 Eli Zaretskii <eliz@gnu.org>
7547
7548 * bidi.c (bidi_mirror_char): Revert last change: an int is
7549 definitely wide enough here.
7550
42b2a986 75512012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 7552
42b2a986 7553 Fix integer width and related bugs (Bug#9874).
eb106a49 7554 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
7555 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
7556 (string_bytes, check_sblock, allocate_string_data):
7557 (compact_small_strings, Fmake_bool_vector, make_string)
7558 (make_unibyte_string, make_multibyte_string)
7559 (make_string_from_bytes, make_specified_string)
7560 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
7561 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
7562 (mark_vectorlike):
7563 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7564 (allocate_pseudovector):
7565 Use int, not EMACS_INT, where int is wide enough.
7566 (inhibit_garbage_collection, Fgarbage_collect):
7567 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7568 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
7569 int might not be wide enough.
7570 (bidi_cache_search, bidi_cache_find, bidi_init_it)
7571 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
7572 (bidi_at_paragraph_end, bidi_find_paragraph_start)
7573 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7574 (bidi_level_of_next_char, bidi_move_to_visually_next):
7575 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7576 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
7577 (Fkill_buffer, Fset_buffer_major_mode)
7578 (advance_to_char_boundary, Fbuffer_swap_text)
7579 (Fset_buffer_multibyte, overlays_at, overlays_in)
7580 (overlay_touches_p, struct sortvec, record_overlay_string)
7581 (overlay_strings, recenter_overlay_lists)
7582 (adjust_overlays_for_insert, adjust_overlays_for_delete)
7583 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
7584 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
7585 (Foverlay_recenter, last_overlay_modification_hooks_used)
7586 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7587 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
7588 (validate_region): Omit unnecessary test for b <= e,
7589 since that's guaranteed by the previous test.
d311d28c
PE
7590 (adjust_overlays_for_delete): Avoid pos + length overflow.
7591 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7592 (report_overlay_modification):
7593 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7594 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7595 Omit pointer cast, which isn't needed anyway, and doesn't work
7596 after the EMACS_INT -> ptrdiff_t change.
02481186 7597 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
7598 * buffer.h: Adjust decls to match defn changes elsewhere.
7599 (struct buffer_text, struct buffer):
7600 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7601 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
7602 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7603 not int, to avoid needless 32-bit limit on 64-bit hosts.
7604 (exec_byte_code): Use tighter memory-full test, one that checks
7605 for alloca overflow. Don't compute the address of the object just
7606 before an array, as that's not portable. Use EMACS_INT, not
7607 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
7608 * callint.c (Fcall_interactively):
7609 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7610 * callproc.c (call_process_kill, Fcall_process):
7611 Don't assume pid_t fits into an Emacs fixnum.
7612 (call_process_cleanup, Fcall_process, child_setup):
7613 Don't assume pid_t fits into int.
7614 (call_process_cleanup, Fcall_process, delete_temp_file)
7615 (Fcall_process_region):
7616 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7617 (Fcall_process): Simplify handling of volatile integers.
7618 Use int, not EMACS_INT, where int will do.
7619 * casefiddle.c (casify_object, casify_region, operate_on_word)
7620 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7621 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7622 (casify_object): Avoid integer overflow when overallocating buffer.
7623 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 7624 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
7625 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7626 * category.h (CATEGORYP): Don't assume arg is nonnegative.
7627 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7628 integers are now checked earlier. All uses replaced with XINT.
7629 (ccl_driver):
7630 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7631 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
7632 (ccl_driver, Fregister_code_conversion_map):
7633 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
7634 (resolve_symbol_ccl_program): Check that vector header is in range.
7635 Always copy the vector, so that we can check its contents reliably
7636 now rather than having to recheck each instruction as it's being
7637 executed. Check that vector words fit in 'int'.
7638 (ccl_get_compiled_code, Fregister_ccl_program)
7639 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7640 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7641 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7642 contents are in range.
7643 (Fccl_execute_on_string): Check that status is in range.
7644 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7645 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7646 Accept and return EMACS_INT, not int, because callers can pass values
7647 out of 'int' range.
7648 (c_string_width, strwidth, lisp_string_width, chars_in_text)
7649 (multibyte_chars_in_text, parse_str_as_multibyte)
7650 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7651 (str_as_unibyte, str_to_unibyte, string_count_byte8)
7652 (string_escape_byte8, Fget_byte):
7653 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 7654 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
7655 avoid mishandling large integers.
7656 * character.h: Adjust decls to match defn changes elsewhere.
7657 * charset.c (load_charset_map_from_file, find_charsets_in_text)
7658 (Ffind_charset_region):
7659 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7660 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7661 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 7662 Don't assume fixnum fits in int.
d311d28c
PE
7663 (load_charset_map_from_vector, Fmap_charset_chars):
7664 Remove now-unnecessary CHECK_NATNUMs.
7665 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
7666 Don't rely on undefined behavior with signed left shift overflow.
7667 Don't assume unsigned int fits into fixnum, or that fixnum fits
7668 into unsigned int. Don't require max_code to be a valid fixnum;
7669 that's not true for gb10830 4-byte on a 32-bit host. Allow
7670 invalid_code to be a cons, for the same reason. Require code_offset
7671 to be a character. Avoid int overflow if max_char is close
7672 to INT_MAX.
7673 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7674 this is intended anyway and avoids some undefined behavior.
7675 (load_charset_map): Pass unsigned, not int, as 2nd arg of
7676 INDEX_TO_CODE_POINT, as that's what it expects.
7677 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
7678 * charset.h (DECODE_CHAR): Return int, not unsigned;
7679 this is what was intended anyway, and it avoids undefined behavior.
7680 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
7681 integer-overflow issues.
7682 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
7683 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
7684 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
7685 * chartab.c (Fmake_char_table, Fset_char_table_range)
7686 (uniprop_get_decoder, uniprop_get_encoder):
7687 Don't assume fixnum fits in int.
7688 * cmds.c (move_point): New function, that does the gist of
7689 Fforward_char and Fbackward_char, but does so while checking
7690 for integer overflow more accurately.
c96e5d6a 7691 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
7692 (Fforward_line, Fend_of_line, internal_self_insert)
7693 (internal_self_insert):
7694 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7695 Fix a FIXME, by checking for integer overflow when calculating
7696 target_clm and actual_clm.
7697 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 7698 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
7699 (ASSURE_DESTINATION, coding_alloc_by_realloc)
7700 (coding_alloc_by_making_gap, alloc_destination)
7701 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
7702 (encode_coding_utf_16, detect_coding_emacs_mule)
7703 (decode_coding_emacs_mule, encode_coding_emacs_mule)
7704 (detect_coding_iso_2022, decode_coding_iso_2022)
7705 (encode_invocation_designation, encode_designation_at_bol)
7706 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7707 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7708 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7709 (encode_coding_ccl, encode_coding_raw_text)
7710 (detect_coding_charset, decode_coding_charset)
7711 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7712 (produce_composition, produce_charset, produce_annotation)
7713 (decode_coding, handle_composition_annotation)
7714 (handle_charset_annotation, consume_chars, decode_coding_gap)
7715 (decode_coding_object, encode_coding_object, detect_coding_system)
7716 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7717 (code_convert_region, code_convert_string)
8f50130c
PE
7718 (Fdefine_coding_system_internal)
7719 (coding_set_source, coding_set_destination):
d311d28c
PE
7720 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7721 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7722 (Fdefine_coding_system_internal):
7723 Don't assume fixnums fit in int.
7724 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 7725 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
7726 (Funencodable_char_position, Fcheck_coding_systems_region)
7727 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 7728 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 7729 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 7730 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 7731 Don't access memory outside of the args array.
d311d28c 7732 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
7733 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7734 result of ENCODE_CHAR.
d311d28c
PE
7735 * coding.h: Adjust decls to match defn changes elsewhere.
7736 (struct coding_system):
7737 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7738 * composite.c (get_composition_id, find_composition)
7739 (run_composition_function, update_compositions)
7740 (compose_text, composition_gstring_put_cache)
7741 (composition_gstring_p, composition_gstring_width)
7742 (fill_gstring_header, fill_gstring_body, autocmp_chars)
7743 (composition_compute_stop_pos, composition_reseat_it)
7744 (composition_update_it, struct position_record)
7745 (find_automatic_composition, composition_adjust_point)
7746 (Fcomposition_get_gstring, Ffind_composition_internal):
7747 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7748 (update_compositions):
7749 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7750 * composite.h: Adjust decls to match defn changes elsewhere.
7751 (struct composition):
7752 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7753 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7754 Do not attempt to compute the address of the object just before a
7755 buffer; this is not portable.
7756 (Faref, Faset):
7757 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7758 (Faset): Use int, not EMACS_INT, where int is wide enough.
7759 (Fstring_to_number): Don't assume fixnums fit in int.
7760 (Frem): Don't assume arg is nonnegative.
7761 * dbusbind.c (xd_append_arg): Check for integers out of range.
7762 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 7763 (extract_signed, extract_unsigned): New functions.
243e0530
PE
7764 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7765 (xd_get_connection_references): Return ptrdiff_t, not int.
7766 All uses changed.
7767 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7768 (xd_read_message_1):
7769 Use int, not unsigned, where the dbus API uses int.
7770 (Fdbus_message_internal): Don't overflow mtype.
7771 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
7772 * dired.c (directory_files_internal, file_name_completion, scmp)
7773 (file_name_completion_stat):
7774 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7775 (file_name_completion): Don't overflow matchcount.
7776 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7777 * dispextern.h: Adjust decls to match defn changes elsewhere.
7778 (struct text_pos, struct glyph, struct bidi_saved_info)
7779 (struct bidi_string_data, struct bidi_it, struct composition_it)
7780 (struct it):
7781 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7782 (struct display_pos, struct composition_it, struct it):
7783 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7784 * dispnew.c (increment_matrix_positions)
7785 (increment_row_positions, mode_line_string)
7786 (marginal_area_string):
7787 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 7788 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
7789 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7790 (duration_to_sec_usec): New function, to check for overflow better.
7791 (Fsleep_for, sit_for): Use it.
7792 * doc.c (get_doc_string, store_function_docstring):
7793 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7794 (get_doc_string, Fsnarf_documentation):
7795 Use int, not EMACS_INT, where int is wide enough.
7796 (get_doc_string):
7797 Use SAFE_ALLOCA, not alloca.
7798 Check for overflow when converting EMACS_INT to off_t.
7799 * doprnt.c (doprnt):
7800 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7801 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7802 Don't assume uid_t fits into fixnum.
7803 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7804 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7805 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7806 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7807 (general_insert_function)
7808 (Finsert_char, make_buffer_string, make_buffer_string_both)
7809 (update_buffer_properties, Fbuffer_substring)
7810 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7811 (Fsubst_char_in_region, check_translation)
7812 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7813 (transpose_markers, Ftranspose_regions):
7814 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7815 (clip_to_bounds): Move to lisp.h as an inline function).
7816 (Fconstrain_to_field): Don't assume integers are nonnegative.
7817 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7818 (Fsubst_char_in_region, Fsave_restriction):
7819 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7820 (Femacs_pid): Don't assume pid_t fits into fixnum.
7821 (lo_time): Use int, not EMACS_INT, when int suffices.
7822 (lisp_time_argument): Check for usec out of range.
7823 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
7824 (Fuser_login_name, Fuser_full_name): Signal an error
7825 if a uid argument is out of range, rather than relying on
7826 undefined behavior.
c8d5c857
PE
7827 (Fformat_time_string): Remove now-unnecessary check.
7828 lisp_time_argument checks for out-of-range usec now.
243e0530 7829 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
7830 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7831 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7832 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7833 (init_cmdargs, Fdump_emacs):
7834 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7835 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7836 the bottom (typically) 32 bits of the fixnum.
7837 * eval.c (specpdl_size, call_debugger):
7838 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7839 (when_entered_debugger, Fbacktrace_debug):
7840 Don't assume fixnum can fit in int.
7841 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7842 the object just before a buffer; this is not portable.
7843 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7844 (grow_specpdl, unbind_to):
7845 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7846 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7847 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 7848 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
7849 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7850 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7851 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7852 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7853 (a_write, e_write):
7854 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7855 (Fcopy_file, non_regular_nbytes, read_non_regular)
7856 (Finsert_file_contents):
7857 Use int, not EMACS_INT, where int is wide enough.
7858 (READ_BUF_SIZE): Verify that it fits in int.
7859 (Finsert_file_contents): Check that counts are in proper range,
7860 rather than assuming fixnums fit into ptrdiff_t etc.
7861 Don't assume fixnums fit into int.
125b3835 7862 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
7863 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7864 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
7865 (string_char_to_byte, string_byte_to_char)
7866 (string_make_multibyte, string_to_multibyte)
7867 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7868 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7869 (substring_both, Fdelete, internal_equal, Ffillarray)
7870 (Fclear_string, mapcar1)
7871 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7872 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7873 (larger_vector, make_hash_table, maybe_resize_hash_table)
7874 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7875 (Fmaphash, secure_hash):
7876 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7877 (concat): Check for string index and length overflow.
7878 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7879 (Frequire):
7880 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7881 (larger_vector): New API (vec, incr_min, size_max) replaces old
7882 one (vec, new_size, init). This catches size overflow.
7883 INIT was removed because it was always Qnil.
7884 All callers changed.
7885 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7886 the upper bound on a hash table index size.
7887 (make_hash_table, maybe_resize_hash_table): Use it.
7888 (secure_hash): Computer start_byte and end_byte only after
7889 they're known to be in ptrdiff_t range.
7890 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7891 (Ffont_get_glyphs, Ffont_at):
7892 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7893 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7894 (Flist_fonts, Fopen_font):
7895 Don't assume fixnum can fit in int.
7896 (check_gstring): Don't assume index can fit in int.
7897 (font_match_p): Check that fixnum is a character, not a nonnegative
7898 fixnum, since the later code needs to stuff it into an int.
7899 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7900 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7901 conversion overflow issues.
7902 (Fopen_font): Check for integer out of range.
7903 (Ffont_get_glyphs): Don't assume index can fit in int.
7904 * font.h: Adjust decls to match defn changes elsewhere.
7905 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7906 integer overflow.
7907 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7908 printmax_t, where ptrdiff_t is wide enough.
7909 (Finternal_char_font):
7910 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7911 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7912 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7913 (Fset_frame_position, x_set_frame_parameters)
7914 (x_set_line_spacing, x_set_border_width)
7915 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7916 Check that fixnums are in proper range for system types.
7917 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7918 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7919 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7920 Use SAFE_ALLOCA_LISP, not alloca.
7921 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7922 intptr_t is wide enough.
7923 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7924 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7925 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7926 Check for fixnum out of range.
7927 * ftfont.c (ftfont_list): Don't assume index fits in int.
7928 Check that fixnums are in proper range for system types.
7929 (ftfont_shape_by_flt):
7930 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
7931 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7932 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7933 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7934 Check that fixnums are in proper range for system types.
7935 * gnutls.h: Adjust decls to match defn changes elsewhere.
7936 * gtkutil.c (xg_dialog_run):
7937 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7938 (update_frame_tool_bar):
7939 Check that fixnums are in proper range for system types.
7940 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 7941 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
7942 * indent.c (last_known_column, last_known_column_point):
7943 (current_column_bol_cache):
7944 (skip_invisible, current_column, check_display_width):
7945 (check_display_width, scan_for_column, current_column_1)
7946 (Findent_to, Fcurrent_indentation, position_indentation)
7947 (indented_beyond_p, Fmove_to_column, compute_motion):
7948 (Fcompute_motion, Fvertical_motion):
7949 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7950 (last_known_column_modified): Use EMACS_INT, not int.
7951 (check_display_width):
7952 (Fcompute_motion):
7953 Check that fixnums and floats are in proper range for system types.
7954 (compute_motion): Don't assume index or fixnum fits in int.
7955 (compute_motion, Fcompute_motion):
7956 Use int, not EMACS_INT, when it is wide enough.
7957 (vmotion): Omit local var start_hpos that is always 0; that way
7958 we don't need to worry about overflow in expressions involving it.
7959 * indent.h: Adjust decls to match defn changes elsewhere.
7960 (struct position):
7961 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7962 Use int, not EMACS_INT, where int is wide enough.
7963 Remove unused members ovstring_chars_done and tab_offset;
7964 all uses removed.
7965 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7966 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7967 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7968 (make_gap, copy_text, insert, insert_and_inherit)
7969 (insert_before_markers, insert_before_markers_and_inherit)
7970 (insert_1, count_combining_before, count_combining_after)
7971 (insert_1_both, insert_from_string)
7972 (insert_from_string_before_markers, insert_from_string_1)
7973 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7974 (adjust_after_replace, adjust_after_insert, replace_range)
7975 (replace_range_2, del_range, del_range_1, del_range_byte)
7976 (del_range_both, del_range_2, modify_region)
7977 (prepare_to_modify_buffer, signal_before_change)
7978 (signal_after_change, Fcombine_after_change_execute):
7979 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7980 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7981 (balance_an_interval, split_interval_right, split_interval_left)
7982 (find_interval, next_interval, update_interval)
7983 (adjust_intervals_for_insertion, delete_node, delete_interval)
7984 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7985 (static_offset_intervals, offset_intervals)
7986 (merge_interval_right, merge_interval_left, make_new_interval)
7987 (graft_intervals_into_buffer, temp_set_point_both)
7988 (temp_set_point, set_point, adjust_for_invis_intang)
7989 (set_point_both, move_if_not_intangible, get_property_and_range)
7990 (get_local_map, copy_intervals, copy_intervals_to_string)
7991 (compare_string_intervals, set_intervals_multibyte_1):
7992 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7993 * intervals.h: Adjust decls to match defn changes elsewhere.
7994 (struct interval):
7995 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7996 * keyboard.c (this_command_key_count, this_single_command_key_start)
7997 (before_command_key_count, before_command_echo_length, echo_now)
7998 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7999 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8000 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8001 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8002 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8003 (last_non_minibuf_size, last_point_position, echo_truncate)
8004 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8005 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8006 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8007 (stuff_buffered_input):
8008 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8009 (last_auto_save, command_loop_1, read_char):
8010 Use EMACS_INT, not int, to avoid integer overflow.
8011 (record_char): Avoid overflow in total_keys computation.
8012 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8013 * keyboard.h: Adjust decls to match defn changes elsewhere.
8014 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8015 (Fkey_description, Fdescribe_vector, Flookup_key):
8016 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8017 (click_position): New function, to check that positions are in range.
8018 (Fcurrent_active_maps):
8019 (describe_command):
8020 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8021 (Faccessible_keymaps, Fkey_description):
8022 (preferred_sequence_p):
8023 Don't assume fixnum can fit into int.
8024 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8025 Check for integer overflow in size calculations.
8026 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8027 avoid mishandling large integers.
8028 * lisp.h: Adjust decls to match defn changes elsewhere.
8029 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8030 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8031 (struct Lisp_Marker):
8032 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8033 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
8034 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8035 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8036 All callers changed.
8037 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8038 Assume the arg has valid form, since it always does.
8039 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8040 unsigned integer system type.
8041 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8042 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8043 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8044 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8045 (duration_to_sec_usec): New decl.
8046 * lread.c (read_from_string_index, read_from_string_index_byte)
8047 (read_from_string_limit, readchar, unreadchar, openp)
8048 (read_internal_start, read1, oblookup):
8049 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8050 (Fload, readevalloop, Feval_buffer, Feval_region):
8051 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8052 (openp): Check for out-of-range argument to 'access'.
8053 (read1): Use int, not EMACS_INT, where int is wide enough.
8054 Don't assume fixnum fits into int.
6efdadfd 8055 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
8056 (read_filtered_event): Use duration_to_sec_usec
8057 to do proper overflow checking on durations.
d311d28c
PE
8058 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8059 in size calculation.
8060 (Fexecute_kbd_macro):
8061 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8062 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8063 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8064 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8065 (set_marker_both, set_marker_restricted_both, marker_position)
8066 (marker_byte_position, Fbuffer_has_markers_at):
8067 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8068 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 8069 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
8070 It now merely ensures that the menu is large enough, without
8071 necessarily growing it, as this avoids some integer overflow issues.
8072 All callers changed.
8073 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8074 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8075 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8076 Use SAFE_ALLOCA_LISP, not alloca.
8077 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8078 to EMACS_INT. Check that fixnums are in proper range for system types.
8079 * minibuf.c (minibuf_prompt_width, string_to_object)
8080 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8081 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8082 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8083 (get_minibuffer, read_minibuf_unwind):
8084 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8085 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8086 this simplifies overflow checking. All callers changed.
8087 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8088 (Ftest_completion):
8089 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8090 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8091 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8092 Check that fixnums are in proper range for system types.
8093 (Fx_create_frame, Fx_show_tip):
8094 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8095 * nsfont.m (ns_findfonts, nsfont_list_family):
8096 Don't assume fixnum fits in long.
8097 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8098 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8099 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8100 wide enough.
17fdb222 8101 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
8102 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8103 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8104 (PRINTDECLARE, PRINTPREPARE):
8105 (strout, print_string):
8106 (print, print_preprocess, print_check_string_charset_prop)
8107 (print_object):
8108 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8109 (PRINTDECLARE):
8110 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8111 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8112 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 8113 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 8114 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
8115 (print_error_message): Use SAFE_ALLOCA, not alloca.
8116 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
8117 (print_depth, new_backquote_output, print_number_index):
8118 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
8119 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8120 (Fset_process_window_size, Fformat_network_address)
8121 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 8122 (sigchld_handler):
d311d28c 8123 Check that fixnums are in proper range for system types.
d44287d4 8124 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
8125 Check for process-ids out of pid_t range rather than relying on
8126 undefined behavior.
e4d81efc 8127 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
8128 (Fformat_network_address, read_process_output, send_process)
8129 (Fprocess_send_region, status_notify):
8130 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8131 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8132 (wait_reading_process_output, read_process_output, exec_sentinel):
8133 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8134 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8135 (Faccept_process_output): Use duration_to_sec_usec to do proper
8136 overflow checking on durations.
dde14581
PE
8137 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8138 Don't assume pid_t fits in int.
02481186
PE
8139 * process.h (struct Lisp_Process): Members tick and update_tick
8140 are now of type EMACS_INT, not int.
b62b53e8
PE
8141 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8142 configured --with-wide-int.
d311d28c
PE
8143 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8144 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8145 * search.c (looking_at_1, string_match_1):
8146 (fast_string_match, fast_c_string_match_ignore_case)
8147 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8148 (scan_newline, find_before_next_newline, search_command)
8149 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8150 (set_search_regs, wordify):
8151 (Freplace_match):
8152 (Fmatch_data):
8153 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8154 (string_match_1, search_buffer, set_search_regs):
8155 (Fmatch_data):
8156 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8157 (wordify): Check for overflow in size calculation.
8158 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8159 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8160 Check that fixnums are in proper range for system types.
8161 * sound.c (struct sound_device)
8162 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8163 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8164 (Fplay_sound_internal):
8165 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 8166 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
8167 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8168 (Fparse_partial_sexp):
8169 Don't assume fixnums can fit in int.
8170 (struct lisp_parse_state, find_start_pos, find_start_value)
8171 (find_start_value_byte, find_start_begv)
8172 (update_syntax_table, char_quoted, dec_bytepos)
8173 (find_defun_start, prev_char_comend_first, back_comment):
8174 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8175 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8176 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8177 (Finternal_describe_syntax_value): Check that match_lisp is a
8178 character, not an integer, since the code stuffs it into int.
8179 (scan_words, scan_sexps_forward):
8180 Check that fixnums are in proper range for system types.
8181 (Fforward_word):
8182 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8183 (scan_sexps_forward):
8184 Use CHARACTERP, not INTEGERP, since the value must fit into int.
8185 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
8186 * syntax.h: Adjust decls to match defn changes elsewhere.
8187 (struct gl_state_s):
8188 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
8189 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
8190 MOST_POSITIVE_FIXNUM.
d311d28c
PE
8191 * sysdep.c (wait_for_termination_1, wait_for_termination)
8192 (interruptible_wait_for_termination, mkdir):
8193 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
8194 (emacs_read, emacs_write):
8195 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
8196 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
8197 and double all fit in int.
d311d28c
PE
8198 * term.c (set_tty_color_mode):
8199 Check that fixnums are in proper range for system types.
8200 * termhooks.h (struct input_event):
8201 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8202 * textprop.c (validate_interval_range, interval_of)
8203 (Fadd_text_properties, set_text_properties_1)
8204 (Fremove_text_properties, Fremove_list_of_text_properties)
8205 (Ftext_property_any, Ftext_property_not_all)
8206 (copy_text_properties, text_property_list, extend_property_ranges)
8207 (verify_interval_modification):
8208 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8209 (Fnext_single_char_property_change)
8210 (Fprevious_single_char_property_change):
8211 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
8212 (copy_text_properties):
8213 Check for integer overflow in index calculation.
d311d28c
PE
8214 * undo.c (last_boundary_position, record_point, record_insert)
8215 (record_delete, record_marker_adjustment, record_change)
8216 (record_property_change):
8217 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8218 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
8219 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8220 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8221 (Fx_hide_tip, Fx_file_dialog):
8222 * w32menu.c (set_frame_menubar):
8223 Use ptrdiff_t, not int, for consistency with rest of code.
8224 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
8225 (select_window, Fdelete_other_windows_internal)
8226 (window_scroll_pixel_based, window_scroll_line_based)
8227 (Frecenter, Fset_window_configuration):
8228 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8229 (Fset_window_hscroll, run_window_configuration_change_hook)
8230 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 8231 (Fscroll_other_window, Frecenter):
d311d28c
PE
8232 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8233 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
8234 Don't assume fixnum fits in int.
8235 (Fset_window_scroll_bars):
8236 Check that fixnums are in proper range for system types.
8237 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
8238 (string_pos, c_string_pos, number_of_chars, init_iterator)
8239 (in_ellipses_for_invisible_text_p, init_from_display_pos)
8240 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
8241 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
8242 (face_before_or_after_it_pos, handle_invisible_prop)
8243 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
8244 (display_prop_intangible_p, string_buffer_position_lim)
8245 (string_buffer_position, handle_composition_prop, load_overlay_strings)
8246 (get_overlay_strings_1, get_overlay_strings)
8247 (iterate_out_of_display_property, forward_to_next_line_start)
8248 (back_to_previous_visible_line_start, reseat, reseat_to_string)
8249 (get_next_display_element, set_iterator_to_next)
8250 (get_visually_first_element, compute_stop_pos_backwards)
8251 (handle_stop_backwards, next_element_from_buffer)
8252 (move_it_in_display_line_to, move_it_in_display_line)
8253 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8254 (add_to_log, message_dolog, message_log_check_duplicate)
8255 (message2, message2_nolog, message3, message3_nolog
8256 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
8257 (current_message_1, truncate_echo_area, truncate_message_1)
8258 (set_message, set_message_1, store_mode_line_noprop)
8259 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
8260 (text_outside_line_unchanged_p, check_point_in_composition)
8261 (reconsider_clip_changes)
8262 (redisplay_internal, set_cursor_from_row, try_scrolling)
8263 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
8264 (redisplay_window, find_last_unchanged_at_beg_row)
8265 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
8266 (trailing_whitespace_p, find_row_edges, display_line)
8267 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
8268 (display_mode_element, store_mode_line_string)
8269 (pint2str, pint2hrstr, decode_mode_spec)
8270 (display_count_lines, display_string, draw_glyphs)
8271 (x_produce_glyphs, x_insert_glyphs)
8272 (rows_from_pos_range, mouse_face_from_buffer_pos)
8273 (fast_find_string_pos, mouse_face_from_string_pos)
8274 (note_mode_line_or_margin_highlight, note_mouse_highlight):
8275 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8276 (safe_call, init_from_display_pos, handle_fontified_prop)
8277 (handle_single_display_spec, load_overlay_strings)
8278 (with_echo_area_buffer, setup_echo_area_for_printing)
8279 (display_echo_area, echo_area_display)
8280 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
8281 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
8282 (redisplay_window, dump_glyph_row, display_mode_line)
8283 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 8284 (handle_display_spec, display_prop_string_p):
d311d28c
PE
8285 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8286 (handle_single_display_spec, build_desired_tool_bar_string)
8287 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
8288 (get_specified_cursor_type):
8289 Check that fixnums are in proper range for system types.
8290 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
8291 (Flookup_image_map):
8292 Don't assume fixnums fit in int.
8293 (compare_overlay_entries):
8294 Avoid mishandling comparisons due to subtraction overflow.
8295 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
8296 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
8297 (handle_tool_bar_click):
8298 Use int, not unsigned, since we prefer signed and the signedness
8299 doesn't matter here.
8300 (get_next_display_element, next_element_from_display_vector):
8301 Use int, not EMACS_INT, when int is wide enough.
8302 (start_hourglass): Use duration_to_sec_usec to do proper
8303 overflow checking on durations.
8304 * xfaces.c (Fbitmap_spec_p):
8305 Check that fixnums are in proper range for system types.
8306 (compare_fonts_by_sort_order):
8307 Avoid mishandling comparisons due to subtraction overflow.
8308 (Fx_family_fonts, realize_basic_faces):
8309 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8310 (Fx_family_fonts):
8311 Don't assume fixnum fits in int.
8312 Use SAFE_ALLOCA_LISP, not alloca.
8313 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
8314 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
8315 (face_at_buffer_position, face_for_overlay_string)
8316 (face_at_string_position):
8317 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8318 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
8319 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
8320 (Fx_show_tip):
8321 Check that fixnums are in proper range for system types.
8322 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8323 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
8324 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8325 (Fx_change_window_property): Don't assume fixnums fit in int.
8326 * xfont.c (xfont_chars_supported):
8327 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8328 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
8329 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
8330 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8331 * xml.c (parse_region):
8332 * xrdb.c (magic_file_p):
8333 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8334 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
8335 (x_get_local_selection, x_reply_selection_request)
8336 (x_handle_selection_request, wait_for_property_change):
8337 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8338 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
8339 short is wide enough.
8340 (x_send_client_event): Don't assume fixnum fits in int.
8341 * xterm.c (x_x_to_emacs_modifiers):
8342 Don't assume EMACS_INT overflows nicely into int.
8343 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
8344 may come from Lisp.
8345 (handle_one_xevent): NATNUMP can eval its arg twice.
8346 (x_connection_closed):
8347 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8348 * xterm.h: Adjust decls to match defn changes elsewhere.
8349 (struct scroll_bar): Use struct vectorlike_header
8350 rather than rolling our own approximation.
8351 (SCROLL_BAR_VEC_SIZE): Remove; not used.
8352
c6574eb5
GM
83532012-05-25 Glenn Morris <rgm@gnu.org>
8354
8355 * lisp.mk (lisp): Update for more files being compiled now.
8356
e8d32c7e
SM
83572012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
8358
48def666
SM
8359 * lread.c: Remove `read_pure' which makes no difference.
8360 (read_pure): Remove var.
8361 (unreadpure): Remove function.
8362 (readevalloop): Don't call read_list with -1 flag.
8363 (read1, read_vector): Don't test read_pure any more.
8364 (read_list): Simplify.
8365
e8d32c7e
SM
8366 * fileio.c, character.h: Minor style tweaks.
8367
4b2addb7
DA
83682012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
8369
8370 * window.h (clip_changed): Remove useless declaration.
8371
584461b2
JB
83722012-05-22 Juanma Barranquero <lekktu@gmail.com>
8373
8374 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
8375 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
8376
34374650
PE
83772012-05-22 Paul Eggert <eggert@cs.ucla.edu>
8378
8379 Remove src/m/*.
8380 This directory predates autoconf and is no longer needed nowadays.
8381 Move its few remaining bits of functionality to where they're needed.
8382 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8383 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8384 * m/template.h: Remove.
8385 * Makefile.in (M_FILE): Remove. All uses removed.
8386 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
8387 * lisp.h (USE_LSB_TAG):
8388 * mem-limits.h (EXCEEDS_LISP_PTR):
8389 Use VAL_MAX, not VALBITS, in #if.
8390 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
8391 (EMACS_UINT): Define unconditionally now.
8392 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
8393 (BITS_PER_EMACS_INT): New constants, replacing
8394 what used to be in config.h, but not useful in #if.
8395 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
8396 define them any more.
8397 (VAL_MAX): New macro.
8398 (VALMASK): Use it.
8399 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
8400 BITS_PER_EMACS_INT, in #if.
8401 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8402 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
8403 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8404 * s/ms-w32.h (DATA_START):
8405 Move here from removed file m/intel386.h.
8406 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8407 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8408
261cb4bb
PE
84092012-05-21 Paul Eggert <eggert@cs.ucla.edu>
8410
8411 Assume C89 or later.
8412 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8413 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8414 (xrealloc):
8415 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8416 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8417 * textprop.c, tparam.c (NULL): Remove.
8418 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8419 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8420 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
8421 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8422 * xterm.c (input_signal_count): Assume volatile works.
8423
ff23cd9f
KB
84242012-05-21 Ken Brown <kbrown@cornell.edu>
8425
8426 * xgselect.c (xg_select): Fix first argument in call to 'select'
8427 (bug#11508).
8428
1b170bc6
KB
84292012-05-20 Ken Brown <kbrown@cornell.edu>
8430
8431 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 8432 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 8433
b2f4d39f
KB
84342012-05-19 Ken Brown <kbrown@cornell.edu>
8435
8436 * xfns.c (x_in_use): Remove `static' qualifier.
8437 * xterm.h (x_in_use): Declare.
8438 * xgselect.c: Include xterm.h.
8439 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8440 and `display_arg' (bug#9754).
8441
003fdae2
PE
84422012-05-19 Paul Eggert <eggert@cs.ucla.edu>
8443
9232a6d9
PE
8444 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
8445
003fdae2
PE
8446 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
8447 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8448
784b56e2
EZ
84492012-05-18 Eli Zaretskii <eliz@gnu.org>
8450
8451 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8452
8453 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 8454 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
8455
8456 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8457 reference to image_cache->refcount.
8458 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8459
a0a79cde
JL
84602012-05-17 Juri Linkov <juri@jurta.org>
8461
8462 * search.c (Fword_search_regexp, Fword_search_backward)
8463 (Fword_search_forward, Fword_search_backward_lax)
8464 (Fword_search_forward_lax): Move functions to isearch.el
8465 (bug#10145, bug#11381).
8466
b0572523
PE
84672012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8468
8469 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8470
9660f5fc
SM
84712012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8472
8473 * lread.c (init_obarray): Declare Qt and Qnil as special.
8474
4374de83
GM
84752012-05-14 Glenn Morris <rgm@gnu.org>
8476
8477 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 8478 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 8479
dc44c39a
PE
84802012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8481
078c97cb
PE
8482 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8483
dc44c39a
PE
8484 * unexaix.c: Port to more-recent AIX compilers.
8485 (report_error, report_error_1, make_hdr, copy_sym)
8486 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8487 Make arguments const char *, not char *, to avoid violations of C
8488 standard and to fix some AIX warnings reported by Gilles Pion.
8489
e18afed7 84902012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
8491
8492 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8493 already have overlays loaded.
8494 (handle_single_display_spec): Before returning without displaying
8495 fringe bitmap, synchronize the bidi iterator with the main display
8496 iterator, by calling iterate_out_of_display_property.
8497 (iterate_out_of_display_property): Detect buffer iteration by
8498 testing that it->string is a Lisp string.
8499 (get_next_display_element): When the current object is exhausted,
8500 and there's something on it->stack, call set_iterator_to_next to
8501 proceed with what's on the stack, instead of returning zero.
8502 (set_iterator_to_next): If called at the end of a Lisp string,
8503 proceed to consider_string_end without incrementing string
8504 position. Don't increment display vector index past the end of
8505 the display vector. (Bug#11417)
c8fb9dc6
EZ
8506 (pos_visible_p): Don't report a position visible when move_it_to
8507 stopped at the last line of window, which happens to be scanned
8508 backwards by the bidi iteration. (Bug#11464)
ac268e67 8509
e18afed7 85102012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
8511
8512 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8513 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
8514 are on a TTY, and thus unable to display on the fringes.
8515 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
8516 so we need to signal to the caller that this is a "replacing"
8517 display spec. This fixes display when the spec is invalid or we
8518 are on a TTY.
8519
e18afed7 85202012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
8521
8522 * unexaix.c (make_hdr): Fix typo in prototype.
8523 This bug broke the build on AIX. Problem reported by Gilles Pion.
8524
9d0a235a
MA
85252012-05-14 Michael Albinus <michael.albinus@gmx.de>
8526
8527 * keyboard.c (kbd_buffer_get_event): Read special events also in
8528 batch mode. (Bug#11415)
8529
9e6b06ed
GM
85302012-05-12 Glenn Morris <rgm@gnu.org>
8531
8532 * ns.mk: Update for ns_appbindir no longer having trailing "/".
8533
c1a1d7a3
EZ
85342012-05-12 Eli Zaretskii <eliz@gnu.org>
8535
8536 * lisp.mk (lisp): Add newcomment.elc.
8537
3fe7cdc8
GM
85382012-05-12 Glenn Morris <rgm@gnu.org>
8539
8540 * Makefile.in (MKDIR_P): New, set by configure.
8541 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
8542
53f7d2c0
PE
85432012-05-11 Paul Eggert <eggert@cs.ucla.edu>
8544
8545 Remove unused function hourglass_started.
8546 * dispextern.h (hourglass_started):
8547 * w32fns.c (hourglass_started):
8548 * xdisp.c (hourglass_started): Remove.
8549
75aafb17
JB
85502012-05-10 Juanma Barranquero <lekktu@gmail.com>
8551
8552 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
8553 Update dependencies.
8554
12959e8e
PE
85552012-05-10 Paul Eggert <eggert@cs.ucla.edu>
8556
97107e2e
PE
8557 * xgselect.c (xg_select): Put maxfds+1 into a var.
8558 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
8559
12959e8e
PE
8560 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
8561
836d29b3
DA
85622012-05-10 Dave Abrahams <dave@boostpro.com>
8563
8564 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
8565 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
8566
5cb67954
MA
85672012-05-09 Michael Albinus <michael.albinus@gmx.de>
8568
8569 * dbusbind.c (xd_registered_buses): New internal Lisp object.
8570 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
8571 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
8572 Initialize xd_registered_buses.
8573
3478ec45
PE
85742012-05-09 Paul Eggert <eggert@cs.ucla.edu>
8575
b263a6b0
PE
8576 Untag more efficiently if USE_LSB_TAG.
8577 This is based on a proposal by YAMAMOTO Mitsuharu in
8578 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
8579 For an admittedly artificial (nth 8000 longlist) benchmark on
8580 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
8581 Emacs's overall text size by 1%.
8582 * lisp.h (XUNTAG): New macro.
8583 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
8584 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
8585 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8586 * eval.c (Fautoload):
8587 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8588 * frame.h (XFRAME): Use XUNTAG.
8589
3478ec45
PE
8590 Port recent dbusbind.c changes to 32-bit --with-wide-int.
8591 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8592 Remove unportable assumptions about print widths of types like
8593 dbus_uint32_t.
8594 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8595 intptr_t when converting between pointer and integer, to avoid GCC
8596 warnings about wrong width.
8597
666b903b 85982012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
8599
8600 * w32proc.c (new_child): Force Windows to reserve only 64KB of
8601 stack for each reader_thread, instead of defaulting to 8MB
8602 determined by the linker. This avoids failures in creating
8603 subprocesses on Windows 7, see the discussion in this thread:
8604 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8605
b120cc17
JC
86062012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
8607
8608 Fix up display of the *Minibuf-0* buffer in the mini window.
8609 * keyboard.c (read_char): Don't clear the echo area if there's no
8610 message to clear.
8611 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 8612 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 8613
9a4b36f8
MA
86142012-05-07 Michael Albinus <michael.albinus@gmx.de>
8615
8616 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8617 batch mode.
8618
e5f9458f
CY
86192012-05-06 Chong Yidong <cyd@gnu.org>
8620
8621 * lisp.mk (lisp): Update.
8622
eceeb5fc 86232012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
8624
8625 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8626
71873e2b
SM
86272012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
8628
8629 * data.c (PUT_ERROR): New macro.
8630 (syms_of_data): Use it. Add new error type `user-error'.
8631 * undo.c (user_error): New function.
8632 (Fprimitive_undo): Use it.
8633 * print.c (print_error_message): Adjust print style for `user-error'.
8634 * keyboard.c (user_error): New function.
8635 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8636
ab0fa4e4
PE
86372012-05-03 Paul Eggert <eggert@cs.ucla.edu>
8638
8639 Do not limit current-time-string to years 1000..9999.
8640 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8641 (Fcurrent_time_string): Support any year that is supported by the
8642 underlying localtime representation. Don't use asctime, as it
8643 has undefined behavior for years outside the range -999..9999.
8644
7ed806a7
PE
86452012-05-02 Paul Eggert <eggert@cs.ucla.edu>
8646
8647 Fix race conditions involving setenv, gmtime, localtime, asctime.
8648 Without this fix, interrupts could mess up code that uses these
8649 nonreentrant functions, since setting TZ invalidates existing
8650 tm_zone or tzname values, and since most of these functions return
8651 pointers to static storage.
8652 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8653 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8654 Grow the critical sections to include not just invoking
8655 localtime/gmtime, but also accessing these functions' results
8656 including their tm_zone values if any, and any related TZ setting.
8657 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
8658 so that the struct tm is saved in the critical section.
8659 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
8660 motivated by the fact that memory allocation needs to be outside
8661 the critical section.
8662
0c16dfed
DA
86632012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
8664
8665 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8666 with RESET_INTERVAL.
8667
8668 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8669 Remove duplicated buffer name initialization.
8670
3f83ace8
JM
86712012-05-02 Jim Meyering <jim@meyering.net>
8672
8673 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8674
c7b8541e
JM
8675 * xfns.c (x_window): Use xstrdup (Bug#11375).
8676
90207a15 86772012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
8678
8679 * xdisp.c (pos_visible_p): If already at a newline from the
8680 display string before the 'while' loop, don't walk back the glyphs
8681 from it3.glyph_row. Solves assertion violation when the display
8682 string begins with a newline (egg.el). (Bug#11367)
8683
b593d6a9
AH
86842012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
8685
8686 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
8687 Move to simple.el.
8688
4737362e
GM
86892012-05-01 Glenn Morris <rgm@gnu.org>
8690
99cf43f9
GM
8691 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
8692 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
8693 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
8694 All were removed before 23.1.
8695
9311dcff
GM
8696 * dispnew.c: Remove HAVE_LIBNCURSES test;
8697 it is always true on relevant platforms.
8698
4d5c6349
GM
8699 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
8700 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
8701
4737362e
GM
8702 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
8703
74dd3a6b
AS
87042012-04-30 Andreas Schwab <schwab@linux-m68k.org>
8705
8706 * .gdbinit (xpr): Remove checks for no longer existing misc types.
8707 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8708 Remove.
8709
13c379ee
PE
87102012-04-28 Paul Eggert <eggert@cs.ucla.edu>
8711
8712 Do not avoid creating empty evaporating overlays (Bug#9642).
8713 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8714 That is, do not delete an evaporating overlay if it becomes
8715 empty after its bounds are adjusted to fit within its buffer.
8716 This fix caused other problems, and I'm reverting it until we get
8717 to the bottom of them.
8718
a8e7d6d7 87192012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
8720
8721 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8722
a8e7d6d7 87232012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
8724
8725 * xdisp.c (pos_visible_p): If the window start position is beyond
8726 ZV, start the display from buffer beginning. Prevents assertion
8727 violation in init_iterator when the minibuffer window is scrolled
8728 via the scroll bar.
8729
8730 * window.c (window_scroll_pixel_based): Likewise.
8731
a8e7d6d7 87322012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
8733
8734 * keymap.c (where_is_internal): Doc fix (Bug#10872).
8735
a8e7d6d7 87362012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
8737
8738 * fileio.c (Fcopy_file, Fset_file_selinux_context):
8739 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
8740
a8e7d6d7 87412012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 8742
b593d6a9
AH
8743 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8744 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 8745
1c6900d9
EZ
87462012-04-26 Eli Zaretskii <eliz@gnu.org>
8747
4c3fa1d9
EZ
8748 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8749 display element, check also the underlying string or buffer
8750 character. (Bug#11341)
8751
1c6900d9
EZ
8752 * w32menu.c: Include w32heap.h.
8753 (add_menu_item): If the call to AppendMenuW (via
8754 unicode_append_menu) fails, disable Unicode menus only if we are
8755 running on Windows 9X/Me.
8756
42bf8205
AS
87572012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8758
8759 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8760 (xgetint): Add missing shift for LSB tags.
8761
b1bac16e
MR
87622012-04-24 Martin Rudalics <rudalics@gmx.at>
8763
8764 * keyboard.c (read_char): Don't wipe echo area for select window
8765 events: These might get delayed via `mouse-autoselect-window'
8766 (Bug#11304).
8767
d69621cc
JB
87682012-04-24 Juanma Barranquero <lekktu@gmail.com>
8769
8770 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8771 manipulation of :loaded-from data.
8772
02fd101b
JB
87732012-04-23 Juanma Barranquero <lekktu@gmail.com>
8774
8775 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8776 now a cons (bug#11311).
8777
888bec30
PE
87782012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8779
89a438bd
PE
8780 Do not create empty overlays with the evaporate property (Bug#9642).
8781 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8782 if it becomes empty after its bounds are adjusted to fit within
8783 its buffer. Without this fix, in a nonempty buffer (let ((o
8784 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8785 yields an empty overlay that has the evaporate property, which is
8786 not supposed to happen.
8787
1068fe4d
PE
8788 Fix minor GTK3 problems found by static checking.
8789 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8790 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8791 (struct _EmacsFixedClass, emacs_fixed_get_type):
8792 Move decls here from emacsgtkfixed.h, since they needn't be public.
8793 (emacs_fixed_get_type): Now static.
8794 (emacs_fixed_class_init): Omit unused local.
8795 (emacs_fixed_child_type): Remove; unused.
8796 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8797 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8798 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8799 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8800 (EMACS_FIXED_GET_CLASS): Remove; unused.
8801 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8802
888bec30
PE
8803 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8804 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8805
de85e130
PE
88062012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8807
d0baac98 8808 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 8809 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
8810 (__malloc_size_t, __malloc_ptrdiff_t):
8811 Remove. All uses removed, replaced by the definiens if needed,
8812 since we can assume C89 or better now.
8813 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8814 (protect_malloc_state, align, get_contiguous_space)
8815 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8816 (malloc_atfork_handler_child, malloc_enable_thread)
8817 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8818 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8819 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8820 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8821 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8822 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8823 Define using prototypes, not old style.
8824 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8825 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8826 (align): Don't assume that signed integer overflow wraps around.
8827 Omit unused local var.
8828 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8829 (_free_internal_nolock, memalign, mallochook, reallochook):
8830 Omit no-longer-needed casts.
8831 (valloc): Use getpagesize, not __getpagesize.
8832 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8833 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8834
de85e130
PE
8835 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8836
dcbf5805
MA
88372012-04-22 Michael Albinus <michael.albinus@gmx.de>
8838
8839 Move functions from C to Lisp. Make non-blocking method calls
8840 the default. Implement further D-Bus standard interfaces.
8841
8842 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8843 (QCdbus_request_name_allow_replacement)
8844 (QCdbus_request_name_replace_existing)
8845 (QCdbus_request_name_do_not_queue)
8846 (QCdbus_request_name_reply_primary_owner)
8847 (QCdbus_request_name_reply_in_queue)
8848 (QCdbus_request_name_reply_exists)
8849 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8850 (QCdbus_registered_serial, QCdbus_registered_method)
8851 (QCdbus_registered_signal): New Lisp objects.
8852 (XD_DEBUG_MESSAGE): Use sizeof.
8853 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8854 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8855 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8856 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8857 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8858 (xd_signature, xd_append_arg): Allow float for integer types.
8859 (xd_get_connection_references): New function.
b593d6a9
AH
8860 (xd_get_connection_address): Rename from xd_initialize.
8861 Return cached address.
dcbf5805
MA
8862 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8863 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8864 level.
8865 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 8866 Return number of refcounts.
dcbf5805
MA
8867 (Fdbus_get_unique_name): Make stronger parameter check.
8868 (Fdbus_message_internal): New defun.
8869 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8870 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8871 (Fdbus_send_signal, Fdbus_register_service)
8872 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8873 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8874 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8875 (Vdbus_compiled_version, Vdbus_runtime_version)
8876 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8877 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8878 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
8879 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8880 Adapt docstring.
dcbf5805 8881
52828e02
PE
88822012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8883
da05bc4c
PE
8884 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8885 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8886 Do not assume ptrdiff_t is the same width as 'int'.
8887
52828e02
PE
8888 * alloc.c: Handle unusual debugging option combinations.
8889 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8890 since the two debugging options are incompatible.
8891 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8892 is defined.
8893 (mem_init, mem_insert, mem_insert_fixup):
8894 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8895 (NEED_MEM_INSERT): Remove; no longer needed.
8896
f01769f9
LL
88972012-04-22 Leo Liu <sdl.web@gmail.com>
8898
8899 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8900
5790543d
PE
89012012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8902
8903 * sysdep.c [__FreeBSD__]: Minor cleanups.
8904 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8905 Use Emacs indenting style more consistently. Avoid some casts.
8906 Use 'double' consistently rather than mixing 'float' and 'double'.
8907
b91b7e4d
EW
89082012-04-21 Eduard Wiebe <usenet@pusto.de>
8909
b593d6a9
AH
8910 * sysdep.c (list_system_processes, system_process_attributes):
8911 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 8912
6114eb15
AS
89132012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8914
8915 * lisp.mk (lisp): Update.
8916
2f38dff7
PE
89172012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8918
8919 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8920 It is never used otherwise.
8921
4ae29f89
SM
89222012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8923
8924 * print.c (print_preprocess): Only check print_depth if print-circle
8925 is nil.
8926 (print_object): Check for cycles even when print-circle is nil and
8927 print-gensym is t, but only check print_depth if print-circle is nil.
8928
f30d612a
CY
89292012-04-20 Chong Yidong <cyd@gnu.org>
8930
8931 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8932 set the status to "failed" and ensure that sentinel is run.
8933
c07a4c0b 89342012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
8935
8936 * process.c (Fset_process_inherit_coding_system_flag)
8937 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 8938 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 8939
c07a4c0b 89402012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
8941
8942 * xdisp.c (string_buffer_position_lim): Limit starting position to
8943 BEGV.
8944 (set_cursor_from_row): If called for a mode-line or header-line
8945 row, return zero immediately.
8946 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
8947 farther than the first row after the header line, if any.
8948 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
8949 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8950
c07a4c0b 89512012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8952
4ae29f89
SM
8953 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8954 (bug#11238).
ad3a2b41 8955
c07a4c0b 89562012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 89572012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
8958
8959 configure: new option --enable-gcc-warnings (Bug#11207)
8960 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8961 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8962 (ALL_CFLAGS): Use new macros rather than old.
8963 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8964 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8965 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8966 -Wunused-result, -Wunused-variable. This should go away once
8967 the Emacs and Gnulib regex code is merged.
8968 (xmalloc, xrealloc): Now static.
8969
aba027e8
PE
89702012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8971
8972 * dired.c (Fsystem_groups): Remove unused local.
8973
e5a36063
GM
89742012-04-17 Glenn Morris <rgm@gnu.org>
8975
8976 * dired.c (Fsystem_users): Doc fix.
8977
316411f0
DA
89782012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8979
8980 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8981 (syms_of_dired): Add them.
8982
9426aba4
PE
89832012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8984
b62a57be
PE
8985 Fix minor alloc.c problems found by static checking.
8986 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8987 New extern decls, to avoid calling undeclared functions.
8988 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8989 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8990 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8991 (NEED_MEM_INSERT): New macro.
8992 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 8993 Remove one incorrect comment and fix another.
b62a57be 8994
3539f31f
PE
8995 Fix minor ralloc.c problems found by static checking.
8996 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8997 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8998 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8999 (r_alloc_sbrk): Now static.
9000
a041960a
PE
9001 Improve ralloc.c interface checking.
9002 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9003 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9004 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9005 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9006 [REL_ALLOC]: ... to here, to check interface.
9007 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9008 Remove decls. This fixes an "It stinks!".
9009
9426aba4
PE
9010 * alloc.c (which_symbols): Fix alignment issue / type clash.
9011
d55c12ed
AS
90122012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9013
9014 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9015 (struct Lisp_Misc_Any): Likewise.
9016 (struct Lisp_Free): Likewise.
9017 * alloc.c (union aligned_Lisp_Symbol): Define.
9018 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9019 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9020 (union aligned_Lisp_Misc): Define.
9021 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9022 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 9023 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 9024
b948ce8b
PE
90252012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9026
9027 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9028 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9029 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9030 * s/netbsd.h, s/sol2-6.h:
9031 Remove definition of GC_MARK_STACK, since the default now works.
9032 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9033 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9034 no longer the default.
9035 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9036
35dc09a1 90372012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 9038
35dc09a1
GM
9039 * lread.c (lisp_file_lexically_bound_p):
9040 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 9041
35dc09a1
GM
90422012-04-14 Eli Zaretskii <eliz@gnu.org>
9043
9044 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9045 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9046
90472012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9048
9049 * nsterm.m (constrainFrameRect): Always constrain when there is only
9050 one screen (Bug#10962).
9051
bcd86815
KB
90522012-04-13 Ken Brown <kbrown@cornell.edu>
9053
9054 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9055
c25df26e
RT
90562012-04-13 Reuben Thomas <rrt@sc3d.org>
9057
9058 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9059
0fc59f1e
DC
90602012-04-11 Daniel Colascione <dancol@dancol.org>
9061
9062 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9063 against is gone. It's better to use vfork now so that when Cygwin
9064 gains a new, working vfork, we use it automatically (bug#10398).
9065
de8c03dc
SM
90662012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9067
9068 * window.c (save_window_save): Obey window-point-insertion-type.
9069
2f097256
GM
90702012-04-11 Glenn Morris <rgm@gnu.org>
9071
9072 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9073
453b951e
SM
90742012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9075
9076 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9077
75f1671a 90782012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
9079
9080 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9081 (force_quit_count): New var.
9082 (handle_interrupt): Use it.
9083
2a8ce227
JB
90842012-04-10 Juanma Barranquero <lekktu@gmail.com>
9085
9086 * w32.c (w32_delayed_load): Record the full path of the library
9087 being loaded (bug#10424).
9088
935396c0
GM
90892012-04-09 Glenn Morris <rgm@gnu.org>
9090
05920a43
GM
9091 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9092 not just in the obarray, before snarfing them. (Bug#11036)
9093
935396c0
GM
9094 * Makefile.in ($(leimdir)/leim-list.el):
9095 Pass EMACS rather than BUILT_EMACS.
9096
a18ecafa
TZ
90972012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9098
9099 * process.c (make_process):
9100 * process.h: Add integer `gnutls_handshakes_tried' member to
9101 process struct.
9102
6bbef4e5
JC
9103 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9104 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
9105
9106 * gnutls.c (gnutls_log_function2i): Convenience log function.
9107 (emacs_gnutls_read): Use new log functions,
9108 `gnutls_handshakes_tried' process member, and
9109 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9110 attempts per process (connection).
9111
b4d3bc10
CY
91122012-04-09 Chong Yidong <cyd@gnu.org>
9113
9114 * eval.c (Fuser_variable_p, user_variable_p_eh)
9115 (lisp_indirect_variable): Functions deleted.
9116 (Fdefvar): Caller changed.
9117
9118 * callint.c (Finteractive, Fcall_interactively):
9119 * minibuf.c (Fread_variable): Callers changed.
9120
70f4d973
EZ
91212012-04-09 Eli Zaretskii <eliz@gnu.org>
9122
9123 * xdisp.c (set_cursor_from_row): If the display string appears in
9124 the buffer at position that is closer to point than the position
9125 after the display string, display the cursor on the first glyph of
9126 the display string. Fixes cursor display when a 'display' text
9127 property immediately follows invisible text. (Bug#11094)
9128
cb3c2e3e
PE
91292012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9130
9131 composite.c: use 'double' consistently
9132 * composite.c (get_composition_id): Use 'double' consistently
9133 instead of converting 'float' to 'double' and vice versa; this is
9134 easier to understand and avoids a GCC warning.
9135
fd06db5d
GM
91362012-04-09 Glenn Morris <rgm@gnu.org>
9137
50fe702a
GM
9138 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9139 preparation for dumping it with emacs. (Bug#4789)
9140 (leimdir): New variable.
9141 ($(leimdir)/leim-list.el): New rule.
9142 (emacs$(EXEEXT)): Depend on leim-list.el.
9143
fd06db5d
GM
9144 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9145 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9146 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9147
55c131ee
AS
91482012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9149
9150 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9151 proper alignment.
9152
9209588f
JB
91532012-04-07 Juanma Barranquero <lekktu@gmail.com>
9154
9155 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9156 Remove unused local variable.
9157
e3fb2efb
PE
91582012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9159
9160 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9161 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9162 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9163 objects, as mark_maybe_pointer will catch them otherwise.
9164 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9165 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9166
b5385551
PE
91672012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9168
9169 Fix typo that broke non-Windows builds.
9170 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9171
9078ead6
EZ
91722012-04-07 Eli Zaretskii <eliz@gnu.org>
9173
9174 Support building on MS-Windows with libxml2.
9175
9176 * makefile.w32-in (OBJ2): Add xml.$(O).
9177 (GLOBAL_SOURCES): Add xml.c.
9178 ($(BLD)/xml.$(O)): New dependency list.
9179
9180 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
9181 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
9182 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
9183 [!WINDOWSNT]: New macros.
9184 (init_libxml2_functions, libxml2_loaded_p): New functions.
9185 (parse_region): Call fn_xmlCheckVersion instead of using the macro
9186 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
9187 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
9188 Calls xmlCleanupParser only if libxml2 was loaded (or statically
9189 linked in).
6bbef4e5
JC
9190 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
9191 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
9192 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
9193
9194 * emacs.c: Don't include libxml/parser.h.
9195 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
9196 xmlCleanupParser directly.
9197
9198 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
9199
3811fdf3
EZ
92002012-04-07 Eli Zaretskii <eliz@gnu.org>
9201
9202 * indent.c (Fvertical_motion): If there is a display string at
9203 point, use it.vpos to compute how many lines to backtrack after
9204 move_it_to point. (Bug#11133)
9205
2f8e16b2
EZ
92062012-04-06 Eli Zaretskii <eliz@gnu.org>
9207
9208 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
9209 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
9210 about subtle differences between FETCH_CHAR* and STRING_CHAR*
9211 macros related to unification of CJK characters. For the details,
9212 see the discussion following the message here:
9213 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
9214
3d439cd1
CY
92152012-04-04 Chong Yidong <cyd@gnu.org>
9216
9217 * keyboard.c (Vdelayed_warnings_list): Doc fix.
9218
8bc53d00
EZ
92192012-04-01 Eli Zaretskii <eliz@gnu.org>
9220
9221 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
9222 instead of alloca. (Bug#11138)
9223
3b0512a3
AS
92242012-04-01 Andreas Schwab <schwab@linux-m68k.org>
9225
9226 * w32menu.c (is_simple_dialog): Properly check lisp types.
9227 (Bug#11141)
9228
8427ddd2
EZ
92292012-03-31 Eli Zaretskii <eliz@gnu.org>
9230
979022ef
EZ
9231 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
9232 position we get to after a call to move_it_to fails the
9233 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
9234 only if we wind up in a string from display property. (Bug#11063)
9235
a6b1c7cc
EZ
9236 * window.c (Fdelete_other_windows_internal): Invalidate the row
9237 and column information about mouse highlight, so that redisplay
9238 restores it after reallocating the glyph matrices. (Bug#7464)
9239
8427ddd2
EZ
9240 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
9241 string comes from a `display' text property, use the buffer
9242 position of that property as if we actually saw that position in
9243 the row's glyphs.
697ba24b
EZ
9244 (move_it_by_lines): Remove the assertion that
9245 "it->current_x == 0 && it->hpos == 0" which can be legitimately
9246 violated when there's a before-string at the beginning of a line.
9247 (Bug#11063)
8427ddd2 9248
65a0a738
EZ
92492012-03-30 Eli Zaretskii <eliz@gnu.org>
9250
9251 * xdisp.c (append_space_for_newline): If the default face was
9252 remapped, use the remapped face for the appended newline.
9253 (extend_face_to_end_of_line): Use the remapped default face for
9254 extending the face to the end of the line.
9255 (display_line): Call extend_face_to_end_of_line when the default
9256 face was remapped. (Bug#11068)
9257
581355cc
EZ
92582012-03-29 Eli Zaretskii <eliz@gnu.org>
9259
9260 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
9261
e8fc049f
SM
92622012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9263
9264 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
9265
4fb9a543
GM
92662012-03-27 Glenn Morris <rgm@gnu.org>
9267
9268 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
9269 Doc fixes.
9270
679910f1
KH
92712012-03-26 Kenichi Handa <handa@m17n.org>
9272
9273 * dispextern.h (struct glyph): Fix previous change. Change the
9274 bit length of glyphless.ch to 25 (Bug#11082).
9275
90d49b7f
CY
92762012-03-26 Chong Yidong <cyd@gnu.org>
9277
9278 * keyboard.c (Vselection_inhibit_update_commands): New variable.
9279 (command_loop_1): Use it; inhibit selection update for
9280 handle-select-window too (Bug#8996).
9281
f514f6f0
FP
92822012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
9283
e8fc049f 9284 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 9285
bf43fa51
KH
92862012-03-25 Kenichi Handa <handa@m17n.org>
9287
9288 * dispextern.h (struct glyph): Change the bit length of
9289 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
9290
8a0c01dd
EZ
92912012-03-24 Eli Zaretskii <eliz@gnu.org>
9292
9293 * s/ms-w32.h (tzname): Include time.h before redirecting to
9294 _tzname. Fixes the MSVC build. (Bug#9960)
9295
7d1c3a76
AS
92962012-03-24 Andreas Schwab <schwab@linux-m68k.org>
9297
8ed79523
AS
9298 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
9299 characters.
9300
7d1c3a76
AS
9301 * xterm.c (XTread_socket): Only modify handling_signal if
9302 !SYNC_INPUT. (Bug#11080)
9303
e99a9b8b
EZ
93042012-03-23 Eli Zaretskii <eliz@gnu.org>
9305
9306 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
9307 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
9308 when fetching a multibyte character consumes more bytes than
9309 CHAR_BYTES returns, due to unification of CJK characters in
9310 string_char. (Bug#11073)
9311
5063c0e1
TN
93122012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
9313
9314 * process.c (wait_reading_process_output): Handle pty disconnect
9315 by refraining from sending oneself a SIGCHLD (bug#10933).
9316
9f851fbd
CY
93172012-03-22 Chong Yidong <cyd@gnu.org>
9318
9319 * dispextern.h (struct it): New member string_from_prefix_prop_p.
9320
5063c0e1 9321 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
9322 Mark string as coming from a prefix property.
9323 (handle_face_prop): Use default face for prefix strings (Bug#4281).
9324 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
9325
fb5b8aca
CY
93262012-03-21 Chong Yidong <cyd@gnu.org>
9327
9328 * xfaces.c (Vface_remapping_alist): Doc fix.
9329
62356a1b
EZ
93302012-03-20 Eli Zaretskii <eliz@gnu.org>
9331
9332 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
9333 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
9334 Doc fixes.
62356a1b 9335
025de85b
CY
93362012-03-20 Chong Yidong <cyd@gnu.org>
9337
9338 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
9339 to reflect default non-nil value of redisplay-dont-pause.
9340
4827f94e
KH
93412012-03-19 Kenichi Handa <handa@m17n.org>
9342
9343 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
9344 it fit in a valid range (Bug#11003).
9345
e50a24a2
EZ
93462012-03-18 Eli Zaretskii <eliz@gnu.org>
9347
9348 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
9349 that is not from display property, accept the row as a "cursor
9350 row" if one of the string's character has a non-nil `cursor'
9351 property. Fixes cursor positioning when there are newlines in
9352 overlay strings, e.g. in icomplete.el. (Bug#11035)
9353
9af5ed87
PE
93542012-03-12 Paul Eggert <eggert@cs.ucla.edu>
9355
9356 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
9357
d1f55f16
CY
93582012-03-12 Chong Yidong <cyd@gnu.org>
9359
9360 * eval.c (inhibit_lisp_code): Rename from
9361 inhibit_window_configuration_change_hook; move from window.c.
9362
9363 * xfns.c (unwind_create_frame_1, Fx_create_frame):
9364 * window.c (run_window_configuration_change_hook)
9365 (syms_of_window): Callers changed.
9366
66c5eebd
CY
93672012-03-11 Chong Yidong <cyd@gnu.org>
9368
413df973
CY
9369 * keymap.c (Fkey_description): Doc fix (Bug#9700).
9370
66c5eebd
CY
9371 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
9372
1de11f56
CY
93732012-03-10 Chong Yidong <cyd@gnu.org>
9374
9375 * frame.c (other_visible_frames): Don't assume the selected frame
9376 is visible (Bug#10955).
9377
cae07000
SM
93782012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
9379
9380 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9381
89c94350
JD
93822012-03-08 Jan Djärv <jan.h.d@swipnet.se>
9383
9384 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9385 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
9386 zero (Bug#10954).
9387
999dd333
GM
93882012-03-03 Glenn Morris <rgm@gnu.org>
9389
01a6dcc8 9390 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 9391
de0100f2
EZ
93922012-03-02 Eli Zaretskii <eliz@gnu.org>
9393
9394 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
9395 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
9396 (redisplay_window, next_element_from_string): Fix typos in
9397 comments.
3e441275
EZ
9398 (redisplay_window): Pass to move_it_vertically the margin in
9399 pixels, not in screen lines.
de0100f2 9400
96a72ee9
GM
94012012-03-02 Glenn Morris <rgm@gnu.org>
9402
9403 * buffer.c (buffer-list-update-hook): Doc fix.
9404
312508d7
EZ
94052012-02-29 Eli Zaretskii <eliz@gnu.org>
9406
9407 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9408 push_it before setting up the iterator for the first overlay
9409 string, even if we have an empty string loaded.
9410 (next_overlay_string): If there's an empty string on the iterator
9411 stack, pop the stack. (Bug#10903)
9412
27f3c637
PE
94132012-02-25 Paul Eggert <eggert@cs.ucla.edu>
9414
9415 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9416 Suggested by Stefan Monnier in
9417 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9418 * alloc.c (widen_to_Lisp_Object): New static function.
9419 (mark_memory): Also mark Lisp_Objects by fetching pointer words
9420 and widening them to Lisp_Objects. This would work even if
9421 USE_LSB_TAG is defined and wide integers are used, which might
9422 happen in a future version of Emacs.
9423
3c9dfce6
CY
94242012-02-25 Chong Yidong <cyd@gnu.org>
9425
fa74b241
CY
9426 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9427 Doc fix.
9428
3c9dfce6
CY
9429 * xselect.c (Fx_selection_exists_p): Doc fix.
9430 (x_clipboard_manager_save_all): Print an informative message
9431 before saving to clipboard manager.
9432
9486df08
CY
94332012-02-24 Chong Yidong <cyd@gnu.org>
9434
9435 * keyboard.c (process_special_events): Handle all X selection
9436 requests in kbd_buffer, not just the next one (Bug#8869).
9437
f01d3321
CY
94382012-02-23 Chong Yidong <cyd@gnu.org>
9439
9440 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9441 call when setting menu-bar-lines and tool-bar-lines parameters.
9442 (unwind_create_frame_1): New helper function.
9443
9444 * window.c (inhibit_window_configuration_change_hook): New var.
9445 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 9446 (syms_of_window): Initialize it.
f01d3321 9447
86b847b6
CY
94482012-02-22 Chong Yidong <cyd@gnu.org>
9449
9450 * xterm.c (x_draw_image_relief): Add missing type check for
9451 Vtool_bar_button_margin (Bug#10743).
9452
a59225b1
CY
94532012-02-21 Chong Yidong <cyd@gnu.org>
9454
9455 * fileio.c (Vfile_name_handler_alist): Doc fix.
9456
9457 * buffer.c (Fget_file_buffer): Protect against invalid file
9458 handler return value.
9459
310f5bd4
PE
94602012-02-20 Paul Eggert <eggert@cs.ucla.edu>
9461
cb3a28cc
PE
9462 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9463 when computing $valmask.
9464
310f5bd4
PE
9465 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9466 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9467 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9468 It's useless in that case, and it can cause problems on hosts
9469 that allocate halves of EMACS_INT values separately.
9470 Reported by Dan Horák. Diagnosed by Andreas Schwab in
9471 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9472 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9473 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
9474 it avoids undefined behavior on hosts where shifting right by more
9475 than the word width has undefined behavior.
9476
2375c96a
CY
94772012-02-19 Chong Yidong <cyd@gnu.org>
9478
9479 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9480 (Funhandled_file_name_directory, Ffile_name_as_directory)
9481 (Fdirectory_file_name, Fexpand_file_name)
9482 (Fsubstitute_in_file_name): Protect against invalid file handler
9483 return values (Bug#10845).
9484
3eb49e71
EZ
94852012-02-18 Eli Zaretskii <eliz@gnu.org>
9486
9487 * .gdbinit (pitx): Fix incorrect references to fields of the
9488 iterator stack.
9489
7b926f3f
CY
94902012-02-17 Chong Yidong <cyd@gnu.org>
9491
9492 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9493
11273115
PE
94942012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9495
9496 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9497 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9498
c3a70e2b
CY
94992012-02-15 Chong Yidong <cyd@gnu.org>
9500
9501 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9502 marked as special. Also, starting docstrings with * is obsolete.
9503
0ca43699
AS
95042012-02-13 Andreas Schwab <schwab@linux-m68k.org>
9505
9506 * gnutls.c (emacs_gnutls_write): Fix last change.
9507
2e8f3c56
LI
95082012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
9509
9510 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9511 send_process.
9512
af70074f
SM
95132012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
9514
9515 * keymap.c (Fsingle_key_description): Handle char ranges.
9516
95986d52
CY
95172012-02-12 Chong Yidong <cyd@gnu.org>
9518
afd83bd1
CY
9519 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9520 as that creates a dangerous corner case.
9521
95986d52
CY
9522 * window.c (Fdelete_window_internal): Invalidate the mouse
9523 highlight (Bug#9904).
9524
bd7da63e
GM
95252012-02-12 Glenn Morris <rgm@gnu.org>
9526
9527 * xselect.c (Fx_own_selection_internal)
9528 (Fx_get_selection_internal, Fx_disown_selection_internal)
9529 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
9530 * nsselect.m (Fx_own_selection_internal)
9531 (Fx_disown_selection_internal, Fx_selection_exists_p)
9532 (Fx_selection_owner_p, Fx_get_selection_internal):
9533 Sync docs and argument specs with the xselect.c versions.
9534
77abcbc2
LI
95352012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
9536
9537 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
9538
90b671e2
EZ
95392012-02-11 Eli Zaretskii <eliz@gnu.org>
9540
1c0ca0b7
EZ
9541 * w32select.c (Fx_selection_exists_p): Sync doc string and
9542 argument list with xselect.c. (Bug#10783)
9543
9544 * w16select.c (Fx_selection_exists_p): Sync doc string and
9545 argument list with xselect.c. (Bug#10783)
90b671e2 9546
49241268
GM
95472012-02-10 Glenn Morris <rgm@gnu.org>
9548
9549 * fns.c (Fsecure_hash): Doc fix.
9550
f998bbe7 95512012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
9552
9553 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
9554
0992bd9c
CY
95552012-02-07 Chong Yidong <cyd@gnu.org>
9556
9557 * buffer.c (Fbuffer_local_variables)
9558 (buffer_lisp_local_variables): Handle unbound vars correctly;
9559 don't let Qunbound leak into Lisp.
9560
af008560
GM
95612012-02-07 Glenn Morris <rgm@gnu.org>
9562
dd605cc4
GM
9563 * image.c (Fimagemagick_types): Doc fix.
9564
af008560
GM
9565 * image.c (imagemagick-render-type): Change it from a lisp object
9566 to an integer. Move the doc here from the lisp manual.
9567 Treat all values not equal to 0 the same.
9568
1449fa1d
CY
95692012-02-06 Chong Yidong <cyd@gnu.org>
9570
9571 * doc.c (store_function_docstring): Avoid applying docstring of
9572 alias to base function (Bug#2603).
9573
3723ec07
AS
95742012-02-04 Andreas Schwab <schwab@linux-m68k.org>
9575
9576 * .gdbinit (pp1, pv1): Remove redundant defines.
9577 (pr): Use pp.
9578
79c1cc1e
CY
95792012-02-04 Chong Yidong <cyd@gnu.org>
9580
9581 * nsterm.m: Declare a global (Bug#10694).
9582
d7f29f8e
EZ
95832012-02-04 Eli Zaretskii <eliz@gnu.org>
9584
cae07000
SM
9585 * w32.c (get_emacs_configuration_options):
9586 Include --enable-checking, if specified, in the return value.
d7f29f8e 9587
3b95a6f9
MR
95882012-02-04 Martin Rudalics <rudalics@gmx.at>
9589
9590 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9591 after rounding frame sizes. (Bug#9723)
9592
d6fa96a6
EZ
95932012-02-04 Eli Zaretskii <eliz@gnu.org>
9594
9595 * keyboard.c (adjust_point_for_property): Don't position point
9596 before BEGV. (Bug#10696)
9597
df0b2940
PE
95982012-02-03 Paul Eggert <eggert@cs.ucla.edu>
9599
9600 Handle overflow when computing char display width (Bug#9496).
9601 * character.c (char_width): Return EMACS_INT, not int.
9602 (char_width, c_string_width): Check for overflow when
9603 computing the width; this is possible now that individual
9604 characters can have unbounded width. Problem introduced
9605 by merge from Emacs 23 on 2012-01-19.
9606
6bee44d6
MA
96072012-02-02 Michael Albinus <michael.albinus@gmx.de>
9608
9609 * dbusbind.c (Fdbus_register_method): Mention the return value
9610 :ignore in the docstring.
9611
44f92739
GM
96122012-02-02 Glenn Morris <rgm@gnu.org>
9613
1b9f60cc
GM
9614 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9615
44f92739
GM
9616 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9617 Unconditionally set to t. (Bug#10673)
9618 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9619 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9620 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9621
c5d3843c
KH
96222012-02-02 Kenichi Handa <handa@m17n.org>
9623
9624 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
9625 0, do not call append_composite_glyph.
9626
159462d4 96272012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
9628
9629 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9630 NULL (Bug#6988).
9631 (x_produce_glyphs): If the component of a composition is a null
9632 string, set it->pixel_width to 1 to avoid zero-width glyph.
9633
78cef877
EZ
96342012-02-01 Eli Zaretskii <eliz@gnu.org>
9635
9636 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9637 first 2 arguments are identical. This makes inserting large
9638 output from a subprocess an order of magnitude faster on
9639 MS-Windows, where all sbrk'ed memory is always contiguous.
9640
97897668
GM
96412012-01-31 Glenn Morris <rgm@gnu.org>
9642
9643 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 9644 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
9645 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9646
31fd3586
GM
96472012-01-29 Glenn Morris <rgm@gnu.org>
9648
9649 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9650
0e24a8b2
CY
96512012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
9652
9653 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9654
cc0adcb0
CY
96552012-01-28 Chong Yidong <cyd@gnu.org>
9656
9657 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9658
acc28cb9
CY
96592012-01-26 Chong Yidong <cyd@gnu.org>
9660
9c69cfb7
CY
9661 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9662
acc28cb9
CY
9663 * search.c (Fsearch_forward, Fsearch_backward): Document negative
9664 repeat counts (Bug#10507).
9665
48da7392
GM
96662012-01-26 Glenn Morris <rgm@gnu.org>
9667
9668 * lread.c (syms_of_lread): Doc fix.
9669
14af5f7f
CY
96702012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
9671
9672 * coding.c (encode_designation_at_bol): Change return value to
9673 EMACS_INT.
9674
0b21c100
CY
96752012-01-25 Chong Yidong <cyd@gnu.org>
9676
9677 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
9678
3c2907f7
CY
96792012-01-21 Chong Yidong <cyd@gnu.org>
9680
9681 * floatfns.c (Fcopysign): Make the second argument non-optional,
9682 since nil is not allowed anyway.
9683
959ad23f
AS
96842012-01-21 Andreas Schwab <schwab@linux-m68k.org>
9685
9686 * process.c (read_process_output): Use p instead of XPROCESS (proc).
9687 (send_process): Likewise.
9688
34a02f46
MR
96892012-01-19 Martin Rudalics <rudalics@gmx.at>
9690
9691 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
9692 (Vwindow_persistent_parameters): Do not use Qstate.
9693 Rewrite doc-strings.
34a02f46 9694
1259009a 96952012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
9696
9697 * character.c (char_width): New function.
70d4fdf6
GM
9698 (Fchar_width, c_string_width, lisp_string_width):
9699 Use char_width (Bug#9496).
25ed9e61 9700
6a6ee00d
MR
97012012-01-16 Martin Rudalics <rudalics@gmx.at>
9702
9703 * window.c (Vwindow_persistent_parameters): New variable.
9704 (Fset_window_configuration, save_window_save): Handle persistent
9705 window parameters.
9706
c85efaf7
EZ
97072012-01-14 Eli Zaretskii <eliz@gnu.org>
9708
9709 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9710 thrashing the stack of the thread. (Bug#9087)
9711
5944709e
PE
97122012-01-12 Paul Eggert <eggert@cs.ucla.edu>
9713
9714 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9715
e71f5d99
EZ
97162012-01-11 Eli Zaretskii <eliz@gnu.org>
9717
9718 * xdisp.c (rows_from_pos_range): Handle the case where the
9719 highlight ends on a newline. (Bug#10464)
9720 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9721 he end column for display of highlight that ends on a newline
9722 before a R2L line.
9723
ce316182
GM
97242012-01-11 Glenn Morris <rgm@gnu.org>
9725
9726 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9727 from load-path also when installation-directory is nil. (Bug#10208)
9728
5b43da69
GM
97292012-01-10 Glenn Morris <rgm@gnu.org>
9730
74cc8ff9
GM
9731 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9732
7d8d6e4e
GM
9733 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9734 Update template values to be closer to their typical values these days.
5b43da69 9735
a0db8d43
EZ
97362012-01-09 Eli Zaretskii <eliz@gnu.org>
9737
9738 * xdisp.c (rows_from_pos_range): Accept additional argument
9739 DISP_STRING, and accept any glyph in a row whose object is that
9740 string as eligible for mouse highlight. Fixes mouse highlight of
9741 display strings from overlays. (Bug#10464)
9742
9a0115ab 97432012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 9744
b9110d6a 9745 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
9746 * fileio.c (auto_saving_dir_umask): New static var.
9747 (Fmake_directory_internal): Use it.
9748 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9749 creating the directory. The old code temporarily assigns
9750 too-generous permissions to the directory.
9751 (do_auto_save_eh): Clear it.
b9110d6a 9752 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
9753 that the var is always cleared.
9754
6c1bd3f3
EZ
97552012-01-07 Eli Zaretskii <eliz@gnu.org>
9756
9757 * search.c (scan_buffer): Pass character positions to
9758 know_region_cache, not byte positions. (Bug#6540)
9759
069d2b50
L
97602012-01-07 LynX <_LynX@bk.ru> (tiny change)
9761
9762 * w32.c (sys_rename): Report EXDEV when rename of a directory
9763 fails because the target is on another logical disk. (Bug#10284)
9764
75bf0d33
DB
97652012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9766
9767 * xterm.c (x_embed_request_focus): New function.
9768
9769 * xterm.h: Add prototype.
9770
9771 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9772
1c6e5a32
GM
97732012-01-05 Glenn Morris <rgm@gnu.org>
9774
9775 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9776
651e947e
EZ
97772012-01-01 Eli Zaretskii <eliz@gnu.org>
9778
9779 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9780 Load gnutls_transport_set_lowat only if GnuTLS version is below
9781 2.11.1.
9782 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9783 GnuTLS versions below 2.11.1.
9784
3778cdd8
AL
97852011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9786
9787 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9788 to the doc string advising against its use for altering the way
9789 windows are scrolled.
9790
0e5317f7
KH
97912011-12-28 Kenichi Handa <handa@m17n.org>
9792
9793 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9794 coding-system ASCII compatible only when it does not produce BOM
9795 on encoding (Bug#10383).
9796
93d5ca1f
JD
97972011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9798
9799 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9800 can scroll.
9801 (create_and_show_popup_menu): Always use menu_position_func for
9802 Gtk3 (Bug#10361).
9803
ca22b785
AS
98042011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9805
9806 * callint.c (Fcall_interactively): Don't truncate prompt string.
9807
d048e1e6
EZ
98082011-12-23 Eli Zaretskii <eliz@gnu.org>
9809
9810 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9811 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 9812 resumed from there (after widening). (Bug#10360)
d048e1e6 9813
5ccaba1f
JD
98142011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9815
9816 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9817
204ee57f
JD
98182011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9819
b81d40f0
JB
9820 * nsterm.m (x_free_frame_resources):
9821 Release f->output_data.ns->miniimage.
204ee57f
JD
9822 (ns_index_color): Fix indentation. Do not retain
9823 color_table->colors[i].
9824
9825 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9826 before returning.
9827
9828 * nsfns.m (x_set_background_color): Assign return value from
9829 ns_index_color to face-background instead of NSColor*.
9830 (ns_implicitly_set_icon_type): Fix indentation.
9831 Change assignment in for loop to comparison.
9832
9833 * emacs.c (ns_pool): New variable.
9834 (main): Assign ns_pool.
9835 (Fkill_emacs): Call ns_release_autorelease_pool.
9836
9837 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9838 autorelease fdesc, release fdAttrs and tdict.
9839 (ns_get_covering_families): Release charset.
9840 (ns_findfonts): Release NSFontDescriptor created with new.
9841 (ns_uni_to_glyphs): Fix indentation.
9842 (setString): Release attrStr before assigning new value.
9843
c803b2b7
JD
98442011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9845
678f4426
JD
9846 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9847 and NS_IMPL_COCOA.
9848 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9849 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9850
cd394be1 98512011-12-18 David Reitter <reitter@cmu.edu>
678f4426 9852
5fecd5fc
JD
9853 * nsterm.m (ns_term_init): Subscribe for notifications
9854 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9855 to method trackingNotification in EmacsMenu.
9856
9857 * nsmenu.m (trackingMenu): New variable.
3771cb17 9858 (trackingNotification): New method (from Aquamacs).
5fecd5fc 9859 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 9860 from Aquamacs (Bug#7030).
678f4426
JD
9861
98622011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 9863
c803b2b7
JD
9864 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9865 (symbol_to_nsstring): Fix indentation.
9866 (ns_symbol_to_pb): New function.
cae07000
SM
9867 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9868 (Fns_rotate_cut_buffers_internal): Remove.
9869 (Fns_store_selection_internal): Rename from
c803b2b7
JD
9870 Fns_store_cut_buffer_internal.
9871 (ns_get_foreign_selection, Fx_own_selection_internal)
9872 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
9873 (Fns_get_selection_internal, Fns_store_selection_internal):
9874 Use ns_symbol_to_pb and check if return value is nil.
9875 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9876 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
9877 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9878 renamed to Sns_store_selection_internal.
9879 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9880 and remove this function.
9881 (ns_handle_selection_clear): Remove, never used.
9882 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9883 here.
9884
e1b01a3a
KB
98852011-12-17 Ken Brown <kbrown@cornell.edu>
9886
9887 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9888 GID is unknown (Bug#10257).
9889
2adb6e85
PE
98902011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9891
9892 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9893 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9894 which caused a build failure on GNU/Linux IA-64. This problem was
9895 introduced by my 2011-10-07 patch.
9896
d1d7b339
JL
98972011-12-15 Juri Linkov <juri@jurta.org>
9898
9899 * image.c (imagemagick_error): New function. (Bug#10112)
9900 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9901 Use `imagemagick_error' where ImageMagick functions return
9902 `MagickFalse'.
9903 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9904 proper order.
9905
100d5755
KH
99062011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9907
9908 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9909 fill background (Bug#8992).
9910
454592a6
MR
99112011-12-13 Martin Rudalics <rudalics@gmx.at>
9912
9913 * window.c (Vwindow_combination_resize)
9914 (Vwindow_combination_limit): Use t instead of non-nil in
9915 doc-strings.
61d4b438
MR
9916 (Vrecenter_redisplay): Add first sentence of doc-string on
9917 separate line.
53524d93 9918 (Frecenter): Fix doc-string typo.
454592a6 9919
3633e3aa
KH
99202011-12-11 Kenichi Handa <handa@m17n.org>
9921
9922 * coding.c (Funencodable_char_position): Pay attention to the
9923 buffer text relocation (Bug#9389).
9924
7b9d523a 99252011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 9926
7b9d523a
JD
9927 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9928 gtk_init (Bug#10100).
9929
b73189c6
EZ
99302011-12-10 Eli Zaretskii <eliz@gnu.org>
9931
9932 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9933 IT->string is nil. (Bug#10263)
9934
f7dfe5d6
JD
99352011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9936
83faebb4
JD
9937 * nsterm.h (x_free_frame_resources): Declare.
9938
f7dfe5d6
JD
9939 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9940 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9941
9942 * nsterm.h (ns_get_defaults_value): Declare.
9943
9944 * nsterm.m (ns_default): Call ns_get_defaults_value.
9945
7cd4e72c
EZ
99462011-12-09 Eli Zaretskii <eliz@gnu.org>
9947
9948 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9949 (Bug#10170)
9950
b34d7317
YM
99512011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9952
9953 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9954 that where the value of an _OBJC_* symbol points to is in the .bss
9955 section (Bug#10240).
9956
76470ad1
KH
99572011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9958
9959 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 9960 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 9961
745fff94
KH
99622011-12-08 Kenichi Handa <handa@m17n.org>
9963
9964 * ftfont.c (get_adstyle_property): Fix previous change
9965 (Bug#10233).
9966
6e44397c
JB
99672011-12-07 Juanma Barranquero <lekktu@gmail.com>
9968
9969 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9970 dirs from the default value of EMACSLOADPATH (bug#10208).
9971
7efa6272
GM
99722011-12-07 Glenn Morris <rgm@gnu.org>
9973
9974 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9975 installation and source directories as well. (Bug#10208)
9976
f6fc4d87
CY
99772011-12-06 Chong Yidong <cyd@gnu.org>
9978
9979 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9980
2bf26180
GM
99812011-12-06 Glenn Morris <rgm@gnu.org>
9982
9983 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9984 as an error, not just -1. (Bug#10217)
9985
3a6ad4f0
CY
99862011-12-05 Chong Yidong <cyd@gnu.org>
9987
9988 * keyboard.c (process_special_events): New function.
9989 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9990
75a3b399
PE
99912011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9992
9993 * coding.c (encode_designation_at_bol): Don't use uninitialized
9994 local variable (Bug#9318).
9995
c3c9e25e
KH
99962011-12-05 Kenichi Handa <handa@m17n.org>
9997
9998 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9999 return Qnil (Bug#8046, Bug#10193).
10000
5eb05ea3
KH
100012011-12-05 Kenichi Handa <handa@m17n.org>
10002
10003 * coding.c (encode_designation_at_bol): New args charbuf_end and
10004 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
10005 (coding_set_source): Return how many bytes coding->source was
10006 relocated.
10007 (coding_set_destination): Return how many bytes
10008 coding->destination was relocated.
10009 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 10010 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
10011
100122011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10013
10014 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10015 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10016 macro (Bug#9318).
10017
100182011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10019
10020 The following changes are to fix Bug#9318.
10021
a79703f5 10022 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
10023 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10024 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 10025 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 10026
7dbda6df
JB
100272011-12-05 Juanma Barranquero <lekktu@gmail.com>
10028
10029 * lisp.h (process_quit_flag): Fix external declaration.
10030
6d5eb5b0
SM
100312011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10032
10033 Don't macro-inline non-performance-critical code.
10034 * eval.c (process_quit_flag): New function.
10035 * lisp.h (QUIT): Use it.
10036
a0c3fad0
JD
100372011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10038
10039 * nsfns.m (get_geometry_from_preferences): New function.
10040 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10041
6c07aac2
AS
100422011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10043
10044 * emacs.c (Qkill_emacs): Define.
10045 (syms_of_emacs): Initialize it.
10046 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10047 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
10048 (quit_throw_to_read_char): Add parameter `from_signal'.
10049 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
10050 * lisp.h (QUIT): Call Fkill_emacs if requested.
10051
c052ead4
JD
100522011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10053
10054 * widget.c (update_wm_hints): Return if wmshell is null.
10055 (widget_update_wm_size_hints): New function.
10056
10057 * widget.h (widget_update_wm_size_hints): Declare.
10058
10059 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10060 widget_update_wm_size_hints (Bug#10104).
10061
9e49252b
EZ
100622011-12-03 Eli Zaretskii <eliz@gnu.org>
10063
10064 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10065 before a newline, prepare the bidi iterator for consuming the
10066 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 10067 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 10068
02b16839
JL
100692011-12-02 Juri Linkov <juri@jurta.org>
10070
10071 * search.c (Fword_search_regexp): New Lisp function created from
10072 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10073 (Fword_search_backward, Fword_search_forward)
10074 (Fword_search_backward_lax, Fword_search_forward_lax):
10075 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10076 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10077
0068070e
SM
100782011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10079
10080 * fileio.c (Finsert_file_contents): Move after-change-function call
10081 to before the "handled:" label, since all "goto handled" appear in
10082 cases where the *-change-functions have already been properly called
10083 (bug#10117).
10084
3360a3fc
AS
100852011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10086
10087 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10088 waiting for input. (Bug#10169)
10089
73d6c093
EZ
100902011-11-30 Eli Zaretskii <eliz@gnu.org>
10091
10092 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10093 verifies glyph row's hash code--we have just reallocated the
10094 glyphs, so their contents can be complete garbage. (Bug#10164)
10095
febe6bea
JB
100962011-11-30 Juanma Barranquero <lekktu@gmail.com>
10097
10098 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10099
801a4313
EZ
101002011-11-30 Eli Zaretskii <eliz@gnu.org>
10101
10102 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10103 attributes are tested _before_ calling verify_row_hash, to protect
10104 against GCC re-ordering of the tests. (Bug#10164)
10105
2b56b87e
JD
101062011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10107
10108 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10109
10110 * xterm.c (handle_one_xevent): Only set async_visible and friends
10111 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 10112 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
10113 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10114
dbf31225
PE
101152011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10116
10117 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10118 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10119 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10120 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10121 All uses changed to use GCPRO1 etc.
10122 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10123 Revert to old implementation (i.e., before 2011-03-11).
10124
1305621b
YM
101252011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10126
10127 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10128 of scroll runs so as to avoid assigning disabled bogus rows and
10129 unnecessary graphics copy operations.
10130
8c9afb46
EZ
101312011-11-27 Eli Zaretskii <eliz@gnu.org>
10132
10133 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10134 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10135 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10136 (malloc, free, realloc, calloc): Redirect to e_* only when
10137 compiling Emacs.
10138
10139 * lisp.h (GCTYPEBITS): Move before first use.
10140 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10141 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10142 this macro definition.
10143
10144 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10145 _MSC_VER.
10146
54e9e3bf
JD
101472011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10148
6d5eb5b0
SM
10149 * gtkutil.c (xg_create_frame_widgets):
10150 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
10151 present with Gtk+ 2.0.
10152
83aca1cb
PE
101532011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10154
10155 * fileio.c (Finsert_file_contents): Undo previous change; see
10156 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10157
5b76caa4
PE
101582011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10159
10160 Rename locals to avoid shadowing.
10161 * fileio.c (Finsert_file_contents):
10162 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10163 * process.c (wait_reading_process_output):
10164 Rename inner 'proc' to 'p' to avoid shadowing.
10165 Indent for consistency with usual Emacs style.
10166
8c535114
EZ
101672011-11-25 Eli Zaretskii <eliz@gnu.org>
10168
10169 * xdisp.c (redisplay_window): If cursor row is not fully visible
10170 after recentering, and scroll-conservatively is set to a large
10171 number, scroll window by a few more lines to make the cursor fully
10172 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
10173 (start_display): Don't move to the next line if the display should
10174 start at a newline that is part of a display vector or an overlay
10175 string. (Bug#10119)
8c535114 10176
fa4fdb5c
JL
101772011-11-24 Juri Linkov <juri@jurta.org>
10178
10179 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10180 after the `MagickPingImage' call. (Bug#10112)
10181
90ec88df
CY
101822011-11-23 Chong Yidong <cyd@gnu.org>
10183
10184 * window.c (Fcoordinates_in_window_p): Accept only live windows.
10185
56e2e794
MR
101862011-11-23 Martin Rudalics <rudalics@gmx.at>
10187
10188 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
10189 making another buffer current. (Bug#10114)
10190
b6e64c41
GM
101912011-11-23 Glenn Morris <rgm@gnu.org>
10192
10193 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
10194
6b21de18
CY
101952011-11-23 Chong Yidong <cyd@gnu.org>
10196
10197 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
10198 using it (Bug#5984).
10199
b12cd789
EZ
102002011-11-22 Eli Zaretskii <eliz@gnu.org>
10201
10202 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
10203 and header-lines, as they don't have one computed for them.
10204 (Bug#10098)
10205
10206 * .gdbinit (prow): Make displayed values more self-explaining.
10207 Add row's hash code.
10208
261b6fd4
LMI
102092011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
10210
10211 * process.c (wait_reading_process_output): Fix asynchrounous
10212 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 10213 (wait_reading_process_output): Add comment and URL.
261b6fd4 10214
e7cfd277
JD
102152011-11-21 Jan Djärv <jan.h.d@swipnet.se>
10216
10217 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
10218
a9b9b7f5
CY
102192011-11-21 Chong Yidong <cyd@gnu.org>
10220
10221 * window.c (Fnext_window, Fprevious_window): Doc fix.
10222
b0d15b4f
SM
102232011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10224
10225 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
10226
fe7a3057
JB
102272011-11-20 Juanma Barranquero <lekktu@gmail.com>
10228
10229 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
10230
d2999b1a
MR
102312011-11-20 Martin Rudalics <rudalics@gmx.at>
10232
10233 * window.c (Fset_window_combination_limit): Rename argument
10234 STATUS to LIMIT.
10235 (Vwindow_combination_limit): Remove "status" from doc-string.
10236
d5ff9cd0
AS
102372011-11-20 Andreas Schwab <schwab@linux-m68k.org>
10238
10239 * m/ibms390.h: Remove.
10240 * m/ibms390x.h: Don't include "ibms390.h".
10241
a5bb9bd3
SM
102422011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10243
10244 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
10245 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
10246
cd1181db
JB
102472011-11-20 Juanma Barranquero <lekktu@gmail.com>
10248
10249 * casetab.c (Fset_case_table):
10250 * charset.c (Fcharset_after): Fix typos.
10251
615a3b8d 102522011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 10253
17e845af
PE
10254 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
10255 Otherwise, valgrind does not work on some platforms.
10256 Problem reported by Andreas Schwab in
6a0bf43d
PE
10257 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
10258 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
10259 is set, removing the need for VIRT_ADDRESS_VARIES.
10260 (PURE_P): Use a more-efficient implementation that needs just one
10261 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
10262 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
10263 to 4 (xorl, subq, cmpq, setbe).
10264 * alloc.c (pure): Always extern now, since that's the
10265 VIRT_ADDR_VARIES behavior.
10266 (PURE_POINTER_P): Use a single comparison, not two, for
10267 consistency with the new puresize.h.
10268 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
10269 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
10270 Remove VIRT_ADDR_VARIES no longer needed.
10271
f8fe6f96
EZ
102722011-11-19 Eli Zaretskii <eliz@gnu.org>
10273
10274 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
10275 (erase_phys_cursor, update_window_cursor, show_mouse_face)
10276 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
10277 behave as if the cursor position were at the window margin.
10278
10279 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
10280 and the cursor position is out of bounds, behave as if the cursor
10281 position were at the window margin. (Bug#10075)
10282
df05a53c
CY
102832011-11-18 Chong Yidong <cyd@gnu.org>
10284
10285 * window.c (Fwindow_combination_limit): Make first argument
10286 non-optional, since it is meaningless for live windows like the
10287 selected window.
61ccba97 10288
2071918e
DA
102892011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
10290
10291 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
10292
b50a28de
SM
102932011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
10294
10295 * intervals.c: Fix grafting over the whole buffer (bug#10071).
10296 (graft_intervals_into_buffer): Simplify.
10297
015137db
EZ
102982011-11-18 Eli Zaretskii <eliz@gnu.org>
10299
10300 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
10301 hash values of the two rows.
10302 (copy_row_except_pointers): Preserve the used[] arrays and the
10303 hash values of the two rows. (Bug#10035)
68c95424 10304 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
10305
10306 * xdisp.c (row_hash): New function, body extracted from
10307 compute_line_metrics.
10308 (compute_line_metrics): Call row_hash, instead of computing the
10309 hash code inline.
10310
10311 * dispnew.c (verify_row_hash): Call row_hash for computing the
10312 hash code of a row, instead of duplicating code from xdisp.c.
10313
10314 * dispextern.h (row_hash): Add prototype.
10315
a2addb04
TH
103162011-11-18 Tassilo Horn <tassilo@member.fsf.org>
10317
10318 * frame.c (delete_frame): Don't delete the terminal when the last
10319 X frame is closed if emacs is built with GTK toolkit.
10320
df85d315
JB
103212011-11-17 Juanma Barranquero <lekktu@gmail.com>
10322
10323 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
10324
a0c2d0ae
MR
103252011-11-17 Martin Rudalics <rudalics@gmx.at>
10326
10327 * window.c (Vwindow_splits): Rename to
10328 Vwindow_combination_resize. Suggested by Juri Linkov.
10329 (Fsplit_window_internal): Use Vwindow_combination_resize instead
10330 of Vwindow_splits.
10331
58179cce
JB
103322011-11-16 Juanma Barranquero <lekktu@gmail.com>
10333
7877f373
JB
10334 * nsfns.m (Fns_font_name):
10335 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 10336
b6f67890
MR
103372011-11-16 Martin Rudalics <rudalics@gmx.at>
10338
10339 * window.h (window): Rename slot "nest" to "combination_limit".
10340 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
10341 (Fset_window_nest): Rename to Fset_window_combination_limit.
10342 (Vwindow_nest): Rename to Vwindow_combination_limit.
10343 (recombine_windows, make_parent_window, make_window)
10344 (Fsplit_window_internal, saved_window)
10345 (Fset_window_configuration, save_window_save): Rename all
10346 occurrences of window_nest to window_combination_limit.
10347
c7015153
JB
103482011-11-15 Juanma Barranquero <lekktu@gmail.com>
10349
10350 * image.c (imagemagick_load_image): Fix typo.
10351
322ad6ec
EZ
103522011-11-14 Eli Zaretskii <eliz@gnu.org>
10353
10354 * xdisp.c (display_line): Move the call to
10355 highlight_trailing_whitespace before the call to
10356 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
10357 faces of all the glyphs to compute ROW's hash value.
10358 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 10359
f067b8ec
JB
103602011-11-14 Juanma Barranquero <lekktu@gmail.com>
10361
10362 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
10363 just return (bug#10044).
10364
1e5b2111
EZ
103652011-11-12 Eli Zaretskii <eliz@gnu.org>
10366
7ef3cbd5
EZ
10367 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
10368 with user-defined heap size. Bump the default size of the temacs
10369 heap to 27MB, to avoid memory warning when running temacs.
10370 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
10371
1e5b2111
EZ
10372 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
10373 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
10374 (verify_row_hash) [XASSERTS]: New function.
10375 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
10376 that the hash value of glyph rows is correct.
1e5b2111 10377
89d61221
MR
103782011-11-12 Martin Rudalics <rudalics@gmx.at>
10379
10380 * window.h (window): Remove splits slot.
10381 * window.c (Fwindow_splits, Fset_window_splits): Remove.
10382 (Fdelete_other_windows_internal, make_parent_window)
10383 (make_window, Fsplit_window_internal, Fdelete_window_internal)
10384 (Fset_window_configuration, save_window_save): Don't deal with
10385 split status of windows.
10386 (saved_window): Remove splits slot.
10387 (Vwindow_splits): Rewrite doc-string.
10388
97f18cc8
JD
103892011-11-11 Jan Djärv <jan.h.d@swipnet.se>
10390
10391 * xfns.c (unwind_create_frame):
10392 * nsfns.m (unwind_create_frame):
10393 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
10394 Vframe_list (Bug#9999).
10395
22a648b4
DA
103962011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
10397
0b381c7e 10398 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 10399
659afede
KH
104002011-11-11 Kenichi Handa <handa@m17n.org>
10401
10402 * callproc.c (Fcall_process): Set the member dst_multibyte of
10403 process_coding.
10404
9ac0394b
KH
104052011-11-11 Johan Bockgård <bojohan@gnu.org>
10406
10407 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10408 avoid a crash (bug#9496).
10409
2fbdc249
CY
104102011-11-09 Chong Yidong <cyd@gnu.org>
10411
10412 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10413 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10414
ac6b1f81
PE
104152011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10416
10417 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10418
09db192c
PE
104192011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10420
10421 Avoid some portability problems by eschewing 'extern inline' functions.
10422 The trivial performance wins aren't worth the portability hassles; see
10423 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10424 et seq.
10425 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10426 (window_box_width, window_box_left, window_box_left_offset)
10427 (window_box_right, window_box_right_offset): Undo previous change,
10428 by removing the "extern"s.
10429 * intervals.c (adjust_intervals_for_insertion)
10430 (adjust_intervals_for_deletion): Undo previous change,
10431 making these static again.
10432 (offset_intervals, temp_set_point_both, temp_set_point)
10433 (copy_intervals_to_string): No longer inline.
10434 * xdisp.c (window_text_bottom_y, window_box_width)
10435 (window_box_height, window_box_left_offset)
10436 (window_box_right_offset, window_box_left, window_box_right)
10437 (window_box): No longer inline.
10438
105216ed
CY
104392011-11-08 Chong Yidong <cyd@gnu.org>
10440
10441 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
10442 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
10443 Signal an error if not a live window.
105216ed
CY
10444 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
10445 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
10446
ae9e237f
JB
104472011-11-07 Juanma Barranquero <lekktu@gmail.com>
10448
10449 * lisp.h (syms_of_abbrev): Remove declaration.
10450 Reported by CHENG Gao <chenggao@royau.me>.
10451
c7aa8333
EZ
104522011-11-07 Eli Zaretskii <eliz@gnu.org>
10453
10454 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10455 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
10456 of temacs in GUI mode.
10457
be7f5545
MR
104582011-11-07 Martin Rudalics <rudalics@gmx.at>
10459
10460 * window.h: Declare delete_all_child_windows instead of
10461 delete_all_subwindows.
10462 * window.c (Fwindow_nest, Fset_window_nest)
10463 (Fset_window_new_total, Fset_window_new_normal)
10464 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10465 (delete_all_subwindows): Rename to delete_all_child_windows.
10466 (Fdelete_other_windows_internal, Fset_window_configuration):
10467 Call delete_all_child_windows instead of delete_all_subwindows.
10468 * frame.c (delete_frame): Call delete_all_child_windows instead
10469 of delete_all_subwindows.
10470
ca78dc43
PE
104712011-11-07 Paul Eggert <eggert@cs.ucla.edu>
10472
10473 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10474 This is also needed for porting to any host where GC_MARK_STACK is
10475 not GC_MAKE_GCPROS_NOOPS.
10476 (which_symbols): Use it.
10477
a0241d01
KH
104782011-11-07 Kenichi Handa <handa@m17n.org>
10479
10480 * coding.c (coding_set_destination): Check coding->src_pos only
10481 when coding->src_object is a buffer (bug#9910).
10482
10483 * process.c (send_process): Set the member src_multibyte of coding
10484 to 0 (bug#9911) when sending a unibyte text.
10485
10486 * callproc.c (Fcall_process): Set the member src_multibyte of
10487 process_coding to 0 (bug#9912).
10488
a64bfdfa 104892011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
10490
10491 * xmenu.c (cleanup_widget_value_tree): New function.
10492 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10493 calling free_menubar_widget_value_tree directly (Bug#9830).
10494
cb41b32a
PE
104952011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10496
10497 Fix some portability problems with 'inline'.
10498 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10499 (window_box_width, window_box_left, window_box_left_offset)
10500 (window_box_right, window_box_right_offset): Declare extern.
10501 Otherwise, these inline functions do not conform to C99 and
10502 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
10503 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10504 * intervals.c (adjust_intervals_for_insertion)
10505 (adjust_intervals_for_deletion): Now extern, because otherwise the
10506 extern inline functions 'offset_intervals' couldn't refer to it.
10507 (static_offset_intervals): Remove.
10508 (offset_intervals): Rewrite using the old contents of
10509 static_offset_intervals. The old version didn't conform to C99
10510 because an extern inline function contained a reference to an
10511 identifier with static linkage.
10512
b7041366
AS
105132011-11-06 Andreas Schwab <schwab@linux-m68k.org>
10514
10515 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10516 GC.
10517
88a37c4d
EZ
105182011-11-06 Eli Zaretskii <eliz@gnu.org>
10519
10520 * xdisp.c (init_iterator, reseat_to_string): Don't set the
10521 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
10522 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10523 return Qleft_to_right.
10524
49745b39
CY
105252011-11-06 Chong Yidong <cyd@gnu.org>
10526
10527 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
10528 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
10529 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
10530 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
10531 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
10532 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
10533 (Fwindow_vscroll): Doc fix.
10534 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
10535 argument, since it makes no sense to pass a live window and for
10536 consistency with window-child.
10537
1f05cd82
CS
105382011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
10539
10540 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
10541 support MSVC.
10542
22610910
JR
105432011-11-05 Jason Rumney <jasonr@gnu.org>
10544
10545 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
10546 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
10547 fonts (Bug#6029).
10548 (add_font_entity_to_list): Fix logic errors in mixed boolean and
10549 bitwise arithmetic preventing use of unicode-sip and non-truetype
10550 opentype fonts.
10551
a06776b2
EZ
105522011-11-05 Eli Zaretskii <eliz@gnu.org>
10553
3ad924ba
EZ
10554 * s/ms-w32.h (fstat, stat, utime): Move redirections to
10555 "emacs"-only part.
10556
a06776b2
EZ
10557 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
10558 initialization code to keep similarity to xfns.c after changes
10559 from 2011-11-05.
10560
c9e7db78
JD
105612011-11-05 Jan Djärv <jan.h.d@swipnet.se>
10562
a97f8f3f
JD
10563 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
10564 (unwind_create_frame): New function (Bug#9943).
10565 (Fx_create_frame): Restructure code to be more similar to the one in
10566 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
10567 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
10568 Move terminal->reference_count++ just before making the frame official
10569 (Bug#9943).
10570
10571 * nsterm.m (x_free_frame_resources): New function.
10572 (x_destroy_window): Move code to x_free_frame_resources.
10573
c9e7db78 10574 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
10575 (Fx_create_frame, x_create_tip_frame):
10576 Move terminal->reference_count++ just before making the frame
75f1671a 10577 official. Move initialization of image_cache_refcount and
c9e7db78
JD
10578 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
10579
a6fc3b5c
EZ
105802011-11-05 Eli Zaretskii <eliz@gnu.org>
10581
10582 Support MSVC build with newer versions of Visual Studio.
10583 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
10584 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
10585 nt/gmake.defs.
10586
10587 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10588 which are not supported by MSVC.
10589 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10590 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10591 bitfields.
10592 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10593 types in bitfields.
10594 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10595
10596 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10597
58179cce 105982011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
10599
10600 Support MSVC build with newer versions of Visual Studio.
10601 * w32.c: Don't include w32api.h for MSVC.
10602 (init_environment) [_MSC_VER]: Call sys_access, not _access.
10603
10604 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10605 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10606 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10607 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10608 e_* cousins.
10609 (alloca) [_MSC_VER]: Define to _alloca.
10610
10611 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10612
10613 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10614
a58c13ed
EZ
106152011-11-04 Eli Zaretskii <eliz@gnu.org>
10616
10617 * xdisp.c (note_mouse_highlight): If either of
10618 previous/next-single-property-change returns nil, treat that as
10619 the beginning or the end of the buffer. (Bug#9955)
10620
fe0b6370
JD
106212011-11-04 Jan Djärv <jan.h.d@swipnet.se>
10622
a58c13ed 10623 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
10624 label is not null (Bug#9951).
10625 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10626 may be NULL.
10627
89bd5ee1
EZ
106282011-11-04 Eli Zaretskii <eliz@gnu.org>
10629
10630 * window.c (Fwindow_body_size): Mention in the doc string that the
10631 return value is in frame's canonical units. (Bug#9949)
10632
84c3edb9
EZ
106332011-11-03 Eli Zaretskii <eliz@gnu.org>
10634
4e2fb5c7
EZ
10635 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
10636
84c3edb9 10637 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 10638 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 10639 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 10640
bc17a887
EZ
106412011-11-01 Eli Zaretskii <eliz@gnu.org>
10642
10643 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10644 Don't stop backward scan on the continuation glyph, even though
10645 its CHARPOS is positive.
6d5eb5b0
SM
10646 (mouse_face_from_buffer_pos, note_mouse_highlight):
10647 Rename cover_string to disp_string.
bc17a887 10648
4ee88440
MR
106492011-11-01 Martin Rudalics <rudalics@gmx.at>
10650
10651 * window.c (temp_output_buffer_show): Don't use
10652 Vtemp_buffer_show_specifiers.
10653 (Vtemp_buffer_show_specifiers): Remove unused variable.
10654
c2ff3c02
EZ
106552011-10-30 Eli Zaretskii <eliz@gnu.org>
10656
10657 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10658 past the beginning of the current glyph matrix.
10659
58179cce 106602011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
10661
10662 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10663 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10664 HAVE_GTK3 (Bug#9869).
b77a6a7f 10665
3b574623
JD
10666 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10667 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10668
b77a6a7f
JD
10669 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10670
10671 * xterm.c: Declare x_handle_net_wm_state to return int.
10672 (handle_one_xevent): Check if we are iconified but don't have
10673 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
10674 (get_current_wm_state): Return non-zero if not hidden,
10675 check for _NET_WM_STATE_HIDDEN (Bug#9893).
10676 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
10677 (x_handle_net_wm_state): Return what get_current_wm_state returns.
10678 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
10679
196e41e4
PE
106802011-10-29 Paul Eggert <eggert@cs.ucla.edu>
10681
10682 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
10683 so that this new function doesn't get optimized away by a
10684 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
10685
021f2e1a
AS
106862011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10687
10688 * frame.h (MOUSE_HL_INFO): Remove excess parens.
10689
8b058d44
EZ
106902011-10-29 Eli Zaretskii <eliz@gnu.org>
10691
10692 Fix the `xbytecode' command.
10693 * .gdbinit (xprintbytestr): New command.
b50a28de 10694 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
10695 (xbytecode): Print the byte-code string as well.
10696
4452fb80
EZ
106972011-10-29 Kim Storm <storm@cua.dk>
10698
8b058d44
EZ
10699 * alloc.c (which_symbols): New function.
10700
21b72067
AS
107012011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10702
10703 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
10704 line. (Bug#9903)
10705
83ed7b5c
GM
107062011-10-29 Glenn Morris <rgm@gnu.org>
10707
10708 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10709 Not clear what it was for, and it causes various bugs. (Bug#9839)
10710
5a7a728b
EZ
107112011-10-28 Eli Zaretskii <eliz@gnu.org>
10712
10713 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10714 possible random value that matches one of those tested as
10715 condition to clear the mouse face.
10716
d3d0842f
CY
107172011-10-28 Chong Yidong <cyd@gnu.org>
10718
10719 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10720
31b39d13
DN
107212011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
10722
10723 * window.c (make_window): Initialize phys_cursor_on_p.
10724
9aba6043
SM
107252011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
10726
10727 * lisp.h (struct Lisp_Symbol): Update comments.
10728
c20992f4
JB
107292011-10-28 Juanma Barranquero <lekktu@gmail.com>
10730
10731 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10732
db4f02f2
EZ
107332011-10-28 Eli Zaretskii <eliz@gnu.org>
10734
10735 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
10736 <oslsachem@gmail.com> for helping to debug this.
10737
10738 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10739 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10740 (g_b_init_get_glyph_outline_w): New static variables.
10741 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10742 (GetGlyphOutlineW_Proc): New typedefs.
10743 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
10744 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10745 New functions.
10746 (w32font_open_internal, compute_metrics):
10747 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
10748 instead of calling the "wide" APIs directly.
10749
10750 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10751
10752 * w32.h (syms_of_w32font): Add prototype.
10753
87e68db4
JB
107542011-10-27 Juanma Barranquero <lekktu@gmail.com>
10755
10756 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10757 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10758 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10759 (Fmove_to_window_line): Doc fix.
10760
435c1d67
CY
107612011-10-27 Chong Yidong <cyd@gnu.org>
10762
10763 * process.c (make_process): Set gnutls_state to NULL.
10764
10765 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10766 non-NULL, regardless of GNUTLS_INITSTAGE.
10767 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10768 an error. Set process slots as soon as we allocate them.
10769
10770 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10771
9c6c6f49
CY
107722011-10-27 Chong Yidong <cyd@gnu.org>
10773
9aba6043
SM
10774 * gnutls.c (emacs_gnutls_deinit): New function.
10775 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
10776 (Fgnutls_deinit, Fgnutls_boot): Use it.
10777
10778 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10779 (deactivate_process): Call emacs_gnutls_deinit.
10780
657d08d3
JB
107812011-10-27 Juanma Barranquero <lekktu@gmail.com>
10782
10783 * image.c (x_create_x_image_and_pixmap):
10784 * w32.c (sys_rename, w32_delayed_load):
10785 * w32font.c (fill_in_logfont):
10786 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10787
5430d399
JB
107882011-10-26 Juanma Barranquero <lekktu@gmail.com>
10789
10790 * w32fns.c (w32_default_color_map): New function,
10791 extracted from Fw32_default_color_map.
a7ef684b 10792 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 10793
fe0055fa
PE
107942011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10795
10796 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10797
e6346438
SM
107982011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10799
10800 * keyboard.c (test_undefined): New function (bug#9751).
10801 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10802
e112cc37
ET
108032011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10804
10805 * sysdep.c (init_sys_modes): Fix the check for the controlling
10806 terminal (Bug#6649).
10807
7b5d6677
EZ
108082011-10-20 Eli Zaretskii <eliz@gnu.org>
10809
10810 * dispextern.h (struct bidi_it): New member next_en_type.
10811
10812 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10813 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10814 current character, check also for next_en_type being WEAK_EN.
10815 (bidi_resolve_weak): Don't enter the expensive loop if the current
10816 position is before next_en_pos. Record the bidi type of the first
10817 non-ET, non-BN character we find, in addition to its position.
10818 (bidi_level_of_next_char): Invalidate next_en_type when
10819 next_en_pos is over-stepped.
10820
7da0b018
PE
108212011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10822
10823 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10824 * editfns.c: Rewrite current-time-zone so that it invokes
10825 the equivalent of (format-time-string "%Z") to get the time zone name.
10826 This fixes a bug when the time zone name contains characters that
10827 need converting from the system time locale to Emacs internal format.
10828 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10829 that patch fixed format-time-string to do the conversion, but
10830 I forgot to fix current-time-zone.
10831 (format_time_string): New function, containing most of
10832 what Fformat_time_string used to contain.
10833 (Fformat_time_string): Rewrite in terms of format_time_string.
10834 This doesn't change this function's behavior.
10835 (current-time-zone): Rewrite to use format_time_string.
10836 This fixes the bug reported by Michael Schierl in
10837 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10838 Jason Rumney's 2007-06-07 change worked around this bug, but
10839 didn't fix it.
10840 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10841
8547b010
EZ
108422011-10-19 Eli Zaretskii <eliz@gnu.org>
10843
10844 * xdisp.c (start_display): If the character at POS is displayed
10845 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
10846 (try_window_reusing_current_matrix): If a line ends in a display
10847 vector or the next line starts in a display vector, continue
10848 redrawing the window even though the character position of
10849 start_row was reached.
8547b010
EZ
10850 (Bug#9771, part 2)
10851
4e948d15
CY
108522011-10-18 Chong Yidong <cyd@gnu.org>
10853
10854 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10855 with nobreak-char-display too.
10856
4787455f
EZ
108572011-10-18 Eli Zaretskii <eliz@gnu.org>
10858
10859 Fix part 3 of bug#9771.
10860 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10861 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10862 non-neutral characters if the current character is a paragraph
10863 separator (a.k.a. Newline). This avoids running the same
10864 expensive loop twice, once when we consume the preceding newline
10865 and the other time when the line actually needs to be displayed.
10866 Avoid the loop when we see neutrals on the base embedding level
10867 following a character whose directionality is the same as the
10868 paragraph's. This avoids running the expensive loop when a line
10869 ends in a long sequence of neutrals, like control characters.
10870 Add assertion against STRONG_AL type. Slightly rearrange code
10871 that determines the type of a neutral given the first non-neutral
10872 that follows it.
10873 (bidi_level_of_next_char): Set next_en_pos to zero when
10874 invalidating its info.
10875
2c91f553
EZ
108762011-10-17 Eli Zaretskii <eliz@gnu.org>
10877
10878 * xdisp.c (push_display_prop): Determine whether to record string
10879 or buffer position by IT->string, not by IT->method. Allow
10880 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
10881 (move_it_vertically_backward): Don't look for character position
10882 immediately after the newline when in a continuation line.
10883 (Bug#9771, part 1)
2c91f553 10884
c7b08b0d
MR
108852011-10-15 Martin Rudalics <rudalics@gmx.at>
10886
10887 * window.c (coordinates_in_window): Rewrite and delabelize
10888 vertical border check. (Bug#5357) (Bug#9618)
10889
6b02f655
SM
108902011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10891
10892 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10893 errors in XSetWindowBorder (bug#9310).
10894
81d40c92
DA
108952011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10896
10897 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10898 avoid crash when xmalloc overrun checking is enabled.
10899
d4172c3b
EZ
109002011-10-13 Eli Zaretskii <eliz@gnu.org>
10901
10902 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10903 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10904 cursor motion with <left> and <right> arrow keys.
10905
10906 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10907 some callers set that themselves.
10908
b00eea75
EZ
109092011-10-12 Eli Zaretskii <eliz@gnu.org>
10910
10911 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10912 display string and the previous row comes from the same string and
10913 is empty. (Bug#9739) (Bug#9738)
10914
8fe012c4
SM
109152011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10916
10917 * doc.c (get_doc_string): Encode file name (bug#9735).
10918
0074aef2
EZ
109192011-10-12 Eli Zaretskii <eliz@gnu.org>
10920
79beb178
EZ
10921 * bidi.c (bidi_level_of_next_char):
10922 * xdisp.c (get_visually_first_element): Remove old incorrect
10923 comments regarding the Unicode Line Separator character.
10924
0074aef2
EZ
10925 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10926
6e4b3fbe
DA
109272011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10928
10929 * alloc.c (Fgc_status): Do not access beyond zombies array
10930 boundary if nzombies > MAX_ZOMBIES.
10931 * alloc.c (dump_zombies): Add missing format specifier.
10932
0324f3af
PE
109332011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10934
b5525cac
PE
10935 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10936 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10937
0324f3af
PE
10938 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10939 Some packages use them to denote characters with modifiers.
10940
e9b5f888
AS
109412011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10942
10943 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10944 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10945 matching a pp-number. Rename parameter var to var1.
10946
127827c0
SM
109472011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10948
10949 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10950
c8fd3bd0
GM
109512011-10-08 Glenn Morris <rgm@gnu.org>
10952
10953 * callint.c (Fcall_interactively): Give a more explicit error for the
10954 'c' case with a non-character input. (Bug#8479)
10955
352ec8ff
EZ
109562011-10-08 Eli Zaretskii <eliz@gnu.org>
10957
03669ccb
EZ
10958 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10959 lines.
7061c986
EZ
10960 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10961 lines that are hscrolled on the left.
03669ccb 10962
352ec8ff
EZ
10963 * dispnew.c (buffer_posn_from_coords): Account for a possible
10964 presence of header-line. (Bug#4426)
10965
a66cfb1c
SM
109662011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10967
6b02f655
SM
10968 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10969 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 10970
7c5ee88e
PE
109712011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10972
10973 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10974 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10975 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10976 this makes Emacs dump core during garbage collection on rare
10977 occasions. sizeof is obviously inferior to offsetof here, so
10978 stick with offsetof.
10979 (GC_POINTER_ALIGNMENT): New macro.
10980 (mark_memory): Omit 3rd (offset) arg; caller changed.
10981 Don't assume EMACS_INT alignment is the same as pointer alignment.
10982
df1bbe5b
SM
109832011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10984
10985 * keyboard.c (read_key_sequence_remapped): New var.
10986 (read_key_sequence): Compute remapping in the right buffer.
10987 (command_loop_1): Use read_key_sequence's remapping directly.
10988
51553db6
SM
109892011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10990
32c1fffd
SM
10991 * dired.c (file_name_completion): Don't expand file name.
10992 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10993 before checking file name handler.
10994
51553db6
SM
10995 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10996 they've been requested explicitly (bug#9591).
10997
b6bd1599 109982011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
10999
11000 * keymap.c (Fsingle_key_description): Use make_specified_string
11001 instead of build_string to build string from push_key_description.
11002 (Bug#5193)
11003
f701dc2a
PE
110042011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11005
4222c55d
PE
11006 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11007 This fixes a Y2038 bug on 64-bit hosts.
11008 * buffer.c (reset_buffer):
11009 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11010 (Fclear_buffer_auto_save_failure):
11011 Use 0, not -1, to represent an unset failure time, since time_t
11012 might not be signed.
11013
f701dc2a
PE
11014 Remove dependency on glibc malloc internals.
11015 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11016 Move back here from lisp.h, but with their new implementations.
11017 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11018 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11019 * charset.c (charset_table_init): New static var.
11020 (syms_of_charset): Use it instead of xmalloc. This removes a
11021 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11022 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11023 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11024 Move back to alloc.c.
11025 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11026 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11027
9ceebf39
JD
110282011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11029
11030 * nsterm.m (windowDidResize): Call x_set_window_size only when
11031 ns_in_resize is true. Otherwise set pixelwidth/height and
11032 call change_frame_size (Bug#9628).
11033
cb993c58
PE
110342011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11035
3930c88b
PE
11036 Port --enable-checking=all to Fedora 14 x86-64.
11037 * charset.c (syms_of_charset): Also account for glibc malloc's
11038 internal overhead when calculating the initial malloc maximum.
11039
cb993c58
PE
11040 Port --enable-checking=all to Fedora 14 x86.
11041 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11042 Move to lisp.h.
11043 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11044 (overrun_check_realloc, overrun_check_free):
11045 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11046 That way, xmalloc returns a properly-aligned pointer even if
11047 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11048 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11049 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11050 into account when calculating the initial malloc maximum.
11051 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11052 Move here from alloc.c, so that charset.c can use it too.
11053 Properly align; the old code wasn't right for common 32-bit hosts
11054 when configured with --enable-checking=all.
11055 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11056 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11057
31bed486
EZ
110582011-09-29 Eli Zaretskii <eliz@gnu.org>
11059
04c70788 11060 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
11061 use EDOM.
11062
fbcaa2f3
EZ
110632011-09-28 Eli Zaretskii <eliz@gnu.org>
11064
11065 * xdisp.c (compute_display_string_end): If there's no display
11066 string at CHARPOS, return -1.
11067
11068 * bidi.c (bidi_fetch_char): When compute_display_string_end
11069 returns a negative value, treat the character as a normal
11070 character not covered by a display string. (Bug#9624)
11071
a239d4e9
JB
110722011-09-28 Juanma Barranquero <lekktu@gmail.com>
11073
11074 * lread.c (Fread_from_string): Fix typo in docstring.
11075
88652fd5
EZ
110762011-09-27 Eli Zaretskii <eliz@gnu.org>
11077
11078 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11079 newline, reseat the iterator instead of bidi-iterating there one
11080 character at a time. (Bug#9610)
32c1fffd
SM
11081 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11082 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 11083
ed497dd4
AS
110842011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11085
11086 * lread.c (readevalloop): Use correct code for NBSP.
11087 (read1): Likewise. (Bug#9608)
11088
b2bf61aa
MA
110892011-09-25 Michael Albinus <michael.albinus@gmx.de>
11090
11091 * dbusbind.c (Fdbus_register_signal): When service is not
11092 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11093
32bbb17c
GM
110942011-09-25 Glenn Morris <rgm@gnu.org>
11095
11096 * buffer.c (truncate-lines): Doc fix.
11097
94e0933e
CY
110982011-09-24 Chong Yidong <cyd@stupidchicken.com>
11099
11100 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11101 (Fset_window_next_buffers): Doc fix.
11102
cddde921
GM
111032011-09-24 Glenn Morris <rgm@gnu.org>
11104
11105 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11106
1260aef1
PE
111072011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11108
25b4bfa0
PE
11109 Fix minor problems found by static checking.
11110 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
11111 * indent.c (Fvertical_motion): Fix == vs = typo.
11112
e3cbd34b
EZ
111132011-09-24 Eli Zaretskii <eliz@gnu.org>
11114
a66cfb1c
SM
11115 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11116 Default value is now t. Doc fix.
6bf7006f 11117
e3cbd34b 11118 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 11119 logic when moving up, not only when moving down. Fix the
e3cbd34b 11120 confusing name and values of the it_overshoot_expected variable;
32c1fffd 11121 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
11122
11123 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11124 CHARPOS is covered by a display string which includes newlines.
11125 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11126 is covered by a display string with embedded newlines.
11127
a3de0cbd
MA
111282011-09-24 Michael Albinus <michael.albinus@gmx.de>
11129
11130 * dbusbind.c (Fdbus_register_signal): Add match rule to
11131 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
11132 (Fdbus_register_method, Vdbus_registered_objects_table):
11133 Fix docstring.
a3de0cbd 11134
b260039d
JM
111352011-09-24 Jim Meyering <meyering@redhat.com>
11136
32c1fffd 11137 do not ignore write error for any output size
b260039d
JM
11138 The previous change was incomplete.
11139 While it makes emacs --batch detect the vast majority of stdout
11140 write failures, errors were still ignored whenever the output size is
11141 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11142 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11143 && echo FAIL: ignored write error
11144 FAIL: ignored write error
11145 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11146 && echo FAIL: ignored write error
11147 FAIL: ignored write error
11148 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11149
8eca8a7c
AS
111502011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11151
11152 * emacs.c (Fkill_emacs): In noninteractive mode exit
11153 non-successfully if a write error occurred on stdout. (Bug#9574)
11154
3341db62
EZ
111552011-09-21 Eli Zaretskii <eliz@gnu.org>
11156
11157 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11158 the xassert test.
11159
11160 * dispextern.h (struct it): Update the comment documenting what
11161 can it->OBJECT be.
11162
8c203dbf
EZ
111632011-09-20 Eli Zaretskii <eliz@gnu.org>
11164
11165 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11166 a display string, extend search for cursor position to end of row.
11167 (find_row_edges): If the row ends in a newline from a display
11168 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11169 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
11170 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11171 non-empty line. Fixes confusing cursor motion with arrow keys at
11172 the beginning of a line that starts with whitespace.
8c203dbf 11173
a4824228
LMI
111742011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11175
11176 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11177 (bug#9493).
11178
33ed493b
CY
111792011-09-18 Chong Yidong <cyd@stupidchicken.com>
11180
11181 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
11182 boolean (Bug#9154).
11183
56cd55c8
EZ
111842011-09-18 Eli Zaretskii <eliz@gnu.org>
11185
11186 * xdisp.c (display_line): Record maximum and minimum buffer
11187 positions even if no glyphs were produced (e.g., by a zero-width
11188 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
11189 buffer positions that will be removed from the glyph row because
11190 they don't fit.
c02dcedf
EZ
11191 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
11192 column is beyond frame width: don't subtract 1 "pixel" when
11193 computing width of the stretch.
3e62b7e0
EZ
11194 (reseat_at_next_visible_line_start): Undo the change made on
11195 2011-09-17 that saved paragraph information and restored it after
11196 the call to `reseat'. (Bug#9545)
56cd55c8 11197
5ed99d36 111982011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
11199
11200 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
11201 and turn window cursor on if cleared (Bug#9415).
11202
5ed99d36 112032011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
11204
11205 * search.c (boyer_moore): Take unibyte characters from pattern
11206 literally. (Bug#9458)
11207
9bade7b2
EZ
112082011-09-18 Eli Zaretskii <eliz@gnu.org>
11209
11210 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
11211
e5e9d610
PE
112122011-09-18 Paul Eggert <eggert@cs.ucla.edu>
11213
87e4427a
PE
11214 Fix minor problem found by static checking.
11215 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
11216 initialized, to pacify gcc -Wuninitialized.
11217
e5e9d610
PE
11218 * fileio.c: Report proper errno when syscall falls.
11219 (Finsert_file_contents): Save and restore errno,
11220 so that report_file_error outputs the correct diagnostic.
11221 (Fwrite_region) [CLASH_DETECTION]: Likewise.
11222
a1674f0b
EZ
112232011-09-18 Eli Zaretskii <eliz@gnu.org>
11224
11225 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
11226
fbfb6dd4
EZ
112272011-09-17 Eli Zaretskii <eliz@gnu.org>
11228
11229 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
11230 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
11231
bb187662
EZ
112322011-09-17 Eli Zaretskii <eliz@gnu.org>
11233
1137e8b8 11234 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 11235 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
11236
11237 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
11238 (bidi_find_paragraph_start): Search back for paragraph beginning
11239 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
11240 (bidi_move_to_visually_next): Only trigger paragraph-related
11241 computations when the last character is a newline or at EOB, not
11242 just any NEUTRAL_B. (Bug#9470)
11243
bb187662
EZ
11244 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
11245 truncated lines if point is covered by a display string. (Bug#9524)
11246
2e621251
PE
112472011-09-16 Paul Eggert <eggert@cs.ucla.edu>
11248
11249 * xselect.c: Relax test for outgoing X longs (Bug#9498).
11250 (cons_to_x_long): New function.
11251 (lisp_data_to_selection_data): Use it. Correct the test for
11252 short-versus-long data; it was negated. Break out of vector
11253 loop, for efficiency, when a long datum is discovered.
11254
91a15bc6
SM
112552011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
11256
11257 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
11258
b41c3a35
EZ
112592011-09-16 Eli Zaretskii <eliz@gnu.org>
11260
11261 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
11262 GCC PR/17406) by declaring this function with external scope.
11263
7812ba2d
PE
112642011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11265
11266 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
11267 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
11268
cf7edc2a
AS
112692011-09-15 Andreas Schwab <schwab@linux-m68k.org>
11270
11271 * editfns.c (Fformat): Correctly handle text properties on "%%".
11272
bd01620e
EZ
112732011-09-15 Eli Zaretskii <eliz@gnu.org>
11274
11275 * xterm.c (x_draw_composite_glyph_string_foreground):
11276 * w32term.c (x_draw_composite_glyph_string_foreground):
11277 * term.c (encode_terminal_code):
11278 * composite.c (composition_update_it, get_composition_id):
11279 * xdisp.c (get_next_display_element)
11280 (fill_composite_glyph_string): Add comments about special meaning
11281 of TAB characters in a composition.
11282
a02719a3
PE
112832011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11284
11285 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
11286 This occurs when processing a multibyte format.
11287 Problem reported by Wolfgang Jenker.
a02719a3 11288
72589a3c
JB
112892011-09-15 Johan Bockgård <bojohan@gnu.org>
11290
11291 * xdisp.c (try_cursor_movement): Only check for exact match if
11292 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
11293
1c14176c
PE
112942011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11295
11296 Remove unused external symbols.
11297 * dispextern.h (calc_pixel_width_or_height): Remove decl.
11298 * xdisp.c (calc_pixel_width_or_height): Now static.
11299 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
11300 * indent.c (check_display_width):
11301 * w32term.c: Fix comment to match code.
11302 * xterm.c, xterm.h (x_catching_errors): Remove.
11303
d2eea5b5
PE
113042011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11305
11306 * xselect.c: Use signed conversions more consistently (Bug#9498).
11307 (selection_data_to_lisp_data): Assume incoming selection data are
11308 signed integers, not unsigned. This is to be consistent with
11309 outgoing selection data, which was modified to use signed integers
11310 in as part of the fix to Bug#9196 in response to Jan D.'s comment
11311 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
11312 expects long, not unsigned long.
11313
46888499
EZ
113142011-09-14 Eli Zaretskii <eliz@gnu.org>
11315
11316 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
11317 computation of loop end. Reported by Johan Bockgård
11318 <bojohan@gnu.org>.
11319
ef8ef9fb
CY
113202011-09-13 Chong Yidong <cyd@stupidchicken.com>
11321
11322 * frame.c (Fother_visible_frames_p): Function deleted.
11323
fa819fed
EZ
113242011-09-12 Eli Zaretskii <eliz@gnu.org>
11325
11326 * indent.c (compute_motion): Process display vector front to back
11327 rather than the other way around. (Bug#2496)
11328
2ba8e008
SM
113292011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
11330
11331 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
11332
20f53c69
CY
113332011-09-11 Chong Yidong <cyd@stupidchicken.com>
11334
11335 * minibuf.c (Fread_from_minibuffer): Doc fix.
11336
d562d7a4
EZ
113372011-09-11 Eli Zaretskii <eliz@gnu.org>
11338
11339 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
11340 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
11341
1c4d7f3d
LMI
113422011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11343
11344 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
11345 value for non-existent files.
11346
b885bf36
EZ
113472011-09-11 Eli Zaretskii <eliz@gnu.org>
11348
11349 * fileio.c (Finsert_file_contents): If the file cannot be opened,
11350 set its "size" to -1. This will set the modtime_size field of
11351 the corresponding buffer to -1, which is what
11352 verify-visited-file-modtime expects for files that do not exist.
11353 (Bug#9139)
11354
6612f0bf
PE
113552011-09-11 Paul Eggert <eggert@cs.ucla.edu>
11356
11357 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
11358 here ...
11359 * lisp.h: ... from here. push_key_description is no longer
11360 defined in keyboard.c, so its declaration should not be in
11361 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
11362 logically belongs with push_key_description.
11363
dfb3f755
PE
113642011-09-10 Paul Eggert <eggert@cs.ucla.edu>
11365
11366 * buffer.h: Include <sys/types.h> instead of <time.h>.
11367 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
11368 Problem reported by Herbert J. Skuhra.
11369
3134906c
LMI
113702011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
11371
11372 * xml.c (parse_region): Make the parsing work for
11373 non-comment-starting XML files again (bug#9144).
11374
8d903f4e
AS
113752011-09-10 Andreas Schwab <schwab@linux-m68k.org>
11376
11377 * image.c (gif_load): Fix calculation of bottom and right corner.
11378 (Bug#9468)
11379
80ad64f4
EZ
113802011-09-10 Eli Zaretskii <eliz@gnu.org>
11381
11382 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
11383 redisplay in small windows.
11384
208a048d
EZ
113852011-09-09 Eli Zaretskii <eliz@gnu.org>
11386
11387 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
11388
9b1c252e
MR
113892011-09-08 Martin Rudalics <rudalics@gmx.at>
11390
11391 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
11392 Operate on live windows only.
11393
2949f33b
JB
113942011-09-08 Juanma Barranquero <lekktu@gmail.com>
11395
11396 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
11397
e08dcafd
EZ
113982011-09-07 Eli Zaretskii <eliz@gnu.org>
11399
11400 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
11401 only under bidi iteration.
11402
115b96bd
JD
114032011-09-07 Jan Djärv <jan.h.d@swipnet.se>
11404
11405 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11406
c8199d0f
PE
114072011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11408
11409 isnan: Fix porting problem to Solaris 10 with bundled gcc.
11410 Without this fix, the command to link temacs failed due to an
11411 undefined symbol __builtin_isnan. This is because
11412 /usr/include/iso/math_c99.h #defines isnan(x) to
11413 __builtin_isnan(x), but the bundled gcc, which identifies itself
11414 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11415 a __builtin_isnan.
11416 * floatfns.c (isnan): #undef, and then #define to a clone of
11417 what's in data.c.
11418 (Fisnan): Always define, since it's always available now.
11419 (syms_of_floatfns): Always define isnan at the Lisp level.
11420
e39b275c 114212011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
11422
11423 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11424
b2db44d9 114252011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 11426
f4af5137 11427 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
11428 The previous code assumed that file offsets (off_t values) fit in
11429 EMACS_INT variables, which is not true on typical 32-bit hosts.
11430 The code messed up by falsely reporting buffer overflow in cases
11431 such as (insert-file-contents "big" nil 1 2) into an empty buffer
11432 when "big" contains more than 2**29 bytes, even though this
11433 inserts just one byte and does not overflow the buffer.
11434 (Finsert_file_contents): Store file offsets as off_t
11435 values, not as EMACS_INT values. Check for overflow when
11436 converting between EMACS_INT and off_t. When checking for
11437 buffer overflow or for overlap, take the offsets into account.
11438 Don't use EMACS_INT for small values where int suffices.
11439 When checking for overlap, fix a typo: ZV was used where
11440 ZV_BYTE was intended.
11441 (Fwrite_region): Don't assume off_t fits into 'long'.
11442 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
11443
ecfc0a49
MA
114442011-09-05 Michael Albinus <michael.albinus@gmx.de>
11445
11446 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
11447
6511acf2 114482011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 11449
0999621a 11450 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
11451
11452 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 11453 (esprintf, exprintf, evxprintf): New functions.
62f19c19 11454 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 11455 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
11456 (modify_event_symbol): Do not assume that the length of
11457 name_alist_or_stem is safe to alloca and fits in int.
11458 (Fexecute_extended_command): Likewise for function name and binding.
11459 (Frecursion_depth): Wrap around reliably on integer overflow.
11460 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11461 since some callers pass EMACS_INT values.
11462 (Fsingle_key_description): Don't crash if symbol name contains more
11463 than MAX_ALLOCA bytes.
11464 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11465 (get_minibuffer): Arg is now EMACS_INT, not int.
11466 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 11467 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
11468 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11469
2be7d702
PE
11470 * dbusbind.c (signature_cat): New function.
11471 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
11472 Do not overrun buffer; instead, report string overflow.
11473
9d1df220
PE
11474 * dispnew.c (add_window_display_history): Don't overrun buffer.
11475 Truncate instead; this is OK since it's just a log.
11476
33ef5c64
PE
11477 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11478 even if the time zone offset is outlandishly large.
11479 Don't mishandle offset == INT_MIN.
11480
66c6fdd5
PE
11481 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11482 when creating daemon; the previous buffer-overflow check was incorrect.
11483
d749b01b
PE
11484 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11485 which has the guts of the old verror function.
11486
b5cd1905
PE
11487 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11488 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11489
6e1a67fb
PE
11490 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11491 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 11492 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 11493 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
11494 length of string rather than counting it via multiple sprintfs;
11495 that's simpler and more reliable.
c21721cc
PE
11496 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11497 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11498 sprintf, in case result does not fit in int.
11499
c57b67fc
PE
11500 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11501 (fontset_from_font): Print it.
11502
8a401434
PE
11503 * frame.c (tty_frame_count): Now printmax_t, not int.
11504 (make_terminal_frame, set_term_frame_name): Print it.
11505 (x_report_frame_params): In X, window IDs are unsigned long,
11506 not signed long, so print them as unsigned.
11507 (validate_x_resource_name): Check for implausibly long names,
11508 and don't assume name length fits in 'int'.
11509 (x_get_resource_string): Don't blindly alloca invocation name;
11510 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
11511 not fit in int.
11512
6e1a67fb
PE
11513 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11514 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
11515 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11516
0df02bf3
PE
11517 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11518 Use esprintf, not sprintf, in case result does not fit in int.
11519
48e30793
PE
11520 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11521 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11522 it as a large positive number.
11523 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
11524 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11525
a66ff6d8
PE
11526 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
11527 in case result does not fit in int.
11528
aca216ff
PE
11529 * print.c (float_to_string): Detect width overflow more reliably.
11530 (print_object): Make sprintf buffer a bit bigger, to avoid potential
11531 buffer overrun. Don't assume list length fits in 'int'. Treat
11532 print length of 0 as 0, not as infinity; to be consistent with other
11533 uses of print length in this function. Don't overflow print length
11534 index. Don't assume hash table size fits in 'long', or that
11535 vectorlike size fits in 'unsigned long'.
11536
31c286f7
PE
11537 * process.c (make_process): Use printmax_t, not int, to format
11538 process-name gensyms.
11539
55e5faa1
PE
11540 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
11541
80f2e268
PE
11542 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
11543 to avoid potential buffer overrun.
11544
670741ab
PE
11545 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
11546 if X resource line is longer than 512 bytes.
11547
b7163a50
PE
11548 * xfns.c (x_window): Make sprintf buffer a bit bigger
11549 to avoid potential buffer overrun.
11550
ae58ff1f
PE
11551 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
11552
c43c8a6a
PE
11553 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
11554
3f8236f4
PE
115552011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11556
53e9fe90 11557 Integer overflow fixes for scrolling, etc.
6511acf2
PE
11558 Without these, Emacs silently mishandles large integers sometimes.
11559 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
11560 it were "C-u 1 M-x recenter" on a typical 64-bit host.
11561
6511acf2
PE
11562 * xdisp.c (try_window_id): Check Emacs fixnum range before
11563 converting to 'int'.
806add1d 11564
6511acf2 11565 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
11566 Check that an Emacs fixnum is in range before assigning it to 'int'.
11567 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
11568 values converted from Emacs fixnums.
11569 (Frecenter): Don't wrap around a line count if it is out of 'int'
11570 range; instead, treat it as an extreme value.
11571 (Fset_window_configuration, compare_window_configurations):
11572 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
11573
6511acf2
PE
11574 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
11575 that can exceed INT_MAX. Check that EMACS_INT value is in range
11576 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
11577 (match_limit): Don't assume that a fixnum can fit in 'int'.
11578
6511acf2 11579 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
11580 exceed INT_MAX.
11581
6511acf2 11582 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
11583 (Fvertical_motion): Don't wrap around LINES values that don't fit
11584 in 'int'. Instead, treat them as extreme values. This is good
11585 enough for windows, which can't have more than INT_MAX lines anyway.
11586
fcb901a7
LMI
115872011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11588
0f2f6b6d
LMI
11589 * Require libxml/parser.h to avoid compilation warning.
11590
fcb901a7
LMI
11591 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11592
11593 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11594 since this reportedly can destroy thread storage.
11595
6e20a0d4
CY
115962011-08-30 Chong Yidong <cyd@stupidchicken.com>
11597
11598 * syntax.c (find_defun_start): Update all cache variables if
11599 exiting early (Bug#9401).
11600
148ae00e
EZ
116012011-08-30 Eli Zaretskii <eliz@gnu.org>
11602
f6cfbd8f
EZ
11603 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11604
148ae00e
EZ
11605 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11606 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
11607 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
11608
11609 * term.c (tty_append_glyph): New function.
11610 (produce_stretch_glyph): Static function and its prototype deleted.
11611
a66cfb1c
SM
11612 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11613 Add prototypes.
148ae00e 11614
c4a07a4c
PE
116152011-08-29 Paul Eggert <eggert@cs.ucla.edu>
11616
11617 * image.c (parse_image_spec): Check for nonnegative, not for positive,
11618 when checking :margin (Bug#9390).
11619 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 11620 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
11621 so that the name doesn't mislead. All uses changed.
11622
6bc8cd65
JB
116232011-08-28 Johan Bockgård <bojohan@gnu.org>
11624
11625 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11626 set_tty_hooks.
11627
dca4927e
EZ
116282011-08-27 Eli Zaretskii <eliz@gnu.org>
11629
11630 * xdisp.c (move_it_to): Don't bail out early when reaching
11631 position beyond to_charpos, if we are scanning backwards.
11632 (move_it_vertically_backward): When DY == 0, make sure we get to
11633 the first character in the line after the newline.
11634
f2cad773
PE
116352011-08-27 Paul Eggert <eggert@cs.ucla.edu>
11636
11637 * ccl.c: Improve and simplify overflow checking (Bug#9196).
11638 (ccl_driver): Do not generate an out-of-range pointer.
11639 (Fccl_execute_on_string): Remove unnecessary check for
11640 integer overflow, noted by Stefan Monnier in
11641 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11642 Remove a FIXME that didn't need fixing.
11643 Simplify the newly-introduced buffer reallocation code.
11644
0cae2cdb
JB
116452011-08-27 Juanma Barranquero <lekktu@gmail.com>
11646
11647 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11648
5fc295a4 116492011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 11650
70c60eb2 11651 Integer and memory overflow issues (Bug#9196).
726e0ab1 11652
d31850da
PE
11653 * doc.c (get_doc_string): Rework so that
11654 get_doc_string_buffer_size is the actual buffer size, rather than
11655 being 1 less than the actual buffer size; this makes xpalloc more
11656 convenient.
11657
a69fbedb
PE
11658 * image.c (x_allocate_bitmap_record, cache_image):
11659 * xselect.c (Fx_register_dnd_atom):
11660 Simplify previous changes by using xpalloc.
11661
fe5c5d37
PE
11662 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11663 since either will do and ptrdiff_t is convenient with xpalloc.
11664
0065d054
PE
11665 * charset.c (charset_table_size)
11666 (struct charset_sort_data.priority): Now ptrdiff_t.
11667 (charset_compare): Don't overflow if priorities differ greatly.
11668 (Fsort_charsets): Don't assume list length fits in int.
11669 Check for size-calculation overflow when allocating sort data.
11670 (syms_of_charset): Allocate an initial charset table that is
11671 just under 64 KiB, to avoid problems with glibc malloc and mmap.
11672
11673 * cmds.c (internal_self_insert): Check for size-calculation overflow.
11674
11675 * composite.h (struct composition.glyph_len): Now int, not unsigned.
11676 The actual value is always <= INT_MAX, and leaving it unsigned made
11677 overflow checking harder.
11678
11679 * dispextern.h (struct glyph_matrix.rows_allocated)
11680 (struct face_cache.size): Now ptrdiff_t, for convenience in use
11681 with xpalloc. The values are still always <= INT_MAX.
11682
11683 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
11684
11685 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
11686 (SAFE_NALLOCA): New macro.
11687
11688 * region-cache.c (struct boundary.pos, find_cache_boundary)
11689 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
11690 (set_cache_region, invalidate_region_cache)
11691 (revalidate_region_cache, know_region_cache, region_cache_forward)
11692 (region_cache_backward, pp_cache):
11693 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
11694 so that ptrdiff_t * can be passed to xpalloc.
11695 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
11696 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
11697 (pp_cache): Don't assume cache_len fits in int.
11698 * region-cache.h: Adjust extern decls to match.
11699
11700 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
11701 EMACS_INT, since either will do, for xpalloc.
11702
11703 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
11704 (xnmalloc, xnrealloc, xpalloc): New functions.
11705
726e0ab1
PE
11706 * bidi.c (bidi_shelve_header_size): New constant.
11707 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11708 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11709
51f30bc5 11710 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
11711 * buffer.c (overlays_at, overlays_in, record_overlay_string)
11712 (overlay_strings):
11713 Don't update size of array until after memory allocation succeeds,
11714 because xmalloc/xrealloc may not return.
0065d054
PE
11715 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11716 now that we have proper integer overflow checking.
11717 (record_overlay_string, overlay_strings): Catch overflows when
11718 calculating size of overlay_str_buf.
726e0ab1 11719
0065d054
PE
11720 * callproc.c (Fcall_process): Check for size overflow when
11721 calculating size of args2.
11722 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11723 Normally we prefer signed values, but sticking with ptrdiff_t would
11724 require adding more-complicated checks.
726e0ab1
PE
11725
11726 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11727 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11728 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 11729 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
11730
11731 * character.c (Fstring): Check for size-calculation overflow.
11732
11733 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11734 unnecessary integer overflow. Check for size overflow.
11735 (encode_coding_object): Don't update size until xmalloc succeeds.
11736
11737 * composite.c (get_composition_id): Check for overflow in glyph
11738 length calculations.
11739
11740 Integer and memory overflow fixes for display code.
11741 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11742 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11743 (scrolling_window): Check for overflow in size calculations.
11744 (line_draw_cost, realloc_glyph_pool, add_row_entry):
11745 Don't assume glyph table len fits in int.
11746 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11747 (row_table_size): Now ptrdiff_t, not int.
11748 (scrolling_window): Avoid overflow in size calculations.
11749 Don't update size until allocation succeeds.
11750 * fns.c (concat): Check for overflow in size calculations.
11751 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11752 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11753 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11754
11755 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11756 (get_doc_string): Check for size calculation overflow.
11757 Don't update size until allocation succeeds.
11758 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11759 EMACS_INT, where ptrdiff_t will do.
11760 (Fsubstitute_command_keys): Check for string overflow.
11761
11762 * editfns.c (set_time_zone_rule): Don't assume environment length
11763 fits in int.
11764 (message_length): Now ptrdiff_t, not int.
11765 (Fmessage_box): Don't update size until allocation succeeds.
11766 Don't assume message length fits in int.
11767 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11768
0065d054
PE
11769 * emacs.c (main): Do not reallocate argv, since there is a null at
11770 the end that can be overwritten, and this way there's no need to
11771 worry about size-calculation overflow.
11772 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
11773
11774 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11775 alloc succeeds.
11776 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11777
11778 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11779 (x_set_scroll_bar_width, x_figure_window_size):
11780 Check for integer overflow.
11781 (x_set_alpha): Do not assume XINT fits in int.
11782
11783 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11784 This is for the members text_lines, text_cols, total_lines, total_cols,
11785 where the system imposes an 'int' limit.
11786
11787 * fringe.c (Fdefine_fringe_bitmap):
11788 Don't update size until alloc works.
11789
11790 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11791 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11792
11793 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11794 Check for size-calculation overflow.
11795 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11796 do, as we prefer signed integers.
11797 (id_to_widget.max_size, id_to_widget.used)
11798 (xg_store_widget_in_map, xg_remove_widget_from_map)
11799 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11800 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11801 Use and return ptrdiff_t, not int.
11802 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11803 * gtkutil.h: Change prototypes to match the above.
11804
11805 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11806 are duplicate now that they've been promoted to lisp.h.
11807 (x_allocate_bitmap_record, x_alloc_image_color)
11808 (make_image_cache, cache_image, xpm_load):
11809 Don't update size until alloc is done.
11810 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11811 (x_detect_edges):
3256efce 11812 Check for size calculation overflow.
726e0ab1
PE
11813 (ct_colors_allocated_max): New constant.
11814 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11815 overflow.
3256efce 11816
726e0ab1
PE
11817 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11818 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11819 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11820 Use ptrdiff_t, not int, to count maps.
11821 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
11822 calculations. Don't update size until allocation succeeds.
11823 Redo calculations to avoid overflow.
726e0ab1
PE
11824 * keyboard.h: Change prototypes to match the above.
11825
11826 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11827 to count maps.
11828 (current_minor_maps): Check for size calculation overflow.
11829 * keymap.h: Change prototypes to match the above.
11830
11831 * lread.c (read1, init_obarray): Don't update size until alloc done.
11832
11833 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11834 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11835
726e0ab1
PE
11836 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11837 Now ptrdiff_t, not int.
11838 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11839 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11840
11841 * process.c (Fnetwork_interface_list): Check for overflow
11842 in size calculation.
11843
11844 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11845
11846 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11847 overflow. Don't bother calling xmalloc when xrealloc will do.
11848
11849 * search.c (Freplace_match): Check for size calculation overflow.
11850 (Fset_match_data): Don't assume list lengths fit in 'int'.
11851
11852 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11853 for command line length. Do not attempt to address one before the
11854 beginning of an array, as that's not portable.
11855
11856 * term.c (max_frame_lines): Remove; unused.
11857 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11858 not int.
11859 (encode_terminal_code, calculate_costs): Check for size
11860 calculation overflow.
11861 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11862 table lengths and related sizes. Don't update size until alloc
11863 done. Redo calculations to avoid overflow.
11864 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11865
11866 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11867 subtracting pointers.
11868 (gobble_line): Check for overflow more carefully. Don't update size
11869 until alloc done.
11870
11871 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11872 Don't update size until alloc done.
11873 Redo size calculations to avoid overflow.
11874 Check for size calculation overflow.
0065d054 11875 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
11876
11877 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11878 Use ptrdiff_t, not int, for sizes.
11879 (store_mode_line_noprop_char): Don't update size until alloc done.
11880
0065d054
PE
11881 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11882 Use ptrdiff_t, not int, for sizes.
11883 (Finternal_make_lisp_face, cache_face):
11884 Check for size calculation overflow.
11885 (cache_face): Treat size calculation overflows as if they were
11886 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
11887
11888 * xfns.c (x_encode_text, x_set_name_internal)
11889 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11890 sizes, since they can exceed INT_MAX in size. Check for size
11891 calculation overflow.
11892
0065d054
PE
11893 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11894 (xg_select): Check for size calculation overflow.
726e0ab1
PE
11895 Don't update size until alloc done.
11896
0065d054 11897 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 11898 as sprintf is limited to int lengths.
1d526e2f 11899
252c5ee1
PE
11900 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11901 (X_LONG_MIN): New macros.
864d7ce7
PE
11902 Use them to make the following changes clearer.
11903 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11904 This change doesn't affect the value now, but it may help remind
11905 future maintainers not to raise the value too much later.
11906 (SELECTION_QUANTUM): Remove, replacing with ...
11907 (selection_quantum): ... new function, which avoids overflow.
11908 All uses changed.
11909 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11910 assumption that selection length fits in 'int'.
11911 (x_reply_selection_request, x_handle_selection_request)
11912 (x_get_window_property, receive_incremental_selection)
11913 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11914 (lisp_data_to_selection_data, clean_local_selection_data):
11915 Use ptrdiff_t, not int, to record length of selection.
11916 (x_reply_selection_request, x_get_window_property)
11917 (receive_incremental_selection, x_property_data_to_lisp):
11918 Redo calculations to avoid overflow.
11919 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 11920 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
11921 something.
11922 (x_get_window_property, receive_incremental_selection)
11923 (lisp_data_to_selection_data, x_property_data_to_lisp):
11924 Check for size-calculation overflow.
11925 (x_get_window_property, receive_incremental_selection)
11926 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11927 Don't store size until memory allocation succeeds.
11928 (x_get_window_property): Plug memory leak on memory exhaustion.
11929 Don't double-block input; malloc is safe here. Don't assume 2**34
11930 - 4 fits in unsigned long. Add an xassert to check
11931 XGetWindowProperty overflow. Be more careful about overflow
11932 calculations, and distinguish size from memory overflow better.
11933 (receive_incremental_selection): When tracing, don't assume
11934 unsigned int is less than INT_MAX.
11935 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11936 harmful) conversions of unsigned short to int.
11937 (lisp_data_to_selection_data): Don't assume that integers
11938 in the range -65535 through -1 fit in an X unsigned short.
11939 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11940 result parameters unless successful. Rely on cons_to_unsigned
11941 to report problems with elements; the old code wasn't right anyway.
11942 (x_check_property_data): Check for int overflow; we cannot use
11943 a wider type due to X limits.
11944 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11945
726e0ab1 11946 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 11947
0065d054
PE
11948 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11949 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
11950 (x_color_cells): Don't store size until memory allocation succeeds.
11951 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 11952 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
11953 (x_term_init): Don't assume length fits in int (sprintf is limited
11954 to int size).
bc18e09d 11955
ebfa62c0
PE
11956 Use ptrdiff_t for composition IDs.
11957 * character.c (lisp_string_width):
11958 * composite.c (composition_table_size, n_compositions)
11959 (get_composition_id, composition_gstring_from_id):
11960 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11961 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11962 * window.c (Frecenter):
11963 Use ptrdiff_t, not int, for composition IDs.
11964 * composite.c (get_composition_id): Check for integer overflow.
11965 * composite.h: Adjust prototypes to match the above changes.
11966
d3411f89
PE
11967 Use ptrdiff_t for hash table indexes.
11968 * category.c (hash_get_category_set):
11969 * ccl.c (ccl_driver):
11970 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11971 * coding.c (coding_system_charset_list, detect_coding_system):
11972 * coding.h (struct coding_system.id):
11973 * composite.c (get_composition_id, gstring_lookup_cache):
11974 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11975 * image.c (xpm_get_color_table_h):
11976 * lisp.h (hash_lookup, hash_put):
11977 * minibuf.c (Ftest_completion):
11978 Use ptrdiff_t for hash table indexes, not int (which is too
11979 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11980 32-bit --with-wide-int hosts).
11981
e097a6fa
PE
11982 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11983 Add a FIXME comment about memory leaks.
11984 (syms_of_charset): Don't assume xmalloc returns.
11985
5637687f
PE
11986 Don't assume that stated character widths fit in int.
11987 * character.c (Fchar_width, c_string_width, lisp_string_width):
11988 * character.h (CHAR_WIDTH):
11989 * indent.c (MULTIBYTE_BYTES_WIDTH):
11990 Use sanitize_char_width to avoid undefined and/or bad behavior
11991 with outlandish widths.
a66cfb1c 11992 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
11993 now that we have two such functions. All uses changed.
11994 (sanitize_char_width): New inline function.
11995
a2271ba2
PE
11996 Don't assume that tab-width fits in int.
11997 * character.h (sanitize_width): New inline function.
11998 (SANE_TAB_WIDTH): New macro.
11999 (ASCII_CHAR_WIDTH): Use it.
12000 * indent.c (sane_tab_width): Remove. All uses replaced by
12001 SANE_TAB_WIDTH (current_buffer).
12002 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12003
18c52557
PE
12004 * fileio.c: Integer overflow issues with file modes.
12005 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12006
caeeedc1
PE
12007 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12008 Remove unreachable code.
12009 (read_hex, load_charset_map_from_file): Check for integer overflow.
12010
6df6ae42 12011 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
12012 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12013 (x_send_scroll_bar_event): Likewise. Check that the size does not
12014 exceed limits imposed by XClientMessageEvent, as well as the usual
12015 ptrdiff_t and size_t limits.
12016
b13995db
PE
12017 * keyboard.c: Overflow, signedness and related fixes.
12018 (make_lispy_movement): Use same integer type in forward decl
12019 that is used in the definition.
12020 (read_key_sequence, keyremap_step):
12021 Change bufsize argument back to int, undoing my 2011-03-30 change.
12022 We prefer signed types, and int is wide enough here.
12023 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12024 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12025 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12026 length, not size_t. Use ptrdiff_t for index, not int.
12027 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12028 possibility of integer overflow.
12029
13464394
PE
12030 Overflow, signedness and related fixes for images.
12031
12032 * dispextern.h (struct it.stack[0].u.image.image_id)
12033 (struct_it.image_id, struct image.id, struct image_cache.size)
12034 (struct image_cache.used, struct image_cache.ref_count):
12035 * gtkutil.c (update_frame_tool_bar):
12036 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12037 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12038 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12039 * nsmenu.m (update_frame_tool_bar):
12040 * xdisp.c (calc_pixel_width_or_height):
12041 * xfns.c (image_cache_refcount):
12042 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12043 on typical 64-bit hosts.
12044
12045 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12046 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12047 Omit unnecessary casts to int.
12048 (parse_image_spec): Check that integers fall into 'int' range
12049 when the callers expect that.
12050 (image_ascent): Redo ascent calculation to avoid int overflow.
12051 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12052 (lookup_image): Remove unnecessary tests.
12053 (xbm_image_p): Locals are now of int, not EMACS_INT,
12054 since parse_image_check makes sure they fit into int.
12055 (png_load, gif_load, svg_load_image):
12056 Prefer int to unsigned where either will do.
12057 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
12058 old tiff_error_handler and tiff_warning_handler.
12059 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
12060 stack buffer overflows. It uses only the features of vsnprintf
12061 that are common to both POSIX and native Microsoft.
12062 (tiff_error_handler, tiff_warning_handler): Use it.
12063 (tiff_load, gif_load, imagemagick_load_image):
12064 Don't assume :index value fits in 'int'.
12065 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12066 (imagemagick_load_image): Check that crop parameters fit into
12067 the integer types that MagickCropImage accepts. Don't assume
12068 Vimagemagick_render_type has a nonnegative value. Don't assume
12069 size_t fits in 'long'.
12070 (gs_load): Use printmax_t to print the widest integers possible.
12071 Check for integer overflow when computing image height and width.
12072
c11821d4
EZ
120732011-08-26 Eli Zaretskii <eliz@gnu.org>
12074
12075 * xdisp.c (redisplay_window): Don't force window start if point
12076 will be invisible in the resulting window. (Bug#9324)
12077
0c95fcf7
EZ
120782011-08-25 Eli Zaretskii <eliz@gnu.org>
12079
12080 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12081 the display spec is of the form `(space ...)'.
12082 (handle_display_spec): Return the value returned by
12083 handle_single_display_spec, not just 1 or zero.
12084 (handle_single_display_spec): If the display spec is of the form
12085 `(space ...)', and specifies display in the text area, return 2
12086 rather than 1.
fee65a97 12087 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
12088 accurately, and prefer exact match for point under bidi.
12089 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
12090
12091 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12092 into disp_prop; all users changed.
12093
12094 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12095 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12096 for the text covered by the display property.
12097
e4ed06f1
CY
120982011-08-25 Chong Yidong <cyd@stupidchicken.com>
12099
12100 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12101 Change return value to nil.
12102 (Frecord_buffer): Delete unused function.
12103
f67cdd7f
EZ
121042011-08-24 Eli Zaretskii <eliz@gnu.org>
12105
5980d4c6
EZ
12106 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12107 buffers, return left-to-right.
8610fe8b
EZ
12108 (set_cursor_from_row): Consider candidate row a win if its glyph
12109 represents a newline and point is on that newline. Fixes cursor
12110 positioning on the newline at EOL of R2L text within L2R
12111 paragraph, and vice versa.
12112 (try_cursor_movement): Check continued rows, in addition to
12113 continuation rows. Fixes unwarranted scroll when point enters a
12114 continued line of R2L text within an L2R paragraph, or vice versa.
12115 (cursor_row_p): Consider the case of point being equal to
12116 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12117 from the end of a short line to the beginning of a continued line
12118 of R2L text within L2R paragraph.
12119 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12120 composed characters.
5980d4c6 12121
f67cdd7f
EZ
12122 * bidi.c (bidi_check_type): Use xassert.
12123 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12124 members.
12125
bca633fb
EZ
121262011-08-23 Eli Zaretskii <eliz@gnu.org>
12127
12128 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12129 a character.
12130
4a5885a7
CY
121312011-08-23 Chong Yidong <cyd@stupidchicken.com>
12132
12133 * nsfont.m (ns_otf_to_script): Fix typo.
12134
0902a04e
KH
121352011-08-22 Kenichi Handa <handa@m17n.org>
12136
12137 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12138 extra slot even if the purpose is char-code-property-table.
12139
1a2e6670
EZ
121402011-08-23 Eli Zaretskii <eliz@gnu.org>
12141
8ddde651
EZ
12142 * xdisp.c (redisplay_window): When computing centering_position,
12143 account for the height of the header line. (Bug#8874)
12144
425cc014
EZ
12145 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12146 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12147 candidate is selected by the mouse, and that candidate has a
12148 composed character under the mouse.
12149
1a2e6670
EZ
12150 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12151 coordinates reported by pos-visible-in-window-p for a composed
12152 character in column zero.
12153
8b76d6f8
SM
121542011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12155
12156 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12157
dac347dd
EZ
121582011-08-22 Eli Zaretskii <eliz@gnu.org>
12159
12160 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12161 consider it a hit if to_charpos is anywhere in the range of the
12162 composed buffer positions.
12163
e013fb34
CY
121642011-08-22 Chong Yidong <cyd@stupidchicken.com>
12165
12166 * image.c (gif_load): Don't assume that each subimage has the same
12167 dimensions as the base image. Handle disposal method that is
12168 "undefined" by the gif spec (Bug#9335).
12169
bd1ba3e8
CY
121702011-08-20 Chong Yidong <cyd@stupidchicken.com>
12171
12172 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 12173 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 12174
54a1215b
EZ
121752011-08-19 Eli Zaretskii <eliz@gnu.org>
12176
823564e5
EZ
12177 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12178 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12179 from an Org mode buffer to a Speedbar frame.
12180
54a1215b
EZ
12181 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
12182 a composition, take its buffer position from IT->cmp_it.charpos.
12183 Fixes cursor positioning at the beginning of a line that begins
12184 with a composed character.
12185
9778ebcc
EZ
121862011-08-18 Eli Zaretskii <eliz@gnu.org>
12187
0be6ee06
EZ
12188 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
12189 character bidirectional type, use STRONG_L instead. Fixes crashes
12190 in a buffer produced by `describe-categories'.
12191
9778ebcc
EZ
12192 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
12193 members before the level stack, so they would be saved and
12194 restored when copying iterator state. Fixes incorrect reordering
12195 around TABs covered by display properties.
12196
156bffbe
AS
121972011-08-18 Andreas Schwab <schwab@linux-m68k.org>
12198
6b02f655 12199 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 12200
72ad093b
CY
122012011-08-17 Chong Yidong <cyd@stupidchicken.com>
12202
12203 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
12204 (internal_condition_case_2, internal_condition_case_n):
12205 Remove unnecessary aborts (Bug#9081).
72ad093b 12206
35774242
EZ
122072011-08-17 Eli Zaretskii <eliz@gnu.org>
12208
12209 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
12210 has no `load' handler, try opening the file locally. (Bug#9311)
12211
db76dd85
KB
122122011-08-16 Ken Brown <kbrown@cornell.edu>
12213
12214 * gmalloc.c: Expand comment.
12215
b215eee5
EZ
122162011-08-16 Eli Zaretskii <eliz@gnu.org>
12217
12218 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
12219 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
12220
a4579d33
KB
122212011-08-16 Ken Brown <kbrown@cornell.edu>
12222
12223 Fix memory allocation problems in Cygwin build (Bug#9273).
12224
12225 * unexcw.c ( __malloc_initialized): Declare external variable.
12226 (fixup_executable): Force the dumped emacs to reinitialize malloc.
12227
8b76d6f8
SM
12228 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
12229 New variables.
a4579d33
KB
12230 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
12231 dumped emacs.
12232 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
12233 in the static heap.
12234 [CYGWIN] (special_realloc): New function.
12235 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
12236 requests to realloc storage in the static heap.
12237
3ebec551
PE
122382011-08-15 Paul Eggert <eggert@cs.ucla.edu>
12239
12240 * bidi.c (bidi_initialize): Remove unused local.
12241
9fd8be00
EZ
122422011-08-15 Eli Zaretskii <eliz@gnu.org>
12243
6b02f655
SM
12244 * bidimirror.h:
12245 * biditype.h: Remove file.
12246 * makefile.w32-in ($(BLD)/bidi.$(O)):
12247 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
12248
12249 * dispextern.h: Fix a typo in the comment to bidi_type_t.
12250
12251 * chartab.c: Improve commentary for the uniprop_table API.
12252
32413314
EZ
12253 * bidi.c (bidi_paragraph_init): Support zero value of
12254 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
12255 (bidi_initialize): Use uniprop_table instead of including
12256 biditype.h and bidimirror.h.
32413314 12257
9fd8be00
EZ
12258 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
12259 coordinates of the iterator when restoring from ppos_it.
12260 (Bug#9296)
12261
5cf2b69b
KH
122622011-08-14 Kenichi Handa <handa@m17n.org>
12263
12264 * process.c (create_process): Call setup_process_coding_systems
72ad093b 12265 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 12266
daf17d00
EZ
122672011-08-14 Eli Zaretskii <eliz@gnu.org>
12268
12269 * xdisp.c (move_it_in_display_line_to): Don't invoke
12270 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
12271 ppos_it. Fixes vertical cursor motion when line beginning is
12272 covered by an image. (Bug#9296)
12273
08e3161a
JD
122742011-08-14 Jan Djärv <jan.h.d@swipnet.se>
12275
12276 * nsterm.h (ns_run_ascript): Declare.
12277 (NSAPP_DATA2_RUNASSCRIPT): Define.
12278
12279 * nsfns.m (as_script, as_result, as_status): New static variables.
12280 (ns_run_ascript): New function.
5e617bc2 12281 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
12282 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
12283 the event loop. Get status from as_status (Bug#7276).
12284
12285 * nsterm.m (sendEvent): If event is NSApplicationDefined and
12286 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
12287 the event loop (Bug#7276).
12288
a3720aa2
AS
122892011-08-14 Andreas Schwab <schwab@linux-m68k.org>
12290
12291 * gnutls.c (QCgnutls_bootprop_priority)
12292 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
12293 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
12294 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
12295 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
12296 (QCgnutls_bootprop_verify_hostname_error)
12297 (QCgnutls_bootprop_callbacks_verify): Rename from
12298 Qgnutls_bootprop_..., all uses changed.
12299
12300 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
12301 uses changed.
12302
0a0d27fb
PE
123032011-08-14 Paul Eggert <eggert@cs.ucla.edu>
12304
19d5c50c
PE
12305 * xfaces.c (Qframe_set_background_mode): Now static.
12306 * dispextern.h (Qframe_set_background_mode): Remove decl.
12307
0a0d27fb
PE
12308 * process.c (Fnetwork_interface_info): Declare local only if needed.
12309
377538cb
JD
123102011-08-13 Jan Djärv <jan.h.d@swipnet.se>
12311
12312 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
12313 (Fnetwork_interface_list): Allocate in increments of bytes instead
12314 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
12315 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
12316 sockaddr.
12317 (struct ifflag_def): notrailers is smart on OSX.
12318 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
12319 Get hardware address with getifaddrs if available.
12320
08fff70c
EZ
123212011-08-12 Eli Zaretskii <eliz@gnu.org>
12322
12323 * xdisp.c (iterate_out_of_display_property): xassert that
12324 IT->position is set to within IT->object's boundaries. Break from
12325 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
12326 when IT->position is set up wrongly due to some bug.
12327 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
12328 (push_display_prop): Allow GET_FROM_STRING as IT->method on
12329 entry. Force push_it to save on the stack the current
12330 buffer/string position, to be restored by pop_it. Fix flags in
12331 the iterator structure wrt the object coming from a display
12332 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
12333 properties. (Bug#9284)
12334
7be1c708 123352011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 12336
7be1c708
CY
12337 * fontset.c (fontset_get_font_group): Add proper type checks.
12338 (Bug#9172)
aac0c6e3 12339
7be1c708 123402011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 12341
7be1c708
CY
12342 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
12343 and LC_VERSION_MIN_MACOSX.
12344 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
12345 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 12346
97bb72a6
EZ
123472011-08-08 Eli Zaretskii <eliz@gnu.org>
12348
12349 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
12350 no-display-properties-and-no-overlays under bidi display.
12351 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 12352 properties and overlays.
97bb72a6 12353
d5617611
CY
123542011-08-08 Chong Yidong <cyd@stupidchicken.com>
12355
37e11a63
CY
12356 * editfns.c (Fset_time_zone_rule): Document relationship with the
12357 setenv function.
12358
d5617611
CY
12359 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
12360 the font entity extracted from the cache (Bug#8109).
12361
58872834
CY
123622011-08-07 Chong Yidong <cyd@stupidchicken.com>
12363
12364 * composite.c (autocmp_chars): Don't reset point. That is done by
12365 restore_point_unwind (Bug#5984).
12366
75bfc667
JL
123672011-08-07 Juri Linkov <juri@jurta.org>
12368
12369 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
12370 to show the arg `TIME' instead of `TIMEVAL'.
12371
d1410150
EZ
123722011-08-06 Eli Zaretskii <eliz@gnu.org>
12373
12374 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
12375 display property strides EOL and includes a newline, as in
12376 longlines-mode. (Bug#9254)
75b771e4
EZ
12377 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
12378 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
12379
12380 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12381 is non-zero, even if the data buffer is NULL. Fixes a crash in
12382 vertical-motion with longlines-mode. (Bug#9254)
12383
35928349
EZ
123842011-08-05 Eli Zaretskii <eliz@gnu.org>
12385
ec7cc85b
EZ
12386 * bidi.c <bidi_cache_total_alloc>: Now static.
12387 (bidi_initialize): Initialize bidi_cache_total_alloc.
12388
8b76d6f8 12389 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
12390 cache. (Bug#9221)
12391
12392 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
12393 amount allocated this far in `bidi_cache_total_alloc'.
12394 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
12395 non-zero, only free the data buffer without restoring the cache
12396 contents. All callers changed.
12397
12398 * dispextern.h (bidi_unshelve_cache): Update prototype.
12399
12400 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
12401 (move_it_in_display_line, move_it_to)
12402 (move_it_vertically_backward, move_it_by_lines): Replace the call
12403 to xfree to an equivalent call to bidi_unshelve_cache.
12404 (move_it_in_display_line_to): Fix logic of returning
412b6358 12405 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 12406
e2e2423b
EZ
124072011-08-05 Eli Zaretskii <eliz@gnu.org>
12408
12409 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12410 came from a string character with a `cursor' property. (Bug#9229)
12411
ae9e757a
JD
124122011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12413
12414 * Makefile.in (LIB_PTHREAD): New variable.
12415 (LIBES): Add LIB_PTHREAD (Bug#9216).
12416
12417 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12418 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12419
213bd7f2
AS
124202011-08-04 Andreas Schwab <schwab@linux-m68k.org>
12421
6b02f655 12422 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 12423
99aaf75f
JD
124242011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12425
12426 * xterm.c (x_find_topmost_parent): New function.
12427 (x_set_frame_alpha): Find topmost parent window with
12428 x_find_topmost_parent and set the property there also (bug#9181).
12429 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12430
c74e9d86
PE
124312011-08-04 Paul Eggert <eggert@cs.ucla.edu>
12432
12433 * callproc.c (Fcall_process): Avoid vfork clobbering
12434 the local vars buffer, coding_systems, current_dir.
12435
640c8776
SM
124362011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
12437
12438 * keymap.c (Fmake_composed_keymap): Move to subr.el.
12439
f26d0e4c
PE
124402011-08-03 Paul Eggert <eggert@cs.ucla.edu>
12441
8a10d76c
PE
12442 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
12443 so that it is not optimized away.
12444
f26d0e4c
PE
12445 * xdisp.c (compute_display_string_pos): Remove unused local.
12446
55439c61
EZ
124472011-08-02 Eli Zaretskii <eliz@gnu.org>
12448
12449 Fix slow cursor motion and scrolling in large buffers with
12450 selective display, like Org Mode buffers. (Bug#9218)
12451
12452 * dispextern.h (struct bidi_it): New member disp_prop_p.
12453
12454 * xdisp.c: Remove one-slot cache of display string positions.
12455 (compute_display_string_pos): Accept an additional argument
5e617bc2 12456 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
12457 for a display string or property. If found, set DISP_PROP_P
12458 non-zero.
12459
12460 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
12461 DISP_PROP_P, and pass it to compute_display_string_pos.
12462 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
12463 non-zero. All callers of bidi_fetch_char changed.
12464
fb33fa43
SM
124652011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
12466
12467 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12468
b099e063
DM
124692010-12-03 Don March <don@ohspite.net>
12470
12471 * keymap.c (Fdefine_key): Fix non-prefix key error message when
12472 last character M-[char] is translated to ESC [char] (bug#7541).
12473
5cc7f7af
KH
124742011-08-02 Kenichi Handa <handa@m17n.org>
12475
d0fffa3f 12476 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
12477
12478 * chartab.c (uniprop_table): Make it non-static.
12479
525d5e6e
EZ
124802011-08-01 Eli Zaretskii <eliz@gnu.org>
12481
12482 * xdisp.c (forward_to_next_line_start): Accept additional argument
12483 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12484 on the newline.
12485 (reseat_at_next_visible_line_start): Use the bidi iterator state
12486 returned by forward_to_next_line_start to restore the state of
12487 it->bidi_it after backing up to previous newline. (Bug#9212)
12488
31011111
AS
124892011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12490
12491 * regex.c (re_comp): Protoize.
12492 (re_exec): Fix return type.
12493 (regexec): Fix type of `ret'. (Bug#9203)
12494
476371c4
PE
124952011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12496
e5d76069
PE
12497 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12498 This is needed if max-image-size is a floating-point number.
12499
9a79b20c
AS
125002011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12501
12502 * print.c (print_object): Print empty symbol as ##.
12503
12504 * lread.c (read1): Read ## as empty symbol.
12505
d8c2fa78
AA
125062011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12507
12508 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12509 setting frame foreground color (Bug#9175).
12510 (x_set_background_color): Likewise.
12511
ffe57a7a
AA
12512 * nsmenu.m (-setText): Size tooltip dimensions precisely to
12513 contents (Bug#9176).
12514 (EmacsTooltip -init): Remove bezels and add shadows to
12515 tooltip windows.
12516
bf3492a5
AA
12517 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12518 or scroll bar (Bug#8470).
12519
d55e9c53
AA
12520 * nsfont.m (nsfont_open): Remove assignment to voffset and
12521 unnecessary vars hshink, expand, hd, full_height, min_height.
12522 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12523
12524 * nsterm.h (nsfont_info): Remove voffset field.
12525
d8c2fa78 125262011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
12527
12528 Implement strike-through and overline on NextStep (Bug#8863).
12529
12530 * nsfont.m (nsfont_open): Use underline position provided by font,
12531 instead of hard-coded value of 2.
12532 (nsfont_draw): Call ns_draw_text_decoration instead.
12533
12534 * nsterm.h: Add declaration for ns_draw_text_decoration.
12535
12536 * nsterm.m (ns_draw_text_decoration): New function for drawing
12537 underline, overline, and strike-through.
12538 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
12539 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 12540 accommodate underlining, etc.
4843aac3 12541
4cc60b9b
EZ
125422011-07-28 Eli Zaretskii <eliz@gnu.org>
12543
bc7ece87
EZ
12544 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
12545 default.
4cc60b9b 12546
476371c4
PE
125472011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12548
66606eea
PE
12549 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
12550 Without this fix, if a signal arrives just after memory fills up,
12551 'malloc' might be invoked reentrantly.
12552
476371c4
PE
12553 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
12554 In other words, assume that every image size is allowed, on non-X
12555 hosts. This assumption is probably wrong, but it lets Emacs compile.
12556
f3fcc40d
AS
125572011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12558
12559 * regex.c (re_iswctype): Convert return values to boolean.
12560
350c992f
EZ
125612011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
12562
12563 * xdisp.c (compute_display_string_pos): Don't use cached display
12564 string position if the buffer had its restriction changed.
12565 (Bug#9184)
12566
5266b4bb
PE
125672011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12568
12569 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12570
2573a837 125712011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 12572
41f55ccd 12573 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 12574
39e378da
PE
12575 * bidi.c: Integer size and overflow fixes.
12576 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
12577 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
12578 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12579 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
12580 (bidi_find_other_level_edge):
12581 Use ptrdiff_t instead of EMACS_INT where either will do.
12582 This works better on 32-bit hosts configured --with-wide-int.
12583 (bidi_cache_ensure_space): Check for size-calculation overflow.
12584 Use % rather than repeated addition, for better worst-case speed.
12585 Don't set bidi_cache_size until after xrealloc returns, because it
12586 might not return.
12587 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
12588 (bidi_cache_ensure_space): Also check that the bidi cache size
12589 does not exceed that of the largest Lisp string or buffer. See Eli
12590 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 12591
5e927815
PE
12592 * alloc.c (__malloc_size_t): Remove.
12593 All uses replaced by size_t. See Andreas Schwab's note
12594 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12595
ca4aa935
PE
12596 * image.c: Improve checking for integer overflow.
12597 (check_image_size): Assume that f is nonnull, since
12598 it is always nonnull in practice. This is one less thing to
12599 worry about when checking for integer overflow later.
12600 (x_check_image_size): New function, which checks for integer
12601 overflow issues inside X.
12602 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12603 This removes the need for a memory_full check.
12604 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12605 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12606 (xbm_read_bitmap_data): Change locals back to 'int', since
12607 their values must fit in 'int'.
12608 (xpm_load_image, png_load, tiff_load):
12609 Invoke x_create_x_image_and_pixmap earlier,
12610 to avoid much needless work if the image is too large.
12611 (tiff_load): Treat overly large images as if
12612 x_create_x_image_and_pixmap failed, not as malloc failures.
12613 (gs_load): Use x_check_image_size.
12614
5f8f9cc2
PE
12615 * gtkutil.c: Omit integer casts.
12616 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12617 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12618
5adf60bc
PE
12619 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12620
c8907a93
PE
12621 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12622 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12623 would wrongly return t on a 64-bit host.
12624
e3c25c68
PE
12625 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12626 The plain *_OVERFLOW macros run afoul of GCC bug 49705
12627 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12628 and therefore cause GCC to emit a bogus diagnostic in some cases.
12629
3f791afe
PE
12630 * image.c: Integer signedness and overflow and related fixes.
12631 This is not an exhaustive set of fixes, but it's time to
12632 record what I've got.
12633 (lookup_pixel_color, check_image_size): Remove redundant decls.
12634 (check_image_size): Don't assume that arbitrary EMACS_INT values
12635 fit in 'int', or that arbitrary 'double' values fit in 'int'.
12636 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12637 (tiff_load, imagemagick_load_image):
12638 Check for overflow in size calculations.
12639 (x_create_x_image_and_pixmap): Remove unnecessary test for
12640 xmalloc returning NULL; that can't happen.
12641 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12642 (xpm_color_bucket): Use better integer hashing function.
12643 (xpm_cache_color): Don't possibly over-allocate memory.
12644 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12645 (gif_memory_source):
12646 Use ptrdiff_t, not int or size_t, to record sizes.
12647 (png_load): Don't assume values greater than 2**31 fit in 'int'.
12648 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12649 either works, as we prefer signed integers.
12650 (tiff_read_from_memory, tiff_write_from_memory):
12651 Return tsize_t, not size_t, since that's what the TIFF API wants.
12652 (tiff_read_from_memory): Don't fail simply because the read would
12653 go past EOF; instead, return a short read.
12654 (tiff_load): Omit no-longer-needed casts.
12655 (Fimagemagick_types): Don't assume size fits into 'int'.
12656
3cc5a532
PE
12657 Improve hashing quality when configured --with-wide-int.
12658 * fns.c (hash_string): New function, taken from sxhash_string.
12659 Do not discard information about ASCII character case; this
12660 discarding is no longer needed.
12661 (sxhash-string): Use it. Change sig to match it. Caller changed.
12662 * lisp.h: Declare it.
12663 * lread.c (hash_string): Remove, since we now use fns.c's version.
12664 The fns.c version returns a wider integer if --with-wide-int is
12665 specified, so this should help the quality of the hashing a bit.
12666
b312a492
PE
12667 * emacs.c: Integer overflow minor fix.
12668 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
12669 Define only if GNU_LINUX.
12670 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12671
dfd153ae
PE
12672 * dispnew.c: Integer signedness and overflow fixes.
12673 Remove unnecessary forward decls, that were a maintenance hassle.
12674 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12675 All uses changed.
12676 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
12677 (scrolling_window): Use ptrdiff_t, not int, for byte count.
12678 (prepare_desired_row, line_draw_cost):
12679 Use int, not unsigned, where either works.
12680 (save_current_matrix, restore_current_matrix):
12681 Use ptrdiff_t, not size_t, where either works.
12682 (init_display): Check for overflow more accurately, and without
12683 relying on undefined behavior.
12684
a81d11a3
PE
12685 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
12686 Remove, replacing with the new symbols in lisp.h. All uses changed.
12687 * fileio.c (make_temp_name):
12688 * filelock.c (lock_file_1, lock_file):
12689 * xdisp.c (message_dolog):
12690 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
12691 Use pMd etc. instead.
12692 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
12693 replacing the pWIDE etc. symbols removed from editfns.c.
12694
3300e6fd
PE
12695 * keyboard.h (num_input_events): Now uintmax_t.
12696 This is (very slightly) less likely to mess up due to wraparound.
12697 All uses changed.
12698
fd05c7e9
PE
12699 * buffer.c: Integer signedness fixes.
12700 (alloc_buffer_text, enlarge_buffer_text):
12701 Use ptrdiff_t rather than size_t when either will do, as we prefer
12702 signed integers.
12703
903fe15d
PE
12704 * alloc.c: Integer signedness and overflow fixes.
12705 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
12706 (__malloc_size_t): Default to size_t, not to int.
12707 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12708 (Fgarbage_collect, mark_object_loop_halt, mark_object):
12709 Prefer ptrdiff_t to size_t when either would do, as we prefer
12710 signed integers.
12711 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12712 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12713 Now const. Initialize with values that are in range even if char
12714 is signed.
12715 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12716 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
12717 These functions do the right thing with sizes > 2**32.
12718 (check_depth): Now ptrdiff_t, not int.
12719 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12720 Adjust to new way of storing sizes. Check for size overflow bugs
12721 in rest of code.
12722 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
12723 slightly wrong anyway, as it missed one instance of
12724 XMALLOC_OVERRUN_CHECK_OVERHEAD.
12725 (refill_memory_reserve): Omit needless cast to size_t.
12726 (mark_object_loop_halt): Mark as externally visible.
12727
ac82cc6a
PE
12728 * xselect.c: Integer signedness and overflow fixes.
12729 (Fx_register_dnd_atom, x_handle_dnd_message):
12730 Use ptrdiff_t, not size_t, since we prefer signed.
12731 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12732 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12733 x_dnd_atoms_size and x_dnd_atoms_length.
12734
c2d1e36d
PE
12735 * doprnt.c: Prefer signed to unsigned when either works.
12736 * eval.c (verror):
12737 * doprnt.c (doprnt):
12738 * lisp.h (doprnt):
12739 * xdisp.c (vmessage):
12740 Use ptrdiff_t, not size_t, when using or implementing doprnt,
12741 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12742 prefer signed arithmetic to avoid comparison confusion.
12743 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12744 but is a bit tricky.
12745
0e926e56
PE
12746 Assume freestanding C89 headers, string.h, stdlib.h.
12747 * data.c, doprnt.c, floatfns.c, print.c:
12748 Include float.h unconditionally.
12749 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12750 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12751 * regex.c: Likewise for stddef.h, string.h.
12752 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12753 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12754 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12755 (STDC_HEADERS): Remove obsolete defines.
12756 * sysdep.c: Include limits.h unconditionally.
12757
9cfdb3ec
PE
12758 Assume support for memcmp, memcpy, memmove, memset.
12759 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12760 * regex.c (memcmp, memcpy):
12761 Remove; we assume C89 now.
12762
12763 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12764 (__malloc_safe_bcopy): Remove; no longer needed.
12765
cf950e6b 12766 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
12767 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12768 well either way, and we prefer signed to unsigned.
12769
dbf38e02
LMI
127702011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12771
12772 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12773 closes the connection while we're reading (bug#9182).
12774
d6f0886c 127752011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 12776
d6f0886c
JD
12777 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12778 are specified (Bug#9168).
24e0f6b1 12779
2eb1f9e6
PE
127802011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12781
12782 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12783 Found by GCC static checking and --with-wide-int on a 32-bit host.
12784
22381272 127852011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
12786
12787 * xdisp.c (compute_display_string_pos): Fix logic of caching
12788 previous display string position. Initialize cached_prev_pos to
12789 -1. Fixes slow-down at the beginning of a buffer.
12790
f25e39b4
EZ
127912011-07-24 Eli Zaretskii <eliz@gnu.org>
12792
12793 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12794 for attrs[LFACE_FONTSET_INDEX].
12795
04c4b52e
PE
127962011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12797
12798 * xml.c (parse_region): Remove unused local
12799 that was recently introduced.
12800
c1734fbd
EZ
128012011-07-23 Eli Zaretskii <eliz@gnu.org>
12802
be18c5a5
EZ
12803 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12804 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12805
c1734fbd
EZ
12806 * xdisp.c (move_it_in_display_line_to): Record the best matching
12807 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
12808 exit if none of the characters scanned was an exact match.
12809 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
12810 when exact match is impossible due to invisible text, and the
12811 lines are truncated.
12812
a258d627
JD
128132011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12814
12815 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12816 for OSX >= 10.7.
12817
b6d5a689
EZ
128182011-07-22 Eli Zaretskii <eliz@gnu.org>
12819
0f74f785
EZ
12820 Fix a significant slow-down of cursor motion with C-n, C-p,
12821 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12822 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 12823 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
12824 (next_element_from_buffer): Call compute_stop_pos_backwards to
12825 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
12826 base_level_stop.
12827 (reseat): Don't look for prev_stop, as that could mean a very long
12828 run.
12829 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12830 <cached_disp_overlay_modiff>: Cache for last found display string
12831 position.
551918c1 12832 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
12833 about the same buffer in the same area of character positions, and
12834 the buffer wasn't changed since the time the display string
12835 position was cached.
551918c1 12836
b2d0c91a
EZ
128372011-07-22 Eli Zaretskii <eliz@gnu.org>
12838
12839 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12840 is an integer, which is important for empty lines. (Bug#9149)
12841
043604ee
CY
128422011-07-22 Chong Yidong <cyd@stupidchicken.com>
12843
12844 * frame.c (Fmodify_frame_parameters): In tty case, update the
12845 default face if necessary (Bug#4238).
12846
da4adb04
CY
128472011-07-21 Chong Yidong <cyd@stupidchicken.com>
12848
12849 * editfns.c (Fstring_to_char): No need to explain what a character
12850 is in the docstring (Bug#6576).
12851
9abd0532
LMI
128522011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12853
12854 * xml.c (parse_region): Make sure we always return a tree.
12855
36881d16
HK
128562011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12857
12858 * xml.c (parse_region): If a document contains only comments,
12859 return that, too.
12860
1e98674d
LMI
128612011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12862
12863 * xml.c (make_dom): Return comments, too.
12864
590bd467
PE
128652011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12866
12867 Port to OpenBSD.
12868 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12869 and the surrounding thread.
12870 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12871 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12872 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12873 timer goes off.
12874 * s/openbsd.h (BROKEN_SIGIO): Define.
12875 * unexelf.c (unexec) [__OpenBSD__]:
12876 Don't update the .mdebug section of the Alpha COFF symbol table.
12877
f41628b2
LMI
128782011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12879
12880 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12881 (bug#8460).
12882
b59b67c5
PE
128832011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12884
15e3a074
PE
12885 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12886 This fixes some race conditions on the permissions of any newly
12887 created file.
12888
41bed37d
PE
12889 * alloc.c (valid_pointer_p): Use pipe, not open.
12890 This fixes some permissions issues when debugging.
12891
b59b67c5
PE
12892 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12893 If fchown fails to set both uid and gid, try to set just gid,
12894 as that is sometimes allowed. Adjust the file's mode to eliminate
12895 setuid or setgid bits that are inappropriate if fchown fails.
12896
925a6be7
SM
128972011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12898
12899 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12900 to compare Lisp_Objects.
12901 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12902 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12903 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12904
52968808
AS
129052011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12906
0a6a104b
AS
12907 * lread.c (read_integer): Unread even EOF character.
12908 (read1): Likewise. Properly record start position of symbol.
12909
52968808
AS
12910 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12911 symbol character follows.
12912
9e381cdd
PE
129132011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12914
12915 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12916 This works around a problem with the previous change to Fcopy_file.
12917 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12918 and without this change, GCC might complain about discarding
12919 fchown's return value.
12920
b5641435
JB
129212011-07-16 Juanma Barranquero <lekktu@gmail.com>
12922
12923 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12924
a8031457
PE
129252011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12926
12927 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12928
dd889327
LMI
129292011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12930
750c33f7
LMI
12931 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12932 it's used from the C level.
12933
dd889327
LMI
12934 * process.c: Use the same condition for POLL_FOR_INPUT in both
12935 keyboard.c and process.c (bug#1858).
12936
87e86684
LM
129372011-07-09 Lawrence Mitchell <wence@gmx.li>
12938
12939 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12940 (Fgnutls_boot): Use it.
12941
64348f40
AS
129422011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12943
12944 * doc.c (Fsubstitute_command_keys): Revert last change.
12945
1d698799
LMI
129462011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12947
f863868c
LMI
12948 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12949 quotes the next character, and doesn't affect other longer
12950 sequences (bug#8935).
12951
1d698799
LMI
12952 * lread.c (syms_of_lread): Clarify that is isn't only
12953 `eval-buffer' and `eval-defun' that's affected by
12954 `lexical-binding' (bug#8460).
12955
aa4b6df6
EZ
129562011-07-15 Eli Zaretskii <eliz@gnu.org>
12957
12958 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 12959 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 12960
5d856da6
PE
129612011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12962
ad6042bb
PE
12963 Fix minor problems found by static checking.
12964 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12965 (elsz): Now a signed constant, not a size_t var. We prefer signed
12966 types to unsigned, to avoid integer comparison confusion. Without
12967 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12968 "cannot optimize loop, the loop counter may overflow", a symptom
12969 of the confusion.
f00bbb22 12970 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
12971 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12972
6468f31c
LMI
129732011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12974
49080b10
LMI
12975 * search.c (Fre_search_backward): Mention `case-fold-search' in
12976 all the re_search_* functions (bug#8138).
12977
6468f31c
LMI
12978 * keyboard.c (Fopen_dribble_file): Document when the file is
12979 closed (bug#8056).
12980
c965adc5
EZ
129812011-07-14 Eli Zaretskii <eliz@gnu.org>
12982
df9733bf
EZ
12983 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12984 bidi_cache_idx.
12985
0bb23927
EZ
12986 Support bidi reordering of display and overlay strings.
12987 * xdisp.c (compute_display_string_pos)
12988 (compute_display_string_end): Accept additional argument STRING.
12989 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12990 (reseat_to_string): Initialize bidi_it->string.s and
12991 bidi_it->string.schars.
12992 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
12993 NULL (avoids a crash in bidi_paragraph_init).
12994 Initialize itb.string.lstring.
0bb23927
EZ
12995 (init_iterator): Call bidi_init_it only of a valid
12996 buffer position was specified. Initialize paragraph_embedding to
12997 L2R.
12998 (reseat_to_string): Initialize the bidi iterator.
12999 (display_string): If we need to ignore text properties of
13000 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13001 original value of -1 will not work with bidi.)
13002 (compute_display_string_pos): First arg is now struct
13003 `text_pos *'; all callers changed. Support display properties on
13004 Lisp strings.
13005 (compute_display_string_end): Support display properties on Lisp
13006 strings.
13007 (init_iterator, reseat_1, reseat_to_string): Initialize the
13008 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13009 when iterating on a string not from display properties).
640c8776
SM
13010 (compute_display_string_pos, compute_display_string_end):
13011 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
13012 arrow keys.
13013 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
13014 base_level_stop; instead, set base_level_stop to BEGV.
13015 Fixes crashes in vertical-motion.
0bb23927
EZ
13016 (next_element_from_buffer): Improve commentary for when
13017 the iterator is before prev_stop.
13018 (init_iterator): Initialize bidi_p from the default value of
13019 bidi-display-reordering, not from buffer-local value. Use the
13020 buffer-local value only if initializing for buffer iteration.
13021 (handle_invisible_prop): Support invisible properties on strings
13022 that are being bidi-reordered.
13023 (set_iterator_to_next): Support bidi reordering of C strings and
13024 Lisp strings.
13025 (next_element_from_string): Support bidi reordering of Lisp
13026 strings.
13027 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
13028 (display_string): Support display of R2L glyph rows.
13029 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
13030 (init_iterator): Don't initialize it->bidi_p for strings
13031 here.
13032 (reseat_to_string): Initialize it->bidi_p for strings here.
13033 (next_element_from_string, next_element_from_c_string)
13034 (next_element_from_buffer): Add xassert's for correspondence
13035 between IT's object being iterated and it->bidi_it.string
13036 structure.
13037 (face_before_or_after_it_pos): Support bidi iteration.
13038 (next_element_from_c_string): Handle the case of the first string
13039 character that is not the first one in the visual order.
13040 (get_visually_first_element): New function, refactored from common
13041 parts of next_element_from_buffer, next_element_from_string, and
13042 next_element_from_c_string.
13043 (tool_bar_lines_needed, redisplay_tool_bar)
13044 (display_menu_bar): Force left-to-right direction. Add a FIXME
13045 comment for making that be controlled by a user option.
13046 (push_it, pop_it): Save and restore the state of the
13047 bidi iterator. Save and restore the bidi_p flag.
13048 (pop_it): Iterate out of display property for string iteration as
13049 well.
13050 (iterate_out_of_display_property): Support iteration over strings.
13051 (handle_single_display_spec): Set up it->bidi_it for iteration
13052 over a display string, and call bidi_init_it.
13053 (handle_single_display_spec, next_overlay_string)
13054 (get_overlay_strings_1, push_display_prop): Set up the bidi
13055 iterator for displaying display or overlay strings.
13056 (forward_to_next_line_start): Don't use the shortcut if
13057 bidi-iterating.
13058 (back_to_previous_visible_line_start): If handle_display_prop
13059 pushed the iterator stack, restore the internal state of the bidi
13060 iterator by calling bidi_pop_it same number of times.
13061 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13062 and we are bidi-iterating, don't decrement the iterator position;
13063 instead, set the first_elt flag in the bidi iterator, to produce
13064 the same effect.
13065 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13066 (push_display_prop): xassert that we are iterating a buffer.
13067 (push_it, pop_it): Save and restore paragraph_embedding member.
13068 (handle_single_display_spec, next_overlay_string)
13069 (get_overlay_strings_1, reseat_1, reseat_to_string)
13070 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13071 correctly. Don't assume unibyte strings are not bidi-reordered.
13072 (compute_display_string_pos)
13073 (compute_display_string_end): Fix handling the case of C string.
13074 (push_it, pop_it): Save and restore from_disp_prop_p.
13075 (handle_single_display_spec, push_display_prop): Set the
13076 from_disp_prop_p flag.
13077 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13078 (pop_it): Call iterate_out_of_display_property only if we are
13079 popping after iteration over a string that came from a display
13080 property. Fix a typo in popping stretch info. Add an assertion
13081 for verifying that the iterator position is in sync with the bidi
13082 iterator.
13083 (handle_single_display_spec, get_overlay_strings_1)
13084 (push_display_prop): Fix initialization of paragraph direction for
13085 string when that of the parent object is not yet determined.
13086 (reseat_1): Call bidi_init_it to resync the bidi
13087 iterator with IT's position. (Bug#7616)
13088 (find_row_edges): If ROW->start.pos gives position
13089 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13090 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13091 Reset the from_disp_prop_p flag.
13092 (SAVE_IT, RESTORE_IT): New macros.
13093 (pos_visible_p, face_before_or_after_it_pos)
13094 (back_to_previous_visible_line_start)
13095 (move_it_in_display_line_to, move_it_in_display_line)
13096 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13097 (try_scrolling, redisplay_window, display_line): Use them when
13098 saving a temporary copy of the iterator and restoring it back.
13099 (back_to_previous_visible_line_start, reseat_1)
13100 (init_iterator): Empty the bidi cache "stack".
13101 (move_it_in_display_line_to): If iterator ended up at
13102 EOL, but we never saw any buffer positions smaller than
13103 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13104 motion in bidi-reordered lines.
13105 (move_it_in_display_line_to): Record prev_method and prev_pos
13106 immediately before the call to set_iterator_to_next. Fixes cursor
13107 motion in bidi-reordered lines with stretch glyphs and strings
13108 displayed in margins. (Bug#8133) (Bug#8867)
13109 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13110 TO_CHARPOS.
640c8776
SM
13111 (pos_visible_p): Support positions in bidi-reordered lines.
13112 Save and restore bidi cache.
0bb23927
EZ
13113
13114 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13115 (bidi_paragraph_info): Delete unused struct.
13116 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13117 (bidi_cache_start): New variable.
13118 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13119 to zero.
13120 (bidi_cache_fetch_state, bidi_cache_search)
13121 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13122 (bidi_cache_find, bidi_peek_at_next_level)
13123 (bidi_level_of_next_char, bidi_find_other_level_edge)
13124 (bidi_move_to_visually_next): Compare cache index with
13125 bidi_cache_start rather than with zero.
13126 (bidi_fetch_char): Accept new argument STRING; all callers
13127 changed. Support iteration over a string. Support strings with
13128 display properties. Support unibyte strings. Fix the type of
13129 `len' according to what STRING_CHAR_AND_LENGTH expects.
13130 (bidi_paragraph_init, bidi_resolve_explicit_1)
13131 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
13132 (bidi_level_of_next_char, bidi_move_to_visually_next):
13133 Support iteration over a string.
0bb23927
EZ
13134 (bidi_set_sor_type, bidi_resolve_explicit_1)
13135 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13136 can now be zero (for strings); special values 0 and -1 were
13137 changed to -1 and -2, respectively.
13138 (bidi_char_at_pos): New function.
13139 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13140 Call it instead of FETCH_MULTIBYTE_CHAR.
13141 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13142 initialized to valid values.
13143 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13144 values.
13145 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13146 the test for valid cached positions. Fix the logic for looking up
13147 the sentinel state in the cache. GCPRO the Lisp string we are
13148 iterating.
13149 (bidi_push_it, bidi_pop_it): New functions.
13150 (bidi_initialize): Initialize the bidi cache start stack pointer.
13151 (bidi_cache_ensure_space): New function, refactored from part of
13152 bidi_cache_iterator_state. Don't assume the required size is just
13153 one BIDI_CACHE_CHUNK away.
13154 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13155 (bidi_count_bytes, bidi_char_at_pos): New functions.
13156 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13157 always valid if bidi_cache_idx is valid.
13158 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13159 is valid if it's going to be used.
13160 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13161 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
13162 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13163 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
13164 (bidi_find_other_level_edge, bidi_cache_start_stack):
13165 All variables related to cache indices are now EMACS_INT.
c965adc5 13166
0bb23927
EZ
13167 * dispextern.h (struct bidi_string_data): New structure.
13168 (struct bidi_it): New member `string'. Make flag members be 1-bit
13169 fields, and put them last in the struct.
640c8776
SM
13170 (compute_display_string_pos, compute_display_string_end):
13171 Update prototypes.
0bb23927
EZ
13172 (bidi_push_it, bidi_pop_it): Add prototypes.
13173 (struct iterator_stack_entry): New members bidi_p,
13174 paragraph_embedding, and from_disp_prop_p.
13175 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
13176 (bidi_shelve_cache, bidi_unshelve_cache):
13177 Declare prototypes.
0bb23927
EZ
13178
13179 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13180 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
13181 and vector-like objects.
13182
13183 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
13184 cache around display iteration.
13185
13186 * window.c (Fwindow_end, window_scroll_pixel_based)
13187 (displayed_window_lines, Frecenter): Save and restore the bidi
13188 cache around display iteration.
13189
3bbd2265
LMI
131902011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13191
13192 * editfns.c (Fdelete_region): Clarify the use of the named
13193 parameters (bug#6788).
13194
adc47434
MR
131952011-07-14 Martin Rudalics <rudalics@gmx.at>
13196
13197 * indent.c (Fvertical_motion): Set and restore w->pointm when
13198 saving and restoring the window's buffer (Bug#9006).
13199
837c31f8
LMI
132002011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13201
13202 * editfns.c (Fstring_to_char): Clarify just what is returned
13203 (bug#6576). Text by Eli Zaretskii.
13204
ac389d0c
JB
132052011-07-13 Juanma Barranquero <lekktu@gmail.com>
13206
13207 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
13208
0be0ce47
EZ
132092011-07-13 Eli Zaretskii <eliz@gnu.org>
13210
13211 * buffer.c (mmap_find): Fix a typo.
13212
cd18e7e3
JB
132132011-07-13 Johan Bockgård <bojohan@gnu.org>
13214
13215 Fix execution of x selection hooks.
13216 * xselect.c (Qx_lost_selection_functions)
13217 (Qx_sent_selection_functions): New vars.
13218 (syms_of_xselect): DEFSYM them.
13219 (x_handle_selection_request): Pass Qx_sent_selection_functions
13220 rather than Vx_sent_selection_functions to Frun_hook_with_args.
13221 (x_handle_selection_clear,x_clear_frame_selections):
13222 Pass Qx_lost_selection_functions rather than
13223 Vx_lost_selection_functions to Frun_hook_with_args.
13224
47ea7f44
PE
132252011-07-13 Paul Eggert <eggert@cs.ucla.edu>
13226
ac389d0c 13227 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
13228 The old code sometimes used this field without initializing it.
13229
47ea7f44
PE
13230 * alloc.c (gc_sweep): Don't read past end of array.
13231 In theory, the old code could also have corrupted Emacs internals,
13232 though it'd be very unlikely.
13233
bc985c87
AS
132342011-07-12 Andreas Schwab <schwab@linux-m68k.org>
13235
13236 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 13237 argument. (Bug#4026)
bc985c87 13238
0cf34688
LMI
132392011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
13240
b3dadd76
LMI
13241 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
13242 key" (bug#4257).
13243
0cf34688
LMI
13244 * window.c (Fset_window_start): Doc fix (bug#4199).
13245 (Fset_window_hscroll): Ditto.
13246
270768cd
PE
132472011-07-12 Paul Eggert <eggert@cs.ucla.edu>
13248
077e3dda 13249 Fix minor new problems caught by GCC 4.6.1.
270768cd 13250 * term.c (init_tty): Remove unused local.
490011a6 13251 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 13252 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 13253 not used otherwise.
270768cd 13254
b1f58454
CY
132552011-07-12 Chong Yidong <cyd@stupidchicken.com>
13256
13257 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
13258
22b9578d
LMI
132592011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13260
6e70ab07
LMI
13261 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
13262 are the mini-buffer and the echo area (bug#3320).
13263
22b9578d
LMI
13264 * term.c (init_tty): Remove support for supdup, c10 and perq
13265 terminals, which are no longer supported (bug#1482).
13266
8974cc9f
JB
132672011-07-10 Johan Bockgård <bojohan@gnu.org>
13268
13269 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
13270
a560d974
JD
132712011-07-10 Jan Djärv <jan.h.d@swipnet.se>
13272
13273 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
13274 for non-popups (Bug#3642).
13275
1dae0f0a
AS
132762011-07-10 Andreas Schwab <schwab@linux-m68k.org>
13277
268c2c36 13278 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 13279 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
13280 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
13281 * cm.c (losecursor): Likewise.
1dae0f0a
AS
13282 * data.c (fmod): Likewise.
13283 * dispnew.c (swap_glyphs_in_rows): Likewise.
13284 * emacs.c (memory_warning_signal): Likewise.
13285 * floatfns.c (float_error): Likewise.
13286 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
13287 (otf_open, font_otf_capability, generate_otf_features)
13288 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
13289 Likewise.
13290 * image.c (pbm_read_file): Likewise.
13291 * indent.c (string_display_width): Likewise.
13292 * intervals.c (check_for_interval, search_for_interval)
13293 (inc_interval_count, count_intervals, root_interval)
13294 (adjust_intervals_for_insertion, make_new_interval): Likewise.
13295 * lread.c (defalias): Likewise.
268c2c36 13296 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
13297 * regex.c (set_image_of_range_1, set_image_of_range)
13298 (regex_grow_registers): Likewise.
13299 * sysdep.c (strerror): Likewise.
13300 * termcap.c (valid_filename_p, tprint, main): Likewise.
13301 * tparam.c (main): Likewise.
13302 * unexhp9k800.c (run_time_remap, save_data_space)
13303 (update_file_ptrs, read_header, write_header, calculate_checksum)
13304 (copy_file, copy_rest, display_header): Likewise.
13305 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
13306 Likewise.
13307 * xdisp.c (check_it): Likewise.
13308 * xfaces.c (register_color, unregister_color, unregister_colors):
13309 Likewise.
13310 * xfns.c (print_fontset_result): Likewise.
13311 * xrdb.c (member, fatal, main): Likewise.
13312
99033785
PE
133132011-07-10 Paul Eggert <eggert@cs.ucla.edu>
13314
13315 Fix minor problems found by static checking (Bug#9031).
13316 * chartab.c (char_table_set_range, map_sub_char_table):
13317 Remove unused locals.
13318 (uniprop_table): Now static.
13319 * composite.c (_work_char): Remove unused static var.
13320
9cb2ac56
JB
133212011-07-09 Juanma Barranquero <lekktu@gmail.com>
13322
13323 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
13324
f25661f0
JD
133252011-07-09 Jan Djärv <jan.h.d@swipnet.se>
13326
13327 * gtkutil.c (qttip_cb): Remove code without function.
13328
8278c4fe
EZ
133292011-07-09 Eli Zaretskii <eliz@gnu.org>
13330
13331 * w32.c (pthread_sigmask): New stub.
13332
1692ae2d 133332011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 13334
8a6ebd58 13335 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
13336 sigprocmask is portable only for single-threaded applications, and
13337 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
13338 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
13339 (LIBES): Use it.
13340 * callproc.c (Fcall_process):
13341 * process.c (create_process):
13342 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
13343 Use pthread_sigmask, not sigprocmask.
123403e4 13344
1b854618
JD
133452011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13346
13347 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
13348 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
13349 wrong (Bug#8591).
13350
3fe4b549
JD
133512011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13352
0ce7e563
JD
13353 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
13354 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
13355 (xg_hide_tooltip): Fix comment.
13356
3fe4b549
JD
13357 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
13358 in registerServicesMenuSendTypes.
13359 (validRequestorForSendType): Don't check ns_return_types.
13360
13361 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
13362 ns_return_type.
13363
5df75e47
JR
133642011-07-08 Jason Rumney <jasonr@gnu.org>
13365
22610910
JR
13366 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
13367 SH_SHOW for hidden windows (Bug#5482).
13368
5df75e47
JR
13369 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
13370 frame struct members of non-existent frames (Bug#6284).
13371
699c10bd
JD
133722011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13373
4393663b
JD
13374 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
13375 variable firstTime not needed on OSX >= 10.6.
13376 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
13377 >= 10.5. Use setKnobProportion, setDoubleValue.
13378
13379 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13380 (MAC_OS_X_VERSION_10_5): Define if not defined.
13381 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13382 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13383 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13384
13385 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 13386 cString and lossyCString on OSX >= 10.4.
4393663b 13387
58179cce 13388 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
13389 sizeToFit on OSX >= 10.2.
13390
13391 * nsimage.m (allocInitFromFile): Don't use deprecated method
13392 bestRepresentationForDevice on OSX >= 10.6.
13393
13394 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
13395 to avoid warning.
13396
13397 * emacs.c: Declare unexec_init_emacs_zone.
13398
a63e0781
JD
13399 * nsgui.h: Fix compiler warning about gnulib redefining verify.
13400
699c10bd
JD
13401 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
13402
13403 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13404 on svcsMenu (Bug#8842).
13405
13406 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13407 ns_return_types.
13408 (Fns_list_services): Just return Qnil on 10.6, code not working there.
13409
13410 * nsterm.m (QUTF8_STRING): Declare.
13411 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13412 (validRequestorForSendType): Return type is (id).
13413 Change indexOfObjectIdenticalTo to indexOfObject.
13414 Check if we have local selection before returning self (Bug#8842).
13415 (writeSelectionToPasteboard): Put local selection into paste board
13416 if we have a local selection (Bug#8842).
13417 (syms_of_nsterm): DEFSYM QUTF8_STRING.
13418
13419 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13420 (ns_get_local_selection): Declare.
13421
54e10184
LMI
134222011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
13423
9888ff71
LMI
13424 * keymap.c (describe_map_tree): Don't insert a double newline at
13425 the end of the buffer (bug#1169) and return whether we inserted
13426 something.
13427
54e10184
LMI
13428 * callint.c (Fcall_interactively): Change "reading args" to
13429 "providing args" to try to clarify what it does (bug#1010).
13430
15fa4783
KH
134312011-07-07 Kenichi Handa <handa@m17n.org>
13432
13433 * composite.c (composition_compute_stop_pos): Ignore a static
13434 composition starting before CHARPOS (Bug#8915).
13435
13436 * xdisp.c (handle_composition_prop): Likewise.
13437
a8815b00
EZ
134382011-07-07 Eli Zaretskii <eliz@gnu.org>
13439
13440 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13441 (Bug#9015)
13442
ef7b981d 134432011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
13444
13445 * character.h (unicode_category_t): New enum type.
13446
13447 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13448 (Qchar_code_property_table): New variable.
13449 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13450 (UNIPROP_COMPRESSED_FORM_P): New macros.
13451 (char_table_ascii): Uncompress the compressed values.
13452 (sub_char_table_ref): New arg is_uniprop. Callers changed.
13453 Uncompress the compressed values.
ac389d0c 13454 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
13455 (char_table_ref_and_range): Uncompress the compressed values.
13456 (sub_char_table_set): New arg is_uniprop. Callers changed.
13457 Uncompress the compressed values.
13458 (sub_char_table_set_range): Args changed. Callers changed.
13459 (char_table_set_range): Adjuted for the above change.
13460 (map_sub_char_table): Delete args default_val and parent. Add arg
13461 top. Give decoded values to a Lisp function.
640c8776 13462 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
13463 values to a Lisp function. Gcpro more variables.
13464 (uniprop_table_uncompress)
13465 (uniprop_decode_value_run_length): New functions.
13466 (uniprop_decoder, uniprop_decoder_count): New variables.
13467 (uniprop_get_decoder, uniprop_encode_value_character)
13468 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13469 New functions.
13470 (uniprop_encoder, uniprop_encoder_count): New variables.
13471 (uniprop_get_encoder, uniprop_table)
13472 (Funicode_property_table_internal, Fget_unicode_property_internal)
13473 (Fput_unicode_property_internal): New functions.
13474 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13475 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 13476 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
13477 char-code-property-alist.
13478
640c8776 13479 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
13480 Vunicode_category_table.
13481
640c8776 13482 * font.c (font_range): Adjust for the change of
c805dec0
KH
13483 Vunicode_category_table.
13484
76b397fb
DN
134852011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13486
13487 * m/iris4d.h: Remove file, move contents ...
13488 * s/irix6-5.h: ... here.
13489
22b4128e
PE
134902011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13491
13492 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
13493 * alloc.c (mark_buffer):
13494 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13495 (clone_per_buffer_values): Don't assume that
22b4128e
PE
13496 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13497 This isn't true in general, and it's particularly not true
13498 if Emacs is configured with --with-wide-int.
13499 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13500 New macros, used in the buffer.c change.
13501
869795d6
JD
135022011-07-05 Jan Djärv <jan.h.d@swipnet.se>
13503
13504 * xsettings.c: Use both GConf and GSettings if both are available.
13505 (store_config_changed_event): Add comment.
13506 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13507 (store_tool_bar_style_changed): New functions.
5e617bc2 13508 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
13509 (struct xsettings): Move font inside HAVE_XFT.
13510 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 13511 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 13512 Move inside HAVE_XFT.
640c8776 13513 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
13514 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13515 also.
13516 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 13517 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 13518 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
13519 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13520 (parse_settings): Move check for font inside HAVE_XFT.
13521 (read_settings, apply_xft_settings): Add comment.
13522 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
13523 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
13524 call store_font_name_changed.
13525 (xft_settings_event): Add comment.
13526 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
13527 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
13528 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
13529 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
13530 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
13531 (xsettings_get_system_font, xsettings_get_system_normal_font):
13532 Add comment.
869795d6 13533
d8ed26bd
PE
135342011-07-05 Paul Eggert <eggert@cs.ucla.edu>
13535
13536 Random fixes. E.g., (random) never returned negative values.
13537 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
13538 subseconds part to the entropy, as that's a bit more random.
13539 Prefer signed to unsigned, since the signedness doesn't matter and
13540 in general we prefer signed. When given a limit, use a
13541 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
13542 latter isn't right if USE_2_TAGS_FOR_INTS.
13543 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
13544 not 0..VALMASK. Don't discard "excess" bits that random () returns.
13545
cabf1cac
SM
135462011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
13547
13548 * textprop.c (text_property_stickiness):
13549 Obey Vtext_property_default_nonsticky.
13550 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
13551 * w32fns.c (syms_of_w32fns):
13552 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
13553
6e9b2be9
PE
135542011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13555
13556 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
13557 This is more efficient than Ffile_directory_p and avoids a minor race.
13558
90186c68
LMI
135592011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
13560
7c301272
LMI
13561 * buffer.c (Foverlay_put): Say what the return value is
13562 (bug#7835).
13563
c4f2d8d4
LMI
13564 * fileio.c (barf_or_query_if_file_exists): Check first if the file
13565 is a directory before asking whether to use the file name
13566 (bug#7564).
ad637907
LMI
13567 (barf_or_query_if_file_exists): Make the "File is a directory"
13568 error be more correct.
c4f2d8d4 13569
90186c68
LMI
13570 * fns.c (Frequire): Remove the mention of the .gz files, since
13571 that's installation-specific, but keep the mention of
13572 `get-load-suffixes'.
13573
da64016e
PE
135742011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13575
13576 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
13577 Report string overflow if the output is too long.
13578
7d47b580
JB
135792011-07-04 Juanma Barranquero <lekktu@gmail.com>
13580
a555cb87
JB
13581 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
13582 (syms_of_gnutls): Remove duplicate DEFSYM for
13583 Qgnutls_bootprop_verify_hostname_error, an error for
13584 Qgnutls_bootprop_verify_error (which is no longer used).
13585
7d47b580
JB
13586 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13587 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
13588 Also (re)move comments that are misplaced or no longer relevant.
13589
1e49bfab
LMI
135902011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13591
13592 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13593
1485f4c0
CY
135942011-07-03 Chong Yidong <cyd@stupidchicken.com>
13595
13596 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13597 and background color parameters if they have been changed.
13598
a9ab721e
LMI
135992011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13600
13601 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13602
cf7cff57
PE
136032011-07-03 Paul Eggert <eggert@cs.ucla.edu>
13604
2e13213d
PE
13605 * xsettings.c (SYSTEM_FONT): Define only when used.
13606 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13607
cf7cff57
PE
13608 * keymap.c (access_keymap_1): Now static.
13609
7a8e04f7
CY
136102011-07-02 Chong Yidong <cyd@stupidchicken.com>
13611
13612 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13613 leave any prefix arg for the up event (Bug#1586).
13614
61352f62
LMI
136152011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
13616
69bb1ef7
LMI
13617 * lread.c (syms_of_lread): Mention single symbols defined by
13618 `defvar' or `defconst' (bug#7154).
13619
61352f62 13620 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 13621 (Frequire): Mention get-load-suffixes.
61352f62 13622
28545e04
MR
136232011-07-02 Martin Rudalics <rudalics@gmx.at>
13624
13625 * window.h (window): Remove clone_number slot.
13626 * window.c (Fwindow_clone_number, Fset_window_clone_number):
13627 Remove.
13628 (make_parent_window, make_window, saved_window)
13629 (Fset_window_configuration, save_window_save): Don't deal with
13630 clone numbers.
13631 * buffer.c (Qclone_number): Remove declaration.
13632 (sort_overlays, overlay_strings): Don't deal with clone numbers.
13633
3349e122
SM
136342011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
13635
13636 Add multiple inheritance to keymaps.
13637 * keymap.c (Fmake_composed_keymap): New function.
13638 (Fset_keymap_parent): Simplify.
13639 (fix_submap_inheritance): Remove.
13640 (access_keymap_1): New function extracted from access_keymap to handle
13641 embedded parents and handle lists of maps.
13642 (access_keymap): Use it.
13643 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13644 (Fcopy_keymap): Handle embedded parents.
13645 (Fcommand_remapping, define_as_prefix): Simplify.
13646 (Fkey_binding): Simplify.
13647 (syms_of_keymap): Move minibuffer-local-completion-map,
13648 minibuffer-local-filename-completion-map,
13649 minibuffer-local-must-match-map, and
13650 minibuffer-local-filename-must-match-map to Elisp.
13651 (syms_of_keymap): Defsubr make-composed-keymap.
13652 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13653 (parse_menu_item): Trivial simplification.
13654
3279eb87
GM
136552011-07-01 Glenn Morris <rgm@gnu.org>
13656
13657 * Makefile.in (SETTINGS_LIBS): Fix typo.
13658
39cb9e56 136592011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
13660
13661 * coding.c (Fencode_coding_string): Record the last coding system
13662 used, as the function doc string says (bug#8738).
13663
0949d2b6
JD
136642011-07-01 Jan Djärv <jan.h.d@swipnet.se>
13665
13666 * xsettings.c (store_monospaced_changed): Take new font as arg and
13667 check for change against current_mono_font.
13668 (EMACS_TYPE_SETTINGS): Remove this and related defines.
13669 (emacs_settings_constructor, emacs_settings_get_property)
13670 (emacs_settings_set_property, emacs_settings_class_init)
13671 (emacs_settings_init, gsettings_obj): Remove.
13672 (something_changedCB): New function for HAVE_GSETTINGS.
13673 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13674 with value as argument.
13675 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
13676 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 13677 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
13678 "changed".
13679
13680 * xgselect.c: Add defined (HAVE_GSETTINGS).
13681 (xgselect_initialize): Ditto.
13682
13683 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
13684 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
13685 xg_select.
13686
bbc6b304
PE
136872011-07-01 Paul Eggert <eggert@cs.ucla.edu>
13688
13689 * eval.c (struct backtrace): Simplify and port the data structure.
13690 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
13691 signed bit field, as this assumption is not portable and it makes
13692 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
13693 "char debug_on_exit : 1" as this is not portable either; instead,
13694 use the portable "unsigned int debug_on_exit : 1". Remove unused
13695 member evalargs. Remove obsolete comments about cc bombing out.
13696
9851bfc5
JD
136972011-06-30 Jan Djärv <jan.h.d@swipnet.se>
13698
51bb811f 13699 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
13700 Let HAVE_GSETTINGS override HAVE_GCONF.
13701 (store_monospaced_changed): New function.
13702 (EMACS_SETTINGS): A new type derived from GObject to handle
13703 GSettings notifications.
13704 (emacs_settings_constructor, emacs_settings_get_property)
13705 (emacs_settings_set_property, emacs_settings_class_init):
13706 New functions.
13707 (gsettings_client, gsettings_obj): New variables.
13708 (GSETTINGS_SCHEMA): New define.
13709 (something_changedCB): Call store_monospaced_changed.
13710 (init_gsettings): New function.
13711 (xsettings_initialize): Call init_gsettings.
13712 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13713 to NULL.
13714
640c8776 13715 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
13716 GCONF_CFLAGS/LIBS.
13717
5386012d
MR
137182011-06-29 Martin Rudalics <rudalics@gmx.at>
13719
13720 * window.c (resize_root_window, grow_mini_window)
13721 (shrink_mini_window): Rename Qresize_root_window to
13722 Qwindow_resize_root_window and Qresize_root_window_vertically to
13723 Qwindow_resize_root_window_vertically.
13724
f13e0b08
PE
137252011-06-28 Paul Eggert <eggert@cs.ucla.edu>
13726
13727 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13728
94515237
JB
137292011-06-27 Juanma Barranquero <lekktu@gmail.com>
13730
13731 * makefile.w32-in: Redesign dependencies so they reflect more
13732 clearly which files are directly included by each source file,
13733 and not through other includes.
13734
e43b6e43
MR
137352011-06-27 Martin Rudalics <rudalics@gmx.at>
13736
13737 * buffer.c (Qclone_number): Declare static and DEFSYM it.
13738 (sort_overlays, overlay_strings): When an overlay's clone number
13739 matches the window's clone number process the overlay even if
13740 the overlay's window property doesn't match the current window.
13741
d68443dc
MR
13742 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13743 (Fwindow_hchild): Rename to Fwindow_left_child.
13744 (Fwindow_next): Rename to Fwindow_next_sibling.
13745 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
13746 (resize_window_check): Rename to window_resize_check.
13747 (resize_window_apply): Rename to window_resize_apply.
13748 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13749 (Fdelete_other_windows_internal, resize_frame_windows)
13750 (Fsplit_window_internal, Fdelete_window_internal)
13751 (grow_mini_window, shrink_mini_window)
13752 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 13753
c7e73be5
JD
137542011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13755
13756 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13757 (emacs_fixed_set_min_size): Remove.
13758 (emacs_fixed_new): Take frame as argument.
13759
13760 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13761 (_EmacsFixedPrivate): Remove minwidth/height.
13762 Add struct frame *f.
13763 (emacs_fixed_init): Initialize priv->f.
13764 (get_parent_class, emacs_fixed_set_min_size): Remove.
13765 (emacs_fixed_new): Set priv->f to argument.
13766 (emacs_fixed_get_preferred_width)
13767 (emacs_fixed_get_preferred_height): Use min_width/height from
13768 frames size_hint to set minimum and natural (Bug#8919).
13769 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13770 and use min_width/height from frames size_hint to set
13771 min_width/height (Bug#8919).
13772
13773 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
13774 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13775 Fix indentation.
c7e73be5 13776
cf99dcf8
EZ
137772011-06-26 Eli Zaretskii <eliz@gnu.org>
13778
13779 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13780 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13781 called at ZV.
13782
029529ac
CY
137832011-06-26 Chong Yidong <cyd@stupidchicken.com>
13784
13785 * process.c (wait_reading_process_output): Bypass select if
13786 waiting for a cell while ignoring keyboard input, and input is
13787 pending. Suggested by Jan Djärv (Bug#8869).
13788
7a7ef429
PE
137892011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13790
13791 Use gnulib's dup2 module instead of rolling our own.
13792 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13793
11fdef7d 137942011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
13795
13796 * dispnew.c (scrolling_window): Before scrolling, turn off a
13797 mouse-highlight in the window being scrolled.
13798
cd3520a4
JB
137992011-06-24 Juanma Barranquero <lekktu@gmail.com>
13800
13801 Move DEFSYM to lisp.h and use everywhere.
13802
13803 * character.h (DEFSYM): Move declaration...
13804 * lisp.h (DEFSYM): ...here.
13805
13806 * gnutls.c:
13807 * minibuf.c:
13808 * w32menu.c:
13809 * w32proc.c:
13810 * w32select.c: Don't include character.h.
13811
13812 * alloc.c (syms_of_alloc):
13813 * buffer.c (syms_of_buffer):
13814 * bytecode.c (syms_of_bytecode):
13815 * callint.c (syms_of_callint):
13816 * casefiddle.c (syms_of_casefiddle):
13817 * casetab.c (init_casetab_once):
13818 * category.c (init_category_once, syms_of_category):
13819 * ccl.c (syms_of_ccl):
13820 * cmds.c (syms_of_cmds):
13821 * composite.c (syms_of_composite):
13822 * dbusbind.c (syms_of_dbusbind):
13823 * dired.c (syms_of_dired):
13824 * dispnew.c (syms_of_display):
13825 * doc.c (syms_of_doc):
13826 * editfns.c (syms_of_editfns):
13827 * emacs.c (syms_of_emacs):
13828 * eval.c (syms_of_eval):
13829 * fileio.c (syms_of_fileio):
13830 * fns.c (syms_of_fns):
13831 * frame.c (syms_of_frame):
13832 * fringe.c (syms_of_fringe):
13833 * insdel.c (syms_of_insdel):
13834 * keymap.c (syms_of_keymap):
13835 * lread.c (init_obarray, syms_of_lread):
13836 * macros.c (syms_of_macros):
13837 * msdos.c (syms_of_msdos):
13838 * print.c (syms_of_print):
13839 * process.c (syms_of_process):
13840 * search.c (syms_of_search):
13841 * sound.c (syms_of_sound):
13842 * syntax.c (init_syntax_once, syms_of_syntax):
13843 * terminal.c (syms_of_terminal):
13844 * textprop.c (syms_of_textprop):
13845 * undo.c (syms_of_undo):
13846 * w32.c (globals_of_w32):
13847 * window.c (syms_of_window):
13848 * xdisp.c (syms_of_xdisp):
13849 * xfaces.c (syms_of_xfaces):
13850 * xfns.c (syms_of_xfns):
13851 * xmenu.c (syms_of_xmenu):
13852 * xsettings.c (syms_of_xsettings):
13853 * xterm.c (syms_of_xterm): Use DEFSYM.
13854
4228cf16
TZ
138552011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13856
cd3520a4 13857 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 13858
7fcccf1e
PE
138592011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13860
7efb4e0e
PE
13861 Integer and buffer overflow fixes (Bug#8873).
13862
ff5844ad
PE
13863 * print.c (printchar, strout): Check for string overflow.
13864 (PRINTPREPARE, printchar, strout):
13865 Don't set size unless allocation succeeds.
13866
90532f02
PE
13867 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13868 for sizes. Check for string overflow more accurately.
13869 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13870
6d84508d
PE
13871 * macros.c: Integer and buffer overflow fixes.
13872 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13873 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13874 Use ptrdiff_t, not int, for sizes.
13875 Don't increment bufsize until after realloc succeeds.
13876 Check for size-calculation overflow.
13877 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13878
437b2cb4
PE
13879 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13880
8b9ac8b4
PE
13881 * lread.c: Integer overflow fixes.
13882 (read_integer): Radix is now EMACS_INT, not int,
13883 to improve quality of diagnostics for out-of-range radices.
13884 Calculate buffer size correctly for out-of-range radices.
13885 (read1): Check for integer overflow in radices, and in
13886 read-circle numbers.
82cb60d3
PE
13887 (read_escape): Avoid int overflow.
13888 (Fload, openp, read_buffer_size, read1)
13889 (substitute_object_recurse, read_vector, read_list, map_obarray):
13890 Use ptrdiff_t, not int, for sizes.
13891 (read1): Use EMACS_INT, not int, for sizes.
20270765 13892 Check for size overflow.
8b9ac8b4 13893
7fcccf1e
PE
13894 * image.c (cache_image): Check for size arithmetic overflow.
13895
bfbbd7e7
PE
13896 * lread.c: Integer overflow issues.
13897 (saved_doc_string_size, saved_doc_string_length)
13898 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13899 Now ptrdiff_t, not int.
13900 (read1): Don't assume doc string length fits in int. Check for
13901 out-of-range doc string lengths.
13902 (read_list): Don't assume file position fits in int.
39019e54 13903 (read_escape): Check for hex character overflow.
bfbbd7e7 13904
4e323265
LL
139052011-06-22 Leo Liu <sdl.web@gmail.com>
13906
13907 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13908 Move to minibuffer.el.
13909
85fece3e
PE
139102011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13911
20b84ce9 13912 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
13913 The following patches are for when GLYPH_DEBUG && !XASSERT.
13914 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13915 * dispnew.c (flush_stdout):
13916 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13917 Mark as externally visible.
13918 * dispnew.c (check_window_matrix_pointers): Now static.
13919 * dispnew.c (window_to_frame_vpos):
13920 * xfns.c (unwind_create_frame):
13921 * xterm.c (x_check_font): Remove unused local.
13922 * scroll.c (CHECK_BOUNDS):
13923 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13924 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13925 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13926 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13927 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13928 Now static.
13929 (debug_method_add): Use va_list and vsprintf rather than relying
13930 on undefined behavior with wrong number of arguments.
13931 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13932 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13933 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13934 since we're not interested in debugging glyphs with old libraries.
13935 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13936 GCC 4.6.0's static checking.
13937
0766b489
PE
139382011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13939
31fd4b32
PE
13940 Integer overflow and signedness fixes (Bug#8873).
13941 A few related buffer overrun fixes, too.
13942
b79e8648
PE
13943 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13944
0766b489
PE
13945 * dispextern.h (struct face.stipple):
13946 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13947 (x_bitmap_mask, x_allocate_bitmap_record)
13948 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13949 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13950 (x_create_bitmap_from_xpm_data):
13951 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13952 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13953 (.bitmaps_last):
13954 * xfaces.c (load_pixmap):
13955 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13956 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13957 (.bitmaps_last, struct x_output.icon_bitmap):
13958 Use ptrdiff_t, not int, for bitmap indexes.
13959 (x_allocate_bitmap_record): Check for size overflow.
13960 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13961
b081724f
PE
13962 Use ptrdiff_t, not int, for overlay counts.
13963 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13964 * editfns.c (overlays_around, get_pos_property):
13965 * textprop.c (get_char_property_and_overlay):
13966 * xdisp.c (next_overlay_change, note_mouse_highlight):
13967 * xfaces.c (face_at_buffer_position):
21514da7
PE
13968 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13969 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13970 (Fnext_overlay_change, Fprevious_overlay_change)
13971 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 13972 Use ptrdiff_t, not int, for sizes.
21514da7 13973 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 13974
3de73e5e
PE
13975 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13976
2606c57b
PE
13977 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13978 (x_session_initialize): Do not assume string length fits in int.
13979
aaafe47a
PE
13980 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13981 This is unlikely, but can occur if DPI is outlandish.
13982
2674ddc8 13983 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
13984 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13985
28154962
PE
13986 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13987 * xrdb.c (magic_file_p, search_magic_path):
13988 Omit last arg SUFFIX; it was always 0. All callers changed.
13989 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13990
7de51af5
PE
13991 * xfont.c (xfont_match): Avoid need for strlen.
13992
25ed6cc3
PE
13993 * xfns.c: Don't assume strlen fits in int.
13994 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13995
4eab31dd
PE
13996 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13997 not unsigned long, as we prefer signed integers. All callers changed.
13998 Detect integer overflow in repeat count.
13999 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 14000 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 14001
171e2a58
PE
14002 * termcap.c: Don't assume sizes fit in int and never overflow.
14003 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14004 (gobble_line): Check for size-calculation overflow.
14005
ad39faca 14006 * minibuf.c (Fread_buffer):
6e5bb2dc 14007 * lread.c (intern, intern_c_string):
74ca2eb3
PE
14008 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14009 Don't assume string length fits in int.
14010
52c61c22 14011 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
14012 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14013
b5b8c9e5
PE
14014 * font.c: Don't assume string length fits in int.
14015 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14016 Use ptrdiff_t, not int.
ccd6111c
PE
14017 (font_intern_prop): Don't assume string length fits in int.
14018 Don't assume integer property fits in fixnum.
14019 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 14020
882f0d81 14021 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 14022 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
14023 Reformulate so as not to need the command string.
14024 Invoke gzip -cd rather than gunzip, as it's more portable.
14025 (lock_info_type, lock_file_1, lock_file):
14026 Don't assume pid_t and time_t fit in unsigned long.
14027 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14028 (current_lock_owner): Prefer signed type for sizes.
14029 Use memcpy, not strncpy, where memcpy is what is really wanted.
14030 Don't assume (via atoi) that time_t and pid_t fit in int.
14031 Check for time_t and/or pid_t out of range, e.g., via a network share.
14032 Don't alloca where an auto var works fine.
14033
93f4cf88
PE
14034 * fileio.c: Fix some integer overflow issues.
14035 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14036 Don't assume string length fits in int.
14037 (directory_file_name): Don't assume string length fits in long.
14038 (make_temp_name): Don't assume pid fits in int, or that its print
14039 length is less than 20.
14040
f3e92b69
PE
14041 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14042
1bfdaf10
PE
14043 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14044
35016e9a
PE
14045 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14046
3d1e65a1
PE
14047 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14048 We prefer signed integers, even for size calculations.
14049
0b963a93
PE
14050 * emacs.c: Don't assume string length fits in 'int'.
14051 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14052 (main): Don't invoke strlen when not needed.
14053
573f4b54
PE
14054 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14055 (XD_DEBUG_MESSAGE): Don't waste a byte.
14056
989f33ba
PE
14057 * callproc.c (getenv_internal_1, getenv_internal)
14058 (Fgetenv_internal):
965d34eb
PE
14059 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14060
e4d29b33
PE
14061 * lread.c (invalid_syntax): Omit length argument.
14062 All uses changed. This doesn't fix a bug, but it simplifies the
14063 code away from its former Hollerith-constant appearance, and it's
14064 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 14065 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 14066
eb49b136
PE
14067 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14068 This didn't break anything, but it didn't help either.
14069 It's confusing to put a bogus integer in a place where the actual
14070 value does not matter.
9f62aeb1 14071 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 14072 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 14073
15375a22
PE
14074 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14075 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14076 implementation.
b61cc01c
PE
14077 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14078 We prefer signed types, and the value cannot exceed the EMACS_INT
14079 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
14080 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14081 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14082 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 14083
53b2623d
PE
14084 * indent.c (sane_tab_width): New function.
14085 (current_column, scan_for_column, Findent_to, position_indentation)
14086 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 14087 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 14088
51cab52b 14089 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 14090
f2ed8a70
PE
14091 * lisp.h (lint_assume): New macro.
14092 * composite.c (composition_gstring_put_cache):
14093 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14094
abe80cc6
PE
14095 * editfns.c, insdel.c:
14096 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 14097
b02c740e
PE
14098 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14099
ebc96716
PE
14100 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14101
b4e50fa0 14102 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 14103 Use much-faster test for byte-length change.
311d5d7c 14104 Don't assume string byte-length fits in 'int'.
a4cf38e4 14105 Check that character arg fits in 'int'.
85461888 14106 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 14107
c0c1ee9f
PE
14108 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14109
a498d7f4
PE
14110 * fns.c (concat): Catch string overflow earlier.
14111 Do not rely on integer wraparound.
14112
51cab52b
PE
14113 * dispextern.h (struct it.overlay_strings_charpos)
14114 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
14115 * xdisp.c (forward_to_next_line_start)
14116 (back_to_previous_visible_line_start)
14117 (reseat_at_next_visible_line_start, next_element_from_buffer):
14118 Don't arbitrarily truncate the value of 'selective' to int.
14119
76031fad
PE
14120 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14121
5eb55db9
PE
14122 * composite.c: Don't truncate sizes to 'int'.
14123 (composition_gstring_p, composition_reseat_it)
14124 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
14125 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14126 not EMACS_UINT, for indexes.
5eb55db9 14127
0703a717
PE
14128 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14129
d6202519
PE
14130 * buffer.c: Include <verify.h>.
14131 (struct sortvec.priority, struct sortstr.priority):
8961a454 14132 Now EMACS_INT, not int.
c20998a7 14133 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
14134 (struct sortstr.size, record_overlay_string)
14135 (struct sortstrlist.size, struct sortlist.used):
14136 Don't truncate size to int.
14137 (record_overlay_string): Check for size-calculation overflow.
d6202519 14138 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 14139
d5a19415
JM
141402011-06-22 Jim Meyering <meyering@redhat.com>
14141
029529ac 14142 Don't leak an XBM-image-sized buffer
d5a19415
JM
14143 * image.c (xbm_load): Free the image buffer after using it.
14144
a9041e6c
PE
141452011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14146
14147 Port to Sun C.
14148 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14149 that Sun C diagnosed.
14150 * fns.c (secure_hash): Fix pointer signedness issue.
14151 * intervals.c (static_offset_intervals): New function.
14152 (offset_intervals): Use it.
14153
7f3f739f
LL
141542011-06-21 Leo Liu <sdl.web@gmail.com>
14155
14156 * deps.mk (fns.o):
14157 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14158 sha512.h.
14159
14160 * fns.c (secure_hash): Rename from crypto_hash_function and change
14161 the first arg to accept symbols.
5b66d427 14162 (Fsecure_hash): New primitive.
7f3f739f
LL
14163 (syms_of_fns): New symbols.
14164
76147d94
DD
141652011-06-20 Deniz Dogan <deniz@dogan.se>
14166
14167 * process.c (Fset_process_buffer): Clarify return value in
14168 docstring.
14169
7d7d0045
CY
141702011-06-18 Chong Yidong <cyd@stupidchicken.com>
14171
14172 * dispnew.c (add_window_display_history): Use BVAR.
14173
14174 * xdisp.c (debug_method_add): Use BVAR.
14175 (check_window_end, dump_glyph_matrix, dump_glyph)
14176 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14177
14178 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14179 Likewise.
14180
14181 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
14182 check till after the cache is created in init_frame_faces.
14183
ff2bc410
SM
141842011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
14185
14186 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
14187
28177add
PE
141882011-06-16 Paul Eggert <eggert@cs.ucla.edu>
14189
dd3482fe
PE
14190 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
14191 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
14192 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
14193
393d71f3 14194 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
14195 * fileio.c (Finsert_file_contents):
14196 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
14197 Remove the old (too-loose) buffer overflow checks.
14198 They weren't needed, since make_gap checks for buffer overflow.
14199 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
14200 The old code merely checked for Emacs fixnum overflow, and relied
14201 on undefined (wraparound) behavior. The new code avoids undefined
14202 behavior, and also checks for ptrdiff_t and/or size_t overflow.
14203
2e6813b0 14204 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
14205 Tune. Don't use wider integers than needed. Don't use alloca.
14206 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 14207
599a9e4f
PE
14208 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
14209
99561444
PE
14210 * insdel.c, lisp.h (buffer_overflow): New function.
14211 (insert_from_buffer_1, replace_range, replace_range_2):
14212 * insdel.c (make_gap_larger):
14213 * editfns.c (Finsert_char):
14214 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
14215
28177add
PE
14216 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
14217
e69dafad
PE
142182011-06-15 Paul Eggert <eggert@cs.ucla.edu>
14219
4baa020d 14220 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 14221
b1c46f02
PE
14222 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
14223 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
14224
e69dafad
PE
14225 * fileio.c: Don't assume EMACS_INT fits in off_t.
14226 (emacs_lseek): New static function.
14227 (Finsert_file_contents, Fwrite_region): Use it.
14228 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
14229
566684ea
PE
14230 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
14231
e6966cd6
PE
14232 * fns.c: Don't overflow int when computing a list length.
14233 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
14234 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
14235 truncation on 64-bit hosts. Check for QUIT every
14236 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
14237 faster and is responsive enough.
14238 (Flength): Report an error instead of overflowing an integer.
14239 (Fsafe_length): Return a float if the value is not representable
14240 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 14241 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 14242 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 14243
dd0b0efb
PE
14244 * alloc.c: Check that resized vectors' lengths fit in fixnums.
14245 (header_size, word_size): New constants.
14246 (allocate_vectorlike): Don't check size overflow here.
14247 (allocate_vector): Check it here instead, since this is the only
14248 caller of allocate_vectorlike that could cause overflow.
14249 Check that the new vector's length is representable as a fixnum.
14250
86fe5cfe
PE
14251 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
14252 The previous code was bogus. For example, next_almost_prime (32)
14253 returned 39, which is undesirable as it is a multiple of 3; and
14254 next_almost_prime (24) returned 25, which is a multiple of 5 so
14255 why was the code bothering to check for multiples of 7?
14256
80e88859
PE
14257 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
14258
4a2f0ad6
PE
14259 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
14260
f66c7cf8
PE
14261 Variadic C functions now count arguments with ptrdiff_t.
14262 This partly undoes my 2011-03-30 change, which replaced int with size_t.
14263 Back then I didn't know that the Emacs coding style prefers signed int.
14264 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
14265 were being counted with int, which may truncate counts on 64-bit
14266 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
14267 * lisp.h (struct Lisp_Subr.function.aMANY)
14268 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
14269 Arg counts are now ptrdiff_t, not size_t.
14270 All variadic functions and their callers changed accordingly.
14271 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
14272 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
14273 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
14274 * callint.c (Fcall_interactively): Check arg count for overflow,
14275 to avoid potential buffer overrun. Use signed char, not 'int',
14276 for 'varies' array, so that we needn't bother to check its size
14277 calculation for overflow.
14278 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
14279 * eval.c (apply_lambda):
14280 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
14281 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
14282 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
14283
a1759b76
PE
14284 * callint.c (Fcall_interactively): Don't use index var as event count.
14285
d96be9fc
PE
14286 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
14287 * mem-limits.h (SIZE): Remove; no longer used.
14288
a690a978 14289 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 14290
578c21e6
PE
14291 Remove unnecessary casts.
14292 * xterm.c (x_term_init):
14293 * xfns.c (x_set_border_pixel):
14294 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
14295 These aren't needed now that we assume ANSI C.
14296
96f53c6c
PE
14297 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
14298 It's more likely to cause problems (due to unsigned overflow)
14299 than to cure them.
14300
83c77d31
PE
14301 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
14302
ee2079f1
PE
14303 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
14304
6da65536
PE
14305 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
14306
7147c4a4
PE
14307 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
14308
193e32d9
PE
14309 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
14310
e5533da6
PE
14311 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
14312
9910e595
PE
14313 GLYPH_CODE_FACE returns EMACS_INT, not int.
14314 * dispextern.h (merge_faces):
14315 * xfaces.c (merge_faces):
01103c44
PE
14316 * xdisp.c (get_next_display_element, next_element_from_display_vector):
14317 Don't assume EMACS_INT fits in int.
9910e595 14318
2638320e
PE
14319 * character.h (CHAR_VALID_P): Remove unused parameter.
14320 * fontset.c, lisp.h, xdisp.c: All uses changed.
14321
045eb8d9
PE
14322 * editfns.c (Ftranslate_region_internal): Omit redundant test.
14323
c1f134b5
PE
14324 * fns.c (concat): Minor tuning based on overflow analysis.
14325 This doesn't fix any bugs. Use int to hold character, instead
14326 of constantly refetching from Emacs object. Use XFASTINT, not
14327 XINT, for value known to be a character. Don't bother comparing
14328 a single byte to 0400, as it's always less.
14329
395fcb93 14330 * floatfns.c (Fexpt):
327eeec8
PE
14331 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
14332
abbd3d23
PE
14333 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
14334 for characters.
14335
684a03ef
PE
14336 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
14337
0fed43f3
PE
14338 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
14339 Without this fix, on a 64-bit host (aset S 0 4294967386) would
14340 incorrectly succeed when S was a string, because 4294967386 was
14341 truncated before it was used.
14342
8fd02eb7
PE
14343 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
14344 Otherwise, an out-of-range integer could cause undefined behavior
14345 on a 64-bit host.
14346
f8c86b69
PE
14347 * composite.c: Use int, not EMACS_INT, for characters.
14348 (fill_gstring_body, composition_compute_stop_pos): Use int, not
14349 EMACS_INT, for values that are known to be in character range.
14350 This doesn't fix any bugs but is the usual style inside Emacs and
14351 may generate better code on 32-bit machines.
14352
34206dd2
PE
14353 Make sure a 64-bit char is never passed to ENCODE_CHAR.
14354 This is for reasons similar to the recent CHAR_STRING fix.
14355 * charset.c (Fencode_char): Check that character arg is actually
14356 a character. Pass an int to ENCODE_CHAR.
14357 * charset.h (ENCODE_CHAR): Verify that the character argument is no
14358 wider than 'int', as a compile-time check to prevent future regressions
14359 in this area.
14360
c5958d4c 14361 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
14362
14363 Make sure a 64-bit char is never passed to CHAR_STRING.
14364 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
14365 by silently ignoring the top 32 bits, allowing some values
14366 that were far too large to be valid characters.
14367 * character.h: Include <verify.h>.
14368 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
14369 arguments are no wider than unsigned, as a compile-time check
14370 to prevent future regressions in this area.
14371 * data.c (Faset):
01103c44 14372 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
14373 (Fsubst_char_in_region):
14374 * fns.c (concat):
14375 * xdisp.c (decode_mode_spec_coding):
14376 Adjust to CHAR_STRING's new requirement.
14377 * editfns.c (Finsert_char, Fsubst_char_in_region):
14378 * fns.c (concat): Check that character args are actually
14379 characters. Without this test, these functions did the wrong
14380 thing with wildly out-of-range values on 64-bit hosts.
14381
d37ca623
PE
14382 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14383 These casts should not be needed on 32-bit hosts, either.
14384 * keyboard.c (read_char):
14385 * lread.c (Fload): Remove casts to unsigned.
14386
ea204efb
PE
14387 * lisp.h (UNSIGNED_CMP): New macro.
14388 This fixes comparison bugs on 64-bit hosts.
14389 (ASCII_CHAR_P): Use it.
14390 * casefiddle.c (casify_object):
01103c44 14391 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
14392 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
14393 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
14394 * dispextern.h (FACE_FROM_ID):
14395 * keyboard.c (read_char): Use UNSIGNED_CMP.
14396
41cb286c
PE
14397 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
14398 not to EMACS_INT, to avoid GCC warning.
14399
4a1b9832
PE
14400 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
14401
55daad71
PE
14402 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
14403 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14404 isn't needed on 32-bit machines.
8f95c75c 14405
01103c44
PE
14406 * buffer.c (Fgenerate_new_buffer_name):
14407 Use EMACS_INT for count, not int.
0ceccced 14408 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
14409
14410 * data.c (Qcompiled_function): Now static.
14411
c6f072e7
PE
14412 * window.c (window_body_lines): Now static.
14413
20ce5912
PE
14414 * image.c (gif_load): Rename local to avoid shadowing.
14415
9c4c5f81
PE
14416 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14417 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14418 * alloc.c (make_save_value): Integer argument is now of type
14419 ptrdiff_t, not int.
14420 (mark_object): Use ptrdiff_t, not int.
14421 * lisp.h (pD): New macro.
14422 * print.c (print_object): Use it.
14423
c0c5c8ae
PE
14424 * alloc.c: Use EMACS_INT, not int, to count objects.
14425 (total_conses, total_markers, total_symbols, total_vector_size)
14426 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
14427 (total_free_floats, total_floats, total_free_intervals)
14428 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
14429 Now EMACS_INT, not int. All uses changed.
14430 (Fgarbage_collect): Compute overall total using a double, so that
14431 integer overflow is less likely to be a problem. Check for overflow
14432 when converting back to an integer.
5a25e253
PE
14433 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14434 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14435 These were 'int' variables that could overflow on 64-bit hosts;
14436 they were never used, so remove them instead of repairing them.
211a0b2a 14437 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
14438 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14439 Previously, this ceilinged at INT_MAX, but that doesn't work on
14440 64-bit machines.
e46bb31a 14441 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 14442
c78baabf 14443 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 14444 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
14445 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
14446 when a (possibly-narrower) signed value would do just as well.
14447 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 14448
c9d624c6
PE
14449 * alloc.c: Catch some string size overflows that we were missing.
14450 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14451 for convenience in STRING_BYTES_MAX.
14452 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14453 The definition here is exact; the one in lisp.h was approximate.
14454 (allocate_string_data): Check for string overflow. This catches
14455 some instances we weren't catching before. Also, it catches
14456 size_t overflow on (unusual) hosts where SIZE_MAX <= min
14457 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14458 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 14459
c9d624c6
PE
14460 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14461 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 14462 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 14463
353032ce
PE
14464 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14465
2bccce07
PE
14466 * alloc.c (Fmake_string): Check for out-of-range init.
14467
0ac30604
SM
144682011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14469
14470 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14471
c195f2de
JD
144722011-06-14 Jan Djärv <jan.h.d@swipnet.se>
14473
14474 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14475 xg_get_default_scrollbar_width.
14476
14477 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14478 (int_gtk_range_get_value): Move to the scroll bar part of the file.
14479 (style_changed_cb): Call update_theme_scrollbar_width and call
14480 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14481 all frames (Bug#8505).
14482 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14483 Call gtk_window_set_resizable if HAVE_GTK3.
14484 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14485 and height if HAVE_GTK3 (Bug#8505).
14486 (scroll_bar_width_for_theme): New variable.
14487 (update_theme_scrollbar_width): New function.
14488 (xg_get_default_scrollbar_width): Move code to
14489 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14490 (xg_initialize): Call update_theme_scrollbar_width.
14491
14492 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14493
14494 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14495
e10ac9f1
MR
144962011-06-12 Martin Rudalics <rudalics@gmx.at>
14497
14498 * frame.c (make_frame): Call other_buffer_safely instead of
14499 other_buffer.
14500
14501 * window.c (temp_output_buffer_show): Call display_buffer with
14502 second argument Vtemp_buffer_show_specifiers and reset latter
14503 immediately after the call.
14504 (Vtemp_buffer_show_specifiers): New variable.
14505 (auto_window_vscroll_p, next_screen_context_lines)
14506 (Vscroll_preserve_screen_position): Remove leading asterisks from
14507 doc-strings.
14508
2d3c217e 145092011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 14510
7b7f97e8 14511 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
14512 * buffer.c (Qclone_number): Remove for now, as it's unused.
14513 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14514 (record_buffer): Remove unused local.
14515 * frame.c (other_visible_frames, frame_buffer_list): Now static.
14516 (set_frame_buffer_list): Remove; unused.
14517 * frame.h (other_visible_frames): Remove decl.
14518 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14519 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14520 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14521 if HAVE_GPM.
14522 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14523 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
14524 Define only if HAVE_GPM.
14525 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
14526 (update_hints_inhibit): Remove; never set. All uses removed.
14527 * widgetprv.h (emacsFrameClassRec): Remove decl.
14528 * window.c (delete_deletable_window): Now returns void, since it
14529 wasn't returning anything.
14530 (compare_window_configurations): Remove unused locals.
14531 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
14532 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
14533 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
14534 the same widths as pointers. This follows up on the 2011-05-06 patch.
14535 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
14536 * xterm.h: Likewise.
14537 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
14538
1384b89e
JB
145392011-06-12 Juanma Barranquero <lekktu@gmail.com>
14540
14541 * makefile.w32-in: Update dependencies.
14542 (LISP_H): Add lib/intprops.h.
14543
1100a63c
CY
145442011-06-11 Chong Yidong <cyd@stupidchicken.com>
14545
14546 * image.c (gif_load): Add animation frame delay to the metadata.
14547 (syms_of_image): Use DEFSYM. New symbol `delay'.
14548
6198ccd0
MR
145492011-06-11 Martin Rudalics <rudalics@gmx.at>
14550
14551 * window.c (delete_deletable_window): Re-add.
14552 (Fset_window_configuration): Rewrite to handle dead buffers and
14553 consequently deletable windows.
14554 (window_tree, Fwindow_tree): Remove. Supply functionality in
14555 window.el.
14556 (compare_window_configurations): Simplify code.
14557
b6e3633c
AS
145582011-06-11 Andreas Schwab <schwab@linux-m68k.org>
14559
1ab0dee5
AS
14560 * image.c (imagemagick_load_image): Fix type mismatch.
14561 (Fimagemagick_types): Likewise.
14562
b6e3633c
AS
14563 * window.h (replace_buffer_in_windows): Declare.
14564
9397e56f
MR
145652011-06-11 Martin Rudalics <rudalics@gmx.at>
14566
14567 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
14568 Qclone_number. Remove external declaration of Qdelete_window.
14569 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
14570 code.
640c8776
SM
14571 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
14572 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
14573 (Fother_buffer): Rewrite doc-string. Major rewrite for new
14574 buffer list implementation.
14575 (other_buffer_safely): New function.
14576 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
14577 calls to replace_buffer_in_windows and
14578 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
14579 if allowed.
14580 (record_buffer): Inhibit quitting and rewrite using quittable
14581 functions. Run Qbuffer_list_update_hook if allowed.
14582 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
14583 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
14584 Move switch-to-buffer to window.el.
9397e56f
MR
14585 (bury-buffer): Move to window.el.
14586 (Vbuffer_list_update_hook): New variable.
14587
14588 * lisp.h (other_buffer_safely): Add prototype in buffer.c
14589 section.
14590
14591 * window.h (resize_frame_windows): Move up in code.
14592 (Fwindow_frame): Remove EXFUN.
14593 (replace_buffer_in_all_windows): Remove prototype.
14594 (replace_buffer_in_windows_safely): Add prototype.
14595
14596 * window.c: Declare Qdelete_window static again. Move down
14597 declaration of select_count.
14598 (Fnext_window, Fprevious_window): Rewrite doc-strings.
14599 (Fother_window): Move to window.el.
14600 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14601 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14602 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14603 window.el.
14604 (replace_buffer_in_windows): Implement by calling
14605 Qreplace_buffer_in_windows.
14606 (replace_buffer_in_all_windows): Remove with some functionality
14607 moved into replace_buffer_in_windows_safely.
14608 (replace_buffer_in_windows_safely): New function.
14609 (select_window_norecord, select_frame_norecord): Move in front
14610 of run_window_configuration_change_hook. Remove now obsolete
14611 declarations.
640c8776
SM
14612 (Fset_window_buffer): Rewrite doc-string.
14613 Call Qrecord_window_buffer.
9397e56f
MR
14614 (keys_of_window): Move binding for other-window to window.el.
14615
b50691aa
CY
146162011-06-11 Chong Yidong <cyd@stupidchicken.com>
14617
14618 * dispextern.h (struct image): Replace data member, whose int_val
14619 and ptr_val fields were not used by anything, with a single
14620 lisp_val object.
14621
14622 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14623 (gif_clear_image, gif_load, imagemagick_load_image)
14624 (gs_clear_image, gs_load): Callers changed.
14625
3f754b86
PE
146262011-06-10 Paul Eggert <eggert@cs.ucla.edu>
14627
cca69397
PE
14628 * buffer.h: Include <time.h>, for time_t.
14629 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
14630
109e28d0
PE
14631 Fix minor problems found by static checking.
14632
60737f02
PE
14633 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14634
4b66faf3
PE
14635 Make identifiers static if they are not used in other modules.
14636 * data.c (Qcompiled_function, Qframe, Qvector):
14637 * image.c (QimageMagick, Qsvg):
14638 * minibuf.c (Qmetadata):
14639 * window.c (resize_window_check, resize_root_window): Now static.
14640 * window.h (resize_window_check, resize_root_window): Remove decls.
14641
109e28d0
PE
14642 * window.c (window_deletion_count, delete_deletable_window):
14643 Remove; unused.
46a4ce9e
PE
14644 (window_body_lines): Now static.
14645 (Fdelete_other_windows_internal): Mark vars as initialized.
14646 Make sure 'resize_failed' is initialized.
14647 (run_window_configuration_change_hook): Rename local to avoid shadowing.
14648 (resize_window_apply): Remove unused local.
14649 * window.h (delete_deletable_window): Remove decl.
14650
109e28d0 14651 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
14652 (imagemagick_load_image): Fix pointer signedness problem by changing
14653 last arg from unsigned char * to char *. All uses changed.
14654 Also, fix a local for similar reasons.
14655 Remove unused locals. Remove locals to avoid shadowing.
14656 (fn_rsvg_handle_free): Remove; unused.
14657 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 14658 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 14659
3f754b86
PE
14660 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14661
2547adb1
CY
146622011-06-10 Chong Yidong <cyd@stupidchicken.com>
14663
14664 * image.c (gif_load): Fix omitted cast error introduced by
14665 2011-06-06 change.
14666
2c8e37d4
MR
146672011-06-10 Martin Rudalics <rudalics@gmx.at>
14668
14669 * window.h (resize_proportionally, orig_total_lines)
14670 (orig_top_line): Remove from window structure.
14671 (set_window_height, set_window_width, change_window_heights)
14672 (Fdelete_window): Remove prototypes.
14673 (resize_frame_windows): Remove duplicate declaration.
14674
440a42e3
EZ
146752011-06-10 Eli Zaretskii <eliz@gnu.org>
14676
14677 * window.h (resize_frame_windows, resize_window_check)
14678 (delete_deletable_window, resize_root_window)
14679 (resize_frame_windows): Declare prototypes.
14680
14681 * window.c (resize_window_apply): Make definition be "static" to
14682 match the prototype.
14683
562dd5e9
MR
146842011-06-10 Martin Rudalics <rudalics@gmx.at>
14685
14686 * window.c: Remove declarations of Qwindow_size_fixed,
14687 window_min_size_1, window_min_size_2, window_min_size,
14688 size_window, window_fixed_size_p, enlarge_window, delete_window.
14689 Remove static from declaration of Qdelete_window, it's
14690 temporarily needed by Fbury_buffer.
14691 (replace_window): Don't assign orig_top_line and
14692 orig_total_lines.
14693 (Fdelete_window, delete_window): Remove. Window deletion is
14694 handled by window.el.
640c8776
SM
14695 (window_loop): Remove DELETE_OTHER_WINDOWS case.
14696 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
14697 (Fdelete_other_windows): Remove. Deleting other windows is
14698 handled by window.el.
14699 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
14700 handled in window.el.
14701 (window_min_size_2, window_min_size_1, window_min_size): Remove.
14702 Window minimum sizes are handled in window.el.
14703 (shrink_windows, size_window, set_window_height)
14704 (set_window_width, change_window_heights, window_height)
14705 (window_width, CURBEG, CURSIZE, enlarge_window)
14706 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
14707 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
14708 handled in window.el.
14709 (make_dummy_parent): Rename to make_parent_window and give it a
14710 second argument horflag.
14711 (make_window): Don't set resize_proportionally any more.
14712 (Fsplit_window): Remove. Windows are split in window.el.
14713 (save_restore_action, save_restore_orig_size)
14714 (shrink_window_lowest_first, save_restore_orig_size): Remove.
14715 Resize mini windows in window.el.
14716 (grow_mini_window, shrink_mini_window): Implement by calling
14717 Qresize_root_window_vertically, resize_window_check and
14718 resize_window_apply.
640c8776
SM
14719 (saved_window, Fset_window_configuration, save_window_save):
14720 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
14721 resize_proportionally.
14722 (window_min_height, window_min_width): Move to window.el.
14723 (keys_of_window): Move bindings for delete-other-windows,
14724 split-window, delete-window and enlarge-window to window.el.
14725
14726 * buffer.c: Temporarily extern Qdelete_window.
14727 (Fbury_buffer): Temporarily call Qdelete_window instead of
14728 Fdelete_window (Fbury_buffer will move to window.el soon).
14729
14730 * frame.c (set_menu_bar_lines_1): Remove code handling
14731 orig_top_line and orig_total_lines.
14732
14733 * dispnew.c (adjust_frame_glyphs_initially): Don't use
14734 set_window_height but set heights directly.
14735 (change_frame_size_1): Use resize_frame_windows.
14736
14737 * xdisp.c (init_xdisp): Don't use set_window_height but set
14738 heights directly.
14739
640c8776
SM
14740 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14741 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
14742 run_window_configuration_change_hook.
14743
14744 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14745 instead of change_window_heights and run
14746 run_window_configuration_change_hook.
14747
1a13852e
MR
147482011-06-09 Martin Rudalics <rudalics@gmx.at>
14749
14750 * window.c (replace_window): Rename second argument REPLACEMENT to
14751 NEW. New third argument SETFLAG. Rewrite.
14752 (delete_window, make_dummy_parent): Call replace_window with
14753 third argument 1.
14754 (window_list_1): Move down in code.
14755 (run_window_configuration_change_hook): Move set_buffer part
14756 before select_frame_norecord part in order to unwind correctly.
14757 Rename count1 to count.
14758 (recombine_windows, delete_deletable_window, resize_root_window)
14759 (Fdelete_other_windows_internal)
14760 (Frun_window_configuration_change_hook, make_parent_window)
14761 (resize_window_check, resize_window_apply, Fresize_window_apply)
14762 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
14763 (Fdelete_window_internal, Fresize_mini_window_internal):
14764 New functions.
1a13852e
MR
14765 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14766
f3d1777e
MR
147672011-06-08 Martin Rudalics <rudalics@gmx.at>
14768
496e208e
MR
14769 * window.h (window): Add some new members to window structure -
14770 normal_lines, normal_cols, new_total, new_normal, clone_number,
14771 splits, nest, prev_buffers, next_buffers.
14772 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 14773 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 14774
f3d1777e
MR
14775 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14776 Remove.
496e208e
MR
14777 (make_dummy_parent): Set new members of windows structure.
14778 (make_window): Move down in code. Handle new members of window
14779 structure.
14780 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14781 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14782 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14783 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
14784 (Fset_window_next_buffers, Fset_window_clone_number):
14785 New functions.
496e208e
MR
14786 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14787 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14788 Doc-string fixes.
14789 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14790 Argument WINDOW can be now internal window too.
14791 (Fwindow_use_time): Move up in code.
14792 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14793 Rewrite doc-string.
14794 (Fset_window_configuration, saved_window)
14795 (Fcurrent_window_configuration, save_window_save): Handle new
14796 members of window structure.
b9e809c2
MR
14797 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14798 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14799 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14800 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14801 Qget_mru_window, Qresize_root_window,
14802 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14803 Qauto_buffer_name; staticpro them.
f3d1777e 14804
abde8f8c
MR
148052011-06-07 Martin Rudalics <rudalics@gmx.at>
14806
14807 * window.c (Fwindow_total_size, Fwindow_left_column)
14808 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14809 (Fwindow_list_1): New functions.
14810 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
14811 (Fwindow_width, Fscroll_left, Fscroll_right):
14812 Use window_body_cols instead of window_box_text_cols.
14813 (delete_window, Fset_window_configuration):
14814 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
14815 (delete_all_subwindows): Take a window as argument and not a
14816 structure. Rewrite.
190b47e6
MR
14817 (window_loop): Remove handling of GET_LRU_WINDOW and
14818 GET_LARGEST_WINDOW.
14819 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
14820
14821 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
14822 window_box_text_cols. delete_all_subwindows now takes a
14823 Lisp_Object as argument.
abde8f8c 14824
640c8776
SM
14825 * indent.c (compute_motion, Fcompute_motion):
14826 Use window_body_cols instead of window_box_text_cols.
abde8f8c 14827
fa8a67e6
MR
14828 * frame.c (delete_frame): Call delete_all_subwindows with root
14829 window as argument.
14830
a54e3482
DC
148312011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14832
14833 * fns.c (Fputhash): Document return value.
14834
60002bf5
CY
148352011-06-06 Chong Yidong <cyd@stupidchicken.com>
14836
14837 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14838
0c671da6 148392011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 14840
b862a52a 14841 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 14842
be44ca6c
PE
14843 Check for overflow when converting integer to cons and back.
14844 * charset.c (Fdefine_charset_internal, Fdecode_char):
14845 Use cons_to_unsigned to catch overflow.
14846 (Fencode_char): Use INTEGER_TO_CONS.
14847 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14848 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14849 * data.c (long_to_cons, cons_to_long): Remove.
14850 (cons_to_unsigned, cons_to_signed): New functions.
14851 These signal an error for invalid or out-of-range values.
14852 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14853 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14854 * font.c (Ffont_variation_glyphs):
14855 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14856 * lisp.h: Include <intprops.h>.
14857 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14858 (cons_to_signed, cons_to_unsigned): New decls.
14859 (long_to_cons, cons_to_long): Remove decls.
14860 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14861 (Fprimitive_undo): Use CONS_TO_INTEGER.
14862 * xfns.c (Fx_window_property): Likewise.
14863 * xselect.c: Include <limits.h>.
14864 (x_own_selection, selection_data_to_lisp_data):
14865 Use INTEGER_TO_CONS.
14866 (x_handle_selection_request, x_handle_selection_clear)
14867 (x_get_foreign_selection, Fx_disown_selection_internal)
14868 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14869 (lisp_data_to_selection_data): Use cons_to_unsigned.
14870 (x_fill_property_data): Use cons_to_signed.
14871 Report values out of range.
14872
d1f3d2af
PE
14873 Check for buffer and string overflow more precisely.
14874 * buffer.h (BUF_BYTES_MAX): New macro.
14875 * lisp.h (STRING_BYTES_MAX): New macro.
14876 * alloc.c (Fmake_string):
14877 * character.c (string_escape_byte8):
14878 * coding.c (coding_alloc_by_realloc):
14879 * doprnt.c (doprnt):
14880 * editfns.c (Fformat):
14881 * eval.c (verror):
14882 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14883 since they may not be the same number.
14884 * editfns.c (Finsert_char):
14885 * fileio.c (Finsert_file_contents):
14886 Likewise for BUF_BYTES_MAX.
14887
dd52fcea
PE
14888 * image.c: Use ptrdiff_t, not int, for sizes.
14889 (slurp_file): Switch from int to ptrdiff_t.
14890 All uses changed.
14891 (slurp_file): Check that file size fits in both size_t (for
14892 malloc) and ptrdiff_t (for sanity and safety).
14893
7f9bbdbb
PE
14894 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14895 if b->modtime has its maximal value.
14896
dfe18f82
PE
14897 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14898
84acfcf0
PE
14899 Don't assume time_t can fit into int.
14900 * buffer.h (struct buffer.modtime): Now time_t, not int.
14901 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14902 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14903
ccd9a01a
PE
14904 Minor fixes for signed vs unsigned integers.
14905 * character.h (MAYBE_UNIFY_CHAR):
14906 * charset.c (maybe_unify_char):
14907 * keyboard.c (read_char, reorder_modifiers):
14908 XINT -> XFASTINT, since the integer must be nonnegative.
14909 * ftfont.c (ftfont_spec_pattern):
14910 * keymap.c (access_keymap, silly_event_symbol_error):
14911 XUINT -> XFASTINT, since the integer must be nonnegative.
14912 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14913 since it makes no difference and we prefer signed.
14914 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14915 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14916 nonnegative.
14917
d6d100dd
SM
149182011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14919
14920 * window.h (Fwindow_frame): Declare.
14921
2b6148e4
PE
149222011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14923
14924 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14925 (SPARE_MEMORY): Always define.
14926 (LARGE_REQUEST): Remove.
14927 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14928
f230ecc9
MR
149292011-06-06 Martin Rudalics <rudalics@gmx.at>
14930
727e958e
MR
14931 * lisp.h: Move EXFUNS for Fframe_root_window,
14932 Fframe_first_window and Fset_frame_selected_window to window.h.
14933
14934 * window.h: Move EXFUNS for Fframe_root_window,
14935 Fframe_first_window and Fset_frame_selected_window here from
14936 lisp.h.
14937
14938 * frame.c (Fwindow_frame, Fframe_first_window)
14939 (Fframe_root_window, Fframe_selected_window)
14940 (Fset_frame_selected_window): Move to window.c.
14941 (Factive_minibuffer_window): Move to minibuf.c.
14942 (Fother_visible_frames_p): New function.
14943
14944 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14945
f230ecc9
MR
14946 * window.c (decode_window, decode_any_window): Move up in code.
14947 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14948 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
14949 (Fwindow_buffer): Move up and rewrite doc-string.
14950 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14951 (Fwindow_prev): New functions.
727e958e
MR
14952 (Fwindow_frame): Move here from frame.c. Accept any window as
14953 argument.
14954 (Fframe_root_window, Fframe_first_window)
14955 (Fframe_selected_window): Move here from frame.c. Accept frame
14956 or arbitrary window as argument. Update doc-strings.
14957 (Fminibuffer_window): Move up in code.
14958 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
14959 (Fset_frame_selected_window): Move here from frame.c.
14960 Marginal rewrite.
727e958e
MR
14961 (Fselected_window, select_window, Fselect_window): Move up in
14962 code. Minor doc-string fixes.
f230ecc9 14963
4d09bcf6
PE
149642011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14965
14966 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14967 Do not assume that spare memory exists; that assumption is valid
14968 only if SYSTEM_MALLOC.
14969 (LARGE_REQUEST): New macro, so that the issue of large requests
14970 is separated from the issue of spare memory.
14971
810928a2
AS
149722011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14973
172418ad
AS
14974 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14975 format. (Bug#8806)
14976
43f862f7
AS
14977 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14978
810928a2
AS
14979 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14980 before statements.
14981
a059fe24
JD
149822011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14983
14984 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14985
14986 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14987
14988 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14989 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14990
989bf368
JB
149912011-06-05 Juanma Barranquero <lekktu@gmail.com>
14992
14993 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14994
4b80f674
CY
149952011-06-04 Chong Yidong <cyd@stupidchicken.com>
14996
14997 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14998 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
14999 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15000 New error handlers.
4b80f674
CY
15001 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15002 Obey Vx_select_enable_clipboard_manager. Catch errors in
15003 x_clipboard_manager_save (Bug#8779).
15004 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 15005 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 15006
99a33b77 150072011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
15008
15009 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15010
99a33b77 150112011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
15012
15013 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15014 in the current matrix if keep_current_p is non-zero.
15015
8264569d
EZ
150162011-06-04 Eli Zaretskii <eliz@gnu.org>
15017
15018 * bidi.c (bidi_level_of_next_char): Fix last change.
15019
57f97249
EZ
150202011-06-03 Eli Zaretskii <eliz@gnu.org>
15021
fec2107c 15022 Support bidi reordering of text covered by display properties.
57f97249 15023
fec2107c
EZ
15024 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15025 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15026 (bidi_cache_search, bidi_cache_iterator_state)
15027 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
15028 (bidi_level_of_next_char, bidi_move_to_visually_next):
15029 Support character positions inside a run of characters covered by a
fec2107c
EZ
15030 display string.
15031 (bidi_paragraph_init, bidi_resolve_explicit_1)
15032 (bidi_level_of_next_char): Call bidi_fetch_char and
15033 bidi_fetch_char_advance instead of FETCH_CHAR and
15034 FETCH_CHAR_ADVANCE.
15035 (bidi_init_it): Initialize new members.
15036 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15037 definitions.
15038 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15039 instead of using explicit *_CHAR codes.
d6d100dd
SM
15040 (bidi_resolve_explicit, bidi_resolve_weak):
15041 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
15042 bidirectional text is supported only in multibyte buffers.
15043 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15044 it to initialize the frame_window_p member of struct bidi_it.
15045 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15046 (bidi_resolve_explicit, bidi_resolve_weak)
15047 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15048 bidi_it->nchars is non-positive.
15049 (bidi_level_of_next_char): Don't try to lookup the cache for the
15050 next/previous character if nothing is cached there yet, or if we
15051 were just reseat()'ed to a new position.
c40e2fb2 15052
0e14fe90
EZ
15053 * xdisp.c (set_cursor_from_row): Set start and stop points
15054 according to the row's direction when priming the loop that looks
15055 for the glyph on which to display cursor.
15056 (single_display_spec_intangible_p): Function deleted.
15057 (display_prop_intangible_p): Reimplement to call
15058 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
15059 Accept 3 additional arguments needed by handle_display_spec.
15060 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
15061 values: lists, `(when COND...)' forms, etc.
15062 (single_display_spec_string_p): Support property values that are
15063 lists with the argument STRING its top-level element.
15064 (display_prop_string_p): Fix the condition for processing a
15065 property that is a list to be consistent with handle_display_spec.
fec2107c 15066 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
15067 last portion of handle_display_prop.
15068 (compute_display_string_pos): Accept additional argument
15069 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15070 value of a `display' property is a "replacing spec".
15071 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15072 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15073 the display property, but just return a value indicating whether
15074 the display property will replace the characters it covers.
15075 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15076 frame_window_p members of struct bidi_it.
d6d100dd
SM
15077 (compute_display_string_pos, compute_display_string_end):
15078 New functions.
fec2107c
EZ
15079 (push_it): Accept second argument POSITION, where pop_it should
15080 jump to continue iteration.
15081 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 15082
fec2107c
EZ
15083 * keyboard.c (adjust_point_for_property): Adjust the call to
15084 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
15085
15086 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
15087 (bidi_init_it): Update prototypes.
15088 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
15089 (compute_display_string_pos, compute_display_string_end):
15090 Declare prototypes.
fec2107c
EZ
15091 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15092 EMACS_INT.
fc6f18ce 15093
40087514 150942011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 15095
57f53182
PE
15096 Malloc failure behavior now depends on size of allocation.
15097 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15098 * lisp.h: Change signatures accordingly.
15099 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15100 All callers changed. (Bug#8762)
15101
15102 * gnutls.c: Use Emacs's memory allocators.
15103 Without this change, the gnutls library would invoke malloc etc.
15104 directly, which causes problems on non-SYNC_INPUT hosts, and which
15105 runs afoul of improving memory_full behavior. (Bug#8761)
15106 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15107 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15108 xfree instead of the default malloc, realloc, free.
15109 (Fgnutls_boot): No need to check for memory allocation failure,
15110 since xmalloc does that for us.
15111
ac32cd99 15112 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
15113 * category.c (hash_get_category_set):
15114 * ccl.c (ccl_driver):
15115 * charset.c (Fdefine_charset_internal):
15116 * charset.h (struct charset.hash_index):
15117 * composite.c (get_composition_id, gstring_lookup_cache)
15118 (composition_gstring_put_cache):
15119 * composite.h (struct composition.hash_index):
15120 * dispextern.h (struct image.hash):
15121 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15122 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15123 (hashfn_equal, hashfn_user_defined, make_hash_table)
15124 (maybe_resize_hash_table, hash_lookup, hash_put)
15125 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15126 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15127 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15128 * image.c (make_image, search_image_cache, lookup_image)
15129 (xpm_put_color_table_h):
15130 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 15131 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 15132 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 15133 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
15134 * alloc.c (allocate_vectorlike):
15135 Check for overflow in vector size calculations.
15136 * ccl.c (ccl_driver):
15137 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
15138 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15139 need to be updated by these changes.
40087514
PE
15140 * fns.c (make_hash_table, maybe_resize_hash_table):
15141 Check for integer overflow with large hash tables.
0de4bb68
PE
15142 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15143 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15144 (SXHASH_REDUCE): New macro.
15145 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15146 Use it instead of discarding useful hash info with large hash values.
15147 (sxhash_float): New function.
15148 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15149 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
15150 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15151 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
15152 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15153 Adjust signatures to match updated version of code.
15154 (consing_since_gc): Now EMACS_INT, since a single hash table can
15155 use more than INT_MAX bytes.
15156
698d32e2
DN
151572011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15158
15159 Make it possible to build with GCC-4.6+ -O2 -flto.
15160
15161 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15162
fd6fa53f
SM
151632011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15164
15165 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15166 Call minibuffer-inactive-mode.
15167
864db017
JB
151682011-05-31 Juanma Barranquero <lekktu@gmail.com>
15169
15170 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15171 Update dependencies.
15172
2ad0baf4
DN
151732011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15174
15175 * data.c (init_data): Remove code for UTS, this system is not
15176 supported anymore.
15177
4fcc2638
DN
151782011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15179
15180 Don't force ./temacs to start in terminal mode.
15181
15182 * frame.c (make_initial_frame): Initialize faces in all cases, not
15183 only when CANNOT_DUMP is defined.
15184 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
15185
c56e0fd5
DN
151862011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15187
15188 * dispnew.c (add_window_display_history): Use const for the string
15189 pointer. Remove declaration, not needed.
15190
333d54da 151912011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 15192
55d4c1b2 15193 Use 'inline', not 'INLINE'.
333d54da 15194 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
15195 * alloc.c, fontset.c (INLINE): Remove.
15196 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
15197 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
15198 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
15199 * gmalloc.c (register_heapinfo): Use inline unconditionally.
15200 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
15201
738db178
DN
152022011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15203
15204 Make it possible to run ./temacs.
15205
15206 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
15207 syms_of_callproc does the same thing. Remove test for
15208 "initialized", do it in the caller.
15209 * emacs.c (main): Avoid calling set_initial_environment when dumping.
15210
620c53a6
SM
152112011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
15212
15213 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
15214 (read_minibuf): Use get_minibuffer.
15215 (syms_of_minibuf): Use DEFSYM.
15216 (Qmetadata): New var.
15217 * data.c (Qbuffer): Don't make it static.
15218 (syms_of_data): Use DEFSYM.
15219
e003a292
PE
152202011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15221
15222 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
15223 (CCL_CODE_MIN): New macro.
15224
ed008a6d
PE
152252011-05-30 Paul Eggert <eggert@cs.ucla.edu>
15226
3687c2ef
PE
15227 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
15228
ed008a6d
PE
15229 * eval.c (Qdebug): Now static.
15230 * lisp.h (Qdebug): Remove decl. This reverts a part of the
15231 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
15232 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
15233
d66c4c7c
CY
152342011-05-29 Chong Yidong <cyd@stupidchicken.com>
15235
15236 * image.c: Various fixes to ImageMagick code comments.
15237 (Fimagemagick_types): Doc fix.
15238
5fbc2025
PE
152392011-05-29 Paul Eggert <eggert@cs.ucla.edu>
15240
0196f88a
PE
15241 Minor fixes prompted by GCC 4.6.0 warnings.
15242
15243 * xselect.c (converted_selections, conversion_fail_tag): Now static.
15244
5fbc2025
PE
15245 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
15246 (x_clipboard_manager_save_all): Move extern decl to ...
15247 * xterm.h: ... here, so that it can be checked for consistency.
15248
1dd3c2d9
CY
152492011-05-29 Chong Yidong <cyd@stupidchicken.com>
15250
15251 * xselect.c (x_clipboard_manager_save_frame)
15252 (x_clipboard_manager_save_all): New functions.
15253 (Fx_clipboard_manager_save): Lisp function deleted.
15254
15255 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
15256 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
15257
15258 * xterm.h: Update prototype.
15259
5ba6571d
WX
152602011-05-28 William Xu <william.xwl@gmail.com>
15261
15262 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
15263 exiting (Bug#8239).
15264
3eaff834
JM
152652011-05-28 Jim Meyering <meyering@redhat.com>
15266
e1900994 15267 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
15268 * fns.c (to_uchar): Define.
15269 (crypto_hash_function): Use it to convert some newly-signed
15270 variables to unsigned, to avoid sign-extension bugs. For example,
15271 without this change, (md5 "truc") would evaluate to
15272 45723a2aff78ff4fff7fff1114760e62 rather than the expected
15273 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 15274 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 15275
0f6990a7
PE
152762011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15277
15278 Integer overflow fixes.
c8a9ca5a 15279
08686060
PE
15280 * dbusbind.c: Serial number integer overflow fixes.
15281 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
15282 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
15283 to hold a serial number that is too large for a fixnum.
15284 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15285 Check for serial numbers out of range. Decode any serial number
59568bf0 15286 that was so large that it became a float. (Bug#8722)
08686060 15287
2d1fc3c7
PE
15288 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
15289 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15290 Use XFASTINT rather than XUINT when numbers are nonnegative.
15291 (xd_append_arg, Fdbus_method_return_internal):
15292 (Fdbus_method_error_internal): Likewise. Also, for unsigned
15293 arguments, check that Lisp number is nonnegative, rather than
59568bf0 15294 silently wrapping negative numbers around. (Bug#8722)
30217ff0 15295 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 15296 (Bug#8722)
2d1fc3c7 15297
c8a9ca5a
PE
15298 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
15299
519e1d69
PE
15300 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
15301
6df6ae42 15302 ccl: Add integer overflow checks.
30569699
PE
15303 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
15304 (IN_INT_RANGE): New macros.
15305 (ccl_driver): Use them to check for integer overflow when
15306 decoding a CCL program. Many of the new checks are whether XINT (x)
15307 fits in int; it doesn't always, on 64-bit hosts. The new version
15308 doesn't catch all possible integer overflows, but it's an
847044ea 15309 improvement. (Bug#8719)
30569699 15310
c11285dc
PE
15311 * alloc.c (make_event_array): Use XINT, not XUINT.
15312 There's no need for unsigned here.
15313
fdccd48e
PE
15314 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
15315 This follows up to the 2011-05-06 change that substituted uintptr_t
15316 for EMACS_INT. This case wasn't caught back then.
15317
37910ab2
PE
15318 Rework Fformat to avoid integer overflow issues.
15319 * editfns.c: Include <float.h> unconditionally, as it's everywhere
15320 now (part of C89). Include <verify.h>.
15321 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
15322 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
15323 (Fformat): Avoid the prepass trying to compute sizes; it was only
15324 approximate and thus did not catch overflow reliably. Instead, walk
15325 through the format just once, formatting and computing sizes as we go,
15326 checking for integer overflow at every step, and allocating a larger
15327 buffer as needed. Keep track separately whether the format is
15328 multibyte. Keep only the most-recently calculated precision, rather
15329 than them all. Record whether each argument has been converted to
15330 string. Use EMACS_INT, not int, for byte and char and arg counts.
15331 Support field widths and precisions larger than INT_MAX. Avoid
15332 sprintf's undefined behavior with conversion specifications such as %#d
15333 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
15334 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
15335 formatting out-of-range floating point numbers with int
9173deec 15336 formats. (Bug#8668)
37910ab2 15337
2e6578fb
PE
15338 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
15339
0ae6bdee
PE
15340 * data.c: Avoid integer truncation in expressions involving floats.
15341 * data.c: Include <intprops.h>.
15342 (arith_driver): When there's an integer overflow in an expression
15343 involving floating point, convert the integers to floating point
15344 so that the resulting value does not suffer from catastrophic
15345 integer truncation. For example, on a 64-bit host (* 4
15346 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
15347 Do not rely on undefined behavior after integer overflow.
15348
de883a70
PE
15349 merge count_size_as_multibyte, parse_str_to_multibyte
15350 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 15351 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
15352 Check for integer overflow.
15353 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
15354 since it's now a duplicate of the other. This is more of
15355 a character than a buffer op, so better that it's in character.c.
15356 * fns.c, print.c: Adjust to above changes.
15357
2ff916cb
PE
153582011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
15359
15360 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
15361
f1b54466
PE
153622011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15363
fb1ac845
PE
15364 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15365 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
15366 (x_clipboard_manager_save): Now static.
15367 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
15368
f1b54466
PE
15369 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15370 (crypto_hash_function): Now static.
15371 Fix pointer signedness problems. Avoid unnecessary initializations.
15372
a9f737ee
CY
153732011-05-27 Chong Yidong <cyd@stupidchicken.com>
15374
15375 * termhooks.h (Vselection_alist): Make it terminal-local.
15376
15377 * terminal.c (create_terminal): Initialize it.
15378
15379 * xselect.c: Support for clipboard managers.
15380 (Vselection_alist): Move to termhooks.h as terminal-local var.
15381 (LOCAL_SELECTION): New macro.
15382 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15383 (symbol_to_x_atom): Remove gratuitous arg.
15384 (x_handle_selection_request, lisp_data_to_selection_data)
15385 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
15386 (x_own_selection, x_get_local_selection, x_convert_selection):
15387 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
15388 (some_frame_on_display): Delete unused function.
15389 (Fx_own_selection_internal, Fx_get_selection_internal)
15390 (Fx_disown_selection_internal, Fx_selection_owner_p)
15391 (Fx_selection_exists_p): New optional frame arg.
15392 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
15393 (x_handle_selection_clear): Don't treat other terminals with the
15394 same keyboard specially. Use the terminal-local Vselection_alist.
15395 (x_clear_frame_selections): Use Frun_hook_with_args.
15396
15397 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
15398
15399 * xterm.h: Add support for those atoms.
15400
e067f0c1
CY
154012011-05-26 Chong Yidong <cyd@stupidchicken.com>
15402
15403 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15404 (converted_selections, conversion_fail_tag): New global variables.
15405 (x_selection_request_lisp_error): Free the above.
15406 (x_get_local_selection): Remove unnecessary code.
15407 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
15408 of converted selections stored in converted_selections.
15409 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
15410 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15411 (x_convert_selection): New function.
15412 (x_handle_selection_event): Simplify.
15413 (x_get_foreign_selection): Don't ignore incoming requests while
15414 waiting for an answer; this will fail when we implement
15415 SAVE_TARGETS, and seems unnecessary anyway.
15416 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15417 (Vx_sent_selection_functions): Doc fix.
15418
0f4aebc0
LL
154192011-05-26 Leo Liu <sdl.web@gmail.com>
15420
15421 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
15422
e61124cd
YM
154232011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15424
15425 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15426
15427 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15428 for fringe update if it has periodic bitmap.
ac389d0c 15429 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
15430 and fringe_bitmap_periodic_p.
15431
15432 * fringe.c (get_fringe_bitmap_data): New function.
15433 (draw_fringe_bitmap_1, update_window_fringes): Use it.
15434 (update_window_fringes): Record periodicity of fringe bitmap in glyph
15435 row. Mark glyph row for fringe update if periodicity changed.
15436
15437 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15438 for fringe update unless it has periodic bitmap.
15439
f16d9837
KH
154402011-05-25 Kenichi Handa <handa@m17n.org>
15441
15442 * xdisp.c (get_next_display_element): Set correct it->face_id for
15443 a static composition.
15444
e1b90ef6
LL
154452011-05-24 Leo Liu <sdl.web@gmail.com>
15446
15447 * deps.mk (fns.o):
15448 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15449
15450 * fns.c (crypto_hash_function, Fsha1): New function.
15451 (Fmd5): Use crypto_hash_function.
15452 (syms_of_fns): Add Ssha1.
15453
7400048f
PE
154542011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15455
15456 * gnutls.c: Remove unused macros.
15457 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15458 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15459 Remove macros that are defined and never used.
15460 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15461
abb71cf4
CY
154622011-05-22 Chong Yidong <cyd@stupidchicken.com>
15463
15464 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15465 (Fx_get_selection_internal): Minor cleanup.
15466 (Fx_own_selection_internal): Rename arguments for consistency with
15467 select.el.
15468
6307db39
PE
154692011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15470
15471 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15472
f3d4e0a4
CY
154732011-05-22 Chong Yidong <cyd@stupidchicken.com>
15474
15475 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15476
4d8ade89
YM
154772011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15478
15479 * dispnew.c (scrolling_window): Don't exclude the case that the
15480 last enabled row in the desired matrix touches the bottom boundary.
15481
32078c8d
GM
154822011-05-21 Glenn Morris <rgm@gnu.org>
15483
15484 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
15485 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15486 and add some more files.
32078c8d 15487
7285dc67
EZ
154882011-05-20 Eli Zaretskii <eliz@gnu.org>
15489
15490 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15491 report_file_error introduced by the change from 2011-05-07.
15492
89d1bd22
PE
154932011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15494
15495 * systime.h (Time): Define only if emacs is defined.
15496 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15497 where the include path doesn't have X11/X.h by default. See
15498 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15499
cd394be1 155002011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
15501
15502 * composite.c (find_automatic_composition): Fix previous change.
15503
b9704ad9
GM
155042011-05-20 Glenn Morris <rgm@gnu.org>
15505
15506 * lisp.mk: New file, split from Makefile.in.
15507 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15508 (shortlisp): Remove.
15509 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15510
4a720484
GM
155112011-05-19 Glenn Morris <rgm@gnu.org>
15512
15513 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15514 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15515 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15516 (lisp): Set the order to that of loadup.el.
15517 (shortlisp): Make it a copy of $lisp.
15518 (SOME_MACHINE_LISP): Remove.
15519 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15520 Use just $shortlisp, not $SOME_MACHINE_LISP too.
15521
a28d4396
KH
155222011-05-18 Kenichi Handa <handa@m17n.org>
15523
15524 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
15525 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
15526 (find_automatic_composition): Mostly rewrite for efficiency.
15527
a2b1fa8e
JB
155282011-05-18 Juanma Barranquero <lekktu@gmail.com>
15529
15530 * makefile.w32-in: Update dependencies.
15531
8e1f5610
CS
155322011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
15533
15534 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 15535 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 15536
7025ee00 155372011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 15538
cdfa6eab
PE
15539 Fix some integer overflow issues, such as string length overflow.
15540
06d6db33
PE
15541 * insdel.c (count_size_as_multibyte): Check for string overflow.
15542
2b4560a8
PE
15543 * character.c (lisp_string_width): Check for string overflow.
15544 Use EMACS_INT, not int, for string indexes and lengths; in
15545 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
15546 the resulting string length overflows an EMACS_INT; instead,
15547 report a string overflow if no precision given. When checking for
15548 precision exhaustion, use a check that cannot possibly have
15549 integer overflow. (Bug#8675)
15550 * character.h (lisp_string_width): Adjust to new signature.
15551
cb93f9be
PE
15552 * alloc.c (string_overflow): New function.
15553 (Fmake_string): Use it. This doesn't change behavior, but saves
15554 a few bytes and will simplify future changes.
15555 * character.c (string_escape_byte8): Likewise.
15556 * lisp.h (string_overflow): New decl.
15557
1a1f3366
PE
15558 Fixups, following up to the user-interface timestamp change.
15559 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
15560 for UI timestamps, instead of unsigned long.
9fbd6841
PE
15561 * msdos.c (mouse_get_pos): Likewise.
15562 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
15563 * w32gui.h (Time): Define by including "systime.h" rather than by
15564 declaring it ourselves. (Bug#8664)
15565
d4e3e4d3
PE
15566 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
15567 * image.c (clear_image_cache): Likewise.
15568
f6a24d19
PE
15569 * term.c (term_mouse_position): Don't assume time_t wraparound.
15570
08dc5ae6
PE
15571 Be more systematic about user-interface timestamps.
15572 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
15573 and sometimes 'EMACS_UINT', to represent these timestamps.
15574 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
15575 This makes the code easier to follow, and makes it easier to catch
15576 integer overflow bugs such as Bug#8664.
15577 * frame.c (Fmouse_position, Fmouse_pixel_position):
15578 Use Time, not unsigned long, for user-interface timestamps.
15579 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
15580 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
15581 * keyboard.h (last_event_timestamp): Likewise.
15582 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15583 * menu.h (xmenu_show): Likewise.
15584 * term.c (term_mouse_position): Likewise.
15585 * termhooks.h (struct input_event.timestamp): Likewise.
15586 (struct terminal.mouse_position_hook): Likewise.
15587 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15588 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15589 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
15590 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15591 what it was before.
15592 * menu.h, termhooks.h: Include "systime.h", for Time.
15593
8e55734a
PE
15594 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15595 Don't assume that the difference between two unsigned long values
15596 can fit into an integer. At this point, we know button_down_time
15597 <= event->timestamp, so the difference must be nonnegative, so
15598 there's no need to cast the result if double-click-time is
15599 nonnegative, as it should be; check that it's nonnegative, just in
15600 case. This bug is triggered when events are more than 2**31 ms
86db42d2 15601 apart (about 25 days). (Bug#8664)
8e55734a 15602
841f1b75 15603 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 15604 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 15605
3e26f69c
PE
15606 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15607 that always fit in int. Use a sentinel instead of a counter, to
15608 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
15609 * frame.h (struct frame): Use int for menu_bar_items_used
15610 instead of EMACS_INT, since it always fits in int.
3e26f69c 15611
5cc152c0
PE
15612 * menu.c (grow_menu_items): Check for int overflow.
15613
d89eb65e
PE
15614 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15615
5235bd3e
PE
15616 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15617 Before, the code was not consistent. These values cannot exceed
15618 2**31 - 1 so there's no need to make them unsigned.
15619 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15620 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15621 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15622 as modifiers.
15623 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15624
bc827e23
PE
15625 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15626 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15627 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15628 presumably because the widths might not match.
15629
78eb494e
PE
15630 * window.c (size_window): Avoid needless test at loop start.
15631
04f2d78b
CB
156322011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
15633
15634 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15635
d2fc7e3d 156362011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
15637
15638 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15639
d2fc7e3d 156402011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
15641
15642 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15643 `width' to `bar_area_x' and `bar_area_width', respectively.
15644 (x_scroll_run): Take account of fringe background extension.
15645
04f2d78b
CB
15646 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15647 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
15648 `bar_area_width', respectively.
15649 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15650 background extension.
15651
79b70037
GM
156522011-05-10 Jim Meyering <meyering@redhat.com>
15653
15654 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15655
2f142cc5
JB
156562011-05-10 Juanma Barranquero <lekktu@gmail.com>
15657
15658 * image.c (Finit_image_library): Return t for built-in image types,
15659 like pbm and xbm. (Bug#8640)
15660
57679c86
AS
156612011-05-09 Andreas Schwab <schwab@linux-m68k.org>
15662
15663 * w32menu.c (set_frame_menubar): Fix submenu allocation.
15664
888c9e86
EZ
156652011-05-07 Eli Zaretskii <eliz@gnu.org>
15666
b0512a1d
EZ
15667 * w32console.c (Fset_screen_color): Doc fix.
15668 (Fget_screen_color): New function.
15669 (syms_of_ntterm): Defsubr it.
15670
7285dc67
EZ
15671 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15672 unlink the temporary file if Fcall_process didn't create it in the
15673 first place.
15674 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15675 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
15676 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
15677 cue to call_process_cleanup not to close that handle.
15678
4d3fcc8e
BK
156792011-05-07 Ben Key <bkey76@gmail.com>
15680
15681 * makefile.w32-in: The bootstrap-temacs rule now makes use of
15682 one of two shell specific rules, either bootstrap-temacs-CMD or
15683 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
15684 to the previous implementation of the bootstrap-temacs rule.
15685 The bootstrap-temacs-CMD rule is similar to the previous
15686 implementation of the bootstrap-temacs rule except that it
15687 makes use of the ESC_CFLAGS variable instead of the CFLAGS
15688 variable.
15689
15690 These changes, along with some changes to nt/configure.bat,
15691 nt/gmake.defs, and nt/nmake.defs, are required to extend my
15692 earlier fix to add support for --cflags and --ldflags options
15693 that include quotes so that it works whether make uses cmd or
15694 sh as the shell.
15695
b4289b64
MA
156962011-05-06 Michael Albinus <michael.albinus@gmx.de>
15697
15698 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
15699 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
15700 is a constant.
15701 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
15702 a string. Handle both cases.
15703 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
15704 (Fdbus_register_method): Use Qinvalid_function.
15705
af4c0e28
JB
157062011-05-06 Juanma Barranquero <lekktu@gmail.com>
15707
15708 * makefile.w32-in: Update dependencies.
15709 (LISP_H): Add inttypes.h and stdin.h.
15710 (PROCESS_H): Add unistd.h.
15711
c51453d9
EZ
157122011-05-06 Eli Zaretskii <eliz@gnu.org>
15713
15714 * lread.c: Include limits.h (fixes the MS-Windows build broken by
15715 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15716
8ff0ac3c 157172011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 15718
4c4b566b
PE
15719 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15720
aab2b9b5
PE
15721 * term.c (vfatal): Remove stray call to va_end.
15722 It's not needed and the C Standard doesn't allow it here anyway.
15723
c378da0b
PE
15724 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15725 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
15726
288b08c7
PE
15727 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15728 bytes.
15729
e3601888
PE
15730 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15731
db6c0e74
PE
15732 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15733
dd5963ea
PE
15734 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15735
88c9450f
PE
15736 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15737
2f9442b8
PE
15738 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15739
c032b5f8
PE
15740 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15741 * charset.c (Fdefine_charset_internal): Don't initialize
15742 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 15743 32-bit int (Bug#8600).
a108c10b
PE
15744
15745 * lread.c (read_integer): Be more consistent with string-to-number.
15746 Use string_to_number to do the actual conversion; this avoids
15747 rounding errors and fixes some other screwups. Without this fix,
15748 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15749 (digit_to_number): Move earlier, for benefit of read_integer.
15750 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 15751 not a digit in any supported base. (Bug#8602)
a108c10b 15752
ad5f9eea
PE
15753 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15754
aec1708a
PE
15755 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15756 to match comment at start of function. This also removes a
15757 GCC warning about overflow in a 32+64-bit port.
15758
47be4ab5
PE
15759 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15760
371cac43
PE
15761 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15762 Reported by Stefan Monnier in
15763 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
15764 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15765 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 15766
d01a7826
PE
15767 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15768 (EMACS_UINTPTR): Likewise, with uintptr_t.
15769
7fd47d5c
PE
15770 * lisp.h: Prefer 64-bit EMACS_INT if available.
15771 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15772 on 32-bit hosts that have 64-bit int, so that they can access
15773 large files.
122b0c86
PE
15774 However, temporarily disable this change unless the temporary
15775 symbol WIDE_EMACS_INT is defined.
7fd47d5c 15776
8727937b
PE
15777 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15778
8ac068ac
PE
15779 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15780 This removes an assumption that EMACS_INT and long are the same
15781 width as pointers. The assumption is true for Emacs porting targets
15782 now, but we want to make other targets possible.
15783 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15784 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15785 In the rest of the code, change types of integers that hold casted
15786 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15787 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15788 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15789 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15790 No need to cast type when ORing.
15791 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15792 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15793 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15794 assume EMACS_INT is the same width as char *.
15795 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15796 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15797 Remove no-longer-needed casts.
15798 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15799 (xg_tool_bar_help_callback, xg_make_tool_item):
15800 Use EMACS_INTPTR to hold an integer
15801 that will be cast to void *; this can avoid a GCC warning
15802 if EMACS_INT is not the same width as void *.
15803 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15804 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15805 (current_message_1, set_message_1):
15806 Use a local to convert to proper width without a cast.
15807 * xmenu.c (dialog_selection_callback): Likewise.
15808
ede49d71
PE
15809 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15810 Also, don't assume VALBITS / RAND_BITS is less than 5,
15811 and don't rely on undefined behavior when shifting a 1 left into
15812 the sign bit.
15813 * lisp.h (get_random): Change signature to match.
15814
2f30ecd0
PE
15815 * lread.c (hash_string): Use size_t, not int, for hash computation.
15816 Normally we prefer signed values; but hashing is special, because
15817 it's better to use unsigned division on hash table sizes so that
15818 the remainder is nonnegative. Also, size_t is the natural width
15819 for hashing into memory. The previous code used 'int', which doesn't
15820 retain enough info to hash well into very large tables.
15821 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15822
2a866e7b
PE
15823 * dbusbind.c: Don't possibly lose pointer info when converting.
15824 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15825 Use XPNTR rather than XHASH, so that the high-order bits of
15826 the pointer aren't lost when converting through void *.
15827
51639eac
PE
15828 * eval.c (Fautoload): Don't double-shift a pointer.
15829
92394119
PE
15830 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15831
dbdb9a7c
JB
158322011-05-06 Juanma Barranquero <lekktu@gmail.com>
15833
15834 * gnutls.c (DEF_GNUTLS_FN):
15835 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15836
db7a0b4f
AS
158372011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15838
15839 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15840 marker. (Bug#8610)
15841
cd394be1 158422011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
15843
15844 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15845 New version that can reserve upto 2GB of heap space.
15846
f7ff1b0f 158472011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
15848
15849 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15850
639c109b
TZ
158512011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15852
15853 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15854 `gnutls_certificate_set_x509_key_file'.
15855
d2127135
JB
158562011-05-05 Juanma Barranquero <lekktu@gmail.com>
15857
15858 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15859 Update dependencies.
15860
e968f4f3
JB
158612011-05-04 Juanma Barranquero <lekktu@gmail.com>
15862
15863 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15864 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15865 Remove unused parameter `fildes'.
15866 * process.c (read_process_output, send_process): Don't pass it.
15867
84d358f0
JB
158682011-05-04 Juanma Barranquero <lekktu@gmail.com>
15869
15870 Fix previous change: the library cache is defined in w32.c.
15871 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15872 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15873
0898ca10
JB
158742011-05-04 Juanma Barranquero <lekktu@gmail.com>
15875
15876 Implement dynamic loading of GnuTLS on Windows.
15877
15878 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15879 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15880 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15881 Declare.
15882
15883 * gnutls.c (Qgnutls_dll): Define.
15884 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15885 (gnutls_*): Declare function pointers.
15886 (init_gnutls_functions): New function to initialize function pointers.
15887 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15888 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15889 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15890 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15891 (emacs_gnutls_write, emacs_gnutls_read)
15892 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15893 (Fgnutls_available_p): New function.
15894 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15895 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15896 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15897
15898 * image.c: Include w32.h.
15899 (Vimage_type_cache): Delete.
15900 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15901 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15902 (w32_delayed_load): Move to w32.c.
15903
15904 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15905
15906 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15907 (w32_delayed_load): Move from image.c. When loading a library, record
15908 its filename in the :loaded-from property of the library id.
15909 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15910 Initialize and staticpro them.
15911 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15912
15913 * process.c: Include lisp.h before w32.h, not after.
15914 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15915 instead of gnutls_record_check_pending.
15916
15917 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15918
ff4de4aa
TZ
159192011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15920
15921 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15922 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15923 as passed in.
15924
abe95abb
JD
159252011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15926
15927 * xterm.c (x_set_frame_alpha): Do not set property on anything
15928 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15929
e16e55d4
JB
159302011-05-02 Juanma Barranquero <lekktu@gmail.com>
15931
15932 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15933
bafcf6a5
JB
159342011-05-02 Juanma Barranquero <lekktu@gmail.com>
15935
15936 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15937 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15938 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15939 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15940 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15941 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15942 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15943 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15944 (Qgnutls_bootprop_callbacks_verify): Make static.
15945
e7a6747f
AS
159462011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15947
19ed11ba
AS
15948 * callproc.c: Indentation fixup.
15949
e7a6747f 15950 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
15951 (wait_for_termination, interruptible_wait_for_termination):
15952 Move after wait_for_termination_1.
e7a6747f 15953
1ef14cb4
LMI
159542011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15955
15956 * sysdep.c (interruptible_wait_for_termination): New function
15957 which is like wait_for_termination, but allows keyboard
15958 interruptions.
15959
15960 * callproc.c (Fcall_process): Add (:file "file") as an option for
15961 the STDOUT buffer.
15962 (Fcall_process_region): Ditto.
15963
330d880c
EZ
159642011-04-30 Eli Zaretskii <eliz@gnu.org>
15965
8db90b73
EZ
15966 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15967 rather than `XVECTOR (FOO)->size'.
15968
330d880c
EZ
15969 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15970 inttypes.h, as a gnulib replacement is used if it not available in
15971 system headers.
15972
15cbd324
EZ
159732011-04-21 Eli Zaretskii <eliz@gnu.org>
15974
15975 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15976 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15977 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15978
15979 * coding.c (coding_alloc_by_realloc): Error out if destination
15980 will grow beyond MOST_POSITIVE_FIXNUM.
15981 (decode_coding_emacs_mule): Abort if there isn't enough place in
15982 charbuf for the composition carryover bytes. Reserve an extra
15983 space for up to 2 characters produced in a loop.
15984 (decode_coding_iso_2022): Abort if there isn't enough place in
15985 charbuf for the composition carryover bytes.
15986
159872011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 15988
ae940cca
EZ
15989 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15990 aborting when %lld or %lll format is passed.
15991 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15992 %llo or %llx format is passed. (Bug#8545)
15993
03ab8921
EZ
15994 * window.c (window_scroll_line_based): Use a marker instead of
15995 simple variables to record original value of point. (Bug#7952)
15996
afda1437
EZ
15997 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15998 produced by %s or %c overflows available buffer space. (Bug#8545)
15999
f76dee0c
PE
160002011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16001
16002 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 16003 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 16004
fdc5744d
JB
160052011-04-28 Juanma Barranquero <lekktu@gmail.com>
16006
16007 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16008
638f053a
JB
160092011-04-28 Juanma Barranquero <lekktu@gmail.com>
16010
16011 * keyboard.c (Qdelayed_warnings_hook): Define.
16012 (command_loop_1): Run `delayed-warnings-hook'
16013 if Vdelayed_warnings_list is non-nil.
16014 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16015 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16016
d178f871
EZ
160172011-04-28 Eli Zaretskii <eliz@gnu.org>
16018
16019 * doprnt.c (doprnt): Don't return value smaller than the buffer
16020 size if the message was truncated. (Bug#8545).
16021
b124fd93
JB
160222011-04-28 Juanma Barranquero <lekktu@gmail.com>
16023
16024 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16025 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16026
e810457d
PE
160272011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16028
16029 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16030
ea51cceb
JB
160312011-04-27 Juanma Barranquero <lekktu@gmail.com>
16032
16033 * makefile.w32-in: Update dependencies.
16034
94dcfacf
EZ
160352011-04-27 Eli Zaretskii <eliz@gnu.org>
16036
16037 Improve `doprnt' and its usage. (Bug#8545)
16038 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16039 `format_end'. Remove support for %l as a conversion specifier.
16040 Don't use xrealloc. Improve diagnostics when the %l size modifier
16041 is used. Update the commentary.
16042
16043 * eval.c (verror): Simplify calculation of size_t.
16044
16045 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16046 messages.
16047
f61f41d7
PE
160482011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16049
16050 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16051 change.
16052
96fb4434
PE
160532011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16054
16055 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16056 This makes this file independent of the recent pseudovector change.
16057
671875da 160582011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 16059
69e9b5a3
PE
16060 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16061
b5f869a7 16062 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 16063 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 16064 Remove unused local.
c8926152 16065 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 16066
841a1577 16067 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
16068 GCC 4.6.0 optimizes based on type-based alias analysis.
16069 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
16070 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16071 != &v->size, and therefore "v->size = 1; b->size = 2; return
16072 v->size;" must therefore return 1. This assumption is incorrect
16073 for Emacs, since it type-puns struct Lisp_Vector * with many other
16074 types. To fix this problem, this patch adds a new type struct
f904488f 16075 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
16076 and pseudovectors, and helps optimizing compilers not get fooled
16077 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16078 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
16079 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16080 the size member.
eab3844f
PE
16081 (XSETPVECTYPE): Rewrite in terms of new macro.
16082 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16083 This is a bit clearer, and further avoids the possibility of
16084 undesirable aliasing.
16085 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 16086 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
16087 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16088 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
16089 (ASIZE): Now uses header.size rather than size.
16090 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
16091 to avoid the hassle of writing XVECTOR (foo)->header.size.
16092 (struct vectorlike_header): New type.
eab3844f
PE
16093 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16094 object, to help avoid aliasing.
16095 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16096 (SUBRP): Likewise, since Lisp_Subr is a special case.
16097 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16098 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16099 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 16100 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
16101 changed to be "header.size" and "header.next".
16102 * buffer.h (struct buffer): Likewise.
16103 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16104 * frame.h (struct frame): Likewise.
16105 * process.h (struct Lisp_Process): Likewise.
16106 * termhooks.h (struct terminal): Likewise.
16107 * window.c (struct save_window_data, struct saved_window): Likewise.
16108 * window.h (struct window): Likewise.
16109 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16110 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16111 * buffer.c (init_buffer_once): Likewise.
16112 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16113 special case.
16114 * process.c (Fformat_network_address): Use local var for size,
16115 for brevity.
16116
0df1eac5
PE
16117 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16118
847ab9d1 16119 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
16120 * data.c (atof): Remove decl; no longer used or needed.
16121 (digit_to_number): Move to lread.c.
16122 (Fstring_to_number): Use new string_to_number function, to be
16123 consistent with how the Lisp reader treats infinities and NaNs.
16124 Do not assume that floating-point numbers represent EMACS_INT
16125 without losing information; this is not true on most 64-bit hosts.
16126 Avoid double-rounding errors, by insisting on integers when
16127 parsing non-base-10 numbers, as the documentation specifies.
16128 * lisp.h (string_to_number): New decl, replacing ...
16129 (isfloat_string): Remove.
bc0a5c13 16130 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 16131 (read1): Do not accept +. and -. as integers; this
452f4150
PE
16132 appears to have been a coding error. Similarly, do not accept
16133 strings like +-1e0 as floating point numbers. Do not report
16134 overflow for integer overflows unless the base is not 10 which
16135 means we have no simple and reliable way to continue.
16136 Break out the floating-point parsing into a new
16137 function string_to_number, so that Fstring_to_number parses
16138 floating point numbers consistently with the Lisp reader.
04f2d78b 16139 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
16140 (E_CHAR, EXP_INT): Remove, replacing with ...
16141 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16142 (string_to_number): New function, replacing isfloat_string.
16143 This function checks for valid syntax and produces the resulting
16144 Lisp float number too. Rework it so that string-to-number
bc0a5c13 16145 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
16146 so that overflow for non-base-10 numbers is reported only when
16147 there's no portable and simple way to convert to floating point.
452f4150 16148
67769ffc
PE
16149 * textprop.c (set_text_properties_1): Rewrite for clarity,
16150 and to avoid GCC warning about integer overflow.
16151
c20db43f
PE
16152 * intervals.h (struct interval): Use EMACS_INT for members
16153 where EMACS_UINT might cause problems. See
16154 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16155 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16156 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16157 All uses changed.
37aa2f85
PE
16158 (offset_intervals): Tell GCC not to worry about length overflow
16159 when negating a negative length.
c20db43f 16160
2538aa2f
PE
16161 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16162 (overrun_check_free): Likewise.
16163
f2d3008d
PE
16164 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16165 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16166 word size.
16167
ec8df744
PE
16168 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16169 (gnutls_make_error): Rename local to avoid shadowing.
16170 (gnutls_emacs_global_deinit): ifdef out; not used.
16171 (Fgnutls_boot): Use const for pointer to readonly storage.
16172 Comment out unused local. Fix pointer signedness problems.
16173
640ee02d
PE
16174 * lread.c (openp): Don't stuff size_t into an 'int'.
16175 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16176 about possible signed overflow.
16177
6048fb2a
PE
16178 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16179 (GDK_KEY_g): Don't define if already defined.
16180 (xg_prepare_tooltip): Avoid pointer signedness problem.
16181 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
16182
fa3c87e1
PE
16183 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
16184 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
16185
2172544b
PE
16186 * xfns.c (Fx_window_property): Simplify a bit,
16187 to make a bit faster and to avoid GCC 4.6.0 warning.
16188 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
16189
9b821a21
PE
16190 * fns.c (internal_equal): Don't assume size_t fits in int.
16191
3c616cfa
PE
16192 * alloc.c (compact_small_strings): Tighten assertion a little.
16193
c2982e87
PE
16194 Replace pEd with more-general pI, and fix some printf arg casts.
16195 * lisp.h (pI): New macro, generalizing old pEd macro to other
16196 conversion specifiers. For example, use "...%"pI"d..." rather
16197 than "...%"pEd"...".
16198 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 16199 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
16200 * alloc.c (check_pure_size): Don't overflow by converting size to int.
16201 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
16202 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
16203 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
16204 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
16205 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
16206 64-bit hosts.
16207 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
16208 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
16209 * print.c (safe_debug_print, print_object): Likewise.
16210 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
16211 to int.
6f04d126
PE
16212 Use pI instead of if-then-else-abort. Use %p to avoid casts,
16213 avoiding the 0 flag, which is not portable.
c2982e87
PE
16214 * process.c (Fmake_network_process): Use pI to avoid cast.
16215 * region-cache.c (pp_cache): Likewise.
16216 * xdisp.c (decode_mode_spec): Likewise.
16217 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
16218 behavior on 64-bit hosts with printf arg.
6f04d126 16219 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
16220 (x_stop_queuing_selection_requests): Likewise.
16221 (x_get_window_property): Don't truncate byte count to an 'int'
16222 when tracing.
0b432f21 16223
5e073ec7
PE
16224 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
16225 here, since it parses constructs like leading '-' and spaces,
16226 which are not wanted; and it overflows with large numbers.
16227 Instead, simply match F[0-9]+, which is what is wanted anyway.
16228
36372bf9
PE
16229 * alloc.c: Remove unportable assumptions about struct layout.
16230 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
16231 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
16232 (allocate_vectorlike, make_pure_vector): Use the new macros,
16233 plus offsetof, to remove unportable assumptions about struct layout.
16234 These assumptions hold on all porting targets that I know of, but
16235 they are not guaranteed, they're easy to remove, and removing them
16236 makes further changes easier.
16237
0b432f21
PE
16238 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
16239 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
16240 (string_overrun_cookie): Now const. Use initializers that
16241 don't formally overflow signed char, to avoid warnings.
000098c1
PE
16242 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
16243 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
16244 (allocate_buffer): Don't assume sizeof (struct buffer) is a
16245 multiple of sizeof (EMACS_INT); it need not be, if
16246 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 16247 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 16248
895009e1
JB
162492011-04-26 Juanma Barranquero <lekktu@gmail.com>
16250
16251 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
16252
6a7a1b0b
TZ
162532011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
16254
16255 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 16256 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
16257 Reported by Paul Eggert <eggert@cs.ucla.edu>.
16258
841a1577 162592011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
16260
16261 * lisp.h (Qdebug): List symbol.
895009e1 16262 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
16263 * keyboard.c (debug-on-event): New variable.
16264 (handle_user_signal): Break into debugger when debug-on-event
16265 matches the current signal symbol.
16266
f2d3ba6f
DN
162672011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
16268
16269 * alloc.c (check_sblock, check_string_bytes)
16270 (check_string_free_list): Convert to standard C.
16271
42ce4c63
TZ
162722011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
16273
16274 * w32.c (emacs_gnutls_push): Fix typo.
16275
825cd63c
EZ
162762011-04-25 Eli Zaretskii <eliz@gnu.org>
16277
fb11d64d
EZ
16278 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
16279 "cast to pointer from integer of different size".
16280
825cd63c
EZ
16281 Improve doprnt and its use in verror. (Bug#8545)
16282 * doprnt.c (doprnt): Document the set of format control sequences
16283 supported by the function. Use SAFE_ALLOCA instead of always
16284 using `alloca'.
16285
16286 * eval.c (verror): Don't limit the buffer size at size_max-1, that
16287 is one byte too soon. Don't use xrealloc; instead xfree and
16288 xmalloc anew.
16289
e061a11b
TZ
162902011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
16291
16292 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
16293 callbacks stage.
16294
16295 * gnutls.c: Renamed global_initialized to
16296 gnutls_global_initialized. Added internals for the
16297 :verify-hostname-error, :verify-error, and :verify-flags
16298 parameters of `gnutls-boot' and documented those parameters in the
16299 docstring. Start callback support.
9173deec
JB
16300 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
16301 unless a fatal error occurred. Call gnutls_alert_send_appropriate
16302 on error. Return error code.
e061a11b
TZ
16303 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
16304 (emacs_gnutls_read): Likewise.
16305 (Fgnutls_boot): Return handshake error code.
16306 (emacs_gnutls_handle_error): New function.
16307 (wsaerror_to_errno): Likewise.
16308
16309 * w32.h (emacs_gnutls_pull): Add prototype.
16310 (emacs_gnutls_push): Likewise.
16311
16312 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
16313 (emacs_gnutls_push): Likewise.
16314
163152011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
16316
16317 * process.c (wait_reading_process_output): Check if GnuTLS
16318 buffered some data internally if no FDs are set for TLS
16319 connections.
16320
16321 * makefile.w32-in (OBJ2): Add gnutls.$(O).
16322 (LIBS): Link to USER_LIBS.
16323 ($(BLD)/gnutls.$(0)): New target.
16324
fa6996bc
EZ
163252011-04-24 Eli Zaretskii <eliz@gnu.org>
16326
eb35682e
EZ
16327 * xdisp.c (handle_single_display_spec): Rename the
16328 display_replaced_before_p argument into display_replaced_p, to
16329 make it consistent with the commentary. Fix typos in the
16330 commentary.
16331
e2ad650c
EZ
16332 * textprop.c (syms_of_textprop): Remove dead code.
16333 (copy_text_properties): Delete obsolete commentary about an
16334 interface that was deleted long ago. Fix typos in the description
16335 of arguments.
16336
1b2de274
EZ
16337 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
16338 to changes in oldXMenu/XMenu.h from 2011-04-16.
16339 <menu_help_message, prev_menu_help_message>: Constify.
16340 (IT_menu_make_room): menu->help_text is now `const char **';
16341 adjust.
16342
16343 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
16344 to changes in oldXMenu/XMenu.h from 2011-04-16.
16345 (struct XMenu): Declare `help_text' `const char **'.
16346
16347 * xfaces.c <Qunspecified>: Make extern again.
16348
16349 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 16350 required by POSIX.
1b2de274 16351
762b15be
EZ
16352 * doc.c (get_doc_string): Improve the format passed to `error'.
16353
16354 * doprnt.c (doprnt): Improve commentary.
16355
16356 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
16357
16358 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
16359 them with etags.
16360
f1052e5d
EZ
16361 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
16362 changes in globals.h immediately force recompilation.
762b15be
EZ
16363 (TAGS): Depend on $(CURDIR)/m/intel386.h and
16364 $(CURDIR)/s/ms-w32.h.
16365 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 16366
fa6996bc
EZ
16367 * character.c (Fchar_direction): Function deleted.
16368 (syms_of_character): Don't defsubr it.
16369 <char-direction-table>: Deleted.
16370
e6c3da20
EZ
163712011-04-23 Eli Zaretskii <eliz@gnu.org>
16372
16373 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
16374 * doprnt.c: Include limits.h.
16375 (SIZE_MAX): New macro.
04f2d78b
CB
16376 (doprnt): Return a size_t value. 2nd arg is now size_t.
16377 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
16378 Improve overflow protection. Support `l' modifier for integer
16379 conversions. Support %l conversion. Don't assume an EMACS_INT
16380 argument for integer conversions and for %c.
16381
16382 * lisp.h (doprnt): Restore prototype.
16383
16384 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16385 $(SRC)/character.h.
16386
16387 * Makefile.in (base_obj): Add back doprnt.o.
16388
16389 * deps.mk (doprnt.o): Add back prerequisites.
16390 (callint.o): Depend on character.h.
16391
16392 * eval.c (internal_lisp_condition_case): Include the handler
16393 representation in the error message.
16394 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
16395 when breaking from the loop.
16396
16397 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
16398
16399 * callint.c (Fcall_interactively): When displaying error message
16400 about invalid control letter, pass the character's codepoint, not
16401 a pointer to its multibyte form. Improve display of the character
16402 in octal and display also its hex code.
16403
16404 * character.c (char_string): Use %x to display the (unsigned)
16405 codepoint of an invalid character, to avoid displaying a bogus
16406 negative value.
16407
16408 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16409 `error', not SYMBOL_NAME itself.
16410
16411 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16412 character arguments to `error'.
16413
16414 * charset.c (check_iso_charset_parameter): Fix incorrect argument
16415 to `error' in error message about FINAL_CHAR argument. Make sure
16416 FINAL_CHAR is a character, and use %c when it is passed as
16417 argument to `error'.
16418
4ffd0d6b 164192011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
16420
16421 * s/ms-w32.h (localtime): Redirect to sys_localtime.
16422
16423 * w32.c: Include <time.h>.
16424 (sys_localtime): New function.
16425
4ffd0d6b 164262011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
16427
16428 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16429
4ffd0d6b 16430 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 16431
4ffd0d6b 164322011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 16433
4ffd0d6b
GM
16434 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16435 zombies (Bug#8467).
aac0c6e3 16436
04c56954
EZ
164372011-04-19 Eli Zaretskii <eliz@gnu.org>
16438
16439 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16440 gl_state.e_property when gl_state.object is Qt.
16441
16442 * insdel.c (make_gap_larger): Remove limitation of buffer size
16443 to <= INT_MAX.
16444
16a43933
CY
164452011-04-18 Chong Yidong <cyd@stupidchicken.com>
16446
16447 * xdisp.c (lookup_glyphless_char_display)
16448 (produce_glyphless_glyph): Handle cons cell entry in
16449 glyphless-char-display.
16450 (Vglyphless_char_display): Document it.
16451
16452 * term.c (produce_glyphless_glyph): Handle cons cell entry in
16453 glyphless-char-display.
16454
4581706e
CY
164552011-04-17 Chong Yidong <cyd@stupidchicken.com>
16456
16457 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16458
16459 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16460
16461 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16462 definition for no-X builds.
16463
4887c6e2 164642011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 16465
fd35b6f9
PE
16466 Static checks with GCC 4.6.0 and non-default toolkits.
16467
5c1ccb01
PE
16468 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16469
006c5daa
PE
16470 * process.c (keyboard_bit_set): Define only if SIGIO.
16471 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16472 (send_process): Repair possible setjmp clobbering.
16473
efc736d3
PE
16474 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16475
4e2fe2e6
PE
16476 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16477
f97334a2
PE
16478 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16479
4e75f29d
PE
16480 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16481 Define only if needed.
16482
90efadd1
PE
16483 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16484 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 16485 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 16486
3c647824
PE
16487 * dispextern.h (struct redisplay_interface): Rename param
16488 to avoid shadowing.
e264f262 16489 * termhooks.h (struct terminal): Likewise.
761383f4 16490 * xterm.c (xembed_send_message): Likewise.
3c647824 16491
b58c5c4a
PE
16492 * insdel.c (make_gap_smaller): Define only if
16493 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16494
cad59032
PE
16495 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16496 it.
16497
c339dc2e
PE
16498 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16499 so that we aren't warned about unused symbols.
16500
91a3e27b
PE
16501 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16502
399c71d3 16503 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 16504
8ffc96f5
PE
16505 * xfns.c (x_real_positions): Mark locals as initialized.
16506
eef9bc79
PE
16507 * xmenu.c (xmenu_show): Don't use uninitialized vars.
16508
098db9dd
PE
16509 * xterm.c: Fix problems found by static analysis with other toolkits.
16510 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
16511 (x_dispatch_event): Declare static if USE_GTK, and
16512 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 16513 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 16514 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
16515 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16516 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 16517
eb18f6cc
PE
16518 * xmenu.c (menu_help_callback): Pointer type fixes.
16519 Use const pointers when pointing at readonly data. Avoid pointer
16520 signedness clashes.
16521 (FALSE): Remove unused macro.
16522 (update_frame_menubar): Remove unused decl.
16523
1fe72bf8
PE
16524 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
16525
60d9e1db
PE
16526 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
16527 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
16528 (single_menu_item): Rename local to avoid shadowing.
16529
39261c26
PE
16530 * keyboard.c (make_lispy_event): Remove unused local var.
16531
018c5e19
PE
16532 * frame.c, frame.h (x_get_resource_string): Bring this back, but
16533 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
16534
63d2b86e
PE
16535 * bitmaps: Change bitmaps from unsigned char back to the X11
16536 compatible char. Avoid the old compiler warnings about
16537 out-of-range initializers by using, for example, '\xab' rather
16538 than 0xab.
16539
aefd87e1
PE
16540 * xgselect.c (xgselect_initialize): Check vs interface
16541 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
16542
bf501fb9
PE
16543 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
16544
e9829fdf
PE
16545 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
16546 to read-only memory.
16547
1086c095
PE
16548 * fns.c (vector): Remove; this old hack is no longer needed.
16549
2baccd04 16550 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 16551 Remove unused var.
dde42981 16552 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 16553
72391843 16554 * xrdb.c (x_load_resources): Omit unused local.
3565b346 16555
436c16df 16556 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 16557 (x_window): Rename locals to avoid shadowing.
dc5ddd85 16558 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 16559
92bb796d 16560 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 16561 (x_term_init): Remove local to avoid shadowing.
92bb796d 16562
764430a3 16563 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
16564
16565 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
16566 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
16567
d1dfb56c
EZ
165682011-04-16 Eli Zaretskii <eliz@gnu.org>
16569
c4354cb4
EZ
16570 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
16571
d1dfb56c
EZ
16572 Fix regex.c, syntax.c and friends for buffers > 2GB.
16573 * syntax.h (struct gl_state_s): Declare character position members
16574 EMACS_INT.
16575
16576 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
16577
04f2d78b
CB
16578 * textprop.c (verify_interval_modification, interval_of):
16579 Declare arguments EMACS_INT.
d1dfb56c
EZ
16580
16581 * intervals.c (adjust_intervals_for_insertion): Declare arguments
16582 EMACS_INT.
16583
16584 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
16585
16586 * indent.c (Fvertical_motion): Local variable it_start is now
16587 EMACS_INT.
16588
16589 * regex.c (re_match, re_match_2, re_match_2_internal)
16590 (bcmp_translate, regcomp, regexec, print_double_string)
16591 (group_in_compile_stack, re_search, re_search_2, regex_compile)
16592 (re_compile_pattern, re_exec): Declare arguments and local
16593 variables `size_t' and `ssize_t' and return values `regoff_t', as
16594 appropriate.
16595 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16596 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16597 <compile_stack_type>: `size' and `avail' are now `size_t'.
16598
16599 * regex.h <regoff_t>: Use ssize_t, not int.
16600 (re_search, re_search_2, re_match, re_match_2): Arguments that
16601 specify buffer/string position and length are now ssize_t and
16602 size_t. Return type is regoff_t.
16603
613052cd
BK
166042011-04-16 Ben Key <bkey76@gmail.com>
16605
16606 * nsfont.m: Fixed bugs in ns_get_family and
16607 ns_descriptor_to_entity that were caused by using free to
16608 deallocate memory blocks that were allocated by xmalloc (via
16609 xstrdup). This caused Emacs to crash when compiled with
16610 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16611 --enable-checking=xmallocoverrun). xfree is now used to
16612 deallocate these memory blocks.
16613
4170f62f 166142011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 16615
71b41406
PE
16616 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16617
9587a89d
PE
16618 emacs_write: Accept and return EMACS_INT for sizes.
16619 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16620 et seq.
16621 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16622 Accept and return EMACS_INT.
16623 (emacs_gnutls_write): Return the number of bytes written on
16624 partial writes.
16625 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
16626 (emacs_read, emacs_write): Remove check for negative size, as the
16627 Emacs source code has been audited now.
9587a89d
PE
16628 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16629 (emacs_read, emacs_write): Use it.
273a5f82
PE
16630 * process.c (send_process): Adjust to the new signatures of
16631 emacs_write and emacs_gnutls_write. Do not attempt to store
16632 a byte offset into an 'int'; it might overflow.
9587a89d 16633 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 16634
3e047f51
PE
16635 * sound.c: Don't assume sizes fit in 'int'.
16636 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 16637 Return EMACS_INT, not int.
3e047f51 16638 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
16639 Accept EMACS_INT, not int.
16640 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
16641 record read return values.
16642
cc39a9db
BK
166432011-04-15 Ben Key <bkey76@gmail.com>
16644
c9d0ec6d
JB
16645 * keyboard.c (Qundefined): Don't declare static since it is used
16646 in nsfns.m.
16647 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16648 static since they are used in nsfont.m.
cc39a9db 16649
6c60eb9f
SM
166502011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
16651
16652 * process.c (Qprocessp): Don't declare static.
16653 * lisp.h (Qprocessp): Declare again.
16654
7990b61a
JB
166552011-04-15 Juanma Barranquero <lekktu@gmail.com>
16656
16657 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16658
5d4cb038
PE
166592011-04-14 Paul Eggert <eggert@cs.ucla.edu>
16660
8bd7b830 16661 Improve C-level modularity by making more things 'static'.
cd64ea1d 16662
e3b27b31
PE
16663 Don't publish debugger-only interfaces to other modules.
16664 * lisp.h (safe_debug_print, debug_output_compilation_hack):
16665 (verify_bytepos, count_markers): Move decls to the only modules
16666 that need them.
16667 * region-cache.h (pp_cache): Likewise.
16668 * window.h (check_all_windows): Likewise.
16669 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16670
5d4cb038
PE
16671 * sysdep.c (croak): Now static, if
16672 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16673 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
16674
16675 * alloc.c (refill_memory_reserve): Now static if
16676 !defined REL_ALLOC || defined SYSTEM_MALLOC.
16677 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 16678
e87b6180
PE
16679 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
16680 Define only if USE_LUCID.
16681
ac64929e
PE
16682 * xrdb.c (x_customization_string, x_rm_string): Now static.
16683
6f37259d
PE
16684 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
16685 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
16686
1683e3ab
PE
16687 * xdisp.c (draw_row_with_mouse_face): Now static.
16688 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
16689
de9c2632
PE
16690 * window.h (check_all_windows): Mark externally visible.
16691
2b96acb7
PE
16692 * window.c (window_deletion_count): Now static.
16693
16694 * undo.c: Make symbols static if they're not exported.
16695 (last_undo_buffer, last_boundary_position, pending_boundary):
16696 Now static.
16697
50436f33
PE
16698 * textprop.c (interval_insert_behind_hooks): Now static.
16699 (interval_insert_in_front_hooks): Likewise.
16700
64520e5c
PE
16701 * term.c: Make symbols static if they're not exported.
16702 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
16703 (max_frame_lines, tty_set_terminal_modes):
16704 (tty_reset_terminal_modes, tty_turn_off_highlight):
16705 (get_tty_terminal): Now static.
16706 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
16707 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 16708 HAVE_WINDOW_SYSTEM.
64520e5c
PE
16709 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16710 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16711
1fa53021
PE
16712 * sysdep.c: Make symbols static if they're not exported.
16713 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16714 Now static.
16715 (sigprocmask_set, full_mask): Remove; unused.
16716 (wait_debugging): Mark as visible.
16717 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16718 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16719
d4b43b22
PE
16720 * syntax.c (syntax_temp): Define only if !__GNUC__.
16721
b7c513d0
PE
16722 * sound.c (current_sound_device, current_sound): Now static.
16723
989b29ad
PE
16724 * search.c (searchbufs, searchbuf_head): Now static.
16725
13a55a78
PE
16726 * scroll.c (scroll_cost): Remove; unused.
16727 * dispextern.h (scroll_cost): Remove decl.
16728
de68a1fc
PE
16729 * region-cache.h (pp_cache): Mark as externally visible.
16730
40ccffa6
PE
16731 * process.c: Make symbols static if they're not exported.
16732 (process_tick, update_tick, create_process, chan_process):
16733 (Vprocess_alist, proc_buffered_char, datagram_access):
16734 (fd_callback_data, send_process_frame, process_sent_to): Now static.
16735 (deactivate_process): Mark defn as static, as well as decl.
16736 * lisp.h (create_process): Remove decl.
16737 * process.h (chan_process, Vprocess_alist): Remove decls.
16738
ad64fc97
PE
16739 * print.c: Make symbols static if they're not exported.
16740 (print_depth, new_backquote_output, being_printed, print_buffer):
16741 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16742 (print_interval, print_number_index, initial_stderr_stream):
16743 Now static.
16744 * lisp.h (Fprinc): Remove decl.
16745 (debug_output_compilation_hack): Mark as externally visible.
16746
adddb265
PE
16747 * sysdep.c (croak): Move decl from here to syssignal.h.
16748 * syssignal.h (croak): Put it here, so the API can be checked when
16749 'croak' is called from dissociate_if_controlling_tty.
16750
1717ede2
PE
16751 * minibuf.c: Make symbols static if they're not exported.
16752 (minibuf_save_list, choose_minibuf_frame): Now static.
16753 * lisp.h (choose_minibuf_frame): Remove decl.
16754
fa5fb2bc
PE
16755 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16756
1e3890d1
PE
16757 * lread.c: Make symbols static if they're not exported.
16758 (read_objects, initial_obarray, oblookup_last_bucket_number):
16759 Now static.
16760 (make_symbol): Remove; unused.
16761 * lisp.h (initial_obarray, make_symbol): Remove decls.
16762
8a1414fa
PE
16763 * keyboard.c: Make symbols static if they're not exported.
16764 (single_kboard, recent_keys_index, total_keys, recent_keys):
16765 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16766 (this_single_command_key_start, echoing, last_auto_save):
16767 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16768 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16769 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16770 (Vlispy_mouse_stem, double_click_count):
16771 Now static.
16772 (force_auto_save_soon): Define only if SIGDANGER.
16773 (ignore_mouse_drag_p): Now static if
16774 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16775 (print_help): Remove; unused.
16776 (stop_character, last_timer_event): Mark as externally visible.
16777 * keyboard.h (ignore_mouse_drag_p): Declare only if
16778 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16779 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16780 * lisp.h (echoing): Remove decl.
16781 (force_auto_save_soon): Declare only if SIGDANGER.
16782 * xdisp.c (redisplay_window): Simplify code, to make it more
16783 obvious that ignore_mouse_drag_p is not accessed if !defined
16784 USE_GTK && !defined HAVE_NS.
16785
93ea6e8f
PE
16786 * intervals.c: Make symbols static if they're not exported.
16787 (merge_properties_sticky, merge_interval_right, delete_interval):
16788 Now static.
16789 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16790
77382fcc
PE
16791 * insdel.c: Make symbols static if they're not exported.
16792 However, leave prepare_to_modify_buffer alone. It's never
16793 called from outside this function, but that appears to be a bug.
16794 (combine_after_change_list, combine_after_change_buffer):
4889fc82 16795 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
16796 (adjust_after_replace_noundo): Remove; unused.
16797 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 16798 (signal_before_change): Remove decls.
77382fcc 16799
9306c32e
PE
16800 * indent.c (val_compute_motion, val_vmotion): Now static.
16801
cd44d2eb
PE
16802 * image.c: Make symbols static if they're not exported.
16803 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16804 if USE_GTK.
16805 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16806 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16807
ad9a7a06
PE
16808 * fringe.c (standard_bitmaps): Now static.
16809 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16810
81626931
PE
16811 * frame.c: Make symbols static if they're not exported.
16812 (x_report_frame_params, make_terminal_frame): Now static.
16813 (get_frame_param): Now static, unless HAVE_NS.
16814 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16815 (x_get_resource_string): Remove; not used.
16816 * frame.h (make_terminal_frame, x_report_frame_params):
16817 (x_get_resource_string); Remove decls.
16818 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16819 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16820
239f9db9
PE
16821 * font.c, fontset.c: Make symbols static if they're not exported.
16822 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16823 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16824 * font.c (font_close_object): Now static.
16825 * font.h (font_close_object): Remove.
16826 * fontset.c (FONTSET_OBJLIST): Remove.
16827 (free_realized_fontset) #if-0 the body, which does nothing.
16828 (face_suitable_for_char_p): #if-0, as it's never called.
16829 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
16830 * xfaces.c (face_at_string_position):
16831 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
16832 since 0 is always ASCII.
16833
dfcf3579
PE
16834 * fns.c (weak_hash_tables): Now static.
16835
5045092b
PE
16836 * fileio.c: Make symbols static if they're not exported.
16837 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16838 (Vwrite_region_annotation_buffers): Now static.
16839
57a96f5c
PE
16840 * eval.c: Make symbols static if they're not exported.
16841 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16842 * lisp.h (backtrace_list): Remove decl.
16843
35f08c38
PE
16844 * emacs.c: Make symbols static if they're not exported.
16845 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16846 (fatal_error_code, fatal_error_signal_hook, standard_args):
16847 Now static.
16848 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16849 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16850 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16851 * lisp.h (fatal_error_signal_hook): Remove decl.
16852 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16853
f44bd759
PE
16854 * editfns.c: Move a (normally-unused) function to its only use.
16855 * editfns.c, lisp.h (get_operating_system_release): Remove.
16856 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16857 worth the hassle of breaking this out.
16858
b532497d
PE
16859 * xterm.c: Make symbols static if they're not exported.
16860 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16861 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16862 (x_destroy_window, x_delete_display):
16863 Now static.
16864 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16865 (x_mouse_leave): Remove; unused.
16866 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16867 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16868 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16869 Remove decls.
16870 (x_mouse_leave): Declare only if WINDOWSNT.
16871 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16872 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16873 USE_X_TOOLKIT.
16874
1675728f
PE
16875 * ftxfont.c: Make symbols static if they're not exported.
16876 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16877 HAVE_FREETYPE.
16878 * font.h (ftxfont_driver): Likewise.
16879
e4cebfca
PE
16880 * xfns.c: Make symbols static if they're not exported.
16881 (x_last_font_name, x_display_info_for_name):
16882 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16883 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16884 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16885 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16886 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16887 (last_show_tip_args): Now static.
16888 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16889 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16890 (x_screen_planes): Remove; unused.
16891 * dispextern.h (x_screen_planes): Remove decl.
16892
5bf46f05
PE
16893 * dispnew.c: Make symbols static if they're not exported.
16894 * dispextern.h (redraw_garbaged_frames, scrolling):
16895 (increment_row_positions): Remove.
16896 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16897 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16898 Now static.
16899 (redraw_garbaged_frames): Remove; unused.
16900
435f4c28
PE
16901 * xfaces.c: Make symbols static if they're not exported.
16902 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16903 Remove decls.
16904 * xterm.h (defined_color): Remove decls.
16905 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16906 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16907 (menu_face_changed_default, defined_color, free_realized_face):
16908 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16909 (ascii_face_of_lisp_face): Remove; unused.
16910
8524aef3
PE
16911 * xdisp.c: Make symbols static if they're not exported.
16912 * dispextern.h (scratch_glyph_row, window_box_edges):
16913 (glyph_to_pixel_coords, set_cursor_from_row):
16914 (get_next_display_element, set_iterator_to_next):
16915 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16916 (show_mouse_face): Remove decls
16917 * frame.h (message_buf_print): Likewise.
16918 * lisp.h (pop_message, set_message, check_point_in_composition):
16919 Likewise.
16920 * xterm.h (set_vertical_scroll_bar): Likewise.
16921 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16922 (message_buf_print, scratch_glyph_row, displayed_buffer):
16923 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16924 (get_next_display_element, show_mouse_face, window_box_edges):
16925 (frame_to_window_pixel_xy, check_point_in_composition):
16926 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16927 (glyph_to_pixel_coords): Remove; unused.
16928
16390cd2
PE
16929 * dired.c (file_name_completion): Now static.
16930
16931 * dbusbind.c (xd_in_read_queued_messages): Now static.
16932
a25f4dfa
PE
16933 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16934 * data.c (circular_list_error): Remove.
16935
14a9c8df
PE
16936 * commands.h (last_point_position, last_point_position_buffer):
16937 (last_point_position_window): Remove decls.
16938 * keyboard.c: Make these variables static.
16939
04f2d78b
CB
16940 * coding.h (coding, code_convert_region, encode_coding_gap):
16941 Remove decls.
74ab6df5
PE
16942 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16943 (iso_code_class, detect_coding, code_convert_region): Now static.
16944 (encode_coding_gap): Remove; unused.
16945
38dfbee1
PE
16946 * chartab.c (chartab_chars, chartab_bits): Now static.
16947
a2cb4e63
PE
16948 * charset.h (charset_iso_8859_1): Remove decl.
16949 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16950 Now static.
16951
127198fd
PE
16952 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16953 * ccl.c (Vccl_program_table): Now static.
16954 (check_ccl_update): Remove; unused.
16955
d85b608f
PE
16956 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16957 * category.h: ... from here.
16958 * category.c (check_category_table, set_category_set): Now static.
16959
31cd66f3
PE
16960 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16961 * lisp.h: Remove these decls.
16962
c358e587
PE
16963 * buffer.c (buffer_count): Remove unused var.
16964
e78aecca
PE
16965 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16966 so that it's not optimized away.
16967 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16968 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16969 exported only to the debugger.
16970
e192d7d3 16971 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 16972 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 16973
92470028
PE
16974 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16975 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16976 was inaccessible from Lisp.
16977 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16978 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16979
244ed907
PE
16980 alloc.c: Import and export fewer symbols, and remove unused items.
16981 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16982 is defined.
16983 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16984 it's not optimized away by whole-program optimization.
16985 (message_enable_multibyte, free_misc): Remove.
16986 (catchlist, handlerlist, mark_backtrace):
16987 Declare only if BYTE_MARK_STACK.
16988 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16989 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16990 (message_enable_multibyte): Remove decl.
16991 (free_misc, interval_free_list, float_block, float_block_index):
16992 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16993 (cons_free_list, last_marked_index):
16994 Now static.
16995 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16996 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16997 (mark_backtrace): Define only if BYTE_MARK_STACK.
16998 * xdisp.c (message_enable_multibyte): Now static.
16999
61c2b50e 17000 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
17001 This makes it easier for human readers (and static analyzers)
17002 to see whether these variables are used from other modules.
17003 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17004 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17005 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17006 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17007 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17008 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17009 * xmenu.c, xselect.c:
17010 Declare Q* vars static if they are not used in other modules.
17011 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17012 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17013 Remove decls of unexported vars.
17014 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17015
95c82688
PE
17016 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17017
16a97296
PE
17018 Make Emacs functions such as Fatom 'static' by default.
17019 This makes it easier for human readers (and static analyzers)
17020 to see whether these functions can be called from other modules.
17021 DEFUN now defines a static function. To make the function external
17022 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
17023 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17024 (Finit_image_library):
16a97296
PE
17025 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17026 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17027 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17028 Remove decls, since these functions are now static.
17029 (Funintern, Fget_internal_run_time): New decls, since these functions
17030 were already external.
95c82688 17031
16a97296
PE
17032 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17033 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17034 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17035 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17036 * keyboard.c, keymap.c, lread.c:
17037 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17038 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17039 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17040 Mark functions with DEFUE instead of DEFUN,
17041 if they are used in other modules.
17042 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17043 decls for now-static functions.
17044 * buffer.h (Fdelete_overlay): Remove decl.
17045 * callproc.c (Fgetenv_internal): Mark as internal.
17046 * composite.c (Fremove_list_of_text_properties): Remove decl.
17047 (Fcomposition_get_gstring): New forward static decl.
17048 * composite.h (Fcomposite_get_gstring): Remove decl.
17049 * dired.c (Ffile_attributes): New forward static decl.
17050 * doc.c (Fdocumntation_property): New forward static decl.
17051 * eval.c (Ffetch_bytecode): New forward static decl.
17052 (Funintern): Remove extern decl; now in .h file where it belongs.
17053 * fileio.c (Fmake_symbolic_link): New forward static decl.
17054 * image.c (Finit_image_library): New forward static decl.
17055 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17056 * intervals.h (Fprevious_property_change):
17057 (Fremove_list_of_text_properties): Remove decls.
17058 * keyboard.c (Fthis_command_keys): Remove decl.
17059 (Fcommand_execute): New forward static decl.
17060 * keymap.c (Flookup_key): New forward static decl.
17061 (Fcopy_keymap): Now static.
17062 * keymap.h (Flookup_key): Remove decl.
17063 * process.c (Fget_process): New forward static decl.
17064 (Fprocess_datagram_address): Mark as internal.
17065 * syntax.c (Fsyntax_table_p): New forward static decl.
17066 (skip_chars): Remove duplicate decl.
17067 * textprop.c (Fprevious_property_change): New forward static decl.
17068 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17069 Now internal.
17070 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17071 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17072
785bbd42
PE
17073 * editfns.c (Fformat): Remove unreachable code.
17074
8b913b57
AS
170752011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17076
17077 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17078 change. (Bug#8496)
17079
a6744a35
EZ
170802011-04-13 Eli Zaretskii <eliz@gnu.org>
17081
17082 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17083 when at ZV. (Bug#8487)
17084
e7974947
AS
170852011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17086
baad03f0
AS
17087 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17088 (Bug#8437)
17089 * keyboard.c (parse_tool_bar_item): Likewise.
17090 * sound.c (sound_cleanup, alsa_close): Likewise.
17091 * termcap.c (tgetent): Likewise.
17092 * xfns.c (x_default_font_parameter): Likewise.
17093 * xsettings.c (read_and_apply_settings): Likewise.
17094
e7974947
AS
17095 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17096 (overrun_check_free): Protoize.
17097
28272684
PE
170982011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17099
17100 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17101 since callers should never pass a negative size.
17102 Change the signature to match that of plain 'read' and 'write'; see
17103 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17104 * lisp.h: Update prototypes of emacs_write and emacs_read.
17105
11997c76
EZ
171062011-04-11 Eli Zaretskii <eliz@gnu.org>
17107
17108 * xdisp.c (redisplay_window): Don't try to determine the character
17109 position of the scroll margin if the window start point w->startp
e896f03c 17110 is outside the buffer's accessible region. (Bug#8468)
11997c76 17111
8a2cbd72
EZ
171122011-04-10 Eli Zaretskii <eliz@gnu.org>
17113
17114 Fix write-region and its subroutines for buffers > 2GB.
17115 * fileio.c (a_write, e_write): Modify declaration of arguments and
17116 local variables to support buffers larger than 2GB.
17117 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17118
17119 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17120 argument, local variables, and return value.
17121
17122 * lisp.h: Update prototypes of emacs_write and emacs_read.
17123
17124 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17125
4073e537 171262011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 17127
1ebfdcb6
PE
17128 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17129
b2ded58d
PE
17130 Fix more problems found by GCC 4.6.0's static checks.
17131
7d66342c
PE
17132 * xdisp.c (vmessage): Use a better test for character truncation.
17133
bbf47d44
PE
17134 * charset.c (load_charset_map): <, not <=, for optimization,
17135 and to avoid potential problems with integer overflow.
9248994d 17136 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 17137 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 17138 * editfns.c (Fformat): Likewise.
1e69125e 17139 * syntax.c (skip_chars): Likewise.
3befa583 17140
e3019616
PE
17141 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17142 This also lets GCC 4.6.0 generate slightly better loop code.
17143
becfa255
PE
17144 * callint.c (Fcall_interactively): <, not <=, for optimization.
17145 (Fcall_interactively): Count the number of arguments produced,
17146 not the number of arguments given. This is simpler and lets GCC
17147 4.6.0 generate slightly better code.
17148
dae0cd48
PE
17149 * ftfont.c: Distingish more carefully between FcChar8 and char.
17150 The previous code passed unsigned char * to a functions like
17151 strlen and xstrcasecmp that expect char *, which does not
17152 conform to the C standard.
17153 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17154 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17155 char * when the C standard requires it.
17156
76032d70
PE
17157 * keyboard.c (read_char): Remove unused var.
17158
eb3f1cc8
PE
17159 * eval.c: Port to Windows vsnprintf (Bug#8435).
17160 Include <limits.h>.
17161 (SIZE_MAX): Define if the headers do not.
17162 (verror): Do not give up if vsnprintf returns a negative count.
17163 Instead, grow the buffer. This ports to Windows vsnprintf, which
17164 does not conform to C99. Problem reported by Eli Zaretskii.
17165 Also, simplify the allocation scheme, by avoiding the need for
17166 calling realloc, and removing the ALLOCATED variable.
17167
70476b54
PE
17168 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17169
12020a9e
PE
17170 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17171 But keep the doprint source code for now, as we might revamp it
17172 and use it again (Bug#8435).
ea6c7ae6
PE
17173 * lisp.h (doprnt): Remove.
17174 * Makefile.in (base_obj): Remove doprnt.o.
17175 * deps.mk (doprnt.o): Remove.
17176
5fdb398c
PE
17177 error: Print 32- and 64-bit integers portably (Bug#8435).
17178 Without this change, on typical 64-bit hosts error ("...%d...", N)
17179 was used to print both 32- and 64-bit integers N, which relied on
17180 undefined behavior.
61bdb816 17181 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
17182 * lisp.h (error, verror): Mark as printf-like functions.
17183 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
17184 Report overflow in size calculations when allocating printf buffer.
17185 Do not truncate output string at its first null byte.
17186 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
17187 Truncate the output at a character boundary, since vsnprintf does not
17188 do that.
17189 * charset.c (check_iso_charset_parameter): Convert internal
17190 character to string before calling 'error', since %c now has the
17191 printf meaning.
17192 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
17193 overflow when computing char to be passed to 'error'. Do not
17194 pass Lisp_Object to 'error'; pass the integer instead.
17195 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
17196 formatted with plain %d.
17197
b189fa66
PE
17198 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
17199
bff87ef0
PE
17200 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
17201
7e2cac20
PE
17202 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
17203
ce4d90b5
PE
17204 * xterm.c (x_catch_errors): Remove duplicate declaration.
17205
266c9547
PE
17206 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
17207
79c49ad2
PE
17208 * xdisp.c, lisp.h (message_nolog): Remove; unused.
17209
368f4090
JM
172102011-04-10 Jim Meyering <meyering@redhat.com>
17211
17212 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
17213 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
17214 return ssize_t not "int", and use size_t as the buffer length.
17215 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
17216 * gnutls.h: Update declarations.
17217 * process.c (read_process_output): Use ssize_t, to match.
17218 (send_process): Likewise.
17219
a32d4040
CY
172202011-04-09 Chong Yidong <cyd@stupidchicken.com>
17221
17222 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
17223
8546720e 172242011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 17225
04f2d78b
CB
17226 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
17227 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 17228
8546720e
GM
17229 * xterm.c (handle_one_xevent):
17230 * xmenu.c (create_and_show_popup_menu):
17231 * xselect.c (x_decline_selection_request)
17232 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 17233
0a2f5c1a 172342011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
17235
17236 Fix some uses of `int' instead of EMACS_INT.
17237 * search.c (string_match_1, fast_string_match)
17238 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
17239 (scan_buffer, find_next_newline_no_quit)
17240 (find_before_next_newline, search_command, Freplace_match)
17241 (Fmatch_data): Make some `int' variables be EMACS_INT.
17242
17243 * xdisp.c (display_count_lines): 3rd argument and return value now
17244 EMACS_INT. All callers changed.
17245 (pint2hrstr): Last argument is now EMACS_INT.
17246
17247 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
17248 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
17249 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
17250 (decode_coding_utf_16, decode_coding_emacs_mule)
17251 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
17252 (decode_coding_ccl, decode_coding_charset)
17253 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
17254 (decode_coding_iso_2022, decode_coding_emacs_mule)
17255 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
17256 <char_offset, last_offset>: Declare EMACS_INT.
17257 (encode_coding_utf_8, encode_coding_utf_16)
17258 (encode_coding_emacs_mule, encode_invocation_designation)
17259 (encode_designation_at_bol, encode_coding_iso_2022)
17260 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
17261 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
17262 Declare EMACS_INT.
17263 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
17264 (encode_invocation_designation): Last argument P_NCHARS is now
17265 EMACS_INT.
17266 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
17267 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
17268
17269 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
17270 All users changed.
17271
17272 * ccl.c (Fccl_execute_on_string): Declare some variables
17273 EMACS_INT.
17274
8546720e 172752011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
17276
17277 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
17278
4e19a977
CS
172792011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
17280
17281 * process.c (Fformat_network_address): Doc fix.
17282
87302331
R
172832011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
17284
ee7683eb 17285 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 17286
cbb59342
CY
172872011-04-08 Chong Yidong <cyd@stupidchicken.com>
17288
17289 * keyboard.c (read_char): Call Lisp function help-form-show,
17290 instead of using internal_with_output_to_temp_buffer.
17291 (Qhelp_form_show): New var.
e0d38eeb 17292 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
17293
17294 * print.c (internal_with_output_to_temp_buffer): Function deleted.
17295
17296 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
17297
e67a13ab
CY
172982011-04-06 Chong Yidong <cyd@stupidchicken.com>
17299
04f2d78b
CB
17300 * process.c (Flist_processes): Remove to Lisp.
17301 (list_processes_1): Delete.
e67a13ab 17302
973f782d
EZ
173032011-04-06 Eli Zaretskii <eliz@gnu.org>
17304
7c106b1e
EZ
17305 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
17306
973f782d
EZ
17307 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
17308
41cf7d1a 173092011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 17310
ca23cc88
PE
17311 Fix more problems found by GCC 4.6.0's static checks.
17312
f390e2d5
PE
17313 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
17314
42eea0d0
PE
17315 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
17316
b69769da 17317 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 17318
f9541e84
PE
17319 * xdisp.c (vmessage): Mark as a printf-like function.
17320
13841b55
PE
17321 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
17322
c136c10f
PE
17323 * sound.c (sound_warning): Don't crash if arg contains a printf format.
17324
5e2d4a30
PE
17325 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
17326 printf-like functions.
17327 (tiff_load): Add casts to remove these marks before passing them
17328 to system-supplied API.
17329
583f48b9
PE
17330 * eval.c (Fsignal): Remove excess argument to 'fatal'.
17331
b25d760e
PE
17332 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
17333 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
17334 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
17335 directly, rather than having caller test rule sign. This avoids
17336 some unnecessary tests.
17337 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
17338 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
17339 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 17340
bc7b6697 17341 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 17342 (xfont_open): Avoid unnecessary tests.
bc7b6697 17343
27ccc379
PE
17344 * composite.c (composition_gstring_put_cache): Use unsigned integer.
17345
dcd5c89a
PE
17346 * composite.h, composite.c (composition_gstring_put_cache):
17347 Use EMACS_INT, not int, for length.
17348
b13a45c6
PE
17349 * composite.h (COMPOSITION_DECODE_REFS): New macro,
17350 breaking out part of COMPOSITION_DECODE_RULE.
17351 (COMPOSITION_DECODE_RULE): Use it.
17352 * composite.c (get_composition_id): Remove unused local vars,
17353 by using the new macro.
17354
1e792e4d
PE
17355 * textprop.c (set_text_properties_1): Change while to do-while,
17356 since the condition is always true at first.
17357
dc6c6455 17358 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
17359 (interval_deletion_adjustment): Return unsigned value.
17360 All uses changed.
dc6c6455 17361
aba7731a
PE
17362 * process.c (list_processes_1, create_pty, read_process_output):
17363 (exec_sentinel): Remove vars that were set but not used.
afd4052b 17364 (create_pty): Remove unnecessary "volatile"s.
bc57d757 17365 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 17366 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 17367 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 17368
fdfc4bf3
PE
17369 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
17370
fca8fe46 17371 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 17372 (update_syntax_table): Use unsigned instead of int.
fca8fe46 17373
06a0259a 17374 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 17375 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 17376 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 17377
e7b9e80f
PE
17378 * print.c (print_error_message): Avoid int overflow.
17379
56201685
PE
17380 * font.c (font_list_entities): Redo for clarity,
17381 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17382
78834453 17383 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 17384 (font_score): Avoid potential overflow in diff calculation.
78834453 17385
0bc0b309 17386 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 17387 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 17388
e610eaca
PE
17389 * eval.c (funcall_lambda): Rename local to avoid shadowing.
17390
b895abce
PE
17391 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
17392 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
17393 can always succeed if overflow has undefined behavior.
17394
1f1d9321 17395 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 17396 (wordify): Omit three unnecessary tests.
1f1d9321 17397
c59478bc
PE
17398 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
17399 All callers changed. This avoids the need for an unused var.
17400
79b73827
PE
17401 * casefiddle.c (casify_region): Remove var that is set but not used.
17402
a4db5dfe
PE
17403 * dired.c (file_name_completion): Remove var that is set but not used.
17404
43aae36e
PE
17405 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17406
2a47c44d 17407 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 17408 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 17409
a37c69bf
PE
17410 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17411 Check for integer overflow on size calculations.
17412
328ab8e7
PE
17413 * buffer.c (Fprevious_overlay_change): Remove var that is set
17414 but not used.
17415
e5a2a5cb
PE
17416 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17417 Remove vars that are set but not used.
8d84a6eb 17418 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 17419 (timer_check_2): Mark vars as initialized.
e5a2a5cb 17420
a60e5f68
PE
17421 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17422
f661cb61 17423 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 17424 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 17425
f0397f5a
PE
17426 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17427 that are set but not used.
17428
8664db06 17429 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 17430 if XCreateBitmapFromData fails (Bug#8410).
8664db06 17431
6abdaa4a
PE
17432 * xselect.c (x_get_local_selection, x_handle_property_notify):
17433 Remove vars that are set but not used.
17434
0ce7538d 17435 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 17436 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 17437
9ae848fc
PE
17438 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17439 Remove var that is set but not used.
0b918413
PE
17440 (scroll_bar_windows_size): Now size_t, not int.
17441 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
17442 Check for overflow.
9ae848fc 17443
a5a62657
PE
17444 * xfaces.c (realize_named_face): Remove vars that are set but not used.
17445 (map_tty_color) [!defined MSDOS]: Likewise.
17446
5c5cdd39
PE
17447 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17448
66ebf983
PE
17449 * coding.c: Remove vars that are set but not used.
17450 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17451 All callers changed.
17452 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17453 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17454 (decode_coding_charset): Remove vars that are set but not used.
17455
1be4d761
PE
17456 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17457 that is set but not used.
17458
47553fa8
PE
17459 * print.c (print_object): Remove var that is set but not used.
17460
1f7196bf 17461 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
17462 The gnulib version avoids calling malloc in the usual case,
17463 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17464 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17465 * filelock.c (current_lock_owner): Likewise.
17466 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17467 * sysdep.c: Include allocator.h, careadlinkat.h.
17468 (emacs_no_realloc_allocator): New static constant.
17469 (emacs_readlink): New function.
fdb61804
PE
17470 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17471 ../lib/careadlinkat.h.
d1fdcab7 17472
f84c17c7
SM
174732011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
17474
17475 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17476 first non-nil return value).
17477
ef3862ad
JD
174782011-04-03 Jan Djärv <jan.h.d@swipnet.se>
17479
17480 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17481 if not defined (Bug#8403).
17482
376a7006
JB
174832011-04-02 Juanma Barranquero <lekktu@gmail.com>
17484
17485 * xdisp.c (display_count_lines): Remove parameter `start',
17486 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17487 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17488 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17489 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17490 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17491 and thereabouts. All callers changed.
17492 (get_per_char_metric): Remove parameter `f', unused since
17493 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17494
6ca3801d
JM
174952011-04-02 Jim Meyering <meyering@redhat.com>
17496
17497 do not dereference NULL upon failed strdup
17498 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17499 (ns_get_family): Likewise.
17500
d8e2b5ba
JB
175012011-04-02 Juanma Barranquero <lekktu@gmail.com>
17502
17503 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17504
8c74fcbd
JD
175052011-04-02 Jan Djärv <jan.h.d@swipnet.se>
17506
17507 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17508 later (Bug#8403).
17509
7200d79c
SM
175102011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
17511
03408648 17512 Add lexical binding.
7200d79c 17513
03408648
SM
17514 * window.c (Ftemp_output_buffer_show): New fun.
17515 (Fsave_window_excursion):
17516 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17517
17518 * lread.c (lisp_file_lexically_bound_p): New function.
17519 (Fload): Bind Qlexical_binding.
17520 (readevalloop): Remove `evalfun' arg.
17521 Bind Qinternal_interpreter_environment.
17522 (Feval_buffer): Bind Qlexical_binding.
17523 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
17524 Mark as dynamic.
17525 (syms_of_lread): Declare `lexical-binding'.
17526
17527 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
17528
17529 * keyboard.c (eval_dyn): New fun.
17530 (menu_item_eval_property): Use it.
ca105506
SM
17531
17532 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 17533
03408648
SM
17534 * fns.c (concat, mapcar1): Accept byte-code-functions.
17535
17536 * eval.c (Fsetq): Handle lexical vars.
17537 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
17538 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
17539 (FletX, Flet): Obey lexical binding.
17540 (Fcommandp): Handle closures.
17541 (Feval): New `lexical' arg.
17542 (eval_sub): New function extracted from Feval. Use it almost
17543 everywhere where Feval was used. Look up vars in lexical env.
17544 Handle closures.
17545 (Ffunctionp): Move from subr.el.
17546 (Ffuncall): Handle closures.
17547 (apply_lambda): Remove `eval_flags'.
17548 (funcall_lambda): Handle closures and new byte-code-functions.
17549 (Fspecial_variable_p): New function.
17550 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
17551 but without exporting it to Lisp.
23aba0ea 17552
23aba0ea 17553 * doc.c (Fdocumentation, store_function_docstring):
03408648 17554 * data.c (Finteractive_form): Handle closures.
23aba0ea 17555
03408648
SM
17556 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
17557 interactive spec.
ba83908c 17558
04f2d78b
CB
17559 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
17560 New byte-codes.
03408648
SM
17561 (exec_byte_code): New function extracted from Fbyte_code to handle new
17562 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 17563
03408648 17564 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 17565
03408648 17566 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 17567
e2abce01
JB
175682011-03-31 Juanma Barranquero <lekktu@gmail.com>
17569
17570 * xdisp.c (redisplay_internal): Fix prototype.
17571
63696a73 175722011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 17573
63696a73 17574 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
17575 (try_scrolling): Use it when setting scroll_limit.
17576 Limit scrolling to 100 screen lines.
63696a73
EZ
17577 (redisplay_window): Even when falling back on "recentering",
17578 position point in the window according to scroll-conservatively,
17579 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
17580
17581 (try_scrolling): When point is above the window, allow searching
17582 as far as scroll_max, or one screenful, to compute vertical
17583 distance from PT to the scroll margin position. This prevents
17584 try_scrolling from unnecessarily failing when
17585 scroll-conservatively is set to a value slightly larger than the
17586 window height. Clean up the case of PT below the margin at bottom
17587 of window: scroll_max can no longer be INT_MAX. When aggressive
17588 scrolling is in use, don't let point enter the opposite scroll
17589 margin as result of the scroll.
17590 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
17591 threshold of 100 lines for never-recentering scrolling.
17592
e4cc2dfc
JB
175932011-03-31 Juanma Barranquero <lekktu@gmail.com>
17594
17595 * dispextern.h (move_it_by_lines):
17596 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17597 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
17598 (message_log_check_duplicate): Remove parameters `prev_bol' and
17599 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17600 (redisplay_internal): Remove parameter `preserve_echo_area',
17601 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
17602
17603 * indent.c (Fvertical_motion):
17604 * window.c (window_scroll_pixel_based, Frecenter):
17605 Don't pass `need_y_p' to `move_it_by_lines'.
17606
1c470562
SM
176072011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
17608
44f230aa
SM
17609 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17610 steal a few bits to be more compact.
17611 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17612 Remove unneeded casts.
17613
1c470562
SM
17614 * bytecode.c (Fbyte_code): CAR and CDR can GC.
17615
888adce9
ZK
176162011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
17617
17618 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17619 binding" message (bug#7967).
17620
f838ed7b
PE
176212011-03-30 Paul Eggert <eggert@cs.ucla.edu>
17622
77861b95
PE
17623 Fix more problems found by GCC 4.6.0's static checks.
17624
de6dbc14
PE
17625 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17626 Remove unused local var.
17627
f838ed7b
PE
17628 * editfns.c (Fmessage_box): Remove unused local var.
17629
792c7b2b
PE
17630 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17631 (note_mode_line_or_margin_highlight, note_mouse_highlight):
17632 Omit unused local vars.
c499e557 17633 * window.c (shrink_windows): Omit unused local var.
b01a1c29 17634 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
17635 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17636 Omit unused local var.
17637
ba0165e1
PE
17638 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17639 Don't assume string length fits in int.
32ad8845 17640 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 17641 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 17642
3c59b4c9
PE
17643 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17644 instead of alloca (Bug#8344).
17645
a3eed478 17646 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 17647 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 17648
eb4d412d
PE
17649 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17650
1658b401
PE
17651 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17652 concerns.
17653
17654 * term.c (produce_glyphless_glyph): Remove unnecessary test.
17655
17656 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 17657
9a2c6e05
PE
17658 * keyboard.c (syms_of_keyboard): Use the same style as later
17659 in this function when indexing through an array. This also
17660 works around GCC bug 48267.
17661
03d0a109
PE
17662 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17663
44f730c8
PE
17664 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17665
fe75f926
PE
17666 * chartab.c (sub_char_table_ref_and_range): Redo for slight
17667 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17668
ffa8c828
PE
17669 * keyboard.c, keyboard.h (num_input_events): Now size_t.
17670 This avoids undefined behavior on integer overflow, and is a bit
17671 more convenient anyway since it is compared to a size_t variable.
17672
c5101a77
PE
17673 Variadic C functions now count arguments with size_t, not int.
17674 This avoids an unnecessary limitation on 64-bit machines, which
17675 caused (substring ...) to crash on large vectors (Bug#8344).
17676 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
17677 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 17678 All variadic functions and their callers changed accordingly.
c5101a77
PE
17679 (struct gcpro.nvars): Now size_t, not int. All uses changed.
17680 * data.c (arith_driver, float_arith_driver): Likewise.
17681 * editfns.c (general_insert_function): Likewise.
17682 * eval.c (struct backtrace.nargs, interactive_p)
17683 (internal_condition_case_n, run_hook_with_args, apply_lambda)
17684 (funcall_lambda, mark_backtrace): Likewise.
17685 * fns.c (concat): Likewise.
17686 * frame.c (x_set_frame_parameters): Likewise.
17687 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
17688 0 if not found, not -1. All callers changed.
17689
dd3f25f7
PE
17690 * alloc.c (garbage_collect): Don't assume stack size fits in int.
17691 (stack_copy_size): Now size_t, not int.
17692 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
17693
461c2ab9
JB
176942011-03-28 Juanma Barranquero <lekktu@gmail.com>
17695
17696 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
17697 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17698 All callers changed.
17699
17700 * lisp.h (multibyte_char_to_unibyte):
17701 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
17702 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17703 * character.h (CHAR_TO_BYTE8):
17704 * cmds.c (internal_self_insert):
17705 * editfns.c (general_insert_function):
17706 * keymap.c (push_key_description):
17707 * search.c (Freplace_match):
17708 * xdisp.c (message_dolog, set_message_1): All callers changed.
17709
f6d62986
SM
177102011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
17711
17712 * keyboard.c (safe_run_hook_funcall): New function.
17713 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17714 don't set the hook to nil, but remove the offending function instead.
17715 (Qcommand_hook_internal): Remove, unused.
17716 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17717 Vcommand_hook_internal.
17718
17719 * eval.c (enum run_hooks_condition): Remove.
17720 (funcall_nil, funcall_not): New functions.
17721 (run_hook_with_args): Call each function through a `funcall' argument.
17722 Remove `cond' argument, now redundant.
17723 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17724 (Frun_hook_with_args_until_failure): Adjust accordingly.
17725 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17726
1db5b1ad
JB
177272011-03-28 Juanma Barranquero <lekktu@gmail.com>
17728
17729 * dispextern.h (string_buffer_position): Remove declaration.
17730
17731 * print.c (strout): Remove parameter `multibyte', unused since
17732 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
17733
17734 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17735 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17736 All callers changed.
17737
17738 * w32.c (_wsa_errlist): Use braces for struct initializers.
17739
17740 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17741 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17742 All callers changed.
17743 (string_buffer_position): Likewise. Also, make static (it's never
17744 used outside xdisp.c).
17745 (cursor_row_p): Remove parameter `w', unused since
17746 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
17747 (decode_mode_spec): Remove parameter `precision', introduced during
17748 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17749 All callers changed.
17750
5ffb62aa
JD
177512011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17752
17753 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17754
461c2ab9 177552011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
17756
17757 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17758 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17759 (ns_update_auto_hide_menu_bar): New functions.
17760 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17761 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17762 ns_constrain_all_frames.
17763 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17764 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17765
5c380ffb
JD
177662011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17767
17768 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17769
9af30bdf
GM
177702011-03-27 Glenn Morris <rgm@gnu.org>
17771
17772 * syssignal.h: Replace RETSIGTYPE with void.
17773 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17774 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17775 Replace SIGTYPE with void everywhere.
17776 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17777 * s/template.h (SIGTYPE): Remove commented out definition.
17778
e2abce01
JB
177792011-03-26 Eli Zaretskii <eliz@gnu.org>
17780
17781 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17782 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17783
f868cd8a
JB
177842011-03-26 Juanma Barranquero <lekktu@gmail.com>
17785
59eb0929
JB
17786 * w32.c (read_unc_volume): Use parameter `henum', instead of
17787 global variable `wget_enum_handle'.
17788
17789 * keymap.c (describe_vector): Remove parameters `indices' and
17790 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17791 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17792
f868cd8a
JB
17793 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17794
17795 * keyboard.c (timer_check): Remove parameter `do_it_now',
17796 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17797 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17798 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17799
17800 * keyboard.c (read_char):
17801 * w32menu.c (w32_menu_display_help):
17802 * xmenu.c (show_help_event, menu_help_callback):
17803 Adjust calls to `show_help_echo'.
17804
17805 * gtkutil.c (xg_maybe_add_timer):
17806 * keyboard.c (readable_events):
17807 * process.c (wait_reading_process_output):
17808 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17809
17810 * insdel.c (adjust_markers_gap_motion):
17811 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17812 (gap_left, gap_right): Don't call it.
17813
2ecf6fdb
CY
178142011-03-25 Chong Yidong <cyd@stupidchicken.com>
17815
17816 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17817 incurred during fontification.
17818
6b1f9ba4
JB
178192011-03-25 Juanma Barranquero <lekktu@gmail.com>
17820
17821 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17822 (DEFVAR_PER_BUFFER): Don't pass it.
17823
17824 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17825 (scrolling_window): Don't pass it.
17826
0f4a96b5
JB
178272011-03-25 Juanma Barranquero <lekktu@gmail.com>
17828
17829 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17830
17831 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17832 and `suffix'.
17833 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17834 of variables specific to SELinux and computation of `encoded_absname'.
17835
17836 * image.c (XPutPixel): Remove unused variable `height'.
17837
17838 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17839
17840 * unexw32.c (get_section_info): Remove unused variable `section'.
17841
17842 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17843 (system_process_attributes): Remove unused variable `sess'.
17844 (sys_read): Remove unused variable `err'.
17845
17846 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17847 (w32_wnd_proc): Remove unused variable `isdead'.
17848 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17849 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17850 (x_create_tip_frame): Remove unused variable `tem'.
17851
17852 * w32inevt.c (w32_console_read_socket):
17853 Remove unused variable `no_events'.
17854
17855 * w32term.c (x_draw_composite_glyph_string_foreground):
17856 Remove unused variable `width'.
17857
1149507c
JB
178582011-03-24 Juanma Barranquero <lekktu@gmail.com>
17859
17860 * w32term.c (x_set_glyph_string_clipping):
17861 Don't pass uninitialized region to CombineRgn.
17862
9c88f339
JB
178632011-03-23 Juanma Barranquero <lekktu@gmail.com>
17864
17865 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17866 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17867 (Fx_close_connection): Remove unused variable `i'.
17868
17869 * w32font.c (w32font_draw): Return number of glyphs.
17870 (w32font_open_internal): Remove unused variable `i'.
17871 (w32font_driver): Add missing initializer.
17872
17873 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17874 (fill_in_menu): Remove unused variable `items_added'.
17875
17876 * w32term.c (last_mouse_press_frame): Remove static global variable.
17877 (w32_clip_to_row): Remove unused variable `f'.
17878 (x_delete_terminal): Remove unused variable `i'.
17879
17880 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17881 (NOTHING): Remove unused static global variable.
17882 (uniscribe_check_otf): Remove unused variable `table'.
17883 (uniscribe_font_driver): Add missing initializers.
17884
dee091a3
JD
178852011-03-23 Julien Danjou <julien@danjou.info>
17886
17887 * term.c (Fsuspend_tty, Fresume_tty):
17888 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17889 * window.c (temp_output_buffer_show):
17890 * insdel.c (signal_before_change):
17891 * frame.c (Fhandle_switch_frame):
17892 * fileio.c (Fdo_auto_save):
17893 * emacs.c (Fkill_emacs):
17894 * editfns.c (save_excursion_restore):
17895 * cmds.c (internal_self_insert):
17896 * callint.c (Fcall_interactively):
17897 * buffer.c (Fkill_all_local_variables):
17898 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17899 Use Frun_hooks.
0f4a96b5 17900 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 17901 unconditionally since it does the check itself.
dee091a3 17902
2c520ab5 179032011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 17904
c9c49752
PE
17905 Fix more problems found by GCC 4.5.2's static checks.
17906
8abc3f12
PE
17907 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17908 the first time through the loop, since we know p0 < p1 then.
17909 This also avoids a gcc -Wstrict-overflow warning.
17910
a2d26660
PE
17911 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17912 leading to a memory leak, possible in functions like
17913 load_charset_map_from_file that can allocate an unbounded number
b12ef411 17914 of objects (Bug#8318).
a2d26660 17915
916c72e9
PE
17916 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17917 that could (at least in theory) be that large.
17918
19ab8a18
PE
17919 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17920 This is less likely to overflow, and avoids undefined behavior if
17921 overflow does occur. All callers changed. Use strtoul to scan
17922 for the unsigned long integer.
b7cbbd6f
PE
17923 (pint2hrstr): Simplify and tune code slightly.
17924 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 17925
f0641eff
PE
17926 * scroll.c (do_scrolling): Work around GCC bug 48228.
17927 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17928
7f650bb9
PE
17929 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17930 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
17931 (validate_x_resource_name): Simplify count usage.
17932 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 17933
37dd57d1
PE
17934 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17935 fail (Bug#8306).
81e56e61 17936
699979fc 17937 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 17938
401bf9b4
PE
17939 * process.c (Fmake_network_process): Use socklen_t, not int,
17940 where POSIX says socklen_t is required in portable programs.
17941 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 17942 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
17943 (Fmake_network_process, server_accept_connection):
17944 (wait_reading_process_output, read_process_output):
17945 Likewise.
17946
b93aacde
PE
17947 * process.c: Rename or move locals to avoid shadowing.
17948 (list_processes_1, Fmake_network_process):
17949 (read_process_output_error_handler, exec_sentinel_error_handler):
17950 Rename or move locals.
4dc343ee 17951 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 17952 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 17953 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 17954 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 17955 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 17956
af8a867c 17957 Make tparam.h and terminfo.c consistent.
44f230aa
SM
17958 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17959 Include tparam.h instead, since it declares them.
af8a867c
PE
17960 * cm.h (PC): Remove extern decl; tparam.h now does this.
17961 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17962 * terminfo.c: Include tparam.h, to check interfaces.
17963 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17964 (tparam): Adjust signature to match interface in tparam.h;
17965 this removes some undefined behavior. Check that outstring and len
17966 are zero, which they always are with Emacs.
17967 * tparam.h (PC, BC, UP): New extern decls.
17968
0248044d 17969 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 17970 (xftfont_open): Rename locals to avoid shadowing.
0248044d 17971
8ff096c1 17972 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
17973 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17974 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 17975 (ftfont_list): Remove unused local.
49eaafba
PE
17976 (get_adstyle_property, ftfont_pattern_entity):
17977 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17978 Rename locals to avoid shadowing.
8ff096c1 17979
e2be39f6
PE
17980 * xfont.c (xfont_list_family): Mark var as initialized.
17981
c9735e30
PE
17982 * xml.c (make_dom): Now static.
17983
8f5201ae
PE
17984 * composite.c (composition_compute_stop_pos): Rename local to
17985 avoid shadowing.
b246f932
PE
17986 (composition_reseat_it): Remove unused locals.
17987 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 17988 (composition_update_it): Mark var as initialized.
11b61122
PE
17989 (find_automatic_composition): Mark vars as initialized,
17990 with a FIXME (Bug#8290).
8f5201ae 17991
760fbc2c
PE
17992 character.h: Rename locals to avoid shadowing.
17993 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17994 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17995 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17996 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17997 to avoid shadowing.
17998
ff08eb85
PE
17999 * textprop.c (property_change_between_p): Remove; unused.
18000
fc7bf025
PE
18001 * intervals.c (interval_start_pos): Now static.
18002
235d7abc
PE
18003 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18004
44f230aa
SM
18005 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18006 Rename locals to avoid shadowing.
3e7d6594 18007
50060332
PE
18008 * sound.c (wav_play, au_play, Fplay_sound_internal):
18009 Fix pointer signedness.
d01f234b 18010 (alsa_choose_format): Remove unused local var.
c83b8872
PE
18011 (wav_play): Initialize a variable to 0, to prevent undefined
18012 behavior (Bug#8278).
50060332 18013
c4fc4e30
PE
18014 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18015
918436ed
PE
18016 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18017
c939f91b
PE
18018 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18019 clobbering (Bug#8298).
b9c7f648
PE
18020 * sysdep.c (sys_subshell): Likewise.
18021 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 18022
6bd8c144
PE
18023 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18024 This should get cleaned up, so that child_setup has the
18025 same signature on all platforms.
18026
7710357c 18027 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 18028 (relocate_fd): Rename locals to avoid shadowing.
7710357c 18029
c59da222
CY
180302011-03-22 Chong Yidong <cyd@stupidchicken.com>
18031
18032 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18033 not to be necessary, and produces flickering.
18034
66b87493
GM
180352011-03-20 Glenn Morris <rgm@gnu.org>
18036
18037 * config.in: Remove file.
18038
45b6f6d5
JB
180392011-03-20 Juanma Barranquero <lekktu@gmail.com>
18040
18041 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18042 are now in src/globals.h.
18043 (syms_of_minibuf): Remove spurious & from previous change.
18044
cd394be1 180452011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
18046
18047 * minibuf.c (completing-read-function): New variable.
18048 (completing-read-default): Rename from completing-read.
18049 (completing-read): Call completing-read-function.
18050
b14e3e21
CY
180512011-03-19 Juanma Barranquero <lekktu@gmail.com>
18052
18053 * xfaces.c (Fx_load_color_file):
18054 Read color file from absolute filename (bug#8250).
18055
f2b726e6
JB
180562011-03-19 Juanma Barranquero <lekktu@gmail.com>
18057
18058 * makefile.w32-in: Update dependencies.
18059
09f6ff02
EZ
180602011-03-17 Eli Zaretskii <eliz@gnu.org>
18061
18062 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18063
29a6015a
PE
180642011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18065
a3a6c54e
PE
18066 Fix more problems found by GCC 4.5.2's static checks.
18067
b766f867
PE
18068 * process.c (make_serial_process_unwind, send_process_trap):
18069 (sigchld_handler): Now static.
18070
be02381c
PE
18071 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18072 That way, the code declares only the vars that it needs.
18073 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18074 * s/cygwin.h (PTY_ITERATION): Likewise.
18075 * s/darwin.h (PTY_ITERATION): Likewise.
18076 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18077
57048744
PE
18078 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18079 * process.c (allocate_pty): Don't declare stb unless it's needed.
18080
7914961c 18081 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
18082 (CONSTANTLIM): Remove; unused.
18083 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18084 Define only if needed.
7914961c 18085
b3967b18
PE
18086 * unexelf.c (unexec): Name an expression,
18087 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
18088 Use a different way to cause a compilation error if anyone uses
18089 n rather than nn, a way that does not involve shadowing.
73366a00 18090 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 18091
29a6015a
PE
18092 * deps.mk (unexalpha.o): Remove; unused.
18093
43cfc33e 18094 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 18095 * unexec.h: New file.
ce701a33
PE
18096 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18097 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18098 Depend on unexec.h.
18099 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18100 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18101 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 18102 Change as necessary to match prototype in unexec.h.
ce701a33 18103
01f44d5a
PE
18104 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18105 shadowing.
4f63c6bb 18106 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 18107
a6670b0b
PE
18108 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18109 Rename locals to avoid shadowing.
18110
cef2010d 18111 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 18112 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 18113
d4d7173a
PE
18114 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18115
f08b802a
PE
18116 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18117 warning when compiling print.c.
18118
3ddb0639
PE
18119 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18120 instead of using an uninitialized var.
5ad03b97 18121 (font_sort_entities): Mark var as initialized.
3ddb0639 18122
170a2692
PE
18123 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18124
e663c700
PE
18125 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18126 pointers to constants.
89bc529a 18127 (font_parse_fcname): Remove unused vars.
7b81e2d0 18128 (font_delete_unmatched): Now static.
ea838e10 18129 (font_get_spec): Remove; unused.
13a547c6
PE
18130 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18131 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18132 Rename or move locals to avoid shadowing.
e663c700 18133
2a80c887 18134 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 18135 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 18136
1384fa33 18137 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 18138 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 18139
8b2c52e9
PE
18140 * alloc.c (mark_backtrace): Move decl from here ...
18141 * lisp.h: ... to here, so that it can be checked.
18142
475545b5 18143 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 18144 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
18145 (lisp_indirect_variable): Name an expression,
18146 to avoid gcc -Wbad-function-cast warning.
1faed8ae 18147 (Fdefvar): Rename locals to avoid shadowing.
475545b5 18148
b1349114 18149 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 18150 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 18151 Use const pointer when appropriate.
b1349114 18152
a2928364
PE
18153 * lisp.h (get_system_name, get_operating_system_release):
18154 Move decls here, to check interfaces.
18155 * process.c (get_operating_system_release): Move decl to lisp.h.
18156 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
18157 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18158 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18159 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
18160 (Fformat_time_string, Fencode_time, Finsert_char):
18161 (Ftranslate_region_internal, Fformat):
18162 Rename or remove local vars to avoid shadowing.
9710023e 18163 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 18164
a415e694
PE
18165 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18166 avoid shadowing.
18167
8ef4622d
PE
18168 * lisp.h (eassert): Check that the argument compiles, even if
18169 ENABLE_CHECKING is not defined.
18170
946f9a5b
PE
18171 * data.c (Findirect_variable): Name an expression, to avoid
18172 gcc -Wbad-function-cast warning.
112396d6 18173 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 18174 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
18175 (Fmake_variable_buffer_local, Fmake_local_variable):
18176 Mark variables as initialized.
52746918 18177 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 18178
e5aab7e7 18179 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
18180 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
18181 Rename locals to avoid shadowing.
dff45157
PE
18182 (mark_stack): Move local variables into the #ifdef region where
18183 they're used.
7bc26fdb
PE
18184 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
18185 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
18186 needed otherwise.
18187 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
18188 (GC_STRING_CHARS): Remove; not used.
d40d4be1 18189 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 18190
e5aab7e7
PE
18191 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
18192 avoids undefined behavior in theory.
18193
4da60324
PE
18194 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
18195
88043301
PE
18196 Use functions, not macros, for up- and down-casing (Bug#8254).
18197 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18198 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
18199 to use the following functions instead of these macros.
18200 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
18201 EMACS_INT, since callers assume the returned value fits in int.
18202 (upcase1): Likewise, for UPCASE_TABLE.
18203 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 18204 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 18205 the race-condition problem in the old DOWNCASE.
88043301 18206
19ed5445
PE
18207 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
18208 Rename locals to avoid shadowing.
18209 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
18210 (regex_compile, re_search_2, re_match_2_internal):
18211 Remove unused local vars.
952db0d7
PE
18212 (FREE_VAR): Rewrite so as not to use empty "else",
18213 which gcc can warn about.
da053e48 18214 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
18215 (RETALLOC_IF): Define only if needed.
18216 (WORDCHAR_P): Likewise. This one is never needed, but is used
18217 only in a comment talking about a compiler bug, so put inside
18218 the #if 0 of that comment.
18219 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
18220 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
18221 Remove; unused.
19ed5445 18222
1f3561e4 18223 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
18224 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
18225 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 18226
ded6f8f7
PE
18227 * search.c (simple_search): Remove unused var.
18228
dbd37a95
PE
18229 * dired.c (compile_pattern): Move decl from here ...
18230 * lisp.h: ... to here, so that it can be checked.
18231 (struct re_registers): New forward decl.
18232
7e47afad
PE
18233 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
18234
85f24f61
PE
18235 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
18236 All uses changed.
18237 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
18238 Rename locals to avoid shadowing.
5671df8f 18239 (Fvertical_motion): Mark locals as initialized.
85f24f61 18240
181aa2be 18241 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 18242 (casify_region): Mark local as initialized.
181aa2be 18243
930d429c
PE
18244 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
18245
7082eac6
PE
18246 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
18247 New macros, so that the caller can use some names other than
18248 gcpro1, gcpro2, etc.
18249 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
18250 of the new macros.
18251 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
18252 argument, for consistency with GCPRO2_VAR, etc: it is now the
18253 prefix of the variable, not the variable itself. All uses
18254 changed.
38b2c076
PE
18255 * dired.c (directory_files_internal, file_name_completion):
18256 Rename locals to avoid shadowing.
18257
15206ed9
PE
18258 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
18259 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
18260 dired.c's scmp function, had undefined behavior.
18261 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18262 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
18263 * buffer.h: ... to here, because these macros use current_buffer,
18264 and the new implementation with inline functions needs to have
18265 current_buffer in scope now, rather than later when the macros
18266 are used.
18267 (downcase, upcase1): New static inline functions.
18268 (DOWNCASE, UPCASE1): Reimplement using these functions.
18269 This avoids undefined behavior in expressions like
18270 DOWNCASE (x) == DOWNCASE (y), which previously suffered
18271 from race conditions in accessing the global variables
18272 case_temp1 and case_temp2.
18273 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
18274 * lisp.h (case_temp1, case_temp2): Remove their decls.
18275 * character.h (ASCII_CHAR_P): Move from here ...
18276 * lisp.h: ... to here, so that the inline functions mentioned
18277 above can use them.
18278
4a6bea26
PE
18279 * dired.c (directory_files_internal_unwind): Now static.
18280
f14b7e14
PE
18281 * fileio.c (file_name_as_directory, directory_file_name):
18282 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
18283 Now static.
2893f146
PE
18284 (file_name_as_directory): Use const pointers when appropriate.
18285 (Fexpand_file_name): Likewise. In particular, newdir might
18286 point at constant storage, so make it a const pointer.
fd4ead52 18287 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
18288 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
18289 signedness issues.
f839df0c
PE
18290 (Fset_file_times, Finsert_file_contents, auto_save_error):
18291 Rename locals to avoid shadowing.
f14b7e14 18292
5716756e 18293 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
18294 (Ftry_completion, Fall_completions): Rename or remove locals
18295 to avoid shadowing.
5716756e 18296
b4c3046a
PE
18297 * marker.c (bytepos_to_charpos): Remove; unused.
18298
b45db522
PE
18299 * lisp.h (verify_bytepos, count_markers): New decls,
18300 so that gcc does not warn that these functions aren't declared.
18301
85876d07
PE
18302 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
18303 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 18304 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 18305 (copy_text): Remove unused local var.
85876d07 18306
03d78a21 18307 * filelock.c (within_one_second): Now static.
b3dd38ab 18308 (lock_file_1): Rename local to avoid shadowing.
03d78a21 18309
5df8f01b
PE
18310 * buffer.c (fix_overlays_before): Mark locals as initialized.
18311 (fix_start_end_in_overlays): Likewise. This function should be
18312 simplified by using pointers-to-pointers, but that's a different
18313 matter.
b1d876f1 18314 (switch_to_buffer_1): Now static.
8f54f30a
PE
18315 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
18316 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 18317
a70072c9 18318 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 18319 Fix pointer signedness issue.
edced198
PE
18320 (sys_subshell): Mark local as volatile if checking for lint,
18321 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 18322 (MAXPATHLEN): Define only if needed.
a70072c9 18323
a0977c44
PE
18324 * process.c (serial_open, serial_configure): Move decls from here ...
18325 * systty.h: ... to here, so that they can be checked.
18326
a884fdcc
PE
18327 * fns.c (get_random, seed_random): Move extern decls from here ...
18328 * lisp.h: ... to here, so that they can be checked.
18329
604efe86 18330 * sysdep.c (reset_io): Now static.
b8950c94 18331 (wait_for_termination_signal): Remove; unused.
604efe86 18332
38fc62d9
PE
18333 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
18334 (copy_keymap_item, append_key, push_text_char_description):
18335 Now static.
1004a21a 18336 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 18337 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
18338 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
18339 (describe_map_tree):
18340 Rename locals to avoid shadowing.
38fc62d9 18341
2f2650da
PE
18342 * keyboard.c: Declare functions static if they are not used elsewhere.
18343 (echo_char, echo_dash, cmd_error, top_level_2):
18344 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
18345 (read_char, kbd_buffer_get_event, make_lispy_position):
18346 (make_lispy_event, make_lispy_movement, apply_modifiers):
18347 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
18348 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
18349 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 18350 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 18351 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 18352
a053e86c 18353 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
18354 (mark_kboards): Move decl here ...
18355 * alloc.c (mark_kboards): ... from here.
a053e86c 18356
4752793e
PE
18357 * lisp.h (force_auto_save_soon): New decl.
18358
74f10ca7 18359 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
18360 (DEFINE_DUMMY_FUNCTION): New macro.
18361 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
18362 Use it.
c03cd23f
PE
18363 (main): Add casts to avoid warnings
18364 if GCC considers string literals to be constants.
74f10ca7 18365
022e70d4
PE
18366 * lisp.h (fatal_error_signal): Add decl, since it's exported.
18367
59d6fe83
PE
18368 * dbusbind.c: Pointer signedness fixes.
18369 (xd_signature, xd_append_arg, xd_initialize):
18370 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18371 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18372 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
18373 (Fdbus_register_signal): Use SSDATA when the context wants char *.
18374
78320123
PE
18375 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
18376 if GCC considers string literals to be constants.
49cebcca 18377 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 18378
35ac2a97
SM
183792011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
18380
fb103ca9
SM
18381 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18382 (print_preprocess, print_object): New macro to fix last change.
18383
35ac2a97
SM
18384 * print.c (print_preprocess): Don't forget font objects.
18385
62973b41
JB
183862011-03-16 Juanma Barranquero <lekktu@gmail.com>
18387
18388 * emacs.c (USAGE3): Doc fixes.
18389
0e48bb22
AS
183902011-03-15 Andreas Schwab <schwab@linux-m68k.org>
18391
18392 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
18393 structure.
18394
7684e57b
JB
183952011-03-14 Juanma Barranquero <lekktu@gmail.com>
18396
18397 * lisp.h (VWindow_system, Qfile_name_history):
18398 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
18399 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
18400 (w32_system_caret_x, w32_system_caret_y): Declare extern.
18401
18402 * w32select.c: Don't #include "keyboard.h".
c96bbc66 18403 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
18404
18405 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18406 * w32console.c (detect_input_pending, read_input_pending)
18407 (encode_terminal_code):
18408 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18409 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18410 (w32_system_caret_y, Qfile_name_history):
18411 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18412 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18413 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18414 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18415 * w32proc.c (Qlocal, report_file_error):
18416 * w32term.c (Vwindow_system, updating_frame):
18417 * w32uniscribe.c (initialized, uniscribe_font_driver):
18418 Remove unneeded extern declarations.
18419
2aa46d6c
CY
184202011-03-14 Chong Yidong <cyd@stupidchicken.com>
18421
c96bbc66 18422 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 18423
cffc6f3b
CY
184242011-03-13 Chong Yidong <cyd@stupidchicken.com>
18425
18426 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18427 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18428 These macros can no longer be used for assignment.
18429
44f230aa
SM
18430 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18431 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
18432 (record_buffer_markers, fetch_buffer_markers): New functions for
18433 recording and fetching special buffer markers.
18434 (set_buffer_internal_1, set_buffer_temp): Use them.
18435
18436 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18437
18438 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18439
18440 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18441 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
18442
18443 * xdisp.c (hscroll_window_tree):
18444 (reconsider_clip_changes): Use PT instead of BUF_PT.
18445
d251f04b
EZ
184462011-03-13 Eli Zaretskii <eliz@gnu.org>
18447
18448 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18449 $(EMACS_ROOT)/lib/intprops.h.
18450
f0c77cd1
PE
184512011-03-13 Paul Eggert <eggert@cs.ucla.edu>
18452
3eca4629
PE
18453 Fix more problems found by GCC 4.5.2's static checks.
18454
7c86ee98
PE
18455 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18456 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
18457 (xg_free_frame_widgets): Make it clear that a local variable is
18458 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
18459 (gdk_window_get_screen): Make it clear that this macro is needed
18460 only if USE_GTK_TOOLTIP.
1e5524e7
PE
18461 (int_gtk_range_get_value): New function, which avoids a diagnostic
18462 from gcc -Wbad-function-cast.
18463 (xg_set_toolkit_scroll_bar_thumb): Use it.
18464 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18465 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
18466 (get_utf8_string, xg_get_file_with_chooser):
18467 Rename locals to avoid shadowing.
18468 (create_dialog): Move locals to avoid shadowing.
7c86ee98 18469
41729b81
PE
18470 * xgselect.c (xg_select): Remove unused var.
18471
f0c77cd1
PE
18472 * image.c (four_corners_best): Mark locals as initialized.
18473 (gif_load): Initialize transparent_p to zero (Bug#8238).
18474 Mark another local as initialized.
ec6cf4c6 18475 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 18476
ce0ad53d 18477 * image.c (clear_image_cache): Now static.
d5d5a617 18478 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 18479 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
18480 (x_edge_detection): Remove unnecessary cast that
18481 gcc -Wbad-function-cast diagnoses.
2037898d 18482 (gif_load): Fix pointer signedness.
6ae141d6
PE
18483 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18484 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 18485
33383987 184862011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 18487
d32df629
PE
18488 Improve quality of tests for time stamp overflow.
18489 For example, without this patch (encode-time 0 0 0 1 1
18490 1152921504606846976) returns the obviously-bogus value (-948597
18491 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18492 reports time overflow. See
18493 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
18494 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18495 * editfns.c: Include limits.h and intprops.h.
18496 (TIME_T_MIN, TIME_T_MAX): New macros.
18497 (time_overflow): Move earlier, to before first use.
18498 (hi_time, lo_time): New functions, for an accurate test for
18499 out-of-range times.
18500 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18501 (Fget_internal_run_time): Don't assume time_t fits in int.
18502 (make_time): Use list2 instead of Fcons twice.
18503 (Fdecode_time): More accurate test for out-of-range times.
18504 (check_tm_member): New function.
18505 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
18506 (lisp_time_argument): Don't rely on undefined left-shift and
18507 right-shift behavior when checking for time stamp overflow.
8be6f318 18508
fe31d94c
PE
18509 * editfns.c (time_overflow): New function, refactoring common code.
18510 (Fformat_time_string, Fdecode_time, Fencode_time):
18511 (Fcurrent_time_string): Use it.
18512
8be6f318
PE
18513 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18514 * dired.c (make_time): Move to ...
18515 * editfns.c (make_time): ... here.
18516 * systime.h: Note the move.
18517
09d9db2c 185182011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 18519
126bc0dc
YM
18520 * fringe.c (update_window_fringes): Remove unused variables.
18521
c47cbdfd
YM
18522 * unexmacosx.c (copy_data_segment): Also copy __got section.
18523 (Bug#8223)
18524
7ac80be9
EZ
185252011-03-12 Eli Zaretskii <eliz@gnu.org>
18526
c96bbc66 18527 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
18528 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
18529 Constify `char *' arguments and their references according to
18530 prototypes in tparam.h.
18531
ecb0f94d 18532 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 18533
7ac80be9
EZ
18534 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
18535 Adapt all references accordingly.
18536
18537 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
18538
ef1fd07e
TT
185392011-03-11 Tom Tromey <tromey@redhat.com>
18540
18541 * buffer.c (syms_of_buffer): Remove obsolete comment.
18542
7ef4b50c
EZ
185432011-03-11 Eli Zaretskii <eliz@gnu.org>
18544
18545 * termhooks.h (encode_terminal_code): Declare prototype.
18546
18547 * msdos.c (encode_terminal_code): Don't declare prototype.
18548
18549 * term.c (encode_terminal_code): Now external again, used by
18550 w32console.c and msdos.c.
18551
44f230aa
SM
18552 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
18553 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 18554
4b1ec863 185552011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 18556
1714f52b 18557 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 18558
4b1ec863
PE
18559 * fringe.c (update_window_fringes): Mark locals as initialized
18560 (Bug#8227).
18561 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 18562
524c7aa6
PE
18563 * alloc.c (mark_fringe_data): Move decl from here ...
18564 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
18565 to check its interface.
18566 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
18567
a5c0af81 18568 * fontset.c (free_realized_fontset): Now static.
7519b8cd 18569 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 18570 (fontset_font): Mark local as initialized.
a9a06e0b 18571 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 18572
b4716021
PE
18573 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
18574
811e9bac 18575 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 18576 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
18577 (x_own_selection, Fx_disown_selection_internal): Rename locals
18578 to avoid shadowing.
18579 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 18580
7e3ab302
PE
18581 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
18582 so that the caller can use some name other than gcpro1.
18583 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
18584 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18585 (Fx_backspace_delete_keys_p):
18586 Use them to avoid shadowing, and rename vars to avoid shadowing.
18587 (x_decode_color, x_set_name, x_window): Now static.
6b437900 18588 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 18589 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
18590 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18591 Remove unused locals.
7e3ab302
PE
18592 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18593 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18594 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18595 macros.
f78faa98 18596
e2b13473
PE
18597 * xterm.h (x_mouse_leave): New decl.
18598
77f23912
PE
18599 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18600 Remove unused functions.
cdf4ba58
PE
18601 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18602 (x_calc_absolute_position): Now static.
7411c686 18603 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 18604 Don't declare local "event" unless it's used.
ed7bf3a5
PE
18605 (x_iconify_frame, x_free_frame_resources): Don't declare locals
18606 unless they are used.
38d0b34a
PE
18607 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18608 (x_fatal_error_signal): Remove; not used.
a6067996
PE
18609 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18610 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18611 (x_error_catcher, x_connection_closed, x_error_handler):
18612 (x_error_quitter, xembed_send_message, x_iconify_frame):
18613 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 18614 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 18615 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 18616
44f230aa
SM
18617 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18618 Rename or move locals to avoid shadowing.
6b463e58 18619 (tty_defined_color, merge_face_heights): Now static.
5967d051 18620 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
18621 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18622 does not deduce is never used uninitialized.
73719eba
PE
18623 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18624 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 18625
426994c3 18626 * terminal.c (store_terminal_param): Now static.
5489860b 18627
032f1620 18628 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 18629 (set_frame_menubar): Remove unused local.
d4323972 18630 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
18631 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18632 since they might point to immutable storage.
281585b0
PE
18633 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18634 since it's unused otherwise.
032f1620 18635
367c19e5 18636 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 18637 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
18638 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18639 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 18640 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
18641 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18642 does not deduce are never used uninitialized.
70739cbe 18643
07b48fa9
PE
18644 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18645
8868a238 18646 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
18647 * window.c (window_loop, size_window):
18648 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 18649
7e5cf297 18650 * window.c (display_buffer): Now static.
d6550a9f
PE
18651 (size_window): Mark variables that gcc -Wuninitialized
18652 does not deduce are never used uninitialized.
a586633d
PE
18653 * window.h (check_all_windows): New decl, to forestall
18654 gcc -Wmissing-prototypes diagnostic.
5b555da1 18655 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 18656
f6095868
PE
18657 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18658 shadowing.
18659 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
18660 Include <limits.h>.
18661 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18662 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
18663 (load_charset_map): Mark variables that gcc -Wuninitialized
18664 does not deduce are never used uninitialized.
53df7c11 18665 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 18666
f38b440c
PE
18667 * coding.c (coding_set_source, coding_set_destination):
18668 Use "else { /* comment */ }" rather than "else /* comment */;"
18669 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
18670 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18671 a block, when the outer 'i' will do.
18672 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18673 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18674 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18675 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
18676 (Fdecode_sjis_char, Fdefine_coding_system_internal):
18677 Rename locals to avoid shadowing.
18678 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
18679 * coding.c (emacs_mule_char, encode_invocation_designation):
18680 Now static, since they're not used elsewhere.
413bb2db 18681 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 18682 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
18683 (decode_coding_emacs_mule): Mark variables that gcc
18684 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
18685 (detect_coding_iso_2022): Initialize a local variable that might
18686 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 18687 this initialization is needed. (Bug#8211)
5f58e762
PE
18688 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
18689 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
18690 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
18691 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
18692 Remove unused macros.
f38b440c 18693
232b38b9 18694 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 18695 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 18696 * character.c (string_count_byte8): Likewise.
232b38b9 18697
fb90da1b
PE
18698 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
18699 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
18700
fb93dbc2
PE
18701 * chartab.c (copy_sub_char_table): Now static, since it's not used
18702 elsewhere.
5c156ace
PE
18703 (sub_char_table_ref_and_range, char_table_ref_and_range):
18704 Rename locals to avoid shadowing.
bbcd0949 18705 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 18706
7d3b3862 18707 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 18708 (BIDI_BOB): Remove unused macro.
7d3b3862 18709
6be7d3da
PE
18710 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18711 deduce are never used uninitialized.
c2ed9c8b 18712 * term.c (encode_terminal_code): Likewise.
6be7d3da 18713
75f8807f 18714 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 18715
50938595
PE
18716 * tparam.h: New file.
18717 * term.c, tparam.h: Include it.
18718 * deps.mk (term.o, tparam.o): Depend on tparam.h.
18719 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18720 Move these decls to tparam.h, and make them agree with what
18721 is actually in tparam.c. The previous trick of using incompatible
18722 decls in different modules does not conform to the C standard.
18723 All callers of tparam changed to use tparam's actual API.
18724 * tparam.c (tparam1, tparam, tgoto):
18725 Use const pointers where appropriate.
18726
fbceeba2
PE
18727 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18728 * cm.h (struct cm): Likewise.
18729 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18730 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18731 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18732 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18733 (turn_on_face, init_tty): Likewise.
18734 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 18735
7f3f1250
PE
18736 * term.c (term_mouse_position): Rename local to avoid shadowing.
18737
e6ca6543
PE
18738 * alloc.c (mark_ttys): Move decl from here ...
18739 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18740
c40f8d15
AS
187412011-03-11 Andreas Schwab <schwab@linux-m68k.org>
18742
18743 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18744
cfe0661d
JB
187452011-03-09 Juanma Barranquero <lekktu@gmail.com>
18746
18747 * search.c (compile_pattern_1): Remove argument regp, unused since
18748 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18749 (compile_pattern): Don't pass it.
18750
0afb4571
J
187512011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18752
18753 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18754 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18755 for ! HAVE_GTK3.
18756 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18757
18758 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18759
18760 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18761 gdk_window_get_screen, gdk_window_get_geometry,
18762 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18763 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18764 (xg_get_pixbuf_from_pixmap): New function.
18765 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18766 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18767 Call xg_get_pixbuf_from_pixmap instead of
18768 gdk_pixbuf_get_from_drawable.
18769 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18770 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18771 (xg_check_special_colors): Use GtkStyleContext and its functions
18772 for HAVE_GTK3.
18773 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18774 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18775 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
18776 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18777 Call gtk_widget_get_preferred_size.
0afb4571
J
18778 (xg_frame_resized): gdk_window_get_geometry only takes 5
18779 parameters.
44f230aa
SM
18780 (xg_win_to_widget, xg_event_is_for_menubar):
18781 Call gdk_x11_window_lookup_for_display.
0afb4571
J
18782 (xg_set_widget_bg): New function.
18783 (delete_cb): New function.
895009e1 18784 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 18785 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
18786 (xg_set_background_color): Call xg_set_widget_bg.
18787 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18788 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18789 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18790 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18791 if ! HAVE_GTK3.
18792 (update_frame_tool_bar): Call gtk_widget_hide.
18793 (xg_initialize): Use GDK_KEY_g.
18794
18795 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18796 if ! HAVE_GTK3
18797 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18798
18799 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18800 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18801 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18802
1c2cc4ef
JB
188032011-03-08 Juanma Barranquero <lekktu@gmail.com>
18804
18805 * w32xfns.c (select_palette): Check success of RealizePalette against
18806 GDI_ERROR, not zero.
18807
33383987 18808See ChangeLog.11 for earlier changes.
aac0c6e3
MR
18809
18810;; Local Variables:
18811;; coding: utf-8
aac0c6e3
MR
18812;; End:
18813
2f097256 18814 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
18815
18816 This file is part of GNU Emacs.
18817
18818 GNU Emacs is free software: you can redistribute it and/or modify
18819 it under the terms of the GNU General Public License as published by
18820 the Free Software Foundation, either version 3 of the License, or
18821 (at your option) any later version.
18822
18823 GNU Emacs is distributed in the hope that it will be useful,
18824 but WITHOUT ANY WARRANTY; without even the implied warranty of
18825 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18826 GNU General Public License for more details.
18827
18828 You should have received a copy of the GNU General Public License
18829 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.