Merge from trunk.
[bpt/emacs.git] / src / ChangeLog
1 2012-10-09 Eli Zaretskii <eliz@gnu.org>
2
3 * w32fns.c (w32_last_error): Change the return value to DWORD, to
4 match what GetLastError returns. Explain why the function is
5 needed.
6
7 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
8 'is_tooltip_frame', to avoid confusion with its global namesake.
9
10 2012-10-08 Daniel Colascione <dancol@dancol.org>
11
12 * xdisp.c (start_hourglass): Call w32_note_current_window when
13 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
14 build that caused Emacs to display the hourglass cursor forever.
15
16 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
17 which is broken under remote desktop, calculate the number of
18 colors available for a display based on the display's number of
19 planes and number of bits per pixel per plane. (bug#10397).
20
21 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
22
23 * nsfont.m (Vfonts_in_cache): New variable.
24 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
25 are used. Add cached fonts to Vfonts_in_cache.
26 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
27
28 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
29
30 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
31 in nt/config.nt.
32 (FONT_H): Define after FRAME_H.
33 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
34 Update dependencies.
35
36 * w32term.c: Remove leftover declaration of keyboard_codepage.
37
38 2012-10-08 Eli Zaretskii <eliz@gnu.org>
39
40 * makefile.w32-in (FONT_H): Add $(FRAME_H).
41 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
42 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
43 (GLOBAL_SOURCES): Add cygw32.c.
44 ($(BLD)/unexw32.$(O)):
45 ($(BLD)/w32.$(O)):
46 ($(BLD)/w32console.$(O)):
47 ($(BLD)/w32fns.$(O)):
48 ($(BLD)/w32heap.$(O)):
49 ($(BLD)/w32menu.$(O)):
50 ($(BLD)/w32proc.$(O)): Add w32common.h.
51
52 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
53 'const char *'.
54 (x_to_w32_color): Don't modify the argument, modify a copy instead.
55
56 2012-10-08 Daniel Colascione <dancol@dancol.org>
57
58 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
59 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
60 accidental message numbering hole. Change other messages to
61 match.
62
63 * w32select.h (HAVE_W32SELECT): Remove.
64
65 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
66 w32common.h instead of w32heap.h
67
68 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
69 (get_allocation_unit, get_processor_type, get_w32_major_version)
70 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
71 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
72 (OS_NT, os_subtype, cache_system_info): Move declarations to
73 w32common.
74
75 * w32heap.c: Include w32common.h.
76 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
77 (w32_minor_version, w32_build_number, w32_subtype): Remove
78 duplicate definitions.
79
80 * w32fns.c: Include w32common.h; include w32heap.h only in
81 WINDOWSNT.
82
83 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
84 Use `report_file_error' instead of `error' in order to better
85 inform users of what went wrong. Increase NTGUI_UNICODE file
86 dialog box file name length to 32k, the maximum allowed by the NT
87 kernel.
88
89 * w32common.h: New file.
90 (ROUND_UP, ROUND_DOWN, get_page_size)
91 (get_allocation_unit, get_processor_type, get_w32_major_version)
92 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
93 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
94 (OS_NT, os_subtype, cache_system_info): Move here.
95
96 * unexw32.c, unexcw.c: Include w32common.h.
97
98 * emacs.c (main): Use (defined (WINDOWSNT) || defined
99 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
100 to call syms_of_w32select.
101
102 * cygw32.h: Remove obsolete EXFUN declarations.
103
104 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
105
106 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
107 of w32inevt.o from SOME_MACHINE_OBJECTS.
108
109 2012-10-08 Daniel Colascione <dancol@dancol.org>
110
111 * image.c: Permanent fix for JPEG compilation issue --- limit
112 jpeglib `boolean' redefinition to Cygwin builds.
113
114 2012-10-08 Eli Zaretskii <eliz@gnu.org>
115
116 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
117
118 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
119 Cygwin.
120
121 2012-10-08 Daniel Colascione <dancol@dancol.org>
122
123 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
124 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
125 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
126 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
127 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
128 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
129 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
130 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
131 now a supported configuration.
132
133 * Makefile.in: consolidate image variables into LIBIMAGE; add
134 W32_OBJ and W32_LIBS. Compile new files.
135
136 * conf_post.h:
137 (_DebPrint) declare tracing facility for W32 debugging. We need
138 to unify tracing later.
139
140 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
141 unconditional use of W32 Unicode functions. Cygwin runs only on
142 100% Unicode operating systems.
143
144 * cygw32.c: New file. Define Cygwin-specific facilities.
145 (Fcygwin_convert_path_to_windows)
146 (Fcygwin_convert_path_from_windows): New user functions for
147 accessing Cygwin path-munging routines.
148
149 * cygw32.h: New file.
150 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
151 UTF-16LE strings temporarily inside non-Lisp-visible string
152 objects.
153
154 (w32_strerror): Just what it says on the tin.
155
156 * emacs.c: Make the NS fork-then-exec code for daemon-launching
157 also run for Cygwin; both systems have the same problem with using
158 GUI facilities in a forked child. Also call syms_of_cygw32,
159 syms_of_w32select in correct places.
160
161 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
162 needs fork-then-exec for daemon launching.
163
164 * font.h: Include frame.h.
165
166 * image.c: Use the image library cache machinery only when we're
167 compiling for native WINDOWSNT; Cygwin can use shared libraries
168 like any other Unixlike system.
169
170 * keyboard.c: Clarify a comment regarding the input loop.
171
172 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
173 functions directly instead of trying to detect at runtime that our
174 host operating system supports them. We make this change for two
175 reasons: Cygwin lacks support for the multibyte character
176 conversion functions used by the legacy menu code, and Cygwin
177 never needs to rely on non-Unicode APIs.
178
179 * unexw32.c (hinst): Declare extern.
180
181 * w32.c: Change header order;
182 (w32_strerror): Move to w32fns.c because we need it for
183 non-WINDOWSNT builds.
184
185 * w32.h: Add #error macro to make sure we don't include w32.h for
186 Cygwin builds. Remove w32select declarations.
187
188 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
189 w32fns.c. w32console.c is WINDOWSNT-only.
190
191 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
192 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
193 POSIXy alternative.
194 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
195 (w32_major_version, w32_minor_version, w32_build_number)
196 (os_subtype, sound_type): Define here
197 (w32_defined_color): Make color parameter const for consistency
198 with other _defined_color functions.
199 (w32_createwindow): Unconditionally call w32_init_class instead of
200 doing so only when hprevinst is non-NULL. Plumbing hprevinst
201 through the code is complex and unnecessary because class
202 registration is practically free.
203 (w32_name_of_message): New EMACSDEBUG-only function.
204 (Fset_message_beep): Move here
205 (Fx_open_connection): Require that the display name for Windows be
206 "w32" for consistency, emacsclient disambiguation, and maybe, one
207 day, multi-window-system support.
208 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
209 Cygwin files for W32 GUI facilities, since these clearly don't
210 expect Cygwin names.
211 (_DebPrint): Define.
212 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
213 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
214 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
215 (w32_last_error): Remove.
216
217 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
218
219 * w32heap.c (syspage_mask): Declare here.
220 (cache_system_info): Remove.
221
222 * w32inevt.c (faked_key): Define globally, not statically.
223 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
224 (w32_console_toggle_lock_key): Move to w32fns.c.
225
226 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
227
228 * w32proc.c (_DebPrint): Move to w32fns.c.
229 * w32select.c: Include string.h, stdio.h for Cygwin.
230 * w32select.h: New File.
231
232 * w32term.c: Include io.h for non-CYGWIN builds; needed for
233 get_osfhandle.
234 (w32_message_fd): New variable. Under Cygwin, holds the file
235 descriptor the system used to tell us about pending thread
236 messages.
237
238 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
239 that prevented compilation under non-WINDOWSNT systems.
240
241 (w32_initialize): Open /dev/windows and assign it to
242 w32_message_fd. Provide w32 feature.
243
244 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
245 (WM_EMACS_INPUT_READY): add.
246 (prepend_msg, w32_message_fd): Declare globally.
247
248 * w32xfns.c:
249 (keyboard_handle): Use only when WINDOWSNT.
250 (notify_msg_ready): New function. Posts a message to the main
251 thread's message queue under CYGWIN, which wakes up the main
252 thread from select(2) by making the /dev/windows file descriptor
253 ready. Under WINDOWSNT, it sets an event the same way the old
254 code did.
255
256 (post, prepend_msg): Actually call notify_msg_ready instead of
257 setting the input event directly.
258
259 2012-10-07 Eli Zaretskii <eliz@gnu.org>
260
261 * ralloc.c (relinquish): If a heap is ready to be relinquished,
262 but it still has blocs in it, don't return it to the system,
263 instead of aborting. (Bug#12402)
264
265 2012-10-07 Eli Zaretskii <eliz@gnu.org>
266
267 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
268 (WM_EMACS_END): Bump value by 1.
269
270 * w32term.c (lispy_file_action, queue_notifications): New functions.
271 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
272 <Qrenamed_to>: New symbols.
273
274 * w32notify.c: New file, implement file event notifications for
275 MS-Windows.
276
277 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
278 by posting it to the w32_read_socket queue.
279
280 * termhooks.h (enum event_kind) [WINDOWSNT]: New event kind
281 FILE_NOTIFY_EVENT.
282
283 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
284 (GLOBAL_SOURCES): Add w32notify.c
285 ($(BLD)/w32notify.$(O)): New set of dependencies.
286
287 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
288
289 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]: Handle
290 FILE_NOTIFY_EVENT.
291 (syms_of_keyboard) [WINDOWSNT] <Qfile_notify>: New symbol.
292 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
293 w32notify-handle-event by default.
294
295 * emacs.c (main) [WINDOWSNT]: Call syms_of_w32notify.
296
297 * alloc.c (NSTATICS): Enlarge to 0x660.
298
299 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
300
301 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
302
303 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
304 MAC_OS_X_VERSION_10_6.
305 (syms_of_nsterm): Remove comment about Panther and above for
306 ns-antialias-text.
307 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
308 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
309 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
310
311 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
312 MAC_OS_X_VERSION_10_4.
313
314 * nsmenu.m (fillWithWidgetValue:): Remove code for <
315 MAC_OS_X_VERSION_10_2.
316
317 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
318
319 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
320 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
321
322 * nsterm.m (ns_in_resize): Remove (Bug#12479).
323 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
324 (ns_clear_frame, sendEvent, windowDidResize, drawRect:): Remove
325 ns_in_resize check.
326 (ns_clear_frame_area): Remove resize handle code.
327
328 * nsfns.m (ns_in_resize): Remove.
329 (x_set_icon_name, ns_set_name, ns_set_name_as_filename): Remove
330 ns_in_resize check.
331
332 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
333
334 Improve sys_siglist detection.
335 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
336 defined as a macro, as is done in Solaris.
337 (sys_siglist_entries): New macro.
338 (save_strsignal): Use it.
339 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
340 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
341
342 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
343
344 * nsfns.m (Fx_create_frame): Call x_default_parameter with
345 fullscreen/Fullscreen.
346
347 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
348 tobar_height is new.
349
350 * nsterm.m (x_make_frame_visible): Check for fullscreen.
351 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
352 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
353 (windowDidResize:): Check for correct window if old style fullscreen.
354 Capitalize word in comment. Remove incorrect comment.
355 (initFrameFromEmacs:): tbar_height renamed tibar_height.
356 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
357 error in drawing background.
358 (toggleFullScreen:): Remove comment. Rearrange calls.
359 Set toolbar values to zero, save old height in tobar_height.
360 Restore tool bar height when leaving fullscreen.
361 (canBecomeMainWindow): New function.
362
363 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
364
365 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
366
367 2012-10-05 Eli Zaretskii <eliz@gnu.org>
368
369 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
370
371 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
372 that time stamps of directories could also be changed. Don't
373 request the too broad GENERIC_WRITE, only the more restrictive
374 FILE_WRITE_ATTRIBUTES access rights.
375
376 * fileio.c (Fset_file_times): Special-case ignoring errors for
377 directories only on MSDOS, not on MS-Windows.
378
379 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
380
381 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
382
383 2012-10-04 Eli Zaretskii <eliz@gnu.org>
384
385 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
386 see whether CreateFile failed.
387
388 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
389
390 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
391 to avoid similar races.
392 * keyboard.c (pending_signals): Now bool, not int.
393
394 Port timers to OpenBSD, plus check for timer failures.
395 OpenBSD problem reported by Han Boetes.
396 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
397 and/or setitimer.
398 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
399 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
400 like OpenBSD, which has timer_settime but does not declare it.
401 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
402 whether to use itimerspec-related primitives. All uses of
403 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
404
405 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
406
407 * profiler.c (handle_profiler_signal): Fix a malloc race
408 that caused Emacs to hang on Fedora 17 when profiling Lisp.
409
410 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
411
412 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
413
414 2012-10-02 Eli Zaretskii <eliz@gnu.org>
415
416 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
417 consistent with the change in return value of 'safe_strsignal'.
418
419 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
420
421 Prefer plain 'static' to 'static inline' (Bug#12541).
422 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
423 (bidi_set_sor_type, bidi_push_embedding_level)
424 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
425 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
426 (bidi_cache_search, bidi_cache_ensure_space)
427 (bidi_cache_iterator_state, bidi_cache_find)
428 (bidi_peek_at_next_level, bidi_set_paragraph_end)
429 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
430 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
431 Now 'static', not 'static inline'.
432
433 Count overruns when profiling; change units to ns.
434 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
435 Give extra weight to samples after overruns, to attempt to count
436 the time more accurately.
437 (setup_cpu_timer): Change sampling interval units from ms to ns, since
438 the underlying primitives nominally do ns.
439 (Fprofiler_cpu_start): Document the change. Mention that
440 the sampling intervals are only approximate.
441
442 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
443
444 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
445
446 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
447 case for the special 0 coding-system.
448
449 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
450 (Fmake_overlay): Remove redundant tests.
451 (fix_start_end_in_overlays): Remove redundant recentering.
452
453 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
454
455 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
456 Update dependencies.
457
458 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
459
460 Fix a malloc race condition involving strsignal.
461 A signal can arrive in the middle of a malloc, and Emacs's signal
462 handler can invoke strsignal, which can invoke malloc, which is
463 not portable. This race condition bug makes Emacs hang on GNU/Linux.
464 Fix it by altering the signal handler so that it does not invoke
465 strsignal.
466 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
467 * process.c (status_message): Use const pointer, in case strsignal
468 is #defined to safe_strsignal.
469 * sysdep.c (sys_siglist, init_signals): Always define and
470 initialize a substitute sys_siglist if the system does not define
471 one, even if HAVE_STRSIGNAL.
472 (safe_strsignal): Rename from strsignal. Always define,
473 using sys_siglist. Return a const pointer.
474 * syssignal.h (safe_strsignal): New decl.
475 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
476
477 2012-10-01 Eli Zaretskii <eliz@gnu.org>
478
479 * w32proc.c (timer_loop): Fix code that waits for timer
480 expiration, to avoid high CPU usage.
481
482 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
483
484 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
485 (sweep_weak_table): Remove redundant prototypes.
486
487 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
488
489 * emacs.c: Move the inclusion of TERM_HEADER after including
490 windows.h on WINDOWSNT. This avoids compilation problems with
491 MSVC.
492
493 2012-10-01 Eli Zaretskii <eliz@gnu.org>
494
495 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
496 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
497 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
498 as the previous version used 'void *'.
499
500 * ralloc.c (ROUNDUP): Fix last change.
501 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
502 'size_t'.
503
504 * w32proc.c <disable_itimers>: New static flag.
505 (init_timers): Initialize it to zero, after creating the critical
506 sections used by the timer threads.
507 (term_timers): Set to 1 before deleting the critical sections.
508 (getitimer, setitimer): If disable_itimers is non-zero, return an
509 error indication without doing anything. Reported by Fabrice
510 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
511 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
512 return results.
513 [!HAVE_SETITIMER]: Behave as the previous version that didn't
514 support timers.
515
516 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
517 term_ntproc after all the other bookkeeping, to get timers working
518 as long as possible.
519
520 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
521
522 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
523 Suggested by Juri Linkov in
524 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
525
526 Prefer plain 'static' to 'static inline' (Bug#12541).
527 With static functions, modern compilers inline pretty well by
528 themselves; advice from programmers often hurts as much as it helps.
529 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
530 this change shrinks the text size of the Emacs executable by 1.1%
531 without affecting CPU significantly in my benchmark.
532 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
533 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
534 (mark_maybe_object, mark_maybe_pointer, bounded_number):
535 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
536 (bset_auto_fill_function, bset_auto_save_file_format)
537 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
538 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
539 (bset_cache_long_line_scans, bset_case_fold_search)
540 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
541 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
542 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
543 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
544 (bset_header_line_format, bset_indicate_buffer_boundaries)
545 (bset_indicate_empty_lines, bset_invisibility_spec)
546 (bset_left_fringe_width, bset_major_mode, bset_mark)
547 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
548 (bset_name, bset_overwrite_mode, bset_pt_marker)
549 (bset_right_fringe_width, bset_save_length)
550 (bset_scroll_bar_width, bset_scroll_down_aggressively)
551 (bset_scroll_up_aggressively, bset_selective_display)
552 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
553 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
554 (set_buffer_overlays_after):
555 * category.c (bset_category_table):
556 * charset.c (read_hex):
557 * coding.c (produce_composition, produce_charset)
558 (handle_composition_annotation, handle_charset_annotation)
559 (char_encodable_p):
560 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
561 (assign_row, set_frame_matrix_frame, make_current)
562 (add_row_entry):
563 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
564 * fns.c (maybe_resize_hash_table):
565 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
566 * gmalloc.c (register_heapinfo):
567 * image.c (lookup_image_type):
568 * intervals.c (set_interval_object, set_interval_left)
569 (set_interval_right, copy_interval_parent, rotate_right)
570 (rotate_left, balance_possible_root_interval):
571 * keyboard.c (kset_echo_string, kset_kbd_queue)
572 (kset_keyboard_translate_table, kset_last_prefix_arg)
573 (kset_last_repeatable_command, kset_local_function_key_map)
574 (kset_overriding_terminal_local_map, kset_real_last_command)
575 (kset_system_key_syms, clear_event, set_prop):
576 * lread.c (digit_to_number):
577 * marker.c (attach_marker, live_buffer, set_marker_internal):
578 * nsterm.m (ns_compute_glyph_string_overhangs):
579 * process.c (pset_buffer, pset_command)
580 (pset_decode_coding_system, pset_decoding_buf)
581 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
582 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
583 (pset_status, pset_tty_name, pset_type, pset_write_queue):
584 * syntax.c (bset_syntax_table, dec_bytepos):
585 * terminal.c (tset_param_alist):
586 * textprop.c (interval_has_some_properties)
587 (interval_has_some_properties_list):
588 * window.c (wset_combination_limit, wset_dedicated)
589 (wset_display_table, wset_hchild, wset_left_fringe_width)
590 (wset_left_margin_cols, wset_new_normal, wset_new_total)
591 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
592 (wset_right_fringe_width, wset_right_margin_cols)
593 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
594 (wset_vertical_scroll_bar_type, wset_window_parameters):
595 * xdisp.c (wset_base_line_number, wset_base_line_pos)
596 (wset_column_number_displayed, wset_region_showing)
597 (window_box_edges, run_window_scroll_functions)
598 (append_glyph_string_lists, prepend_glyph_string_lists)
599 (append_glyph_string, set_glyph_string_background_width)
600 (append_glyph, append_composite_glyph)
601 (take_vertical_position_into_account):
602 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
603 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
604 (lface_hash, lface_same_font_attributes_p, lookup_face):
605 * xml.c (libxml2_loaded_p):
606 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
607 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
608 Now 'static', not 'static inline'.
609
610 * bidi.c: Tune.
611 (bidi_copy_it): Do the whole copy with a single memcpy.
612 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
613
614 Revert the FOLLOW-SYMLINKS change for file-attributes.
615 Doing it right would require several changes to Tramp, and there's
616 not enough time to get that tested before the freeze today.
617 * dired.c (directory_files_internal, Ffile_attributes):
618 Undo last change.
619
620 * frame.c (x_report_frame_params): Port better to wider ints.
621 Do not assume that EMACS_UINT is the same width as uprintmax_t,
622 or that pointers can be printed in 15 decimal digits.
623 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
624
625 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
626
627 Support x64 build on MS-Windows.
628 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
629 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
630 compatibility with x64.
631 (x_get_focus_frame): Add prototype.
632
633 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
634 defining an XRectangle structure.
635
636 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
637 arithmetics for compatibility with x64.
638
639 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
640 compatibility with x64.
641
642 * w32heap.h: Adjust prototypes and declarations.
643
644 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
645 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
646 DWORD, long, and unsigned long, for compatibility with x64.
647 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
648 (sbrk): Argument is now of type ptrdiff_t.
649
650 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
651 less than 0x0500.
652 (w32_msg_pump): Use WPARAM type for 'result'.
653
654 * w32.c (init_environment, get_emacs_configuration): Support AMD64
655 architecture.
656 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
657 compatibility with x64.
658
659 * vm-limit.c (lim_data): Now size_t.
660 (check_memory_limits): Adjust prototypes of real_morecore and
661 __morecore to receive argument of type ptrdiff_t. Use size_t for
662 five_percent and data_size.
663
664 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
665 variables, for compatibility with x64.
666 (rva_to_section, offset_to_section, relocate_offset)
667 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
668 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
669 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
670 for compatibility with x64.
671
672 * sysdep.c (STDERR_FILENO): Define if not already defined.
673
674 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
675 (__morecore): Argument type is now ptrdiff_t.
676 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
677 (relinquish): Use ptrdiff_t type for 'excess'.
678 (r_alloc_sbrk): Argument type is now ptrdiff_t.
679
680 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
681 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
682 instead of a literal number.
683
684 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
685 (min): Define only if not already defined.
686
687 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
688 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
689 hosts.
690
691 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
692 'bitmaps' is a pointer.
693
694 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
695
696 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
697
698 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
699
700 file-attributes has a new optional arg FOLLOW-SYMLINKS.
701 * dired.c (directory_files_internal, Ffile_attributes):
702 New arg follow_symlinks. All uses changed.
703
704 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
705
706 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
707
708 2012-09-30 Eli Zaretskii <eliz@gnu.org>
709
710 Support atimers and CPU profiler via profile.c on MS-Windows.
711 * w32proc.c (sig_mask, crit_sig): New static variables.
712 (sys_signal): Support SIGALRM and SIGPROF.
713 (sigemptyset, sigaddset, sigfillset, sigprocmask)
714 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
715 sigfillset, and sigprocmask are no longer no-ops.
716 (sigismember): New function.
717 (struct itimer_data): New definition.
718 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
719 (crit_prof): New static variables.
720 (MAX_SINGLE_SLEEP): New definition.
721 (timer_loop, stop_timer_thread, term_timers, init_timers)
722 (start_timer_thread, getitimer, setitimer): New functions.
723 (alarm): No longer a no-op, calls setitimer.
724
725 * w32.c (term_ntproc): Call term_timers.
726 (init_ntproc): Make sure all signals are unblocked at startup, to
727 erase any traces of dumping. Call init_timers.
728
729 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
730 Windows-specific code to display the hourglass mouse pointer is no
731 longer used.
732 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
733 to hourglass timer expiration.
734 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
735 Remove, no longer used.
736 (w32_note_current_window, show_hourglass, hide_hourglass):
737 New functions, in support of hourglass cursor display similar to other
738 window systems.
739 (syms_of_w32fns): Don't initialize hourglass_timer.
740
741 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
742 WINDOWSNT as well.
743 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
744
745 * w32.h (init_timers, term_timers): Add prototypes.
746
747 2012-09-30 Kenichi Handa <handa@gnu.org>
748
749 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
750 to the buffer relocation which may be caused by ccl_driver.
751
752 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
753
754 * xfns.c (Fx_file_dialog): Update comment.
755
756 * w32fns.c (Fx_file_dialog): Update comment.
757
758 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
759 Initialize panel name field if OSX >= 10.6.
760
761 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
762
763 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
764
765 * nsterm.m (NEW_STYLE_FS): New define.
766 (ns_fullscreen_hook, windowWillEnterFullScreen)
767 (windowDidEnterFullScreen, windowWillExitFullScreen)
768 (windowDidExitFullScreen, toggleFullScreen, handleFS)
769 (setFSValue): New functions.
770 (EmacsFSWindow): New implementation.
771 (canBecomeKeyWindow): New function for EmacsFSWindow.
772 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
773 (dealloc): Release nonfs_window if in fullscreen.
774 (updateFrameSize:): Call windowDidMove to update top/left.
775 (windowWillResize:toSize:): Check if frame is still maximized.
776 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
777 next_maximized, maximized_width, maximized_height and nonfs_window.
778 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
779 tbar_height.
780 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
781 fullscreen. Set maximized_width/height. Act on next_maximized.
782
783 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
784 (EmacsView): Add variables for fullscreen.
785 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
786 (EmacsFSWindow): New interface for fullscreen.
787
788 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
789
790 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
791
792 2012-09-30 Chong Yidong <cyd@gnu.org>
793
794 * fns.c (Frandom): Doc fix.
795
796 2012-09-30 Martin Rudalics <rudalics@gmx.at>
797
798 * window.c (Vwindow_combination_limit): New default value.
799 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
800
801 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
802
803 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
804 Suggested by Eli Zaretskii in
805 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
806
807 2012-09-30 Eli Zaretskii <eliz@gnu.org>
808
809 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
810 HAVE_TIMER_SETTIME is defined.
811
812 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
813
814 Profiler improvements: more-accurate timers, overflow checks.
815 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
816 signal.h, setjmp.h. Include systime.h instead.
817 (saturated_add): New function.
818 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
819 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
820 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
821 New static vars.
822 (enum profiler_cpu_running): New enum.
823 (profiler_cpu_running): Now of that enum type, not bool.
824 All uses changed to store the new value.
825 (handle_profiler_signal): Rename from sigprof_handler_1,
826 for consistency with other handlers. Do not check whether
827 cpu_log is a hash-table if garbage collecting, since it
828 doesn't matter in that case.
829 (deliver_profiler_signal): Rename from sigprof_handler,
830 for consistency with other handlers.
831 (setup_cpu_timer): New function, with much of what used to be in
832 Fprofiler_cpu_start. Check for out-of-range argument.
833 Prefer timer_settime if available, and prefer
834 thread cputime clocks, then process cputime clocks, then
835 monotonic clocks, to the old realtime clock. Use make_timeval
836 to round more-correctly when falling back to setitimer.
837 (Fprofiler_cpu_start): Use it.
838 (Fprofiler_cpu_stop): Prefer timer_settime if available.
839 Don't assume that passing NULL as the 2nd argument of setitimer
840 is the same as passing a pointer to all-zero storage.
841 Ignore SIGPROF afterwards.
842 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
843 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
844 non-fatal signal handlers. Ignore SIGPROF on startup.
845 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
846 in profiler.c, since sysdep.c now uses it.
847
848 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
849 Suggested by Eli Zaretskii in
850 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
851
852 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
853
854 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
855
856 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
857
858 * lisp.h (struct backtrace): Remove indirection for `function' field.
859 * xdisp.c (redisplay_internal):
860 * profiler.c (record_backtrace, sigprof_handler_1):
861 * alloc.c (Fgarbage_collect):
862 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
863 (Fbacktrace_frame): Adjust accordingly.
864
865 2012-09-28 Glenn Morris <rgm@gnu.org>
866
867 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
868 (Frun_hook_with_args_until_failure): Doc fixes.
869
870 2012-09-28 Eli Zaretskii <eliz@gnu.org>
871
872 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
873 Qautomatic_redisplay and change the symbol name. All users changed.
874
875 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
876
877 * profiler.c (sigprof_handler): Fix race condition.
878
879 2012-09-28 Glenn Morris <rgm@gnu.org>
880
881 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
882
883 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
884
885 Check more robustly for timer_settime.
886 * Makefile.in (LIB_TIMER_TIME): New macro.
887 (LIBES): Add it.
888 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
889 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
890 call timer_settime.
891
892 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
893
894 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
895
896 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
897
898 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
899
900 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
901
902 * character.h (MAYBE_UNIFY_CHAR): Remove.
903 * charset.c, charset.h (maybe_unify_char): Now static.
904 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
905 Since this stuff is now private to charset.c, there's no need for
906 a public macro and no need to inline by hand.
907
908 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
909 Stefan Monnier <monnier@iro.umontreal.ca>
910 Juanma Barranquero <lekktu@gmail.com>
911
912 * profiler.c: New file.
913 * Makefile.in (base_obj): Add profiler.o.
914 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
915 ($(BLD)/profiler.$(O)): New target.
916 * emacs.c (main): Call syms_of_profiler.
917 * alloc.c (Qautomatic_gc): New constant.
918 (MALLOC_PROBE): New macro.
919 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
920 (total_bytes_of_live_objects): New function.
921 (Fgarbage_collect): Use it. Record itself in backtrace_list.
922 Call malloc_probe for the memory profiler.
923 (syms_of_alloc): Define Qautomatic_gc.
924 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
925 race condition.
926 (struct backtrace): Move definition...
927 * lisp.h (struct backtrace): ..here.
928 (Qautomatic_gc, profiler_memory_running): Declare vars.
929 (malloc_probe, syms_of_profiler): Declare functions.
930 * xdisp.c (Qautomatic_redisplay): New constant.
931 (redisplay_internal): Record itself in backtrace_list.
932 (syms_of_xdisp): Define Qautomatic_redisplay.
933
934 2012-09-25 Eli Zaretskii <eliz@gnu.org>
935 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
936
937 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
938
939 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
940
941 Prefer POSIX timers if available.
942 They avoid a race if the timer is too close to the current time.
943 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
944 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
945 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
946
947 2012-09-25 Eli Zaretskii <eliz@gnu.org>
948
949 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
950 CHAR_STRING_ADVANCE.
951 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
952 STRING_CHAR_ADVANCE.
953
954 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
955
956 Move Vlibrary_cache to emacs.c and reset before dumping.
957
958 * lisp.h (reset_image_types): Declare.
959 [WINDOWSNT] (Vlibrary_cache): Declare.
960
961 * image.c (reset_image_types): New function.
962
963 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
964 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
965 (Fdump_emacs): Reset Vlibrary_cache and image_types.
966
967 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
968 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
969
970 * w32.h (Vlibrary_cache): Do not declare.
971
972 2012-09-25 Eli Zaretskii <eliz@gnu.org>
973
974 * w32proc.c (sys_signal): Handle all signals defined by the
975 MS-Windows runtime, not just SIGCHLD. Actually install the signal
976 handlers for signals supported by Windows. Don't override
977 term_ntproc as the handler for SIGABRT.
978 (sigaction): Rewrite to call sys_signal instead of duplicating its
979 code.
980 (sys_kill): Improve commentary.
981
982 * w32.c (term_ntproc): Accept (and ignore) one argument, for
983 consistency with a signature of a signal handler. All callers
984 changed.
985 (init_ntproc): Accept an argument DUMPING. If dumping, don't
986 install term_ntproc as a signal handler for SIGABRT, as that
987 should be done by the dumped Emacs.
988
989 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
990
991 * w32select.c (term_w32select): Protect against repeated
992 invocation by setting clipboard_owner to NULL after calling
993 DestroyWindow.
994
995 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
996 and term_ntproc to their modified signatures.
997
998 * character.c (char_string, string_char): Remove calls to
999 MAYBE_UNIFY_CHAR. See the discussion starting at
1000 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1001 for the details.
1002
1003 2012-09-25 Chong Yidong <cyd@gnu.org>
1004
1005 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1006
1007 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1008
1009 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1010 when encountering an unknown bytecode.
1011
1012 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1013
1014 image.c, indent.c: Use bool for booleans.
1015 * dispextern.h (struct image_type): Members valid_p, load, init
1016 now return bool, not int. All uses changed.
1017 * image.c: Omit unnecessary static decls.
1018 (x_create_bitmap_mask, x_build_heuristic_mask):
1019 Return void, not int, since callers don't care about the return value.
1020 (x_create_bitmap_mask, define_image_type, valid_image_p)
1021 (struct image_keyword, parse_image_spec, image_spec_value)
1022 (check_image_size, image_background)
1023 (image_background_transparent, x_clear_image_1)
1024 (postprocess_image, lookup_image, x_check_image_size)
1025 (x_create_x_image_and_pixmap, xbm_image_p)
1026 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1027 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1028 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1029 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1030 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1031 (png_image_p, init_png_functions, png_load_body, png_load)
1032 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1033 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1034 (init_gif_functions, gif_load, imagemagick_image_p)
1035 (imagemagick_load_image, imagemagick_load, svg_image_p)
1036 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1037 (gs_load):
1038 * nsimage.m (ns_load_image):
1039 * nsterm.m (ns_defined_color):
1040 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1041 * xfns.c (x_defined_color):
1042 * xterm.c (x_alloc_lighter_color_for_widget)
1043 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1044 (x_alloc_lighter_color):
1045 * indent.c (disptab_matches_widthtab, current_column)
1046 (scan_for_column, string_display_width, indented_beyond_p)
1047 (compute_motion, vmotion, Fvertical_motion):
1048 Use bool for booleans.
1049
1050 2012-09-24 Chong Yidong <cyd@gnu.org>
1051
1052 * chartab.c (Fset_char_table_default): Obsolete function removed.
1053
1054 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1055
1056 Move pid_t related decls out of lisp.h.
1057 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1058 (interruptible_wait_for_termination):
1059 Move these decls from lisp.h to syswait.h, since they use pid_t.
1060 Needed on FreeBSD; see Herbert J. Skuhra in
1061 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1062 * callproc.c: Include syswait.h.
1063
1064 gnutls.c, gtkutil.c: Use bool for boolean.
1065 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1066 (emacs_gnutls_handle_error):
1067 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1068 (xg_hide_tooltip, xg_create_frame_widgets)
1069 (create_dialog, xg_uses_old_file_dialog)
1070 (xg_get_file_with_chooser, xg_get_file_with_selection)
1071 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1072 (xg_item_label_same_p, xg_update_menubar)
1073 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1074 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1075 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1076 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1077 (update_frame_tool_bar, free_frame_tool_bar):
1078 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1079 * nsmenu.m (ns_update_menubar):
1080 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1081 * xfns.c (Fx_show_tip) [USE_GTK]:
1082 Use bool for boolean.
1083 * gtkutil.c (xg_update_frame_menubar):
1084 * xmenu.c (update_frame_menubar):
1085 Return void, not int, since caller ignores return value.
1086 * gtkutil.c (xg_change_toolbar_position):
1087 Return void, not 1.
1088
1089 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1090
1091 * makefile.w32-in (BLOCKINPUT_H): Remove.
1092 (SYSSIGNAL_H): New macro.
1093 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1094 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1095 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1096 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1097 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1098 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1099 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1100 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1101 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1102 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1103 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1104 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1105 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1106 ($(BLD)/w32xfns.$(O)): Update dependencies.
1107
1108 2012-09-23 Eli Zaretskii <eliz@gnu.org>
1109
1110 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1111 fatal_error_backtrace.
1112
1113 * w32proc.c (sys_kill): Undo last change: don't do anything when
1114 invoked to deliver SIGABRT to our own process. This is now
1115 handled by emacs_raise.
1116
1117 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1118
1119 * w32term.c (w32_read_socket): Remove leftover reference to
1120 interrupt_input_pending.
1121
1122 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1123
1124 Do not use SA_NODEFER.
1125 Problem reported by Dani Moncayo in
1126 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1127 * alloc.c (die):
1128 * sysdep.c (emacs_abort): Do not reset signal handler.
1129 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1130 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1131 wanted even on POSIXish hosts, and it doesn't work on Windows.
1132
1133 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1134
1135 * xterm.c (x_term_init): Call fixup_locale before and after calling
1136 gtk_init (Bug#12392).
1137
1138 2012-09-23 Chong Yidong <cyd@gnu.org>
1139
1140 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1141 Vdynamic_library_alist.
1142
1143 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1144 (Fgnutls_available_p): Caller changed.
1145
1146 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1147 (Flibxml_parse_xml_region): Likewise.
1148
1149 * dispextern.h (struct image_type): Remove arg from init function.
1150
1151 * image.c (Finit_image_library, lookup_image_type)
1152 (define_image_type): Remove now-unneeded second arg.
1153 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1154 (init_tiff_functions, init_gif_functions, init_svg_functions):
1155 Arglist and w32_delayed_load calling convention changed.
1156 (gs_type): Remove init_gs_functions; there is no such function.
1157 (valid_image_p, make_image): Fix caller to lookup_image_type.
1158
1159 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1160
1161 Simplify and avoid signal-handling races (Bug#12471).
1162 * alloc.c (die):
1163 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1164 Avoid recursive loop if there's a fatal error in the function itself.
1165 * atimer.c (pending_atimers):
1166 * blockinput.h: Don't include "atimer.h"; no longer needed.
1167 (interrupt_input_pending): Remove. All uses removed.
1168 pending_signals now counts both atimers and ordinary interrupts.
1169 This is less racy than having three separate pending-signal flags.
1170 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1171 (input_blocked_p):
1172 Rename from their upper-case counterparts BLOCK_INPUT,
1173 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1174 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1175 This makes it easier to access volatile variables more accurately.
1176 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1177 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1178 that's more reliable if the code is buggy and sets
1179 interrupt_input_blocked to a negative value. All uses changed.
1180 * atimer.c (deliver_alarm_signal):
1181 Remove. No need to deliver this to the parent; any thread can
1182 handle this signal now. All uses replaced by underlying handler.
1183 * atimer.c (turn_on_atimers):
1184 * dispnew.c (handle_window_change_signal):
1185 * emacs.c (handle_danger_signal):
1186 * keyboard.c (kbd_buffer_get_event):
1187 Don't reestablish signal handler; not needed with sigaction.
1188 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1189 (UNBLOCK_INPUT_TO):
1190 Rework to avoid unnecessary accesses to volatile variables.
1191 (UNBLOCK_INPUT_TO): Now a function.
1192 (totally_unblock_input, unblock_input): New decls.
1193 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1194 (init_data): Remove. Necessary stuff now done in init_signal.
1195 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1196 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1197 (fatal_error_code): Remove; no longer needed.
1198 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1199 it doesn't always backtrace. All uses changed. No need to reset
1200 signal to default, since sigaction and/or die does that for us now.
1201 Use emacs_raise (FOO), not kill (getpid (), FOO).
1202 (main): Check more-accurately whether we're dumping.
1203 Move fatal-error setup to sysdep.c
1204 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1205 * gtkutil.c (xg_get_file_name, xg_get_font):
1206 Remove no-longer-needed signal-mask manipulation.
1207 * keyboard.c, process.c (POLL_FOR_INPUT):
1208 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1209 * keyboard.c (read_avail_input): Remove.
1210 All uses replaced by gobble_input.
1211 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1212 (kbd_buffer_store_event_hold, gobble_input):
1213 (record_asynch_buffer_change) [USABLE_SIGIO]:
1214 (store_user_signal_events):
1215 No need to mess with signal mask.
1216 (gobble_input): If blocking input and there are terminals, simply
1217 set pending_signals to 1 and return. All hooks changed to not
1218 worry about whether input is blocked.
1219 (process_pending_signals): Clear pending_signals before processing
1220 them, in case a signal comes in while we're processing.
1221 By convention callers now test pending_signals before calling us.
1222 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
1223 New functions, to support changes to blockinput.h.
1224 (handle_input_available_signal): Now extern.
1225 (reinvoke_input_signal): Remove. All uses replaced by
1226 handle_async_input.
1227 (quit_count): Now volatile, since a signal handler uses it.
1228 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
1229 All callers changed. Block SIGINT only if not already blocked.
1230 Clear sigmask reliably, even if Fsignal returns, which it can.
1231 Omit unnecessary accesses to volatile var.
1232 (quit_throw_to_read_char): No need to restore sigmask.
1233 * keyboard.c (gobble_input, handle_user_signal):
1234 * process.c (wait_reading_process_output):
1235 Call signal-handling code rather than killing ourselves.
1236 * lisp.h: Include <float.h>, for...
1237 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
1238 (pending_signals): Now volatile.
1239 (syms_of_data): Now const if IEEE floating point.
1240 (handle_input_available_signal) [USABLE_SIGIO]:
1241 (terminate_due_to_signal, record_child_status_change): New decls.
1242 * process.c (create_process): Avoid disaster if memory is exhausted
1243 while we're processing a vfork, by tightening the critical section
1244 around the vfork.
1245 (send_process_frame, process_sent_to, handle_pipe_signal)
1246 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
1247 ignores SIGPIPE.
1248 (send_process): No need for setjmp/longjmp any more, since the
1249 SIGPIPE stuff is now gone. Instead, report an error if errno
1250 is EPIPE.
1251 (record_child_status_change): Now extern. PID and W are now args.
1252 Return void, not bool. All callers changed.
1253 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
1254 Remove. All uses removed. This bug should be fixed now in a
1255 different way.
1256 (wait_for_termination_1): Use waitpid rather than sigsuspend,
1257 and record the child status change directly. This avoids the
1258 need to futz with the signal mask.
1259 (process_fatal_action): Move here from emacs.c.
1260 (emacs_sigaction_flags): New function, containing
1261 much of what used to be in emacs_sigaction_init.
1262 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
1263 caught by emacs, to make races less likely.
1264 (deliver_process_signal): Rename from handle_on_main_thread.
1265 All uses changed.
1266 (BACKTRACE_LIMIT_MAX): Now at top level.
1267 (thread_backtrace_buffer, threadback_backtrace_pointers):
1268 New static vars.
1269 (deliver_thread_signal, deliver_fatal_thread_signal):
1270 New functions, for more-accurate delivery of thread-specific signals.
1271 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
1272 (deliver_arith_signal): Handle in this thread, not
1273 in the main thread, since it's triggered by this thread.
1274 (maybe_fatal_sig): New function.
1275 (init_signals): New arg DUMPING so that we can be more accurate
1276 about whether we're dumping. Caller changed.
1277 Treat thread-specific signals differently from process-general signals.
1278 Block all signals while handling fatal error; that's safer.
1279 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
1280 on IEEE hosts.
1281 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
1282 Ignore SIGPIPE unless batch.
1283 (emacs_backtrace): Output backtrace for the appropriate thread,
1284 which is not necessarily the main thread.
1285 * syssignal.h: Include <stdbool.h>.
1286 (emacs_raise): New macro.
1287 * xterm.c (x_connection_signal): Remove; no longer needed
1288 now that we use sigaction.
1289 (x_connection_closed): No need to mess with sigmask now.
1290 (x_initialize): No need to reset SIGPIPE handler here, since
1291 init_signals does this for us now.
1292
1293 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1294
1295 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
1296 background rect may be larger (Bug#12245).
1297
1298 2012-09-23 Chong Yidong <cyd@gnu.org>
1299
1300 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
1301
1302 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1303
1304 * .gdbinit: Just stop at fatal_error_backtrace.
1305 See Stefan Monnier's request in
1306 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
1307 Remove no-longer-used query of system type.
1308
1309 2012-09-22 Chong Yidong <cyd@gnu.org>
1310
1311 * search.c (Freplace_match): Doc fix (Bug#12325).
1312
1313 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
1314
1315 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
1316 (Fline_end_position): Doc fix.
1317
1318 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
1319
1320 2012-09-22 Chong Yidong <cyd@gnu.org>
1321
1322 * dispextern.h (struct image_type): Add new slot, storing a type
1323 initialization function.
1324
1325 * image.c (define_image_type): Call the image initializer function
1326 if it is defined. Arguments and return value changed.
1327 (valid_image_p, make_image): Callers changed.
1328 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
1329 (gif_type, imagemagick_type, svg_type, gs_type):
1330 Add initialization functions.
1331 (Finit_image_library): Call lookup_image_type.
1332 (CHECK_LIB_AVAILABLE): Macro deleted.
1333 (lookup_image_type): Call define_image_type here, rather than via
1334 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
1335 (syms_of_image): Move define_image_type calls for xbm_type and
1336 pbm_type to lookup_image_type.
1337
1338 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1339
1340 * keyboard.c (timer_check_2): Move calculation of 'timers' and
1341 'idle_timers' from here ...
1342 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
1343 lists, to avoid infloops when the timer does something stupid,
1344 like reinvoke itself with the same or smaller time-out.
1345 (Bug#12447)
1346
1347 2012-09-22 Martin Rudalics <rudalics@gmx.at>
1348
1349 * window.c (Fsplit_window_internal): Handle only Qt value of
1350 Vwindow_combination_limit separately.
1351 (Qtemp_buffer_resize): New symbol.
1352 (Vwindow_combination_limit): New default value.
1353 Rewrite doc-string.
1354
1355 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1356
1357 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
1358 the new overlay string. (Bug#10159)
1359
1360 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1361
1362 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
1363 or that fprintf is async-signal-safe. POSIX doesn't require
1364 either assumption.
1365
1366 2012-09-22 Chong Yidong <cyd@gnu.org>
1367
1368 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
1369 (Bug#8207).
1370
1371 2012-09-22 Kenichi Handa <handa@gnu.org>
1372
1373 * composite.c (composition_reseat_it): Handle the case that a
1374 grapheme cluster is not covered by a single font (Bug#12352).
1375
1376 2012-09-21 Chong Yidong <cyd@gnu.org>
1377
1378 * image.c (define_image_type): Avoid adding duplicate types to
1379 image_types (Bug#12463). Suggested by Jörg Walter.
1380
1381 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1382
1383 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
1384 (print_load_command_name): Add case LC_DATA_IN_CODE.
1385 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
1386
1387 2012-09-21 Glenn Morris <rgm@gnu.org>
1388
1389 * eval.c (Frun_hook_with_args_until_success)
1390 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
1391
1392 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
1393
1394 * fileio.c (Ffile_selinux_context): Only call freecon when
1395 lgetfilecon succeeded.
1396 (Fset_file_selinux_context): Likewise. (Bug#12444)
1397
1398 2012-09-21 Eli Zaretskii <eliz@gnu.org>
1399
1400 * xdisp.c (try_window_reusing_current_matrix): Under bidi
1401 reordering, locate the cursor by calling set_cursor_from_row; if
1402 that fails, clear the desired glyph matrix before returning a
1403 failure indication to the caller. Fixes leaving garbled display
1404 when fast scrolling with a down-key. (Bug#12403)
1405 (compute_stop_pos_backwards): Fix a typo that caused crashes while
1406 scrolling through multibyte text.
1407
1408 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
1409
1410 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
1411 calling mark_vectorlike since that's the one that marks the window.
1412 (mark_discard_killed_buffers): Mark the final cdr.
1413 * window.h (struct window): Move prev/next_buffers to the
1414 non-standard fields.
1415 * window.c (make_window): Initialize prev/next_buffers manually.
1416
1417 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
1418
1419 Omit unused arg EXPECTED from socket hooks.
1420 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1421 * nsterm.m (ns_term_init):
1422 * termhooks.h (struct terminal.read_socket_hook):
1423 * w32inevt.c (w32_console_read_socket):
1424 * w32term.c (w32_read_socket):
1425 * xterm.c (XTread_socket):
1426 Omit unused arg EXPECTED. All callers changed.
1427 (store_user_signal_events): Return void, not int, since callers no
1428 longer care about the return value. All uses changed.
1429
1430 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
1431
1432 * w32gui.h (XParseGeometry): Do not declare.
1433
1434 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
1435
1436 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1437 Ignore 'expected'. See Eli Zaretskii in
1438 <http://bugs.gnu.org/12471#8> (last line).
1439
1440 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
1441 (XParseGeometry): Now static. Substitute extremal values for
1442 values that are out of range.
1443
1444 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
1445
1446 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1447
1448 * nsfns.m (XParseGeometry): Remove.
1449 (Fx_create_frame): Call x_set_offset to correctly interpret
1450 top_pos in geometry.
1451
1452 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
1453 (Fx_parse_geometry): If there is a space in string, call
1454 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1455
1456 2012-09-17 Eli Zaretskii <eliz@gnu.org>
1457
1458 * search.c (scan_buffer): Use character positions in calls to
1459 region_cache_forward and region_cache_backward, not byte
1460 positions. (Bug#12196)
1461
1462 * w32term.c (w32_read_socket): Set pending_signals to 1, like
1463 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
1464
1465 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1466 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1467 emacs_blocked_malloc, now deleted.
1468
1469 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
1470
1471 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1472 The workaround was for improving performance on Solaris 2.4, but
1473 is getting in the way now. Emacs will still work if someone is
1474 still running Solaris 2.4 in a museum somewhere; Sun dropped
1475 support for Solaris 2.4 in 2003.
1476 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1477 * process.c (create_process) [HAVE_WORKING_VFORK]:
1478 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1479 since Emacs no longer uses vfork on that platform.
1480
1481 2012-09-17 Glenn Morris <rgm@gnu.org>
1482
1483 * emacs.c: Use COPYRIGHT.
1484
1485 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
1486
1487 Remove configure's --without-sync-input option (Bug#12450).
1488 When auditing signal-handling in preparation for cleaning it up,
1489 I found that SYNC_INPUT has race conditions and would be a real
1490 pain to fix. Since it's an undocumented and deprecated
1491 configure-time option, now seems like a good time to remove it.
1492 Also see <http://bugs.gnu.org/11080#16>.
1493 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1494 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1495 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1496 (malloc_hysteresis):
1497 (check_depth) [XMALLOC_OVERRUN_CHECK]:
1498 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1499 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1500 (dont_register_blocks, bytes_used_when_reconsidered)
1501 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1502 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1503 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1504 Remove. All uses removed.
1505 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1506 implementation, one that depends on whether the new macro
1507 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1508 is defined.
1509 * atimer.c (run_timers, handle_alarm_signal):
1510 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1511 (handle_async_input, process_pending_signals)
1512 (handle_input_available_signal, init_keyboard):
1513 * nsterm.m (ns_read_socket):
1514 * process.c (wait_reading_process_output):
1515 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1516 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1517 (emacs_write):
1518 * xterm.c (XTread_socket):
1519 Assume SYNC_INPUT.
1520 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1521 * eval.c (handling_signal): Remove. All uses removed.
1522 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1523 All uses replaced with the SYNC_INPUT version.
1524 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1525 Remove decls.
1526 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1527 Now static.
1528
1529 * font.c (Ffont_shape_gstring): Remove unused local.
1530
1531 2012-09-16 Glenn Morris <rgm@gnu.org>
1532
1533 * Makefile.in (clean): No longer run nextstep's clean.
1534
1535 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1536 (ns_frag): Remove.
1537 (ns-app): Move here from ns.mk, and simplify.
1538 (clean): Simplify nextstep entry.
1539 * ns.mk: Remove file.
1540
1541 2012-09-17 Kenichi Handa <handa@gnu.org>
1542
1543 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1544 not covert the last few charactes.
1545
1546 2012-09-16 Kenichi Handa <handa@gnu.org>
1547
1548 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1549 here, but just check the validity of glyphs in the glyph-string.
1550
1551 2012-09-16 Martin Rudalics <rudalics@gmx.at>
1552
1553 * window.c (Fwindow_parameter, Fset_window_parameter):
1554 Accept any window as argument (Bug#12452).
1555
1556 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
1557
1558 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1559 to ns_term_init to avoid memory leak.
1560
1561 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
1562 explicit retain/release.
1563 (ns_term_init): Only allow one display. Initialize outerpool and
1564 ns_*_types.
1565
1566 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1567
1568 Port _setjmp fix to POSIXish hosts as well as Microsoft.
1569 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
1570 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
1571 the Microsoft problem in a different way, by altering ../nt/config.nt.
1572
1573 2012-09-15 Eli Zaretskii <eliz@gnu.org>
1574
1575 * w32xfns.c:
1576 * w32uniscribe.c:
1577 * w32term.c:
1578 * w32select.c:
1579 * w32reg.c:
1580 * w32proc.c:
1581 * w32menu.c:
1582 * w32inevt.c:
1583 * w32heap.c:
1584 * w32font.c:
1585 * w32fns.c:
1586 * w32console.c:
1587 * w32.c:
1588 * w16select.c: Remove inclusion of setjmp.h, as it is now included
1589 by lisp.h. This completes removal of setjmp.h inclusion
1590 erroneously announced in the previous commit. (Bug#12446)
1591
1592 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
1593 more accurate.
1594
1595 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
1596 not defined as a macro. The latter happens on MS-Windows.
1597 (Bug#12446)
1598
1599 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1600
1601 Port better to POSIX hosts lacking _setjmp (Bug#12446).
1602 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
1603 Some instances of '#include <setjmp.h>' removed, if the
1604 only reason for the instance was because "lisp.h" was included.
1605 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
1606 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
1607 and _longjmp with the new symbols. Emacs already uses _setjmp if
1608 available, so this change affects only POSIXish hosts that have
1609 sigsetjmp but not _setjmp, such as some versions of Solaris and
1610 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
1611 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
1612 (png_load_body) [HAVE_PNG]:
1613 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
1614 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
1615 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
1616 since PNG requires jmp_buf. This is the only exception to the
1617 general rule that we now use sys_setjmp and sys_longjmp.
1618 This exception is OK since this code does not change the signal
1619 mask or longjmp out of a signal handler.
1620
1621 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
1622
1623 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1624 Include "syssignal.h", for 'main_thread'.
1625
1626 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
1627
1628 Avoid out-of-range marker position (Bug#12426).
1629 * insdel.c (replace_range, replace_range_2):
1630 Adjust markers before overlays, as suggested by comments.
1631 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1632 Remove redundant check before calling offset_intervals.
1633
1634 2012-09-14 Martin Rudalics <rudalics@gmx.at>
1635
1636 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1637 current buffer (Bug#12387).
1638
1639 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
1640
1641 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1642
1643 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1644
1645 Use a more backwards-compatible timer format (Bug#12430).
1646 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1647 vector element, not from the 4th, since PSECS is now at the end.
1648 (Fcurrent_idle_time): Doc fix.
1649
1650 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
1651
1652 Function to mark objects and remove killed buffers at once.
1653 * alloc.c (discard_killed_buffers): Rename to ...
1654 (mark_discard_killed buffers) ... new name. Add marking
1655 of remaining objects. Fix comment. Adjust users.
1656 (mark_object): Do not touch frame buffer lists here.
1657 * frame.c (delete_frame): Reset frame buffer lists here.
1658
1659 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1660
1661 Better workaround for GNOME bug when --enable-gcc-warnings.
1662 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1663 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
1664 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1665
1666 Simplify SIGIO usage (Bug#12408).
1667 The code that dealt with SIGIO was crufty and confusing, e.g., it
1668 played tricks like "#undef SIGIO" but these tricks were not used
1669 consistently. Simplify mostly by not #undeffing standard symbols,
1670 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1671 or not as we please) rather than "defined SIGIO" (standard symbol
1672 that we probably shouldn't #undef).
1673 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1674 Modules that need it can include it.
1675 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1676 * dispextern.h (ignore_sigio): New decl.
1677 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1678 unconditionally, since it's now a no-op if !USABLE_SIGIO.
1679 * emacs.c (shut_down_emacs):
1680 * keyboard.c (kbd_buffer_store_event_hold):
1681 Use ignore_sigio rather than invoking 'signal' directly.
1682 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1683 for FIONREAD.
1684 (FIONREAD, SIGIO): Do not #undef.
1685 (tty_read_avail_input): Use #error rather than a syntax error.
1686 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1687 for I_PIPE, used by SETUP_SLAVE_PTY.
1688 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1689 * sysdep.c (croak): Remove; no longer needed. This bit of
1690 temporary code, with Fred N. Fish's comment that it's temporary,
1691 has been in Emacs since at least 1992!
1692 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1693 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1694 * syssignal.h (croak): Remove decl.
1695 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1696 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1697 now that we're termios-only.
1698 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1699 * term.c (dissociate_if_controlling_tty): Use #error rather than
1700 a run-time error.
1701
1702 Work around GCC and GNOME bugs when --enable-gcc-warnings.
1703 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1704 to work around GNOME bug 683906.
1705 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1706 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1707 This works around GCC bug 54561.
1708
1709 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1710
1711 More fixes for 'volatile' and setjmp/longjmp.
1712 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1713 * image.c (struct png_load_context) [HAVE_PNG]: New type.
1714 (png_load_body) [HAVE_PNG]:
1715 (jpeg_load_body) [HAVE_JPEG]:
1716 New function, with most of the old parent function's body.
1717 (png_load) [HAVE_PNG]:
1718 (jpeg_load) [HAVE_JPEG]:
1719 Invoke the new function, to avoid longjmp munging our locals.
1720 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
1721 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
1722 longjmp is passed 2, as the C standard doesn't guarantee this.
1723 Instead, store the failure code into mgr->failure_code.
1724
1725 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1726
1727 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
1728 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
1729 (syms_of_keyboard): Remove support for unread-command-char.
1730
1731 2012-09-12 Eli Zaretskii <eliz@gnu.org>
1732
1733 * w32proc.c (sys_kill): If PID is our process ID and the signal is
1734 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
1735 violation. (Bug#12426)
1736
1737 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1738
1739 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
1740
1741 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1742
1743 * eval.c: Add `inhibit-debugger'.
1744 (Qinhibit_debugger): New symbol.
1745 (call_debugger): Bind it instead of Qdebug_on_error.
1746 (maybe_call_debugger): Test Vinhibit_debugger.
1747 (syms_of_eval): Define inhibit-debugger.
1748 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1749 (syms_of_xdisp): Remove inhibit-debug-on-message.
1750
1751 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1752
1753 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1754 If a nonvolatile local variable is written before a _longjmp to
1755 the frame containing the variable, and is read after the _longjmp,
1756 the value read is indeterminate. Some local variables of type
1757 'struct handler' and 'struct catchtag' are used in this way, so
1758 mark each of their slots as volatile if the slot can be set before
1759 _longjmp and read afterwards.
1760 * lisp.h (struct handler): var and chosen_clause are now volatile.
1761 (struct catchtag): val, next, and pdlcount are now volatile.
1762
1763 * bidi.c (bidi_push_it, bidi_pop_it):
1764 * fns.c (copy_hash_table):
1765 * image.c (define_image_type):
1766 * keyboard.c (kbd_buffer_store_event_hold):
1767 * process.c (Fprocess_send_eof):
1768 * xfaces.c (x_create_gc) [HAVE_NS]:
1769 * xgselect.c (xg_select):
1770 Prefer assignment to memcpy when either will do.
1771
1772 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1773 Use pointer-to-a-pointer to simplify and avoid a NILP check each
1774 time an item is removed. No need to mark this function 'inline';
1775 the compiler knows better than we do.
1776
1777 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
1778
1779 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1780 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1781 to change_frame_size (Bug#12388).
1782 (windowDidResize:): Pass YES to updateFrameSize.
1783
1784 * nsterm.h: Add delay parameter to updateFrameSize.
1785
1786 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1787
1788 Discard killed buffers from deleted window and frame objects.
1789 This reduces an amount of references to killed buffers and
1790 helps GC to reclaim them faster.
1791 * alloc.c (discard_killed_buffers): New function.
1792 (mark_object): Use it for deleted windows and frames.
1793 (mark_object): If symbol's value is set up for a killed buffer
1794 or deleted frame, restore it's global binding.
1795 * data.c (swap_in_global_binding): Add GC notice.
1796 (swap_in_symval_forwarding): Use convenient set_blv_where.
1797 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1798 * window.h: ... to here.
1799
1800 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1801
1802 Convenient macro to check whether the buffer is live.
1803 * buffer.h (BUFFER_LIVE_P): New macro.
1804 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1805 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1806
1807 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1808
1809 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1810 composition cases (Bug#12364).
1811
1812 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1813 overhang of succeeding glyphs overlapping box cursor.
1814
1815 * w32term.c (x_draw_glyph_string): Likewise.
1816
1817 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1818
1819 Simplify, document, and port floating-point (Bug#12381).
1820 The porting part of this patch fixes bugs on non-IEEE platforms
1821 with frexp, ldexp, logb.
1822 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1823 Now static.
1824 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1825 support, by removing commented-out code and briefly listing the
1826 C89 functions excluded. The commented-out stuff was confusing
1827 maintenance, e.g., we thought we needed cbrt but it was commented out.
1828 (logb): Remove decl; no longer needed.
1829 (isfinite): New macro, if not already supplied.
1830 (isnan): Don't replace any existing macro.
1831 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1832 are present on all C89 platforms.
1833 (Ffrexp): Do not special-case zero, as frexp does the right thing
1834 for that case.
1835 (Flogb): Do not use logb, as it doesn't have the desired meaning
1836 on hosts that use non-base-2 floating point. Instead, stick with
1837 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1838 frexp, to avoid getting an unspecified result.
1839
1840 * xdisp.c (Qinhibit_debug_on_message): Now static.
1841
1842 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1843
1844 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1845 NSBezierPath (Bug#12131).
1846
1847 2012-09-10 Chong Yidong <cyd@gnu.org>
1848
1849 * fns.c (Fdelq, Fdelete): Doc fix.
1850
1851 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1852
1853 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1854 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1855
1856 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1857
1858 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1859 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1860 Use it.
1861
1862 2012-09-09 Eli Zaretskii <eliz@gnu.org>
1863
1864 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1865 left fringe if the window has a left margin. This avoids leaving
1866 traces of the cursor because its leftmost pixel is not drawn over.
1867
1868 * dispnew.c (update_window_line): When the left margin area of a
1869 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1870 that screen line. (Bug#12277)
1871
1872 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1873
1874 Assume C89 or later for math functions (Bug#12381).
1875 This simplifies the code, and makes it a bit smaller and faster,
1876 and (most important) makes it easier to clean up signal handling
1877 since we can stop worring about floating-point exceptions in
1878 library code. That was a problem before C89, but the problem
1879 went away many years ago on all practical Emacs targets.
1880 * data.c, image.c, lread.c, print.c:
1881 Don't include <math.h>; no longer needed.
1882 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1883 might be autoconfigured, as that never happens.
1884 * data.c (fmod):
1885 * doprnt.c (DBL_MAX_10_EXP):
1886 * print.c (DBL_DIG):
1887 Remove. C89 or later always defines these.
1888 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1889 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1890 (arith_error, domain_error, domain_error2):
1891 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1892 no longer needed -- we simply return what C returns. All uses removed.
1893 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1894 the wrapped code.
1895 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1896 Remove. All uses expanded, as these macros are no longer used
1897 more than once and are now more trouble than they're worth.
1898 (Ftan): Use tan, not sin / cos.
1899 (Flogb): Assume C89 frexp.
1900 (fmod_float): Assume C89 fmod.
1901 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1902 (init_floatfns): Remove. All uses removed.
1903
1904 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1905
1906 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1907 compositeToPoint for OSX < 10.6 (Bug#12390).
1908
1909 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1910
1911 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1912 This produces more-accurate results.
1913
1914 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1915
1916 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1917 changes (Bug#12088).
1918
1919 2012-09-08 Chong Yidong <cyd@gnu.org>
1920
1921 * syntax.c (Fstring_to_syntax): Doc fix.
1922
1923 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1924
1925 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1926 in the internal border.
1927 (x_set_window_size): Remove static variables and their usage.
1928 (ns_redraw_scroll_bars): Fix NSTRACE arg.
1929 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1930 Remove fringe/internal border adjustment (Bug#11052).
1931 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1932 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1933 (ns_fix_rect_ibw): Remove.
1934 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1935 (ns_dumpglyphs_box_or_relief): Ditto.
1936 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1937 adjustment.
1938 (ns_dumpglyphs_image): Ditto.
1939 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
1940 border adjustment.
1941 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1942 their usage. Add fringe_extended_p and its use as in other terms.
1943 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1944 scroll bar was removed.
1945 (updateFrameSize): New function.
1946 (windowDidResize): Move code to updateFrameSize and call it.
1947
1948 * nsterm.h (EmacsView): Add updateFrameSize.
1949
1950 2012-09-07 Chong Yidong <cyd@gnu.org>
1951
1952 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1953
1954 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1955
1956 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1957
1958 More signal-handler cleanup (Bug#12327).
1959 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1960 Problem introduced when merging patches. Noted by Eli Zaretskii in
1961 <http://bugs.gnu.org/12327#67>.
1962 * floatfns.c: Comment fix.
1963 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1964 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1965 and anyway the declaration is harmless even if SIGDANGER is not defined.
1966 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1967 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1968 source files not surprisingly expected syssignal.h to define, or
1969 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1970 Include <sys/ioctl.h>, for FIONREAD.
1971 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1972 This eliminates a problem whereby other files mysteriously had
1973 to include "syssignal.h" before including "systty.h" if they
1974 wanted to use "#ifdef SIGIO".
1975
1976 2012-09-07 Eli Zaretskii <eliz@gnu.org>
1977
1978 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1979
1980 * w32.c (sigemptyset): Empty the set.
1981 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1982
1983 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1984
1985 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1986
1987 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1988 (mark_object): Likewise for frame objects.
1989
1990 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1991
1992 * syssignal.h (handle_on_main_thread): Always declare,
1993 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1994 This ports to platforms without HAVE_PTHREAD.
1995
1996 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1997
1998 Signal-handler cleanup (Bug#12327).
1999 Emacs's signal handlers were written in the old 4.2BSD style with
2000 sigblock and sigmask and so forth, and this led to some
2001 inefficiencies and confusion. Rewrite these to use
2002 pthread_sigmask etc. without copying signal sets around. Also,
2003 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2004 'signal', and instead use functions that do not attempt to take
2005 over the system name space. This patch causes Emacs's text
2006 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2007 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2008 Do not include <signal.h> or "syssignal.h", as these
2009 modules do not use signals.
2010 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2011 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2012 Do not include <signal.h>, as "syssignal.h" does that for us now.
2013 * atimer.c (sigmask_atimers): New function.
2014 (block_atimers, unblock_atimers): New functions,
2015 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2016 All uses replaced.
2017 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2018 no longer needed here.
2019 * emacs.c (main): Inspect existing signal handler with sigaction,
2020 so that there's no need to block and unblock SIGHUP.
2021 * sysdep.c (struct save_signal): New member 'action', replacing
2022 old member 'handler'.
2023 (save_signal_handlers, restore_signal_handlers):
2024 Use sigaction instead of 'signal' to save and restore.
2025 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2026 New function. All users of 'signal' modified to use set_sighandler
2027 if they're writeonly, and to use sys_signal if they're read+write.
2028 (emacs_sigaction_init, forwarded_signal): New functions.
2029 (sys_signal): Remove. All uses replaced by calls to sigaction
2030 and emacs_sigaction_init, or by direct calls to 'signal'.
2031 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2032 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2033 all uses replaced by pthread_sigmask etc. calls.
2034 * syssignal.h: Include <signal.h>.
2035 (emacs_sigaction_init, forwarded_signal): New decls.
2036 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2037 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2038 (sigmask, sys_sigmask): Remove; no longer needed.
2039 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2040 (sigblock, sigunblock, sigfree):
2041 (sigsetmask) [!defined sigsetmask]:
2042 Remove. All uses replaced by pthread_sigmask.
2043 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2044 no longer need to be replaced, and its typical old uses
2045 are now done via emacs_sigaction_init and sigaction.
2046 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2047 (sys_sigdel): Remove; unused.
2048 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2049
2050 2012-09-06 Eli Zaretskii <eliz@gnu.org>
2051
2052 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2053 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2054
2055 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2056
2057 Explicitly mark buffer_defaults and buffer_local_symbols.
2058 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2059 mark_local_symbols here.
2060 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2061 since special buffers aren't marked here any more.
2062 (allocate_buffer): Chain new buffer with all_buffers here...
2063 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2064 not here.
2065 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2066 (syms_of_buffer): Remove staticpro of the above.
2067 (init_buffer_once): Set names for buffer_defaults and
2068 buffer_local_symbols.
2069
2070 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2071
2072 Use bool for booleans in font-related modules.
2073 * font.c (font_intern_prop, font_style_to_value)
2074 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2075 (generate_otf_features, font_check_otf_features, font_check_otf)
2076 (font_match_p, font_list_entities, font_at):
2077 * fontset.c (fontset_id_valid_p, reorder_font_vector
2078 (fontset_find_font, Fset_fontset_font)
2079 (face_suitable_for_char_p) [0]:
2080 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2081 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2082 (m17n_flt_initialized, ftfont_shape_by_flt):
2083 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2084 * nsfont.m (nsfont_draw):
2085 * w32font.c (w32font_draw):
2086 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2087 Use bool for booleans.
2088 * font.h: Adjust to above API changes.
2089 (struct font, struct font_driver, struct font_driver_list):
2090 Use bool for booleans.
2091 (struct font): Remove useless member encoding_type.
2092 All users removed.
2093 * fontset.c, xftfont.c: Omit unnecessary static decls.
2094
2095 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2096
2097 * alloc.c (mark_object): Revert window marking code
2098 since it's unsafe for the Fset_window_configuration.
2099
2100 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2101
2102 Fix race conditions with signal handlers and errno (Bug#12327).
2103 Be more systematic about preserving errno whenever a signal
2104 handler returns, even if it's not in the main thread. Do this by
2105 renaming signal handlers to distinguish between signal delivery
2106 and signal handling. All uses changed.
2107 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2108 * data.c (deliver_arith_signal): Rename from arith_error.
2109 * dispnew.c (deliver_window_change_signal): Rename from
2110 window_change_signal.
2111 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2112 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2113 * keyboard.c (deliver_input_available_signal): Rename from
2114 input_available_signal.
2115 (deliver_user_signal): Rename from handle_user_signal.
2116 (deliver_interrupt_signal): Rename from interrupt_signal.
2117 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2118 (deliver_child_signal): Rename from sigchld_handler.
2119 * atimer.c (handle_alarm_signal):
2120 * data.c (handle_arith_signal):
2121 * dispnew.c (handle_window_change_signal):
2122 * emacs.c (handle_fatal_signal, handle_danger_signal):
2123 * keyboard.c (handle_input_available_signal):
2124 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2125 * process.c (handle_pipe_signal, handle_child_signal):
2126 New functions, with the actual signal-handling code taken from the
2127 original respective signal handlers, sans the sporadic attempts to
2128 preserve errno, since that's now done by handle_on_main_thread.
2129 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2130 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2131 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2132 Move to sysdep.c.
2133 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2134 Move initialization of main_thread to sysdep.c's init_signals.
2135 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2136 our usage, and simplifies the mainline code.
2137 (record_child_status_change): New static function, as a helper
2138 for handle_child_signal, and with most of the old child handler's
2139 contents.
2140 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2141 (handle_child_signal): Use the above.
2142 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2143 Moved here from emacs.c.
2144 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2145 code moved here from emacs.c's main function.
2146 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
2147 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2148 This lets callers save and restore errno properly.
2149
2150 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2151
2152 Remove redundant or unused things here and there.
2153 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2154 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2155 * editfns.c (Fcompare_buffer_substrings): Likewise.
2156 * frame.h (struct terminal, struct font_driver_list):
2157 Remove redundant declarations.
2158 * window.h (Qleft, Qright): Likewise.
2159
2160 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2161
2162 Do not mark objects from deleted buffers, windows and frames.
2163 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2164 (mark_object): Likewise for windows and frames.
2165
2166 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2167
2168 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2169 buffer_defaults and buffer_local_symbols as valid objects.
2170 Return special value to denote them.
2171
2172 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2173
2174 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2175 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2176 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2177 (file_name_absolute_p, Fsubstitute_in_file_name):
2178 (check_executable, check_writable, Ffile_accessible_directory_p)
2179 (Fset_file_selinux_context, Fdefault_file_modes)
2180 (Finsert_file_contents, choose_write_coding_system)
2181 (Fwrite_region, build_annotations, a_write, e_write)
2182 (Fdo_auto_save):
2183 * filelock.c (boot_time_initialized, get_boot_time)
2184 (get_boot_time_1, lock_file_1, within_one_second):
2185 * floatfns.c (in_float):
2186 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2187 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2188 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2189 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2190 * window.c (compare_window_configurations):
2191 Use bool for booleans.
2192 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2193 (Fdefault_file_modes): Now mode_t, not int, for modes.
2194 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2195 (internal_delete_file): Now returns void, not a (boolean) int,
2196 since nobody was looking at the return value.
2197 * lisp.h, window.h: Adjust to above API changes.
2198
2199 * xdisp.c (set_message): Simplify and reindent last change.
2200
2201 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
2202
2203 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2204
2205 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2206
2207 * eval.c (call_debugger): Make the function non-static so that we
2208 can call it from set_message.
2209
2210 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2211 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2212
2213 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2214
2215 Give more-useful info on a fatal error (Bug#12328).
2216 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2217 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2218 of doing the work ourselves.
2219 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
2220 do most of the work.
2221 (fatal_error_backtrace): New function, taken from the guts
2222 of the old fatal_error_signal, but with a new option to output
2223 a backtrace.
2224 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
2225 info about the signal than just its number.
2226 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
2227 * sysdep.c: Include <execinfo.h>
2228 (emacs_backtrace): New function, taken partly from the previous
2229 code of the 'die' function.
2230 (emacs_abort): Call fatal_error_backtrace rather than abort.
2231
2232 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2233
2234 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
2235 eager (load-time) macro-expansion.
2236 * lisp.mk (lisp): Add macroexp.
2237
2238 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2239
2240 Simplify redefinition of 'abort' (Bug#12316).
2241 Do not try to redefine the 'abort' function. Instead, redo
2242 the code so that it calls 'emacs_abort' rather than 'abort'.
2243 This removes the need for the NO_ABORT configure-time macro
2244 and makes it easier to change the abort code to do a backtrace.
2245 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
2246 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
2247 Remove; sysdep.c's emacs_abort now takes its place.
2248 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
2249 'abort' changed to use 'emacs_abort'.
2250 * msdos.c (dos_abort) [defined abort]: Remove; not used.
2251 (abort) [!defined abort]: Rename to ...
2252 (emacs_abort): ... new name.
2253 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
2254 the place of the old 'abort' in emacs.c.
2255 * w32.c, w32fns.c (abort): Do not #undef.
2256 * w32.c (emacs_abort): Rename from w32_abort.
2257
2258 2012-09-04 Eli Zaretskii <eliz@gnu.org>
2259
2260 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
2261 offsets[j].dv, since the y axis of the screen coordinates points
2262 down, while the y axis of the font definition coordinates points
2263 up. This fixes display of Arabic diacritics such as KASRA and
2264 KASRATAN. (Bug#11860)
2265
2266 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2267
2268 Be more systematic about _setjmp vs setjmp.
2269 * alloc.c (test_setjmp, mark_stack):
2270 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
2271 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
2272 (png_load, my_error_exit, jpeg_load):
2273 * process.c (send_process_trap, send_process):
2274 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
2275 The underscored versions are up to 30x faster on some hosts.
2276 Formerly, the code used setjmp+longjmp sometimes and
2277 _setjmp+_longjmp at other times, with no particular reason to
2278 prefer setjmp+longjmp.
2279
2280 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
2281
2282 Fix minor problem found by static checking.
2283 * buffer.c (Fdelete_all_overlays): Return nil.
2284
2285 2012-09-03 Martin Rudalics <rudalics@gmx.at>
2286
2287 * buffer.c (Fdelete_all_overlays): New function.
2288
2289 2012-09-03 Chong Yidong <cyd@gnu.org>
2290
2291 * gtkutil.c: Add extern decl for Qxft.
2292
2293 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2294
2295 * emacs.c, eval.c: Use bool for boolean.
2296 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
2297 (malloc_using_checking) [DOUG_LEA_MALLOC]:
2298 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
2299 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
2300 (main, decode_env_path, Fdaemon_initialized):
2301 * eval.c (call_debugger, Finteractive_p, interactive_p):
2302 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
2303 (maybe_call_debugger, Fbacktrace):
2304 * process.c (read_process_output, exec_sentinel):
2305 Use bool for booleans.
2306 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
2307 All callers changed.
2308 * eval.c (interactive_p): Omit always-true boolean argument
2309 EXCLUDE_SUBRS_P. All callers changed.
2310 * dispextern.h, lisp.h: Reflect above API changes.
2311 * firstfile.c (dummy): Use the address of 'main', whose signature
2312 won't change, instead of the address of 'initialize', whose
2313 signature just changed from int to bool.
2314 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
2315 * msdos.c (fatal_error_in_progress): ... from here.
2316 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
2317 of incrementing it.
2318 (redisplay_internal, unwind_redisplay): Simply clear
2319 REDISPLAYING_P when unwinding, instead of saving its previous,
2320 always-false value and then restoring it.
2321
2322 Clean up some extern decls.
2323 Mostly, this hoists extern decls out of .c files and into .h files.
2324 That way, we're more likely to catch errors if the interfaces change.
2325 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
2326 declare xg_mark_data.
2327 * dispextern.h (x_frame_parm_handlers):
2328 * font.h (Qxft):
2329 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
2330 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
2331 (Qultra_bold, Qoblique, Qitalic):
2332 Move extern decl here from .c file.
2333 * alloc.c (xg_mark_data) [USE_GTK]:
2334 * doc.c (Qclosure):
2335 * eval.c (Qlexical_binding):
2336 * fns.c (time) [!HAVE_UNISTD_H]:
2337 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
2338 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
2339 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
2340 * lread.c (Qinternal_interpreter_environment):
2341 * minibuf.c (Qbuffer):
2342 * process.c (QCfamily, QCfilter):
2343 * widget.c (free_frame_faces):
2344 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
2345 * xfont.c (x_clear_errors):
2346 * xterm.c (x_frame_parm_handlers):
2347 Remove now-redundant extern decls.
2348 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
2349 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
2350 Now static.
2351 * xfaces.c: Remove unnecessary static decls.
2352 * xterm.c (updating_frame): Remove decl of nonexistent object.
2353
2354 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
2355 when building globals.h, as the objects that are not built on
2356 this host are not needed to compile C files on this host.
2357
2358 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
2359
2360 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
2361
2362 * frame.h: Add missing prototype for x_wm_set_size_hint.
2363
2364 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2365
2366 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
2367 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
2368 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
2369 (Fsubstitute_command_keys):
2370 * editfns.c (region_limit, find_field, Fconstrain_to_field)
2371 (save_excursion_save, save_excursion_restore)
2372 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
2373 (format_time_string, general_insert_function)
2374 (make_buffer_string, make_buffer_string_both)
2375 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
2376 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
2377 (copy_text, insert_1, insert_1_both, insert_from_string)
2378 (insert_from_string_before_markers, insert_from_string_1)
2379 (insert_from_buffer, insert_from_buffer_1, replace_range)
2380 (replace_range_2, del_range_1, del_range_byte, del_range_both)
2381 (del_range_2, modify_region):
2382 * intervals.c (intervals_equal, balance_possible_root_interval)
2383 (adjust_intervals_for_insertion, merge_properties_sticky)
2384 (graft_intervals_into_buffer, lookup_char_property)
2385 (adjust_for_invis_intang, set_point_both)
2386 (get_property_and_range, compare_string_intervals)
2387 (set_intervals_multibyte_1, set_intervals_multibyte):
2388 * keyboard.c (decode_timer):
2389 Use bool for boolean.
2390 * intervals.h, lisp.h, systime.h: Reflect above API changes.
2391 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
2392
2393 2012-09-02 Chong Yidong <cyd@gnu.org>
2394
2395 * keymap.c (push_key_description): Print M-TAB as C-M-i
2396 (Bug#11758).
2397
2398 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
2399
2400 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
2401 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
2402 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
2403 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
2404 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
2405 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
2406 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2407
2408 2012-09-01 Eli Zaretskii <eliz@gnu.org>
2409
2410 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
2411 more than one grapheme cluster passed to the shaper: compute the
2412 offset adjustment values separately for each cluster. (Bug#11860)
2413
2414 * image.c: Restore mistakenly removed inclusion of w32.h. Without
2415 it, GCC doesn't see prototypes of w32_delayed_load, and complains
2416 about implicit conversions from integer to pointer.
2417
2418 2012-09-01 Daniel Colascione <dancol@dancol.org>
2419
2420 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2421 system used too early.
2422
2423 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
2424
2425 Better seed support for (random).
2426 * emacs.c (main): Call init_random.
2427 * fns.c (Frandom): Set the seed from a string argument, if given.
2428 Remove long-obsolete Gentzel cruft.
2429 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
2430 (init_random): New function.
2431
2432 2012-09-01 Daniel Colascione <dancol@dancol.org>
2433
2434 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
2435 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
2436 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
2437 x_wm_set_size_hint, x_query_colors, x_real_positions,
2438 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
2439 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
2440 all of which have been moved to common code.
2441
2442 * xfaces.c: Include TERM_HEADER instead of listing all possible
2443 window-system headers.
2444
2445 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2446 to match header.
2447
2448 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2449 directly accessing frame internals.
2450
2451 * w32font.h: Include font.h. Define syms_of_w32font and
2452 globals_of_w32font.
2453
2454 * process.c: Include TERM_HEADER instead of listing all possible
2455 window-system headers.
2456
2457 * nsterm.h: Remove declarations now in frame.h.
2458 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
2459
2460 * menu.c: Include TERM_HEADER instead of listing all possible
2461 window-system headers.
2462
2463 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2464 window system.
2465
2466 * keyboard.c: Include TERM_HEADER instead of listing all possible
2467 window-system headers.
2468
2469 * image.c: Include TERM_HEADER instead of listing all possible
2470 window-system headers. Declare Vlibrary_cache when compiling for
2471 Windows.
2472
2473 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2474 window system declarations.
2475
2476 * frame.h: Move common functions here: set_frame_menubar,
2477 x_set_window_size, x_sync, x_get_focus_frame,
2478 x_set_mouse_position, x_set_mouse_pixel_position,
2479 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
2480 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
2481 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
2482 x_activate_menubar, x_real_positions, x_bitmap_icon,
2483 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
2484 and x_query_colors.
2485
2486 * frame.c: Include TERM_HEADER instead of listing all possible
2487 window-system headers.
2488
2489 * font.c: Include TERM_HEADER instead of listing all possible
2490 window-system headers.
2491
2492 * emacs.c: Include TERM_HEADER.
2493
2494 * dispnew.c: Include TERM_HEADER instead of listing all possible
2495 window-system headers.
2496
2497 * ccl.h: Include character.h.
2498
2499 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2500 the current window system; include in list of objects to link into
2501 Emacs.
2502
2503 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2504
2505 Remove mark_ttys function and fix tty_display_info initialization.
2506 * lisp.h (mark_ttys): Remove prototype.
2507 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2508 to mark_ttys because all possible values of 'top_frame' slot are
2509 the frames which are reachable from Vframe_list.
2510 * term.c (mark_ttys): Remove.
2511 (init_tty): Safely initialize 'top_frame' slot with Qnil.
2512
2513 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2514
2515 Change struct frame bitfields from unsigned char to unsigned.
2516 * frame.h (struct frame): Change type of 'display_preempted',
2517 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2518 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2519 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2520 bitfields from unsigned char to unsigned.
2521
2522 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2523
2524 Remove unused member of struct x_output and struct w32_output.
2525 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2526 * w32term.h (struct w32_output): Likewise.
2527
2528 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2529
2530 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2531 does not become zero (Bug#12234).
2532
2533 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2534
2535 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2536 for GCC 4.7.1 x86-64.
2537
2538 2012-08-30 Glenn Morris <rgm@gnu.org>
2539
2540 * lread.c (init_lread): For out-of-tree builds, only add the
2541 source directory's site-lisp dir to the load-path if it exists,
2542 consistent with in-tree builds. (Bug#12302)
2543
2544 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
2545
2546 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
2547 button_values to NULL. Call setStykeMask so dialogs get a close button.
2548 (windowShouldClose:): Set window_closed.
2549 (dealloc): New member, free button_values.
2550 (process_dialog:): Make member function. Remove window argument,
2551 replace window with self. Count buttons and allocate and store values
2552 in button_values.
2553 (addButton:value:row:): value is int with the name tag. Call setTag
2554 with tag. Remove return self, declare return value as void.
2555 (addString:row:): Remove return self, declare return value as void.
2556 (addSplit): Remove return self, declare return value as void.
2557 (clicked:): Remove return self, declare return value as void.
2558 Set dialog_return to button_values[seltag]. Code formatting change.
2559 (initFromContents:isQuestion:): Adjust call to process_dialog.
2560 Code formatting change.
2561 (timeout_handler:): Set timer_fired to YES.
2562 (runDialogAt:): Set timer_fired to NO.
2563 Handle click on close button as quit.
2564
2565 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
2566 Add window_closed and button_values. Add void as return value for
2567 add(Button|String|Split). addButton takes int instead of Lisp_Object.
2568 Add process_dialog as new member.
2569
2570 2012-08-28 Eli Zaretskii <eliz@gnu.org>
2571
2572 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
2573 is not one of the heaps we manage. (Bug#12242)
2574
2575 2012-08-28 Glenn Morris <rgm@gnu.org>
2576
2577 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
2578
2579 2012-08-28 Martin Rudalics <rudalics@gmx.at>
2580
2581 * window.c (Fset_window_configuration): Remove handling of
2582 auto-buffer-name window parameter. Install revision of reverted
2583 fix.
2584
2585 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2586
2587 Do not allow to set major mode for a dead buffer.
2588 * buffer.c (Fset_buffer_major_mode): Signal an error
2589 if the buffer is dead.
2590 (Fother_buffer, other_buffer_safely): Remove redundant
2591 nested declaration.
2592
2593 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2594
2595 Always use set_buffer_if_live to restore original buffer at unwind.
2596 * buffer.h (record_unwind_current_buffer): New function.
2597 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
2598 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
2599 * undo.c, window.c: Adjust users.
2600 * buffer.c (set_buffer_if_live): Fix comment.
2601
2602 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2603
2604 Fix usage of set_buffer_internal.
2605 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
2606 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
2607 * coding.c (decode_coding): Omit redundant test.
2608 * fileio.c (decide_coding_unwind): Likewise.
2609 * fns.c (secure_hash): Likewise.
2610 * insdel.c (modify_region): Likewise.
2611 * keyboard.c (command_loop_1): Likewise.
2612 * print.c (PRINTFINISH): Likewise.
2613 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
2614
2615 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2616
2617 * dispnew.c: Use bool for boolean.
2618 (frame_garbaged, display_completed, delayed_size_change)
2619 (fonts_changed_p, add_window_display_history)
2620 (add_frame_display_history, verify_row_hash)
2621 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
2622 (row_equal_p, realloc_glyph_pool)
2623 (allocate_matrices_for_frame_redisplay)
2624 (showing_window_margins_p)
2625 (adjust_frame_glyphs_for_frame_redisplay)
2626 (build_frame_matrix_from_leaf_window, make_current)
2627 (mirrored_line_dance, mirror_line_dance, update_frame)
2628 (update_window_tree, update_single_window)
2629 (check_current_matrix_flags, update_window, update_text_area)
2630 (update_window_line, set_window_update_flags, scrolling_window)
2631 (update_frame_1, scrolling, buffer_posn_from_coords)
2632 (do_pending_window_change, change_frame_size)
2633 (change_frame_size_1, sit_for):
2634 Use bool for boolean.
2635 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2636 and remove last int (actually boolean) argument, which was always 0.
2637 All callers changed.
2638 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2639 * dispextern.h (struct composition_it): Use bool for boolean.
2640 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2641 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2642 * dired.c (file_name_completion):
2643 Use bool for boolean. (This was missed in an earlier change.)
2644
2645 2012-08-27 Martin Rudalics <rudalics@gmx.at>
2646
2647 * window.c (Fset_window_configuration): Revert first part of
2648 last change.
2649
2650 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
2651
2652 * nsterm.h (NSPanel): New class variable dialog_return.
2653
2654 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2655 Initialize dialog_return.
2656 (windowShouldClose:): Use stop instead of stopModalWithCode.
2657 (clicked:): Ditto, and also set dialog_return (Bug#12258).
2658 (timeout_handler:): Use stop instead of abortModal. Send a dummy
2659 event.
2660 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
2661 modal loop returns.
2662
2663 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2664
2665 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2666 * composite.c (find_composition, composition_gstring_p)
2667 (composition_reseat_it, find_automatic_composition):
2668 * data.c (let_shadows_buffer_binding_p)
2669 (let_shadows_global_binding_p, set_internal, make_blv)
2670 (Fmake_variable_buffer_local, Fmake_local_variable)
2671 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2672 (cons_to_signed, arith_driver):
2673 * dbusbind.c (xd_in_read_queued_messages):
2674 * dired.c (directory_files_internal, file_name_completion):
2675 Use bool for booleans.
2676 * dired.c (file_name_completion):
2677 * process.h (fd_callback):
2678 Omit int (actually boolean) argument. It wasn't being used.
2679 All uses changed.
2680 * composite.h, lisp.h: Reflect above API changes.
2681
2682 * cmds.c, coding.c: Use bool for booleans.
2683 * cmds.c (move_point, Fself_insert_command):
2684 * coding.h (struct composition status, struct coding_system):
2685 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2686 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2687 (emacs_mule_char, decode_coding_emacs_mule)
2688 (encode_coding_emacs_mule, detect_coding_iso_2022)
2689 (decode_coding_iso_2022, encode_invocation_designation)
2690 (encode_designation_at_bol, encode_coding_iso_2022)
2691 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2692 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2693 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2694 (encode_coding_raw_text, detect_coding_charset)
2695 (decode_coding_charset, encode_coding_charset, detect_eol)
2696 (detect_coding, get_translation_table, produce_chars)
2697 (consume_chars, reused_workbuf_in_use)
2698 (make_conversion_work_buffer, code_conversion_save)
2699 (decode_coding_object, encode_coding_object)
2700 (detect_coding_system, char_encodable_p)
2701 (Funencodable_char_position, code_convert_region)
2702 (code_convert_string, code_convert_string_norecord)
2703 (Fset_coding_system_priority):
2704 * fileio.c (Finsert_file_contents):
2705 Use bool for booleans.
2706 * coding.h, lisp.h: Reflect above API changes.
2707 * coding.c: Remove unnecessary static function decls.
2708 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2709 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2710 not a boolean 'int', since callers never look at the return value.
2711 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2712 * coding.h (decoding_buffer_size, encoding_buffer_size)
2713 (emacs_mule_string_char): Remove unused extern decls.
2714 (struct iso_2022_spec, struct coding_system):
2715 Use 'unsigned int : 1' for boolean fields, since there's more than one.
2716 (struct emacs_mule_spec): Remove unused field 'full_support'.
2717 All initializations removed.
2718 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2719
2720 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2721
2722 Fix spare memory change (Bug#12286).
2723 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
2724 (valid_lisp_object_p): Likewise.
2725
2726 2012-08-27 Martin Rudalics <rudalics@gmx.at>
2727
2728 * window.c (Fset_window_configuration): Record any window's old
2729 buffer if it's replaced (see Bug#8789). If the new current
2730 buffer doesn't appear in the selected window, go to its old
2731 point (Bug#12208).
2732
2733 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2734
2735 Special MEM_TYPE_SPARE to denote reserved memory.
2736 * alloc.c (enum mem_type): New memory type.
2737 (refill_memory_reserve): Use new type for spare memory.
2738 This prevents live_cons_p and live_string_p from incorrect
2739 detection of uninitialized objects from spare memory as live.
2740
2741 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2742
2743 Spelling fixes.
2744 * Makefile.in (.PHONY): versioclean -> versionclean.
2745
2746 Remove unused external symbols.
2747 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2748 * window.c (Qwindow_valid_p, decode_valid_window):
2749 Now static, not extern.
2750 * data.c (Qinterval): Remove; unused.
2751 (syms_of_data): Do not define 'interval'.
2752 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2753 * window.h (decode_valid_window):
2754 Remove decls.
2755
2756 * character.c, charset.c, chartab.c: Use bool for booleans.
2757 * character.c (lisp_string_width, string_count_byte8)
2758 (string_escape_byte8):
2759 * charset.c (charset_map_loaded, load_charset_map, read_hex):
2760 (load_charset_map_from_file, map_charset_chars)
2761 (Fdefine_charset_internal, define_charset_internal)
2762 (Fdeclare_equiv_charset, find_charsets_in_text)
2763 (Ffind_charset_region, char_charset, Fiso_charset):
2764 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2765 (sub_char_table_set, sub_char_table_set_range)
2766 (char_table_set_range, optimize_sub_char_table)
2767 (map_sub_char_table):
2768 Use bool for boolean.
2769 * character.c (str_to_unibyte): Omit last boolean argument; it was
2770 always 0. All callers changed.
2771 * character.h, charset.h: Adjust to match previous changes.
2772 * character.h (char_printable_p): Remove decl of nonexistent function.
2773 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2774 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2775 are all boolean, so make them single-bit bitfields.
2776
2777 * lisp.h (ASET): Remove attempt to detect side effects.
2778 It was meant to be temporary and it often doesn't work,
2779 because when IDX has side effects the behavior of IDX==IDX
2780 is undefined. See Stefan Monnier in
2781 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2782
2783 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2784
2785 * lisp.h (functionp): New function (extracted from Ffunctionp).
2786 (FUNCTIONP): Use it.
2787 * eval.c (Ffunctionp): Use it.
2788
2789 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2790
2791 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2792 as that's faster and simpler than static storage. Don't bother
2793 with the g_main_context_query overhead if g_main_context_pending
2794 says no events are pending.
2795 (gfds, gfds_size): Remove these static vars.
2796 (xgselect_initialize): Remove; no longer needed.
2797 All uses and decls removed.
2798
2799 * emacs.c (fatal_error_signal_hook): Remove.
2800 All uses removed. This leftover from old code was always 0.
2801
2802 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2803 * casefiddle.c (casify_object, casify_region):
2804 * casetab.c (set_case_table):
2805 * category.c, category.h (word_boundary_p):
2806 * category.h (CHAR_HAS_CATEGORY):
2807 Use bool for booleans, instead of int.
2808
2809 2012-08-25 Eli Zaretskii <eliz@gnu.org>
2810
2811 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2812
2813 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2814
2815 On assertion failure, print backtrace if available.
2816 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2817 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2818 * Makefile.in (LIB_EXECINFO): New macro.
2819 (LIBES): Use it.
2820
2821 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2822 * bytecode.c (exec_byte_code):
2823 * callint.c (check_mark, Fcall_interactively):
2824 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2825 (getenv_internal, sync_process_alive, call_process_exited):
2826 * lisp.h (USE_SAFE_ALLOCA):
2827 Use bool for booleans, instead of int.
2828 * lisp.h, process.h: Adjust prototypes to match above changes.
2829 * callint.c (Fcall_interactively): Don't assume the mark's
2830 offset fits in 'int'.
2831
2832 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2833
2834 * buffer.c, buffer.h: Use bool for boolean.
2835 * buffer.c (reset_buffer_local_variables)
2836 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2837 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2838 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2839 (overlay_touches_p, overlay_strings, Foverlay_put)
2840 (report_overlay_modification, call_overlay_mod_hooks):
2841 (mmap_enlarge, mmap_set_vars):
2842 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2843 Use bool for booleans, instead of int.
2844 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2845 since the 1-or-0 return value is always ignored anyway.
2846 (mmap_initialized_p):
2847 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2848 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2849
2850 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2851
2852 * bidi.c: Use bool for boolean.
2853 This is a bit more readable, and makes the text segment of bidi.o
2854 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2855 Presumably it's faster too.
2856 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2857 Now bool.
2858 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2859 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2860 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2861 (bidi_explicit_dir_char, bidi_level_of_next_char)
2862 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2863 Use bool for booleans, instead of int.
2864 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2865 (bidi_unshelve_cache): Adjust decls to match code.
2866
2867 2012-08-23 Martin Rudalics <rudalics@gmx.at>
2868
2869 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2870 argument.
2871
2872 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2873
2874 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2875 * atimer.h: Include <stdbool.h>.
2876
2877 2012-08-22 Dan Nicolaescu <dann@gnu.org>
2878
2879 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2880 compile time tests instead of run time tests on systems that do
2881 not use them.
2882 (FRAME_MAC_P): Remove leftover from deleted code.
2883 * frame.c (syms_of_frame): Remove leftover from deleted code.
2884
2885 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2886
2887 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2888
2889 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2890
2891 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2892 Otherwise, the compiler complains about (A?B:C) where B is void
2893 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
2894 (fontset_add): Return void, for FONTSET_ADD.
2895
2896 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2897
2898 * alloc.c: Use bool for booleans.
2899 (gc_in_progress, abort_on_gc)
2900 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2901 (dont_register_blocks) [GC_MALLOC_CHECK]:
2902 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2903 (check_string_bytes, make_specified_string, memory_full)
2904 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2905 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2906 (mark_stack, valid_pointer_p, make_pure_string)
2907 (Fgarbage_collect, survives_gc_p, gc_sweep):
2908 Use bool for booleans, instead of int.
2909 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2910 Remove unused local.
2911 * alloc.c (PURE_POINTER_P):
2912 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2913 * editfns.c (Fformat):
2914 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2915 (Fdo_auto_save):
2916 * fns.c (sweep_weak_table):
2917 * lisp.h (suppress_checking, push_message, survives_gc_p)
2918 (make_pure_string, gc_in_progress, abort_on_gc):
2919 * lread.c (readchar, read1):
2920 * print.c (Fprin1_to_string):
2921 * xdisp.c (push_message):
2922 Use bool for booleans affected directly or indirectly by
2923 alloc.c's changes.
2924
2925 Make recently-introduced setters macros.
2926 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2927 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2928 (set_fontset_default, set_fontset_fallback): Rename from their
2929 upper-case counterparts, and make them functions rather than macros.
2930 This is more consistent with the other recently-introduced setters.
2931 These don't need to be inline, since they're local.
2932
2933 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2934
2935 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2936 the loop (Bug#12247).
2937
2938 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2939
2940 * lisp.h (vcopy): Use memcpy rather than our own loop.
2941 This fixes a performance regression introduced by the recent
2942 addition of vcopy. This means 'vcopy' will need to be modified
2943 for a copying collector, but that's OK. Also, tighten the
2944 checking in the assertion.
2945
2946 2012-08-21 Eli Zaretskii <eliz@gnu.org>
2947
2948 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2949 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2950 non-base glyph for the width of the base character, according to
2951 what x_draw_composite_glyph_string_foreground expects.
2952 Generate WADJUST value according to composition_gstring_width's
2953 expectations, to produce correct width of the composed character.
2954 Reverse the sign of the DU offset produced by ScriptPlace.
2955
2956 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2957
2958 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2959
2960 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2961
2962 Avoid direct writes to contents member of struct Lisp_Vector.
2963 * lisp.h (vcopy): New function to copy data into vector.
2964 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2965 * fns.c (Ffillarray): Use ASET.
2966 * keyboard.c (timer_check_2): Use AREF and ASET.
2967 (append_tool_bar_item, Frecent_keys): Use vcopy.
2968 * lread.c (read_vector): Use ASET.
2969 * msdos.c (Frecent_doskeys): Use vcopy.
2970 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2971 (Finternal_merge_in_global_face): Use ASET and vcopy.
2972 * xfont.c (xfont_list_pattern): Likewise.
2973
2974 2012-08-21 Martin Rudalics <rudalics@gmx.at>
2975
2976 * window.c (Fwindow_point): For the selected window always return
2977 the position of its buffer's point.
2978 (Fset_window_point): For the selected window always go in its
2979 buffer to the specified position.
2980
2981 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2982
2983 Setter macros for fontsets.
2984 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2985 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2986 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2987 Adjust users.
2988
2989 2012-08-20 Glenn Morris <rgm@gnu.org>
2990
2991 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2992 Don't assume that `ln -f' works.
2993
2994 2012-08-20 Eli Zaretskii <eliz@gnu.org>
2995
2996 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2997 and later about non-assignments with no effect. See discussion at
2998 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2999 details.
3000
3001 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3002
3003 Inline setter functions for Lisp_Objects slots of struct specbinding.
3004 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3005 Adjust users.
3006
3007 2012-08-20 Martin Rudalics <rudalics@gmx.at>
3008
3009 * window.c (select_window): Always make selected window's buffer
3010 current.
3011
3012 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3013
3014 Use AREF and ASET for docstrings of category tables.
3015 * category.h (CATEGORY_DOCSTRING): Use AREF.
3016 (SET_CATEGORY_DOCSTRING): Use ASET.
3017 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3018
3019 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3020
3021 Inline setter functions for hash table members.
3022 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3023 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3024 (set_hash_key_and_value, set_hash_index, set_hash_next)
3025 (set_hash_hash): New functions.
3026 * charset.c, fns.c: Adjust users.
3027
3028 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3029
3030 Inline getter and setter functions for per-buffer values.
3031 * buffer.h (per_buffer_default, set_per_buffer_default)
3032 (per_buffer_value, set_per_buffer_value): New functions.
3033 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3034 * buffer.c, data.c: Adjust users.
3035
3036 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
3037
3038 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3039
3040 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3041
3042 Rely on <config.h> + <unistd.h> to declare 'environ',
3043 as gnulib does this if the system doesn't.
3044 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
3045 Remove declaration. MS-Windows declares it on stdlib.h which is
3046 included by conf_post.h.
3047 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3048 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3049 * vm-limit.c: Include <unistd.h>, for 'environ'.
3050
3051 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3052 (start_of_data): Remove decl; mem-limits.h provides it.
3053
3054 * xdisp.c (handle_invisible_prop): Make it a bit faster
3055 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3056
3057 2012-08-19 Chong Yidong <cyd@gnu.org>
3058
3059 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3060 ends (Bug#3874).
3061
3062 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3063
3064 * .gdbinit: Use call instead of set when calling a function in the
3065 inferior.
3066
3067 * data.c (set_internal): Don't use set_blv_found.
3068 (Fkill_local_variable): Likewise.
3069
3070 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3071
3072 * nsfont.m (ns_ascii_average_width): Ensure the string
3073 ascii_printable is initialized with a null-terminated character
3074 array. Otherwise, it can contain undesired extra characters.
3075
3076 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3077
3078 port new setting code to Sun C 5.8 2005/10/13
3079 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3080 Return void, not Lisp_Object. Otherwise, the compiler
3081 complains about (A?B:C) where B is void and C is Lisp_Object
3082 when compiling CHAR_TABLE_SET, due to the recent change to
3083 the API of sub_char_table_set_contents.
3084
3085 2012-08-18 Chong Yidong <cyd@gnu.org>
3086
3087 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3088 for the string case (Bug#3874).
3089
3090 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3091
3092 * buffer.h (BSET): Remove (Bug#12215).
3093 Replace all uses with calls to new setter functions.
3094 (bset_bidi_paragraph_direction, bset_case_canon_table)
3095 (bset_case_eqv_table, bset_directory, bset_display_count)
3096 (bset_display_time, bset_downcase_table)
3097 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3098 (bset_last_selected_window, bset_local_var_alist)
3099 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3100 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3101 (bset_width_table):
3102 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3103 (bset_auto_fill_function, bset_auto_save_file_format)
3104 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3105 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3106 (bset_cache_long_line_scans, bset_case_fold_search)
3107 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3108 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3109 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3110 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3111 (bset_header_line_format, bset_indicate_buffer_boundaries)
3112 (bset_indicate_empty_lines, bset_invisibility_spec)
3113 (bset_left_fringe_width, bset_major_mode, bset_mark)
3114 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3115 (bset_name, bset_overwrite_mode, bset_pt_marker)
3116 (bset_right_fringe_width, bset_save_length)
3117 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3118 (bset_scroll_up_aggressively, bset_selective_display)
3119 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3120 (bset_word_wrap, bset_zv_marker):
3121 * category.c (bset_category_table):
3122 * syntax.c (bset_syntax_table):
3123 New setter functions.
3124
3125 * process.h (PSET): Remove (Bug#12215).
3126 Replace all uses with calls to new setter functions.
3127 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3128 (PROCESS_INLINE): New macro.
3129 (pset_childp): New setter function.
3130 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3131 * process.c (PROCESS_INLINE):
3132 Define to EXTERN_INLINE, so that the corresponding functions
3133 are compiled into code.
3134 (pset_buffer, pset_command, pset_decode_coding_system)
3135 (pset_decoding_buf, pset_encode_coding_system)
3136 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3137 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3138 (pset_type, pset_write_queue): New setter functions.
3139
3140 * window.h (WSET): Remove (Bug#12215).
3141 Replace all uses with calls to new setter functions.
3142 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3143 (WINDOW_INLINE): New macro.
3144 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3145 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3146 (wset_total_lines, wset_vertical_scroll_bar)
3147 (wset_window_end_pos, wset_window_end_valid)
3148 (wset_window_end_vpos): New setter functions.
3149 * window.c (WINDOW_INLINE):
3150 Define to EXTERN_INLINE, so that the corresponding functions
3151 are compiled into code.
3152 (wset_combination_limit, wset_dedicated, wset_display_table)
3153 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3154 (wset_new_normal, wset_new_total, wset_next_buffers)
3155 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3156 (wset_prev_buffers, wset_right_fringe_width)
3157 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3158 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3159 (wset_window_parameters):
3160 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3161 (wset_column_number_displayed, wset_region_showing):
3162 New setter functions.
3163
3164 * termhooks.h (TSET): Remove (Bug#12215).
3165 Replace all uses with calls to new setter functions.
3166 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3167 (TERMHOOKS_INLINE): New macro.
3168 (tset_charset_list, tset_selection_alist): New setter functions.
3169 * terminal.c (TERMHOOKS_INLINE):
3170 Define to EXTERN_INLINE, so that the corresponding functions
3171 are compiled into code.
3172 (tset_param_alist): New setter function.
3173
3174 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3175
3176 * keyboard.h (KSET): Remove (Bug#12215).
3177 Replace all uses with calls to new setter functions.
3178 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3179 (KEYBOARD_INLINE): New macro.
3180 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3181 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3182 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3183 New setter functions.
3184 * keyboard.c (KEYBOARD_INLINE):
3185 Define to EXTERN_INLINE, so that the corresponding functions
3186 are compiled into code.
3187 (kset_echo_string, kset_kbd_queue)
3188 (kset_keyboard_translate_table, kset_last_prefix_arg)
3189 (kset_last_repeatable_command, kset_local_function_key_map)
3190 (kset_overriding_terminal_local_map, kset_real_last_command)
3191 (kset_system_key_syms): New setter functions.
3192
3193 * frame.h (FSET): Remove (Bug#12215).
3194 Replace all uses with calls to new setter functions.
3195 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3196 (FRAME_INLINE): New macro.
3197 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3198 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3199 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3200 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3201 (fset_param_alist, fset_root_window, fset_scroll_bars)
3202 (fset_selected_window, fset_title, fset_tool_bar_items)
3203 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3204 * frame.c (FRAME_INLINE):
3205 Define to EXTERN_INLINE, so that the corresponding functions
3206 are compiled into code.
3207 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3208
3209 A few more naming-convention fixes for getters and setters.
3210 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3211 and rename from buffer_overlays_set_before.
3212 (set_buffer_overlays_after): Move here from buffer.h, and rename
3213 from buffer_overlays_set_after.
3214 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3215 All uses changed.
3216 (set_buffer_intervals): Rename from buffer_set_intervals.
3217 * intervals.c (set_interval_object): Move here from intervals.h,
3218 and rename from interval_set_object.
3219 (set_interval_left): Move here from intervals.h, and rename from
3220 interval_set_left.
3221 (set_interval_right): Move here from intervals.h, and rename from
3222 interval_set_right.
3223 (copy_interval_parent): Move here from intervals.h, and rename from
3224 interval_copy_parent.
3225 * intervals.h (set_interval_parent): Rename from interval_set_parent.
3226 (set_interval_plist): Rename from interval_set_plist.
3227 Return void, not Lisp_Object, since no caller uses the result.
3228 * lisp.h (string_intervals): Rename from string_get_intervals.
3229 (set_string_intervals): Rename from string_set_intervals.
3230
3231 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
3232 (set_char_table_contents): Rename from char_table_set_contents.
3233 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
3234 All uses changed. See the end of
3235 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
3236
3237 * lisp.h (CSET): Remove (Bug#12215).
3238 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
3239 (set_char_table_purpose): New functions,
3240 replacing CSET. All uses changed. For example, replace
3241 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
3242 "set_char_table_parent (char_table, parent);".
3243 The old version was confusing because it used the same name
3244 'parent' for two different things.
3245
3246 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3247
3248 Functions to get and set Lisp_Object fields of buffer-local variables.
3249 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
3250 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
3251 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
3252 * data.c, eval.c, frame.c: Adjust users.
3253
3254 2012-08-17 Chong Yidong <cyd@gnu.org>
3255
3256 * xfaces.c (merge_face_vectors): If the target font specfies a
3257 font spec, make the font's attributes take precedence over
3258 directly-specified attributes.
3259 (merge_face_ref): Recognize :font.
3260
3261 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3262
3263 Do not use memcpy for copying intervals.
3264 * intervals.c (reproduce_interval): New function.
3265 (reproduce_tree, reproduce_tree_obj): Use it.
3266 (reproduce_tree_obj): Remove prototype.
3267
3268 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3269
3270 * lisp.h (duration_to_sec_usec): Remove unused decl.
3271
3272 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
3273
3274 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
3275 to an allocated instance of NSString, not to the class itself.
3276
3277 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
3278
3279 * makefile.w32-in (C_CTYPE_H): New macro.
3280 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
3281 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
3282 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3283
3284 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
3285
3286 Use ASCII tests for character types.
3287 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
3288 * xfns.c, xterm.c:
3289 Don't include <ctype.h>; was not needed.
3290 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
3291 * sysdep.c, xfaces.c:
3292 Include <c-ctype.h> instead of <ctype.h>.
3293 * nsterm.m: Include <c-ctype.h>.
3294 * charset.c (read_hex):
3295 * doc.c (Fsnarf_documentation):
3296 * fileio.c (IS_DRIVE) [WINDOWSNT]:
3297 (DRIVE_LETTER) [DOS_NT]:
3298 (Ffile_name_directory, Fexpand_file_name)
3299 (Fsubstitute_in_file_name):
3300 * font.c (font_parse_xlfd, font_parse_fcname):
3301 * frame.c (x_set_font_backend):
3302 * gtkutil.c (xg_get_font):
3303 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
3304 * nsimage.m (hexchar):
3305 * nsterm.m (ns_xlfd_to_fontname):
3306 * sysdep.c (system_process_attributes):
3307 * xfaces.c (hash_string_case_insensitive):
3308 Use C-locale tests instead of locale-specific tests for character
3309 types, since we want the ASCII interpretation here, not the
3310 interpretation suitable for whatever happens to be the current locale.
3311
3312 2012-08-16 Martin Rudalics <rudalics@gmx.at>
3313
3314 Consistently check windows for validity/liveness
3315 (Bug#11984, Bug#12025, Bug#12026).
3316 * lisp.h (CHECK_VALID_WINDOW): New macro.
3317 * window.c (decode_window): Rename to decode_live_window.
3318 (decode_valid_window, Fwindow_valid_p): New functions.
3319 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
3320 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
3321 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
3322 (Fwindow_prev_sibling, Fwindow_combination_limit)
3323 (Fset_window_combination_limit, Fwindow_use_time)
3324 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
3325 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
3326 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
3327 (Fwindow_hscroll, Fset_window_hscroll)
3328 (Fwindow_redisplay_end_trigger)
3329 (Fset_window_redisplay_end_trigger, Fwindow_edges)
3330 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
3331 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
3332 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
3333 (Fwindow_end, Fset_window_point, Fset_window_start)
3334 (Fpos_visible_in_window_p, Fwindow_line_height)
3335 (Fwindow_dedicated_p, Fset_window_dedicated_p)
3336 (Fwindow_prev_buffers, Fset_window_prev_buffers)
3337 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
3338 (Fset_window_parameter, Fwindow_display_table)
3339 (Fset_window_display_table, Fdelete_other_windows_internal)
3340 (Fset_window_buffer, Fset_window_new_total)
3341 (Fset_window_new_normal, Fdelete_window_internal)
3342 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
3343 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
3344 (Fwindow_scroll_bars): Check whether argument window is a valid or
3345 live window. Update doc-strings.
3346 (syms_of_window): New symbol Qwindow_valid_p.
3347 * keyboard.c (Fposn_at_x_y): Check whether argument
3348 frame_or_window denotes a valid window.
3349
3350 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3351
3352 Fix previous char table change.
3353 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
3354 * chartab.c (optimize_sub_char_table): Likewise.
3355
3356 2012-08-16 Chong Yidong <cyd@gnu.org>
3357
3358 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
3359
3360 * xfont.c (xfont_open):
3361 * xftfont.c (xftfont_open): Set the font's max_width field.
3362
3363 * nsfont.m (nsfont_open): Similar to the Xft backend, set
3364 min_width to space_width and average_width to the average over
3365 printable ASCII characters.
3366 (ns_char_width): Code cleanup.
3367 (ns_ascii_average_width): New utility function.
3368
3369 * font.h (struct font): Update comments.
3370
3371 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3372
3373 Simple interface to set Lisp_Object fields of character tables.
3374 * lisp.h (CSET): New macro.
3375 (char_table_set_extras, char_table_set_contents)
3376 (sub_char_table_set_contents): New function.
3377 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
3378 * syntax.c: Adjust users.
3379
3380 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
3381
3382 * eval.c (eval_sub): Bind lexical-binding.
3383 * lread.c (Qlexical_binding): Make non-static.
3384
3385 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
3386
3387 * nsmenu.m (popupSession): Remove.
3388 (pop_down_menu): Remove endModalSession.
3389 (timeout_handler:): New method.
3390 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
3391 Call runModalForWindow. Check timer_fired when it returns.
3392 If not set, cancel timer and break out of loop.
3393 Otherwise loop again, with a new timeout.
3394
3395 * nsterm.m: Include fcntl.h if present.
3396 (fd_entry, t_readfds, inNsSelect): Remove.
3397 (select_writefds, select_valid, select_timeout, selfds)
3398 (select_mutex, apploopnr): Add.
3399 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
3400 Otherwise call kbd_buffer_store_event.
3401 (ns_send_appdefined): Remove release of fd_entry.
3402 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
3403 Increment and decrement apploopnr.
3404 (ns_select): If no file descriptors, just do a NSTimer.
3405 Otherwise copy read/write masks and start select thread (fd_handler).
3406 Start main loop and wait for application defined event.
3407 Inform select thread to stop selecting after main loop is exited.
3408 (ns_term_init): Create selfds pipe and set non-blocking.
3409 Initialize select_mutex. Start the select thread (fd_handler).
3410 (fd_handler:): Loop forever, wait for info from the main thread
3411 to either start or stop selecting. When select returns, send
3412 and appdefined event.
3413 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
3414 If not call kbd_buffer_store_event.
3415
3416 * nsterm.h (EmacsApp): fd_handler takes id argument.
3417 (EmacsDialogPanel): Add timer_fired and timeout_handler.
3418
3419 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3420
3421 2012-08-15 Eli Zaretskii <eliz@gnu.org>
3422
3423 * region-cache.c (move_cache_gap): Update gap_len using the actual
3424 growth of the boundaries array. Do not change cache_len.
3425 (Bug#12196)
3426
3427 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3428
3429 Generalize and cleanup font subsystem checks.
3430 * font.h (FONT_DEBUG, font_assert): Remove.
3431 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
3432 Change font_assert to eassert. Use eassert where appropriate.
3433
3434 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3435
3436 * gtkutil.c (xg_get_font): Use pango_units_to_double.
3437
3438 2012-08-15 Chong Yidong <cyd@gnu.org>
3439
3440 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
3441 When using the new font chooser, use gtk_font_chooser_get_font_desc to
3442 extract the font descriptor instead of just the font name.
3443 In that case, return a font spec instead of a string.
3444 (x_last_font_name): Move to this file from xfns.c.
3445
3446 * xfns.c (Fx_select_font): The return value can also be a font
3447 spec. Move x_last_font_name management to gtkutil.c.
3448
3449 * xfaces.c: Make font weight and style symbols non-static.
3450
3451 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
3452
3453 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3454 (bug#12117).
3455
3456 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
3457
3458 * alloc.c (Fgarbage_collect): Use plural form consistently.
3459
3460 2012-08-14 Eli Zaretskii <eliz@gnu.org>
3461
3462 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3463 iteration through the command loop. Fixes a problem whereby mouse
3464 movements are ignored until the first mouse click.
3465
3466 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3467
3468 Use bool, not int, for Lisp booleans.
3469 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3470 makes Emacs a bit smaller and presumably a bit faster.
3471 * lisp.h: Include <stdbool.h>.
3472 (struct Lisp_Boolfwd, defvar_bool):
3473 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3474 * regex.c [!emacs]: Include <stdbool.h>.
3475 (false, true): Remove; <stdbool.h> does this for us now.
3476
3477 2012-08-14 Chong Yidong <cyd@gnu.org>
3478
3479 * character.c (Fcharacterp): Doc fix (Bug#12076).
3480
3481 * data.c (Findirect_variable): Doc fix (Bug#11040).
3482
3483 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
3484
3485 * editfns.c (Fformat): Doc fix (Bug#12059).
3486 (Fsave_current_buffer): Doc fix (Bug#11542).
3487
3488 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3489
3490 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3491 (bug#12022).
3492
3493 2012-08-14 Martin Rudalics <rudalics@gmx.at>
3494
3495 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3496 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3497 * minibuf.c (choose_minibuf_frame, read_minibuf):
3498 * w32fns.c (x_create_tip_frame):
3499 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3500 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3501
3502 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3503
3504 * intervals.c (offset_intervals): Remove obsolete comment.
3505
3506 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3507
3508 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3509
3510 2012-08-14 Gergely Risko <gergely@risko.hu>
3511
3512 * coding.c (decode_coding): Record buffer modification before
3513 disabling undo_list (Bug#11773).
3514
3515 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3516
3517 Revert and cleanup some recent overlay changes.
3518 * buffer.h (enum overlay_type): Remove.
3519 (buffer_get_overlays, buffer_set_overlays): Likewise.
3520 (buffer_set_overlays_before, buffer_set_overlays_after):
3521 New function. Adjust users.
3522 (unchain_both): Add eassert.
3523
3524 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3525
3526 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3527
3528 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3529
3530 * gtkutil.c (xg_mark_data): Don't assume C99.
3531
3532 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3533
3534 * gtkutil.c (xg_frame_tb_info): New struct.
3535 (TB_INFO_KEY): New define.
3536 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3537 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3538 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3539 if not present.
3540 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
3541 is up to date. Otherwise store new data.
3542 (free_frame_tool_bar): Free xg_frame_tb_info if present.
3543
3544 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3545
3546 Use KSET for write access to Lisp_Object members of struct kboard.
3547 * keyboard.h (KSET): New macro.
3548 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3549 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3550 * xterm.c: Adjust users.
3551
3552 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3553
3554 Use BSET for write access to Lisp_Object members of struct buffer.
3555 * buffer.h (BSET): New macro.
3556 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3557 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3558 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3559 * window.c, xdisp.c, xfns.c: Adjust users.
3560
3561 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
3562
3563 * lread.c (syms_of_lread): Initialize Vlexical_binding.
3564
3565 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
3566
3567 * nsterm.m (not_in_argv): New function.
3568 (application:openFile, application:openTempFile:):
3569 (application:openFileWithoutUI:, application:openFiles:): Open file
3570 if not_in_argv returns non-zero (bug#12171).
3571
3572 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
3573 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
3574 Define for Gtk+ versions less than 3.2.
3575 (xg_get_font_name): Use those functions/macros here.
3576 Reported by Frans Oilinki <moilinki@gmail.com>.
3577
3578 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3579
3580 * unexmacosx.c (copy_data_segment): Copy initialized data in
3581 statically linked libraries from input file rather than memory.
3582
3583 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
3584 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
3585 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
3586
3587 2012-08-10 Glenn Morris <rgm@gnu.org>
3588
3589 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
3590 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
3591
3592 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3593
3594 Fix last change to allow compilation with low optimization levels.
3595 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
3596 Reported by Jan Djärv <jan.h.d@swipnet.se>.
3597
3598 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3599
3600 Use common inline syntax in intervals.h.
3601 * intervals.h (INTERVALS_INLINE): New macro.
3602 Change all users from LISP_INLINE.
3603
3604 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3605
3606 Define Qnone once for all platforms.
3607 * frame.c (Qnone): Define here.
3608 (syms_of_frame): DEFSYM it.
3609 * lisp.h (Qnone): New declaration.
3610 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
3611 * xfns.c: Remove duplication. Adjust users.
3612
3613 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3614
3615 Remove unused macros from intervals.h.
3616 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
3617 * intervals.c: Adjust comment.
3618
3619 2012-08-10 Eli Zaretskii <eliz@gnu.org>
3620
3621 * w32fns.c <w32_unicode_gui>: New static variable.
3622 (globals_of_w32fns): Initialize it according to os_subtype.
3623 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3624 testing os_subtype.
3625
3626 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
3627 Eli Zaretskii <eliz@gnu.org>
3628
3629 Fix bug #10299 with Unicode characters sent by customized
3630 keyboards created by MSKLC.
3631 * w32fns.c (INIT_WINDOW_CLASS): New macro.
3632 (w32_init_class): Use it to initialize the Emacs class with either
3633 ANSI or Unicode API calls.
3634 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3635 later.
3636 (w32_wnd_proc): If the character code sent by WM_CHAR or
3637 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3638 original message. Call DefWindowProcW on NT and later.
3639
3640 2012-08-10 Glenn Morris <rgm@gnu.org>
3641
3642 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3643
3644 * lisp.h (DIRECTORY_SEP): Let configure set it.
3645
3646 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
3647
3648 Use TSET for write access to Lisp_Object slots of struct terminal.
3649 * termhooks.h (TSET): New macro.
3650 * coding.c, terminal.c, xselect.c: Adjust users.
3651
3652 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
3653
3654 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
3655 the failing expression, include them in the error message.
3656 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3657 * lisp.h (internal_condition_case_n): Update declaration.
3658
3659 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3660
3661 Inline functions to examine and change buffer overlays.
3662 * buffer.c (unchain_both): New function.
3663 * buffer.h (buffer_get_overlays, buffer_set_overlays):
3664 (buffer_has_overlays): New function.
3665 (enum overlay_type): New enum.
3666 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3667 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3668
3669 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3670
3671 Inline functions to examine and change buffer intervals.
3672 * alloc.c (mark_interval_tree): Remove.
3673 (MARK_INTERVAL_TREE): Simplify.
3674 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
3675 * intervals.c (buffer_balance_intervals): New function.
3676 (graft_intervals_into_buffer): Adjust indentation.
3677 (set_intervals_multibyte): Simplify.
3678 * buffer.h (BUF_INTERVALS): Remove.
3679 (buffer_get_intervals, buffer_set_intervals): New function.
3680 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3681 * intervals.c, textprop.c: Adjust users.
3682
3683 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3684
3685 Inline functions to examine and change string intervals.
3686 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3687 (string_get_intervals, string_set_intervals): New function.
3688 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3689 * lread.c, print.c, textprop.c: Adjust users.
3690
3691 2012-08-08 Glenn Morris <rgm@gnu.org>
3692
3693 * lisp.mk (lisp): Remove language/persian.elc.
3694
3695 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3696
3697 Cleanup intervals.
3698 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3699 (NULL_INTERVAL_P): Likewise. Adjust users.
3700 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3701 Adjust comment. Move under #if 0.
3702 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3703 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3704
3705 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3706
3707 Check total length of intervals with eassert.
3708 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3709 * intervals.c: Change all users to eassert.
3710
3711 2012-08-07 Eli Zaretskii <eliz@gnu.org>
3712
3713 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
3714 Rename fields to match removal of FGET and WGET and disuse of
3715 INTERNAL_FIELD in Lisp_Cons.
3716
3717 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3718
3719 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
3720 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
3721 name since all xname users are fixed long time ago. Do not
3722 use INTERNAL_FIELD.
3723 (set_symbol_name, set_symbol_function, set_symbol_plist):
3724 (set_symbol_next, set_overlay_plist): New function.
3725 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
3726 (struct Lisp_Overlay): Likewise.
3727 (CVAR, MVAR, SVAR): Remove.
3728 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
3729 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
3730 * xterm.c: Adjust users.
3731 * .gdbinit: Change to use name field of struct Lisp_Symbol
3732 where appropriate.
3733
3734 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3735
3736 Basic functions to set Lisp_Object and pointer slots of intervals.
3737 * intervals.h (interval_set_parent, interval_set_object):
3738 (interval_set_left, interval_set_right, interval_set_plist):
3739 (interval_copy_parent): New function.
3740 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
3741 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
3742 Adjust indentation.
3743 (INTERVAL_SIZE): Remove. Adjust users.
3744 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3745
3746 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3747
3748 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3749 * process.h (PGET): Remove.
3750 (struct Lisp_Process): Do not use INTERNAL_FIELD.
3751 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3752
3753 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3754
3755 Drop WGET and revert read access to Lisp_Objects slots of struct window.
3756 * window.h (WGET): Remove.
3757 (struct window): Do not use INTERNAL_FIELD.
3758 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3759 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3760 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3761 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3762 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3763 Adjust users.
3764
3765 2012-08-07 Chong Yidong <cyd@gnu.org>
3766
3767 * window.c (Fwindow_edges, Fwindow_pixel_edges)
3768 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3769 (Fdelete_window_internal): Signal an error if the window is not on
3770 a live frame (Bug#12025).
3771
3772 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3773
3774 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3775 * frame.h (FGET): Remove.
3776 (struct frame): Do not use INTERNAL_FIELD.
3777 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3778 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3779 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3780 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3781
3782 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
3783
3784 * w32.c: Silence compiler warnings.
3785 (map_w32_filename): Remove unused variable `is_fat'.
3786 (chase_symlinks): Add parentheses around expression.
3787
3788 2012-08-06 Glenn Morris <rgm@gnu.org>
3789
3790 * sysdep.c: Respect BROKEN_GETWD.
3791
3792 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3793 Let configure handle it.
3794 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3795
3796 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3797
3798 Use GCALIGNMENT where appropriate.
3799 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3800 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3801 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3802
3803 2012-08-06 Eli Zaretskii <eliz@gnu.org>
3804
3805 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3806 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
3807
3808 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3809
3810 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3811 that should be sufficient for everyone.
3812
3813 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3814
3815 * keyboard.c (timer_check_2): Add break so timer_check returns next
3816 timeout.
3817
3818 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3819
3820 Fix Windows build errors introduced after converting to WGET and WSET.
3821 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3822 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3823
3824 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3825
3826 * nsterm.m (ns_frame_rehighlight): Use FSET.
3827
3828 * nsmenu.m (ns_update_menubar): Use FSET.
3829
3830 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3831
3832 Separate read and write access to Lisp_Object slots of Lisp_Process.
3833 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3834 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3835
3836 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3837
3838 Separate read and write access to Lisp_Object slots of struct window.
3839 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3840 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3841 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3842 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3843 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3844 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3845 Adjust users.
3846
3847 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3848
3849 Fix Windows build errors introduced after converting to FGET and FSET.
3850 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3851 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3852 (w32_judge_scroll_bars): Change to use FSET.
3853 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3854
3855 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3856
3857 Fix replacement typo.
3858 * window.c (replace_window): Set root_window instead of
3859 selected_window. This fixes a total window subsystem
3860 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3861
3862 2012-08-06 Glenn Morris <rgm@gnu.org>
3863
3864 * lisp.mk (lisp): Add language/persian.elc.
3865
3866 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3867
3868 Separate read and write access to Lisp_Object slots of struct frame.
3869 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3870 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3871 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3872 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3873 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3874
3875 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3876
3877 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3878
3879 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3880
3881 Generalize common compile-time constants.
3882 * lisp.h (header_size, bool_header_size, word_size): Now here.
3883 (struct Lisp_Vector): Add comment.
3884 (struct Lisp_Bool_Vector): Move up to define handy constants.
3885 (VECSIZE, PSEUDOVECSIZE): Simplify.
3886 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3887 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3888 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3889 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3890 * xfont.c, xmenu.c: Use word_size where appropriate.
3891
3892 2012-08-05 Lawrence Mitchell <wence@gmx.li>
3893
3894 * search.c (Freplace_match): Treat \? in the replacement text
3895 literally (Bug#8161).
3896
3897 2012-08-05 Chong Yidong <cyd@gnu.org>
3898
3899 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3900 * frame.c (Vdelete_frame_functions):
3901 * emacs.c (Vkill_emacs_hook): Doc fix.
3902
3903 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3904
3905 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3906 --with-x-toolkit=no builds.
3907 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3908
3909 2012-08-04 Chong Yidong <cyd@gnu.org>
3910
3911 * syntax.c (Fmodify_syntax_entry): Doc fix.
3912
3913 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3914
3915 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3916 * w32.c (init_environment): Change the default values of many
3917 environment variables in dflt_envvars[] to NULL, to avoid pushing
3918 them into environment when they were not already defined.
3919 Remove the code that deletes site-lisp subdirectories from the default
3920 value of EMACSLOADPATH, as it is no longer needed.
3921 (check_windows_init_file): Now external, not static.
3922 Use Vload_path as is, without adding anything, as this function is now
3923 called when Vload_path is already set up.
3924
3925 * w32.h (check_windows_init_file): Add prototype.
3926
3927 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3928 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3929 compatibility with Posix platforms.
3930 (main): Move the call to check_windows_init_file to here from
3931 w32.c.
3932 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3933 any, in the DEFALT argument into the root of the Emacs build or
3934 installation tree, as appropriate.
3935
3936 * callproc.c (init_callproc_1): Call decode_env_path instead of
3937 doing its equivalent by hand.
3938 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3939 the code that sets Vexec_path run on MS-Windows.
3940
3941 * lread.c (init_lread): Add comments to #ifdef's.
3942
3943 * msdos.c (dos_set_window_size, IT_update_begin)
3944 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3945 instead of direct references.
3946
3947 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3948
3949 Export DEFAULT_REHASH_* to GDB.
3950 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3951 Now constants, not macros.
3952
3953 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3954
3955 Remove unnecessary casts involving pointers.
3956 These casts are no longer needed now that we assume C89 or later,
3957 since they involve casting to or from void *.
3958 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3959 (make_pure_float, make_pure_vector):
3960 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3961 * macros.c (Fstart_kbd_macro):
3962 * menu.c (find_and_return_menu_selection):
3963 * minibuf.c (read_minibuf_noninteractive):
3964 * sysdep.c (closedir):
3965 * xdisp.c (x_produce_glyphs):
3966 * xfaces.c (compare_fonts_by_sort_order):
3967 * xfns.c (x_real_positions, select_visual):
3968 * xselect.c (x_stop_queuing_selection_requests)
3969 (x_get_window_property, x_get_window_property_as_lisp_data):
3970 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3971 Remove unnecessary pointer casts.
3972 * alloc.c (record_xmalloc): New function.
3973 * lisp.h (record_xmalloc): New decl.
3974 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3975 more like a function. This is because the pointer cast is not
3976 needed. All uses changed.
3977 * print.c (print_string, print_error_message): Avoid length recalc.
3978
3979 Improve fix for macroexp crash with debugging (Bug#12118).
3980 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3981 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3982 not supposed to be invoked from the garbage collector.
3983 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3984 (gc_aset): New function, which is like ASET but can be
3985 used in the garbage collector.
3986 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3987 (set_hash_index): Use it instead of ASET.
3988
3989 2012-08-03 Eli Zaretskii <eliz@gnu.org>
3990
3991 Support symlinks on latest versions of MS-Windows.
3992 * w32.c: Include winioctl.h and aclapi.h.
3993 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3994 (revert_to_self): Forward declarations of static functions.
3995 <static BOOL g_b_init_get_security_info>:
3996 <g_b_init_create_symbolic_link>: New static flags.
3997 (globals_of_w32): Initialize them to zero.
3998 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3999 (map_w32_filename): Improve commentary. Simplify switch.
4000 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4001 headers (most versions of MinGW w32api don't).
4002 (get_security_info, create_symbolic_link)
4003 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4004 New functions.
4005 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4006 in the argument file name.
4007 (sys_access): Call unc_volume_file_attributes only if
4008 GetFileAttributes fails with network-related error codes.
4009 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4010 have the required privileges.
4011 (get_file_security_desc_by_name): Rename from
4012 get_file_security_desc.
4013 (stat_worker): New function, with most of the guts of 'stat', and
4014 with addition of handling of symlinks and support for 'lstat'.
4015 If possible, get file's attributes and security information by
4016 handle, not by name. Produce S_IFLNK bit for symlinks, when
4017 called from 'lstat'.
4018 (stat, lstat): New functions, call 'stat_worker'.
4019 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4020 symlinks when the underlying filesystem supports them.
4021
4022 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4023
4024 Fix macroexp crash on Windows with debugging (Bug#12118).
4025 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4026 checking subscripts; problem introduced with the recent
4027 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4028 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4029 since it's used in non-static inline functions now.
4030
4031 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4032 Don't assume buffer size fits in 'int'. Remove unused local.
4033
4034 Use C99-style 'extern inline' if available.
4035 * buffer.h (BUFFER_INLINE):
4036 * category.h (CATEGORY_INLINE):
4037 * character.h (CHARACTER_INLINE):
4038 * charset.h (CHARSET_INLINE):
4039 * composite.h (COMPOSITE_INLINE):
4040 * dispextern.h (DISPEXTERN_INLINE):
4041 * lisp.h (LISP_INLINE):
4042 * systime.h (SYSTIME_INLINE):
4043 New macro, replacing 'static inline' in this header.
4044 * buffer.h, category.h, character.h, charset.h, composite.h:
4045 * dispextern.h, lisp.h, systime.h:
4046 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4047 * alloc.c (LISP_INLINE):
4048 * buffer.c (BUFFER_INLINE):
4049 * category.c (CATEGORY_INLINE):
4050 * character.c (CHARACTER_INLINE):
4051 * charset.c (CHARSET_INLINE):
4052 * composite.c (COMPOSITE_INLINE):
4053 * dispnew.c (DISPEXTERN_INLINE):
4054 * sysdep.c (SYSTIME_INLINE):
4055 Define to EXTERN_INLINE, so that the corresponding functions
4056 are compiled into code.
4057 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4058 (INLINE_HEADER_END): New macros.
4059 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4060 since it's used in non-static inline functions now.
4061 (VALMASK) [!USE_LSB_TAG]: Likewise.
4062
4063 2012-08-02 Glenn Morris <rgm@gnu.org>
4064
4065 * s/: Remove empty directory.
4066
4067 * s/ms-w32.h: Move to ../nt/inc.
4068 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4069 Update for new ms-w32.h location.
4070
4071 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4072
4073 Port to Solaris 8.
4074 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4075
4076 2012-08-02 Glenn Morris <rgm@gnu.org>
4077
4078 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4079 hard-coding the path separator.
4080
4081 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4082
4083 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4084 This how ASET and AREF are supposed to work, and makes
4085 it easier to think about future improvements. See
4086 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4087 * charset.h (set_charset_attr): New function.
4088 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4089 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4090 (aref_addr): New function. All uses of &AREF(...) changed.
4091 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4092 (set_hash_index): New functions. All lvalue-style uses of
4093 HASH_KEY etc. changed.
4094 * keyboard.c (set_prop): New function. All lvalue-style uses
4095 of PROP changed.
4096
4097 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4098
4099 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4100 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
4101 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
4102 * nsfns.m (ns_set_name_as_filename): Likewise.
4103 * nsmenu.m (ns_update_menubar): Likewise.
4104 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4105
4106 2012-08-01 Eli Zaretskii <eliz@gnu.org>
4107
4108 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4109 Adapt to latest changes in field names of the corresponding Lisp
4110 objects.
4111
4112 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4113
4114 2012-08-01 Glenn Morris <rgm@gnu.org>
4115
4116 * s/msdos.h: Remove file.
4117 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4118 * Makefile.in (S_FILE): Remove.
4119 (config_h): Remove S_FILE.
4120
4121 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4122
4123 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4124 Remove; moved to nt/config.nt.
4125
4126 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4127
4128 Use INTERNAL_FIELD for conses and overlays.
4129 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4130 Remove obsolete comment.
4131 (MVAR): New macro.
4132 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4133 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4134
4135 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4136
4137 Use INTERNAL_FIELD for symbols.
4138 * lisp.h (SVAR): New macro. Adjust users.
4139 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4140 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4141
4142 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4143
4144 Use INTERNAL_FIELD for processes.
4145 * process.h (PVAR): New macro. Adjust style.
4146 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4147 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4148
4149 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4150
4151 Use INTERNAL_FIELD for windows.
4152 * window.h (WVAR): New macro.
4153 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4154 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4155 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4156 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4157 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4158 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4159
4160 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4161
4162 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4163
4164 2012-08-01 Glenn Morris <rgm@gnu.org>
4165
4166 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4167 Move to configure.ac.
4168
4169 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4170
4171 * makefile.w32-in (CONFIG_H): Update dependencies.
4172 (CONF_POST_H): New macro.
4173
4174 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4175
4176 2012-07-31 Glenn Morris <rgm@gnu.org>
4177
4178 * Makefile.in (S_FILE): No longer set by configure.
4179
4180 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4181 is available.
4182 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4183
4184 * process.h (NULL_DEVICE):
4185 * emacs.c (SEPCHAR):
4186 * editfns.c (USER_FULL_NAME): Let configure set them.
4187
4188 * s/README, s/template.h: Remove files.
4189
4190 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4191
4192 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4193 Move to configure.ac.
4194
4195 2012-07-31 Eli Zaretskii <eliz@gnu.org>
4196
4197 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4198 resulting renaming of 'struct frame' members.
4199
4200 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4201
4202 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4203 after introduction of FVAR.
4204
4205 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4206
4207 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4208
4209 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4210 instead of compositeToPoint.
4211 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4212
4213 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
4214
4215 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4216
4217 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4218 * lisp.h (INTERNAL_FIELD): New macro.
4219 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
4220 (BVAR): Change to use INTERNAL_FIELD.
4221 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
4222 (KVAR): Change to use INTERNAL_FIELD.
4223 * frame.h (FVAR): New macro.
4224 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
4225 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
4226 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
4227 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4228 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4229
4230 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4231
4232 Miscellaneous fixes for non-default X toolkits.
4233 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
4234 * xterm.c (x_frame_of_widget): Remove redundant prototype.
4235 Move under #ifdef USE_LUCID.
4236 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
4237 definition and usage to avoid warnings.
4238
4239 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4240
4241 * nsterm.m (openFiles): Fix previous checkin.
4242
4243 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
4244
4245 * indent.c (compute_motion): Remove unused local.
4246
4247 2012-07-31 Glenn Morris <rgm@gnu.org>
4248
4249 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
4250
4251 * conf_post.h [USG5_4]:
4252 Move remaining contents of s/usg5-4-common.h here.
4253 * s/usg5-4-common.h: Remove file.
4254
4255 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
4256 * s/irix6-5.h: Remove file.
4257
4258 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
4259 * s/darwin.h: Remove file.
4260
4261 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
4262 * s/hpux10-20.h: Remove file, which is now empty.
4263
4264 2012-07-30 Glenn Morris <rgm@gnu.org>
4265
4266 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
4267 * Makefile.in (config_h): Add conf_post.h.
4268 * makefile.w32-in (CONFIG_H): Add conf_post.h.
4269
4270 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
4271
4272 * nsterm.m (ns_do_open_file): New variable.
4273 (ns_term_init): Set ns_do_open_file to YES after run returns.
4274 (openFile, openTempFile, openFileWithoutUI, openFiles):
4275 Open files only if ns_do_open_file.
4276
4277 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4278
4279 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
4280 This no-op macro hasn't been needed for many years.
4281 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
4282
4283 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
4284 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
4285 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
4286 gdb_make_enums_visible.
4287 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
4288 (DIRECTORY_SEP): Now a constant, not a macro.
4289
4290 2012-07-30 Eli Zaretskii <eliz@gnu.org>
4291
4292 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
4293 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
4294
4295 * w32term.c <w32_keyboard_codepage>: Renamed from
4296 keyboard_codepage and now external. All users changed.
4297
4298 * w32term.h: Add declaration of w32_keyboard_codepage.
4299
4300 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
4301 the codepage to translate keys to Unicode. If this argument is
4302 -1, use the value returned by GetConsoleCP. All callers changed.
4303
4304 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4305
4306 Update .PHONY listings in makefiles.
4307 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
4308 bootstrap-clean, distclean, maintainer-clean, versioclean,
4309 extraclean, frc.
4310
4311 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
4312 This is a bit clearer. Fix some commentary typos.
4313
4314 2012-07-30 Glenn Morris <rgm@gnu.org>
4315
4316 * s/netbsd.h: Let configure include signal.h if needed.
4317 Remove file, which is now empty.
4318
4319 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
4320 Let configure set them.
4321 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
4322 No more need to undefine.
4323
4324 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
4325
4326 * keymap.c (Fkey_description): Don't remove 0x80 bit from
4327 non-single-byte char when adding meta modifier. (Bug#12090)
4328
4329 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4330
4331 Convert safe_call to use variable number of arguments.
4332 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
4333 (safe_call2): Fix comment.
4334 * lisp.h (safe_call): Adjust prototype.
4335 * coding.c (encode_coding_object): Change to use safe_call2.
4336 * xfaces.c (merge_face_heights): Change to use safe_call1.
4337
4338 2012-07-30 Glenn Morris <rgm@gnu.org>
4339
4340 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
4341 does that unconditionally. Remove file, which is now empty.
4342
4343 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
4344 Remove empty files.
4345
4346 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4347
4348 Export to GDB most of lisp.h's remaining object-like macros.
4349 * lisp.h (min, max): Move earlier, because they're used earlier now.
4350 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
4351 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
4352 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
4353 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
4354 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
4355 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
4356 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
4357 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
4358 Now constants, for GDB. They need not be macros.
4359 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
4360 Now constants, for GDB, as well as macros, for static initializers.
4361 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
4362 Move to after the definition of struct Lisp_Char_Table,
4363 since the former now needs that type defined.
4364 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
4365 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
4366 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
4367 New enums, for gdb_make_enums_visible.
4368 (GLYPH_MODE_LINE_FACE): Remove; unused.
4369 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
4370 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
4371 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
4372 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
4373 enum maxargs, enum MAX_ALLOCA.
4374 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
4375 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
4376 no longer needed, now that they are done in lisp.h.
4377
4378 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4379
4380 Cleanup string bytes checking.
4381 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
4382 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
4383 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
4384 (check_sblock, compact_small_strings): Simplify.
4385
4386 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4387
4388 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
4389 These macros are confusing and no longer need to be defined, as
4390 the enum values now suffice. All uses replaced with definiens.
4391 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
4392
4393 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
4394
4395 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
4396 ($(BLD)/w32console.$(O)): Update dependencies.
4397
4398 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4399
4400 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
4401 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
4402 time. Adjust users.
4403 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
4404
4405 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
4406
4407 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
4408 setting sitelisp (Bug#12010).
4409
4410 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4411
4412 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
4413
4414 * w32heap.c (cache_system_info):
4415 * w32.c (sys_rename):
4416 * w32proc.c (find_child_console, sys_kill): All users changed.
4417
4418 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4419
4420 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4421
4422 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4423
4424 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
4425
4426 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4427
4428 Cleanup statistics calculation in Fgarbage_collect.
4429 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
4430 Fix zombies percentage calculation. Simplify elapsed time calculation.
4431
4432 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4433
4434 Generalize marker debugging code under MARKER_DEBUG and use eassert.
4435 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
4436 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
4437 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
4438 (replace_range, replace_range_2, del_range_2): Change to eassert.
4439 * marker.c (byte_char_debug_check): Adjust style.
4440
4441 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4442
4443 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4444 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4445 long-ago-commented-out code that talks about "WIN32".
4446 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4447 All uses changed.
4448
4449 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
4450
4451 Use Gnulib stdalign module (Bug#9772, Bug#9960).
4452 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4453 Simplify by using alignof.
4454 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4455 * lisp.h: Include <stdalign.h>.
4456 (GCALIGNMENT): New macro and constant.
4457 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
4458 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4459 (stdalign): New macro, if not already defined.
4460
4461 2012-07-28 Eli Zaretskii <eliz@gnu.org>
4462
4463 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
4464 * w32inevt.c: Include w32inevt.h.
4465 (w32_read_console_input): New inline function, calls either
4466 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4467 w32_console_unicode_input.
4468 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4469 (w32_kbd_patch_key, key_event): Use the codepage returned by
4470 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4471 (key_event): use uChar.UnicodeChar only if
4472 w32_console_unicode_input is non-zero.
4473
4474 * w32console.c: Include w32heap.h.
4475 <w32_console_unicode_input>: New global variable.
4476 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4477 family of Windows, zero otherwise.
4478
4479 * w32inevt.h: Declare w32_console_unicode_input.
4480
4481 * xdisp.c (init_iterator): Don't reference tip_frame in a build
4482 --without-x. (Bug#11742)
4483
4484 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4485
4486 Adjust GDB to reflect pvec_type changes (Bug#12036).
4487 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
4488 2012-07-04 changes to pseudovector representation.
4489 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
4490
4491 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
4492
4493 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4494 bus address.
4495 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4496
4497 2012-07-27 Eli Zaretskii <eliz@gnu.org>
4498
4499 * alloc.c (listn): Fix the order the arguments are consed onto the
4500 list.
4501
4502 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4503 enumeration constants, as PURE and HEAP are too general, and clash
4504 with other headers and sources, such as gmalloc.c and the
4505 MS-Windows system headers. All users changed.
4506
4507 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4508
4509 Revert last save_excursion_save and save_excursion_restore changes.
4510 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4511 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4512
4513 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4514
4515 Fix recently-introduced typos in Windows port.
4516 Reported by Martin Rudalics <rudalics@gmx.at>.
4517 * w32.c (init_environment): Replace comma with semicolon.
4518 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
4519
4520 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4521
4522 Improve GDB symbol export (Bug#12036).
4523 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4524 arms of an 'if', not using conditional expressions; otherwise GDB
4525 complains about the types in the unevaluated arm when the argument
4526 is an integer literal.
4527 (xgetint): Simplify expression.
4528 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4529 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4530 Zaretskii in <http://bugs.gnu.org/12036#13>.
4531 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4532 needed now that we have gdb_make_enums_visible.
4533 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4534 (enum enum_USE_LSB_TAG):
4535 New enum types, packaging up enums that need to be exported to GDB.
4536
4537 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4538
4539 Utility function to make a list from specified amount of objects.
4540 * lisp.h (enum constype): New datatype.
4541 (listn): New prototype.
4542 * alloc.c (listn): New function.
4543 (Fmemory_use_count, syms_of_alloc): Use it.
4544 * buffer.c (syms_of_buffer): Likewise.
4545 * callint.c (syms_of_callint): Likewise.
4546 * charset.c (define_charset_internal): Likewise.
4547 * coding.c (syms_of_coding): Likewise.
4548 * keymap.c (syms_of_keymap): Likewise.
4549 * search.c (syms_of_search): Likewise.
4550 * syntax.c (syms_of_syntax): Likewise.
4551 * w32.c (init_environment): Likewise.
4552 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4553 * xdisp.c (syms_of_xdisp): Likewise.
4554 * xfns.c (syms_of_xfns): Likewise.
4555
4556 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4557
4558 Fast save_excursion_save and save_excursion_restore.
4559 * lisp.h (struct Lisp_Excursion): New data type.
4560 (PVEC_EXCURSION): New pseudovector type.
4561 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
4562 to deal with it. Adjust comments.
4563 (init_marker, attach_marker): New prototype.
4564 (unchain_marker): Adjust prototype.
4565 * marker.c (attach_marker): Change to global.
4566 (init_marker): New function.
4567 * alloc.c (Fmake_marker, build_marker): Use it.
4568 (build_marker): More easserts.
4569 (mark_object): Handle struct Lisp_Excursion.
4570 * editfns.c (save_excursion_save, save_excursion_restore):
4571 Reimplement to use struct Lisp_Excursion. Add comments.
4572
4573 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4574
4575 Fix export of symbols to GDB (Bug#12036).
4576 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
4577 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
4578 emacs.c, as this is a more-suitable home. Had this been done earlier
4579 the fix for 12036 would have avoided some of the problems noted in
4580 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
4581 would have been more obvious.
4582 * emacs.c: Do not include <verify.h>; no longer needed.
4583 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
4584 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
4585 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4586 Remove; now done in lisp.h.
4587 * lisp.h (PUBLISH_TO_GDB): New macro.
4588 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
4589 (DATA_SEG_BITS): Use it.
4590 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
4591 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
4592 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
4593 not be usable in #if. This simplifies things.
4594
4595 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
4596
4597 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
4598
4599 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4600
4601 Simplify export of symbols to GDB (Bug#12036).
4602 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
4603 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
4604 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
4605 Adjust to changes in lisp.h and emacs.c, by using
4606 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
4607 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
4608 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
4609 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
4610 instead of gdb_valbits.
4611 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
4612 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
4613 instead of gdb_array_mark_flag.
4614 (xboolvector): Get size from $->size, not $->header.size.
4615 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
4616 (xreload, hook-run, hookpost-run): Remove.
4617 * emacs.c: Include <verify.h>.
4618 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
4619 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
4620 Remove.
4621 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
4622 (gdb_USE_LSB_TAG): New enum constants.
4623 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4624 Also define these as enum constants, so they're visible to GDB.
4625 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4626 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4627 as constants, so they're visible to GDB.
4628 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4629 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4630 Now enum constants, not macros, so they're visible to GDB.
4631 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4632 more convenient now. All uses changed.
4633 (VALMASK) [USE_LSB_TAG]: Also define in this case.
4634 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4635
4636 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
4637
4638 Explicitly free restriction data that are not needed anymore.
4639 * editfns.c (save_restriction_restore): Free restriction data.
4640
4641 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
4642
4643 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4644 add argument, tune behavior, and adjust all callers.
4645
4646 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
4647
4648 Use typedef for EMACS_INT, EMACS_UINT.
4649 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4650 than macros. This simplifies debugging in the usual case, since
4651 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4652 and it allows expressions involving EMACS_INT casts.
4653 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4654
4655 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
4656
4657 * nsterm.m (ns_read_socket): Return early if there is a modal
4658 window (Bug#12043).
4659
4660 2012-07-25 Martin Rudalics <rudalics@gmx.at>
4661
4662 * frame.c (Fredirect_frame_focus): In doc-string don't mention
4663 that FOCUS-FRAME can be omitted.
4664
4665 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
4666
4667 Adjust buffer text indirection counters at the end of Fkill_buffer.
4668 * buffer.c (Fkill_buffer): Adjust indirection counters when the
4669 buffer is definitely dead. This should really fix an issue reported
4670 by Christoph Scholtes again. (Bug#12007).
4671 (init_buffer_once): Initialize indirection counters of
4672 buffer_defaults and buffer_local_symbols (for sanity and safety).
4673
4674 2012-07-24 Eli Zaretskii <eliz@gnu.org>
4675
4676 * xdisp.c (init_iterator): Don't compute dimensions of truncation
4677 and continuation glyphs on tooltip frames, leave them at zero.
4678 Avoids continued lines in tooltips. (Bug#11832)
4679
4680 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
4681
4682 Simplify copy_overlay.
4683 * buffer.c (copy_overlay): Simplify. Use build_marker.
4684 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4685
4686 2012-07-23 Eli Zaretskii <eliz@gnu.org>
4687
4688 * print.c (print_object): Don't crash when a frame's name is nil
4689 or invalid. (Bug#12025)
4690
4691 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4692 it signals an error when a tooltip frame is being created.
4693
4694 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4695
4696 Cleanup miscellaneous objects allocation and initialization.
4697 * alloc.c (allocate_misc): Change to static. Add argument to
4698 specify the subtype. Adjust comment and users.
4699 (build_overlay): New function.
4700 * buffer.c (copy_overlays, Fmake_overlay): Use it.
4701 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4702 (allocate_misc): Remove prototype.
4703 (build_overlay): Add prototype.
4704
4705 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4706
4707 Swap buffer text indirection counters in Fbuffer_swap_text.
4708 * buffer.c (Fbuffer_swap_text): Swap indirections too.
4709 This avoids crash reported by Christoph Scholtes at
4710 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4711
4712 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
4713
4714 * nsmenu.m (Popdown_data): New struct.
4715 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
4716 free Popdown_data.
4717 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
4718 (initWithContentRect): Make imgView and contentView non-static
4719 and autorelease them. Also autorelease img and matrix (Bug#12005).
4720 (dealloc): Remove (Bug#12005).
4721
4722 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4723
4724 Adjust consing_since_gc when objects are explicitly freed.
4725 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
4726 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
4727 (free_cons, free_misc): Subtract object size from consing_since_gc.
4728
4729 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4730
4731 Simplify and cleanup markers positioning code.
4732 * marker.c (attach_marker): More useful eassert.
4733 (live_buffer, set_marker_internal): New function.
4734 (Fset_marker, set_marker_restricted): Use set_marker_internal.
4735 (set_marker_both, set_marker_restricted_both): Use live_buffer.
4736
4737 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
4738
4739 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
4740 as it's limited by the amount of memory, not by INT_MAX.
4741
4742 2012-07-21 Eli Zaretskii <eliz@gnu.org>
4743
4744 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
4745 in special-event-map. See the discussion at
4746 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4747 for the reasons.
4748
4749 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
4750 info.dwItemData. Fixes crashes on 64-bit Windows.
4751 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
4752
4753 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
4754
4755 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4756 (conversationIdentifier): Return value is NSInteger.
4757 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
4758
4759 2012-07-21 Chong Yidong <cyd@gnu.org>
4760
4761 * window.c (decode_any_window): Signal an error if the window is
4762 on a dead frame (Bug#11984).
4763
4764 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4765
4766 Add indirection counting to speed up Fkill_buffer.
4767 * buffer.h (struct buffer): New member.
4768 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4769 (Fmake_indirect_buffer): Set indirection counter to -1, increment
4770 base buffer indirection counter.
4771 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4772 (Fkill_buffer): Adjust indirection counters as needed, don't walk
4773 through buffer list if indirection counter is 0.
4774
4775 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4776
4777 Extend the value returned by Fgarbage_collect with heap statistics.
4778 * alloc.c (Qheap): New symbol.
4779 (syms_of_alloc): DEFSYM it.
4780 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4781 (Fmemory_free): Remove.
4782 (syms_of_alloc): Don't defsubr it.
4783 * buffer.c (Fcompact_buffer): Remove.
4784 (syms_of_buffer): Don't defsubr it.
4785
4786 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4787
4788 Make maybe_gc inline.
4789 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4790 * lisp.h (consing_since_gc, gc_relative_threshold)
4791 (memory_full_cons_threshold): Revert declaration.
4792 (maybe_gc): Remove prototype, define as inline.
4793 * alloc.c: Remove old commented-out code.
4794 (consing_since_gc, gc_relative_threshold)
4795 (memory_full_cons_threshold): Revert to global.
4796 (maybe_gc): Remove.
4797
4798 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4799
4800 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4801 * lisp.h (build_unibyte_string): New function.
4802 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4803 * sysdep.c, w32fns.c, xfns.c: Use it.
4804 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4805 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4806 Adjust users accordingly.
4807 * font.h (font_open_by_name): Adjust prototype.
4808
4809 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4810
4811 Cleanup calls to Fgarbage_collect.
4812 * lisp.h (maybe_gc): New prototype.
4813 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4814 Remove declarations.
4815 * alloc.c (maybe_gc): New function.
4816 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4817 Make them static.
4818 * bytecode.c (MAYBE_GC): Use maybe_gc.
4819 * eval.c (eval_sub, Ffuncall): Likewise.
4820 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4821 to avoid dependency from auto-save feature.
4822
4823 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4824
4825 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4826 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4827 'for_each_per_buffer_object_at'.
4828 All uses changed. It's better to use upper-case for macros that
4829 cannot be implemented as functions, to give the reader a clue
4830 that they're special.
4831
4832 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4833
4834 * alloc.c (Fgarbage_collect): Tweak docstring.
4835
4836 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4837
4838 Tweak the value returned from Fgarbage_collect again.
4839 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4840 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4841 Adjust documentation.
4842 (total_vector_bytes): Rename to total_vector_slots, adjust
4843 accounting.
4844 (total_free_vector_bytes): Rename to total_free_vector_slots,
4845 adjust accounting.
4846 (Qstring_bytes, Qvector_slots): New symbols.
4847 (syms_of_alloc): DEFSYM them.
4848
4849 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4850
4851 Buffer compaction primitive which may be used from Lisp.
4852 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4853 (syms_of_buffer): Register Fcompact_buffer.
4854 * alloc.c (Fgarbage_collect): Use compact_buffer.
4855 * buffer.h (compact_buffer): New prototype.
4856 (struct buffer_text): New member.
4857
4858 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4859
4860 New macro to iterate over all buffers, miscellaneous cleanups.
4861 * lisp.h (all_buffers): Remove declaration.
4862 * buffer.h (all_buffers): Add declaration, with comment.
4863 (for_each_buffer): New macro.
4864 * alloc.c (Fgarbage_collect, mark_object): Use it.
4865 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4866 (init_buffer): Likewise.
4867 * data.c (Fset_default): Likewise.
4868 * coding.c (code_conversion_restore): Remove redundant check
4869 for dead buffer.
4870 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4871
4872 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4873
4874 Fix bug that created negative-length intervals.
4875 * intervals.c (merge_interval_right, merge_interval_left):
4876 Do not zero out this interval if it is absorbed by its children,
4877 as this interval's total length doesn't change in that case. See
4878 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4879
4880 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4881
4882 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4883 when invoking (make-bool-vector N t) and N is a positive
4884 multiple of 8 -- the last 8 bits were mistakenly cleared.
4885
4886 Remove some struct layout assumptions in bool vectors.
4887 * alloc.c (bool_header_size): New constant.
4888 (header_size, word_size): Move earlier, as they're now used earlier.
4889 Use 'word_size' in a few more places, where it's appropriate.
4890 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4891 padding before the data member of a bool vector.
4892 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4893 than doing the check by hand with an abort ().
4894
4895 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4896
4897 * eval.c (Fdefvar): Don't check constants since we only set the var if
4898 it's not yet defined anyway (bug#11904).
4899
4900 * lisp.h (last_undo_boundary): Declare new var.
4901 * keyboard.c (command_loop_1): Set it.
4902 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4903 were auto-added by the command loop (bug#11774).
4904
4905 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4906
4907 * w32font.c (Qsymbol): Remove local definition.
4908 (syms_of_w32font): Don't DEFSYM it.
4909
4910 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4911
4912 Fix sweep_vectors to handle large bool vectors correctly.
4913 * alloc.c (sweep_vectors): Account total_vector_bytes for
4914 bool vectors larger than VBLOCK_BYTES_MAX.
4915
4916 2012-07-18 Chong Yidong <cyd@gnu.org>
4917
4918 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4919 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4920
4921 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4922
4923 Return more descriptive data from Fgarbage_collect.
4924 Suggested by Stefan Monnier in
4925 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4926 * alloc.c (bounded_number): New function.
4927 (total_buffers, total_vectors): New variable.
4928 (total_string_size): Rename to total_string_bytes, adjust users.
4929 (total_vector_size): Rename to total_vector_bytes, adjust users.
4930 (sweep_vectors): Account total_vectors and total_vector_bytes.
4931 (Fgarbage_collect): New return value. Adjust documentation.
4932 (gc_sweep): Account total_buffers.
4933 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4934 (VECTOR_SIZE): Remove.
4935 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4936 (Qinterval, Qmisc): New symbols.
4937 (syms_of_data): Initialize them.
4938 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4939 (Qcons, Qbuffer): New declarations.
4940
4941 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4942
4943 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4944 Round up, not down. Improve doc.
4945
4946 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4947
4948 Restore old code in allocate_string_data to avoid Faset breakage.
4949 Reported by Julien Danjou <julien@danjou.info> in
4950 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4951 * alloc.c (allocate_string_data): Restore old code with minor
4952 adjustments, fix comment to explain this subtle issue.
4953
4954 2012-07-17 Eli Zaretskii <eliz@gnu.org>
4955
4956 Remove FILE_SYSTEM_CASE.
4957 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4958
4959 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4960 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4961 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4962 call-process-region passes it through expand-file-name.
4963
4964 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4965
4966 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4967
4968 Fix crash when creating indirect buffer (Bug#11917)
4969 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4970 Don't handle unbound variables specially if non-zero.
4971 (Fbuffer_local_variables): Pass zero.
4972 (clone_per_buffer_values): Pass non-zero.
4973
4974 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4975
4976 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4977 to make the loop interruptible.
4978
4979 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4980
4981 * gnutls.c (emacs_gnutls_handshake): Only retry if
4982 GNUTLS_E_INTERRUPTED.
4983
4984 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4985
4986 Cleanup and convert miscellaneous checks to eassert.
4987 * alloc.c (mark_interval): Fix comment, partially rephrase
4988 old comment from intervals.h (see below).
4989 * intervals.c (find_interval, adjust_intervals_for_insertion)
4990 (delete_interval, adjust_intervals_for_deletion)
4991 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4992 Convert to eassert.
4993 (adjust_intervals_for_insertion, make_new_interval):
4994 Remove obsolete and unused code.
4995 * intervals.h (struct interval): Remove obsolete comment.
4996 * textprotp.c (erase_properties): Remove unused code.
4997 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4998 (Fremove_list_of_text_properties): Convert to eassert.
4999
5000 2012-07-17 Chong Yidong <cyd@gnu.org>
5001
5002 * editfns.c (Finsert_char): Doc fix.
5003
5004 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5005
5006 Fix previous change to make Fmemory_free always accurate.
5007 * alloc.c (make_interval): Update total_free_intervals.
5008 (make_float): Likewise for total_free_floats.
5009 (free_cons, Fcons): Likewise for total_free_conses.
5010 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5011 Likewise for total_free_vector_bytes.
5012 (Fmake_symbol): Likewise for total_free_symbols.
5013 (bytes_free): Remove.
5014
5015 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5016
5017 Simple free memory accounting feature.
5018 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5019 (sweep_vectors): Accumulate size of free vectors.
5020 (Fgarbage_collect): Setup bytes_free.
5021 (Fmemory_free): New function.
5022 (syms_of_alloc): Register it.
5023
5024 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5025
5026 Cleanup overlays checking.
5027 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5028 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5029 eassert and OVERLAYP.
5030 (sort_overlays): Change to use OVERLAYP.
5031
5032 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5033
5034 * editfns.c (Finsert_char): Make it interactive, and make the
5035 second arg optional. Copy interactive spec and docstring from
5036 ucs-insert.
5037
5038 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5039
5040 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5041 Unlike the other wrapped functions, fabs has an unspecified
5042 effect on errno.
5043
5044 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5045
5046 * nsterm.m (keyDown): Interpret flags without left/right bits
5047 as the left key (Bug#11670).
5048
5049 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5050
5051 Remove empty and useless init functions.
5052 * lisp.h (init_character_once, init_fns, init_image)
5053 (init_filelock, init_sound): Remove prototype.
5054 * character.c (init_character_once): Remove.
5055 * filelock.c (init_filelock): Likewise.
5056 * fns.c (init_fns): Likewise.
5057 * image.c (init_image): Likewise.
5058 * sound.c (init_sound): Likewise.
5059 * emacs.c (main): Adjust accordingly.
5060
5061 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5062
5063 * gtkutil.h: Tiny cleanups.
5064 (use_old_gtk_file_dialog): Remove useless declaration.
5065 (xg_uses_old_file_dialog): Add suggested const attribute.
5066
5067 2012-07-15 Eli Zaretskii <eliz@gnu.org>
5068
5069 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5070 (bidi_paragraph_init): Use it to limit search forward for a strong
5071 directional character in abnormally large paragraphs full of
5072 neutral or weak characters. (Bug#11943)
5073
5074 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5075
5076 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5077 the toolbar (Bug#9451).
5078 (xg_make_tool_item): Give the widget event box a transparent
5079 background.
5080
5081 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5082
5083 Cleanup basic allocation variables and functions.
5084 * alloc.c (ignore_warnings, init_intervals, init_float)
5085 (init_cons, init_symbol, init_marker): Remove.
5086 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5087 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5088 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5089 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5090 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5091 (staticidx, init_alloc_once, init_strings, free_ablock):
5092 Remove redundant initialization.
5093 * fns.c (init_weak_hash_tables): Remove.
5094 * lisp.h (init_weak_hash_tables): Remove prototype.
5095
5096 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5097
5098 Use zero_vector where appropriate.
5099 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5100 accordingly.
5101 * lisp.h (zero_vector): New declaration.
5102 * font.c (null_vector): Remove.
5103 (syms_of_font): Remove initialization and staticpro.
5104 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5105 * keymap.c (Faccessible_keymaps): Likewise.
5106
5107 2012-07-15 Leo Liu <sdl.web@gmail.com>
5108
5109 * fringe.c: Fix typo in comments.
5110
5111 2012-07-14 Leo Liu <sdl.web@gmail.com>
5112
5113 * fringe.c: Add a new bitmap exclamation-mark.
5114
5115 2012-07-14 Eli Zaretskii <eliz@gnu.org>
5116
5117 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5118
5119 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5120 (HAVE_MENUS): Don't define, defined by editing config.in with
5121 msdos/sed2v2.inp.
5122 (GMALLOC_INHIBIT_VALLOC): Don't define.
5123 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5124
5125 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
5126
5127 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5128
5129 2012-07-14 Glenn Morris <rgm@gnu.org>
5130
5131 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5132 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5133 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5134
5135 2012-07-13 Glenn Morris <rgm@gnu.org>
5136
5137 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5138
5139 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5140 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5141
5142 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5143
5144 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5145 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5146 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5147 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5148 where appropriate.
5149 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5150 as boolean expression.
5151 (x_set_window_size): Remove unused variable toolbar.
5152 (ns_get_color_default, ns_mod_to_lisp): Remove.
5153 (ns_mouse_position): Remove unused variables xchar and ychar.
5154 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5155 (ns_set_vertical_scroll_bar): Remove unused variable count.
5156 (ns_delete_terminal): Remove unused variable i.
5157 (ns_term_init): Remove unused variables r, g and b.
5158 (mouseDown): Remove unused variable window.
5159 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5160 (initFrameFromEmacs): Remove unused variable vbextra.
5161 (mouseEntered): Remove unused variables p and dpyinfo.
5162 (mouseExited): Remove unused variables p and r.
5163 (ns_define_frame_cursor, ns_clear_frame_area)
5164 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5165 (menuDown): Assign [sender tag] to variable and cast the variable.
5166
5167 * nsterm.h (menuDown): Add id as type to argument sender.
5168 (ns_display_info_for_name): Add Lisp_Object argument.
5169 (ns_term_init): Add Lisp_Object argument.
5170 (ns_map_event_to_object): Add void argument.
5171 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5172 prototype with arguments and only declare if __OBJC__.
5173 (nxatoms_of_nsselect): Add void argument.
5174 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5175 (ns_alloc_autorelease_pool): Add void argument.
5176 (ns_release_autorelease_pool): Add void* argument.
5177 (ns_get_defaults_value): Add const char* argument.
5178
5179 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5180 (initFromContents): Use SSDATA where appropriate.
5181 (ns_update_menubar): Add braces to ambigous if-else.
5182 (initWithTitle): Put () around assignment in if statement.
5183 (ns_menu_show): Remove unused variables window and keymap.
5184 (update_frame_tool_bar): Remove unused variable selected_p.
5185 (initWithContentRect): Remove unused variable this_cmd_name.
5186
5187 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5188 appropriate.
5189 (setXBMColor): Remove unused variable len.
5190 (setPixmapData): Put () around assignment in loop statement.
5191
5192 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5193 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5194 where appropriate.
5195 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5196 around assignment in loop statement.
5197 (nsfont_open): Remove unused variable i.
5198 (nsfont_open): Remove unused variable len.
5199 (nsfont_draw): Remove unused variable cs.
5200
5201 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5202 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5203 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5204 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5205 (Fns_font_name, Fns_perform_service)
5206 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5207 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5208 (ns_set_name): Remove unused variable view.
5209 (x_set_menu_bar_lines): Remove unused variable olines.
5210 (x_set_tool_bar_lines): Remove unused variable root_window.
5211 (Fns_list_colors): Put () around assignment in while statement.
5212 (Fns_perform_service): Remove unused variable len.
5213 (Fns_display_usable_bounds): Remove unused variable top.
5214 (syms_of_nsfns): Remove unused variable i.
5215
5216 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5217 memcpy (Bug#11907).
5218
5219 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
5220
5221 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
5222 and free it with DestroyExceptionInfo (Bug#11558).
5223
5224 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
5225
5226 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
5227 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5228 Set here, not in nt/config.nt.
5229
5230 2012-07-13 Eli Zaretskii <eliz@gnu.org>
5231
5232 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
5233 cursor overflow into the last glyph on display line when the right
5234 fringe is off. (Bug#11832)
5235
5236 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
5237
5238 * xdisp.c (produce_special_glyphs): Now static.
5239 * dispextern.h (produce_special_glyphs): Remove decl.
5240
5241 2012-07-13 Glenn Morris <rgm@gnu.org>
5242
5243 * s/bsd-common.h, s/cygwin.h: Remove empty files.
5244 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5245
5246 * s/usg5-4-common.h (USG, USG5):
5247 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
5248 * s/sol2-6.h (SOLARIS2):
5249 * s/irix6-5.h (IRIX6_5):
5250 * s/hpux10-20.h (USG, USG5, HPUX):
5251 * s/gnu-linux.h (USG, GNU_LINUX):
5252 * s/freebsd.h (BSD_SYSTEM):
5253 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
5254 * s/cygwin.h (CYGWIN):
5255 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
5256 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
5257
5258 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
5259
5260 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
5261
5262 2012-07-13 Glenn Morris <rgm@gnu.org>
5263
5264 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
5265
5266 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
5267
5268 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
5269 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
5270
5271 2012-07-12 Glenn Morris <rgm@gnu.org>
5272
5273 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
5274
5275 * process.c (init_process_emacs): Rename from init_process.
5276 The old name is also the name of a Mach system call.
5277 * lisp.h, emacs.c: Update for this name change.
5278 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
5279 longer needed.
5280
5281 2012-07-12 Eli Zaretskii <eliz@gnu.org>
5282
5283 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
5284 memmove call that removes glyphs covered by the left truncation
5285 glyph. Improve commentary.
5286 (display_line): Fix display of continuation glyphs on GUI frames
5287 when the right fringe is turned off and variable-size fonts are
5288 used in the window. Move the code that appends a stretch glyph to
5289 produce_special_glyphs, so that it could be used for truncation
5290 and continuation glyphs alike.
5291 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
5292 glyph of a suitably computed width, to align the special glyphs at
5293 the window margin. Code moved from display_line. (Bug#11832)
5294
5295 2012-07-12 Glenn Morris <rgm@gnu.org>
5296
5297 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
5298
5299 * s/gnu-linux.h, s/hpux10-20.h:
5300 Do not unconditionally define HAVE_XRMSETDATABASE.
5301
5302 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
5303
5304 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
5305
5306 Fix typos that broke OS X build.
5307 Reported by Randal L. Schwartz in
5308 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
5309 * nsterm.m (ns_timeout): Add missing local decl.
5310 (ns_get_color): snprintf -> sprintf, to fix typo.
5311
5312 2012-07-12 Glenn Morris <rgm@gnu.org>
5313
5314 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
5315 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
5316 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
5317 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
5318
5319 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
5320 Move PTY_OPEN to configure.
5321
5322 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5323 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
5324 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
5325
5326 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
5327
5328 Use empty_unibyte_string where applicable.
5329 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
5330 * lread.c (read1): Likewise.
5331 * xsettings.c (syms_of_xsettings): Likewise.
5332
5333 2012-07-12 Glenn Morris <rgm@gnu.org>
5334
5335 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
5336 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
5337 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
5338 * s/hpux10-20.h (RUN_TIME_REMAP):
5339 * s/bsd-common.h (TABDLY): Move to configure.
5340
5341 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
5342
5343 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
5344
5345 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
5346 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
5347
5348 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
5349
5350 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
5351 * s/template.h: Move NARROWPROTO to configure.
5352
5353 2012-07-11 Glenn Morris <rgm@gnu.org>
5354
5355 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
5356 unused since 2011-01-17 change to systty.h.
5357
5358 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
5359 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5360 Move HAVE_PTYS and HAVE_SOCKETS to configure.
5361
5362 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5363
5364 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
5365
5366 2012-07-11 Glenn Morris <rgm@gnu.org>
5367
5368 * s/darwin.h, s/gnu-linux.h, s/template.h:
5369 Move INTERRUPT_INPUT to configure.
5370
5371 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5372
5373 Minor adjustments to interning code.
5374 * lisp.h (intern, intern_c_string): Redefine as static inline
5375 wrappers for intern_1 and intern_c_string_1, respectively.
5376 (intern_1, intern_c_string_1): Rename prototypes.
5377 * lread.c (intern_1, intern_c_string_1, oblookup):
5378 Simplify Vobarray checking.
5379 * font.c (font_intern_prop): Likewise. Adjust comment.
5380 * w32font.c (intern_font_name): Likewise.
5381
5382 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
5383
5384 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
5385
5386 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
5387 of Fcar/Fcdr if possible.
5388 * font.c (check_otf_features): Likewise.
5389 * fontset.c (Fnew_fontset): Likewise.
5390 * gnutls.c (Fgnutls_boot): Likewise.
5391 * minibuf.c (read_minibuf): Likewise.
5392 * msdos.c (IT_set_frame_parameters): Likewise.
5393 * xmenu.c (Fx_popup_dialog): Likewise.
5394 * w32menu.c (Fx_popup_dialog): Likewise.
5395
5396 2012-07-11 Glenn Morris <rgm@gnu.org>
5397
5398 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
5399 since nothing has defined it on these platforms.
5400
5401 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
5402 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
5403
5404 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5405 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5406 Move CLASH_DETECTION to configure.
5407
5408 * s/gnu.h: Remove file, which is now empty.
5409
5410 * s/gnu.h, s/gnu-linux.h:
5411 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
5412
5413 2012-07-11 John Wiegley <johnw@newartisans.com>
5414
5415 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
5416 function attribute, so we only use it if it exists in the
5417 compiler.
5418
5419 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5420
5421 Avoid call to strlen in fast_c_string_match_ignore_case.
5422 * search.c (fast_c_string_match_ignore_case): Change to use
5423 length argument. Adjust users accordingly.
5424 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
5425
5426 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5427
5428 Assume mkdir, rmdir.
5429 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
5430 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
5431
5432 Assume rename.
5433 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
5434
5435 Assume perror.
5436 * s/hpux10-20.h (HAVE_PERROR): Remove.
5437 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
5438 Remove dummy definition, as this problem was obsolete long ago.
5439
5440 Assume strerror.
5441 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5442
5443 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5444
5445 Avoid calls to strlen in font processing functions.
5446 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
5447 (font_open_by_name): Change to use length argument.
5448 Adjust users accordingly.
5449 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5450 Adjust prototypes.
5451 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5452 Change to return ptrdiff_t.
5453 (xfont_list_pattern, xfont_match): Use length returned by
5454 xfont_decode_coding_xlfd.
5455 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5456
5457 2012-07-11 Glenn Morris <rgm@gnu.org>
5458
5459 * s/darwin.h, s/freebsd.h, s/netbsd.h:
5460 Move DONT_REOPEN_PTY to configure.
5461
5462 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5463 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5464
5465 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
5466
5467 Remove "#define unix" that is no longer needed (Bug#11905).
5468 * s/aix4-2.h (unix): Remove; no longer needed.
5469
5470 EMACS_TIME simplification (Bug#11875).
5471 This replaces macros (which typically do not work in GDB)
5472 with functions, typedefs and enums, making the code easier to debug.
5473 The functional style also makes code easier to read and maintain.
5474 * systime.h: Include <sys/time.h> on all hosts, not just if
5475 WINDOWSNT, since 'struct timeval' is needed in general.
5476 (EMACS_TIME): Now a typedef, not a macro.
5477 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5478 not macros.
5479 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
5480 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
5481 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
5482 (EMACS_TIME_LE): Now functions, not macros.
5483 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
5484 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
5485 which are not functions. All uses rewritten to use:
5486 (make_emacs_time): New function.
5487 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5488 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5489 not functions. All uses rewritten to use the following, respectively:
5490 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5491 (add_emacs_time, sub_emacs_time): New functions.
5492 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
5493 * fileio.c (Fcopy_file):
5494 * xterm.c (XTflash): Get the current time closer to when it's used.
5495 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5496
5497 * bytecode.c (targets): Suppress -Woverride-init warnings.
5498
5499 Simplify by avoiding confusing use of strncpy etc.
5500 * doc.c (Fsnarf_documentation):
5501 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5502 * frame.c (Fmake_terminal_frame):
5503 * gtkutil.c (get_utf8_string):
5504 * lread.c (openp):
5505 * nsmenu.m (ns_update_menubar):
5506 * regex.c (regerror):
5507 Prefer memcpy to strncpy and strncat when either will do.
5508 * fileio.c (Fsubstitute_in_file_name):
5509 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5510 (menu_separator_name_p):
5511 * nsmenu.m (ns_update_menubar):
5512 Prefer memcmp to strncmp when either will do.
5513 * nsterm.m: Include <ftoastr.h>.
5514 (ns_get_color):
5515 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5516 Prefer snprintf to strncpy.
5517 * nsterm.m (ns_term_init):
5518 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5519 * nsterm.m (ns_term_init):
5520 Avoid the need for strncpy, by using build_string or
5521 make_unibyte_string directly. Use dtoastr, not snprintf.
5522 * process.c (Fmake_network_process): Diagnose service names that
5523 are too long, rather than silently truncating them or creating
5524 non-null-terminated names.
5525 (Fnetwork_interface_info): Likewise, for interface names.
5526 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5527 Prefer sprintf to strncat.
5528 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5529 Prefer vsnprintf to vsprintf + strncpy.
5530
5531 2012-07-10 Glenn Morris <rgm@gnu.org>
5532
5533 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5534 Clarify fallback case.
5535
5536 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5537
5538 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5539 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5540 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
5541 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
5542 where argument type is known to be a Lisp_Cons.
5543
5544 2012-07-10 Tom Tromey <tromey@redhat.com>
5545
5546 * bytecode.c (BYTE_CODE_THREADED): New macro.
5547 (BYTE_CODES): New macro. Replaces all old byte-code defines.
5548 (enum byte_code_op): New type.
5549 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5550 (exec_byte_code): Use them. Use token threading when applicable.
5551
5552 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5553
5554 Optimize pure C strings initialization.
5555 * lisp.h (make_pure_string): Fix prototype.
5556 (build_pure_c_string): New function, defined as static inline. This
5557 provides a better opportunity to optimize away calls to strlen when
5558 the function is called with compile-time constant argument.
5559 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
5560 argument, adjust users accordingly. Use build_pure_c_string where
5561 appropriate.
5562 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
5563 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
5564 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
5565
5566 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5567
5568 Avoid calls to strlen in miscellaneous functions.
5569 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
5570 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
5571 * lread.c (openp): Likewise.
5572
5573 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5574
5575 Avoid calls to strlen in path processing functions.
5576 * fileio.c (file_name_as_directory): Add comment. Change to add
5577 srclen argument and return the length of result. Adjust users
5578 accordingly.
5579 (directory_file_name): Fix comment. Change to add srclen argument,
5580 swap 1st and 2nd arguments to obey the common convention.
5581 Adjust users accordingly.
5582 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
5583
5584 2012-07-10 Glenn Morris <rgm@gnu.org>
5585
5586 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
5587 Move PENDING_OUTPUT_COUNT definition to configure.
5588
5589 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
5590 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
5591 * s/gnu.h (DATA_START): Move definitions to configure.
5592
5593 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
5594 We include usg5-4-common.h, which defines them both.
5595
5596 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
5597 O_RDONLY already includes it).
5598
5599 Stop ns builds setting the EMACSLOADPATH environment variable.
5600 * nsterm.m (ns_load_path): Rename from ns_init_paths.
5601 Now it does not set EMACSLOADPATH, just returns the load-path string.
5602 * nsterm.h: Update accordingly.
5603 * lread.c [HAVE_NS]: Include nsterm.h.
5604 (init_lread) [HAVE_NS]: Use ns_load_path.
5605 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
5606
5607 2012-07-09 Glenn Morris <rgm@gnu.org>
5608
5609 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
5610 since the included bsd-common.h does so.
5611
5612 Stop ns builds setting the EMACSPATH environment variable.
5613 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
5614 (ns_init_paths): Do not set EMACSPATH.
5615 * nsterm.h (ns_exec_path): Add it.
5616 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
5617 Use ns_exec_path.
5618
5619 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
5620
5621 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
5622
5623 * process.c (wait_reading_process_output): 'waitchannels' was unset
5624 when read_kbd || !NILP (wait_for_cell); fix this.
5625
5626 Add GCC-style 'const' attribute to functions that can use it.
5627 * character.h (char_resolve_modifier_mask):
5628 * keyboard.h (make_ctrl_char):
5629 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5630 (init_character_once, next_almost_prime, init_fns, init_image)
5631 (flush_pending_output, init_sound):
5632 * mem-limits.h (start_of_data):
5633 * menu.h (finish_menu_items):
5634 Add ATTRIBUTE_CONST.
5635 * emacs.c (DEFINE_DUMMY_FUNCTION):
5636 Declare the dummy function with ATTRIBUTE_CONST.
5637 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5638 Add decls with ATTRIBUTE_CONST.
5639
5640 Minor improvements to make_formatted_string.
5641 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5642 where int is good enough, as vsprintf returns an int.
5643 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5644
5645 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5646
5647 Use make_formatted_string to avoid double length calculation.
5648 * lisp.h (make_formatted_string): New prototype.
5649 * alloc.c (make_formatted_string): New function.
5650 * buffer.c (Fgenerate_new_buffer_name): Use it.
5651 * dbus.c (syms_of_dbusbind): Likewise.
5652 * editfns.c (Fcurrent_time_zone): Likewise.
5653 * filelock.c (get_boot_time): Likewise.
5654 * frame.c (make_terminal_frame, set_term_frame_name)
5655 (x_report_frame_params): Likewise.
5656 * image.c (gs_load): Likewise.
5657 * minibuf.c (get_minibuffer): Likewise.
5658 * msdos.c (dos_set_window_size): Likewise.
5659 * process.c (make_process): Likewise.
5660 * xdisp.c (ensure_echo_area_buffers): Likewise.
5661 * xsettings.c (apply_xft_settings): Likewise.
5662
5663 2012-07-09 Glenn Morris <rgm@gnu.org>
5664
5665 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5666 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5667 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5668 * nsterm.h (ns_etc_directory): Add it.
5669 * callproc.c [HAVE_NS]: Include nsterm.h.
5670 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5671
5672 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5673
5674 Move marker debugging code under MARKER_DEBUG.
5675 * marker.c (MARKER_DEBUG): Move marker debugging code under
5676 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5677 for bootstrap with --enable-checking (~3x slowdown reported
5678 by Juanma Barranquero <lekktu@gmail.com>).
5679 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5680
5681 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
5682
5683 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5684 See <http://bugs.gnu.org/11825#29>.
5685
5686 2012-07-08 Eli Zaretskii <eliz@gnu.org>
5687
5688 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5689 has no font, use the frame's font. (Bug#11813)
5690 (display_line): Add commentary about displaying truncation glyphs
5691 on GUI frames.
5692 (produce_special_glyphs): Move here from term.c.
5693
5694 * term.c (produce_special_glyphs): Move to xdisp.c.
5695
5696 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5697 section.
5698
5699 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
5700
5701 * xdisp.c (display_line): Avoid warning about implicit declaration
5702 of FRAME_FONT.
5703
5704 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5705
5706 * lisp.h: Remove empty conditional.
5707
5708 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5709
5710 * lread.c (load_path_check): Now static.
5711
5712 Fix some minor --with-ns problems found by static checking.
5713 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
5714 (x_set_font) [!HAVE_X_WINDOWS]:
5715 * image.c (xpm_load_image) [HAVE_NS]:
5716 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
5717 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
5718 Remove unused local.
5719 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
5720 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
5721 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
5722 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
5723 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
5724 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
5725 Fix pointer signedness problem.
5726 * xfaces.c (FRAME_X_FONT_TABLE):
5727 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
5728
5729 2012-07-07 Glenn Morris <rgm@gnu.org>
5730
5731 * lread.c (load_path_check): New function, split from init_lread.
5732 (init_lread): Reorganize. Motivation:
5733 If EMACSLOADPATH is set, check/warn about that rather than the
5734 defaults, which we are not going to use. Hence we can remove
5735 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
5736 Don't warn if site-lisp directories are missing.
5737 If not installed, start from a blank load-path, since
5738 PATH_LOADSEARCH refers to the eventual installation directories.
5739
5740 2012-07-07 Eli Zaretskii <eliz@gnu.org>
5741
5742 Support truncation and continuation glyphs on GUI frames, when
5743 fringes are disabled. (Bug#11832)
5744 * xdisp.c (init_iterator): Get dimensions of truncation and
5745 continuation glyphs even if on GUI frames.
5746 Adjust it->last_visible_x on GUI frames when the left or right fringes,
5747 or both, are absent.
5748 (start_display, move_it_in_display_line_to): Handle the case of a
5749 GUI frame without a fringe to display continuation or truncation
5750 glyphs.
5751 (insert_left_trunc_glyphs): Support GUI frames: make sure
5752 truncation glyphs overwrite enough glyphs from the current line to
5753 have sufficient space in pixels.
5754 (display_line): Support truncation and continuation glyphs on GUI
5755 frames. If some spare pixels are left on the line after inserting
5756 the truncation glyphs, fill that space with a stretch glyph of a
5757 suitably computed width.
5758
5759 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5760 produce_glyphs, to support GUI sessions.
5761
5762 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5763
5764 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5765
5766 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5767
5768 Do not require float-time's arg to fit in time_t (Bug#11825).
5769 This works better on hosts where time_t is unsigned, and where
5770 float-time is applied to the (negative) difference between two times.
5771 * editfns.c (decode_time_components): Last arg is now double *,
5772 not int *, and means to store all the result as a double, without
5773 worrying about whether the seconds part fits in time_t.
5774 All callers changed.
5775 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5776 All callers changed.
5777 (Ffloat_time): Do not fail merely because the specified time falls
5778 outside of time_t range.
5779
5780 2012-07-07 Glenn Morris <rgm@gnu.org>
5781
5782 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5783 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5784 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5785
5786 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
5787
5788 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5789 Update dependencies.
5790
5791 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5792
5793 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5794
5795 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5796 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5797 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5798 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5799 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5800 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5801
5802 * xfont.c (compare_font_names): Redo to omit the need for casts.
5803
5804 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5805
5806 * xfns.c (Fx_change_window_property): Doc fix.
5807 * w32fns.c (Fx_change_window_property): Doc fix.
5808
5809 * w32fns.c (Fx_window_property): Accept the same arguments as the
5810 X Windows version. Doc fix.
5811 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5812
5813 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
5814 Eli Zaretskii <eliz@gnu.org>
5815
5816 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5817 Windows-specific code from nt/config.nt moved here.
5818 Obsolete settings removed.
5819
5820 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5821
5822 * process.c: Avoid unnecessary calls to gettime.
5823 (wait_reading_process_output): Don't get the time of day
5824 when gobbling data immediately and not waiting, as there's no need
5825 for it in that case. This removes a FIXME.
5826
5827 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5828
5829 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5830 is defined (Bug#11768).
5831
5832 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5833
5834 Fix marker debugging code.
5835 * marker.c (byte_char_debug_check): Do not perform the check
5836 if buffer is not multibyte.
5837 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5838 Call byte_char_debug_check with correct arguments.
5839
5840 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5841
5842 Compile marker debugging code only if ENABLE_CHECKING is defined.
5843 * marker.c (byte_char_debug_check, count_markers):
5844 Use only if ENABLE_CHECKING is defined.
5845 (byte_debug_flag): Remove.
5846 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5847 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5848
5849 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5850
5851 Avoid code repetition in marker-related functions.
5852 * marker.c (attach_marker): New function.
5853 (Fset_marker, set_marker_restricted, set_marker_both)
5854 (set_marker_restricted_both): Use it.
5855 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5856 Consistently rename charno to charpos.
5857 (marker_position): Add eassert.
5858 (marker_byte_position): Convert to eassert.
5859
5860 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5861
5862 Simplify list operations in unchain_overlay and unchain_marker.
5863 * buffer.c (unchain_overlay): Simplify. Add comment.
5864 * marker.c (unchain_marker): Simplify. Fix comments.
5865
5866 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5867
5868 Introduce fast path for the widely used marker operation.
5869 * alloc.c (build_marker): New function.
5870 * lisp.h (build_marker): New prototype.
5871 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5872 * composite.c (autocmp_chars): Likewise.
5873 * editfns.c (buildmark): Remove.
5874 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5875 (save_restriction_save): Use build_marker.
5876 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5877 * window.c (save_window_save): Likewise.
5878
5879 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5880
5881 Do not use Fdelete_overlay in delete_all_overlays
5882 to avoid redundant calls to unchain_overlay.
5883 * buffer.c (drop_overlay): New function.
5884 (delete_all_overlays, Fdelete_overlay): Use it.
5885 * minibuf.c (get_minibuffer): Fix comment.
5886
5887 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5888
5889 Port to OpenBSD 5.1 amd64.
5890 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5891 This is needed for OpenBSD, and should be harmless on all BSD systems.
5892 Also, include <sys/sysctl.h>, as it should be available on all
5893 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5894 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5895 use p_pid member, not kp_proc.pid.
5896
5897 2012-07-06 Glenn Morris <rgm@gnu.org>
5898
5899 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5900
5901 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5902
5903 More xmalloc and related cleanup.
5904 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5905 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5906 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5907 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5908 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5909 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5910 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5911 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5912 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5913 * xterm.c:
5914 Omit needless casts involving void * pointers and allocation.
5915 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5916 as the former is more robust if P's type is changed.
5917 Prefer xzalloc to xmalloc + memset 0.
5918 Simplify malloc-or-realloc to realloc.
5919 Don't worry about xmalloc returning a null pointer.
5920 Prefer xstrdup to xmalloc + strcpy.
5921 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5922 growing it.
5923 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5924 alloca of a constant.
5925
5926 2012-07-05 Eli Zaretskii <eliz@gnu.org>
5927
5928 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5929 hscroll is larger than the line width. Fixes long and futile
5930 looping inside extend_face_to_end_of_line (on a TTY) producing
5931 glyphs that are not needed and thrown away.
5932
5933 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5934
5935 * marker.c (set_marker_restricted_both): Simplify by using
5936 clip_to_bounds.
5937
5938 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5939
5940 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5941
5942 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5943
5944 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5945 not defined (Bug#11768).
5946 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5947 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5948 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5949 followed by gtk_box_set_homogeneous (Bug#11768).
5950 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
5951 (update_theme_scrollbar_width, xg_create_scroll_bar):
5952 Use gtk_scrollbar_new (Bug#11768).
5953 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5954 (is_box_type): New function (Bug#11768).
5955 (xg_tool_item_stale_p): Call is_box_type.
5956 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
5957 with default display (Bug#11768).
5958
5959 2012-07-05 Eli Zaretskii <eliz@gnu.org>
5960
5961 * xdisp.c (window_hscroll_limited): New function.
5962 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5963 coordinates when window's hscroll is set to insanely large
5964 values. (Bug#11857)
5965
5966 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
5967
5968 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5969 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5970
5971 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5972
5973 Cleanup xmalloc.
5974 * lisp.h (xzalloc): New prototype. Omit needless casts.
5975 * alloc.c (xzalloc): New function. Omit needless casts.
5976 * charset.c: Omit needless casts. Convert all calls to
5977 xmalloc with following memset to xzalloc.
5978 * dispnew.c: Likewise.
5979 * fringe.c: Likewise.
5980 * image.c: Likewise.
5981 * sound.c: Likewise.
5982 * term.c: Likewise.
5983 * w32fns.c: Likewise.
5984 * w32font.c: Likewise.
5985 * w32term.c: Likewise.
5986 * xfaces.c: Likewise.
5987 * xfns.c: Likewise.
5988 * xterm.c: Likewise.
5989 * atimer.c: Omit needless casts.
5990 * buffer.c: Likewise.
5991 * callproc.c: Likewise.
5992 * ccl.c: Likewise.
5993 * coding.c: Likewise.
5994 * composite.c: Likewise.
5995 * doc.c: Likewise.
5996 * doprnt.c: Likewise.
5997 * editfns.c: Likewise.
5998 * emacs.c: Likewise.
5999 * eval.c: Likewise.
6000 * filelock.c: Likewise.
6001 * fns.c: Likewise.
6002 * gtkutil.c: Likewise.
6003 * keyboard.c: Likewise.
6004 * lisp.h: Likewise.
6005 * lread.c: Likewise.
6006 * minibuf.c: Likewise.
6007 * msdos.c: Likewise.
6008 * print.c: Likewise.
6009 * process.c: Likewise.
6010 * region-cache.c: Likewise.
6011 * search.c: Likewise.
6012 * sysdep.c: Likewise.
6013 * termcap.c: Likewise.
6014 * terminal.c: Likewise.
6015 * tparam.c: Likewise.
6016 * w16select.c: Likewise.
6017 * w32.c: Likewise.
6018 * w32reg.c: Likewise.
6019 * w32select.c: Likewise.
6020 * w32uniscribe.c: Likewise.
6021 * widget.c: Likewise.
6022 * xdisp.c: Likewise.
6023 * xmenu.c: Likewise.
6024 * xrdb.c: Likewise.
6025 * xselect.c: Likewise.
6026
6027 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6028
6029 * fileio.c (time_error_value): Check the right error number.
6030 Problem reported by Troels Nielsen in
6031 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6032
6033 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6034
6035 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6036 This should be fixed in a better way; see Eli Zaretskii in
6037 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6038 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6039
6040 * fileio.c (time_error_value): Rename from special_mtime.
6041 The old name's problems were noted by Eli Zaretskii in
6042 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6043
6044 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6045 This variable's comment says Emacs needs at least one GDB-visible
6046 symbol of type enum pvec_type, to work around GDB problems.
6047 The symbol's value doesn't matter.
6048
6049 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6050 that causes compilation to fail on pre-C99 compilers.
6051
6052 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
6053
6054 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6055 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6056
6057 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6058
6059 * buffer.c (init_buffer_once): Fix initialization of
6060 headers for buffer_defaults and buffer_local_symbols.
6061 Reported by Juanma Barranquero <lekktu@gmail.com>.
6062
6063 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6064
6065 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6066 * lisp.h (enum pvec_type): Use fewer bits.
6067 (PSEUDOVECTOR_SIZE_BITS): New constant.
6068 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6069 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6070 change in pvec_type.
6071 (PSEUDOVECTOR_TYPEP): New macro.
6072 (TYPED_PSEUDOVECTORP): Use it.
6073 * fns.c (internal_equal): Adapt code to extract pvectype.
6074 * emacs.c (gdb_pvec_type): Update type.
6075 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6076 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6077 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6078 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6079 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6080 abusing vector->header.next.nbytes.
6081 (live_vector_p): Use PVEC_TYPE.
6082 (mark_object): Adapt code to extract pvectype. Use switch.
6083
6084 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6085
6086 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6087 Tighten new eassert a bit.
6088
6089 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6090
6091 Fix compilation with --enable-gcc-warnings and -O1
6092 optimization level.
6093 * doprnt.c (doprnt): Change type of tem to int, initialize
6094 to avoid compiler warning. Add eassert.
6095 * search.c (simple_search): Initialize match_byte to avoid
6096 compiler warning. Add eassert.
6097
6098 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6099
6100 Avoid weird behavior with large horizontal scrolls.
6101 Without this change, for example, large hscroll values would
6102 mess up Emacs's display on Fedora 15 x86, presumably due to
6103 overflows in int calculations in the display code.
6104 Also, if buffers had long lines, Emacs would freeze.
6105 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6106 (set_window_hscroll): New function, containing the old guts of
6107 Fset_window_hscroll. Return the clipped value.
6108 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6109 This avoids the need to check against PTRDIFF_MAX.
6110
6111 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6112
6113 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6114
6115 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6116
6117 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6118
6119 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6120 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6121 since GCC 4.4.6 issues a bogus warning for them.
6122
6123 Fix bugs in file timestamp newness comparisons.
6124 * fileio.c (Ffile_newer_than_file_p):
6125 * lread.c (Fload): Use full timestamp resolution of files,
6126 not just the 1-second resolution, so that files that are only
6127 slightly newer still count as newer.
6128 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6129 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6130
6131 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6132
6133 * fileio.c: Improve handling of file time marker. (Bug#11852)
6134 (special_mtime): New function.
6135 (Finsert_file_contents, Fverify_visited_file_modtime):
6136 Use it to set special mtime values consistently.
6137
6138 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6139
6140 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6141 marker for non-existing file. (Bug#11852)
6142
6143 2012-07-03 Glenn Morris <rgm@gnu.org>
6144
6145 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6146 and did not make it into globals.h).
6147
6148 2012-07-03 Tom Tromey <tromey@redhat.com>
6149
6150 * window.c (Fset_window_margins, Fset_window_fringes)
6151 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6152 * textprop.c (Fprevious_property_change): No longer static.
6153 * syntax.c (Fsyntax_table_p): No longer static.
6154 * process.c (Fget_process, Fprocess_datagram_address): No longer
6155 static.
6156 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6157 * keyboard.c (Fcommand_execute): No longer static.
6158 Remove EXFUN.
6159 * insdel.c (Fcombine_after_change_execute): No longer static.
6160 * image.c (Finit_image_library): No longer static.
6161 * fileio.c (Fmake_symbolic_link): No longer static.
6162 * eval.c (Ffetch_bytecode): No longer static.
6163 * editfns.c (Fuser_full_name): No longer static.
6164 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6165 No longer static.
6166 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6167 static.
6168 * dired.c (Ffile_attributes): No longer static.
6169 * composite.c (Fcomposition_get_gstring): No longer static.
6170 * callproc.c (Fgetenv_internal): No longer static.
6171
6172 * ccl.h: Remove EXFUNs.
6173 * buffer.h: Remove EXFUNs.
6174 * dispextern.h: Remove EXFUNs.
6175 * intervals.h: Remove EXFUNs.
6176 * fontset.h: Remove EXFUN.
6177 * font.h: Remove EXFUNs.
6178 * dosfns.c (system_process_attributes): Remove EXFUN.
6179 * keymap.h: Remove EXFUNs.
6180 * lisp.h: Remove EXFUNs.
6181 * w32term.h: Remove EXFUNs.
6182 * window.h: Remove EXFUNs.
6183 * xsettings.h: Remove EXFUN.
6184 * xterm.h: Remove EXFUN.
6185
6186 2012-07-03 Glenn Morris <rgm@gnu.org>
6187
6188 * lisp.h (Frandom): Make it visible to C.
6189 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6190 buffer for invisible buffers. (Bug#1229)
6191
6192 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6193
6194 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6195 values which aren't power of 2.
6196 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
6197 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
6198 accordingly.
6199
6200 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6201
6202 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6203
6204 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6205
6206 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6207
6208 * alloc.c (allocate_vector_block): Remove redundant
6209 calls to mallopt if DOUG_LEA_MALLOC is defined.
6210 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6211 avoid calls to mallopt if zero_vector is returned.
6212
6213 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6214
6215 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6216 is enabled, avoid dereferencing NULL current_sblock if
6217 running undumped.
6218
6219 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6220
6221 Cleanup basic buffer management.
6222 * buffer.h (struct buffer): Change layout to use generic vector
6223 marking code. Fix some comments. Change type of 'clip_changed'
6224 to bitfield. Remove unused #ifndef old.
6225 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
6226 (GET_OVERLAYS_AT): Fix indentation.
6227 (for_each_per_buffer_object_at): New macro.
6228 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
6229 (Fbuffer_local_variables): Use it.
6230 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
6231 * alloc.c (allocate_buffer): Adjust to match new layout of
6232 struct buffer. Fix comment.
6233 (mark_overlay): New function.
6234 (mark_buffer): Use it. Use mark_vectorlike to mark normal
6235 Lisp area of struct buffer.
6236 (mark_object): Use it. Adjust marking of misc objects
6237 and related comments.
6238
6239 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
6240
6241 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
6242 wrapper that is not needed because the wrapped code is a no-op (zero
6243 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
6244 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
6245
6246 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
6247
6248 * alloc.c (mark_buffer): Simplify. Remove prototype.
6249 (mark_object): Add comment. Reorganize marking of vector-like
6250 objects. Use CHECK_LIVE for all vector-like objects except buffers
6251 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
6252 Avoid redundant calls to mark_vectorlike for bool vectors.
6253
6254 2012-06-30 Glenn Morris <rgm@gnu.org>
6255
6256 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
6257
6258 * epaths.in (PATH_SITELOADSEARCH): New.
6259 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
6260 This is rather than relying on --enable-locallisppath elements
6261 having "site-lisp" in their names. (Bug#10208#25, 11658)
6262
6263 2012-06-30 Eli Zaretskii <eliz@gnu.org>
6264
6265 * w32proc.c (sys_select): Accept and ignore one more argument.
6266
6267 * w32.c (emacs_gnutls_pull): Call select with one more argument.
6268
6269 * sysselect.h [DOS_NT]: Don't include sys/select.h.
6270 (pselect) [!MS_DOS]: Redirect to sys_select.
6271
6272 * sysdep.c: Don't include dos.h and dosfns.h.
6273
6274 * process.c (sys_select):
6275 * msdos.c (sys_select): Accept one more argument and ignore it.
6276
6277 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
6278 adapt data types and code to that.
6279
6280 * dosfns.c:
6281 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
6282 which clashes with the gnulib function of the same name.
6283
6284 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
6285
6286 * font.c (font_style_to_value, font_style_symbolic)
6287 (font_prop_validate_style): Add type checks for values in
6288 font_style_table.
6289
6290 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
6291 argument.
6292 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
6293 uses.
6294
6295 2012-06-29 Eli Zaretskii <eliz@gnu.org>
6296
6297 * xdisp.c (try_window_id): Undo last change.
6298
6299 * w32.c (getwd): Adjust commentary about startup_dir.
6300 (init_environment): Always call sys_access, even in non-MSVC
6301 builds. Don't chdir to the directory of the Emacs executable.
6302 This undoes code from 1997 which was justified by the need to
6303 "avoid conflicts when removing and renaming directories". But its
6304 downside was that every relative file name was being interpreted
6305 relative to the directory of the Emacs executable, which can never
6306 be TRT. In particular, it broke sys_access when called with
6307 relative file names.
6308 (sys_access): Map GetLastError to errno.
6309
6310 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6311
6312 * window.h (struct window): Change type of 'fringes_outside_margins'
6313 to bitfield. Fix comment. Adjust users accordingly.
6314 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
6315 Adjust comment.
6316 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
6317 to ptrdiff_t.
6318
6319 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
6320
6321 * gnutls.c (emacs_gnutls_handshake):
6322 Add QUIT to make the loop interruptible.
6323
6324 2012-06-29 Glenn Morris <rgm@gnu.org>
6325
6326 * charset.c (init_charset): Make lack of etc/charsets fatal.
6327
6328 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6329
6330 * editfns.c (region_limit): Fix type mismatch.
6331
6332 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6333
6334 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
6335 undefined. Convert from xassert to eassert.
6336 * nsmenu.m: Convert from xassert to eassert.
6337 * nsterm.m: Likewise.
6338
6339 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
6340
6341 * editfns.c (region_limit): Clip to narrowing (bug#11770).
6342
6343 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
6344
6345 Avoid integer overflow on scroll-left and scroll-right.
6346 * window.c (HSCROLL_MAX): New macro.
6347 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
6348 overflow when requested scroll falls outside ptrdiff_t range.
6349
6350 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6351
6352 * window.h (struct window): Change type of 'hscroll',
6353 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
6354 'last_modified' and 'last_overlay_modified' to EMACS_INT.
6355 Adjust users accordingly.
6356 * xdisp.c (try_cursor_movement): Replace type check with eassert.
6357 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
6358 from EMACS_INT to ptrdiff_t.
6359 (make_window): Omit redundant initialization.
6360
6361 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
6362
6363 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
6364
6365 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6366
6367 * window.h (struct window): Change type of 'use_time' and
6368 'sequence_number' from Lisp_Object to int.
6369 * frame.c (make_frame): Adjust users accordingly.
6370 * print.c (print_object): Likewise.
6371 * window.c (select_window, Fwindow_use_time, make_parent_window)
6372 (make_window): Likewise.
6373
6374 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6375
6376 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
6377 enabled with --enable-checking=[all,glyphs] configure option.
6378 Fix GLYPH_DEBUG usage assuming that it may be undefined,
6379 adjust comments accordingly.
6380 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
6381 undefined, adjust comments accordingly.
6382 * image.c: Likewise.
6383 * scroll.c: Likewise.
6384 * w32fns.c: Likewise.
6385 * w32term.c: Likewise.
6386 * xdisp.c: Likewise.
6387 * xfaces.c: Likewise.
6388 * xfns.c: Likewise.
6389 * xterm.c: Likewise.
6390
6391 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6392
6393 Generalize run-time debugging checks.
6394 * dispextern.h (XASSERTS): Remove.
6395 * fontset.c (xassert): Remove.
6396 Convert from xassert to eassert.
6397 * alloc.c: Convert from xassert to eassert.
6398 * bidi.c: Likewise.
6399 * dispnew.c: Likewise.
6400 * fns.c: Likewise.
6401 * fringe.c: Likewise.
6402 * ftfont.c: Likewise.
6403 * gtkutil.c: Likewise.
6404 * image.c: Likewise.
6405 * keyboard.c: Likewise.
6406 * menu.c: Likewise.
6407 * process.c: Likewise.
6408 * scroll.c: Likewise.
6409 * sound.c: Likewise.
6410 * term.c: Likewise.
6411 * w32console.c: Likewise.
6412 * w32fns.c: Likewise.
6413 * w32term.c: Likewise.
6414 * window.c: Likewise.
6415 * xdisp.c: Likewise.
6416 * xfaces.c: Likewise.
6417 * xfns.c: Likewise.
6418 * xselect.c: Likewise.
6419 * xterm.c: Likewise.
6420
6421 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
6422
6423 * fns.c (maybe_resize_hash_table): Output message when growing the
6424 purify-hashtable.
6425
6426 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6427
6428 * alloc.c (allocate_string_data): Remove dead code.
6429 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
6430 avoid GCC warning about unused macro.
6431
6432 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6433
6434 * alloc.c (allocate_string): Omit intervals initialization.
6435 * alloc.c (make_uninit_multibyte_string): Initialize intervals
6436 as in make_pure_string and make_pure_c_string.
6437
6438 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6439
6440 * alloc.c (allocate_string): Fix last change.
6441
6442 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6443
6444 * alloc.c (allocate_string): Remove two redundant calls
6445 to memset, add explicit initialization where appropriate.
6446
6447 2012-06-27 Glenn Morris <rgm@gnu.org>
6448
6449 * lisp.mk (lisp): Remove paths.elc.
6450
6451 2012-06-27 Chong Yidong <cyd@gnu.org>
6452
6453 * doc.c (Fsubstitute_command_keys): Fix punctuation.
6454
6455 2012-06-26 John Wiegley <johnw@newartisans.com>
6456
6457 * unexmacosx.c (copy_data_segment): Add two section names used
6458 on Mac OS X Lion: __mod_init_func and __mod_term_func.
6459
6460 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6461 when building with Clang.
6462
6463 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
6464
6465 * eval.c (Fapply): Allow calling it with a single argument.
6466
6467 2012-06-26 Eli Zaretskii <eliz@gnu.org>
6468
6469 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6470 _stricmp and _strnicmp.
6471 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6472
6473 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6474
6475 * alloc.c (allocate_window): Zero out non-Lisp part of newly
6476 allocated window.
6477 (allocate_process): Likewise for new process.
6478 (allocate_terminal): Change to use offsetof.
6479 (allocate_frame): Likewise.
6480 * frame.c (make_frame): Omit redundant initialization.
6481 * window.c (make_parent_window): Use memset.
6482 (make_window): Omit redundant initialization.
6483 * process.c (make_process): Omit redundant initialization.
6484 * terminal.c (create_terminal): Likewise.
6485
6486 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6487
6488 * term.c (delete_tty): Remove redundant call to memset.
6489
6490 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6491
6492 * alloc.c: Remove build_string.
6493 * lisp.h: Define build_string as static inline. This provides
6494 a better opportunity to optimize away calls to strlen when the
6495 function is called with compile-time constant argument.
6496 * image.c (imagemagick_error): Convert to build_string.
6497 * w32proc.c (sys_spawnve): Likewise.
6498 * xterm.c (x_term_init): Likewise.
6499
6500 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
6501
6502 Use sprintf return value instead of invoking strlen on result.
6503 In the old days this wasn't portable, since some sprintf
6504 implementations returned char *. But they died out years ago and
6505 Emacs already assumes sprintf returns int.
6506 Similarly for float_to_string.
6507 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6508 * ccl.c (ccl_driver):
6509 * character.c (string_escape_byte8):
6510 * data.c (Fnumber_to_string):
6511 * doprnt.c (doprnt):
6512 * print.c (print_object):
6513 * xdisp.c (message_dolog):
6514 * xfns.c (syms_of_xfns):
6515 Use sprintf or float_to_string result to avoid need to call strlen.
6516 * data.c (Fnumber_to_string):
6517 Use make_unibyte_string, since the string must be ASCII.
6518 * lisp.h, print.c (float_to_string): Now returns int length.
6519 * term.c (produce_glyphless_glyph):
6520 Use sprintf result rather than recomputing it.
6521
6522 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6523 * Makefile.in (ALL_CFLAGS):
6524 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6525 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6526
6527 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6528
6529 * dispextern.h (xstrcasecmp): Define to library function
6530 strcasecmp if available.
6531 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6532
6533 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6534
6535 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6536 Avoid comma operator.
6537 * menu.c (push_submenu_start, push_submenu_end)
6538 (push_left_right_boundary, push_menu_pane): Likewise.
6539 * msdos.c (dos_rawgetc): Likewise.
6540
6541 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6542
6543 * xfns.c (xic_create_fontsetname): Remove redundant calls
6544 to memset.
6545
6546 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
6547
6548 * gtkutil.c (get_utf8_string): Remove redundant assignment.
6549 sprintf already null-terminates its output.
6550
6551 * xfns.c (x_window): Remove redundant cast.
6552
6553 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6554
6555 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6556 `const char *' to `char *' to avoid compiler warning.
6557
6558 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6559
6560 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6561 instead of truncating it to 63 (admittedly a generous limit).
6562
6563 * process.c: Fix spelling and caps in comments.
6564
6565 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
6566
6567 * emacs.c (setpgrp): Remove definition, unused.
6568 * sysdep.c (setpgrp): Remove definition, not used in this file.
6569
6570 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
6571
6572 * makefile.w32-in: Update dependencies.
6573
6574 2012-06-24 Eli Zaretskii <eliz@gnu.org>
6575
6576 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
6577 (SYSTIME_H): Add nt/inc/sys/time.h.
6578
6579 * systime.h [WINDOWSNT]: Include sys/time.h.
6580
6581 * s/ms-w32.h (struct timespec): Definition moved from
6582 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
6583
6584 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6585
6586 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
6587 * buffer.h (buffer_slot_type_mismatch):
6588 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6589 * eval.c (unwind_to_catch):
6590 * image.c (my_png_error, my_error_exit):
6591 * keyboard.c (quit_throw_to_read_char, user_error)
6592 (Fexit_recursive_edit, Fabort_recursive_edit):
6593 * lisp.h (die, args_out_of_range, args_out_of_range_3)
6594 (wrong_type_argument, buffer_overflow, __executable_start)
6595 (memory_full, buffer_memory_full, string_overflow, Fthrow)
6596 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
6597 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
6598 (fatal):
6599 (child_setup) [!DOS_NT]:
6600 * lread.c (end_of_file_error, invalid_syntax):
6601 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6602 * puresize.h (pure_write_error):
6603 * search.c (matcher_overflow):
6604 * sound.c (sound_perror, alsa_sound_perror):
6605 * sysdep.c, syssignal.h (croak):
6606 * term.c (maybe_fatal, vfatal):
6607 * textprop.c (text_read_only):
6608 * undo.c (user_error):
6609 * unexmacosx.c (unexec_error):
6610 * xterm.c (x_ins_del_lines, x_delete_glyphs):
6611 Use _Noreturn rather than NO_RETURN.
6612 No need for separate decl merely because of _Noreturn.
6613 * sound.c (sound_warning, parse_sound):
6614 Remove unnecessary forward decls.
6615
6616 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6617
6618 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
6619 * lisp.h (WAIT_READING_MAX): New macro.
6620 * dispnew.c (Fsleep_for, sit_for):
6621 * keyboard.c (kbd_buffer_get_event):
6622 * process.c (Faccept_process_output):
6623 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6624 This improves on the previous patch, which introduced a bug
6625 when time_t is unsigned and as wide as intmax_t.
6626 See <http://bugs.gnu.org/9000#51>.
6627
6628 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6629
6630 * dispnew.c (sit_for, Fsleep_for):
6631 * keyboard.c (kbd_buffer_get_event):
6632 * process.c (Faccept_process_output): Avoid compiler warnings when
6633 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6634
6635 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
6636
6637 * makefile.w32-in: Update dependencies.
6638
6639 * w32.c (ltime): Add return type and declare static.
6640 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6641
6642 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6643
6644 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6645 Privately reported by Herbert J. Skuhra.
6646 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6647 All uses changed.
6648 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6649 not make_lisp_timeval, when the argument is of type EMACS_TIME.
6650
6651 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6652
6653 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6654 last argument of make_unibyte_string.
6655
6656 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6657 language ID in the event parameters.
6658
6659 * w32term.c (w32_read_socket): Put the new keyboard codepage into
6660 event.code, not the obscure "character set ID".
6661
6662 2012-06-23 Chong Yidong <cyd@gnu.org>
6663
6664 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6665
6666 2012-06-23 Eli Zaretskii <eliz@gnu.org>
6667
6668 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6669 * w32.c (fdutimens): New function.
6670
6671 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6672
6673 * s/ms-w32.h (pselect): Redirect to sys_select.
6674
6675 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6676
6677 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6678 in the logic of incrementing and decrementing the value of
6679 use_relocatable_buffers.
6680
6681 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6682
6683 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6684 Privately reported by Herbert J. Skuhra.
6685 [__FreeBSD__]: Remove "*/" typo after "#include".
6686 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6687 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6688 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6689 Don't assume EMACS_TIME and struct timeval are the same type.
6690
6691 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
6692
6693 Support higher-resolution time stamps (Bug#9000).
6694 The time stamps are only nanosecond-resolution at the C level,
6695 since that's the best that any real-world system supports now.
6696 But they are picosecond-resolution at the Lisp level, as that's
6697 easy, and leaves room for future OS improvements.
6698
6699 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6700 (LIBES): Use it.
6701
6702 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6703 Don't get current time unless it's needed.
6704
6705 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6706 now provides it if it's absent.
6707 (start_atimer): Port to higher-res time stamps.
6708 Check for time stamp overflow. Don't get current time more
6709 often than is needed.
6710
6711 * buffer.h (struct buffer): Buffer modtime now has high resolution.
6712 Include systime.h, not time.h.
6713 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
6714
6715 * dired.c: Include stat-time.h.
6716 (Ffile-attributes): File times now have higher resolution.
6717
6718 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
6719 (struct image): Timestamp now has higher resolution.
6720
6721 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
6722 has at least microseconds now. All uses removed.
6723 (update_frame, update_single_window, update_window, update_frame_1)
6724 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
6725 (duration_to_sec_usec): Remove; no longer needed.
6726
6727 * editfns.c (time_overflow): Now extern.
6728 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
6729 (float-time, Fformat_time_string, Fcurrent_time_string)
6730 (Fcurrent_time_zone): Accept and generate higher-resolution
6731 time stamps.
6732 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
6733 (decode_time_components, lisp_seconds_argument): New functions.
6734 (make_time): Now static.
6735 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
6736 Report an error if the time is invalid, rather than having the caller
6737 do that.
6738
6739 * fileio.c: Include <stat-time.h>
6740 (Fcopy_file): Copy higher-resolution time stamps.
6741 Prefer to set the time stamp via a file descriptor if that works.
6742 (Fset_file_times, Finsert_file_contents, Fwrite_region)
6743 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
6744 (Fvisited_file_modtime, Fset_visited_file_modtime):
6745 Support higher-resolution time stamps.
6746
6747 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6748
6749 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6750
6751 * image.c (prepare_image_for_display, clear_image_cache)
6752 (lookup_image): Port to higer-resolution time stamps.
6753
6754 * keyboard.c (start_polling, bind_polling_period):
6755 Check for time stamp overflow.
6756 (read_char, kbd_buffer_get_event, timer_start_idle)
6757 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6758 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6759 Port to higher-resolution time stamps. Do not assume time_t is signed.
6760 (decode_timer): New function. Timers are now vectors of length 9,
6761 not 8, to accommodate the picosecond component.
6762 (timer_check_2): Use it.
6763
6764 * nsterm.m (select_timeout, timeval_subtract): Remove.
6765 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6766 as they're a bit more accurate and handle overflow better.
6767 (ns_select): Change prototype to be compatible with pselect.
6768 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6769 * nsterm.h (ns_select): Adjust prototype.
6770
6771 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6772 us-resolution time stamps.
6773 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6774
6775 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6776
6777 * lisp.h (time_overflow): New decl.
6778 (wait_reading_process_output): First arg is now intmax_t, not int,
6779 to accommodate larger waits.
6780
6781 * process.h (struct Lisp_Process.read_output_delay):
6782 Now counts nanoseconds, not microseconds.
6783 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6784 EMACS_HAS_USECS.
6785 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6786 (wait_reading_process_output):
6787 Port to ns-resolution time stamps.
6788 (Faccept_process_output, wait_reading_process_output):
6789 Check for time stamp overflow. Do not assume time_t is signed.
6790 (select_wrapper): Remove; we now use pselect.
6791 (Fprocess_attributes): Now generates ns-resolution time stamps.
6792
6793 * sysdep.c: Include utimens.h. Don't include utime.h
6794 or worry about struct utimbuf; gnulib does that for us now.
6795 (gettimeofday): Remove; gnulib provides a substitute.
6796 (make_timeval): New function.
6797 (set_file_times): Now sets ns-resolution time stamps.
6798 New arg FD; all uses changed.
6799 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6800 (system_process_attributes):
6801 Now returns ns-resolution time stamp. All uses changed.
6802 Check for time stamp overflow.
6803
6804 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6805 provides a substitute now.
6806
6807 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6808 since it guarantees struct timespec.
6809 (EMACS_TIME): Now struct timespec, so that we can support
6810 ns-resolution time stamps.
6811 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6812 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6813 (EMACS_USECS): Remove.
6814 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6815 so multiply the arg by 1000 before storing it.
6816 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6817 New macros.
6818 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6819 Port to ns-resolution time stamps.
6820 (EMACS_TIME_NEG_P): Remove; replaced by....
6821 (EMACS_TIME_SIGN): New macro.
6822 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6823 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6824 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6825 (make_timeval, make_lisp_time, decode_time_components): New decls.
6826 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6827 that it mishandled time_t overflow. You can't compare by subtracting!
6828 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6829 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6830
6831 * term.c: Include <sys/time.h>.
6832 (timeval_to_Time): New function, for proper overflow wraparound.
6833 (term_mouse_position, term_mouse_click): Use it.
6834
6835 * undo.c (record_first_change): Support higher-resolution time stamps
6836 in the undo buffer.
6837 (Fprimitive_undo): Use them when restoring time stamps.
6838
6839 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6840 (w32_get_internal_run_time):
6841 Port to higher-resolution Emacs time stamps.
6842 (ltime): Now accepts single 64-bit integer, as that's more convenient
6843 for callers.
6844
6845 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6846
6847 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6848 for compatibility with pselect. Support ns-resolution time stamps.
6849
6850 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6851
6852 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6853 Check for time stamp overflow, and support ns-resolution time stamps.
6854
6855 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6856 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6857 (timeval_subtract): Remove; no longer needed.
6858 (XTflash, XTring_bell, x_wait_for_event):
6859 Port to ns-resolution time stamps. Don't assume time_t is signed.
6860
6861 2012-06-22 Chong Yidong <cyd@gnu.org>
6862
6863 * xdisp.c (x_consider_frame_title): Revert last change.
6864
6865 2012-06-22 Eli Zaretskii <eliz@gnu.org>
6866
6867 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6868 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6869 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6870 staticidx goes up to 1597 out of 1600 = 0x640.)
6871
6872 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6873
6874 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6875 Otherwise, the umask might be mistakenly 0 while handling input signals.
6876
6877 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6878
6879 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6880
6881 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6882
6883 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6884 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6885 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6886 access to `contents' member of Lisp_Vector objects with AREF and ASET
6887 where appropriate.
6888
6889 2012-06-19 Chong Yidong <cyd@gnu.org>
6890
6891 * frame.c (delete_frame): When selecting a frame on a different
6892 text terminal, do not alter the terminal's top-frame.
6893
6894 * xdisp.c (format_mode_line_unwind_data): Record the target
6895 frame's selected window and its terminal's top-frame.
6896 (unwind_format_mode_line): Restore them.
6897 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6898 Callers changed.
6899 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6900 since tty frames can be explicitly named.
6901 (prepare_menu_bars): Likewise.
6902
6903 * term.c (Ftty_top_frame): New function.
6904
6905 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6906
6907 Port byte-code-meter to modern targets.
6908 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6909 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
6910 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
6911 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6912 (METER_1, METER_2): Simplify.
6913
6914 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6915
6916 * data.c (Fdefalias): Return `symbol' (bug#11686).
6917
6918 2012-06-18 Martin Rudalics <rudalics@gmx.at>
6919
6920 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
6921 gets killed during executing of this function (Bug#11665).
6922 Try to always return Qt when the buffer has been actually killed.
6923 (Vkill_buffer_query_functions): In doc-string say that functions
6924 run by this hook should not change the current buffer.
6925
6926 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6927
6928 Fix recently-introduced process.c problems found by static checking.
6929 * process.c (write_queue_push, write_queue_pop, send_process):
6930 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6931 (write_queue_pop): Fix pointer signedness problem.
6932 (send_process): Remove unused local.
6933
6934 2012-06-17 Chong Yidong <cyd@gnu.org>
6935
6936 * xdisp.c (redisplay_internal): No need to redisplay terminal
6937 frames that are not on top.
6938
6939 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
6940
6941 * process.c (make_process): Initialize write_queue.
6942 (write_queue_push, write_queue_pop): New functions.
6943 (send_process): Use them to maintain correct ordering of process
6944 writes (Bug#10815).
6945
6946 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6947
6948 * lisp.h (eassert): Assume C89 or later.
6949 This removes the need for CHECK.
6950 (CHECK): Remove. Its comments about always evaluating its
6951 argument were confusing, as 'eassert' typically does not evaluate
6952 its argument.
6953
6954 * coding.c (produce_chars): Use ptrdiff_t, not int.
6955
6956 * xterm.c (x_draw_underwave): Check for integer overflow.
6957 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6958
6959 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
6960
6961 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6962 referenced (Bug#11583).
6963
6964 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6965
6966 Implement wave-style variant of underlining.
6967 * dispextern.h (face_underline_type): New enum.
6968 (face): Add field for underline type.
6969 * nsterm.m (ns_draw_underwave): New function.
6970 (ns_draw_text_decoration): Use it.
6971 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6972 New functions.
6973 (x_draw_glyph_string): Use them.
6974 * xfaces.c (Qline, Qwave): New Lisp objects.
6975 (check_lface_attrs, merge_face_ref)
6976 (Finternal_set_lisp_face_attribute, realize_x_face):
6977 Handle wave-style underline face attributes.
6978 * xterm.c (x_draw_underwave): New function.
6979 (x_draw_glyph_string): Use it.
6980
6981 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
6982
6983 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6984 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6985 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6986 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6987 ($(BLD)/w32select.$(O)): Update dependencies.
6988
6989 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6990
6991 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6992 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6993 * character.c (_fetch_multibyte_char_p): Remove.
6994 * alloc.c: Include "character.h" before "buffer.h".
6995 * bidi.c: Likewise.
6996 * buffer.c: Likewise.
6997 * bytecode.c: Likewise.
6998 * callint.c: Likewise.
6999 * callproc.c: Likewise.
7000 * casefiddle.c: Likewise.
7001 * casetab.c: Likewise.
7002 * category.c: Likewise.
7003 * cmds.c: Likewise.
7004 * coding.c: Likewise.
7005 * composite.c: Likewise.
7006 * dired.c: Likewise.
7007 * dispnew.c: Likewise.
7008 * doc.c: Likewise.
7009 * dosfns.c: Likewise.
7010 * editfns.c: Likewise.
7011 * emacs.c: Likewise.
7012 * fileio.c: Likewise.
7013 * filelock.c: Likewise.
7014 * font.c: Likewise.
7015 * fontset.c: Likewise.
7016 * fringe.c: Likewise.
7017 * indent.c: Likewise.
7018 * insdel.c: Likewise.
7019 * intervals.c: Likewise.
7020 * keyboard.c: Likewise.
7021 * keymap.c: Likewise.
7022 * lread.c: Likewise.
7023 * macros.c: Likewise.
7024 * marker.c: Likewise.
7025 * minibuf.c: Likewise.
7026 * nsfns.m: Likewise.
7027 * nsmenu.m: Likewise.
7028 * print.c: Likewise.
7029 * process.c: Likewise.
7030 * regex.c: Likewise.
7031 * region-cache.c: Likewise.
7032 * search.c: Likewise.
7033 * syntax.c: Likewise.
7034 * term.c: Likewise.
7035 * textprop.c: Likewise.
7036 * undo.c: Likewise.
7037 * unexsol.c: Likewise.
7038 * w16select.c: Likewise.
7039 * w32fns.c: Likewise.
7040 * w32menu.c: Likewise.
7041 * window.c: Likewise.
7042 * xdisp.c: Likewise.
7043 * xfns.c: Likewise.
7044 * xmenu.c: Likewise.
7045 * xml.c: Likewise.
7046 * xselect.c: Likewise.
7047
7048 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7049
7050 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7051 If all the glyphs of the glyph row came from strings, and we have no
7052 cursor positioning clues, put the cursor on the first glyph of the
7053 row.
7054 (handle_face_prop): Use chunk-relative overlay string index when
7055 indexing into it->string_overlays array. (Bug#11653)
7056 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7057 the rightmost. (Bug#11720)
7058
7059 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7060
7061 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7062 (CATEGORY_MEMBER): Enforce 1/0 value.
7063 * category.c (_temp_category_set): Remove.
7064
7065 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7066
7067 * window.c (Fdelete_other_windows_internal)
7068 (Fdelete_window_internal): Don't access frame's mouse highlight
7069 info of the initial frame. (Bug#11677)
7070
7071 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7072
7073 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7074 Assume USE_2_TAGS_FOR_INTS.
7075 (xreload): Adjust $tagmask width to match recent lisp.h change.
7076
7077 Simplify lisp.h in minor ways that should not affect code.
7078 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7079 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7080 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7081 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7082 (INTTYPEBITS): New macro, for clarity.
7083 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
7084 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7085 Simplify now that USE_LSB_TAG is always defined.
7086 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7087 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7088
7089 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
7090
7091 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7092
7093 2012-06-13 Glenn Morris <rgm@gnu.org>
7094
7095 * s/bsd-common.h (BSD4_3):
7096 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7097
7098 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7099
7100 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7101 instead of union.
7102 (XLI, XIL): Define.
7103 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7104 Use them.
7105 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
7106 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
7107 * alloc.c (widen_to_Lisp_Object): Remove.
7108 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7109 * frame.c (delete_frame): Remove outdated comment.
7110 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7111 USE_LISP_UNION_TYPE.
7112 (Fw32_unregister_hot_key): Likewise.
7113 (Fw32_toggle_lock_key): Likewise.
7114 * w32menu.c (add_menu_item): Likewise.
7115 (w32_menu_display_help): Use XIL instead of checking
7116 USE_LISP_UNION_TYPE.
7117 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7118 (init_heap): Likewise.
7119 * w32term.c (w32_read_socket): Update comment.
7120
7121 2012-06-13 Glenn Morris <rgm@gnu.org>
7122
7123 * s/usg5-4-common.h, src/s/unixware.h:
7124 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7125
7126 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7127
7128 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7129
7130 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7131 * alloc.c (make_number) [!defined make_number]:
7132 Remove, as lisp.h always defines this now.
7133 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7134 (roundup_size): Verify that it is a power of 2.
7135 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7136 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7137 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7138 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7139 USE_LSB_TAG now is always defined to be either 0 or 1.
7140 All uses changed.
7141 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7142 code works fine either way, and efficiency is not a concern here,
7143 as the union type is for debugging, not for production.
7144 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7145 Use an inline function on all platforms when using the union type,
7146 since this is simpler and 'static inline' can be used portably
7147 within Emacs now.
7148 (LISP_INITIALLY_ZERO): New macro.
7149 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7150 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7151
7152 2012-06-12 Glenn Morris <rgm@gnu.org>
7153
7154 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7155
7156 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
7157
7158 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7159 Move BROKEN_SIGIO to configure.
7160
7161 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7162 Move NO_TERMIO to configure.
7163
7164 2012-06-12 Chong Yidong <cyd@gnu.org>
7165
7166 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7167 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7168 MagickExportImagePixels is undefined.
7169
7170 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7171
7172 * image.c (imagemagick_load_image): Remove unused label.
7173
7174 2012-06-11 Glenn Morris <rgm@gnu.org>
7175
7176 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7177 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7178 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7179 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7180
7181 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7182
7183 * alloc.c (make_byte_code): New function.
7184 (Fmake_byte_code): Use it. Don't purify here.
7185 * lread.c (read1): Use it as well to avoid extra allocation.
7186
7187 2012-06-11 Chong Yidong <cyd@gnu.org>
7188
7189 * image.c (imagemagick_load_image): Implement transparency.
7190
7191 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7192
7193 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7194 account for preceding backslashes. (Bug#11663)
7195
7196 2012-06-09 Chong Yidong <cyd@gnu.org>
7197
7198 * term.c: Support italics in capable terminals (Bug#9652).
7199 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7200 (turn_on_face): Output using TS_enter_italic_mode if available.
7201 Don't handle unused blinking and alt-charset cases.
7202 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7203 and tty_alt_charset_p cases.
7204 (tty_capable_p, init_tty): Support italics.
7205
7206 * termchar.h (struct tty_display_info): Add field for italics.
7207 Remove unused blink field.
7208
7209 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7210 Handle slant.
7211
7212 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7213 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7214 tty_alt_charset_p. Add tty_italic_p.
7215
7216 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
7217
7218 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
7219 dbus_type_is_basic if available.
7220 (xd_extract_signed, xd_extract_unsigned): Rename from
7221 extract_signed and extract_unsigned, respectively. Adapt callers.
7222
7223 2012-06-09 Chong Yidong <cyd@gnu.org>
7224
7225 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
7226
7227 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
7228 case (Bug#9752).
7229
7230 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
7231
7232 * xdisp.c (vmessage): Treat frame message as multibyte.
7233 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
7234 would generate the diagnostic "Making \302\247 buffer-local while
7235 let-bound!".
7236
7237 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7238
7239 * dispnew.c (showing_window_margins_p): Undo last change, which
7240 was done due to an inadvertent commit.
7241 (adjust_frame_glyphs_for_frame_redisplay): Do call
7242 showing_window_margins_p.
7243
7244 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7245
7246 * eval.c (Fmake_var_non_special): New primitive.
7247 (syms_of_eval): Defsubr it.
7248 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
7249
7250 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
7251
7252 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
7253 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
7254
7255 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7256
7257 * alloc.c (allocate_vectorlike): Fix last change.
7258
7259 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
7260
7261 Block-based vector allocation of small vectors.
7262 * lisp.h (struct vectorlike_header): New field `nbytes',
7263 adjust comment accordingly.
7264 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
7265 to denote vector blocks. Adjust users (live_vector_p,
7266 mark_maybe_pointer, valid_lisp_object_p) accordingly.
7267 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
7268 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
7269 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
7270 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
7271 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
7272 (roundup_size): New constant.
7273 (struct vector_block): New data type.
7274 (vector_blocks, vector_free_lists, zero_vector): New variables.
7275 (all_vectors): Rename to `large_vectors'.
7276 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
7277 (sweep_vectors): New functions.
7278 (allocate_vectorlike): Return `zero_vector' as the only vector of
7279 0 items. Allocate new vector from block if vector size is less than
7280 or equal to VBLOCK_BYTES_MAX.
7281 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
7282 (init_alloc_once): Add call to init_vectors.
7283
7284 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7285
7286 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
7287
7288 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
7289
7290 * doprnt.c (doprnt): Truncate multibyte char correctly.
7291 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
7292 would mishandle a string argument "Xc" if X was a multibyte
7293 character of length 2: it would truncate after X's first byte
7294 rather than including all of X.
7295
7296 2012-06-06 Chong Yidong <cyd@gnu.org>
7297
7298 * buffer.c (word_wrap): Doc fix.
7299
7300 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
7301
7302 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
7303
7304 2012-06-03 Glenn Morris <rgm@gnu.org>
7305
7306 * xdisp.c (tool-bar-style): Doc fix.
7307
7308 2012-06-03 Ulrich Müller <ulm@gentoo.org>
7309
7310 * Makefile.in (PAXCTL): Define.
7311 (temacs$(EXEEXT)): Disable memory randomization for the temacs
7312 binary via PaX flags if the paxctl utility is available.
7313 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7314 Restore PaX flags to their default. (Bug#11398)
7315
7316 2012-06-03 Chong Yidong <cyd@gnu.org>
7317
7318 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
7319 buffer (Bug#11226).
7320
7321 2012-06-03 Chong Yidong <cyd@gnu.org>
7322
7323 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
7324 (note_mode_line_or_margin_highlight): If there is no help echo,
7325 use mode-line-default-help-echo. Handle the case where the mouse
7326 position is past the end of the mode line string.
7327
7328 * buffer.c (buffer_local_value_1): New function, split from
7329 Fbuffer_local_value; can return Qunbound.
7330 (Fbuffer_local_value): Use it.
7331 (Vmode_line_format): Docstring tweaks.
7332
7333 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7334
7335 * sysdep.c (system_process_attributes): Improve comment.
7336
7337 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
7338
7339 * keyboard.c: Export real-this-command to Elisp.
7340 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
7341 and DEFVAR it. Update all users.
7342
7343 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7344
7345 * minibuf.c (Fassoc_string): Remove duplicate declaration.
7346
7347 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
7348 Convert pctcpu and pctmem to Lisp float properly.
7349 Let the compiler fold better, as 100.0/0x8000 is exact.
7350
7351 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
7352
7353 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
7354 cons_block.
7355
7356 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
7357
7358 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
7359
7360 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
7361
7362 For a 'struct window', replace some Lisp_Object fields to
7363 bitfields where appropriate, remove unused fields.
7364 * window.h (struct window): Remove unused 'last_mark_x' and
7365 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
7366 change it's type from Lisp_Object to bitfield.
7367 Change type of 'force_start', 'optional_new_start',
7368 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
7369 fields from Lisp_Object to bitfield. Adjust users accordingly.
7370
7371 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7372
7373 Pacify gcc -Wdouble-precision when using Xaw.
7374 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
7375 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
7376 Use 'float' consistently, rather than 'float' in most places
7377 and 'double' in a couple of places.
7378
7379 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7380
7381 * xdisp.c (handle_stop): Detect whether we have overlay strings
7382 loaded by testing it->current.overlay_string_index to be
7383 non-negative, instead of checking whether n_overlay_strings is
7384 positive. (Bug#11587)
7385
7386 2012-05-31 Chong Yidong <cyd@gnu.org>
7387
7388 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
7389
7390 * doc.c (Fsubstitute_command_keys): Doc fix.
7391
7392 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7393
7394 * search.c (search_buffer): Remove calls to
7395 r_alloc_inhibit_buffer_relocation, as it is now called by
7396 maybe_unify_char, which was the cause of relocation of buffer text
7397 in bug#11519.
7398
7399 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7400
7401 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
7402 for the duration of call to load_charset, to avoid problems with
7403 callers of maybe_unify_char that access buffer text through C
7404 pointers.
7405
7406 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
7407 decrement the inhibition flag, instead of just setting or
7408 resetting it.
7409
7410 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7411
7412 Remove obsolete '#define static' cruft.
7413 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
7414 This #undef was "temporary" in 2000; it is no longer needed
7415 now that '#define static' has gone away.
7416 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
7417 (gray_bitmap_bits): Remove; no longer needed.
7418 All uses replaced with definiens.
7419 * xterm.c: Include "bitmaps/gray.xbm".
7420
7421 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7422
7423 Clean up __executable_start, monstartup when --enable-profiling.
7424 The following changes affect the code only when profiling.
7425 * dispnew.c (__executable_start): Rename from safe_bcopy.
7426 Define only on platforms that need it.
7427 * emacs.c: Include <sys/gmon.h> when profiling.
7428 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
7429 (__executable_start): Remove decl, since lisp.h does it now.
7430 (safe_bcopy): Remove decl; no longer has that name.
7431 (main): Coalesce #if into single bit of code, for simplicity.
7432 Cast pointers to uintptr_t, since standard libraries want integers
7433 and not pointers.
7434 * lisp.h (__executable_start): New decl.
7435
7436 2012-05-31 Glenn Morris <rgm@gnu.org>
7437
7438 * image.c (Fimagemagick_types): Doc fix.
7439
7440 2012-05-30 Jim Meyering <meyering@redhat.com>
7441
7442 * callproc.c (Fcall_process_region): Include directory component
7443 in mkstemp error message (Bug#11586).
7444
7445 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7446
7447 * alloc.c, lisp.h (make_pure_vector): Now static.
7448
7449 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
7450
7451 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7452 Move to byte-run.el.
7453 (Fautoload): Do the hash-doc more carefully.
7454 * data.c (Fdefalias): Purify definition, except for keymaps.
7455 (Qdefun): Move from eval.c.
7456 * lisp.h (Qdefun): Remove.
7457 * lread.c (read1): Tiny simplification.
7458
7459 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
7460
7461 Do not create empty overlays with the evaporate property (Bug#9642).
7462 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7463 Bug#9642, but explicitly check that the buffer the overlay would
7464 be moved to is live and rearrange lines to make sure that errors
7465 will not put the overlay in an inconsistent state.
7466 (Fdelete_overlay): Cosmetics.
7467
7468 2012-05-28 Eli Zaretskii <eliz@gnu.org>
7469
7470 * w32term.c (my_bring_window_to_top): New function.
7471 (x_raise_frame): Use handle returned by DeferWindowPos, which
7472 could be different from the original one.
7473 Call my_bring_window_to_top instead of my_set_foreground_window.
7474 (Bug#11513)
7475
7476 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7477 by calling BringWindowToTop.
7478
7479 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
7480 (WM_EMACS_END): Increase by one.
7481
7482 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
7483
7484 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
7485 This avoids undefined behavior that might cause the eassert
7486 to not catch an out-of-range value.
7487
7488 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
7489
7490 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7491 Update dependencies.
7492
7493 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7494
7495 * bidi.c (bidi_mirror_char): Fix last change.
7496
7497 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
7498
7499 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7500 when referring to sectname field in printf format.
7501
7502 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
7503
7504 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7505 Only r_alloc_inhibit_buffer_relocation needed to be added;
7506 the others were already declared.
7507
7508 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7509 before checking whether it's out of range. Put the check inside
7510 eassert. See
7511 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7512
7513 2012-05-27 Ken Brown <kbrown@cornell.edu>
7514
7515 * callproc.c (Fcall_process): Restore a line that was accidentally
7516 commented out in the 2011-02-13 change (bug#11547).
7517
7518 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7519
7520 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7521 defined on ralloc.c.
7522
7523 * buffer.c [REL_ALLOC]: Remove prototypes of
7524 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7525 they are now on lisp.h.
7526
7527 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7528
7529 * search.c (search_buffer): Use it to inhibit relocation of buffer
7530 text while re_search_2 is doing its job, because re_search_2 is
7531 passed C pointers to buffer text. (Bug#11519)
7532
7533 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7534 Update value to 24.
7535
7536 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7537 state after an additional call to move_it_in_display_line_to, keep
7538 the values of it->max_ascent and it->max_descent found for the
7539 entire line.
7540 (pos_visible_p): Revert the comparison against bottom_y to what it
7541 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7542 (Bug#11464)
7543
7544 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7545
7546 Fix coding-related core dumps with gcc -ftrapv.
7547 The code was computing A - B, where A and B are pointers, and B is
7548 random garbage. This can lead to core dumps on platforms that
7549 have special pointer registers, and it also leads to core dumps on
7550 x86-64 when compiled with gcc -ftrapv. The fix is to compute
7551 A - B only when B is initialized properly.
7552 * coding.c (coding_set_source, coding_set_destination): Return void.
7553 (coding_change_source, coding_change_destinations): New functions,
7554 with the old behaviors of coding_set_source and coding_set_destination.
7555 All callers that need an offset changed to use these new functions.
7556
7557 2012-05-26 Glenn Morris <rgm@gnu.org>
7558
7559 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
7560
7561 2012-05-26 Eli Zaretskii <eliz@gnu.org>
7562
7563 Extend mouse support on W32 text-mode console.
7564 * xdisp.c (draw_row_with_mouse_face):
7565 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
7566
7567 * w32console.c: Include window.h.
7568 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
7569 New functions.
7570 (initialize_w32_display): Initialize mouse-highlight data.
7571
7572 * w32inevt.c: Include termchar.h and window.h.
7573 (do_mouse_event): Support mouse-autoselect-window. When the mouse
7574 moves, call note_mouse_highlight. If help_echo changed, call
7575 gen_help_event to produce help-echo message in the echo area.
7576 Call clear_mouse_face if mouse_face_hidden is set in the mouse
7577 highlight info.
7578
7579 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7580
7581 * lread.c (read1): Simplify slightly to avoid an overflow warning
7582 with GCC 4.7.0 on x86-64.
7583
7584 2012-05-26 Eli Zaretskii <eliz@gnu.org>
7585
7586 * bidi.c (bidi_mirror_char): Revert last change: an int is
7587 definitely wide enough here.
7588
7589 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
7590
7591 Fix integer width and related bugs (Bug#9874).
7592 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
7593 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
7594 (string_bytes, check_sblock, allocate_string_data):
7595 (compact_small_strings, Fmake_bool_vector, make_string)
7596 (make_unibyte_string, make_multibyte_string)
7597 (make_string_from_bytes, make_specified_string)
7598 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
7599 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
7600 (mark_vectorlike):
7601 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7602 (allocate_pseudovector):
7603 Use int, not EMACS_INT, where int is wide enough.
7604 (inhibit_garbage_collection, Fgarbage_collect):
7605 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7606 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
7607 int might not be wide enough.
7608 (bidi_cache_search, bidi_cache_find, bidi_init_it)
7609 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
7610 (bidi_at_paragraph_end, bidi_find_paragraph_start)
7611 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7612 (bidi_level_of_next_char, bidi_move_to_visually_next):
7613 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7614 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
7615 (Fkill_buffer, Fset_buffer_major_mode)
7616 (advance_to_char_boundary, Fbuffer_swap_text)
7617 (Fset_buffer_multibyte, overlays_at, overlays_in)
7618 (overlay_touches_p, struct sortvec, record_overlay_string)
7619 (overlay_strings, recenter_overlay_lists)
7620 (adjust_overlays_for_insert, adjust_overlays_for_delete)
7621 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
7622 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
7623 (Foverlay_recenter, last_overlay_modification_hooks_used)
7624 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7625 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7626 (validate_region): Omit unnecessary test for b <= e,
7627 since that's guaranteed by the previous test.
7628 (adjust_overlays_for_delete): Avoid pos + length overflow.
7629 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7630 (report_overlay_modification):
7631 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7632 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7633 Omit pointer cast, which isn't needed anyway, and doesn't work
7634 after the EMACS_INT -> ptrdiff_t change.
7635 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
7636 * buffer.h: Adjust decls to match defn changes elsewhere.
7637 (struct buffer_text, struct buffer):
7638 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7639 Use EMACS_INT, not int, where int might not be wide enough.
7640 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7641 not int, to avoid needless 32-bit limit on 64-bit hosts.
7642 (exec_byte_code): Use tighter memory-full test, one that checks
7643 for alloca overflow. Don't compute the address of the object just
7644 before an array, as that's not portable. Use EMACS_INT, not
7645 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
7646 * callint.c (Fcall_interactively):
7647 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7648 * callproc.c (call_process_kill, Fcall_process):
7649 Don't assume pid_t fits into an Emacs fixnum.
7650 (call_process_cleanup, Fcall_process, child_setup):
7651 Don't assume pid_t fits into int.
7652 (call_process_cleanup, Fcall_process, delete_temp_file)
7653 (Fcall_process_region):
7654 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7655 (Fcall_process): Simplify handling of volatile integers.
7656 Use int, not EMACS_INT, where int will do.
7657 * casefiddle.c (casify_object, casify_region, operate_on_word)
7658 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7659 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7660 (casify_object): Avoid integer overflow when overallocating buffer.
7661 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
7662 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
7663 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7664 * category.h (CATEGORYP): Don't assume arg is nonnegative.
7665 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7666 integers are now checked earlier. All uses replaced with XINT.
7667 (ccl_driver):
7668 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7669 For CCL_MapSingle, check that content and value are in int range.
7670 (ccl_driver, Fregister_code_conversion_map):
7671 Check that Vcode_version_map_vector is a vector.
7672 (resolve_symbol_ccl_program): Check that vector header is in range.
7673 Always copy the vector, so that we can check its contents reliably
7674 now rather than having to recheck each instruction as it's being
7675 executed. Check that vector words fit in 'int'.
7676 (ccl_get_compiled_code, Fregister_ccl_program)
7677 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7678 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7679 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7680 contents are in range.
7681 (Fccl_execute_on_string): Check that status is in range.
7682 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7683 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7684 Accept and return EMACS_INT, not int, because callers can pass values
7685 out of 'int' range.
7686 (c_string_width, strwidth, lisp_string_width, chars_in_text)
7687 (multibyte_chars_in_text, parse_str_as_multibyte)
7688 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7689 (str_as_unibyte, str_to_unibyte, string_count_byte8)
7690 (string_escape_byte8, Fget_byte):
7691 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7692 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
7693 avoid mishandling large integers.
7694 * character.h: Adjust decls to match defn changes elsewhere.
7695 * charset.c (load_charset_map_from_file, find_charsets_in_text)
7696 (Ffind_charset_region):
7697 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7698 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7699 (load_charset_map_from_vector, Fdefine_charset_internal):
7700 Don't assume fixnum fits in int.
7701 (load_charset_map_from_vector, Fmap_charset_chars):
7702 Remove now-unnecessary CHECK_NATNUMs.
7703 (Fdefine_charset_internal): Check ranges here, more carefully.
7704 Don't rely on undefined behavior with signed left shift overflow.
7705 Don't assume unsigned int fits into fixnum, or that fixnum fits
7706 into unsigned int. Don't require max_code to be a valid fixnum;
7707 that's not true for gb10830 4-byte on a 32-bit host. Allow
7708 invalid_code to be a cons, for the same reason. Require code_offset
7709 to be a character. Avoid int overflow if max_char is close
7710 to INT_MAX.
7711 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7712 this is intended anyway and avoids some undefined behavior.
7713 (load_charset_map): Pass unsigned, not int, as 2nd arg of
7714 INDEX_TO_CODE_POINT, as that's what it expects.
7715 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
7716 * charset.h (DECODE_CHAR): Return int, not unsigned;
7717 this is what was intended anyway, and it avoids undefined behavior.
7718 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
7719 integer-overflow issues.
7720 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
7721 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
7722 where the argument is EMACS_INT, and this behavior is not intended.
7723 * chartab.c (Fmake_char_table, Fset_char_table_range)
7724 (uniprop_get_decoder, uniprop_get_encoder):
7725 Don't assume fixnum fits in int.
7726 * cmds.c (move_point): New function, that does the gist of
7727 Fforward_char and Fbackward_char, but does so while checking
7728 for integer overflow more accurately.
7729 (Fforward_char, Fbackward_char): Use it.
7730 (Fforward_line, Fend_of_line, internal_self_insert)
7731 (internal_self_insert):
7732 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7733 Fix a FIXME, by checking for integer overflow when calculating
7734 target_clm and actual_clm.
7735 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
7736 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
7737 (ASSURE_DESTINATION, coding_alloc_by_realloc)
7738 (coding_alloc_by_making_gap, alloc_destination)
7739 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
7740 (encode_coding_utf_16, detect_coding_emacs_mule)
7741 (decode_coding_emacs_mule, encode_coding_emacs_mule)
7742 (detect_coding_iso_2022, decode_coding_iso_2022)
7743 (encode_invocation_designation, encode_designation_at_bol)
7744 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7745 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7746 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7747 (encode_coding_ccl, encode_coding_raw_text)
7748 (detect_coding_charset, decode_coding_charset)
7749 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7750 (produce_composition, produce_charset, produce_annotation)
7751 (decode_coding, handle_composition_annotation)
7752 (handle_charset_annotation, consume_chars, decode_coding_gap)
7753 (decode_coding_object, encode_coding_object, detect_coding_system)
7754 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7755 (code_convert_region, code_convert_string)
7756 (Fdefine_coding_system_internal)
7757 (coding_set_source, coding_set_destination):
7758 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7759 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7760 (Fdefine_coding_system_internal):
7761 Don't assume fixnums fit in int.
7762 (decode_coding_gap, decode_coding_object, encode_coding_object)
7763 (Fread_coding_system, Fdetect_coding_region)
7764 (Funencodable_char_position, Fcheck_coding_systems_region)
7765 (get_translation, handle_composition_annotation, consume_chars):
7766 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7767 (consume_chars): Rewrite to not calculate an address outside buffer.
7768 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7769 Don't access memory outside of the args array.
7770 (Fdefine_coding_system_internal): Check for charset-id overflow.
7771 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7772 result of ENCODE_CHAR.
7773 * coding.h: Adjust decls to match defn changes elsewhere.
7774 (struct coding_system):
7775 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7776 * composite.c (get_composition_id, find_composition)
7777 (run_composition_function, update_compositions)
7778 (compose_text, composition_gstring_put_cache)
7779 (composition_gstring_p, composition_gstring_width)
7780 (fill_gstring_header, fill_gstring_body, autocmp_chars)
7781 (composition_compute_stop_pos, composition_reseat_it)
7782 (composition_update_it, struct position_record)
7783 (find_automatic_composition, composition_adjust_point)
7784 (Fcomposition_get_gstring, Ffind_composition_internal):
7785 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7786 (update_compositions):
7787 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7788 * composite.h: Adjust decls to match defn changes elsewhere.
7789 (struct composition):
7790 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7791 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7792 Do not attempt to compute the address of the object just before a
7793 buffer; this is not portable.
7794 (Faref, Faset):
7795 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7796 (Faset): Use int, not EMACS_INT, where int is wide enough.
7797 (Fstring_to_number): Don't assume fixnums fit in int.
7798 (Frem): Don't assume arg is nonnegative.
7799 * dbusbind.c (xd_append_arg): Check for integers out of range.
7800 (Fdbus_call_method): Don't overflow the timeout int.
7801 (extract_signed, extract_unsigned): New functions.
7802 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7803 (xd_get_connection_references): Return ptrdiff_t, not int.
7804 All uses changed.
7805 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7806 (xd_read_message_1):
7807 Use int, not unsigned, where the dbus API uses int.
7808 (Fdbus_message_internal): Don't overflow mtype.
7809 (syms_of_dbusbind): Allocate right-sized buffer for integers.
7810 * dired.c (directory_files_internal, file_name_completion, scmp)
7811 (file_name_completion_stat):
7812 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7813 (file_name_completion): Don't overflow matchcount.
7814 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7815 * dispextern.h: Adjust decls to match defn changes elsewhere.
7816 (struct text_pos, struct glyph, struct bidi_saved_info)
7817 (struct bidi_string_data, struct bidi_it, struct composition_it)
7818 (struct it):
7819 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7820 (struct display_pos, struct composition_it, struct it):
7821 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7822 * dispnew.c (increment_matrix_positions)
7823 (increment_row_positions, mode_line_string)
7824 (marginal_area_string):
7825 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7826 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
7827 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7828 (duration_to_sec_usec): New function, to check for overflow better.
7829 (Fsleep_for, sit_for): Use it.
7830 * doc.c (get_doc_string, store_function_docstring):
7831 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7832 (get_doc_string, Fsnarf_documentation):
7833 Use int, not EMACS_INT, where int is wide enough.
7834 (get_doc_string):
7835 Use SAFE_ALLOCA, not alloca.
7836 Check for overflow when converting EMACS_INT to off_t.
7837 * doprnt.c (doprnt):
7838 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7839 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7840 Don't assume uid_t fits into fixnum.
7841 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7842 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7843 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7844 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7845 (general_insert_function)
7846 (Finsert_char, make_buffer_string, make_buffer_string_both)
7847 (update_buffer_properties, Fbuffer_substring)
7848 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7849 (Fsubst_char_in_region, check_translation)
7850 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7851 (transpose_markers, Ftranspose_regions):
7852 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7853 (clip_to_bounds): Move to lisp.h as an inline function).
7854 (Fconstrain_to_field): Don't assume integers are nonnegative.
7855 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7856 (Fsubst_char_in_region, Fsave_restriction):
7857 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7858 (Femacs_pid): Don't assume pid_t fits into fixnum.
7859 (lo_time): Use int, not EMACS_INT, when int suffices.
7860 (lisp_time_argument): Check for usec out of range.
7861 (Fencode_time): Don't assume fixnum fits in int.
7862 (Fuser_login_name, Fuser_full_name): Signal an error
7863 if a uid argument is out of range, rather than relying on
7864 undefined behavior.
7865 (Fformat_time_string): Remove now-unnecessary check.
7866 lisp_time_argument checks for out-of-range usec now.
7867 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
7868 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7869 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7870 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7871 (init_cmdargs, Fdump_emacs):
7872 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7873 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7874 the bottom (typically) 32 bits of the fixnum.
7875 * eval.c (specpdl_size, call_debugger):
7876 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7877 (when_entered_debugger, Fbacktrace_debug):
7878 Don't assume fixnum can fit in int.
7879 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7880 the object just before a buffer; this is not portable.
7881 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7882 (grow_specpdl, unbind_to):
7883 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7884 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7885 (grow_specpdl): Simplify allocation by using xpalloc.
7886 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
7887 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7888 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7889 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7890 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7891 (a_write, e_write):
7892 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7893 (Fcopy_file, non_regular_nbytes, read_non_regular)
7894 (Finsert_file_contents):
7895 Use int, not EMACS_INT, where int is wide enough.
7896 (READ_BUF_SIZE): Verify that it fits in int.
7897 (Finsert_file_contents): Check that counts are in proper range,
7898 rather than assuming fixnums fit into ptrdiff_t etc.
7899 Don't assume fixnums fit into int.
7900 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
7901 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7902 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
7903 (string_char_to_byte, string_byte_to_char)
7904 (string_make_multibyte, string_to_multibyte)
7905 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7906 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7907 (substring_both, Fdelete, internal_equal, Ffillarray)
7908 (Fclear_string, mapcar1)
7909 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7910 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7911 (larger_vector, make_hash_table, maybe_resize_hash_table)
7912 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7913 (Fmaphash, secure_hash):
7914 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7915 (concat): Check for string index and length overflow.
7916 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7917 (Frequire):
7918 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7919 (larger_vector): New API (vec, incr_min, size_max) replaces old
7920 one (vec, new_size, init). This catches size overflow.
7921 INIT was removed because it was always Qnil.
7922 All callers changed.
7923 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7924 the upper bound on a hash table index size.
7925 (make_hash_table, maybe_resize_hash_table): Use it.
7926 (secure_hash): Computer start_byte and end_byte only after
7927 they're known to be in ptrdiff_t range.
7928 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7929 (Ffont_get_glyphs, Ffont_at):
7930 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7931 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7932 (Flist_fonts, Fopen_font):
7933 Don't assume fixnum can fit in int.
7934 (check_gstring): Don't assume index can fit in int.
7935 (font_match_p): Check that fixnum is a character, not a nonnegative
7936 fixnum, since the later code needs to stuff it into an int.
7937 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7938 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7939 conversion overflow issues.
7940 (Fopen_font): Check for integer out of range.
7941 (Ffont_get_glyphs): Don't assume index can fit in int.
7942 * font.h: Adjust decls to match defn changes elsewhere.
7943 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7944 integer overflow.
7945 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7946 printmax_t, where ptrdiff_t is wide enough.
7947 (Finternal_char_font):
7948 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7949 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7950 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7951 (Fset_frame_position, x_set_frame_parameters)
7952 (x_set_line_spacing, x_set_border_width)
7953 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7954 Check that fixnums are in proper range for system types.
7955 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7956 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7957 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7958 Use SAFE_ALLOCA_LISP, not alloca.
7959 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7960 intptr_t is wide enough.
7961 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7962 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7963 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7964 Check for fixnum out of range.
7965 * ftfont.c (ftfont_list): Don't assume index fits in int.
7966 Check that fixnums are in proper range for system types.
7967 (ftfont_shape_by_flt):
7968 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7969 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7970 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7971 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7972 Check that fixnums are in proper range for system types.
7973 * gnutls.h: Adjust decls to match defn changes elsewhere.
7974 * gtkutil.c (xg_dialog_run):
7975 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7976 (update_frame_tool_bar):
7977 Check that fixnums are in proper range for system types.
7978 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
7979 (lookup_image): Check that fixnums are in range for system types.
7980 * indent.c (last_known_column, last_known_column_point):
7981 (current_column_bol_cache):
7982 (skip_invisible, current_column, check_display_width):
7983 (check_display_width, scan_for_column, current_column_1)
7984 (Findent_to, Fcurrent_indentation, position_indentation)
7985 (indented_beyond_p, Fmove_to_column, compute_motion):
7986 (Fcompute_motion, Fvertical_motion):
7987 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7988 (last_known_column_modified): Use EMACS_INT, not int.
7989 (check_display_width):
7990 (Fcompute_motion):
7991 Check that fixnums and floats are in proper range for system types.
7992 (compute_motion): Don't assume index or fixnum fits in int.
7993 (compute_motion, Fcompute_motion):
7994 Use int, not EMACS_INT, when it is wide enough.
7995 (vmotion): Omit local var start_hpos that is always 0; that way
7996 we don't need to worry about overflow in expressions involving it.
7997 * indent.h: Adjust decls to match defn changes elsewhere.
7998 (struct position):
7999 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8000 Use int, not EMACS_INT, where int is wide enough.
8001 Remove unused members ovstring_chars_done and tab_offset;
8002 all uses removed.
8003 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8004 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8005 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8006 (make_gap, copy_text, insert, insert_and_inherit)
8007 (insert_before_markers, insert_before_markers_and_inherit)
8008 (insert_1, count_combining_before, count_combining_after)
8009 (insert_1_both, insert_from_string)
8010 (insert_from_string_before_markers, insert_from_string_1)
8011 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8012 (adjust_after_replace, adjust_after_insert, replace_range)
8013 (replace_range_2, del_range, del_range_1, del_range_byte)
8014 (del_range_both, del_range_2, modify_region)
8015 (prepare_to_modify_buffer, signal_before_change)
8016 (signal_after_change, Fcombine_after_change_execute):
8017 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8018 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8019 (balance_an_interval, split_interval_right, split_interval_left)
8020 (find_interval, next_interval, update_interval)
8021 (adjust_intervals_for_insertion, delete_node, delete_interval)
8022 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8023 (static_offset_intervals, offset_intervals)
8024 (merge_interval_right, merge_interval_left, make_new_interval)
8025 (graft_intervals_into_buffer, temp_set_point_both)
8026 (temp_set_point, set_point, adjust_for_invis_intang)
8027 (set_point_both, move_if_not_intangible, get_property_and_range)
8028 (get_local_map, copy_intervals, copy_intervals_to_string)
8029 (compare_string_intervals, set_intervals_multibyte_1):
8030 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8031 * intervals.h: Adjust decls to match defn changes elsewhere.
8032 (struct interval):
8033 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8034 * keyboard.c (this_command_key_count, this_single_command_key_start)
8035 (before_command_key_count, before_command_echo_length, echo_now)
8036 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8037 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8038 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8039 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8040 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8041 (last_non_minibuf_size, last_point_position, echo_truncate)
8042 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8043 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8044 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8045 (stuff_buffered_input):
8046 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8047 (last_auto_save, command_loop_1, read_char):
8048 Use EMACS_INT, not int, to avoid integer overflow.
8049 (record_char): Avoid overflow in total_keys computation.
8050 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8051 * keyboard.h: Adjust decls to match defn changes elsewhere.
8052 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8053 (Fkey_description, Fdescribe_vector, Flookup_key):
8054 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8055 (click_position): New function, to check that positions are in range.
8056 (Fcurrent_active_maps):
8057 (describe_command):
8058 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8059 (Faccessible_keymaps, Fkey_description):
8060 (preferred_sequence_p):
8061 Don't assume fixnum can fit into int.
8062 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8063 Check for integer overflow in size calculations.
8064 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8065 avoid mishandling large integers.
8066 * lisp.h: Adjust decls to match defn changes elsewhere.
8067 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8068 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8069 (struct Lisp_Marker):
8070 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8071 (clip_to_bounds): Now an inline function, moved here from editfns.c.
8072 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8073 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8074 All callers changed.
8075 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8076 Assume the arg has valid form, since it always does.
8077 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8078 unsigned integer system type.
8079 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8080 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8081 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8082 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8083 (duration_to_sec_usec): New decl.
8084 * lread.c (read_from_string_index, read_from_string_index_byte)
8085 (read_from_string_limit, readchar, unreadchar, openp)
8086 (read_internal_start, read1, oblookup):
8087 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8088 (Fload, readevalloop, Feval_buffer, Feval_region):
8089 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8090 (openp): Check for out-of-range argument to 'access'.
8091 (read1): Use int, not EMACS_INT, where int is wide enough.
8092 Don't assume fixnum fits into int.
8093 Fix off-by-one error that can read outside a buffer.
8094 (read_filtered_event): Use duration_to_sec_usec
8095 to do proper overflow checking on durations.
8096 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8097 in size calculation.
8098 (Fexecute_kbd_macro):
8099 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8100 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8101 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8102 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8103 (set_marker_both, set_marker_restricted_both, marker_position)
8104 (marker_byte_position, Fbuffer_has_markers_at):
8105 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8106 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
8107 * menu.c (ensure_menu_items): Rename from grow_menu_items.
8108 It now merely ensures that the menu is large enough, without
8109 necessarily growing it, as this avoids some integer overflow issues.
8110 All callers changed.
8111 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8112 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8113 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8114 Use SAFE_ALLOCA_LISP, not alloca.
8115 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8116 to EMACS_INT. Check that fixnums are in proper range for system types.
8117 * minibuf.c (minibuf_prompt_width, string_to_object)
8118 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8119 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8120 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8121 (get_minibuffer, read_minibuf_unwind):
8122 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8123 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8124 this simplifies overflow checking. All callers changed.
8125 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8126 (Ftest_completion):
8127 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8128 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8129 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8130 Check that fixnums are in proper range for system types.
8131 (Fx_create_frame, Fx_show_tip):
8132 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8133 * nsfont.m (ns_findfonts, nsfont_list_family):
8134 Don't assume fixnum fits in long.
8135 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8136 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8137 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8138 wide enough.
8139 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
8140 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8141 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8142 (PRINTDECLARE, PRINTPREPARE):
8143 (strout, print_string):
8144 (print, print_preprocess, print_check_string_charset_prop)
8145 (print_object):
8146 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8147 (PRINTDECLARE):
8148 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8149 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8150 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
8151 (printchar, strout): Use xpalloc to catch size calculation overflow.
8152 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
8153 (print_error_message): Use SAFE_ALLOCA, not alloca.
8154 (print_object): Use int, not EMACS_INT, where int is wide enough.
8155 (print_depth, new_backquote_output, print_number_index):
8156 Use ptrdiff_t, not int, where int might not be wide enough.
8157 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8158 (Fset_process_window_size, Fformat_network_address)
8159 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
8160 (sigchld_handler):
8161 Check that fixnums are in proper range for system types.
8162 (Fsignal_process): Simplify by avoiding a goto.
8163 Check for process-ids out of pid_t range rather than relying on
8164 undefined behavior.
8165 (process_tick, update_tick): Use EMACS_INT, not int.
8166 (Fformat_network_address, read_process_output, send_process)
8167 (Fprocess_send_region, status_notify):
8168 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8169 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8170 (wait_reading_process_output, read_process_output, exec_sentinel):
8171 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8172 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8173 (Faccept_process_output): Use duration_to_sec_usec to do proper
8174 overflow checking on durations.
8175 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8176 Don't assume pid_t fits in int.
8177 * process.h (struct Lisp_Process): Members tick and update_tick
8178 are now of type EMACS_INT, not int.
8179 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8180 configured --with-wide-int.
8181 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8182 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8183 * search.c (looking_at_1, string_match_1):
8184 (fast_string_match, fast_c_string_match_ignore_case)
8185 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8186 (scan_newline, find_before_next_newline, search_command)
8187 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8188 (set_search_regs, wordify):
8189 (Freplace_match):
8190 (Fmatch_data):
8191 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8192 (string_match_1, search_buffer, set_search_regs):
8193 (Fmatch_data):
8194 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8195 (wordify): Check for overflow in size calculation.
8196 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8197 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8198 Check that fixnums are in proper range for system types.
8199 * sound.c (struct sound_device)
8200 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8201 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8202 (Fplay_sound_internal):
8203 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8204 * syntax.c (struct lisp_parse_state, find_start_modiff)
8205 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8206 (Fparse_partial_sexp):
8207 Don't assume fixnums can fit in int.
8208 (struct lisp_parse_state, find_start_pos, find_start_value)
8209 (find_start_value_byte, find_start_begv)
8210 (update_syntax_table, char_quoted, dec_bytepos)
8211 (find_defun_start, prev_char_comend_first, back_comment):
8212 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8213 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8214 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8215 (Finternal_describe_syntax_value): Check that match_lisp is a
8216 character, not an integer, since the code stuffs it into int.
8217 (scan_words, scan_sexps_forward):
8218 Check that fixnums are in proper range for system types.
8219 (Fforward_word):
8220 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8221 (scan_sexps_forward):
8222 Use CHARACTERP, not INTEGERP, since the value must fit into int.
8223 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
8224 * syntax.h: Adjust decls to match defn changes elsewhere.
8225 (struct gl_state_s):
8226 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8227 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
8228 MOST_POSITIVE_FIXNUM.
8229 * sysdep.c (wait_for_termination_1, wait_for_termination)
8230 (interruptible_wait_for_termination, mkdir):
8231 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
8232 (emacs_read, emacs_write):
8233 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8234 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
8235 and double all fit in int.
8236 * term.c (set_tty_color_mode):
8237 Check that fixnums are in proper range for system types.
8238 * termhooks.h (struct input_event):
8239 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8240 * textprop.c (validate_interval_range, interval_of)
8241 (Fadd_text_properties, set_text_properties_1)
8242 (Fremove_text_properties, Fremove_list_of_text_properties)
8243 (Ftext_property_any, Ftext_property_not_all)
8244 (copy_text_properties, text_property_list, extend_property_ranges)
8245 (verify_interval_modification):
8246 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8247 (Fnext_single_char_property_change)
8248 (Fprevious_single_char_property_change):
8249 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8250 (copy_text_properties):
8251 Check for integer overflow in index calculation.
8252 * undo.c (last_boundary_position, record_point, record_insert)
8253 (record_delete, record_marker_adjustment, record_change)
8254 (record_property_change):
8255 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8256 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
8257 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8258 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8259 (Fx_hide_tip, Fx_file_dialog):
8260 * w32menu.c (set_frame_menubar):
8261 Use ptrdiff_t, not int, for consistency with rest of code.
8262 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
8263 (select_window, Fdelete_other_windows_internal)
8264 (window_scroll_pixel_based, window_scroll_line_based)
8265 (Frecenter, Fset_window_configuration):
8266 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8267 (Fset_window_hscroll, run_window_configuration_change_hook)
8268 (set_window_buffer, temp_output_buffer_show, scroll_command)
8269 (Fscroll_other_window, Frecenter):
8270 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8271 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
8272 Don't assume fixnum fits in int.
8273 (Fset_window_scroll_bars):
8274 Check that fixnums are in proper range for system types.
8275 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
8276 (string_pos, c_string_pos, number_of_chars, init_iterator)
8277 (in_ellipses_for_invisible_text_p, init_from_display_pos)
8278 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
8279 (compute_display_string_end, handle_face_prop)
8280 (face_before_or_after_it_pos, handle_invisible_prop)
8281 (handle_display_prop, handle_display_spec, handle_single_display_spec)
8282 (display_prop_intangible_p, string_buffer_position_lim)
8283 (string_buffer_position, handle_composition_prop, load_overlay_strings)
8284 (get_overlay_strings_1, get_overlay_strings)
8285 (iterate_out_of_display_property, forward_to_next_line_start)
8286 (back_to_previous_visible_line_start, reseat, reseat_to_string)
8287 (get_next_display_element, set_iterator_to_next)
8288 (get_visually_first_element, compute_stop_pos_backwards)
8289 (handle_stop_backwards, next_element_from_buffer)
8290 (move_it_in_display_line_to, move_it_in_display_line)
8291 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8292 (add_to_log, message_dolog, message_log_check_duplicate)
8293 (message2, message2_nolog, message3, message3_nolog
8294 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
8295 (current_message_1, truncate_echo_area, truncate_message_1)
8296 (set_message, set_message_1, store_mode_line_noprop)
8297 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
8298 (text_outside_line_unchanged_p, check_point_in_composition)
8299 (reconsider_clip_changes)
8300 (redisplay_internal, set_cursor_from_row, try_scrolling)
8301 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
8302 (redisplay_window, find_last_unchanged_at_beg_row)
8303 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
8304 (trailing_whitespace_p, find_row_edges, display_line)
8305 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
8306 (display_mode_element, store_mode_line_string)
8307 (pint2str, pint2hrstr, decode_mode_spec)
8308 (display_count_lines, display_string, draw_glyphs)
8309 (x_produce_glyphs, x_insert_glyphs)
8310 (rows_from_pos_range, mouse_face_from_buffer_pos)
8311 (fast_find_string_pos, mouse_face_from_string_pos)
8312 (note_mode_line_or_margin_highlight, note_mouse_highlight):
8313 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8314 (safe_call, init_from_display_pos, handle_fontified_prop)
8315 (handle_single_display_spec, load_overlay_strings)
8316 (with_echo_area_buffer, setup_echo_area_for_printing)
8317 (display_echo_area, echo_area_display)
8318 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
8319 (update_tool_bar, hscroll_window_tree, redisplay_internal)
8320 (redisplay_window, dump_glyph_row, display_mode_line)
8321 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
8322 (handle_display_spec, display_prop_string_p):
8323 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8324 (handle_single_display_spec, build_desired_tool_bar_string)
8325 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
8326 (get_specified_cursor_type):
8327 Check that fixnums are in proper range for system types.
8328 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
8329 (Flookup_image_map):
8330 Don't assume fixnums fit in int.
8331 (compare_overlay_entries):
8332 Avoid mishandling comparisons due to subtraction overflow.
8333 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
8334 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
8335 (handle_tool_bar_click):
8336 Use int, not unsigned, since we prefer signed and the signedness
8337 doesn't matter here.
8338 (get_next_display_element, next_element_from_display_vector):
8339 Use int, not EMACS_INT, when int is wide enough.
8340 (start_hourglass): Use duration_to_sec_usec to do proper
8341 overflow checking on durations.
8342 * xfaces.c (Fbitmap_spec_p):
8343 Check that fixnums are in proper range for system types.
8344 (compare_fonts_by_sort_order):
8345 Avoid mishandling comparisons due to subtraction overflow.
8346 (Fx_family_fonts, realize_basic_faces):
8347 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8348 (Fx_family_fonts):
8349 Don't assume fixnum fits in int.
8350 Use SAFE_ALLOCA_LISP, not alloca.
8351 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
8352 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
8353 (face_at_buffer_position, face_for_overlay_string)
8354 (face_at_string_position):
8355 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8356 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
8357 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
8358 (Fx_show_tip):
8359 Check that fixnums are in proper range for system types.
8360 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8361 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
8362 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8363 (Fx_change_window_property): Don't assume fixnums fit in int.
8364 * xfont.c (xfont_chars_supported):
8365 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8366 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
8367 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
8368 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8369 * xml.c (parse_region):
8370 * xrdb.c (magic_file_p):
8371 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8372 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
8373 (x_get_local_selection, x_reply_selection_request)
8374 (x_handle_selection_request, wait_for_property_change):
8375 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8376 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
8377 short is wide enough.
8378 (x_send_client_event): Don't assume fixnum fits in int.
8379 * xterm.c (x_x_to_emacs_modifiers):
8380 Don't assume EMACS_INT overflows nicely into int.
8381 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
8382 may come from Lisp.
8383 (handle_one_xevent): NATNUMP can eval its arg twice.
8384 (x_connection_closed):
8385 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8386 * xterm.h: Adjust decls to match defn changes elsewhere.
8387 (struct scroll_bar): Use struct vectorlike_header
8388 rather than rolling our own approximation.
8389 (SCROLL_BAR_VEC_SIZE): Remove; not used.
8390
8391 2012-05-25 Glenn Morris <rgm@gnu.org>
8392
8393 * lisp.mk (lisp): Update for more files being compiled now.
8394
8395 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
8396
8397 * lread.c: Remove `read_pure' which makes no difference.
8398 (read_pure): Remove var.
8399 (unreadpure): Remove function.
8400 (readevalloop): Don't call read_list with -1 flag.
8401 (read1, read_vector): Don't test read_pure any more.
8402 (read_list): Simplify.
8403
8404 * fileio.c, character.h: Minor style tweaks.
8405
8406 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
8407
8408 * window.h (clip_changed): Remove useless declaration.
8409
8410 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
8411
8412 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
8413 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
8414
8415 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
8416
8417 Remove src/m/*.
8418 This directory predates autoconf and is no longer needed nowadays.
8419 Move its few remaining bits of functionality to where they're needed.
8420 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8421 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8422 * m/template.h: Remove.
8423 * Makefile.in (M_FILE): Remove. All uses removed.
8424 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
8425 * lisp.h (USE_LSB_TAG):
8426 * mem-limits.h (EXCEEDS_LISP_PTR):
8427 Use VAL_MAX, not VALBITS, in #if.
8428 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
8429 (EMACS_UINT): Define unconditionally now.
8430 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
8431 (BITS_PER_EMACS_INT): New constants, replacing
8432 what used to be in config.h, but not useful in #if.
8433 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
8434 define them any more.
8435 (VAL_MAX): New macro.
8436 (VALMASK): Use it.
8437 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
8438 BITS_PER_EMACS_INT, in #if.
8439 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8440 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
8441 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8442 * s/ms-w32.h (DATA_START):
8443 Move here from removed file m/intel386.h.
8444 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8445 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8446
8447 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
8448
8449 Assume C89 or later.
8450 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8451 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8452 (xrealloc):
8453 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8454 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8455 * textprop.c, tparam.c (NULL): Remove.
8456 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8457 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8458 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
8459 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8460 * xterm.c (input_signal_count): Assume volatile works.
8461
8462 2012-05-21 Ken Brown <kbrown@cornell.edu>
8463
8464 * xgselect.c (xg_select): Fix first argument in call to 'select'
8465 (bug#11508).
8466
8467 2012-05-20 Ken Brown <kbrown@cornell.edu>
8468
8469 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
8470 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
8471
8472 2012-05-19 Ken Brown <kbrown@cornell.edu>
8473
8474 * xfns.c (x_in_use): Remove `static' qualifier.
8475 * xterm.h (x_in_use): Declare.
8476 * xgselect.c: Include xterm.h.
8477 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8478 and `display_arg' (bug#9754).
8479
8480 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
8481
8482 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
8483
8484 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
8485 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8486
8487 2012-05-18 Eli Zaretskii <eliz@gnu.org>
8488
8489 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8490
8491 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
8492 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
8493
8494 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8495 reference to image_cache->refcount.
8496 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8497
8498 2012-05-17 Juri Linkov <juri@jurta.org>
8499
8500 * search.c (Fword_search_regexp, Fword_search_backward)
8501 (Fword_search_forward, Fword_search_backward_lax)
8502 (Fword_search_forward_lax): Move functions to isearch.el
8503 (bug#10145, bug#11381).
8504
8505 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8506
8507 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8508
8509 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8510
8511 * lread.c (init_obarray): Declare Qt and Qnil as special.
8512
8513 2012-05-14 Glenn Morris <rgm@gnu.org>
8514
8515 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
8516 Put "libexec" before "bin", for the sake of init_callproc_1.
8517
8518 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8519
8520 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8521
8522 * unexaix.c: Port to more-recent AIX compilers.
8523 (report_error, report_error_1, make_hdr, copy_sym)
8524 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8525 Make arguments const char *, not char *, to avoid violations of C
8526 standard and to fix some AIX warnings reported by Gilles Pion.
8527
8528 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8529
8530 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8531 already have overlays loaded.
8532 (handle_single_display_spec): Before returning without displaying
8533 fringe bitmap, synchronize the bidi iterator with the main display
8534 iterator, by calling iterate_out_of_display_property.
8535 (iterate_out_of_display_property): Detect buffer iteration by
8536 testing that it->string is a Lisp string.
8537 (get_next_display_element): When the current object is exhausted,
8538 and there's something on it->stack, call set_iterator_to_next to
8539 proceed with what's on the stack, instead of returning zero.
8540 (set_iterator_to_next): If called at the end of a Lisp string,
8541 proceed to consider_string_end without incrementing string
8542 position. Don't increment display vector index past the end of
8543 the display vector. (Bug#11417)
8544 (pos_visible_p): Don't report a position visible when move_it_to
8545 stopped at the last line of window, which happens to be scanned
8546 backwards by the bidi iteration. (Bug#11464)
8547
8548 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8549
8550 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8551 and right-margin display specs even if the spec is invalid or we
8552 are on a TTY, and thus unable to display on the fringes.
8553 That's because the text with the property will not be displayed anyway,
8554 so we need to signal to the caller that this is a "replacing"
8555 display spec. This fixes display when the spec is invalid or we
8556 are on a TTY.
8557
8558 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8559
8560 * unexaix.c (make_hdr): Fix typo in prototype.
8561 This bug broke the build on AIX. Problem reported by Gilles Pion.
8562
8563 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
8564
8565 * keyboard.c (kbd_buffer_get_event): Read special events also in
8566 batch mode. (Bug#11415)
8567
8568 2012-05-12 Glenn Morris <rgm@gnu.org>
8569
8570 * ns.mk: Update for ns_appbindir no longer having trailing "/".
8571
8572 2012-05-12 Eli Zaretskii <eliz@gnu.org>
8573
8574 * lisp.mk (lisp): Add newcomment.elc.
8575
8576 2012-05-12 Glenn Morris <rgm@gnu.org>
8577
8578 * Makefile.in (MKDIR_P): New, set by configure.
8579 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
8580
8581 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
8582
8583 Remove unused function hourglass_started.
8584 * dispextern.h (hourglass_started):
8585 * w32fns.c (hourglass_started):
8586 * xdisp.c (hourglass_started): Remove.
8587
8588 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
8589
8590 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
8591 Update dependencies.
8592
8593 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
8594
8595 * xgselect.c (xg_select): Put maxfds+1 into a var.
8596 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
8597
8598 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
8599
8600 2012-05-10 Dave Abrahams <dave@boostpro.com>
8601
8602 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
8603 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
8604
8605 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
8606
8607 * dbusbind.c (xd_registered_buses): New internal Lisp object.
8608 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
8609 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
8610 Initialize xd_registered_buses.
8611
8612 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
8613
8614 Untag more efficiently if USE_LSB_TAG.
8615 This is based on a proposal by YAMAMOTO Mitsuharu in
8616 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
8617 For an admittedly artificial (nth 8000 longlist) benchmark on
8618 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
8619 Emacs's overall text size by 1%.
8620 * lisp.h (XUNTAG): New macro.
8621 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
8622 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
8623 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8624 * eval.c (Fautoload):
8625 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8626 * frame.h (XFRAME): Use XUNTAG.
8627
8628 Port recent dbusbind.c changes to 32-bit --with-wide-int.
8629 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8630 Remove unportable assumptions about print widths of types like
8631 dbus_uint32_t.
8632 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8633 intptr_t when converting between pointer and integer, to avoid GCC
8634 warnings about wrong width.
8635
8636 2012-05-09 Eli Zaretskii <eliz@gnu.org>
8637
8638 * w32proc.c (new_child): Force Windows to reserve only 64KB of
8639 stack for each reader_thread, instead of defaulting to 8MB
8640 determined by the linker. This avoids failures in creating
8641 subprocesses on Windows 7, see the discussion in this thread:
8642 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8643
8644 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
8645
8646 Fix up display of the *Minibuf-0* buffer in the mini window.
8647 * keyboard.c (read_char): Don't clear the echo area if there's no
8648 message to clear.
8649 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
8650 contents of *Minibuf-0*) if there's no message displayed in its stead.
8651
8652 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
8653
8654 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8655 batch mode.
8656
8657 2012-05-06 Chong Yidong <cyd@gnu.org>
8658
8659 * lisp.mk (lisp): Update.
8660
8661 2012-05-05 Jim Meyering <meyering@redhat.com>
8662
8663 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8664
8665 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
8666
8667 * data.c (PUT_ERROR): New macro.
8668 (syms_of_data): Use it. Add new error type `user-error'.
8669 * undo.c (user_error): New function.
8670 (Fprimitive_undo): Use it.
8671 * print.c (print_error_message): Adjust print style for `user-error'.
8672 * keyboard.c (user_error): New function.
8673 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8674
8675 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
8676
8677 Do not limit current-time-string to years 1000..9999.
8678 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8679 (Fcurrent_time_string): Support any year that is supported by the
8680 underlying localtime representation. Don't use asctime, as it
8681 has undefined behavior for years outside the range -999..9999.
8682
8683 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
8684
8685 Fix race conditions involving setenv, gmtime, localtime, asctime.
8686 Without this fix, interrupts could mess up code that uses these
8687 nonreentrant functions, since setting TZ invalidates existing
8688 tm_zone or tzname values, and since most of these functions return
8689 pointers to static storage.
8690 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8691 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8692 Grow the critical sections to include not just invoking
8693 localtime/gmtime, but also accessing these functions' results
8694 including their tm_zone values if any, and any related TZ setting.
8695 (format_time_string): Last arg is now struct tm *, not struct tm **,
8696 so that the struct tm is saved in the critical section.
8697 All callers changed. Simplify allocation of initial buffer, partly
8698 motivated by the fact that memory allocation needs to be outside
8699 the critical section.
8700
8701 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
8702
8703 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8704 with RESET_INTERVAL.
8705
8706 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8707 Remove duplicated buffer name initialization.
8708
8709 2012-05-02 Jim Meyering <jim@meyering.net>
8710
8711 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8712
8713 * xfns.c (x_window): Use xstrdup (Bug#11375).
8714
8715 2012-05-02 Eli Zaretskii <eliz@gnu.org>
8716
8717 * xdisp.c (pos_visible_p): If already at a newline from the
8718 display string before the 'while' loop, don't walk back the glyphs
8719 from it3.glyph_row. Solves assertion violation when the display
8720 string begins with a newline (egg.el). (Bug#11367)
8721
8722 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
8723
8724 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
8725 Move to simple.el.
8726
8727 2012-05-01 Glenn Morris <rgm@gnu.org>
8728
8729 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
8730 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
8731 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
8732 All were removed before 23.1.
8733
8734 * dispnew.c: Remove HAVE_LIBNCURSES test;
8735 it is always true on relevant platforms.
8736
8737 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
8738 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
8739
8740 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
8741
8742 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
8743
8744 * .gdbinit (xpr): Remove checks for no longer existing misc types.
8745 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8746 Remove.
8747
8748 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
8749
8750 Do not avoid creating empty evaporating overlays (Bug#9642).
8751 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8752 That is, do not delete an evaporating overlay if it becomes
8753 empty after its bounds are adjusted to fit within its buffer.
8754 This fix caused other problems, and I'm reverting it until we get
8755 to the bottom of them.
8756
8757 2012-04-27 Chong Yidong <cyd@gnu.org>
8758
8759 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8760
8761 2012-04-27 Eli Zaretskii <eliz@gnu.org>
8762
8763 * xdisp.c (pos_visible_p): If the window start position is beyond
8764 ZV, start the display from buffer beginning. Prevents assertion
8765 violation in init_iterator when the minibuffer window is scrolled
8766 via the scroll bar.
8767
8768 * window.c (window_scroll_pixel_based): Likewise.
8769
8770 2012-04-27 Chong Yidong <cyd@gnu.org>
8771
8772 * keymap.c (where_is_internal): Doc fix (Bug#10872).
8773
8774 2012-04-27 Glenn Morris <rgm@gnu.org>
8775
8776 * fileio.c (Fcopy_file, Fset_file_selinux_context):
8777 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
8778
8779 2012-04-27 Eli Zaretskii <eliz@gnu.org>
8780
8781 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8782 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
8783
8784 2012-04-26 Eli Zaretskii <eliz@gnu.org>
8785
8786 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8787 display element, check also the underlying string or buffer
8788 character. (Bug#11341)
8789
8790 * w32menu.c: Include w32heap.h.
8791 (add_menu_item): If the call to AppendMenuW (via
8792 unicode_append_menu) fails, disable Unicode menus only if we are
8793 running on Windows 9X/Me.
8794
8795 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8796
8797 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8798 (xgetint): Add missing shift for LSB tags.
8799
8800 2012-04-24 Martin Rudalics <rudalics@gmx.at>
8801
8802 * keyboard.c (read_char): Don't wipe echo area for select window
8803 events: These might get delayed via `mouse-autoselect-window'
8804 (Bug#11304).
8805
8806 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
8807
8808 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8809 manipulation of :loaded-from data.
8810
8811 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
8812
8813 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8814 now a cons (bug#11311).
8815
8816 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8817
8818 Do not create empty overlays with the evaporate property (Bug#9642).
8819 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8820 if it becomes empty after its bounds are adjusted to fit within
8821 its buffer. Without this fix, in a nonempty buffer (let ((o
8822 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8823 yields an empty overlay that has the evaporate property, which is
8824 not supposed to happen.
8825
8826 Fix minor GTK3 problems found by static checking.
8827 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8828 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8829 (struct _EmacsFixedClass, emacs_fixed_get_type):
8830 Move decls here from emacsgtkfixed.h, since they needn't be public.
8831 (emacs_fixed_get_type): Now static.
8832 (emacs_fixed_class_init): Omit unused local.
8833 (emacs_fixed_child_type): Remove; unused.
8834 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8835 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8836 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8837 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8838 (EMACS_FIXED_GET_CLASS): Remove; unused.
8839 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8840
8841 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8842 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8843
8844 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8845
8846 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
8847 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
8848 (__malloc_size_t, __malloc_ptrdiff_t):
8849 Remove. All uses removed, replaced by the definiens if needed,
8850 since we can assume C89 or better now.
8851 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8852 (protect_malloc_state, align, get_contiguous_space)
8853 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8854 (malloc_atfork_handler_child, malloc_enable_thread)
8855 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8856 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8857 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8858 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8859 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8860 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8861 Define using prototypes, not old style.
8862 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8863 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8864 (align): Don't assume that signed integer overflow wraps around.
8865 Omit unused local var.
8866 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8867 (_free_internal_nolock, memalign, mallochook, reallochook):
8868 Omit no-longer-needed casts.
8869 (valloc): Use getpagesize, not __getpagesize.
8870 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8871 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8872
8873 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8874
8875 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
8876
8877 Move functions from C to Lisp. Make non-blocking method calls
8878 the default. Implement further D-Bus standard interfaces.
8879
8880 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8881 (QCdbus_request_name_allow_replacement)
8882 (QCdbus_request_name_replace_existing)
8883 (QCdbus_request_name_do_not_queue)
8884 (QCdbus_request_name_reply_primary_owner)
8885 (QCdbus_request_name_reply_in_queue)
8886 (QCdbus_request_name_reply_exists)
8887 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8888 (QCdbus_registered_serial, QCdbus_registered_method)
8889 (QCdbus_registered_signal): New Lisp objects.
8890 (XD_DEBUG_MESSAGE): Use sizeof.
8891 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8892 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8893 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8894 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8895 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8896 (xd_signature, xd_append_arg): Allow float for integer types.
8897 (xd_get_connection_references): New function.
8898 (xd_get_connection_address): Rename from xd_initialize.
8899 Return cached address.
8900 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8901 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8902 level.
8903 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
8904 Return number of refcounts.
8905 (Fdbus_get_unique_name): Make stronger parameter check.
8906 (Fdbus_message_internal): New defun.
8907 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8908 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8909 (Fdbus_send_signal, Fdbus_register_service)
8910 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8911 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8912 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8913 (Vdbus_compiled_version, Vdbus_runtime_version)
8914 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8915 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8916 (Vdbus_message_type_signal): New defvars.
8917 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8918 Adapt docstring.
8919
8920 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8921
8922 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8923 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8924 Do not assume ptrdiff_t is the same width as 'int'.
8925
8926 * alloc.c: Handle unusual debugging option combinations.
8927 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8928 since the two debugging options are incompatible.
8929 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8930 is defined.
8931 (mem_init, mem_insert, mem_insert_fixup):
8932 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8933 (NEED_MEM_INSERT): Remove; no longer needed.
8934
8935 2012-04-22 Leo Liu <sdl.web@gmail.com>
8936
8937 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8938
8939 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8940
8941 * sysdep.c [__FreeBSD__]: Minor cleanups.
8942 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8943 Use Emacs indenting style more consistently. Avoid some casts.
8944 Use 'double' consistently rather than mixing 'float' and 'double'.
8945
8946 2012-04-21 Eduard Wiebe <usenet@pusto.de>
8947
8948 * sysdep.c (list_system_processes, system_process_attributes):
8949 Add implementation for FreeBSD (Bug#5243).
8950
8951 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8952
8953 * lisp.mk (lisp): Update.
8954
8955 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8956
8957 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8958 It is never used otherwise.
8959
8960 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8961
8962 * print.c (print_preprocess): Only check print_depth if print-circle
8963 is nil.
8964 (print_object): Check for cycles even when print-circle is nil and
8965 print-gensym is t, but only check print_depth if print-circle is nil.
8966
8967 2012-04-20 Chong Yidong <cyd@gnu.org>
8968
8969 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8970 set the status to "failed" and ensure that sentinel is run.
8971
8972 2012-04-20 Glenn Morris <rgm@gnu.org>
8973
8974 * process.c (Fset_process_inherit_coding_system_flag)
8975 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
8976 (Fmake_network_process, Fmake_serial_process): Doc fix.
8977
8978 2012-04-20 Eli Zaretskii <eliz@gnu.org>
8979
8980 * xdisp.c (string_buffer_position_lim): Limit starting position to
8981 BEGV.
8982 (set_cursor_from_row): If called for a mode-line or header-line
8983 row, return zero immediately.
8984 (try_cursor_movement): If inside continuation line, don't back up
8985 farther than the first row after the header line, if any.
8986 Don't consider the header-line row as "partially visible", even if
8987 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8988
8989 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8990
8991 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8992 (bug#11238).
8993
8994 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
8995 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
8996
8997 configure: new option --enable-gcc-warnings (Bug#11207)
8998 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8999 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9000 (ALL_CFLAGS): Use new macros rather than old.
9001 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9002 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9003 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9004 -Wunused-result, -Wunused-variable. This should go away once
9005 the Emacs and Gnulib regex code is merged.
9006 (xmalloc, xrealloc): Now static.
9007
9008 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9009
9010 * dired.c (Fsystem_groups): Remove unused local.
9011
9012 2012-04-17 Glenn Morris <rgm@gnu.org>
9013
9014 * dired.c (Fsystem_users): Doc fix.
9015
9016 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9017
9018 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9019 (syms_of_dired): Add them.
9020
9021 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9022
9023 Fix minor alloc.c problems found by static checking.
9024 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9025 New extern decls, to avoid calling undeclared functions.
9026 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9027 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9028 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9029 (NEED_MEM_INSERT): New macro.
9030 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
9031 Remove one incorrect comment and fix another.
9032
9033 Fix minor ralloc.c problems found by static checking.
9034 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9035 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9036 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9037 (r_alloc_sbrk): Now static.
9038
9039 Improve ralloc.c interface checking.
9040 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9041 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9042 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9043 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9044 [REL_ALLOC]: ... to here, to check interface.
9045 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9046 Remove decls. This fixes an "It stinks!".
9047
9048 * alloc.c (which_symbols): Fix alignment issue / type clash.
9049
9050 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9051
9052 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9053 (struct Lisp_Misc_Any): Likewise.
9054 (struct Lisp_Free): Likewise.
9055 * alloc.c (union aligned_Lisp_Symbol): Define.
9056 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9057 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9058 (union aligned_Lisp_Misc): Define.
9059 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9060 aligned_Lisp_Misc instead of union Lisp_Misc.
9061 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
9062
9063 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9064
9065 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9066 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9067 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9068 * s/netbsd.h, s/sol2-6.h:
9069 Remove definition of GC_MARK_STACK, since the default now works.
9070 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9071 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9072 no longer the default.
9073 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9074
9075 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9076
9077 * lread.c (lisp_file_lexically_bound_p):
9078 Fix hang at ";-*-\n" (bug#11238).
9079
9080 2012-04-14 Eli Zaretskii <eliz@gnu.org>
9081
9082 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9083 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9084
9085 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9086
9087 * nsterm.m (constrainFrameRect): Always constrain when there is only
9088 one screen (Bug#10962).
9089
9090 2012-04-13 Ken Brown <kbrown@cornell.edu>
9091
9092 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9093
9094 2012-04-13 Reuben Thomas <rrt@sc3d.org>
9095
9096 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9097
9098 2012-04-11 Daniel Colascione <dancol@dancol.org>
9099
9100 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9101 against is gone. It's better to use vfork now so that when Cygwin
9102 gains a new, working vfork, we use it automatically (bug#10398).
9103
9104 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9105
9106 * window.c (save_window_save): Obey window-point-insertion-type.
9107
9108 2012-04-11 Glenn Morris <rgm@gnu.org>
9109
9110 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9111
9112 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9113
9114 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9115
9116 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
9117
9118 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9119 (force_quit_count): New var.
9120 (handle_interrupt): Use it.
9121
9122 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
9123
9124 * w32.c (w32_delayed_load): Record the full path of the library
9125 being loaded (bug#10424).
9126
9127 2012-04-09 Glenn Morris <rgm@gnu.org>
9128
9129 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9130 not just in the obarray, before snarfing them. (Bug#11036)
9131
9132 * Makefile.in ($(leimdir)/leim-list.el):
9133 Pass EMACS rather than BUILT_EMACS.
9134
9135 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9136
9137 * process.c (make_process):
9138 * process.h: Add integer `gnutls_handshakes_tried' member to
9139 process struct.
9140
9141 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9142 Add convenience `GNUTLS_LOG2i' macro.
9143
9144 * gnutls.c (gnutls_log_function2i): Convenience log function.
9145 (emacs_gnutls_read): Use new log functions,
9146 `gnutls_handshakes_tried' process member, and
9147 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9148 attempts per process (connection).
9149
9150 2012-04-09 Chong Yidong <cyd@gnu.org>
9151
9152 * eval.c (Fuser_variable_p, user_variable_p_eh)
9153 (lisp_indirect_variable): Functions deleted.
9154 (Fdefvar): Caller changed.
9155
9156 * callint.c (Finteractive, Fcall_interactively):
9157 * minibuf.c (Fread_variable): Callers changed.
9158
9159 2012-04-09 Eli Zaretskii <eliz@gnu.org>
9160
9161 * xdisp.c (set_cursor_from_row): If the display string appears in
9162 the buffer at position that is closer to point than the position
9163 after the display string, display the cursor on the first glyph of
9164 the display string. Fixes cursor display when a 'display' text
9165 property immediately follows invisible text. (Bug#11094)
9166
9167 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9168
9169 composite.c: use 'double' consistently
9170 * composite.c (get_composition_id): Use 'double' consistently
9171 instead of converting 'float' to 'double' and vice versa; this is
9172 easier to understand and avoids a GCC warning.
9173
9174 2012-04-09 Glenn Morris <rgm@gnu.org>
9175
9176 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9177 preparation for dumping it with emacs. (Bug#4789)
9178 (leimdir): New variable.
9179 ($(leimdir)/leim-list.el): New rule.
9180 (emacs$(EXEEXT)): Depend on leim-list.el.
9181
9182 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9183 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9184 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9185
9186 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9187
9188 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9189 proper alignment.
9190
9191 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
9192
9193 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9194 Remove unused local variable.
9195
9196 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9197
9198 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9199 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9200 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9201 objects, as mark_maybe_pointer will catch them otherwise.
9202 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9203 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9204
9205 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9206
9207 Fix typo that broke non-Windows builds.
9208 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9209
9210 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9211
9212 Support building on MS-Windows with libxml2.
9213
9214 * makefile.w32-in (OBJ2): Add xml.$(O).
9215 (GLOBAL_SOURCES): Add xml.c.
9216 ($(BLD)/xml.$(O)): New dependency list.
9217
9218 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
9219 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
9220 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
9221 [!WINDOWSNT]: New macros.
9222 (init_libxml2_functions, libxml2_loaded_p): New functions.
9223 (parse_region): Call fn_xmlCheckVersion instead of using the macro
9224 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
9225 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
9226 Calls xmlCleanupParser only if libxml2 was loaded (or statically
9227 linked in).
9228 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
9229 Call init_libxml2_functions before calling libxml2 functions.
9230 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
9231
9232 * emacs.c: Don't include libxml/parser.h.
9233 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
9234 xmlCleanupParser directly.
9235
9236 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
9237
9238 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9239
9240 * indent.c (Fvertical_motion): If there is a display string at
9241 point, use it.vpos to compute how many lines to backtrack after
9242 move_it_to point. (Bug#11133)
9243
9244 2012-04-06 Eli Zaretskii <eliz@gnu.org>
9245
9246 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
9247 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
9248 about subtle differences between FETCH_CHAR* and STRING_CHAR*
9249 macros related to unification of CJK characters. For the details,
9250 see the discussion following the message here:
9251 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
9252
9253 2012-04-04 Chong Yidong <cyd@gnu.org>
9254
9255 * keyboard.c (Vdelayed_warnings_list): Doc fix.
9256
9257 2012-04-01 Eli Zaretskii <eliz@gnu.org>
9258
9259 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
9260 instead of alloca. (Bug#11138)
9261
9262 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
9263
9264 * w32menu.c (is_simple_dialog): Properly check lisp types.
9265 (Bug#11141)
9266
9267 2012-03-31 Eli Zaretskii <eliz@gnu.org>
9268
9269 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
9270 position we get to after a call to move_it_to fails the
9271 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
9272 only if we wind up in a string from display property. (Bug#11063)
9273
9274 * window.c (Fdelete_other_windows_internal): Invalidate the row
9275 and column information about mouse highlight, so that redisplay
9276 restores it after reallocating the glyph matrices. (Bug#7464)
9277
9278 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
9279 string comes from a `display' text property, use the buffer
9280 position of that property as if we actually saw that position in
9281 the row's glyphs.
9282 (move_it_by_lines): Remove the assertion that
9283 "it->current_x == 0 && it->hpos == 0" which can be legitimately
9284 violated when there's a before-string at the beginning of a line.
9285 (Bug#11063)
9286
9287 2012-03-30 Eli Zaretskii <eliz@gnu.org>
9288
9289 * xdisp.c (append_space_for_newline): If the default face was
9290 remapped, use the remapped face for the appended newline.
9291 (extend_face_to_end_of_line): Use the remapped default face for
9292 extending the face to the end of the line.
9293 (display_line): Call extend_face_to_end_of_line when the default
9294 face was remapped. (Bug#11068)
9295
9296 2012-03-29 Eli Zaretskii <eliz@gnu.org>
9297
9298 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
9299
9300 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9301
9302 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
9303
9304 2012-03-27 Glenn Morris <rgm@gnu.org>
9305
9306 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
9307 Doc fixes.
9308
9309 2012-03-26 Kenichi Handa <handa@m17n.org>
9310
9311 * dispextern.h (struct glyph): Fix previous change. Change the
9312 bit length of glyphless.ch to 25 (Bug#11082).
9313
9314 2012-03-26 Chong Yidong <cyd@gnu.org>
9315
9316 * keyboard.c (Vselection_inhibit_update_commands): New variable.
9317 (command_loop_1): Use it; inhibit selection update for
9318 handle-select-window too (Bug#8996).
9319
9320 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
9321
9322 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
9323
9324 2012-03-25 Kenichi Handa <handa@m17n.org>
9325
9326 * dispextern.h (struct glyph): Change the bit length of
9327 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
9328
9329 2012-03-24 Eli Zaretskii <eliz@gnu.org>
9330
9331 * s/ms-w32.h (tzname): Include time.h before redirecting to
9332 _tzname. Fixes the MSVC build. (Bug#9960)
9333
9334 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
9335
9336 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
9337 characters.
9338
9339 * xterm.c (XTread_socket): Only modify handling_signal if
9340 !SYNC_INPUT. (Bug#11080)
9341
9342 2012-03-23 Eli Zaretskii <eliz@gnu.org>
9343
9344 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
9345 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
9346 when fetching a multibyte character consumes more bytes than
9347 CHAR_BYTES returns, due to unification of CJK characters in
9348 string_char. (Bug#11073)
9349
9350 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
9351
9352 * process.c (wait_reading_process_output): Handle pty disconnect
9353 by refraining from sending oneself a SIGCHLD (bug#10933).
9354
9355 2012-03-22 Chong Yidong <cyd@gnu.org>
9356
9357 * dispextern.h (struct it): New member string_from_prefix_prop_p.
9358
9359 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9360 Mark string as coming from a prefix property.
9361 (handle_face_prop): Use default face for prefix strings (Bug#4281).
9362 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
9363
9364 2012-03-21 Chong Yidong <cyd@gnu.org>
9365
9366 * xfaces.c (Vface_remapping_alist): Doc fix.
9367
9368 2012-03-20 Eli Zaretskii <eliz@gnu.org>
9369
9370 * w32proc.c (Fw32_set_console_codepage)
9371 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
9372 Doc fixes.
9373
9374 2012-03-20 Chong Yidong <cyd@gnu.org>
9375
9376 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
9377 to reflect default non-nil value of redisplay-dont-pause.
9378
9379 2012-03-19 Kenichi Handa <handa@m17n.org>
9380
9381 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
9382 it fit in a valid range (Bug#11003).
9383
9384 2012-03-18 Eli Zaretskii <eliz@gnu.org>
9385
9386 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
9387 that is not from display property, accept the row as a "cursor
9388 row" if one of the string's character has a non-nil `cursor'
9389 property. Fixes cursor positioning when there are newlines in
9390 overlay strings, e.g. in icomplete.el. (Bug#11035)
9391
9392 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
9393
9394 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
9395
9396 2012-03-12 Chong Yidong <cyd@gnu.org>
9397
9398 * eval.c (inhibit_lisp_code): Rename from
9399 inhibit_window_configuration_change_hook; move from window.c.
9400
9401 * xfns.c (unwind_create_frame_1, Fx_create_frame):
9402 * window.c (run_window_configuration_change_hook)
9403 (syms_of_window): Callers changed.
9404
9405 2012-03-11 Chong Yidong <cyd@gnu.org>
9406
9407 * keymap.c (Fkey_description): Doc fix (Bug#9700).
9408
9409 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
9410
9411 2012-03-10 Chong Yidong <cyd@gnu.org>
9412
9413 * frame.c (other_visible_frames): Don't assume the selected frame
9414 is visible (Bug#10955).
9415
9416 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
9417
9418 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9419
9420 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
9421
9422 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9423 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
9424 zero (Bug#10954).
9425
9426 2012-03-03 Glenn Morris <rgm@gnu.org>
9427
9428 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
9429
9430 2012-03-02 Eli Zaretskii <eliz@gnu.org>
9431
9432 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
9433 position past the first glyph_row that ends at ZV. (Bug#10902)
9434 (redisplay_window, next_element_from_string): Fix typos in
9435 comments.
9436 (redisplay_window): Pass to move_it_vertically the margin in
9437 pixels, not in screen lines.
9438
9439 2012-03-02 Glenn Morris <rgm@gnu.org>
9440
9441 * buffer.c (buffer-list-update-hook): Doc fix.
9442
9443 2012-02-29 Eli Zaretskii <eliz@gnu.org>
9444
9445 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9446 push_it before setting up the iterator for the first overlay
9447 string, even if we have an empty string loaded.
9448 (next_overlay_string): If there's an empty string on the iterator
9449 stack, pop the stack. (Bug#10903)
9450
9451 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
9452
9453 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9454 Suggested by Stefan Monnier in
9455 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9456 * alloc.c (widen_to_Lisp_Object): New static function.
9457 (mark_memory): Also mark Lisp_Objects by fetching pointer words
9458 and widening them to Lisp_Objects. This would work even if
9459 USE_LSB_TAG is defined and wide integers are used, which might
9460 happen in a future version of Emacs.
9461
9462 2012-02-25 Chong Yidong <cyd@gnu.org>
9463
9464 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9465 Doc fix.
9466
9467 * xselect.c (Fx_selection_exists_p): Doc fix.
9468 (x_clipboard_manager_save_all): Print an informative message
9469 before saving to clipboard manager.
9470
9471 2012-02-24 Chong Yidong <cyd@gnu.org>
9472
9473 * keyboard.c (process_special_events): Handle all X selection
9474 requests in kbd_buffer, not just the next one (Bug#8869).
9475
9476 2012-02-23 Chong Yidong <cyd@gnu.org>
9477
9478 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9479 call when setting menu-bar-lines and tool-bar-lines parameters.
9480 (unwind_create_frame_1): New helper function.
9481
9482 * window.c (inhibit_window_configuration_change_hook): New var.
9483 (run_window_configuration_change_hook): Obey it.
9484 (syms_of_window): Initialize it.
9485
9486 2012-02-22 Chong Yidong <cyd@gnu.org>
9487
9488 * xterm.c (x_draw_image_relief): Add missing type check for
9489 Vtool_bar_button_margin (Bug#10743).
9490
9491 2012-02-21 Chong Yidong <cyd@gnu.org>
9492
9493 * fileio.c (Vfile_name_handler_alist): Doc fix.
9494
9495 * buffer.c (Fget_file_buffer): Protect against invalid file
9496 handler return value.
9497
9498 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
9499
9500 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9501 when computing $valmask.
9502
9503 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9504 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9505 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9506 It's useless in that case, and it can cause problems on hosts
9507 that allocate halves of EMACS_INT values separately.
9508 Reported by Dan Horák. Diagnosed by Andreas Schwab in
9509 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9510 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9511 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
9512 it avoids undefined behavior on hosts where shifting right by more
9513 than the word width has undefined behavior.
9514
9515 2012-02-19 Chong Yidong <cyd@gnu.org>
9516
9517 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9518 (Funhandled_file_name_directory, Ffile_name_as_directory)
9519 (Fdirectory_file_name, Fexpand_file_name)
9520 (Fsubstitute_in_file_name): Protect against invalid file handler
9521 return values (Bug#10845).
9522
9523 2012-02-18 Eli Zaretskii <eliz@gnu.org>
9524
9525 * .gdbinit (pitx): Fix incorrect references to fields of the
9526 iterator stack.
9527
9528 2012-02-17 Chong Yidong <cyd@gnu.org>
9529
9530 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9531
9532 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9533
9534 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9535 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9536
9537 2012-02-15 Chong Yidong <cyd@gnu.org>
9538
9539 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9540 marked as special. Also, starting docstrings with * is obsolete.
9541
9542 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
9543
9544 * gnutls.c (emacs_gnutls_write): Fix last change.
9545
9546 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
9547
9548 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9549 send_process.
9550
9551 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
9552
9553 * keymap.c (Fsingle_key_description): Handle char ranges.
9554
9555 2012-02-12 Chong Yidong <cyd@gnu.org>
9556
9557 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9558 as that creates a dangerous corner case.
9559
9560 * window.c (Fdelete_window_internal): Invalidate the mouse
9561 highlight (Bug#9904).
9562
9563 2012-02-12 Glenn Morris <rgm@gnu.org>
9564
9565 * xselect.c (Fx_own_selection_internal)
9566 (Fx_get_selection_internal, Fx_disown_selection_internal)
9567 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
9568 * nsselect.m (Fx_own_selection_internal)
9569 (Fx_disown_selection_internal, Fx_selection_exists_p)
9570 (Fx_selection_owner_p, Fx_get_selection_internal):
9571 Sync docs and argument specs with the xselect.c versions.
9572
9573 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
9574
9575 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
9576
9577 2012-02-11 Eli Zaretskii <eliz@gnu.org>
9578
9579 * w32select.c (Fx_selection_exists_p): Sync doc string and
9580 argument list with xselect.c. (Bug#10783)
9581
9582 * w16select.c (Fx_selection_exists_p): Sync doc string and
9583 argument list with xselect.c. (Bug#10783)
9584
9585 2012-02-10 Glenn Morris <rgm@gnu.org>
9586
9587 * fns.c (Fsecure_hash): Doc fix.
9588
9589 2012-02-09 Kenichi Handa <handa@m17n.org>
9590
9591 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
9592
9593 2012-02-07 Chong Yidong <cyd@gnu.org>
9594
9595 * buffer.c (Fbuffer_local_variables)
9596 (buffer_lisp_local_variables): Handle unbound vars correctly;
9597 don't let Qunbound leak into Lisp.
9598
9599 2012-02-07 Glenn Morris <rgm@gnu.org>
9600
9601 * image.c (Fimagemagick_types): Doc fix.
9602
9603 * image.c (imagemagick-render-type): Change it from a lisp object
9604 to an integer. Move the doc here from the lisp manual.
9605 Treat all values not equal to 0 the same.
9606
9607 2012-02-06 Chong Yidong <cyd@gnu.org>
9608
9609 * doc.c (store_function_docstring): Avoid applying docstring of
9610 alias to base function (Bug#2603).
9611
9612 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
9613
9614 * .gdbinit (pp1, pv1): Remove redundant defines.
9615 (pr): Use pp.
9616
9617 2012-02-04 Chong Yidong <cyd@gnu.org>
9618
9619 * nsterm.m: Declare a global (Bug#10694).
9620
9621 2012-02-04 Eli Zaretskii <eliz@gnu.org>
9622
9623 * w32.c (get_emacs_configuration_options):
9624 Include --enable-checking, if specified, in the return value.
9625
9626 2012-02-04 Martin Rudalics <rudalics@gmx.at>
9627
9628 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9629 after rounding frame sizes. (Bug#9723)
9630
9631 2012-02-04 Eli Zaretskii <eliz@gnu.org>
9632
9633 * keyboard.c (adjust_point_for_property): Don't position point
9634 before BEGV. (Bug#10696)
9635
9636 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
9637
9638 Handle overflow when computing char display width (Bug#9496).
9639 * character.c (char_width): Return EMACS_INT, not int.
9640 (char_width, c_string_width): Check for overflow when
9641 computing the width; this is possible now that individual
9642 characters can have unbounded width. Problem introduced
9643 by merge from Emacs 23 on 2012-01-19.
9644
9645 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
9646
9647 * dbusbind.c (Fdbus_register_method): Mention the return value
9648 :ignore in the docstring.
9649
9650 2012-02-02 Glenn Morris <rgm@gnu.org>
9651
9652 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9653
9654 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9655 Unconditionally set to t. (Bug#10673)
9656 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9657 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9658 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9659
9660 2012-02-02 Kenichi Handa <handa@m17n.org>
9661
9662 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
9663 0, do not call append_composite_glyph.
9664
9665 2012-02-02 Kenichi Handa <handa@m17n.org>
9666
9667 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9668 NULL (Bug#6988).
9669 (x_produce_glyphs): If the component of a composition is a null
9670 string, set it->pixel_width to 1 to avoid zero-width glyph.
9671
9672 2012-02-01 Eli Zaretskii <eliz@gnu.org>
9673
9674 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9675 first 2 arguments are identical. This makes inserting large
9676 output from a subprocess an order of magnitude faster on
9677 MS-Windows, where all sbrk'ed memory is always contiguous.
9678
9679 2012-01-31 Glenn Morris <rgm@gnu.org>
9680
9681 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9682 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9683 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9684
9685 2012-01-29 Glenn Morris <rgm@gnu.org>
9686
9687 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9688
9689 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
9690
9691 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9692
9693 2012-01-28 Chong Yidong <cyd@gnu.org>
9694
9695 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9696
9697 2012-01-26 Chong Yidong <cyd@gnu.org>
9698
9699 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9700
9701 * search.c (Fsearch_forward, Fsearch_backward): Document negative
9702 repeat counts (Bug#10507).
9703
9704 2012-01-26 Glenn Morris <rgm@gnu.org>
9705
9706 * lread.c (syms_of_lread): Doc fix.
9707
9708 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
9709
9710 * coding.c (encode_designation_at_bol): Change return value to
9711 EMACS_INT.
9712
9713 2012-01-25 Chong Yidong <cyd@gnu.org>
9714
9715 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
9716
9717 2012-01-21 Chong Yidong <cyd@gnu.org>
9718
9719 * floatfns.c (Fcopysign): Make the second argument non-optional,
9720 since nil is not allowed anyway.
9721
9722 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
9723
9724 * process.c (read_process_output): Use p instead of XPROCESS (proc).
9725 (send_process): Likewise.
9726
9727 2012-01-19 Martin Rudalics <rudalics@gmx.at>
9728
9729 * window.c (save_window_save, Fcurrent_window_configuration)
9730 (Vwindow_persistent_parameters): Do not use Qstate.
9731 Rewrite doc-strings.
9732
9733 2012-01-19 Kenichi Handa <handa@m17n.org>
9734
9735 * character.c (char_width): New function.
9736 (Fchar_width, c_string_width, lisp_string_width):
9737 Use char_width (Bug#9496).
9738
9739 2012-01-16 Martin Rudalics <rudalics@gmx.at>
9740
9741 * window.c (Vwindow_persistent_parameters): New variable.
9742 (Fset_window_configuration, save_window_save): Handle persistent
9743 window parameters.
9744
9745 2012-01-14 Eli Zaretskii <eliz@gnu.org>
9746
9747 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9748 thrashing the stack of the thread. (Bug#9087)
9749
9750 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
9751
9752 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9753
9754 2012-01-11 Eli Zaretskii <eliz@gnu.org>
9755
9756 * xdisp.c (rows_from_pos_range): Handle the case where the
9757 highlight ends on a newline. (Bug#10464)
9758 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9759 he end column for display of highlight that ends on a newline
9760 before a R2L line.
9761
9762 2012-01-11 Glenn Morris <rgm@gnu.org>
9763
9764 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9765 from load-path also when installation-directory is nil. (Bug#10208)
9766
9767 2012-01-10 Glenn Morris <rgm@gnu.org>
9768
9769 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9770
9771 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9772 Update template values to be closer to their typical values these days.
9773
9774 2012-01-09 Eli Zaretskii <eliz@gnu.org>
9775
9776 * xdisp.c (rows_from_pos_range): Accept additional argument
9777 DISP_STRING, and accept any glyph in a row whose object is that
9778 string as eligible for mouse highlight. Fixes mouse highlight of
9779 display strings from overlays. (Bug#10464)
9780
9781 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
9782
9783 emacs: fix an auto-save permissions race condition (Bug#10400)
9784 * fileio.c (auto_saving_dir_umask): New static var.
9785 (Fmake_directory_internal): Use it.
9786 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9787 creating the directory. The old code temporarily assigns
9788 too-generous permissions to the directory.
9789 (do_auto_save_eh): Clear it.
9790 (Fdo_auto_save): Catch all errors, not just file errors, so
9791 that the var is always cleared.
9792
9793 2012-01-07 Eli Zaretskii <eliz@gnu.org>
9794
9795 * search.c (scan_buffer): Pass character positions to
9796 know_region_cache, not byte positions. (Bug#6540)
9797
9798 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
9799
9800 * w32.c (sys_rename): Report EXDEV when rename of a directory
9801 fails because the target is on another logical disk. (Bug#10284)
9802
9803 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9804
9805 * xterm.c (x_embed_request_focus): New function.
9806
9807 * xterm.h: Add prototype.
9808
9809 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9810
9811 2012-01-05 Glenn Morris <rgm@gnu.org>
9812
9813 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9814
9815 2012-01-01 Eli Zaretskii <eliz@gnu.org>
9816
9817 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9818 Load gnutls_transport_set_lowat only if GnuTLS version is below
9819 2.11.1.
9820 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9821 GnuTLS versions below 2.11.1.
9822
9823 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9824
9825 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9826 to the doc string advising against its use for altering the way
9827 windows are scrolled.
9828
9829 2011-12-28 Kenichi Handa <handa@m17n.org>
9830
9831 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9832 coding-system ASCII compatible only when it does not produce BOM
9833 on encoding (Bug#10383).
9834
9835 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9836
9837 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9838 can scroll.
9839 (create_and_show_popup_menu): Always use menu_position_func for
9840 Gtk3 (Bug#10361).
9841
9842 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9843
9844 * callint.c (Fcall_interactively): Don't truncate prompt string.
9845
9846 2011-12-23 Eli Zaretskii <eliz@gnu.org>
9847
9848 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9849 property that ends at ZV, so that the bidi iteration could be
9850 resumed from there (after widening). (Bug#10360)
9851
9852 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9853
9854 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9855
9856 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9857
9858 * nsterm.m (x_free_frame_resources):
9859 Release f->output_data.ns->miniimage.
9860 (ns_index_color): Fix indentation. Do not retain
9861 color_table->colors[i].
9862
9863 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9864 before returning.
9865
9866 * nsfns.m (x_set_background_color): Assign return value from
9867 ns_index_color to face-background instead of NSColor*.
9868 (ns_implicitly_set_icon_type): Fix indentation.
9869 Change assignment in for loop to comparison.
9870
9871 * emacs.c (ns_pool): New variable.
9872 (main): Assign ns_pool.
9873 (Fkill_emacs): Call ns_release_autorelease_pool.
9874
9875 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9876 autorelease fdesc, release fdAttrs and tdict.
9877 (ns_get_covering_families): Release charset.
9878 (ns_findfonts): Release NSFontDescriptor created with new.
9879 (ns_uni_to_glyphs): Fix indentation.
9880 (setString): Release attrStr before assigning new value.
9881
9882 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9883
9884 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9885 and NS_IMPL_COCOA.
9886 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9887 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9888
9889 2011-12-18 David Reitter <reitter@cmu.edu>
9890
9891 * nsterm.m (ns_term_init): Subscribe for notifications
9892 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9893 to method trackingNotification in EmacsMenu.
9894
9895 * nsmenu.m (trackingMenu): New variable.
9896 (trackingNotification): New method (from Aquamacs).
9897 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
9898 from Aquamacs (Bug#7030).
9899
9900 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9901
9902 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9903 (symbol_to_nsstring): Fix indentation.
9904 (ns_symbol_to_pb): New function.
9905 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9906 (Fns_rotate_cut_buffers_internal): Remove.
9907 (Fns_store_selection_internal): Rename from
9908 Fns_store_cut_buffer_internal.
9909 (ns_get_foreign_selection, Fx_own_selection_internal)
9910 (Fx_disown_selection_internal, Fx_selection_exists_p)
9911 (Fns_get_selection_internal, Fns_store_selection_internal):
9912 Use ns_symbol_to_pb and check if return value is nil.
9913 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9914 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
9915 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9916 renamed to Sns_store_selection_internal.
9917 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9918 and remove this function.
9919 (ns_handle_selection_clear): Remove, never used.
9920 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9921 here.
9922
9923 2011-12-17 Ken Brown <kbrown@cornell.edu>
9924
9925 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9926 GID is unknown (Bug#10257).
9927
9928 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9929
9930 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9931 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9932 which caused a build failure on GNU/Linux IA-64. This problem was
9933 introduced by my 2011-10-07 patch.
9934
9935 2011-12-15 Juri Linkov <juri@jurta.org>
9936
9937 * image.c (imagemagick_error): New function. (Bug#10112)
9938 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9939 Use `imagemagick_error' where ImageMagick functions return
9940 `MagickFalse'.
9941 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9942 proper order.
9943
9944 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9945
9946 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9947 fill background (Bug#8992).
9948
9949 2011-12-13 Martin Rudalics <rudalics@gmx.at>
9950
9951 * window.c (Vwindow_combination_resize)
9952 (Vwindow_combination_limit): Use t instead of non-nil in
9953 doc-strings.
9954 (Vrecenter_redisplay): Add first sentence of doc-string on
9955 separate line.
9956 (Frecenter): Fix doc-string typo.
9957
9958 2011-12-11 Kenichi Handa <handa@m17n.org>
9959
9960 * coding.c (Funencodable_char_position): Pay attention to the
9961 buffer text relocation (Bug#9389).
9962
9963 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9964
9965 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9966 gtk_init (Bug#10100).
9967
9968 2011-12-10 Eli Zaretskii <eliz@gnu.org>
9969
9970 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9971 IT->string is nil. (Bug#10263)
9972
9973 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9974
9975 * nsterm.h (x_free_frame_resources): Declare.
9976
9977 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9978 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9979
9980 * nsterm.h (ns_get_defaults_value): Declare.
9981
9982 * nsterm.m (ns_default): Call ns_get_defaults_value.
9983
9984 2011-12-09 Eli Zaretskii <eliz@gnu.org>
9985
9986 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9987 (Bug#10170)
9988
9989 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9990
9991 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9992 that where the value of an _OBJC_* symbol points to is in the .bss
9993 section (Bug#10240).
9994
9995 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9996
9997 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
9998 after the loop to call ccl_driver at least once (Bug#8619).
9999
10000 2011-12-08 Kenichi Handa <handa@m17n.org>
10001
10002 * ftfont.c (get_adstyle_property): Fix previous change
10003 (Bug#10233).
10004
10005 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
10006
10007 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10008 dirs from the default value of EMACSLOADPATH (bug#10208).
10009
10010 2011-12-07 Glenn Morris <rgm@gnu.org>
10011
10012 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10013 installation and source directories as well. (Bug#10208)
10014
10015 2011-12-06 Chong Yidong <cyd@gnu.org>
10016
10017 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10018
10019 2011-12-06 Glenn Morris <rgm@gnu.org>
10020
10021 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10022 as an error, not just -1. (Bug#10217)
10023
10024 2011-12-05 Chong Yidong <cyd@gnu.org>
10025
10026 * keyboard.c (process_special_events): New function.
10027 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10028
10029 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10030
10031 * coding.c (encode_designation_at_bol): Don't use uninitialized
10032 local variable (Bug#9318).
10033
10034 2011-12-05 Kenichi Handa <handa@m17n.org>
10035
10036 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10037 return Qnil (Bug#8046, Bug#10193).
10038
10039 2011-12-05 Kenichi Handa <handa@m17n.org>
10040
10041 * coding.c (encode_designation_at_bol): New args charbuf_end and
10042 dst. Return the number of produced bytes. Callers changed.
10043 (coding_set_source): Return how many bytes coding->source was
10044 relocated.
10045 (coding_set_destination): Return how many bytes
10046 coding->destination was relocated.
10047 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
10048 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
10049
10050 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10051
10052 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10053 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10054 macro (Bug#9318).
10055
10056 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10057
10058 The following changes are to fix Bug#9318.
10059
10060 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
10061 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10062 (encode_coding_iso_2022, encode_coding_sjis)
10063 (encode_coding_big5, encode_coding_charset): Use the above macros.
10064
10065 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
10066
10067 * lisp.h (process_quit_flag): Fix external declaration.
10068
10069 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10070
10071 Don't macro-inline non-performance-critical code.
10072 * eval.c (process_quit_flag): New function.
10073 * lisp.h (QUIT): Use it.
10074
10075 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10076
10077 * nsfns.m (get_geometry_from_preferences): New function.
10078 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10079
10080 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10081
10082 * emacs.c (Qkill_emacs): Define.
10083 (syms_of_emacs): Initialize it.
10084 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10085 Qquit_flag to `kill-emacs' instead.
10086 (quit_throw_to_read_char): Add parameter `from_signal'.
10087 All callers changed. Call Fkill_emacs if requested and safe.
10088 * lisp.h (QUIT): Call Fkill_emacs if requested.
10089
10090 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10091
10092 * widget.c (update_wm_hints): Return if wmshell is null.
10093 (widget_update_wm_size_hints): New function.
10094
10095 * widget.h (widget_update_wm_size_hints): Declare.
10096
10097 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10098 widget_update_wm_size_hints (Bug#10104).
10099
10100 2011-12-03 Eli Zaretskii <eliz@gnu.org>
10101
10102 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10103 before a newline, prepare the bidi iterator for consuming the
10104 newline, and keep the current paragraph direction. (Bug#10183)
10105 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
10106
10107 2011-12-02 Juri Linkov <juri@jurta.org>
10108
10109 * search.c (Fword_search_regexp): New Lisp function created from
10110 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10111 (Fword_search_backward, Fword_search_forward)
10112 (Fword_search_backward_lax, Fword_search_forward_lax):
10113 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10114 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10115
10116 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10117
10118 * fileio.c (Finsert_file_contents): Move after-change-function call
10119 to before the "handled:" label, since all "goto handled" appear in
10120 cases where the *-change-functions have already been properly called
10121 (bug#10117).
10122
10123 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10124
10125 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10126 waiting for input. (Bug#10169)
10127
10128 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10129
10130 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10131 verifies glyph row's hash code--we have just reallocated the
10132 glyphs, so their contents can be complete garbage. (Bug#10164)
10133
10134 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
10135
10136 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10137
10138 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10139
10140 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10141 attributes are tested _before_ calling verify_row_hash, to protect
10142 against GCC re-ordering of the tests. (Bug#10164)
10143
10144 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10145
10146 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10147
10148 * xterm.c (handle_one_xevent): Only set async_visible and friends
10149 if net_wm_state_hidden_seen is non-zero (Bug#10002)
10150 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
10151 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10152
10153 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10154
10155 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10156 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10157 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10158 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10159 All uses changed to use GCPRO1 etc.
10160 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10161 Revert to old implementation (i.e., before 2011-03-11).
10162
10163 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10164
10165 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10166 of scroll runs so as to avoid assigning disabled bogus rows and
10167 unnecessary graphics copy operations.
10168
10169 2011-11-27 Eli Zaretskii <eliz@gnu.org>
10170
10171 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10172 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10173 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10174 (malloc, free, realloc, calloc): Redirect to e_* only when
10175 compiling Emacs.
10176
10177 * lisp.h (GCTYPEBITS): Move before first use.
10178 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10179 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10180 this macro definition.
10181
10182 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10183 _MSC_VER.
10184
10185 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10186
10187 * gtkutil.c (xg_create_frame_widgets):
10188 Call gtk_window_set_has_resize_grip (FALSE) if that function is
10189 present with Gtk+ 2.0.
10190
10191 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10192
10193 * fileio.c (Finsert_file_contents): Undo previous change; see
10194 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10195
10196 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10197
10198 Rename locals to avoid shadowing.
10199 * fileio.c (Finsert_file_contents):
10200 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10201 * process.c (wait_reading_process_output):
10202 Rename inner 'proc' to 'p' to avoid shadowing.
10203 Indent for consistency with usual Emacs style.
10204
10205 2011-11-25 Eli Zaretskii <eliz@gnu.org>
10206
10207 * xdisp.c (redisplay_window): If cursor row is not fully visible
10208 after recentering, and scroll-conservatively is set to a large
10209 number, scroll window by a few more lines to make the cursor fully
10210 visible and out of scroll-margin. (Bug#10105)
10211 (start_display): Don't move to the next line if the display should
10212 start at a newline that is part of a display vector or an overlay
10213 string. (Bug#10119)
10214
10215 2011-11-24 Juri Linkov <juri@jurta.org>
10216
10217 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10218 after the `MagickPingImage' call. (Bug#10112)
10219
10220 2011-11-23 Chong Yidong <cyd@gnu.org>
10221
10222 * window.c (Fcoordinates_in_window_p): Accept only live windows.
10223
10224 2011-11-23 Martin Rudalics <rudalics@gmx.at>
10225
10226 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
10227 making another buffer current. (Bug#10114)
10228
10229 2011-11-23 Glenn Morris <rgm@gnu.org>
10230
10231 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
10232
10233 2011-11-23 Chong Yidong <cyd@gnu.org>
10234
10235 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
10236 using it (Bug#5984).
10237
10238 2011-11-22 Eli Zaretskii <eliz@gnu.org>
10239
10240 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
10241 and header-lines, as they don't have one computed for them.
10242 (Bug#10098)
10243
10244 * .gdbinit (prow): Make displayed values more self-explaining.
10245 Add row's hash code.
10246
10247 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
10248
10249 * process.c (wait_reading_process_output): Fix asynchrounous
10250 GnuTLS socket handling on some versions of the GnuTLS library.
10251 (wait_reading_process_output): Add comment and URL.
10252
10253 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
10254
10255 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
10256
10257 2011-11-21 Chong Yidong <cyd@gnu.org>
10258
10259 * window.c (Fnext_window, Fprevious_window): Doc fix.
10260
10261 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10262
10263 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
10264
10265 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10266
10267 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
10268
10269 2011-11-20 Martin Rudalics <rudalics@gmx.at>
10270
10271 * window.c (Fset_window_combination_limit): Rename argument
10272 STATUS to LIMIT.
10273 (Vwindow_combination_limit): Remove "status" from doc-string.
10274
10275 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
10276
10277 * m/ibms390.h: Remove.
10278 * m/ibms390x.h: Don't include "ibms390.h".
10279
10280 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10281
10282 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
10283 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
10284
10285 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10286
10287 * casetab.c (Fset_case_table):
10288 * charset.c (Fcharset_after): Fix typos.
10289
10290 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
10291
10292 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
10293 Otherwise, valgrind does not work on some platforms.
10294 Problem reported by Andreas Schwab in
10295 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
10296 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
10297 is set, removing the need for VIRT_ADDRESS_VARIES.
10298 (PURE_P): Use a more-efficient implementation that needs just one
10299 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
10300 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
10301 to 4 (xorl, subq, cmpq, setbe).
10302 * alloc.c (pure): Always extern now, since that's the
10303 VIRT_ADDR_VARIES behavior.
10304 (PURE_POINTER_P): Use a single comparison, not two, for
10305 consistency with the new puresize.h.
10306 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
10307 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
10308 Remove VIRT_ADDR_VARIES no longer needed.
10309
10310 2011-11-19 Eli Zaretskii <eliz@gnu.org>
10311
10312 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
10313 (erase_phys_cursor, update_window_cursor, show_mouse_face)
10314 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
10315 behave as if the cursor position were at the window margin.
10316
10317 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
10318 and the cursor position is out of bounds, behave as if the cursor
10319 position were at the window margin. (Bug#10075)
10320
10321 2011-11-18 Chong Yidong <cyd@gnu.org>
10322
10323 * window.c (Fwindow_combination_limit): Make first argument
10324 non-optional, since it is meaningless for live windows like the
10325 selected window.
10326
10327 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
10328
10329 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
10330
10331 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
10332
10333 * intervals.c: Fix grafting over the whole buffer (bug#10071).
10334 (graft_intervals_into_buffer): Simplify.
10335
10336 2011-11-18 Eli Zaretskii <eliz@gnu.org>
10337
10338 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
10339 hash values of the two rows.
10340 (copy_row_except_pointers): Preserve the used[] arrays and the
10341 hash values of the two rows. (Bug#10035)
10342 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
10343
10344 * xdisp.c (row_hash): New function, body extracted from
10345 compute_line_metrics.
10346 (compute_line_metrics): Call row_hash, instead of computing the
10347 hash code inline.
10348
10349 * dispnew.c (verify_row_hash): Call row_hash for computing the
10350 hash code of a row, instead of duplicating code from xdisp.c.
10351
10352 * dispextern.h (row_hash): Add prototype.
10353
10354 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
10355
10356 * frame.c (delete_frame): Don't delete the terminal when the last
10357 X frame is closed if emacs is built with GTK toolkit.
10358
10359 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
10360
10361 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
10362
10363 2011-11-17 Martin Rudalics <rudalics@gmx.at>
10364
10365 * window.c (Vwindow_splits): Rename to
10366 Vwindow_combination_resize. Suggested by Juri Linkov.
10367 (Fsplit_window_internal): Use Vwindow_combination_resize instead
10368 of Vwindow_splits.
10369
10370 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
10371
10372 * nsfns.m (Fns_font_name):
10373 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
10374
10375 2011-11-16 Martin Rudalics <rudalics@gmx.at>
10376
10377 * window.h (window): Rename slot "nest" to "combination_limit".
10378 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
10379 (Fset_window_nest): Rename to Fset_window_combination_limit.
10380 (Vwindow_nest): Rename to Vwindow_combination_limit.
10381 (recombine_windows, make_parent_window, make_window)
10382 (Fsplit_window_internal, saved_window)
10383 (Fset_window_configuration, save_window_save): Rename all
10384 occurrences of window_nest to window_combination_limit.
10385
10386 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
10387
10388 * image.c (imagemagick_load_image): Fix typo.
10389
10390 2011-11-14 Eli Zaretskii <eliz@gnu.org>
10391
10392 * xdisp.c (display_line): Move the call to
10393 highlight_trailing_whitespace before the call to
10394 compute_line_metrics, since the latter needs to see the final
10395 faces of all the glyphs to compute ROW's hash value.
10396 Fixes assertion violations in row_equal_p. (Bug#10035)
10397
10398 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
10399
10400 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
10401 just return (bug#10044).
10402
10403 2011-11-12 Eli Zaretskii <eliz@gnu.org>
10404
10405 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
10406 with user-defined heap size. Bump the default size of the temacs
10407 heap to 27MB, to avoid memory warning when running temacs.
10408 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
10409
10410 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
10411 current_matrix and desired_matrix. (Bug#9990)
10412 (verify_row_hash) [XASSERTS]: New function.
10413 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
10414 that the hash value of glyph rows is correct.
10415
10416 2011-11-12 Martin Rudalics <rudalics@gmx.at>
10417
10418 * window.h (window): Remove splits slot.
10419 * window.c (Fwindow_splits, Fset_window_splits): Remove.
10420 (Fdelete_other_windows_internal, make_parent_window)
10421 (make_window, Fsplit_window_internal, Fdelete_window_internal)
10422 (Fset_window_configuration, save_window_save): Don't deal with
10423 split status of windows.
10424 (saved_window): Remove splits slot.
10425 (Vwindow_splits): Rewrite doc-string.
10426
10427 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
10428
10429 * xfns.c (unwind_create_frame):
10430 * nsfns.m (unwind_create_frame):
10431 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
10432 Vframe_list (Bug#9999).
10433
10434 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
10435
10436 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
10437
10438 2011-11-11 Kenichi Handa <handa@m17n.org>
10439
10440 * callproc.c (Fcall_process): Set the member dst_multibyte of
10441 process_coding.
10442
10443 2011-11-11 Johan Bockgård <bojohan@gnu.org>
10444
10445 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10446 avoid a crash (bug#9496).
10447
10448 2011-11-09 Chong Yidong <cyd@gnu.org>
10449
10450 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10451 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10452
10453 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10454
10455 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10456
10457 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10458
10459 Avoid some portability problems by eschewing 'extern inline' functions.
10460 The trivial performance wins aren't worth the portability hassles; see
10461 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10462 et seq.
10463 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10464 (window_box_width, window_box_left, window_box_left_offset)
10465 (window_box_right, window_box_right_offset): Undo previous change,
10466 by removing the "extern"s.
10467 * intervals.c (adjust_intervals_for_insertion)
10468 (adjust_intervals_for_deletion): Undo previous change,
10469 making these static again.
10470 (offset_intervals, temp_set_point_both, temp_set_point)
10471 (copy_intervals_to_string): No longer inline.
10472 * xdisp.c (window_text_bottom_y, window_box_width)
10473 (window_box_height, window_box_left_offset)
10474 (window_box_right_offset, window_box_left, window_box_right)
10475 (window_box): No longer inline.
10476
10477 2011-11-08 Chong Yidong <cyd@gnu.org>
10478
10479 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
10480 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
10481 Signal an error if not a live window.
10482 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
10483 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
10484
10485 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
10486
10487 * lisp.h (syms_of_abbrev): Remove declaration.
10488 Reported by CHENG Gao <chenggao@royau.me>.
10489
10490 2011-11-07 Eli Zaretskii <eliz@gnu.org>
10491
10492 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10493 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
10494 of temacs in GUI mode.
10495
10496 2011-11-07 Martin Rudalics <rudalics@gmx.at>
10497
10498 * window.h: Declare delete_all_child_windows instead of
10499 delete_all_subwindows.
10500 * window.c (Fwindow_nest, Fset_window_nest)
10501 (Fset_window_new_total, Fset_window_new_normal)
10502 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10503 (delete_all_subwindows): Rename to delete_all_child_windows.
10504 (Fdelete_other_windows_internal, Fset_window_configuration):
10505 Call delete_all_child_windows instead of delete_all_subwindows.
10506 * frame.c (delete_frame): Call delete_all_child_windows instead
10507 of delete_all_subwindows.
10508
10509 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
10510
10511 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10512 This is also needed for porting to any host where GC_MARK_STACK is
10513 not GC_MAKE_GCPROS_NOOPS.
10514 (which_symbols): Use it.
10515
10516 2011-11-07 Kenichi Handa <handa@m17n.org>
10517
10518 * coding.c (coding_set_destination): Check coding->src_pos only
10519 when coding->src_object is a buffer (bug#9910).
10520
10521 * process.c (send_process): Set the member src_multibyte of coding
10522 to 0 (bug#9911) when sending a unibyte text.
10523
10524 * callproc.c (Fcall_process): Set the member src_multibyte of
10525 process_coding to 0 (bug#9912).
10526
10527 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10528
10529 * xmenu.c (cleanup_widget_value_tree): New function.
10530 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10531 calling free_menubar_widget_value_tree directly (Bug#9830).
10532
10533 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10534
10535 Fix some portability problems with 'inline'.
10536 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10537 (window_box_width, window_box_left, window_box_left_offset)
10538 (window_box_right, window_box_right_offset): Declare extern.
10539 Otherwise, these inline functions do not conform to C99 and
10540 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
10541 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10542 * intervals.c (adjust_intervals_for_insertion)
10543 (adjust_intervals_for_deletion): Now extern, because otherwise the
10544 extern inline functions 'offset_intervals' couldn't refer to it.
10545 (static_offset_intervals): Remove.
10546 (offset_intervals): Rewrite using the old contents of
10547 static_offset_intervals. The old version didn't conform to C99
10548 because an extern inline function contained a reference to an
10549 identifier with static linkage.
10550
10551 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
10552
10553 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10554 GC.
10555
10556 2011-11-06 Eli Zaretskii <eliz@gnu.org>
10557
10558 * xdisp.c (init_iterator, reseat_to_string): Don't set the
10559 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
10560 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10561 return Qleft_to_right.
10562
10563 2011-11-06 Chong Yidong <cyd@gnu.org>
10564
10565 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
10566 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
10567 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
10568 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
10569 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
10570 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
10571 (Fwindow_vscroll): Doc fix.
10572 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
10573 argument, since it makes no sense to pass a live window and for
10574 consistency with window-child.
10575
10576 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
10577
10578 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
10579 support MSVC.
10580
10581 2011-11-05 Jason Rumney <jasonr@gnu.org>
10582
10583 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
10584 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
10585 fonts (Bug#6029).
10586 (add_font_entity_to_list): Fix logic errors in mixed boolean and
10587 bitwise arithmetic preventing use of unicode-sip and non-truetype
10588 opentype fonts.
10589
10590 2011-11-05 Eli Zaretskii <eliz@gnu.org>
10591
10592 * s/ms-w32.h (fstat, stat, utime): Move redirections to
10593 "emacs"-only part.
10594
10595 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
10596 initialization code to keep similarity to xfns.c after changes
10597 from 2011-11-05.
10598
10599 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
10600
10601 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
10602 (unwind_create_frame): New function (Bug#9943).
10603 (Fx_create_frame): Restructure code to be more similar to the one in
10604 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
10605 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
10606 Move terminal->reference_count++ just before making the frame official
10607 (Bug#9943).
10608
10609 * nsterm.m (x_free_frame_resources): New function.
10610 (x_destroy_window): Move code to x_free_frame_resources.
10611
10612 * xfns.c (unwind_create_frame): Fix comment.
10613 (Fx_create_frame, x_create_tip_frame):
10614 Move terminal->reference_count++ just before making the frame
10615 official. Move initialization of image_cache_refcount and
10616 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
10617
10618 2011-11-05 Eli Zaretskii <eliz@gnu.org>
10619
10620 Support MSVC build with newer versions of Visual Studio.
10621 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
10622 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
10623 nt/gmake.defs.
10624
10625 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10626 which are not supported by MSVC.
10627 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10628 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10629 bitfields.
10630 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10631 types in bitfields.
10632 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10633
10634 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10635
10636 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
10637
10638 Support MSVC build with newer versions of Visual Studio.
10639 * w32.c: Don't include w32api.h for MSVC.
10640 (init_environment) [_MSC_VER]: Call sys_access, not _access.
10641
10642 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10643 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10644 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10645 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10646 e_* cousins.
10647 (alloca) [_MSC_VER]: Define to _alloca.
10648
10649 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10650
10651 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10652
10653 2011-11-04 Eli Zaretskii <eliz@gnu.org>
10654
10655 * xdisp.c (note_mouse_highlight): If either of
10656 previous/next-single-property-change returns nil, treat that as
10657 the beginning or the end of the buffer. (Bug#9955)
10658
10659 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
10660
10661 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
10662 label is not null (Bug#9951).
10663 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10664 may be NULL.
10665
10666 2011-11-04 Eli Zaretskii <eliz@gnu.org>
10667
10668 * window.c (Fwindow_body_size): Mention in the doc string that the
10669 return value is in frame's canonical units. (Bug#9949)
10670
10671 2011-11-03 Eli Zaretskii <eliz@gnu.org>
10672
10673 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
10674
10675 * w32fns.c (unwind_create_frame): If needed, free the glyph
10676 matrices of the partially constructed frame. (Bug#9943)
10677 * xfns.c (unwind_create_frame): Likewise.
10678
10679 2011-11-01 Eli Zaretskii <eliz@gnu.org>
10680
10681 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10682 Don't stop backward scan on the continuation glyph, even though
10683 its CHARPOS is positive.
10684 (mouse_face_from_buffer_pos, note_mouse_highlight):
10685 Rename cover_string to disp_string.
10686
10687 2011-11-01 Martin Rudalics <rudalics@gmx.at>
10688
10689 * window.c (temp_output_buffer_show): Don't use
10690 Vtemp_buffer_show_specifiers.
10691 (Vtemp_buffer_show_specifiers): Remove unused variable.
10692
10693 2011-10-30 Eli Zaretskii <eliz@gnu.org>
10694
10695 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10696 past the beginning of the current glyph matrix.
10697
10698 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
10699
10700 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10701 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10702 HAVE_GTK3 (Bug#9869).
10703
10704 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10705 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10706
10707 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10708
10709 * xterm.c: Declare x_handle_net_wm_state to return int.
10710 (handle_one_xevent): Check if we are iconified but don't have
10711 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
10712 (get_current_wm_state): Return non-zero if not hidden,
10713 check for _NET_WM_STATE_HIDDEN (Bug#9893).
10714 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
10715 (x_handle_net_wm_state): Return what get_current_wm_state returns.
10716 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
10717
10718 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
10719
10720 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
10721 so that this new function doesn't get optimized away by a
10722 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
10723
10724 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10725
10726 * frame.h (MOUSE_HL_INFO): Remove excess parens.
10727
10728 2011-10-29 Eli Zaretskii <eliz@gnu.org>
10729
10730 Fix the `xbytecode' command.
10731 * .gdbinit (xprintbytestr): New command.
10732 (xwhichsymbols): Rename from `which'; all callers changed.
10733 (xbytecode): Print the byte-code string as well.
10734
10735 2011-10-29 Kim Storm <storm@cua.dk>
10736
10737 * alloc.c (which_symbols): New function.
10738
10739 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10740
10741 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
10742 line. (Bug#9903)
10743
10744 2011-10-29 Glenn Morris <rgm@gnu.org>
10745
10746 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10747 Not clear what it was for, and it causes various bugs. (Bug#9839)
10748
10749 2011-10-28 Eli Zaretskii <eliz@gnu.org>
10750
10751 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10752 possible random value that matches one of those tested as
10753 condition to clear the mouse face.
10754
10755 2011-10-28 Chong Yidong <cyd@gnu.org>
10756
10757 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10758
10759 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
10760
10761 * window.c (make_window): Initialize phys_cursor_on_p.
10762
10763 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
10764
10765 * lisp.h (struct Lisp_Symbol): Update comments.
10766
10767 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
10768
10769 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10770
10771 2011-10-28 Eli Zaretskii <eliz@gnu.org>
10772
10773 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
10774 <oslsachem@gmail.com> for helping to debug this.
10775
10776 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10777 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10778 (g_b_init_get_glyph_outline_w): New static variables.
10779 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10780 (GetGlyphOutlineW_Proc): New typedefs.
10781 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
10782 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10783 New functions.
10784 (w32font_open_internal, compute_metrics):
10785 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
10786 instead of calling the "wide" APIs directly.
10787
10788 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10789
10790 * w32.h (syms_of_w32font): Add prototype.
10791
10792 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10793
10794 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10795 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10796 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10797 (Fmove_to_window_line): Doc fix.
10798
10799 2011-10-27 Chong Yidong <cyd@gnu.org>
10800
10801 * process.c (make_process): Set gnutls_state to NULL.
10802
10803 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10804 non-NULL, regardless of GNUTLS_INITSTAGE.
10805 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10806 an error. Set process slots as soon as we allocate them.
10807
10808 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10809
10810 2011-10-27 Chong Yidong <cyd@gnu.org>
10811
10812 * gnutls.c (emacs_gnutls_deinit): New function.
10813 Deallocate credentials structures as well as calling gnutls_deinit.
10814 (Fgnutls_deinit, Fgnutls_boot): Use it.
10815
10816 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10817 (deactivate_process): Call emacs_gnutls_deinit.
10818
10819 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10820
10821 * image.c (x_create_x_image_and_pixmap):
10822 * w32.c (sys_rename, w32_delayed_load):
10823 * w32font.c (fill_in_logfont):
10824 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10825
10826 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
10827
10828 * w32fns.c (w32_default_color_map): New function,
10829 extracted from Fw32_default_color_map.
10830 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
10831
10832 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10833
10834 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10835
10836 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10837
10838 * keyboard.c (test_undefined): New function (bug#9751).
10839 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10840
10841 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10842
10843 * sysdep.c (init_sys_modes): Fix the check for the controlling
10844 terminal (Bug#6649).
10845
10846 2011-10-20 Eli Zaretskii <eliz@gnu.org>
10847
10848 * dispextern.h (struct bidi_it): New member next_en_type.
10849
10850 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10851 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10852 current character, check also for next_en_type being WEAK_EN.
10853 (bidi_resolve_weak): Don't enter the expensive loop if the current
10854 position is before next_en_pos. Record the bidi type of the first
10855 non-ET, non-BN character we find, in addition to its position.
10856 (bidi_level_of_next_char): Invalidate next_en_type when
10857 next_en_pos is over-stepped.
10858
10859 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10860
10861 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10862 * editfns.c: Rewrite current-time-zone so that it invokes
10863 the equivalent of (format-time-string "%Z") to get the time zone name.
10864 This fixes a bug when the time zone name contains characters that
10865 need converting from the system time locale to Emacs internal format.
10866 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10867 that patch fixed format-time-string to do the conversion, but
10868 I forgot to fix current-time-zone.
10869 (format_time_string): New function, containing most of
10870 what Fformat_time_string used to contain.
10871 (Fformat_time_string): Rewrite in terms of format_time_string.
10872 This doesn't change this function's behavior.
10873 (current-time-zone): Rewrite to use format_time_string.
10874 This fixes the bug reported by Michael Schierl in
10875 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10876 Jason Rumney's 2007-06-07 change worked around this bug, but
10877 didn't fix it.
10878 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10879
10880 2011-10-19 Eli Zaretskii <eliz@gnu.org>
10881
10882 * xdisp.c (start_display): If the character at POS is displayed
10883 via a display vector, reset IT->current.dpvec_index to zero.
10884 (try_window_reusing_current_matrix): If a line ends in a display
10885 vector or the next line starts in a display vector, continue
10886 redrawing the window even though the character position of
10887 start_row was reached.
10888 (Bug#9771, part 2)
10889
10890 2011-10-18 Chong Yidong <cyd@gnu.org>
10891
10892 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10893 with nobreak-char-display too.
10894
10895 2011-10-18 Eli Zaretskii <eliz@gnu.org>
10896
10897 Fix part 3 of bug#9771.
10898 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10899 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10900 non-neutral characters if the current character is a paragraph
10901 separator (a.k.a. Newline). This avoids running the same
10902 expensive loop twice, once when we consume the preceding newline
10903 and the other time when the line actually needs to be displayed.
10904 Avoid the loop when we see neutrals on the base embedding level
10905 following a character whose directionality is the same as the
10906 paragraph's. This avoids running the expensive loop when a line
10907 ends in a long sequence of neutrals, like control characters.
10908 Add assertion against STRONG_AL type. Slightly rearrange code
10909 that determines the type of a neutral given the first non-neutral
10910 that follows it.
10911 (bidi_level_of_next_char): Set next_en_pos to zero when
10912 invalidating its info.
10913
10914 2011-10-17 Eli Zaretskii <eliz@gnu.org>
10915
10916 * xdisp.c (push_display_prop): Determine whether to record string
10917 or buffer position by IT->string, not by IT->method. Allow
10918 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
10919 (move_it_vertically_backward): Don't look for character position
10920 immediately after the newline when in a continuation line.
10921 (Bug#9771, part 1)
10922
10923 2011-10-15 Martin Rudalics <rudalics@gmx.at>
10924
10925 * window.c (coordinates_in_window): Rewrite and delabelize
10926 vertical border check. (Bug#5357) (Bug#9618)
10927
10928 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10929
10930 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10931 errors in XSetWindowBorder (bug#9310).
10932
10933 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10934
10935 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10936 avoid crash when xmalloc overrun checking is enabled.
10937
10938 2011-10-13 Eli Zaretskii <eliz@gnu.org>
10939
10940 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10941 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10942 cursor motion with <left> and <right> arrow keys.
10943
10944 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10945 some callers set that themselves.
10946
10947 2011-10-12 Eli Zaretskii <eliz@gnu.org>
10948
10949 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10950 display string and the previous row comes from the same string and
10951 is empty. (Bug#9739) (Bug#9738)
10952
10953 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10954
10955 * doc.c (get_doc_string): Encode file name (bug#9735).
10956
10957 2011-10-12 Eli Zaretskii <eliz@gnu.org>
10958
10959 * bidi.c (bidi_level_of_next_char):
10960 * xdisp.c (get_visually_first_element): Remove old incorrect
10961 comments regarding the Unicode Line Separator character.
10962
10963 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10964
10965 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10966
10967 * alloc.c (Fgc_status): Do not access beyond zombies array
10968 boundary if nzombies > MAX_ZOMBIES.
10969 * alloc.c (dump_zombies): Add missing format specifier.
10970
10971 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10972
10973 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10974 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10975
10976 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10977 Some packages use them to denote characters with modifiers.
10978
10979 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10980
10981 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10982 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10983 matching a pp-number. Rename parameter var to var1.
10984
10985 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10986
10987 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10988
10989 2011-10-08 Glenn Morris <rgm@gnu.org>
10990
10991 * callint.c (Fcall_interactively): Give a more explicit error for the
10992 'c' case with a non-character input. (Bug#8479)
10993
10994 2011-10-08 Eli Zaretskii <eliz@gnu.org>
10995
10996 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10997 lines.
10998 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10999 lines that are hscrolled on the left.
11000
11001 * dispnew.c (buffer_posn_from_coords): Account for a possible
11002 presence of header-line. (Bug#4426)
11003
11004 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11005
11006 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11007 Don't advertise functionality which we discourage or doesn't work.
11008
11009 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11010
11011 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11012 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11013 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11014 this makes Emacs dump core during garbage collection on rare
11015 occasions. sizeof is obviously inferior to offsetof here, so
11016 stick with offsetof.
11017 (GC_POINTER_ALIGNMENT): New macro.
11018 (mark_memory): Omit 3rd (offset) arg; caller changed.
11019 Don't assume EMACS_INT alignment is the same as pointer alignment.
11020
11021 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11022
11023 * keyboard.c (read_key_sequence_remapped): New var.
11024 (read_key_sequence): Compute remapping in the right buffer.
11025 (command_loop_1): Use read_key_sequence's remapping directly.
11026
11027 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11028
11029 * dired.c (file_name_completion): Don't expand file name.
11030 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11031 before checking file name handler.
11032
11033 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11034 they've been requested explicitly (bug#9591).
11035
11036 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
11037
11038 * keymap.c (Fsingle_key_description): Use make_specified_string
11039 instead of build_string to build string from push_key_description.
11040 (Bug#5193)
11041
11042 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11043
11044 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11045 This fixes a Y2038 bug on 64-bit hosts.
11046 * buffer.c (reset_buffer):
11047 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11048 (Fclear_buffer_auto_save_failure):
11049 Use 0, not -1, to represent an unset failure time, since time_t
11050 might not be signed.
11051
11052 Remove dependency on glibc malloc internals.
11053 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11054 Move back here from lisp.h, but with their new implementations.
11055 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11056 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11057 * charset.c (charset_table_init): New static var.
11058 (syms_of_charset): Use it instead of xmalloc. This removes a
11059 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11060 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11061 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11062 Move back to alloc.c.
11063 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11064 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11065
11066 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11067
11068 * nsterm.m (windowDidResize): Call x_set_window_size only when
11069 ns_in_resize is true. Otherwise set pixelwidth/height and
11070 call change_frame_size (Bug#9628).
11071
11072 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11073
11074 Port --enable-checking=all to Fedora 14 x86-64.
11075 * charset.c (syms_of_charset): Also account for glibc malloc's
11076 internal overhead when calculating the initial malloc maximum.
11077
11078 Port --enable-checking=all to Fedora 14 x86.
11079 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11080 Move to lisp.h.
11081 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11082 (overrun_check_realloc, overrun_check_free):
11083 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11084 That way, xmalloc returns a properly-aligned pointer even if
11085 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11086 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11087 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11088 into account when calculating the initial malloc maximum.
11089 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11090 Move here from alloc.c, so that charset.c can use it too.
11091 Properly align; the old code wasn't right for common 32-bit hosts
11092 when configured with --enable-checking=all.
11093 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11094 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11095
11096 2011-09-29 Eli Zaretskii <eliz@gnu.org>
11097
11098 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
11099 use EDOM.
11100
11101 2011-09-28 Eli Zaretskii <eliz@gnu.org>
11102
11103 * xdisp.c (compute_display_string_end): If there's no display
11104 string at CHARPOS, return -1.
11105
11106 * bidi.c (bidi_fetch_char): When compute_display_string_end
11107 returns a negative value, treat the character as a normal
11108 character not covered by a display string. (Bug#9624)
11109
11110 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
11111
11112 * lread.c (Fread_from_string): Fix typo in docstring.
11113
11114 2011-09-27 Eli Zaretskii <eliz@gnu.org>
11115
11116 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11117 newline, reseat the iterator instead of bidi-iterating there one
11118 character at a time. (Bug#9610)
11119 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11120 TO_CHARPOS if the bidi iterator is at base embedding level.
11121
11122 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11123
11124 * lread.c (readevalloop): Use correct code for NBSP.
11125 (read1): Likewise. (Bug#9608)
11126
11127 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
11128
11129 * dbusbind.c (Fdbus_register_signal): When service is not
11130 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11131
11132 2011-09-25 Glenn Morris <rgm@gnu.org>
11133
11134 * buffer.c (truncate-lines): Doc fix.
11135
11136 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
11137
11138 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11139 (Fset_window_next_buffers): Doc fix.
11140
11141 2011-09-24 Glenn Morris <rgm@gnu.org>
11142
11143 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11144
11145 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11146
11147 Fix minor problems found by static checking.
11148 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
11149 * indent.c (Fvertical_motion): Fix == vs = typo.
11150
11151 2011-09-24 Eli Zaretskii <eliz@gnu.org>
11152
11153 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11154 Default value is now t. Doc fix.
11155
11156 * indent.c (Fvertical_motion): Compute and apply the overshoot
11157 logic when moving up, not only when moving down. Fix the
11158 confusing name and values of the it_overshoot_expected variable;
11159 logic changes accordingly. (Bug#9254) (Bug#9549)
11160
11161 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11162 CHARPOS is covered by a display string which includes newlines.
11163 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11164 is covered by a display string with embedded newlines.
11165
11166 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
11167
11168 * dbusbind.c (Fdbus_register_signal): Add match rule to
11169 Vdbus_registered_objects_table. (Bug#9581)
11170 (Fdbus_register_method, Vdbus_registered_objects_table):
11171 Fix docstring.
11172
11173 2011-09-24 Jim Meyering <meyering@redhat.com>
11174
11175 do not ignore write error for any output size
11176 The previous change was incomplete.
11177 While it makes emacs --batch detect the vast majority of stdout
11178 write failures, errors were still ignored whenever the output size is
11179 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11180 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11181 && echo FAIL: ignored write error
11182 FAIL: ignored write error
11183 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11184 && echo FAIL: ignored write error
11185 FAIL: ignored write error
11186 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11187
11188 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11189
11190 * emacs.c (Fkill_emacs): In noninteractive mode exit
11191 non-successfully if a write error occurred on stdout. (Bug#9574)
11192
11193 2011-09-21 Eli Zaretskii <eliz@gnu.org>
11194
11195 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11196 the xassert test.
11197
11198 * dispextern.h (struct it): Update the comment documenting what
11199 can it->OBJECT be.
11200
11201 2011-09-20 Eli Zaretskii <eliz@gnu.org>
11202
11203 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11204 a display string, extend search for cursor position to end of row.
11205 (find_row_edges): If the row ends in a newline from a display
11206 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11207 Handle the case of a display string with multiple newlines.
11208 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11209 non-empty line. Fixes confusing cursor motion with arrow keys at
11210 the beginning of a line that starts with whitespace.
11211
11212 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11213
11214 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11215 (bug#9493).
11216
11217 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
11218
11219 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
11220 boolean (Bug#9154).
11221
11222 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11223
11224 * xdisp.c (display_line): Record maximum and minimum buffer
11225 positions even if no glyphs were produced (e.g., by a zero-width
11226 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
11227 buffer positions that will be removed from the glyph row because
11228 they don't fit.
11229 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
11230 column is beyond frame width: don't subtract 1 "pixel" when
11231 computing width of the stretch.
11232 (reseat_at_next_visible_line_start): Undo the change made on
11233 2011-09-17 that saved paragraph information and restored it after
11234 the call to `reseat'. (Bug#9545)
11235
11236 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11237
11238 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
11239 and turn window cursor on if cleared (Bug#9415).
11240
11241 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
11242
11243 * search.c (boyer_moore): Take unibyte characters from pattern
11244 literally. (Bug#9458)
11245
11246 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11247
11248 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
11249
11250 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
11251
11252 Fix minor problem found by static checking.
11253 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
11254 initialized, to pacify gcc -Wuninitialized.
11255
11256 * fileio.c: Report proper errno when syscall falls.
11257 (Finsert_file_contents): Save and restore errno,
11258 so that report_file_error outputs the correct diagnostic.
11259 (Fwrite_region) [CLASH_DETECTION]: Likewise.
11260
11261 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11262
11263 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
11264
11265 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11266
11267 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
11268 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
11269
11270 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11271
11272 * xdisp.c (reseat_at_next_visible_line_start): Keep information
11273 about the current paragraph and restore it after the call to reseat.
11274
11275 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
11276 (bidi_find_paragraph_start): Search back for paragraph beginning
11277 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
11278 (bidi_move_to_visually_next): Only trigger paragraph-related
11279 computations when the last character is a newline or at EOB, not
11280 just any NEUTRAL_B. (Bug#9470)
11281
11282 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
11283 truncated lines if point is covered by a display string. (Bug#9524)
11284
11285 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
11286
11287 * xselect.c: Relax test for outgoing X longs (Bug#9498).
11288 (cons_to_x_long): New function.
11289 (lisp_data_to_selection_data): Use it. Correct the test for
11290 short-versus-long data; it was negated. Break out of vector
11291 loop, for efficiency, when a long datum is discovered.
11292
11293 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
11294
11295 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
11296
11297 2011-09-16 Eli Zaretskii <eliz@gnu.org>
11298
11299 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
11300 GCC PR/17406) by declaring this function with external scope.
11301
11302 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11303
11304 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
11305 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
11306
11307 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
11308
11309 * editfns.c (Fformat): Correctly handle text properties on "%%".
11310
11311 2011-09-15 Eli Zaretskii <eliz@gnu.org>
11312
11313 * xterm.c (x_draw_composite_glyph_string_foreground):
11314 * w32term.c (x_draw_composite_glyph_string_foreground):
11315 * term.c (encode_terminal_code):
11316 * composite.c (composition_update_it, get_composition_id):
11317 * xdisp.c (get_next_display_element)
11318 (fill_composite_glyph_string): Add comments about special meaning
11319 of TAB characters in a composition.
11320
11321 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11322
11323 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
11324 This occurs when processing a multibyte format.
11325 Problem reported by Wolfgang Jenker.
11326
11327 2011-09-15 Johan Bockgård <bojohan@gnu.org>
11328
11329 * xdisp.c (try_cursor_movement): Only check for exact match if
11330 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
11331
11332 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11333
11334 Remove unused external symbols.
11335 * dispextern.h (calc_pixel_width_or_height): Remove decl.
11336 * xdisp.c (calc_pixel_width_or_height): Now static.
11337 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
11338 * indent.c (check_display_width):
11339 * w32term.c: Fix comment to match code.
11340 * xterm.c, xterm.h (x_catching_errors): Remove.
11341
11342 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11343
11344 * xselect.c: Use signed conversions more consistently (Bug#9498).
11345 (selection_data_to_lisp_data): Assume incoming selection data are
11346 signed integers, not unsigned. This is to be consistent with
11347 outgoing selection data, which was modified to use signed integers
11348 in as part of the fix to Bug#9196 in response to Jan D.'s comment
11349 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
11350 expects long, not unsigned long.
11351
11352 2011-09-14 Eli Zaretskii <eliz@gnu.org>
11353
11354 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
11355 computation of loop end. Reported by Johan Bockgård
11356 <bojohan@gnu.org>.
11357
11358 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
11359
11360 * frame.c (Fother_visible_frames_p): Function deleted.
11361
11362 2011-09-12 Eli Zaretskii <eliz@gnu.org>
11363
11364 * indent.c (compute_motion): Process display vector front to back
11365 rather than the other way around. (Bug#2496)
11366
11367 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
11368
11369 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
11370
11371 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
11372
11373 * minibuf.c (Fread_from_minibuffer): Doc fix.
11374
11375 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11376
11377 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
11378 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
11379
11380 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11381
11382 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
11383 value for non-existent files.
11384
11385 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11386
11387 * fileio.c (Finsert_file_contents): If the file cannot be opened,
11388 set its "size" to -1. This will set the modtime_size field of
11389 the corresponding buffer to -1, which is what
11390 verify-visited-file-modtime expects for files that do not exist.
11391 (Bug#9139)
11392
11393 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
11394
11395 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
11396 here ...
11397 * lisp.h: ... from here. push_key_description is no longer
11398 defined in keyboard.c, so its declaration should not be in
11399 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
11400 logically belongs with push_key_description.
11401
11402 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
11403
11404 * buffer.h: Include <sys/types.h> instead of <time.h>.
11405 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
11406 Problem reported by Herbert J. Skuhra.
11407
11408 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
11409
11410 * xml.c (parse_region): Make the parsing work for
11411 non-comment-starting XML files again (bug#9144).
11412
11413 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
11414
11415 * image.c (gif_load): Fix calculation of bottom and right corner.
11416 (Bug#9468)
11417
11418 2011-09-10 Eli Zaretskii <eliz@gnu.org>
11419
11420 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
11421 redisplay in small windows.
11422
11423 2011-09-09 Eli Zaretskii <eliz@gnu.org>
11424
11425 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
11426
11427 2011-09-08 Martin Rudalics <rudalics@gmx.at>
11428
11429 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
11430 Operate on live windows only.
11431
11432 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
11433
11434 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
11435
11436 2011-09-07 Eli Zaretskii <eliz@gnu.org>
11437
11438 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
11439 only under bidi iteration.
11440
11441 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
11442
11443 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11444
11445 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11446
11447 isnan: Fix porting problem to Solaris 10 with bundled gcc.
11448 Without this fix, the command to link temacs failed due to an
11449 undefined symbol __builtin_isnan. This is because
11450 /usr/include/iso/math_c99.h #defines isnan(x) to
11451 __builtin_isnan(x), but the bundled gcc, which identifies itself
11452 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11453 a __builtin_isnan.
11454 * floatfns.c (isnan): #undef, and then #define to a clone of
11455 what's in data.c.
11456 (Fisnan): Always define, since it's always available now.
11457 (syms_of_floatfns): Always define isnan at the Lisp level.
11458
11459 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11460
11461 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11462
11463 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11464
11465 * fileio.c: Fix bugs with large file offsets (Bug#9428).
11466 The previous code assumed that file offsets (off_t values) fit in
11467 EMACS_INT variables, which is not true on typical 32-bit hosts.
11468 The code messed up by falsely reporting buffer overflow in cases
11469 such as (insert-file-contents "big" nil 1 2) into an empty buffer
11470 when "big" contains more than 2**29 bytes, even though this
11471 inserts just one byte and does not overflow the buffer.
11472 (Finsert_file_contents): Store file offsets as off_t
11473 values, not as EMACS_INT values. Check for overflow when
11474 converting between EMACS_INT and off_t. When checking for
11475 buffer overflow or for overlap, take the offsets into account.
11476 Don't use EMACS_INT for small values where int suffices.
11477 When checking for overlap, fix a typo: ZV was used where
11478 ZV_BYTE was intended.
11479 (Fwrite_region): Don't assume off_t fits into 'long'.
11480 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
11481
11482 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
11483
11484 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
11485
11486 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11487
11488 sprintf-related integer and memory overflow issues (Bug#9412).
11489
11490 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
11491 (esprintf, exprintf, evxprintf): New functions.
11492 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
11493 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
11494 (modify_event_symbol): Do not assume that the length of
11495 name_alist_or_stem is safe to alloca and fits in int.
11496 (Fexecute_extended_command): Likewise for function name and binding.
11497 (Frecursion_depth): Wrap around reliably on integer overflow.
11498 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11499 since some callers pass EMACS_INT values.
11500 (Fsingle_key_description): Don't crash if symbol name contains more
11501 than MAX_ALLOCA bytes.
11502 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11503 (get_minibuffer): Arg is now EMACS_INT, not int.
11504 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
11505 (esprintf, exprintf, evxprintf): New decls.
11506 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11507
11508 * dbusbind.c (signature_cat): New function.
11509 (xd_signature, Fdbus_register_signal):
11510 Do not overrun buffer; instead, report string overflow.
11511
11512 * dispnew.c (add_window_display_history): Don't overrun buffer.
11513 Truncate instead; this is OK since it's just a log.
11514
11515 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11516 even if the time zone offset is outlandishly large.
11517 Don't mishandle offset == INT_MIN.
11518
11519 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11520 when creating daemon; the previous buffer-overflow check was incorrect.
11521
11522 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11523 which has the guts of the old verror function.
11524
11525 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11526 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11527
11528 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11529 (font_unparse_xlfd): Don't blindly alloca long strings.
11530 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
11531 fits in int, when using sprintf. Use single snprintf to count
11532 length of string rather than counting it via multiple sprintfs;
11533 that's simpler and more reliable.
11534 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11535 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11536 sprintf, in case result does not fit in int.
11537
11538 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11539 (fontset_from_font): Print it.
11540
11541 * frame.c (tty_frame_count): Now printmax_t, not int.
11542 (make_terminal_frame, set_term_frame_name): Print it.
11543 (x_report_frame_params): In X, window IDs are unsigned long,
11544 not signed long, so print them as unsigned.
11545 (validate_x_resource_name): Check for implausibly long names,
11546 and don't assume name length fits in 'int'.
11547 (x_get_resource_string): Don't blindly alloca invocation name;
11548 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
11549 not fit in int.
11550
11551 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11552 (xg_check_special_colors, xg_set_geometry):
11553 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11554
11555 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11556 Use esprintf, not sprintf, in case result does not fit in int.
11557
11558 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11559 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11560 it as a large positive number.
11561 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
11562 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11563
11564 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
11565 in case result does not fit in int.
11566
11567 * print.c (float_to_string): Detect width overflow more reliably.
11568 (print_object): Make sprintf buffer a bit bigger, to avoid potential
11569 buffer overrun. Don't assume list length fits in 'int'. Treat
11570 print length of 0 as 0, not as infinity; to be consistent with other
11571 uses of print length in this function. Don't overflow print length
11572 index. Don't assume hash table size fits in 'long', or that
11573 vectorlike size fits in 'unsigned long'.
11574
11575 * process.c (make_process): Use printmax_t, not int, to format
11576 process-name gensyms.
11577
11578 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
11579
11580 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
11581 to avoid potential buffer overrun.
11582
11583 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
11584 if X resource line is longer than 512 bytes.
11585
11586 * xfns.c (x_window): Make sprintf buffer a bit bigger
11587 to avoid potential buffer overrun.
11588
11589 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
11590
11591 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
11592
11593 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11594
11595 Integer overflow fixes for scrolling, etc.
11596 Without these, Emacs silently mishandles large integers sometimes.
11597 For example, "C-u 4294967297 M-x recenter" was treated as if
11598 it were "C-u 1 M-x recenter" on a typical 64-bit host.
11599
11600 * xdisp.c (try_window_id): Check Emacs fixnum range before
11601 converting to 'int'.
11602
11603 * window.c (window_scroll_line_based, Frecenter):
11604 Check that an Emacs fixnum is in range before assigning it to 'int'.
11605 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
11606 values converted from Emacs fixnums.
11607 (Frecenter): Don't wrap around a line count if it is out of 'int'
11608 range; instead, treat it as an extreme value.
11609 (Fset_window_configuration, compare_window_configurations):
11610 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
11611
11612 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
11613 that can exceed INT_MAX. Check that EMACS_INT value is in range
11614 before assigning it to the (possibly-narrower) index.
11615 (match_limit): Don't assume that a fixnum can fit in 'int'.
11616
11617 * print.c (print_object): Use ptrdiff_t, not int, for index that can
11618 exceed INT_MAX.
11619
11620 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
11621 (Fvertical_motion): Don't wrap around LINES values that don't fit
11622 in 'int'. Instead, treat them as extreme values. This is good
11623 enough for windows, which can't have more than INT_MAX lines anyway.
11624
11625 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11626
11627 * Require libxml/parser.h to avoid compilation warning.
11628
11629 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11630
11631 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11632 since this reportedly can destroy thread storage.
11633
11634 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
11635
11636 * syntax.c (find_defun_start): Update all cache variables if
11637 exiting early (Bug#9401).
11638
11639 2011-08-30 Eli Zaretskii <eliz@gnu.org>
11640
11641 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11642
11643 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11644 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
11645 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
11646
11647 * term.c (tty_append_glyph): New function.
11648 (produce_stretch_glyph): Static function and its prototype deleted.
11649
11650 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11651 Add prototypes.
11652
11653 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
11654
11655 * image.c (parse_image_spec): Check for nonnegative, not for positive,
11656 when checking :margin (Bug#9390).
11657 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
11658 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
11659 so that the name doesn't mislead. All uses changed.
11660
11661 2011-08-28 Johan Bockgård <bojohan@gnu.org>
11662
11663 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11664 set_tty_hooks.
11665
11666 2011-08-27 Eli Zaretskii <eliz@gnu.org>
11667
11668 * xdisp.c (move_it_to): Don't bail out early when reaching
11669 position beyond to_charpos, if we are scanning backwards.
11670 (move_it_vertically_backward): When DY == 0, make sure we get to
11671 the first character in the line after the newline.
11672
11673 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
11674
11675 * ccl.c: Improve and simplify overflow checking (Bug#9196).
11676 (ccl_driver): Do not generate an out-of-range pointer.
11677 (Fccl_execute_on_string): Remove unnecessary check for
11678 integer overflow, noted by Stefan Monnier in
11679 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11680 Remove a FIXME that didn't need fixing.
11681 Simplify the newly-introduced buffer reallocation code.
11682
11683 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
11684
11685 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11686
11687 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
11688
11689 Integer and memory overflow issues (Bug#9196).
11690
11691 * doc.c (get_doc_string): Rework so that
11692 get_doc_string_buffer_size is the actual buffer size, rather than
11693 being 1 less than the actual buffer size; this makes xpalloc more
11694 convenient.
11695
11696 * image.c (x_allocate_bitmap_record, cache_image):
11697 * xselect.c (Fx_register_dnd_atom):
11698 Simplify previous changes by using xpalloc.
11699
11700 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11701 since either will do and ptrdiff_t is convenient with xpalloc.
11702
11703 * charset.c (charset_table_size)
11704 (struct charset_sort_data.priority): Now ptrdiff_t.
11705 (charset_compare): Don't overflow if priorities differ greatly.
11706 (Fsort_charsets): Don't assume list length fits in int.
11707 Check for size-calculation overflow when allocating sort data.
11708 (syms_of_charset): Allocate an initial charset table that is
11709 just under 64 KiB, to avoid problems with glibc malloc and mmap.
11710
11711 * cmds.c (internal_self_insert): Check for size-calculation overflow.
11712
11713 * composite.h (struct composition.glyph_len): Now int, not unsigned.
11714 The actual value is always <= INT_MAX, and leaving it unsigned made
11715 overflow checking harder.
11716
11717 * dispextern.h (struct glyph_matrix.rows_allocated)
11718 (struct face_cache.size): Now ptrdiff_t, for convenience in use
11719 with xpalloc. The values are still always <= INT_MAX.
11720
11721 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
11722
11723 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
11724 (SAFE_NALLOCA): New macro.
11725
11726 * region-cache.c (struct boundary.pos, find_cache_boundary)
11727 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
11728 (set_cache_region, invalidate_region_cache)
11729 (revalidate_region_cache, know_region_cache, region_cache_forward)
11730 (region_cache_backward, pp_cache):
11731 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
11732 so that ptrdiff_t * can be passed to xpalloc.
11733 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
11734 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
11735 (pp_cache): Don't assume cache_len fits in int.
11736 * region-cache.h: Adjust extern decls to match.
11737
11738 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
11739 EMACS_INT, since either will do, for xpalloc.
11740
11741 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
11742 (xnmalloc, xnrealloc, xpalloc): New functions.
11743
11744 * bidi.c (bidi_shelve_header_size): New constant.
11745 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11746 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11747
11748 * bidi.c (bidi_cache_shrink):
11749 * buffer.c (overlays_at, overlays_in, record_overlay_string)
11750 (overlay_strings):
11751 Don't update size of array until after memory allocation succeeds,
11752 because xmalloc/xrealloc may not return.
11753 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11754 now that we have proper integer overflow checking.
11755 (record_overlay_string, overlay_strings): Catch overflows when
11756 calculating size of overlay_str_buf.
11757
11758 * callproc.c (Fcall_process): Check for size overflow when
11759 calculating size of args2.
11760 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11761 Normally we prefer signed values, but sticking with ptrdiff_t would
11762 require adding more-complicated checks.
11763
11764 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11765 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11766 Redo buffer-overflow calculations to avoid integer overflow.
11767 Add a FIXME comment where memory seems to be over-allocated.
11768
11769 * character.c (Fstring): Check for size-calculation overflow.
11770
11771 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11772 unnecessary integer overflow. Check for size overflow.
11773 (encode_coding_object): Don't update size until xmalloc succeeds.
11774
11775 * composite.c (get_composition_id): Check for overflow in glyph
11776 length calculations.
11777
11778 Integer and memory overflow fixes for display code.
11779 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11780 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11781 (scrolling_window): Check for overflow in size calculations.
11782 (line_draw_cost, realloc_glyph_pool, add_row_entry):
11783 Don't assume glyph table len fits in int.
11784 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11785 (row_table_size): Now ptrdiff_t, not int.
11786 (scrolling_window): Avoid overflow in size calculations.
11787 Don't update size until allocation succeeds.
11788 * fns.c (concat): Check for overflow in size calculations.
11789 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11790 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11791 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11792
11793 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11794 (get_doc_string): Check for size calculation overflow.
11795 Don't update size until allocation succeeds.
11796 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11797 EMACS_INT, where ptrdiff_t will do.
11798 (Fsubstitute_command_keys): Check for string overflow.
11799
11800 * editfns.c (set_time_zone_rule): Don't assume environment length
11801 fits in int.
11802 (message_length): Now ptrdiff_t, not int.
11803 (Fmessage_box): Don't update size until allocation succeeds.
11804 Don't assume message length fits in int.
11805 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11806
11807 * emacs.c (main): Do not reallocate argv, since there is a null at
11808 the end that can be overwritten, and this way there's no need to
11809 worry about size-calculation overflow.
11810 (sort_args): Check for size-calculation overflow.
11811
11812 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11813 alloc succeeds.
11814 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11815
11816 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11817 (x_set_scroll_bar_width, x_figure_window_size):
11818 Check for integer overflow.
11819 (x_set_alpha): Do not assume XINT fits in int.
11820
11821 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11822 This is for the members text_lines, text_cols, total_lines, total_cols,
11823 where the system imposes an 'int' limit.
11824
11825 * fringe.c (Fdefine_fringe_bitmap):
11826 Don't update size until alloc works.
11827
11828 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11829 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11830
11831 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11832 Check for size-calculation overflow.
11833 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11834 do, as we prefer signed integers.
11835 (id_to_widget.max_size, id_to_widget.used)
11836 (xg_store_widget_in_map, xg_remove_widget_from_map)
11837 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11838 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11839 Use and return ptrdiff_t, not int.
11840 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11841 * gtkutil.h: Change prototypes to match the above.
11842
11843 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11844 are duplicate now that they've been promoted to lisp.h.
11845 (x_allocate_bitmap_record, x_alloc_image_color)
11846 (make_image_cache, cache_image, xpm_load):
11847 Don't update size until alloc is done.
11848 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11849 (x_detect_edges):
11850 Check for size calculation overflow.
11851 (ct_colors_allocated_max): New constant.
11852 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11853 overflow.
11854
11855 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11856 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11857 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11858 Use ptrdiff_t, not int, to count maps.
11859 (read_char_minibuf_menu_prompt): Check for overflow in size
11860 calculations. Don't update size until allocation succeeds.
11861 Redo calculations to avoid overflow.
11862 * keyboard.h: Change prototypes to match the above.
11863
11864 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11865 to count maps.
11866 (current_minor_maps): Check for size calculation overflow.
11867 * keymap.h: Change prototypes to match the above.
11868
11869 * lread.c (read1, init_obarray): Don't update size until alloc done.
11870
11871 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11872 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11873
11874 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11875 Now ptrdiff_t, not int.
11876 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11877 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11878
11879 * process.c (Fnetwork_interface_list): Check for overflow
11880 in size calculation.
11881
11882 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11883
11884 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11885 overflow. Don't bother calling xmalloc when xrealloc will do.
11886
11887 * search.c (Freplace_match): Check for size calculation overflow.
11888 (Fset_match_data): Don't assume list lengths fit in 'int'.
11889
11890 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11891 for command line length. Do not attempt to address one before the
11892 beginning of an array, as that's not portable.
11893
11894 * term.c (max_frame_lines): Remove; unused.
11895 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11896 not int.
11897 (encode_terminal_code, calculate_costs): Check for size
11898 calculation overflow.
11899 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11900 table lengths and related sizes. Don't update size until alloc
11901 done. Redo calculations to avoid overflow.
11902 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11903
11904 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11905 subtracting pointers.
11906 (gobble_line): Check for overflow more carefully. Don't update size
11907 until alloc done.
11908
11909 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11910 Don't update size until alloc done.
11911 Redo size calculations to avoid overflow.
11912 Check for size calculation overflow.
11913 (main) [DEBUG]: Fix typo in invoking tparam1.
11914
11915 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11916 Use ptrdiff_t, not int, for sizes.
11917 (store_mode_line_noprop_char): Don't update size until alloc done.
11918
11919 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11920 Use ptrdiff_t, not int, for sizes.
11921 (Finternal_make_lisp_face, cache_face):
11922 Check for size calculation overflow.
11923 (cache_face): Treat size calculation overflows as if they were
11924 memory exhaustion (the usual treatment), rather than aborting.
11925
11926 * xfns.c (x_encode_text, x_set_name_internal)
11927 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11928 sizes, since they can exceed INT_MAX in size. Check for size
11929 calculation overflow.
11930
11931 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11932 (xg_select): Check for size calculation overflow.
11933 Don't update size until alloc done.
11934
11935 * xrdb.c (get_environ_db): Don't assume path length fits in int,
11936 as sprintf is limited to int lengths.
11937
11938 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11939 (X_LONG_MIN): New macros.
11940 Use them to make the following changes clearer.
11941 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11942 This change doesn't affect the value now, but it may help remind
11943 future maintainers not to raise the value too much later.
11944 (SELECTION_QUANTUM): Remove, replacing with ...
11945 (selection_quantum): ... new function, which avoids overflow.
11946 All uses changed.
11947 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11948 assumption that selection length fits in 'int'.
11949 (x_reply_selection_request, x_handle_selection_request)
11950 (x_get_window_property, receive_incremental_selection)
11951 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11952 (lisp_data_to_selection_data, clean_local_selection_data):
11953 Use ptrdiff_t, not int, to record length of selection.
11954 (x_reply_selection_request, x_get_window_property)
11955 (receive_incremental_selection, x_property_data_to_lisp):
11956 Redo calculations to avoid overflow.
11957 (x_reply_selection_request): When sending hint, ceiling it at
11958 X_LONG_MAX rather than relying on wraparound overflow to send
11959 something.
11960 (x_get_window_property, receive_incremental_selection)
11961 (lisp_data_to_selection_data, x_property_data_to_lisp):
11962 Check for size-calculation overflow.
11963 (x_get_window_property, receive_incremental_selection)
11964 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11965 Don't store size until memory allocation succeeds.
11966 (x_get_window_property): Plug memory leak on memory exhaustion.
11967 Don't double-block input; malloc is safe here. Don't assume 2**34
11968 - 4 fits in unsigned long. Add an xassert to check
11969 XGetWindowProperty overflow. Be more careful about overflow
11970 calculations, and distinguish size from memory overflow better.
11971 (receive_incremental_selection): When tracing, don't assume
11972 unsigned int is less than INT_MAX.
11973 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11974 harmful) conversions of unsigned short to int.
11975 (lisp_data_to_selection_data): Don't assume that integers
11976 in the range -65535 through -1 fit in an X unsigned short.
11977 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11978 result parameters unless successful. Rely on cons_to_unsigned
11979 to report problems with elements; the old code wasn't right anyway.
11980 (x_check_property_data): Check for int overflow; we cannot use
11981 a wider type due to X limits.
11982 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11983
11984 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
11985
11986 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11987 (x_term_init): Check for size calculation overflow.
11988 (x_color_cells): Don't store size until memory allocation succeeds.
11989 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
11990 Don't assume alloca size is less than MAX_ALLOCA.
11991 (x_term_init): Don't assume length fits in int (sprintf is limited
11992 to int size).
11993
11994 Use ptrdiff_t for composition IDs.
11995 * character.c (lisp_string_width):
11996 * composite.c (composition_table_size, n_compositions)
11997 (get_composition_id, composition_gstring_from_id):
11998 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11999 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12000 * window.c (Frecenter):
12001 Use ptrdiff_t, not int, for composition IDs.
12002 * composite.c (get_composition_id): Check for integer overflow.
12003 * composite.h: Adjust prototypes to match the above changes.
12004
12005 Use ptrdiff_t for hash table indexes.
12006 * category.c (hash_get_category_set):
12007 * ccl.c (ccl_driver):
12008 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12009 * coding.c (coding_system_charset_list, detect_coding_system):
12010 * coding.h (struct coding_system.id):
12011 * composite.c (get_composition_id, gstring_lookup_cache):
12012 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12013 * image.c (xpm_get_color_table_h):
12014 * lisp.h (hash_lookup, hash_put):
12015 * minibuf.c (Ftest_completion):
12016 Use ptrdiff_t for hash table indexes, not int (which is too
12017 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12018 32-bit --with-wide-int hosts).
12019
12020 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12021 Add a FIXME comment about memory leaks.
12022 (syms_of_charset): Don't assume xmalloc returns.
12023
12024 Don't assume that stated character widths fit in int.
12025 * character.c (Fchar_width, c_string_width, lisp_string_width):
12026 * character.h (CHAR_WIDTH):
12027 * indent.c (MULTIBYTE_BYTES_WIDTH):
12028 Use sanitize_char_width to avoid undefined and/or bad behavior
12029 with outlandish widths.
12030 * character.h (sanitize_tab_width): Rename from sanitize_width,
12031 now that we have two such functions. All uses changed.
12032 (sanitize_char_width): New inline function.
12033
12034 Don't assume that tab-width fits in int.
12035 * character.h (sanitize_width): New inline function.
12036 (SANE_TAB_WIDTH): New macro.
12037 (ASCII_CHAR_WIDTH): Use it.
12038 * indent.c (sane_tab_width): Remove. All uses replaced by
12039 SANE_TAB_WIDTH (current_buffer).
12040 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12041
12042 * fileio.c: Integer overflow issues with file modes.
12043 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12044
12045 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12046 Remove unreachable code.
12047 (read_hex, load_charset_map_from_file): Check for integer overflow.
12048
12049 * xterm.c: Don't go over XClientMessageEvent limit.
12050 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12051 (x_send_scroll_bar_event): Likewise. Check that the size does not
12052 exceed limits imposed by XClientMessageEvent, as well as the usual
12053 ptrdiff_t and size_t limits.
12054
12055 * keyboard.c: Overflow, signedness and related fixes.
12056 (make_lispy_movement): Use same integer type in forward decl
12057 that is used in the definition.
12058 (read_key_sequence, keyremap_step):
12059 Change bufsize argument back to int, undoing my 2011-03-30 change.
12060 We prefer signed types, and int is wide enough here.
12061 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12062 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12063 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12064 length, not size_t. Use ptrdiff_t for index, not int.
12065 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12066 possibility of integer overflow.
12067
12068 Overflow, signedness and related fixes for images.
12069
12070 * dispextern.h (struct it.stack[0].u.image.image_id)
12071 (struct_it.image_id, struct image.id, struct image_cache.size)
12072 (struct image_cache.used, struct image_cache.ref_count):
12073 * gtkutil.c (update_frame_tool_bar):
12074 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12075 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12076 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12077 * nsmenu.m (update_frame_tool_bar):
12078 * xdisp.c (calc_pixel_width_or_height):
12079 * xfns.c (image_cache_refcount):
12080 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12081 on typical 64-bit hosts.
12082
12083 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12084 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12085 Omit unnecessary casts to int.
12086 (parse_image_spec): Check that integers fall into 'int' range
12087 when the callers expect that.
12088 (image_ascent): Redo ascent calculation to avoid int overflow.
12089 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12090 (lookup_image): Remove unnecessary tests.
12091 (xbm_image_p): Locals are now of int, not EMACS_INT,
12092 since parse_image_check makes sure they fit into int.
12093 (png_load, gif_load, svg_load_image):
12094 Prefer int to unsigned where either will do.
12095 (tiff_handler): New function, combining the cores of the
12096 old tiff_error_handler and tiff_warning_handler.
12097 This function is rewritten to use vsnprintf and thereby avoid
12098 stack buffer overflows. It uses only the features of vsnprintf
12099 that are common to both POSIX and native Microsoft.
12100 (tiff_error_handler, tiff_warning_handler): Use it.
12101 (tiff_load, gif_load, imagemagick_load_image):
12102 Don't assume :index value fits in 'int'.
12103 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12104 (imagemagick_load_image): Check that crop parameters fit into
12105 the integer types that MagickCropImage accepts. Don't assume
12106 Vimagemagick_render_type has a nonnegative value. Don't assume
12107 size_t fits in 'long'.
12108 (gs_load): Use printmax_t to print the widest integers possible.
12109 Check for integer overflow when computing image height and width.
12110
12111 2011-08-26 Eli Zaretskii <eliz@gnu.org>
12112
12113 * xdisp.c (redisplay_window): Don't force window start if point
12114 will be invisible in the resulting window. (Bug#9324)
12115
12116 2011-08-25 Eli Zaretskii <eliz@gnu.org>
12117
12118 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12119 the display spec is of the form `(space ...)'.
12120 (handle_display_spec): Return the value returned by
12121 handle_single_display_spec, not just 1 or zero.
12122 (handle_single_display_spec): If the display spec is of the form
12123 `(space ...)', and specifies display in the text area, return 2
12124 rather than 1.
12125 (try_cursor_movement): Check for the need to scroll more
12126 accurately, and prefer exact match for point under bidi.
12127 Don't advance `row' beyond the last row of the window.
12128
12129 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12130 into disp_prop; all users changed.
12131
12132 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12133 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12134 for the text covered by the display property.
12135
12136 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
12137
12138 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12139 Change return value to nil.
12140 (Frecord_buffer): Delete unused function.
12141
12142 2011-08-24 Eli Zaretskii <eliz@gnu.org>
12143
12144 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12145 buffers, return left-to-right.
12146 (set_cursor_from_row): Consider candidate row a win if its glyph
12147 represents a newline and point is on that newline. Fixes cursor
12148 positioning on the newline at EOL of R2L text within L2R
12149 paragraph, and vice versa.
12150 (try_cursor_movement): Check continued rows, in addition to
12151 continuation rows. Fixes unwarranted scroll when point enters a
12152 continued line of R2L text within an L2R paragraph, or vice versa.
12153 (cursor_row_p): Consider the case of point being equal to
12154 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12155 from the end of a short line to the beginning of a continued line
12156 of R2L text within L2R paragraph.
12157 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12158 composed characters.
12159
12160 * bidi.c (bidi_check_type): Use xassert.
12161 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12162 members.
12163
12164 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12165
12166 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12167 a character.
12168
12169 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
12170
12171 * nsfont.m (ns_otf_to_script): Fix typo.
12172
12173 2011-08-22 Kenichi Handa <handa@m17n.org>
12174
12175 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12176 extra slot even if the purpose is char-code-property-table.
12177
12178 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12179
12180 * xdisp.c (redisplay_window): When computing centering_position,
12181 account for the height of the header line. (Bug#8874)
12182
12183 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12184 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12185 candidate is selected by the mouse, and that candidate has a
12186 composed character under the mouse.
12187
12188 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12189 coordinates reported by pos-visible-in-window-p for a composed
12190 character in column zero.
12191
12192 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12193
12194 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12195
12196 2011-08-22 Eli Zaretskii <eliz@gnu.org>
12197
12198 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12199 consider it a hit if to_charpos is anywhere in the range of the
12200 composed buffer positions.
12201
12202 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
12203
12204 * image.c (gif_load): Don't assume that each subimage has the same
12205 dimensions as the base image. Handle disposal method that is
12206 "undefined" by the gif spec (Bug#9335).
12207
12208 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
12209
12210 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
12211 (Fcondition_case): Document `debug' symbol in error handler.
12212
12213 2011-08-19 Eli Zaretskii <eliz@gnu.org>
12214
12215 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12216 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12217 from an Org mode buffer to a Speedbar frame.
12218
12219 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
12220 a composition, take its buffer position from IT->cmp_it.charpos.
12221 Fixes cursor positioning at the beginning of a line that begins
12222 with a composed character.
12223
12224 2011-08-18 Eli Zaretskii <eliz@gnu.org>
12225
12226 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
12227 character bidirectional type, use STRONG_L instead. Fixes crashes
12228 in a buffer produced by `describe-categories'.
12229
12230 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
12231 members before the level stack, so they would be saved and
12232 restored when copying iterator state. Fixes incorrect reordering
12233 around TABs covered by display properties.
12234
12235 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
12236
12237 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
12238
12239 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
12240
12241 * eval.c (internal_condition_case, internal_condition_case_1)
12242 (internal_condition_case_2, internal_condition_case_n):
12243 Remove unnecessary aborts (Bug#9081).
12244
12245 2011-08-17 Eli Zaretskii <eliz@gnu.org>
12246
12247 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
12248 has no `load' handler, try opening the file locally. (Bug#9311)
12249
12250 2011-08-16 Ken Brown <kbrown@cornell.edu>
12251
12252 * gmalloc.c: Expand comment.
12253
12254 2011-08-16 Eli Zaretskii <eliz@gnu.org>
12255
12256 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
12257 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
12258
12259 2011-08-16 Ken Brown <kbrown@cornell.edu>
12260
12261 Fix memory allocation problems in Cygwin build (Bug#9273).
12262
12263 * unexcw.c ( __malloc_initialized): Declare external variable.
12264 (fixup_executable): Force the dumped emacs to reinitialize malloc.
12265
12266 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
12267 New variables.
12268 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
12269 dumped emacs.
12270 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
12271 in the static heap.
12272 [CYGWIN] (special_realloc): New function.
12273 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
12274 requests to realloc storage in the static heap.
12275
12276 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
12277
12278 * bidi.c (bidi_initialize): Remove unused local.
12279
12280 2011-08-15 Eli Zaretskii <eliz@gnu.org>
12281
12282 * bidimirror.h:
12283 * biditype.h: Remove file.
12284 * makefile.w32-in ($(BLD)/bidi.$(O)):
12285 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
12286
12287 * dispextern.h: Fix a typo in the comment to bidi_type_t.
12288
12289 * chartab.c: Improve commentary for the uniprop_table API.
12290
12291 * bidi.c (bidi_paragraph_init): Support zero value of
12292 bidi_ignore_explicit_marks_for_paragraph_level.
12293 (bidi_initialize): Use uniprop_table instead of including
12294 biditype.h and bidimirror.h.
12295
12296 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
12297 coordinates of the iterator when restoring from ppos_it.
12298 (Bug#9296)
12299
12300 2011-08-14 Kenichi Handa <handa@m17n.org>
12301
12302 * process.c (create_process): Call setup_process_coding_systems
12303 after the pid of the process is set to -1 (Bug#8162).
12304
12305 2011-08-14 Eli Zaretskii <eliz@gnu.org>
12306
12307 * xdisp.c (move_it_in_display_line_to): Don't invoke
12308 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
12309 ppos_it. Fixes vertical cursor motion when line beginning is
12310 covered by an image. (Bug#9296)
12311
12312 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
12313
12314 * nsterm.h (ns_run_ascript): Declare.
12315 (NSAPP_DATA2_RUNASSCRIPT): Define.
12316
12317 * nsfns.m (as_script, as_result, as_status): New static variables.
12318 (ns_run_ascript): New function.
12319 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
12320 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
12321 the event loop. Get status from as_status (Bug#7276).
12322
12323 * nsterm.m (sendEvent): If event is NSApplicationDefined and
12324 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
12325 the event loop (Bug#7276).
12326
12327 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
12328
12329 * gnutls.c (QCgnutls_bootprop_priority)
12330 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
12331 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
12332 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
12333 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
12334 (QCgnutls_bootprop_verify_hostname_error)
12335 (QCgnutls_bootprop_callbacks_verify): Rename from
12336 Qgnutls_bootprop_..., all uses changed.
12337
12338 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
12339 uses changed.
12340
12341 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
12342
12343 * xfaces.c (Qframe_set_background_mode): Now static.
12344 * dispextern.h (Qframe_set_background_mode): Remove decl.
12345
12346 * process.c (Fnetwork_interface_info): Declare local only if needed.
12347
12348 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
12349
12350 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
12351 (Fnetwork_interface_list): Allocate in increments of bytes instead
12352 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
12353 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
12354 sockaddr.
12355 (struct ifflag_def): notrailers is smart on OSX.
12356 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
12357 Get hardware address with getifaddrs if available.
12358
12359 2011-08-12 Eli Zaretskii <eliz@gnu.org>
12360
12361 * xdisp.c (iterate_out_of_display_property): xassert that
12362 IT->position is set to within IT->object's boundaries. Break from
12363 the loop as soon as EOB is reached; avoids infloops in redisplay
12364 when IT->position is set up wrongly due to some bug.
12365 Set IT->current to match the bidi iterator unconditionally.
12366 (push_display_prop): Allow GET_FROM_STRING as IT->method on
12367 entry. Force push_it to save on the stack the current
12368 buffer/string position, to be restored by pop_it. Fix flags in
12369 the iterator structure wrt the object coming from a display
12370 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
12371 properties. (Bug#9284)
12372
12373 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
12374
12375 * fontset.c (fontset_get_font_group): Add proper type checks.
12376 (Bug#9172)
12377
12378 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12379
12380 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
12381 and LC_VERSION_MIN_MACOSX.
12382 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
12383 (dump_it) [LC_FUNCTION_STARTS]: Use it.
12384
12385 2011-08-08 Eli Zaretskii <eliz@gnu.org>
12386
12387 * xdisp.c (forward_to_next_line_start): Allow to use the
12388 no-display-properties-and-no-overlays under bidi display.
12389 Set disp_pos in the bidi iterator to avoid searches for display
12390 properties and overlays.
12391
12392 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
12393
12394 * editfns.c (Fset_time_zone_rule): Document relationship with the
12395 setenv function.
12396
12397 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
12398 the font entity extracted from the cache (Bug#8109).
12399
12400 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
12401
12402 * composite.c (autocmp_chars): Don't reset point. That is done by
12403 restore_point_unwind (Bug#5984).
12404
12405 2011-08-07 Juri Linkov <juri@jurta.org>
12406
12407 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
12408 to show the arg `TIME' instead of `TIMEVAL'.
12409
12410 2011-08-06 Eli Zaretskii <eliz@gnu.org>
12411
12412 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
12413 display property strides EOL and includes a newline, as in
12414 longlines-mode. (Bug#9254)
12415 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
12416 word-wrap under bidirectional display. (Bug#9224)
12417
12418 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12419 is non-zero, even if the data buffer is NULL. Fixes a crash in
12420 vertical-motion with longlines-mode. (Bug#9254)
12421
12422 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12423
12424 * bidi.c <bidi_cache_total_alloc>: Now static.
12425 (bidi_initialize): Initialize bidi_cache_total_alloc.
12426
12427 * xdisp.c (display_line): Release buffer allocated for shelved bidi
12428 cache. (Bug#9221)
12429
12430 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
12431 amount allocated this far in `bidi_cache_total_alloc'.
12432 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
12433 non-zero, only free the data buffer without restoring the cache
12434 contents. All callers changed.
12435
12436 * dispextern.h (bidi_unshelve_cache): Update prototype.
12437
12438 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
12439 (move_it_in_display_line, move_it_to)
12440 (move_it_vertically_backward, move_it_by_lines): Replace the call
12441 to xfree to an equivalent call to bidi_unshelve_cache.
12442 (move_it_in_display_line_to): Fix logic of returning
12443 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
12444
12445 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12446
12447 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12448 came from a string character with a `cursor' property. (Bug#9229)
12449
12450 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12451
12452 * Makefile.in (LIB_PTHREAD): New variable.
12453 (LIBES): Add LIB_PTHREAD (Bug#9216).
12454
12455 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12456 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12457
12458 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
12459
12460 * regex.c (re_iswctype): Remove some redundant boolean conversions.
12461
12462 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12463
12464 * xterm.c (x_find_topmost_parent): New function.
12465 (x_set_frame_alpha): Find topmost parent window with
12466 x_find_topmost_parent and set the property there also (bug#9181).
12467 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12468
12469 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
12470
12471 * callproc.c (Fcall_process): Avoid vfork clobbering
12472 the local vars buffer, coding_systems, current_dir.
12473
12474 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
12475
12476 * keymap.c (Fmake_composed_keymap): Move to subr.el.
12477
12478 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
12479
12480 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
12481 so that it is not optimized away.
12482
12483 * xdisp.c (compute_display_string_pos): Remove unused local.
12484
12485 2011-08-02 Eli Zaretskii <eliz@gnu.org>
12486
12487 Fix slow cursor motion and scrolling in large buffers with
12488 selective display, like Org Mode buffers. (Bug#9218)
12489
12490 * dispextern.h (struct bidi_it): New member disp_prop_p.
12491
12492 * xdisp.c: Remove one-slot cache of display string positions.
12493 (compute_display_string_pos): Accept an additional argument
12494 DISP_PROP_P; callers changed. Scan at most 5K characters forward
12495 for a display string or property. If found, set DISP_PROP_P
12496 non-zero.
12497
12498 * bidi.c (bidi_fetch_char): Accept an additional argument
12499 DISP_PROP_P, and pass it to compute_display_string_pos.
12500 Only handle text covered by a display string if DISP_PROP_P is returned
12501 non-zero. All callers of bidi_fetch_char changed.
12502
12503 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
12504
12505 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12506
12507 2010-12-03 Don March <don@ohspite.net>
12508
12509 * keymap.c (Fdefine_key): Fix non-prefix key error message when
12510 last character M-[char] is translated to ESC [char] (bug#7541).
12511
12512 2011-08-02 Kenichi Handa <handa@m17n.org>
12513
12514 * lisp.h (uniprop_table): Extern it.
12515
12516 * chartab.c (uniprop_table): Make it non-static.
12517
12518 2011-08-01 Eli Zaretskii <eliz@gnu.org>
12519
12520 * xdisp.c (forward_to_next_line_start): Accept additional argument
12521 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12522 on the newline.
12523 (reseat_at_next_visible_line_start): Use the bidi iterator state
12524 returned by forward_to_next_line_start to restore the state of
12525 it->bidi_it after backing up to previous newline. (Bug#9212)
12526
12527 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12528
12529 * regex.c (re_comp): Protoize.
12530 (re_exec): Fix return type.
12531 (regexec): Fix type of `ret'. (Bug#9203)
12532
12533 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12534
12535 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12536 This is needed if max-image-size is a floating-point number.
12537
12538 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12539
12540 * print.c (print_object): Print empty symbol as ##.
12541
12542 * lread.c (read1): Read ## as empty symbol.
12543
12544 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12545
12546 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12547 setting frame foreground color (Bug#9175).
12548 (x_set_background_color): Likewise.
12549
12550 * nsmenu.m (-setText): Size tooltip dimensions precisely to
12551 contents (Bug#9176).
12552 (EmacsTooltip -init): Remove bezels and add shadows to
12553 tooltip windows.
12554
12555 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12556 or scroll bar (Bug#8470).
12557
12558 * nsfont.m (nsfont_open): Remove assignment to voffset and
12559 unnecessary vars hshink, expand, hd, full_height, min_height.
12560 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12561
12562 * nsterm.h (nsfont_info): Remove voffset field.
12563
12564 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12565
12566 Implement strike-through and overline on NextStep (Bug#8863).
12567
12568 * nsfont.m (nsfont_open): Use underline position provided by font,
12569 instead of hard-coded value of 2.
12570 (nsfont_draw): Call ns_draw_text_decoration instead.
12571
12572 * nsterm.h: Add declaration for ns_draw_text_decoration.
12573
12574 * nsterm.m (ns_draw_text_decoration): New function for drawing
12575 underline, overline, and strike-through.
12576 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
12577 ns_draw_text_decoration. Change treatment of cursor drawing to
12578 accommodate underlining, etc.
12579
12580 2011-07-28 Eli Zaretskii <eliz@gnu.org>
12581
12582 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
12583 default.
12584
12585 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12586
12587 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
12588 Without this fix, if a signal arrives just after memory fills up,
12589 'malloc' might be invoked reentrantly.
12590
12591 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
12592 In other words, assume that every image size is allowed, on non-X
12593 hosts. This assumption is probably wrong, but it lets Emacs compile.
12594
12595 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12596
12597 * regex.c (re_iswctype): Convert return values to boolean.
12598
12599 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
12600
12601 * xdisp.c (compute_display_string_pos): Don't use cached display
12602 string position if the buffer had its restriction changed.
12603 (Bug#9184)
12604
12605 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12606
12607 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12608
12609 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12610
12611 Integer signedness and overflow and related fixes. (Bug#9079)
12612
12613 * bidi.c: Integer size and overflow fixes.
12614 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
12615 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
12616 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12617 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
12618 (bidi_find_other_level_edge):
12619 Use ptrdiff_t instead of EMACS_INT where either will do.
12620 This works better on 32-bit hosts configured --with-wide-int.
12621 (bidi_cache_ensure_space): Check for size-calculation overflow.
12622 Use % rather than repeated addition, for better worst-case speed.
12623 Don't set bidi_cache_size until after xrealloc returns, because it
12624 might not return.
12625 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
12626 (bidi_cache_ensure_space): Also check that the bidi cache size
12627 does not exceed that of the largest Lisp string or buffer. See Eli
12628 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
12629
12630 * alloc.c (__malloc_size_t): Remove.
12631 All uses replaced by size_t. See Andreas Schwab's note
12632 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12633
12634 * image.c: Improve checking for integer overflow.
12635 (check_image_size): Assume that f is nonnull, since
12636 it is always nonnull in practice. This is one less thing to
12637 worry about when checking for integer overflow later.
12638 (x_check_image_size): New function, which checks for integer
12639 overflow issues inside X.
12640 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12641 This removes the need for a memory_full check.
12642 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12643 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12644 (xbm_read_bitmap_data): Change locals back to 'int', since
12645 their values must fit in 'int'.
12646 (xpm_load_image, png_load, tiff_load):
12647 Invoke x_create_x_image_and_pixmap earlier,
12648 to avoid much needless work if the image is too large.
12649 (tiff_load): Treat overly large images as if
12650 x_create_x_image_and_pixmap failed, not as malloc failures.
12651 (gs_load): Use x_check_image_size.
12652
12653 * gtkutil.c: Omit integer casts.
12654 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12655 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12656
12657 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12658
12659 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12660 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12661 would wrongly return t on a 64-bit host.
12662
12663 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12664 The plain *_OVERFLOW macros run afoul of GCC bug 49705
12665 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12666 and therefore cause GCC to emit a bogus diagnostic in some cases.
12667
12668 * image.c: Integer signedness and overflow and related fixes.
12669 This is not an exhaustive set of fixes, but it's time to
12670 record what I've got.
12671 (lookup_pixel_color, check_image_size): Remove redundant decls.
12672 (check_image_size): Don't assume that arbitrary EMACS_INT values
12673 fit in 'int', or that arbitrary 'double' values fit in 'int'.
12674 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12675 (tiff_load, imagemagick_load_image):
12676 Check for overflow in size calculations.
12677 (x_create_x_image_and_pixmap): Remove unnecessary test for
12678 xmalloc returning NULL; that can't happen.
12679 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12680 (xpm_color_bucket): Use better integer hashing function.
12681 (xpm_cache_color): Don't possibly over-allocate memory.
12682 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12683 (gif_memory_source):
12684 Use ptrdiff_t, not int or size_t, to record sizes.
12685 (png_load): Don't assume values greater than 2**31 fit in 'int'.
12686 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12687 either works, as we prefer signed integers.
12688 (tiff_read_from_memory, tiff_write_from_memory):
12689 Return tsize_t, not size_t, since that's what the TIFF API wants.
12690 (tiff_read_from_memory): Don't fail simply because the read would
12691 go past EOF; instead, return a short read.
12692 (tiff_load): Omit no-longer-needed casts.
12693 (Fimagemagick_types): Don't assume size fits into 'int'.
12694
12695 Improve hashing quality when configured --with-wide-int.
12696 * fns.c (hash_string): New function, taken from sxhash_string.
12697 Do not discard information about ASCII character case; this
12698 discarding is no longer needed.
12699 (sxhash-string): Use it. Change sig to match it. Caller changed.
12700 * lisp.h: Declare it.
12701 * lread.c (hash_string): Remove, since we now use fns.c's version.
12702 The fns.c version returns a wider integer if --with-wide-int is
12703 specified, so this should help the quality of the hashing a bit.
12704
12705 * emacs.c: Integer overflow minor fix.
12706 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
12707 Define only if GNU_LINUX.
12708 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12709
12710 * dispnew.c: Integer signedness and overflow fixes.
12711 Remove unnecessary forward decls, that were a maintenance hassle.
12712 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12713 All uses changed.
12714 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
12715 (scrolling_window): Use ptrdiff_t, not int, for byte count.
12716 (prepare_desired_row, line_draw_cost):
12717 Use int, not unsigned, where either works.
12718 (save_current_matrix, restore_current_matrix):
12719 Use ptrdiff_t, not size_t, where either works.
12720 (init_display): Check for overflow more accurately, and without
12721 relying on undefined behavior.
12722
12723 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
12724 Remove, replacing with the new symbols in lisp.h. All uses changed.
12725 * fileio.c (make_temp_name):
12726 * filelock.c (lock_file_1, lock_file):
12727 * xdisp.c (message_dolog):
12728 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
12729 Use pMd etc. instead.
12730 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
12731 replacing the pWIDE etc. symbols removed from editfns.c.
12732
12733 * keyboard.h (num_input_events): Now uintmax_t.
12734 This is (very slightly) less likely to mess up due to wraparound.
12735 All uses changed.
12736
12737 * buffer.c: Integer signedness fixes.
12738 (alloc_buffer_text, enlarge_buffer_text):
12739 Use ptrdiff_t rather than size_t when either will do, as we prefer
12740 signed integers.
12741
12742 * alloc.c: Integer signedness and overflow fixes.
12743 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
12744 (__malloc_size_t): Default to size_t, not to int.
12745 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12746 (Fgarbage_collect, mark_object_loop_halt, mark_object):
12747 Prefer ptrdiff_t to size_t when either would do, as we prefer
12748 signed integers.
12749 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12750 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12751 Now const. Initialize with values that are in range even if char
12752 is signed.
12753 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12754 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
12755 These functions do the right thing with sizes > 2**32.
12756 (check_depth): Now ptrdiff_t, not int.
12757 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12758 Adjust to new way of storing sizes. Check for size overflow bugs
12759 in rest of code.
12760 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
12761 slightly wrong anyway, as it missed one instance of
12762 XMALLOC_OVERRUN_CHECK_OVERHEAD.
12763 (refill_memory_reserve): Omit needless cast to size_t.
12764 (mark_object_loop_halt): Mark as externally visible.
12765
12766 * xselect.c: Integer signedness and overflow fixes.
12767 (Fx_register_dnd_atom, x_handle_dnd_message):
12768 Use ptrdiff_t, not size_t, since we prefer signed.
12769 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12770 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12771 x_dnd_atoms_size and x_dnd_atoms_length.
12772
12773 * doprnt.c: Prefer signed to unsigned when either works.
12774 * eval.c (verror):
12775 * doprnt.c (doprnt):
12776 * lisp.h (doprnt):
12777 * xdisp.c (vmessage):
12778 Use ptrdiff_t, not size_t, when using or implementing doprnt,
12779 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12780 prefer signed arithmetic to avoid comparison confusion.
12781 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12782 but is a bit tricky.
12783
12784 Assume freestanding C89 headers, string.h, stdlib.h.
12785 * data.c, doprnt.c, floatfns.c, print.c:
12786 Include float.h unconditionally.
12787 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12788 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12789 * regex.c: Likewise for stddef.h, string.h.
12790 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12791 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12792 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12793 (STDC_HEADERS): Remove obsolete defines.
12794 * sysdep.c: Include limits.h unconditionally.
12795
12796 Assume support for memcmp, memcpy, memmove, memset.
12797 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12798 * regex.c (memcmp, memcpy):
12799 Remove; we assume C89 now.
12800
12801 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12802 (__malloc_safe_bcopy): Remove; no longer needed.
12803
12804 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
12805 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12806 well either way, and we prefer signed to unsigned.
12807
12808 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12809
12810 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12811 closes the connection while we're reading (bug#9182).
12812
12813 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
12814
12815 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12816 are specified (Bug#9168).
12817
12818 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12819
12820 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12821 Found by GCC static checking and --with-wide-int on a 32-bit host.
12822
12823 2011-07-25 Eli Zaretskii <eliz@gnu.org>
12824
12825 * xdisp.c (compute_display_string_pos): Fix logic of caching
12826 previous display string position. Initialize cached_prev_pos to
12827 -1. Fixes slow-down at the beginning of a buffer.
12828
12829 2011-07-24 Eli Zaretskii <eliz@gnu.org>
12830
12831 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12832 for attrs[LFACE_FONTSET_INDEX].
12833
12834 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12835
12836 * xml.c (parse_region): Remove unused local
12837 that was recently introduced.
12838
12839 2011-07-23 Eli Zaretskii <eliz@gnu.org>
12840
12841 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12842 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12843
12844 * xdisp.c (move_it_in_display_line_to): Record the best matching
12845 position for TO_CHARPOS while scanning the line, and restore it on
12846 exit if none of the characters scanned was an exact match.
12847 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
12848 when exact match is impossible due to invisible text, and the
12849 lines are truncated.
12850
12851 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12852
12853 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12854 for OSX >= 10.7.
12855
12856 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12857
12858 Fix a significant slow-down of cursor motion with C-n, C-p,
12859 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12860 auto-repeat under bidi redisplay in fontified buffers.
12861 * xdisp.c (compute_stop_pos_backwards): New function.
12862 (next_element_from_buffer): Call compute_stop_pos_backwards to
12863 find a suitable prev_stop when we find ourselves before
12864 base_level_stop.
12865 (reseat): Don't look for prev_stop, as that could mean a very long
12866 run.
12867 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12868 <cached_disp_overlay_modiff>: Cache for last found display string
12869 position.
12870 (compute_display_string_pos): Return the cached position if asked
12871 about the same buffer in the same area of character positions, and
12872 the buffer wasn't changed since the time the display string
12873 position was cached.
12874
12875 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12876
12877 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12878 is an integer, which is important for empty lines. (Bug#9149)
12879
12880 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
12881
12882 * frame.c (Fmodify_frame_parameters): In tty case, update the
12883 default face if necessary (Bug#4238).
12884
12885 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
12886
12887 * editfns.c (Fstring_to_char): No need to explain what a character
12888 is in the docstring (Bug#6576).
12889
12890 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12891
12892 * xml.c (parse_region): Make sure we always return a tree.
12893
12894 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12895
12896 * xml.c (parse_region): If a document contains only comments,
12897 return that, too.
12898
12899 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12900
12901 * xml.c (make_dom): Return comments, too.
12902
12903 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12904
12905 Port to OpenBSD.
12906 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12907 and the surrounding thread.
12908 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12909 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12910 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12911 timer goes off.
12912 * s/openbsd.h (BROKEN_SIGIO): Define.
12913 * unexelf.c (unexec) [__OpenBSD__]:
12914 Don't update the .mdebug section of the Alpha COFF symbol table.
12915
12916 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12917
12918 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12919 (bug#8460).
12920
12921 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12922
12923 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12924 This fixes some race conditions on the permissions of any newly
12925 created file.
12926
12927 * alloc.c (valid_pointer_p): Use pipe, not open.
12928 This fixes some permissions issues when debugging.
12929
12930 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12931 If fchown fails to set both uid and gid, try to set just gid,
12932 as that is sometimes allowed. Adjust the file's mode to eliminate
12933 setuid or setgid bits that are inappropriate if fchown fails.
12934
12935 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12936
12937 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12938 to compare Lisp_Objects.
12939 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12940 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12941 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12942
12943 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12944
12945 * lread.c (read_integer): Unread even EOF character.
12946 (read1): Likewise. Properly record start position of symbol.
12947
12948 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12949 symbol character follows.
12950
12951 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12952
12953 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12954 This works around a problem with the previous change to Fcopy_file.
12955 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12956 and without this change, GCC might complain about discarding
12957 fchown's return value.
12958
12959 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
12960
12961 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12962
12963 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12964
12965 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12966
12967 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12968
12969 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12970 it's used from the C level.
12971
12972 * process.c: Use the same condition for POLL_FOR_INPUT in both
12973 keyboard.c and process.c (bug#1858).
12974
12975 2011-07-09 Lawrence Mitchell <wence@gmx.li>
12976
12977 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12978 (Fgnutls_boot): Use it.
12979
12980 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12981
12982 * doc.c (Fsubstitute_command_keys): Revert last change.
12983
12984 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12985
12986 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12987 quotes the next character, and doesn't affect other longer
12988 sequences (bug#8935).
12989
12990 * lread.c (syms_of_lread): Clarify that is isn't only
12991 `eval-buffer' and `eval-defun' that's affected by
12992 `lexical-binding' (bug#8460).
12993
12994 2011-07-15 Eli Zaretskii <eliz@gnu.org>
12995
12996 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
12997 bidi redisplay when a line includes both an image and is truncated.
12998
12999 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13000
13001 Fix minor problems found by static checking.
13002 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13003 (elsz): Now a signed constant, not a size_t var. We prefer signed
13004 types to unsigned, to avoid integer comparison confusion. Without
13005 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13006 "cannot optimize loop, the loop counter may overflow", a symptom
13007 of the confusion.
13008 * indent.c (Fvertical_motion): Mark locals as initialized.
13009 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13010
13011 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13012
13013 * search.c (Fre_search_backward): Mention `case-fold-search' in
13014 all the re_search_* functions (bug#8138).
13015
13016 * keyboard.c (Fopen_dribble_file): Document when the file is
13017 closed (bug#8056).
13018
13019 2011-07-14 Eli Zaretskii <eliz@gnu.org>
13020
13021 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13022 bidi_cache_idx.
13023
13024 Support bidi reordering of display and overlay strings.
13025 * xdisp.c (compute_display_string_pos)
13026 (compute_display_string_end): Accept additional argument STRING.
13027 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13028 (reseat_to_string): Initialize bidi_it->string.s and
13029 bidi_it->string.schars.
13030 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
13031 NULL (avoids a crash in bidi_paragraph_init).
13032 Initialize itb.string.lstring.
13033 (init_iterator): Call bidi_init_it only of a valid
13034 buffer position was specified. Initialize paragraph_embedding to
13035 L2R.
13036 (reseat_to_string): Initialize the bidi iterator.
13037 (display_string): If we need to ignore text properties of
13038 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13039 original value of -1 will not work with bidi.)
13040 (compute_display_string_pos): First arg is now struct
13041 `text_pos *'; all callers changed. Support display properties on
13042 Lisp strings.
13043 (compute_display_string_end): Support display properties on Lisp
13044 strings.
13045 (init_iterator, reseat_1, reseat_to_string): Initialize the
13046 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13047 when iterating on a string not from display properties).
13048 (compute_display_string_pos, compute_display_string_end):
13049 Fix calculation of the object to scan. Fixes an error when using
13050 arrow keys.
13051 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
13052 base_level_stop; instead, set base_level_stop to BEGV.
13053 Fixes crashes in vertical-motion.
13054 (next_element_from_buffer): Improve commentary for when
13055 the iterator is before prev_stop.
13056 (init_iterator): Initialize bidi_p from the default value of
13057 bidi-display-reordering, not from buffer-local value. Use the
13058 buffer-local value only if initializing for buffer iteration.
13059 (handle_invisible_prop): Support invisible properties on strings
13060 that are being bidi-reordered.
13061 (set_iterator_to_next): Support bidi reordering of C strings and
13062 Lisp strings.
13063 (next_element_from_string): Support bidi reordering of Lisp
13064 strings.
13065 (handle_stop_backwards): Support Lisp strings as well.
13066 (display_string): Support display of R2L glyph rows.
13067 Use IT_STRING_CHARPOS when displaying from a Lisp string.
13068 (init_iterator): Don't initialize it->bidi_p for strings
13069 here.
13070 (reseat_to_string): Initialize it->bidi_p for strings here.
13071 (next_element_from_string, next_element_from_c_string)
13072 (next_element_from_buffer): Add xassert's for correspondence
13073 between IT's object being iterated and it->bidi_it.string
13074 structure.
13075 (face_before_or_after_it_pos): Support bidi iteration.
13076 (next_element_from_c_string): Handle the case of the first string
13077 character that is not the first one in the visual order.
13078 (get_visually_first_element): New function, refactored from common
13079 parts of next_element_from_buffer, next_element_from_string, and
13080 next_element_from_c_string.
13081 (tool_bar_lines_needed, redisplay_tool_bar)
13082 (display_menu_bar): Force left-to-right direction. Add a FIXME
13083 comment for making that be controlled by a user option.
13084 (push_it, pop_it): Save and restore the state of the
13085 bidi iterator. Save and restore the bidi_p flag.
13086 (pop_it): Iterate out of display property for string iteration as
13087 well.
13088 (iterate_out_of_display_property): Support iteration over strings.
13089 (handle_single_display_spec): Set up it->bidi_it for iteration
13090 over a display string, and call bidi_init_it.
13091 (handle_single_display_spec, next_overlay_string)
13092 (get_overlay_strings_1, push_display_prop): Set up the bidi
13093 iterator for displaying display or overlay strings.
13094 (forward_to_next_line_start): Don't use the shortcut if
13095 bidi-iterating.
13096 (back_to_previous_visible_line_start): If handle_display_prop
13097 pushed the iterator stack, restore the internal state of the bidi
13098 iterator by calling bidi_pop_it same number of times.
13099 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13100 and we are bidi-iterating, don't decrement the iterator position;
13101 instead, set the first_elt flag in the bidi iterator, to produce
13102 the same effect.
13103 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13104 (push_display_prop): xassert that we are iterating a buffer.
13105 (push_it, pop_it): Save and restore paragraph_embedding member.
13106 (handle_single_display_spec, next_overlay_string)
13107 (get_overlay_strings_1, reseat_1, reseat_to_string)
13108 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13109 correctly. Don't assume unibyte strings are not bidi-reordered.
13110 (compute_display_string_pos)
13111 (compute_display_string_end): Fix handling the case of C string.
13112 (push_it, pop_it): Save and restore from_disp_prop_p.
13113 (handle_single_display_spec, push_display_prop): Set the
13114 from_disp_prop_p flag.
13115 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13116 (pop_it): Call iterate_out_of_display_property only if we are
13117 popping after iteration over a string that came from a display
13118 property. Fix a typo in popping stretch info. Add an assertion
13119 for verifying that the iterator position is in sync with the bidi
13120 iterator.
13121 (handle_single_display_spec, get_overlay_strings_1)
13122 (push_display_prop): Fix initialization of paragraph direction for
13123 string when that of the parent object is not yet determined.
13124 (reseat_1): Call bidi_init_it to resync the bidi
13125 iterator with IT's position. (Bug#7616)
13126 (find_row_edges): If ROW->start.pos gives position
13127 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13128 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13129 Reset the from_disp_prop_p flag.
13130 (SAVE_IT, RESTORE_IT): New macros.
13131 (pos_visible_p, face_before_or_after_it_pos)
13132 (back_to_previous_visible_line_start)
13133 (move_it_in_display_line_to, move_it_in_display_line)
13134 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13135 (try_scrolling, redisplay_window, display_line): Use them when
13136 saving a temporary copy of the iterator and restoring it back.
13137 (back_to_previous_visible_line_start, reseat_1)
13138 (init_iterator): Empty the bidi cache "stack".
13139 (move_it_in_display_line_to): If iterator ended up at
13140 EOL, but we never saw any buffer positions smaller than
13141 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13142 motion in bidi-reordered lines.
13143 (move_it_in_display_line_to): Record prev_method and prev_pos
13144 immediately before the call to set_iterator_to_next. Fixes cursor
13145 motion in bidi-reordered lines with stretch glyphs and strings
13146 displayed in margins. (Bug#8133) (Bug#8867)
13147 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13148 TO_CHARPOS.
13149 (pos_visible_p): Support positions in bidi-reordered lines.
13150 Save and restore bidi cache.
13151
13152 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13153 (bidi_paragraph_info): Delete unused struct.
13154 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13155 (bidi_cache_start): New variable.
13156 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13157 to zero.
13158 (bidi_cache_fetch_state, bidi_cache_search)
13159 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13160 (bidi_cache_find, bidi_peek_at_next_level)
13161 (bidi_level_of_next_char, bidi_find_other_level_edge)
13162 (bidi_move_to_visually_next): Compare cache index with
13163 bidi_cache_start rather than with zero.
13164 (bidi_fetch_char): Accept new argument STRING; all callers
13165 changed. Support iteration over a string. Support strings with
13166 display properties. Support unibyte strings. Fix the type of
13167 `len' according to what STRING_CHAR_AND_LENGTH expects.
13168 (bidi_paragraph_init, bidi_resolve_explicit_1)
13169 (bidi_resolve_explicit, bidi_resolve_weak)
13170 (bidi_level_of_next_char, bidi_move_to_visually_next):
13171 Support iteration over a string.
13172 (bidi_set_sor_type, bidi_resolve_explicit_1)
13173 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13174 can now be zero (for strings); special values 0 and -1 were
13175 changed to -1 and -2, respectively.
13176 (bidi_char_at_pos): New function.
13177 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13178 Call it instead of FETCH_MULTIBYTE_CHAR.
13179 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13180 initialized to valid values.
13181 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13182 values.
13183 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13184 the test for valid cached positions. Fix the logic for looking up
13185 the sentinel state in the cache. GCPRO the Lisp string we are
13186 iterating.
13187 (bidi_push_it, bidi_pop_it): New functions.
13188 (bidi_initialize): Initialize the bidi cache start stack pointer.
13189 (bidi_cache_ensure_space): New function, refactored from part of
13190 bidi_cache_iterator_state. Don't assume the required size is just
13191 one BIDI_CACHE_CHUNK away.
13192 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13193 (bidi_count_bytes, bidi_char_at_pos): New functions.
13194 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13195 always valid if bidi_cache_idx is valid.
13196 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13197 is valid if it's going to be used.
13198 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13199 (bidi_cache_fetch_state, bidi_cache_search)
13200 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13201 (bidi_cache_iterator_state, bidi_cache_find)
13202 (bidi_find_other_level_edge, bidi_cache_start_stack):
13203 All variables related to cache indices are now EMACS_INT.
13204
13205 * dispextern.h (struct bidi_string_data): New structure.
13206 (struct bidi_it): New member `string'. Make flag members be 1-bit
13207 fields, and put them last in the struct.
13208 (compute_display_string_pos, compute_display_string_end):
13209 Update prototypes.
13210 (bidi_push_it, bidi_pop_it): Add prototypes.
13211 (struct iterator_stack_entry): New members bidi_p,
13212 paragraph_embedding, and from_disp_prop_p.
13213 (struct it): Member bidi_p is now a bit field 1 bit wide.
13214 (bidi_shelve_cache, bidi_unshelve_cache):
13215 Declare prototypes.
13216
13217 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13218 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
13219 and vector-like objects.
13220
13221 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
13222 cache around display iteration.
13223
13224 * window.c (Fwindow_end, window_scroll_pixel_based)
13225 (displayed_window_lines, Frecenter): Save and restore the bidi
13226 cache around display iteration.
13227
13228 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13229
13230 * editfns.c (Fdelete_region): Clarify the use of the named
13231 parameters (bug#6788).
13232
13233 2011-07-14 Martin Rudalics <rudalics@gmx.at>
13234
13235 * indent.c (Fvertical_motion): Set and restore w->pointm when
13236 saving and restoring the window's buffer (Bug#9006).
13237
13238 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13239
13240 * editfns.c (Fstring_to_char): Clarify just what is returned
13241 (bug#6576). Text by Eli Zaretskii.
13242
13243 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
13244
13245 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
13246
13247 2011-07-13 Eli Zaretskii <eliz@gnu.org>
13248
13249 * buffer.c (mmap_find): Fix a typo.
13250
13251 2011-07-13 Johan Bockgård <bojohan@gnu.org>
13252
13253 Fix execution of x selection hooks.
13254 * xselect.c (Qx_lost_selection_functions)
13255 (Qx_sent_selection_functions): New vars.
13256 (syms_of_xselect): DEFSYM them.
13257 (x_handle_selection_request): Pass Qx_sent_selection_functions
13258 rather than Vx_sent_selection_functions to Frun_hook_with_args.
13259 (x_handle_selection_clear,x_clear_frame_selections):
13260 Pass Qx_lost_selection_functions rather than
13261 Vx_lost_selection_functions to Frun_hook_with_args.
13262
13263 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
13264
13265 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
13266 The old code sometimes used this field without initializing it.
13267
13268 * alloc.c (gc_sweep): Don't read past end of array.
13269 In theory, the old code could also have corrupted Emacs internals,
13270 though it'd be very unlikely.
13271
13272 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
13273
13274 * character.c (Fcharacterp): Don't advertise optional ignored
13275 argument. (Bug#4026)
13276
13277 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
13278
13279 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
13280 key" (bug#4257).
13281
13282 * window.c (Fset_window_start): Doc fix (bug#4199).
13283 (Fset_window_hscroll): Ditto.
13284
13285 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
13286
13287 Fix minor new problems caught by GCC 4.6.1.
13288 * term.c (init_tty): Remove unused local.
13289 * xsettings.c (store_monospaced_changed): Define this function only
13290 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
13291 not used otherwise.
13292
13293 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
13294
13295 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
13296
13297 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13298
13299 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
13300 are the mini-buffer and the echo area (bug#3320).
13301
13302 * term.c (init_tty): Remove support for supdup, c10 and perq
13303 terminals, which are no longer supported (bug#1482).
13304
13305 2011-07-10 Johan Bockgård <bojohan@gnu.org>
13306
13307 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
13308
13309 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
13310
13311 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
13312 for non-popups (Bug#3642).
13313
13314 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
13315
13316 * alloc.c (reset_malloc_hooks): Protoize.
13317 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
13318 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
13319 * cm.c (losecursor): Likewise.
13320 * data.c (fmod): Likewise.
13321 * dispnew.c (swap_glyphs_in_rows): Likewise.
13322 * emacs.c (memory_warning_signal): Likewise.
13323 * floatfns.c (float_error): Likewise.
13324 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
13325 (otf_open, font_otf_capability, generate_otf_features)
13326 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
13327 Likewise.
13328 * image.c (pbm_read_file): Likewise.
13329 * indent.c (string_display_width): Likewise.
13330 * intervals.c (check_for_interval, search_for_interval)
13331 (inc_interval_count, count_intervals, root_interval)
13332 (adjust_intervals_for_insertion, make_new_interval): Likewise.
13333 * lread.c (defalias): Likewise.
13334 * ralloc.c (r_alloc_check): Likewise.
13335 * regex.c (set_image_of_range_1, set_image_of_range)
13336 (regex_grow_registers): Likewise.
13337 * sysdep.c (strerror): Likewise.
13338 * termcap.c (valid_filename_p, tprint, main): Likewise.
13339 * tparam.c (main): Likewise.
13340 * unexhp9k800.c (run_time_remap, save_data_space)
13341 (update_file_ptrs, read_header, write_header, calculate_checksum)
13342 (copy_file, copy_rest, display_header): Likewise.
13343 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
13344 Likewise.
13345 * xdisp.c (check_it): Likewise.
13346 * xfaces.c (register_color, unregister_color, unregister_colors):
13347 Likewise.
13348 * xfns.c (print_fontset_result): Likewise.
13349 * xrdb.c (member, fatal, main): Likewise.
13350
13351 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
13352
13353 Fix minor problems found by static checking (Bug#9031).
13354 * chartab.c (char_table_set_range, map_sub_char_table):
13355 Remove unused locals.
13356 (uniprop_table): Now static.
13357 * composite.c (_work_char): Remove unused static var.
13358
13359 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
13360
13361 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
13362
13363 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
13364
13365 * gtkutil.c (qttip_cb): Remove code without function.
13366
13367 2011-07-09 Eli Zaretskii <eliz@gnu.org>
13368
13369 * w32.c (pthread_sigmask): New stub.
13370
13371 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
13372
13373 Use pthread_sigmask, not sigprocmask (Bug#9010).
13374 sigprocmask is portable only for single-threaded applications, and
13375 Emacs can be multi-threaded when it uses GTK.
13376 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
13377 (LIBES): Use it.
13378 * callproc.c (Fcall_process):
13379 * process.c (create_process):
13380 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
13381 Use pthread_sigmask, not sigprocmask.
13382
13383 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13384
13385 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
13386 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
13387 wrong (Bug#8591).
13388
13389 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13390
13391 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
13392 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
13393 (xg_hide_tooltip): Fix comment.
13394
13395 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
13396 in registerServicesMenuSendTypes.
13397 (validRequestorForSendType): Don't check ns_return_types.
13398
13399 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
13400 ns_return_type.
13401
13402 2011-07-08 Jason Rumney <jasonr@gnu.org>
13403
13404 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
13405 SH_SHOW for hidden windows (Bug#5482).
13406
13407 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
13408 frame struct members of non-existent frames (Bug#6284).
13409
13410 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13411
13412 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
13413 variable firstTime not needed on OSX >= 10.6.
13414 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
13415 >= 10.5. Use setKnobProportion, setDoubleValue.
13416
13417 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13418 (MAC_OS_X_VERSION_10_5): Define if not defined.
13419 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13420 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13421 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13422
13423 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
13424 cString and lossyCString on OSX >= 10.4.
13425
13426 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
13427 sizeToFit on OSX >= 10.2.
13428
13429 * nsimage.m (allocInitFromFile): Don't use deprecated method
13430 bestRepresentationForDevice on OSX >= 10.6.
13431
13432 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
13433 to avoid warning.
13434
13435 * emacs.c: Declare unexec_init_emacs_zone.
13436
13437 * nsgui.h: Fix compiler warning about gnulib redefining verify.
13438
13439 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
13440
13441 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13442 on svcsMenu (Bug#8842).
13443
13444 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13445 ns_return_types.
13446 (Fns_list_services): Just return Qnil on 10.6, code not working there.
13447
13448 * nsterm.m (QUTF8_STRING): Declare.
13449 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13450 (validRequestorForSendType): Return type is (id).
13451 Change indexOfObjectIdenticalTo to indexOfObject.
13452 Check if we have local selection before returning self (Bug#8842).
13453 (writeSelectionToPasteboard): Put local selection into paste board
13454 if we have a local selection (Bug#8842).
13455 (syms_of_nsterm): DEFSYM QUTF8_STRING.
13456
13457 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13458 (ns_get_local_selection): Declare.
13459
13460 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
13461
13462 * keymap.c (describe_map_tree): Don't insert a double newline at
13463 the end of the buffer (bug#1169) and return whether we inserted
13464 something.
13465
13466 * callint.c (Fcall_interactively): Change "reading args" to
13467 "providing args" to try to clarify what it does (bug#1010).
13468
13469 2011-07-07 Kenichi Handa <handa@m17n.org>
13470
13471 * composite.c (composition_compute_stop_pos): Ignore a static
13472 composition starting before CHARPOS (Bug#8915).
13473
13474 * xdisp.c (handle_composition_prop): Likewise.
13475
13476 2011-07-07 Eli Zaretskii <eliz@gnu.org>
13477
13478 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13479 (Bug#9015)
13480
13481 2011-07-07 Kenichi Handa <handa@m17n.org>
13482
13483 * character.h (unicode_category_t): New enum type.
13484
13485 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13486 (Qchar_code_property_table): New variable.
13487 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13488 (UNIPROP_COMPRESSED_FORM_P): New macros.
13489 (char_table_ascii): Uncompress the compressed values.
13490 (sub_char_table_ref): New arg is_uniprop. Callers changed.
13491 Uncompress the compressed values.
13492 (sub_char_table_ref_and_range): Likewise.
13493 (char_table_ref_and_range): Uncompress the compressed values.
13494 (sub_char_table_set): New arg is_uniprop. Callers changed.
13495 Uncompress the compressed values.
13496 (sub_char_table_set_range): Args changed. Callers changed.
13497 (char_table_set_range): Adjuted for the above change.
13498 (map_sub_char_table): Delete args default_val and parent. Add arg
13499 top. Give decoded values to a Lisp function.
13500 (map_char_table): Adjust for the above change. Give decoded
13501 values to a Lisp function. Gcpro more variables.
13502 (uniprop_table_uncompress)
13503 (uniprop_decode_value_run_length): New functions.
13504 (uniprop_decoder, uniprop_decoder_count): New variables.
13505 (uniprop_get_decoder, uniprop_encode_value_character)
13506 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13507 New functions.
13508 (uniprop_encoder, uniprop_encoder_count): New variables.
13509 (uniprop_get_encoder, uniprop_table)
13510 (Funicode_property_table_internal, Fget_unicode_property_internal)
13511 (Fput_unicode_property_internal): New functions.
13512 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13513 Sunicode_property_table_internal, Sget_unicode_property_internal,
13514 and Sput_unicode_property_internal. Defvar_lisp
13515 char-code-property-alist.
13516
13517 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
13518 Vunicode_category_table.
13519
13520 * font.c (font_range): Adjust for the change of
13521 Vunicode_category_table.
13522
13523 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13524
13525 * m/iris4d.h: Remove file, move contents ...
13526 * s/irix6-5.h: ... here.
13527
13528 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13529
13530 Remove unportable assumption about struct layout (Bug#8884).
13531 * alloc.c (mark_buffer):
13532 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13533 (clone_per_buffer_values): Don't assume that
13534 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13535 This isn't true in general, and it's particularly not true
13536 if Emacs is configured with --with-wide-int.
13537 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13538 New macros, used in the buffer.c change.
13539
13540 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
13541
13542 * xsettings.c: Use both GConf and GSettings if both are available.
13543 (store_config_changed_event): Add comment.
13544 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13545 (store_tool_bar_style_changed): New functions.
13546 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
13547 (struct xsettings): Move font inside HAVE_XFT.
13548 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
13549 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
13550 Move inside HAVE_XFT.
13551 (something_changed_gsettingsCB): Rename from something_changedCB.
13552 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13553 also.
13554 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
13555 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
13556 (something_changed_gconfCB): Rename from something_changedCB.
13557 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13558 (parse_settings): Move check for font inside HAVE_XFT.
13559 (read_settings, apply_xft_settings): Add comment.
13560 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
13561 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
13562 call store_font_name_changed.
13563 (xft_settings_event): Add comment.
13564 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
13565 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
13566 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
13567 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
13568 (xsettings_initialize): Call init_gsettings last.
13569 (xsettings_get_system_font, xsettings_get_system_normal_font):
13570 Add comment.
13571
13572 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
13573
13574 Random fixes. E.g., (random) never returned negative values.
13575 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
13576 subseconds part to the entropy, as that's a bit more random.
13577 Prefer signed to unsigned, since the signedness doesn't matter and
13578 in general we prefer signed. When given a limit, use a
13579 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
13580 latter isn't right if USE_2_TAGS_FOR_INTS.
13581 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
13582 not 0..VALMASK. Don't discard "excess" bits that random () returns.
13583
13584 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
13585
13586 * textprop.c (text_property_stickiness):
13587 Obey Vtext_property_default_nonsticky.
13588 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
13589 * w32fns.c (syms_of_w32fns):
13590 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
13591
13592 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13593
13594 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
13595 This is more efficient than Ffile_directory_p and avoids a minor race.
13596
13597 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
13598
13599 * buffer.c (Foverlay_put): Say what the return value is
13600 (bug#7835).
13601
13602 * fileio.c (barf_or_query_if_file_exists): Check first if the file
13603 is a directory before asking whether to use the file name
13604 (bug#7564).
13605 (barf_or_query_if_file_exists): Make the "File is a directory"
13606 error be more correct.
13607
13608 * fns.c (Frequire): Remove the mention of the .gz files, since
13609 that's installation-specific, but keep the mention of
13610 `get-load-suffixes'.
13611
13612 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13613
13614 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
13615 Report string overflow if the output is too long.
13616
13617 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
13618
13619 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
13620 (syms_of_gnutls): Remove duplicate DEFSYM for
13621 Qgnutls_bootprop_verify_hostname_error, an error for
13622 Qgnutls_bootprop_verify_error (which is no longer used).
13623
13624 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13625 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
13626 Also (re)move comments that are misplaced or no longer relevant.
13627
13628 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13629
13630 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13631
13632 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
13633
13634 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13635 and background color parameters if they have been changed.
13636
13637 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13638
13639 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13640
13641 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
13642
13643 * xsettings.c (SYSTEM_FONT): Define only when used.
13644 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13645
13646 * keymap.c (access_keymap_1): Now static.
13647
13648 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
13649
13650 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13651 leave any prefix arg for the up event (Bug#1586).
13652
13653 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
13654
13655 * lread.c (syms_of_lread): Mention single symbols defined by
13656 `defvar' or `defconst' (bug#7154).
13657
13658 * fns.c (Frequire): Mention .el.gz files (bug#7314).
13659 (Frequire): Mention get-load-suffixes.
13660
13661 2011-07-02 Martin Rudalics <rudalics@gmx.at>
13662
13663 * window.h (window): Remove clone_number slot.
13664 * window.c (Fwindow_clone_number, Fset_window_clone_number):
13665 Remove.
13666 (make_parent_window, make_window, saved_window)
13667 (Fset_window_configuration, save_window_save): Don't deal with
13668 clone numbers.
13669 * buffer.c (Qclone_number): Remove declaration.
13670 (sort_overlays, overlay_strings): Don't deal with clone numbers.
13671
13672 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
13673
13674 Add multiple inheritance to keymaps.
13675 * keymap.c (Fmake_composed_keymap): New function.
13676 (Fset_keymap_parent): Simplify.
13677 (fix_submap_inheritance): Remove.
13678 (access_keymap_1): New function extracted from access_keymap to handle
13679 embedded parents and handle lists of maps.
13680 (access_keymap): Use it.
13681 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13682 (Fcopy_keymap): Handle embedded parents.
13683 (Fcommand_remapping, define_as_prefix): Simplify.
13684 (Fkey_binding): Simplify.
13685 (syms_of_keymap): Move minibuffer-local-completion-map,
13686 minibuffer-local-filename-completion-map,
13687 minibuffer-local-must-match-map, and
13688 minibuffer-local-filename-must-match-map to Elisp.
13689 (syms_of_keymap): Defsubr make-composed-keymap.
13690 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13691 (parse_menu_item): Trivial simplification.
13692
13693 2011-07-01 Glenn Morris <rgm@gnu.org>
13694
13695 * Makefile.in (SETTINGS_LIBS): Fix typo.
13696
13697 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13698
13699 * coding.c (Fencode_coding_string): Record the last coding system
13700 used, as the function doc string says (bug#8738).
13701
13702 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
13703
13704 * xsettings.c (store_monospaced_changed): Take new font as arg and
13705 check for change against current_mono_font.
13706 (EMACS_TYPE_SETTINGS): Remove this and related defines.
13707 (emacs_settings_constructor, emacs_settings_get_property)
13708 (emacs_settings_set_property, emacs_settings_class_init)
13709 (emacs_settings_init, gsettings_obj): Remove.
13710 (something_changedCB): New function for HAVE_GSETTINGS.
13711 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13712 with value as argument.
13713 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
13714 g_settings_new (Bug#8967). Do not create gsettings_obj.
13715 Remove calls to g_settings_bind. Connect something_changedCB to
13716 "changed".
13717
13718 * xgselect.c: Add defined (HAVE_GSETTINGS).
13719 (xgselect_initialize): Ditto.
13720
13721 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
13722 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
13723 xg_select.
13724
13725 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
13726
13727 * eval.c (struct backtrace): Simplify and port the data structure.
13728 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
13729 signed bit field, as this assumption is not portable and it makes
13730 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
13731 "char debug_on_exit : 1" as this is not portable either; instead,
13732 use the portable "unsigned int debug_on_exit : 1". Remove unused
13733 member evalargs. Remove obsolete comments about cc bombing out.
13734
13735 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
13736
13737 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
13738 Let HAVE_GSETTINGS override HAVE_GCONF.
13739 (store_monospaced_changed): New function.
13740 (EMACS_SETTINGS): A new type derived from GObject to handle
13741 GSettings notifications.
13742 (emacs_settings_constructor, emacs_settings_get_property)
13743 (emacs_settings_set_property, emacs_settings_class_init):
13744 New functions.
13745 (gsettings_client, gsettings_obj): New variables.
13746 (GSETTINGS_SCHEMA): New define.
13747 (something_changedCB): Call store_monospaced_changed.
13748 (init_gsettings): New function.
13749 (xsettings_initialize): Call init_gsettings.
13750 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13751 to NULL.
13752
13753 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
13754 GCONF_CFLAGS/LIBS.
13755
13756 2011-06-29 Martin Rudalics <rudalics@gmx.at>
13757
13758 * window.c (resize_root_window, grow_mini_window)
13759 (shrink_mini_window): Rename Qresize_root_window to
13760 Qwindow_resize_root_window and Qresize_root_window_vertically to
13761 Qwindow_resize_root_window_vertically.
13762
13763 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
13764
13765 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13766
13767 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
13768
13769 * makefile.w32-in: Redesign dependencies so they reflect more
13770 clearly which files are directly included by each source file,
13771 and not through other includes.
13772
13773 2011-06-27 Martin Rudalics <rudalics@gmx.at>
13774
13775 * buffer.c (Qclone_number): Declare static and DEFSYM it.
13776 (sort_overlays, overlay_strings): When an overlay's clone number
13777 matches the window's clone number process the overlay even if
13778 the overlay's window property doesn't match the current window.
13779
13780 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13781 (Fwindow_hchild): Rename to Fwindow_left_child.
13782 (Fwindow_next): Rename to Fwindow_next_sibling.
13783 (Fwindow_prev): Rename to Fwindow_prev_sibling.
13784 (resize_window_check): Rename to window_resize_check.
13785 (resize_window_apply): Rename to window_resize_apply.
13786 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13787 (Fdelete_other_windows_internal, resize_frame_windows)
13788 (Fsplit_window_internal, Fdelete_window_internal)
13789 (grow_mini_window, shrink_mini_window)
13790 (Fresize_mini_window_internal): Fix callers accordingly.
13791
13792 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13793
13794 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13795 (emacs_fixed_set_min_size): Remove.
13796 (emacs_fixed_new): Take frame as argument.
13797
13798 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13799 (_EmacsFixedPrivate): Remove minwidth/height.
13800 Add struct frame *f.
13801 (emacs_fixed_init): Initialize priv->f.
13802 (get_parent_class, emacs_fixed_set_min_size): Remove.
13803 (emacs_fixed_new): Set priv->f to argument.
13804 (emacs_fixed_get_preferred_width)
13805 (emacs_fixed_get_preferred_height): Use min_width/height from
13806 frames size_hint to set minimum and natural (Bug#8919).
13807 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13808 and use min_width/height from frames size_hint to set
13809 min_width/height (Bug#8919).
13810
13811 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
13812 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13813 Fix indentation.
13814
13815 2011-06-26 Eli Zaretskii <eliz@gnu.org>
13816
13817 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13818 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13819 called at ZV.
13820
13821 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
13822
13823 * process.c (wait_reading_process_output): Bypass select if
13824 waiting for a cell while ignoring keyboard input, and input is
13825 pending. Suggested by Jan Djärv (Bug#8869).
13826
13827 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13828
13829 Use gnulib's dup2 module instead of rolling our own.
13830 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13831
13832 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13833
13834 * dispnew.c (scrolling_window): Before scrolling, turn off a
13835 mouse-highlight in the window being scrolled.
13836
13837 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
13838
13839 Move DEFSYM to lisp.h and use everywhere.
13840
13841 * character.h (DEFSYM): Move declaration...
13842 * lisp.h (DEFSYM): ...here.
13843
13844 * gnutls.c:
13845 * minibuf.c:
13846 * w32menu.c:
13847 * w32proc.c:
13848 * w32select.c: Don't include character.h.
13849
13850 * alloc.c (syms_of_alloc):
13851 * buffer.c (syms_of_buffer):
13852 * bytecode.c (syms_of_bytecode):
13853 * callint.c (syms_of_callint):
13854 * casefiddle.c (syms_of_casefiddle):
13855 * casetab.c (init_casetab_once):
13856 * category.c (init_category_once, syms_of_category):
13857 * ccl.c (syms_of_ccl):
13858 * cmds.c (syms_of_cmds):
13859 * composite.c (syms_of_composite):
13860 * dbusbind.c (syms_of_dbusbind):
13861 * dired.c (syms_of_dired):
13862 * dispnew.c (syms_of_display):
13863 * doc.c (syms_of_doc):
13864 * editfns.c (syms_of_editfns):
13865 * emacs.c (syms_of_emacs):
13866 * eval.c (syms_of_eval):
13867 * fileio.c (syms_of_fileio):
13868 * fns.c (syms_of_fns):
13869 * frame.c (syms_of_frame):
13870 * fringe.c (syms_of_fringe):
13871 * insdel.c (syms_of_insdel):
13872 * keymap.c (syms_of_keymap):
13873 * lread.c (init_obarray, syms_of_lread):
13874 * macros.c (syms_of_macros):
13875 * msdos.c (syms_of_msdos):
13876 * print.c (syms_of_print):
13877 * process.c (syms_of_process):
13878 * search.c (syms_of_search):
13879 * sound.c (syms_of_sound):
13880 * syntax.c (init_syntax_once, syms_of_syntax):
13881 * terminal.c (syms_of_terminal):
13882 * textprop.c (syms_of_textprop):
13883 * undo.c (syms_of_undo):
13884 * w32.c (globals_of_w32):
13885 * window.c (syms_of_window):
13886 * xdisp.c (syms_of_xdisp):
13887 * xfaces.c (syms_of_xfaces):
13888 * xfns.c (syms_of_xfns):
13889 * xmenu.c (syms_of_xmenu):
13890 * xsettings.c (syms_of_xsettings):
13891 * xterm.c (syms_of_xterm): Use DEFSYM.
13892
13893 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13894
13895 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
13896
13897 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13898
13899 Integer and buffer overflow fixes (Bug#8873).
13900
13901 * print.c (printchar, strout): Check for string overflow.
13902 (PRINTPREPARE, printchar, strout):
13903 Don't set size unless allocation succeeds.
13904
13905 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13906 for sizes. Check for string overflow more accurately.
13907 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13908
13909 * macros.c: Integer and buffer overflow fixes.
13910 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13911 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13912 Use ptrdiff_t, not int, for sizes.
13913 Don't increment bufsize until after realloc succeeds.
13914 Check for size-calculation overflow.
13915 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13916
13917 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13918
13919 * lread.c: Integer overflow fixes.
13920 (read_integer): Radix is now EMACS_INT, not int,
13921 to improve quality of diagnostics for out-of-range radices.
13922 Calculate buffer size correctly for out-of-range radices.
13923 (read1): Check for integer overflow in radices, and in
13924 read-circle numbers.
13925 (read_escape): Avoid int overflow.
13926 (Fload, openp, read_buffer_size, read1)
13927 (substitute_object_recurse, read_vector, read_list, map_obarray):
13928 Use ptrdiff_t, not int, for sizes.
13929 (read1): Use EMACS_INT, not int, for sizes.
13930 Check for size overflow.
13931
13932 * image.c (cache_image): Check for size arithmetic overflow.
13933
13934 * lread.c: Integer overflow issues.
13935 (saved_doc_string_size, saved_doc_string_length)
13936 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13937 Now ptrdiff_t, not int.
13938 (read1): Don't assume doc string length fits in int. Check for
13939 out-of-range doc string lengths.
13940 (read_list): Don't assume file position fits in int.
13941 (read_escape): Check for hex character overflow.
13942
13943 2011-06-22 Leo Liu <sdl.web@gmail.com>
13944
13945 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13946 Move to minibuffer.el.
13947
13948 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13949
13950 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
13951 The following patches are for when GLYPH_DEBUG && !XASSERT.
13952 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13953 * dispnew.c (flush_stdout):
13954 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13955 Mark as externally visible.
13956 * dispnew.c (check_window_matrix_pointers): Now static.
13957 * dispnew.c (window_to_frame_vpos):
13958 * xfns.c (unwind_create_frame):
13959 * xterm.c (x_check_font): Remove unused local.
13960 * scroll.c (CHECK_BOUNDS):
13961 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13962 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13963 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13964 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13965 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13966 Now static.
13967 (debug_method_add): Use va_list and vsprintf rather than relying
13968 on undefined behavior with wrong number of arguments.
13969 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13970 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13971 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13972 since we're not interested in debugging glyphs with old libraries.
13973 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13974 GCC 4.6.0's static checking.
13975
13976 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13977
13978 Integer overflow and signedness fixes (Bug#8873).
13979 A few related buffer overrun fixes, too.
13980
13981 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13982
13983 * dispextern.h (struct face.stipple):
13984 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13985 (x_bitmap_mask, x_allocate_bitmap_record)
13986 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13987 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13988 (x_create_bitmap_from_xpm_data):
13989 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13990 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13991 (.bitmaps_last):
13992 * xfaces.c (load_pixmap):
13993 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13994 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13995 (.bitmaps_last, struct x_output.icon_bitmap):
13996 Use ptrdiff_t, not int, for bitmap indexes.
13997 (x_allocate_bitmap_record): Check for size overflow.
13998 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13999
14000 Use ptrdiff_t, not int, for overlay counts.
14001 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14002 * editfns.c (overlays_around, get_pos_property):
14003 * textprop.c (get_char_property_and_overlay):
14004 * xdisp.c (next_overlay_change, note_mouse_highlight):
14005 * xfaces.c (face_at_buffer_position):
14006 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14007 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14008 (Fnext_overlay_change, Fprevious_overlay_change)
14009 (mouse_face_overlay_overlaps, Foverlays_in):
14010 Use ptrdiff_t, not int, for sizes.
14011 (overlays_at, overlays_in): Check for size-calculation overflow.
14012
14013 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14014
14015 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14016 (x_session_initialize): Do not assume string length fits in int.
14017
14018 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14019 This is unlikely, but can occur if DPI is outlandish.
14020
14021 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
14022 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14023
14024 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14025 * xrdb.c (magic_file_p, search_magic_path):
14026 Omit last arg SUFFIX; it was always 0. All callers changed.
14027 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14028
14029 * xfont.c (xfont_match): Avoid need for strlen.
14030
14031 * xfns.c: Don't assume strlen fits in int.
14032 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14033
14034 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14035 not unsigned long, as we prefer signed integers. All callers changed.
14036 Detect integer overflow in repeat count.
14037 (message_dolog): Don't assume print length fits in 39 bytes.
14038 (display_mode_element): Don't assume strlen fits in int.
14039
14040 * termcap.c: Don't assume sizes fit in int and never overflow.
14041 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14042 (gobble_line): Check for size-calculation overflow.
14043
14044 * minibuf.c (Fread_buffer):
14045 * lread.c (intern, intern_c_string):
14046 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14047 Don't assume string length fits in int.
14048
14049 * keyboard.c (parse_tool_bar_item):
14050 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14051
14052 * font.c: Don't assume string length fits in int.
14053 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14054 Use ptrdiff_t, not int.
14055 (font_intern_prop): Don't assume string length fits in int.
14056 Don't assume integer property fits in fixnum.
14057 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
14058
14059 * filelock.c: Fix some buffer overrun and integer overflow issues.
14060 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
14061 Reformulate so as not to need the command string.
14062 Invoke gzip -cd rather than gunzip, as it's more portable.
14063 (lock_info_type, lock_file_1, lock_file):
14064 Don't assume pid_t and time_t fit in unsigned long.
14065 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14066 (current_lock_owner): Prefer signed type for sizes.
14067 Use memcpy, not strncpy, where memcpy is what is really wanted.
14068 Don't assume (via atoi) that time_t and pid_t fit in int.
14069 Check for time_t and/or pid_t out of range, e.g., via a network share.
14070 Don't alloca where an auto var works fine.
14071
14072 * fileio.c: Fix some integer overflow issues.
14073 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14074 Don't assume string length fits in int.
14075 (directory_file_name): Don't assume string length fits in long.
14076 (make_temp_name): Don't assume pid fits in int, or that its print
14077 length is less than 20.
14078
14079 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14080
14081 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14082
14083 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14084
14085 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14086 We prefer signed integers, even for size calculations.
14087
14088 * emacs.c: Don't assume string length fits in 'int'.
14089 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14090 (main): Don't invoke strlen when not needed.
14091
14092 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14093 (XD_DEBUG_MESSAGE): Don't waste a byte.
14094
14095 * callproc.c (getenv_internal_1, getenv_internal)
14096 (Fgetenv_internal):
14097 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14098
14099 * lread.c (invalid_syntax): Omit length argument.
14100 All uses changed. This doesn't fix a bug, but it simplifies the
14101 code away from its former Hollerith-constant appearance, and it's
14102 one less 'int' to worry about when looking at integer-overflow issues.
14103 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
14104
14105 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14106 This didn't break anything, but it didn't help either.
14107 It's confusing to put a bogus integer in a place where the actual
14108 value does not matter.
14109 (LIST_END_P): Remove unused macro and its bogus comment.
14110 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
14111
14112 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14113 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14114 implementation.
14115 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14116 We prefer signed types, and the value cannot exceed the EMACS_INT
14117 range anyway (because otherwise the length would not be representable).
14118 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14119 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14120 This avoids a GCC warning when WIDE_EMACS_INT.
14121
14122 * indent.c (sane_tab_width): New function.
14123 (current_column, scan_for_column, Findent_to, position_indentation)
14124 (compute_motion): Use it. This is just for clarity.
14125 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
14126
14127 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
14128
14129 * lisp.h (lint_assume): New macro.
14130 * composite.c (composition_gstring_put_cache):
14131 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14132
14133 * editfns.c, insdel.c:
14134 Omit unnecessary forward decls, to simplify future changes.
14135
14136 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14137
14138 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14139
14140 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
14141 Use much-faster test for byte-length change.
14142 Don't assume string byte-length fits in 'int'.
14143 Check that character arg fits in 'int'.
14144 (mapcar1): Declare byte as byte, for clarity.
14145
14146 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14147
14148 * fns.c (concat): Catch string overflow earlier.
14149 Do not rely on integer wraparound.
14150
14151 * dispextern.h (struct it.overlay_strings_charpos)
14152 (struct it.selective): Now EMACS_INT, not int.
14153 * xdisp.c (forward_to_next_line_start)
14154 (back_to_previous_visible_line_start)
14155 (reseat_at_next_visible_line_start, next_element_from_buffer):
14156 Don't arbitrarily truncate the value of 'selective' to int.
14157
14158 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14159
14160 * composite.c: Don't truncate sizes to 'int'.
14161 (composition_gstring_p, composition_reseat_it)
14162 (composition_adjust_point): Use EMACS_INT, not int.
14163 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14164 not EMACS_UINT, for indexes.
14165
14166 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14167
14168 * buffer.c: Include <verify.h>.
14169 (struct sortvec.priority, struct sortstr.priority):
14170 Now EMACS_INT, not int.
14171 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
14172 (struct sortstr.size, record_overlay_string)
14173 (struct sortstrlist.size, struct sortlist.used):
14174 Don't truncate size to int.
14175 (record_overlay_string): Check for size-calculation overflow.
14176 (init_buffer_once): Check at compile-time, not run-time.
14177
14178 2011-06-22 Jim Meyering <meyering@redhat.com>
14179
14180 Don't leak an XBM-image-sized buffer
14181 * image.c (xbm_load): Free the image buffer after using it.
14182
14183 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14184
14185 Port to Sun C.
14186 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14187 that Sun C diagnosed.
14188 * fns.c (secure_hash): Fix pointer signedness issue.
14189 * intervals.c (static_offset_intervals): New function.
14190 (offset_intervals): Use it.
14191
14192 2011-06-21 Leo Liu <sdl.web@gmail.com>
14193
14194 * deps.mk (fns.o):
14195 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14196 sha512.h.
14197
14198 * fns.c (secure_hash): Rename from crypto_hash_function and change
14199 the first arg to accept symbols.
14200 (Fsecure_hash): New primitive.
14201 (syms_of_fns): New symbols.
14202
14203 2011-06-20 Deniz Dogan <deniz@dogan.se>
14204
14205 * process.c (Fset_process_buffer): Clarify return value in
14206 docstring.
14207
14208 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
14209
14210 * dispnew.c (add_window_display_history): Use BVAR.
14211
14212 * xdisp.c (debug_method_add): Use BVAR.
14213 (check_window_end, dump_glyph_matrix, dump_glyph)
14214 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14215
14216 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14217 Likewise.
14218
14219 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
14220 check till after the cache is created in init_frame_faces.
14221
14222 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
14223
14224 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
14225
14226 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
14227
14228 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
14229 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
14230 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
14231
14232 Improve buffer-overflow checking (Bug#8873).
14233 * fileio.c (Finsert_file_contents):
14234 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
14235 Remove the old (too-loose) buffer overflow checks.
14236 They weren't needed, since make_gap checks for buffer overflow.
14237 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
14238 The old code merely checked for Emacs fixnum overflow, and relied
14239 on undefined (wraparound) behavior. The new code avoids undefined
14240 behavior, and also checks for ptrdiff_t and/or size_t overflow.
14241
14242 * editfns.c (Finsert_char): Don't dump core with very negative counts.
14243 Tune. Don't use wider integers than needed. Don't use alloca.
14244 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
14245
14246 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
14247
14248 * insdel.c, lisp.h (buffer_overflow): New function.
14249 (insert_from_buffer_1, replace_range, replace_range_2):
14250 * insdel.c (make_gap_larger):
14251 * editfns.c (Finsert_char):
14252 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
14253
14254 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
14255
14256 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
14257
14258 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
14259
14260 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
14261 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
14262
14263 * fileio.c: Don't assume EMACS_INT fits in off_t.
14264 (emacs_lseek): New static function.
14265 (Finsert_file_contents, Fwrite_region): Use it.
14266 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
14267
14268 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
14269
14270 * fns.c: Don't overflow int when computing a list length.
14271 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
14272 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
14273 truncation on 64-bit hosts. Check for QUIT every
14274 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
14275 faster and is responsive enough.
14276 (Flength): Report an error instead of overflowing an integer.
14277 (Fsafe_length): Return a float if the value is not representable
14278 as a fixnum. This shouldn't happen except in contrived situations.
14279 (Fnthcdr, Fsort): Don't assume list length fits in int.
14280 (Fcopy_sequence): Don't assume vector length fits in int.
14281
14282 * alloc.c: Check that resized vectors' lengths fit in fixnums.
14283 (header_size, word_size): New constants.
14284 (allocate_vectorlike): Don't check size overflow here.
14285 (allocate_vector): Check it here instead, since this is the only
14286 caller of allocate_vectorlike that could cause overflow.
14287 Check that the new vector's length is representable as a fixnum.
14288
14289 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
14290 The previous code was bogus. For example, next_almost_prime (32)
14291 returned 39, which is undesirable as it is a multiple of 3; and
14292 next_almost_prime (24) returned 25, which is a multiple of 5 so
14293 why was the code bothering to check for multiples of 7?
14294
14295 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
14296
14297 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
14298
14299 Variadic C functions now count arguments with ptrdiff_t.
14300 This partly undoes my 2011-03-30 change, which replaced int with size_t.
14301 Back then I didn't know that the Emacs coding style prefers signed int.
14302 Also, in the meantime I found a few more instances where arguments
14303 were being counted with int, which may truncate counts on 64-bit
14304 machines, or EMACS_INT, which may be unnecessarily wide.
14305 * lisp.h (struct Lisp_Subr.function.aMANY)
14306 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
14307 Arg counts are now ptrdiff_t, not size_t.
14308 All variadic functions and their callers changed accordingly.
14309 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
14310 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
14311 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
14312 * callint.c (Fcall_interactively): Check arg count for overflow,
14313 to avoid potential buffer overrun. Use signed char, not 'int',
14314 for 'varies' array, so that we needn't bother to check its size
14315 calculation for overflow.
14316 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
14317 * eval.c (apply_lambda):
14318 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
14319 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
14320 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
14321
14322 * callint.c (Fcall_interactively): Don't use index var as event count.
14323
14324 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
14325 * mem-limits.h (SIZE): Remove; no longer used.
14326
14327 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
14328
14329 Remove unnecessary casts.
14330 * xterm.c (x_term_init):
14331 * xfns.c (x_set_border_pixel):
14332 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
14333 These aren't needed now that we assume ANSI C.
14334
14335 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
14336 It's more likely to cause problems (due to unsigned overflow)
14337 than to cure them.
14338
14339 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
14340
14341 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
14342
14343 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
14344
14345 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
14346
14347 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
14348
14349 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
14350
14351 GLYPH_CODE_FACE returns EMACS_INT, not int.
14352 * dispextern.h (merge_faces):
14353 * xfaces.c (merge_faces):
14354 * xdisp.c (get_next_display_element, next_element_from_display_vector):
14355 Don't assume EMACS_INT fits in int.
14356
14357 * character.h (CHAR_VALID_P): Remove unused parameter.
14358 * fontset.c, lisp.h, xdisp.c: All uses changed.
14359
14360 * editfns.c (Ftranslate_region_internal): Omit redundant test.
14361
14362 * fns.c (concat): Minor tuning based on overflow analysis.
14363 This doesn't fix any bugs. Use int to hold character, instead
14364 of constantly refetching from Emacs object. Use XFASTINT, not
14365 XINT, for value known to be a character. Don't bother comparing
14366 a single byte to 0400, as it's always less.
14367
14368 * floatfns.c (Fexpt):
14369 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
14370
14371 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
14372 for characters.
14373
14374 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
14375
14376 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
14377 Without this fix, on a 64-bit host (aset S 0 4294967386) would
14378 incorrectly succeed when S was a string, because 4294967386 was
14379 truncated before it was used.
14380
14381 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
14382 Otherwise, an out-of-range integer could cause undefined behavior
14383 on a 64-bit host.
14384
14385 * composite.c: Use int, not EMACS_INT, for characters.
14386 (fill_gstring_body, composition_compute_stop_pos): Use int, not
14387 EMACS_INT, for values that are known to be in character range.
14388 This doesn't fix any bugs but is the usual style inside Emacs and
14389 may generate better code on 32-bit machines.
14390
14391 Make sure a 64-bit char is never passed to ENCODE_CHAR.
14392 This is for reasons similar to the recent CHAR_STRING fix.
14393 * charset.c (Fencode_char): Check that character arg is actually
14394 a character. Pass an int to ENCODE_CHAR.
14395 * charset.h (ENCODE_CHAR): Verify that the character argument is no
14396 wider than 'int', as a compile-time check to prevent future regressions
14397 in this area.
14398
14399 * character.c (char_string): Remove unnecessary casts.
14400
14401 Make sure a 64-bit char is never passed to CHAR_STRING.
14402 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
14403 by silently ignoring the top 32 bits, allowing some values
14404 that were far too large to be valid characters.
14405 * character.h: Include <verify.h>.
14406 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
14407 arguments are no wider than unsigned, as a compile-time check
14408 to prevent future regressions in this area.
14409 * data.c (Faset):
14410 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
14411 (Fsubst_char_in_region):
14412 * fns.c (concat):
14413 * xdisp.c (decode_mode_spec_coding):
14414 Adjust to CHAR_STRING's new requirement.
14415 * editfns.c (Finsert_char, Fsubst_char_in_region):
14416 * fns.c (concat): Check that character args are actually
14417 characters. Without this test, these functions did the wrong
14418 thing with wildly out-of-range values on 64-bit hosts.
14419
14420 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14421 These casts should not be needed on 32-bit hosts, either.
14422 * keyboard.c (read_char):
14423 * lread.c (Fload): Remove casts to unsigned.
14424
14425 * lisp.h (UNSIGNED_CMP): New macro.
14426 This fixes comparison bugs on 64-bit hosts.
14427 (ASCII_CHAR_P): Use it.
14428 * casefiddle.c (casify_object):
14429 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
14430 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
14431 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
14432 * dispextern.h (FACE_FROM_ID):
14433 * keyboard.c (read_char): Use UNSIGNED_CMP.
14434
14435 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
14436 not to EMACS_INT, to avoid GCC warning.
14437
14438 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
14439
14440 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
14441 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14442 isn't needed on 32-bit machines.
14443
14444 * buffer.c (Fgenerate_new_buffer_name):
14445 Use EMACS_INT for count, not int.
14446 (advance_to_char_boundary): Return EMACS_INT, not int.
14447
14448 * data.c (Qcompiled_function): Now static.
14449
14450 * window.c (window_body_lines): Now static.
14451
14452 * image.c (gif_load): Rename local to avoid shadowing.
14453
14454 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14455 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14456 * alloc.c (make_save_value): Integer argument is now of type
14457 ptrdiff_t, not int.
14458 (mark_object): Use ptrdiff_t, not int.
14459 * lisp.h (pD): New macro.
14460 * print.c (print_object): Use it.
14461
14462 * alloc.c: Use EMACS_INT, not int, to count objects.
14463 (total_conses, total_markers, total_symbols, total_vector_size)
14464 (total_free_conses, total_free_markers, total_free_symbols)
14465 (total_free_floats, total_floats, total_free_intervals)
14466 (total_intervals, total_strings, total_free_strings):
14467 Now EMACS_INT, not int. All uses changed.
14468 (Fgarbage_collect): Compute overall total using a double, so that
14469 integer overflow is less likely to be a problem. Check for overflow
14470 when converting back to an integer.
14471 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14472 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14473 These were 'int' variables that could overflow on 64-bit hosts;
14474 they were never used, so remove them instead of repairing them.
14475 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
14476 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14477 Previously, this ceilinged at INT_MAX, but that doesn't work on
14478 64-bit machines.
14479 (allocate_pseudovector): Don't use EMACS_INT when int would do.
14480
14481 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
14482 (allocate_vectorlike): Check for ptrdiff_t overflow.
14483 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
14484 when a (possibly-narrower) signed value would do just as well.
14485 We prefer using signed arithmetic, to avoid comparison confusion.
14486
14487 * alloc.c: Catch some string size overflows that we were missing.
14488 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14489 for convenience in STRING_BYTES_MAX.
14490 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14491 The definition here is exact; the one in lisp.h was approximate.
14492 (allocate_string_data): Check for string overflow. This catches
14493 some instances we weren't catching before. Also, it catches
14494 size_t overflow on (unusual) hosts where SIZE_MAX <= min
14495 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14496 and ptrdiff_t and EMACS_INT are both 64 bits.
14497
14498 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14499 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
14500 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
14501
14502 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14503
14504 * alloc.c (Fmake_string): Check for out-of-range init.
14505
14506 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14507
14508 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14509
14510 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
14511
14512 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14513 xg_get_default_scrollbar_width.
14514
14515 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14516 (int_gtk_range_get_value): Move to the scroll bar part of the file.
14517 (style_changed_cb): Call update_theme_scrollbar_width and call
14518 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14519 all frames (Bug#8505).
14520 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14521 Call gtk_window_set_resizable if HAVE_GTK3.
14522 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14523 and height if HAVE_GTK3 (Bug#8505).
14524 (scroll_bar_width_for_theme): New variable.
14525 (update_theme_scrollbar_width): New function.
14526 (xg_get_default_scrollbar_width): Move code to
14527 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14528 (xg_initialize): Call update_theme_scrollbar_width.
14529
14530 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14531
14532 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14533
14534 2011-06-12 Martin Rudalics <rudalics@gmx.at>
14535
14536 * frame.c (make_frame): Call other_buffer_safely instead of
14537 other_buffer.
14538
14539 * window.c (temp_output_buffer_show): Call display_buffer with
14540 second argument Vtemp_buffer_show_specifiers and reset latter
14541 immediately after the call.
14542 (Vtemp_buffer_show_specifiers): New variable.
14543 (auto_window_vscroll_p, next_screen_context_lines)
14544 (Vscroll_preserve_screen_position): Remove leading asterisks from
14545 doc-strings.
14546
14547 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
14548
14549 Fix minor problems found by GCC 4.6.0 static checking.
14550 * buffer.c (Qclone_number): Remove for now, as it's unused.
14551 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14552 (record_buffer): Remove unused local.
14553 * frame.c (other_visible_frames, frame_buffer_list): Now static.
14554 (set_frame_buffer_list): Remove; unused.
14555 * frame.h (other_visible_frames): Remove decl.
14556 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14557 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14558 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14559 if HAVE_GPM.
14560 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14561 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
14562 Define only if HAVE_GPM.
14563 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
14564 (update_hints_inhibit): Remove; never set. All uses removed.
14565 * widgetprv.h (emacsFrameClassRec): Remove decl.
14566 * window.c (delete_deletable_window): Now returns void, since it
14567 wasn't returning anything.
14568 (compare_window_configurations): Remove unused locals.
14569 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
14570 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
14571 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
14572 the same widths as pointers. This follows up on the 2011-05-06 patch.
14573 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
14574 * xterm.h: Likewise.
14575 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
14576
14577 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
14578
14579 * makefile.w32-in: Update dependencies.
14580 (LISP_H): Add lib/intprops.h.
14581
14582 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
14583
14584 * image.c (gif_load): Add animation frame delay to the metadata.
14585 (syms_of_image): Use DEFSYM. New symbol `delay'.
14586
14587 2011-06-11 Martin Rudalics <rudalics@gmx.at>
14588
14589 * window.c (delete_deletable_window): Re-add.
14590 (Fset_window_configuration): Rewrite to handle dead buffers and
14591 consequently deletable windows.
14592 (window_tree, Fwindow_tree): Remove. Supply functionality in
14593 window.el.
14594 (compare_window_configurations): Simplify code.
14595
14596 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
14597
14598 * image.c (imagemagick_load_image): Fix type mismatch.
14599 (Fimagemagick_types): Likewise.
14600
14601 * window.h (replace_buffer_in_windows): Declare.
14602
14603 2011-06-11 Martin Rudalics <rudalics@gmx.at>
14604
14605 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
14606 Qclone_number. Remove external declaration of Qdelete_window.
14607 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
14608 code.
14609 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
14610 Run Qbuffer_list_update_hook if allowed.
14611 (Fother_buffer): Rewrite doc-string. Major rewrite for new
14612 buffer list implementation.
14613 (other_buffer_safely): New function.
14614 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
14615 calls to replace_buffer_in_windows and
14616 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
14617 if allowed.
14618 (record_buffer): Inhibit quitting and rewrite using quittable
14619 functions. Run Qbuffer_list_update_hook if allowed.
14620 (Frecord_buffer, Funrecord_buffer): New functions.
14621 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
14622 Move switch-to-buffer to window.el.
14623 (bury-buffer): Move to window.el.
14624 (Vbuffer_list_update_hook): New variable.
14625
14626 * lisp.h (other_buffer_safely): Add prototype in buffer.c
14627 section.
14628
14629 * window.h (resize_frame_windows): Move up in code.
14630 (Fwindow_frame): Remove EXFUN.
14631 (replace_buffer_in_all_windows): Remove prototype.
14632 (replace_buffer_in_windows_safely): Add prototype.
14633
14634 * window.c: Declare Qdelete_window static again. Move down
14635 declaration of select_count.
14636 (Fnext_window, Fprevious_window): Rewrite doc-strings.
14637 (Fother_window): Move to window.el.
14638 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14639 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14640 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14641 window.el.
14642 (replace_buffer_in_windows): Implement by calling
14643 Qreplace_buffer_in_windows.
14644 (replace_buffer_in_all_windows): Remove with some functionality
14645 moved into replace_buffer_in_windows_safely.
14646 (replace_buffer_in_windows_safely): New function.
14647 (select_window_norecord, select_frame_norecord): Move in front
14648 of run_window_configuration_change_hook. Remove now obsolete
14649 declarations.
14650 (Fset_window_buffer): Rewrite doc-string.
14651 Call Qrecord_window_buffer.
14652 (keys_of_window): Move binding for other-window to window.el.
14653
14654 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
14655
14656 * dispextern.h (struct image): Replace data member, whose int_val
14657 and ptr_val fields were not used by anything, with a single
14658 lisp_val object.
14659
14660 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14661 (gif_clear_image, gif_load, imagemagick_load_image)
14662 (gs_clear_image, gs_load): Callers changed.
14663
14664 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
14665
14666 * buffer.h: Include <time.h>, for time_t.
14667 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
14668
14669 Fix minor problems found by static checking.
14670
14671 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14672
14673 Make identifiers static if they are not used in other modules.
14674 * data.c (Qcompiled_function, Qframe, Qvector):
14675 * image.c (QimageMagick, Qsvg):
14676 * minibuf.c (Qmetadata):
14677 * window.c (resize_window_check, resize_root_window): Now static.
14678 * window.h (resize_window_check, resize_root_window): Remove decls.
14679
14680 * window.c (window_deletion_count, delete_deletable_window):
14681 Remove; unused.
14682 (window_body_lines): Now static.
14683 (Fdelete_other_windows_internal): Mark vars as initialized.
14684 Make sure 'resize_failed' is initialized.
14685 (run_window_configuration_change_hook): Rename local to avoid shadowing.
14686 (resize_window_apply): Remove unused local.
14687 * window.h (delete_deletable_window): Remove decl.
14688
14689 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
14690 (imagemagick_load_image): Fix pointer signedness problem by changing
14691 last arg from unsigned char * to char *. All uses changed.
14692 Also, fix a local for similar reasons.
14693 Remove unused locals. Remove locals to avoid shadowing.
14694 (fn_rsvg_handle_free): Remove; unused.
14695 (svg_load, svg_load_image): Fix pointer signedness problem.
14696 (imagemagick_load_image): Don't use garbage pointer image_wand.
14697
14698 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14699
14700 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
14701
14702 * image.c (gif_load): Fix omitted cast error introduced by
14703 2011-06-06 change.
14704
14705 2011-06-10 Martin Rudalics <rudalics@gmx.at>
14706
14707 * window.h (resize_proportionally, orig_total_lines)
14708 (orig_top_line): Remove from window structure.
14709 (set_window_height, set_window_width, change_window_heights)
14710 (Fdelete_window): Remove prototypes.
14711 (resize_frame_windows): Remove duplicate declaration.
14712
14713 2011-06-10 Eli Zaretskii <eliz@gnu.org>
14714
14715 * window.h (resize_frame_windows, resize_window_check)
14716 (delete_deletable_window, resize_root_window)
14717 (resize_frame_windows): Declare prototypes.
14718
14719 * window.c (resize_window_apply): Make definition be "static" to
14720 match the prototype.
14721
14722 2011-06-10 Martin Rudalics <rudalics@gmx.at>
14723
14724 * window.c: Remove declarations of Qwindow_size_fixed,
14725 window_min_size_1, window_min_size_2, window_min_size,
14726 size_window, window_fixed_size_p, enlarge_window, delete_window.
14727 Remove static from declaration of Qdelete_window, it's
14728 temporarily needed by Fbury_buffer.
14729 (replace_window): Don't assign orig_top_line and
14730 orig_total_lines.
14731 (Fdelete_window, delete_window): Remove. Window deletion is
14732 handled by window.el.
14733 (window_loop): Remove DELETE_OTHER_WINDOWS case.
14734 Replace Fdelete_window calls with calls to Qdelete_window.
14735 (Fdelete_other_windows): Remove. Deleting other windows is
14736 handled by window.el.
14737 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
14738 handled in window.el.
14739 (window_min_size_2, window_min_size_1, window_min_size): Remove.
14740 Window minimum sizes are handled in window.el.
14741 (shrink_windows, size_window, set_window_height)
14742 (set_window_width, change_window_heights, window_height)
14743 (window_width, CURBEG, CURSIZE, enlarge_window)
14744 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
14745 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
14746 handled in window.el.
14747 (make_dummy_parent): Rename to make_parent_window and give it a
14748 second argument horflag.
14749 (make_window): Don't set resize_proportionally any more.
14750 (Fsplit_window): Remove. Windows are split in window.el.
14751 (save_restore_action, save_restore_orig_size)
14752 (shrink_window_lowest_first, save_restore_orig_size): Remove.
14753 Resize mini windows in window.el.
14754 (grow_mini_window, shrink_mini_window): Implement by calling
14755 Qresize_root_window_vertically, resize_window_check and
14756 resize_window_apply.
14757 (saved_window, Fset_window_configuration, save_window_save):
14758 Do not handle orig_top_line, orig_total_lines, and
14759 resize_proportionally.
14760 (window_min_height, window_min_width): Move to window.el.
14761 (keys_of_window): Move bindings for delete-other-windows,
14762 split-window, delete-window and enlarge-window to window.el.
14763
14764 * buffer.c: Temporarily extern Qdelete_window.
14765 (Fbury_buffer): Temporarily call Qdelete_window instead of
14766 Fdelete_window (Fbury_buffer will move to window.el soon).
14767
14768 * frame.c (set_menu_bar_lines_1): Remove code handling
14769 orig_top_line and orig_total_lines.
14770
14771 * dispnew.c (adjust_frame_glyphs_initially): Don't use
14772 set_window_height but set heights directly.
14773 (change_frame_size_1): Use resize_frame_windows.
14774
14775 * xdisp.c (init_xdisp): Don't use set_window_height but set
14776 heights directly.
14777
14778 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14779 Use resize_frame_windows instead of change_window_heights and run
14780 run_window_configuration_change_hook.
14781
14782 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14783 instead of change_window_heights and run
14784 run_window_configuration_change_hook.
14785
14786 2011-06-09 Martin Rudalics <rudalics@gmx.at>
14787
14788 * window.c (replace_window): Rename second argument REPLACEMENT to
14789 NEW. New third argument SETFLAG. Rewrite.
14790 (delete_window, make_dummy_parent): Call replace_window with
14791 third argument 1.
14792 (window_list_1): Move down in code.
14793 (run_window_configuration_change_hook): Move set_buffer part
14794 before select_frame_norecord part in order to unwind correctly.
14795 Rename count1 to count.
14796 (recombine_windows, delete_deletable_window, resize_root_window)
14797 (Fdelete_other_windows_internal)
14798 (Frun_window_configuration_change_hook, make_parent_window)
14799 (resize_window_check, resize_window_apply, Fresize_window_apply)
14800 (resize_frame_windows, Fsplit_window_internal)
14801 (Fdelete_window_internal, Fresize_mini_window_internal):
14802 New functions.
14803 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14804
14805 2011-06-08 Martin Rudalics <rudalics@gmx.at>
14806
14807 * window.h (window): Add some new members to window structure -
14808 normal_lines, normal_cols, new_total, new_normal, clone_number,
14809 splits, nest, prev_buffers, next_buffers.
14810 (WINDOW_TOTAL_SIZE): Move here from window.c.
14811 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
14812
14813 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14814 Remove.
14815 (make_dummy_parent): Set new members of windows structure.
14816 (make_window): Move down in code. Handle new members of window
14817 structure.
14818 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14819 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14820 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14821 (Fset_window_prev_buffers, Fwindow_next_buffers)
14822 (Fset_window_next_buffers, Fset_window_clone_number):
14823 New functions.
14824 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14825 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14826 Doc-string fixes.
14827 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14828 Argument WINDOW can be now internal window too.
14829 (Fwindow_use_time): Move up in code.
14830 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14831 Rewrite doc-string.
14832 (Fset_window_configuration, saved_window)
14833 (Fcurrent_window_configuration, save_window_save): Handle new
14834 members of window structure.
14835 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14836 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14837 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14838 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14839 Qget_mru_window, Qresize_root_window,
14840 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14841 Qauto_buffer_name; staticpro them.
14842
14843 2011-06-07 Martin Rudalics <rudalics@gmx.at>
14844
14845 * window.c (Fwindow_total_size, Fwindow_left_column)
14846 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14847 (Fwindow_list_1): New functions.
14848 (window_box_text_cols): Replace with window_body_cols.
14849 (Fwindow_width, Fscroll_left, Fscroll_right):
14850 Use window_body_cols instead of window_box_text_cols.
14851 (delete_window, Fset_window_configuration):
14852 Call delete_all_subwindows with window as argument.
14853 (delete_all_subwindows): Take a window as argument and not a
14854 structure. Rewrite.
14855 (window_loop): Remove handling of GET_LRU_WINDOW and
14856 GET_LARGEST_WINDOW.
14857 (Fget_lru_window, Fget_largest_window): Move to window.el.
14858
14859 * window.h: Extern window_body_cols instead of
14860 window_box_text_cols. delete_all_subwindows now takes a
14861 Lisp_Object as argument.
14862
14863 * indent.c (compute_motion, Fcompute_motion):
14864 Use window_body_cols instead of window_box_text_cols.
14865
14866 * frame.c (delete_frame): Call delete_all_subwindows with root
14867 window as argument.
14868
14869 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14870
14871 * fns.c (Fputhash): Document return value.
14872
14873 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
14874
14875 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14876
14877 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14878
14879 Cons<->int and similar integer overflow fixes (Bug#8794).
14880
14881 Check for overflow when converting integer to cons and back.
14882 * charset.c (Fdefine_charset_internal, Fdecode_char):
14883 Use cons_to_unsigned to catch overflow.
14884 (Fencode_char): Use INTEGER_TO_CONS.
14885 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14886 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14887 * data.c (long_to_cons, cons_to_long): Remove.
14888 (cons_to_unsigned, cons_to_signed): New functions.
14889 These signal an error for invalid or out-of-range values.
14890 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14891 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14892 * font.c (Ffont_variation_glyphs):
14893 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14894 * lisp.h: Include <intprops.h>.
14895 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14896 (cons_to_signed, cons_to_unsigned): New decls.
14897 (long_to_cons, cons_to_long): Remove decls.
14898 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14899 (Fprimitive_undo): Use CONS_TO_INTEGER.
14900 * xfns.c (Fx_window_property): Likewise.
14901 * xselect.c: Include <limits.h>.
14902 (x_own_selection, selection_data_to_lisp_data):
14903 Use INTEGER_TO_CONS.
14904 (x_handle_selection_request, x_handle_selection_clear)
14905 (x_get_foreign_selection, Fx_disown_selection_internal)
14906 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14907 (lisp_data_to_selection_data): Use cons_to_unsigned.
14908 (x_fill_property_data): Use cons_to_signed.
14909 Report values out of range.
14910
14911 Check for buffer and string overflow more precisely.
14912 * buffer.h (BUF_BYTES_MAX): New macro.
14913 * lisp.h (STRING_BYTES_MAX): New macro.
14914 * alloc.c (Fmake_string):
14915 * character.c (string_escape_byte8):
14916 * coding.c (coding_alloc_by_realloc):
14917 * doprnt.c (doprnt):
14918 * editfns.c (Fformat):
14919 * eval.c (verror):
14920 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14921 since they may not be the same number.
14922 * editfns.c (Finsert_char):
14923 * fileio.c (Finsert_file_contents):
14924 Likewise for BUF_BYTES_MAX.
14925
14926 * image.c: Use ptrdiff_t, not int, for sizes.
14927 (slurp_file): Switch from int to ptrdiff_t.
14928 All uses changed.
14929 (slurp_file): Check that file size fits in both size_t (for
14930 malloc) and ptrdiff_t (for sanity and safety).
14931
14932 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14933 if b->modtime has its maximal value.
14934
14935 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14936
14937 Don't assume time_t can fit into int.
14938 * buffer.h (struct buffer.modtime): Now time_t, not int.
14939 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14940 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14941
14942 Minor fixes for signed vs unsigned integers.
14943 * character.h (MAYBE_UNIFY_CHAR):
14944 * charset.c (maybe_unify_char):
14945 * keyboard.c (read_char, reorder_modifiers):
14946 XINT -> XFASTINT, since the integer must be nonnegative.
14947 * ftfont.c (ftfont_spec_pattern):
14948 * keymap.c (access_keymap, silly_event_symbol_error):
14949 XUINT -> XFASTINT, since the integer must be nonnegative.
14950 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14951 since it makes no difference and we prefer signed.
14952 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14953 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14954 nonnegative.
14955
14956 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14957
14958 * window.h (Fwindow_frame): Declare.
14959
14960 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14961
14962 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14963 (SPARE_MEMORY): Always define.
14964 (LARGE_REQUEST): Remove.
14965 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14966
14967 2011-06-06 Martin Rudalics <rudalics@gmx.at>
14968
14969 * lisp.h: Move EXFUNS for Fframe_root_window,
14970 Fframe_first_window and Fset_frame_selected_window to window.h.
14971
14972 * window.h: Move EXFUNS for Fframe_root_window,
14973 Fframe_first_window and Fset_frame_selected_window here from
14974 lisp.h.
14975
14976 * frame.c (Fwindow_frame, Fframe_first_window)
14977 (Fframe_root_window, Fframe_selected_window)
14978 (Fset_frame_selected_window): Move to window.c.
14979 (Factive_minibuffer_window): Move to minibuf.c.
14980 (Fother_visible_frames_p): New function.
14981
14982 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14983
14984 * window.c (decode_window, decode_any_window): Move up in code.
14985 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14986 (inhibit_frame_unsplittable): Remove unused variable.
14987 (Fwindow_buffer): Move up and rewrite doc-string.
14988 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14989 (Fwindow_prev): New functions.
14990 (Fwindow_frame): Move here from frame.c. Accept any window as
14991 argument.
14992 (Fframe_root_window, Fframe_first_window)
14993 (Fframe_selected_window): Move here from frame.c. Accept frame
14994 or arbitrary window as argument. Update doc-strings.
14995 (Fminibuffer_window): Move up in code.
14996 (Fwindow_minibuffer_p): Move up in code and simplify.
14997 (Fset_frame_selected_window): Move here from frame.c.
14998 Marginal rewrite.
14999 (Fselected_window, select_window, Fselect_window): Move up in
15000 code. Minor doc-string fixes.
15001
15002 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15003
15004 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15005 Do not assume that spare memory exists; that assumption is valid
15006 only if SYSTEM_MALLOC.
15007 (LARGE_REQUEST): New macro, so that the issue of large requests
15008 is separated from the issue of spare memory.
15009
15010 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15011
15012 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15013 format. (Bug#8806)
15014
15015 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15016
15017 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15018 before statements.
15019
15020 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15021
15022 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15023
15024 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15025
15026 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15027 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15028
15029 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
15030
15031 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15032
15033 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
15034
15035 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15036 (x_clipboard_manager_save): Add return value.
15037 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15038 New error handlers.
15039 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15040 Obey Vx_select_enable_clipboard_manager. Catch errors in
15041 x_clipboard_manager_save (Bug#8779).
15042 (Vx_select_enable_clipboard_manager): New variable.
15043 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
15044
15045 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
15046
15047 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15048
15049 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15050
15051 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15052 in the current matrix if keep_current_p is non-zero.
15053
15054 2011-06-04 Eli Zaretskii <eliz@gnu.org>
15055
15056 * bidi.c (bidi_level_of_next_char): Fix last change.
15057
15058 2011-06-03 Eli Zaretskii <eliz@gnu.org>
15059
15060 Support bidi reordering of text covered by display properties.
15061
15062 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15063 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15064 (bidi_cache_search, bidi_cache_iterator_state)
15065 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
15066 (bidi_level_of_next_char, bidi_move_to_visually_next):
15067 Support character positions inside a run of characters covered by a
15068 display string.
15069 (bidi_paragraph_init, bidi_resolve_explicit_1)
15070 (bidi_level_of_next_char): Call bidi_fetch_char and
15071 bidi_fetch_char_advance instead of FETCH_CHAR and
15072 FETCH_CHAR_ADVANCE.
15073 (bidi_init_it): Initialize new members.
15074 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15075 definitions.
15076 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15077 instead of using explicit *_CHAR codes.
15078 (bidi_resolve_explicit, bidi_resolve_weak):
15079 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
15080 bidirectional text is supported only in multibyte buffers.
15081 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15082 it to initialize the frame_window_p member of struct bidi_it.
15083 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15084 (bidi_resolve_explicit, bidi_resolve_weak)
15085 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15086 bidi_it->nchars is non-positive.
15087 (bidi_level_of_next_char): Don't try to lookup the cache for the
15088 next/previous character if nothing is cached there yet, or if we
15089 were just reseat()'ed to a new position.
15090
15091 * xdisp.c (set_cursor_from_row): Set start and stop points
15092 according to the row's direction when priming the loop that looks
15093 for the glyph on which to display cursor.
15094 (single_display_spec_intangible_p): Function deleted.
15095 (display_prop_intangible_p): Reimplement to call
15096 handle_display_spec instead of single_display_spec_intangible_p.
15097 Accept 3 additional arguments needed by handle_display_spec.
15098 This fixes incorrect cursor motion across display property with complex
15099 values: lists, `(when COND...)' forms, etc.
15100 (single_display_spec_string_p): Support property values that are
15101 lists with the argument STRING its top-level element.
15102 (display_prop_string_p): Fix the condition for processing a
15103 property that is a list to be consistent with handle_display_spec.
15104 (handle_display_spec): New function, refactored from the
15105 last portion of handle_display_prop.
15106 (compute_display_string_pos): Accept additional argument
15107 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15108 value of a `display' property is a "replacing spec".
15109 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15110 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15111 the display property, but just return a value indicating whether
15112 the display property will replace the characters it covers.
15113 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15114 frame_window_p members of struct bidi_it.
15115 (compute_display_string_pos, compute_display_string_end):
15116 New functions.
15117 (push_it): Accept second argument POSITION, where pop_it should
15118 jump to continue iteration.
15119 (reseat_1): Initialize bidi_it.disp_pos.
15120
15121 * keyboard.c (adjust_point_for_property): Adjust the call to
15122 display_prop_intangible_p to its new signature.
15123
15124 * dispextern.h (struct bidi_it): New member frame_window_p.
15125 (bidi_init_it): Update prototypes.
15126 (display_prop_intangible_p): Update prototype.
15127 (compute_display_string_pos, compute_display_string_end):
15128 Declare prototypes.
15129 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15130 EMACS_INT.
15131
15132 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
15133
15134 Malloc failure behavior now depends on size of allocation.
15135 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15136 * lisp.h: Change signatures accordingly.
15137 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15138 All callers changed. (Bug#8762)
15139
15140 * gnutls.c: Use Emacs's memory allocators.
15141 Without this change, the gnutls library would invoke malloc etc.
15142 directly, which causes problems on non-SYNC_INPUT hosts, and which
15143 runs afoul of improving memory_full behavior. (Bug#8761)
15144 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15145 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15146 xfree instead of the default malloc, realloc, free.
15147 (Fgnutls_boot): No need to check for memory allocation failure,
15148 since xmalloc does that for us.
15149
15150 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
15151 * category.c (hash_get_category_set):
15152 * ccl.c (ccl_driver):
15153 * charset.c (Fdefine_charset_internal):
15154 * charset.h (struct charset.hash_index):
15155 * composite.c (get_composition_id, gstring_lookup_cache)
15156 (composition_gstring_put_cache):
15157 * composite.h (struct composition.hash_index):
15158 * dispextern.h (struct image.hash):
15159 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15160 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15161 (hashfn_equal, hashfn_user_defined, make_hash_table)
15162 (maybe_resize_hash_table, hash_lookup, hash_put)
15163 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15164 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15165 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15166 * image.c (make_image, search_image_cache, lookup_image)
15167 (xpm_put_color_table_h):
15168 * lisp.h (struct Lisp_Hash_Table):
15169 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
15170 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
15171 for hashes and hash indexes, instead of 'unsigned' and 'int'.
15172 * alloc.c (allocate_vectorlike):
15173 Check for overflow in vector size calculations.
15174 * ccl.c (ccl_driver):
15175 Check for overflow when converting EMACS_INT to int.
15176 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15177 need to be updated by these changes.
15178 * fns.c (make_hash_table, maybe_resize_hash_table):
15179 Check for integer overflow with large hash tables.
15180 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15181 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15182 (SXHASH_REDUCE): New macro.
15183 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15184 Use it instead of discarding useful hash info with large hash values.
15185 (sxhash_float): New function.
15186 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15187 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
15188 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15189 Rewrite to use FIXNUM_BITS, as this simplifies things.
15190 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15191 Adjust signatures to match updated version of code.
15192 (consing_since_gc): Now EMACS_INT, since a single hash table can
15193 use more than INT_MAX bytes.
15194
15195 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15196
15197 Make it possible to build with GCC-4.6+ -O2 -flto.
15198
15199 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15200
15201 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15202
15203 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15204 Call minibuffer-inactive-mode.
15205
15206 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
15207
15208 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15209 Update dependencies.
15210
15211 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15212
15213 * data.c (init_data): Remove code for UTS, this system is not
15214 supported anymore.
15215
15216 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15217
15218 Don't force ./temacs to start in terminal mode.
15219
15220 * frame.c (make_initial_frame): Initialize faces in all cases, not
15221 only when CANNOT_DUMP is defined.
15222 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
15223
15224 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15225
15226 * dispnew.c (add_window_display_history): Use const for the string
15227 pointer. Remove declaration, not needed.
15228
15229 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15230
15231 Use 'inline', not 'INLINE'.
15232 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
15233 * alloc.c, fontset.c (INLINE): Remove.
15234 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
15235 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
15236 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
15237 * gmalloc.c (register_heapinfo): Use inline unconditionally.
15238 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
15239
15240 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15241
15242 Make it possible to run ./temacs.
15243
15244 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
15245 syms_of_callproc does the same thing. Remove test for
15246 "initialized", do it in the caller.
15247 * emacs.c (main): Avoid calling set_initial_environment when dumping.
15248
15249 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
15250
15251 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
15252 (read_minibuf): Use get_minibuffer.
15253 (syms_of_minibuf): Use DEFSYM.
15254 (Qmetadata): New var.
15255 * data.c (Qbuffer): Don't make it static.
15256 (syms_of_data): Use DEFSYM.
15257
15258 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15259
15260 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
15261 (CCL_CODE_MIN): New macro.
15262
15263 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
15264
15265 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
15266
15267 * eval.c (Qdebug): Now static.
15268 * lisp.h (Qdebug): Remove decl. This reverts a part of the
15269 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
15270 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
15271
15272 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15273
15274 * image.c: Various fixes to ImageMagick code comments.
15275 (Fimagemagick_types): Doc fix.
15276
15277 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
15278
15279 Minor fixes prompted by GCC 4.6.0 warnings.
15280
15281 * xselect.c (converted_selections, conversion_fail_tag): Now static.
15282
15283 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
15284 (x_clipboard_manager_save_all): Move extern decl to ...
15285 * xterm.h: ... here, so that it can be checked for consistency.
15286
15287 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15288
15289 * xselect.c (x_clipboard_manager_save_frame)
15290 (x_clipboard_manager_save_all): New functions.
15291 (Fx_clipboard_manager_save): Lisp function deleted.
15292
15293 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
15294 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
15295
15296 * xterm.h: Update prototype.
15297
15298 2011-05-28 William Xu <william.xwl@gmail.com>
15299
15300 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
15301 exiting (Bug#8239).
15302
15303 2011-05-28 Jim Meyering <meyering@redhat.com>
15304
15305 Avoid a sign-extension bug in crypto_hash_function.
15306 * fns.c (to_uchar): Define.
15307 (crypto_hash_function): Use it to convert some newly-signed
15308 variables to unsigned, to avoid sign-extension bugs. For example,
15309 without this change, (md5 "truc") would evaluate to
15310 45723a2aff78ff4fff7fff1114760e62 rather than the expected
15311 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
15312 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
15313
15314 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15315
15316 Integer overflow fixes.
15317
15318 * dbusbind.c: Serial number integer overflow fixes.
15319 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
15320 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
15321 to hold a serial number that is too large for a fixnum.
15322 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15323 Check for serial numbers out of range. Decode any serial number
15324 that was so large that it became a float. (Bug#8722)
15325
15326 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
15327 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15328 Use XFASTINT rather than XUINT when numbers are nonnegative.
15329 (xd_append_arg, Fdbus_method_return_internal):
15330 (Fdbus_method_error_internal): Likewise. Also, for unsigned
15331 arguments, check that Lisp number is nonnegative, rather than
15332 silently wrapping negative numbers around. (Bug#8722)
15333 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
15334 (Bug#8722)
15335
15336 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
15337
15338 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
15339
15340 ccl: Add integer overflow checks.
15341 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
15342 (IN_INT_RANGE): New macros.
15343 (ccl_driver): Use them to check for integer overflow when
15344 decoding a CCL program. Many of the new checks are whether XINT (x)
15345 fits in int; it doesn't always, on 64-bit hosts. The new version
15346 doesn't catch all possible integer overflows, but it's an
15347 improvement. (Bug#8719)
15348
15349 * alloc.c (make_event_array): Use XINT, not XUINT.
15350 There's no need for unsigned here.
15351
15352 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
15353 This follows up to the 2011-05-06 change that substituted uintptr_t
15354 for EMACS_INT. This case wasn't caught back then.
15355
15356 Rework Fformat to avoid integer overflow issues.
15357 * editfns.c: Include <float.h> unconditionally, as it's everywhere
15358 now (part of C89). Include <verify.h>.
15359 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
15360 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
15361 (Fformat): Avoid the prepass trying to compute sizes; it was only
15362 approximate and thus did not catch overflow reliably. Instead, walk
15363 through the format just once, formatting and computing sizes as we go,
15364 checking for integer overflow at every step, and allocating a larger
15365 buffer as needed. Keep track separately whether the format is
15366 multibyte. Keep only the most-recently calculated precision, rather
15367 than them all. Record whether each argument has been converted to
15368 string. Use EMACS_INT, not int, for byte and char and arg counts.
15369 Support field widths and precisions larger than INT_MAX. Avoid
15370 sprintf's undefined behavior with conversion specifications such as %#d
15371 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
15372 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
15373 formatting out-of-range floating point numbers with int
15374 formats. (Bug#8668)
15375
15376 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
15377
15378 * data.c: Avoid integer truncation in expressions involving floats.
15379 * data.c: Include <intprops.h>.
15380 (arith_driver): When there's an integer overflow in an expression
15381 involving floating point, convert the integers to floating point
15382 so that the resulting value does not suffer from catastrophic
15383 integer truncation. For example, on a 64-bit host (* 4
15384 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
15385 Do not rely on undefined behavior after integer overflow.
15386
15387 merge count_size_as_multibyte, parse_str_to_multibyte
15388 * character.c, character.h (count_size_as_multibyte):
15389 Rename from parse_str_to_multibyte; all uses changed.
15390 Check for integer overflow.
15391 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
15392 since it's now a duplicate of the other. This is more of
15393 a character than a buffer op, so better that it's in character.c.
15394 * fns.c, print.c: Adjust to above changes.
15395
15396 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
15397
15398 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
15399
15400 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15401
15402 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15403 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
15404 (x_clipboard_manager_save): Now static.
15405 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
15406
15407 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15408 (crypto_hash_function): Now static.
15409 Fix pointer signedness problems. Avoid unnecessary initializations.
15410
15411 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
15412
15413 * termhooks.h (Vselection_alist): Make it terminal-local.
15414
15415 * terminal.c (create_terminal): Initialize it.
15416
15417 * xselect.c: Support for clipboard managers.
15418 (Vselection_alist): Move to termhooks.h as terminal-local var.
15419 (LOCAL_SELECTION): New macro.
15420 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15421 (symbol_to_x_atom): Remove gratuitous arg.
15422 (x_handle_selection_request, lisp_data_to_selection_data)
15423 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
15424 (x_own_selection, x_get_local_selection, x_convert_selection):
15425 New arg, specifying work frame. Use terminal-local Vselection_alist.
15426 (some_frame_on_display): Delete unused function.
15427 (Fx_own_selection_internal, Fx_get_selection_internal)
15428 (Fx_disown_selection_internal, Fx_selection_owner_p)
15429 (Fx_selection_exists_p): New optional frame arg.
15430 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
15431 (x_handle_selection_clear): Don't treat other terminals with the
15432 same keyboard specially. Use the terminal-local Vselection_alist.
15433 (x_clear_frame_selections): Use Frun_hook_with_args.
15434
15435 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
15436
15437 * xterm.h: Add support for those atoms.
15438
15439 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
15440
15441 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15442 (converted_selections, conversion_fail_tag): New global variables.
15443 (x_selection_request_lisp_error): Free the above.
15444 (x_get_local_selection): Remove unnecessary code.
15445 (x_reply_selection_request): Args changed; handle arbitrary array
15446 of converted selections stored in converted_selections.
15447 Separate the XChangeProperty and SelectionNotify steps.
15448 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15449 (x_convert_selection): New function.
15450 (x_handle_selection_event): Simplify.
15451 (x_get_foreign_selection): Don't ignore incoming requests while
15452 waiting for an answer; this will fail when we implement
15453 SAVE_TARGETS, and seems unnecessary anyway.
15454 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15455 (Vx_sent_selection_functions): Doc fix.
15456
15457 2011-05-26 Leo Liu <sdl.web@gmail.com>
15458
15459 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
15460
15461 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15462
15463 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15464
15465 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15466 for fringe update if it has periodic bitmap.
15467 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
15468 and fringe_bitmap_periodic_p.
15469
15470 * fringe.c (get_fringe_bitmap_data): New function.
15471 (draw_fringe_bitmap_1, update_window_fringes): Use it.
15472 (update_window_fringes): Record periodicity of fringe bitmap in glyph
15473 row. Mark glyph row for fringe update if periodicity changed.
15474
15475 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15476 for fringe update unless it has periodic bitmap.
15477
15478 2011-05-25 Kenichi Handa <handa@m17n.org>
15479
15480 * xdisp.c (get_next_display_element): Set correct it->face_id for
15481 a static composition.
15482
15483 2011-05-24 Leo Liu <sdl.web@gmail.com>
15484
15485 * deps.mk (fns.o):
15486 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15487
15488 * fns.c (crypto_hash_function, Fsha1): New function.
15489 (Fmd5): Use crypto_hash_function.
15490 (syms_of_fns): Add Ssha1.
15491
15492 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15493
15494 * gnutls.c: Remove unused macros.
15495 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15496 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15497 Remove macros that are defined and never used.
15498 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15499
15500 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15501
15502 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15503 (Fx_get_selection_internal): Minor cleanup.
15504 (Fx_own_selection_internal): Rename arguments for consistency with
15505 select.el.
15506
15507 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15508
15509 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15510
15511 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15512
15513 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15514
15515 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15516
15517 * dispnew.c (scrolling_window): Don't exclude the case that the
15518 last enabled row in the desired matrix touches the bottom boundary.
15519
15520 2011-05-21 Glenn Morris <rgm@gnu.org>
15521
15522 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
15523 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15524 and add some more files.
15525
15526 2011-05-20 Eli Zaretskii <eliz@gnu.org>
15527
15528 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15529 report_file_error introduced by the change from 2011-05-07.
15530
15531 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15532
15533 * systime.h (Time): Define only if emacs is defined.
15534 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15535 where the include path doesn't have X11/X.h by default. See
15536 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15537
15538 2011-05-20 Kenichi Handa <handa@m17n.org>
15539
15540 * composite.c (find_automatic_composition): Fix previous change.
15541
15542 2011-05-20 Glenn Morris <rgm@gnu.org>
15543
15544 * lisp.mk: New file, split from Makefile.in.
15545 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15546 (shortlisp): Remove.
15547 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15548
15549 2011-05-19 Glenn Morris <rgm@gnu.org>
15550
15551 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15552 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15553 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15554 (lisp): Set the order to that of loadup.el.
15555 (shortlisp): Make it a copy of $lisp.
15556 (SOME_MACHINE_LISP): Remove.
15557 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15558 Use just $shortlisp, not $SOME_MACHINE_LISP too.
15559
15560 2011-05-18 Kenichi Handa <handa@m17n.org>
15561
15562 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
15563 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
15564 (find_automatic_composition): Mostly rewrite for efficiency.
15565
15566 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
15567
15568 * makefile.w32-in: Update dependencies.
15569
15570 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
15571
15572 * menu.c: Include limits.h (fixes the MS-Windows build broken by
15573 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
15574
15575 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
15576
15577 Fix some integer overflow issues, such as string length overflow.
15578
15579 * insdel.c (count_size_as_multibyte): Check for string overflow.
15580
15581 * character.c (lisp_string_width): Check for string overflow.
15582 Use EMACS_INT, not int, for string indexes and lengths; in
15583 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
15584 the resulting string length overflows an EMACS_INT; instead,
15585 report a string overflow if no precision given. When checking for
15586 precision exhaustion, use a check that cannot possibly have
15587 integer overflow. (Bug#8675)
15588 * character.h (lisp_string_width): Adjust to new signature.
15589
15590 * alloc.c (string_overflow): New function.
15591 (Fmake_string): Use it. This doesn't change behavior, but saves
15592 a few bytes and will simplify future changes.
15593 * character.c (string_escape_byte8): Likewise.
15594 * lisp.h (string_overflow): New decl.
15595
15596 Fixups, following up to the user-interface timestamp change.
15597 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
15598 for UI timestamps, instead of unsigned long.
15599 * msdos.c (mouse_get_pos): Likewise.
15600 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
15601 * w32gui.h (Time): Define by including "systime.h" rather than by
15602 declaring it ourselves. (Bug#8664)
15603
15604 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
15605 * image.c (clear_image_cache): Likewise.
15606
15607 * term.c (term_mouse_position): Don't assume time_t wraparound.
15608
15609 Be more systematic about user-interface timestamps.
15610 Before, the code sometimes used 'Time', sometimes 'unsigned long',
15611 and sometimes 'EMACS_UINT', to represent these timestamps.
15612 This change causes it to use 'Time' uniformly, as that's what X uses.
15613 This makes the code easier to follow, and makes it easier to catch
15614 integer overflow bugs such as Bug#8664.
15615 * frame.c (Fmouse_position, Fmouse_pixel_position):
15616 Use Time, not unsigned long, for user-interface timestamps.
15617 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
15618 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
15619 * keyboard.h (last_event_timestamp): Likewise.
15620 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15621 * menu.h (xmenu_show): Likewise.
15622 * term.c (term_mouse_position): Likewise.
15623 * termhooks.h (struct input_event.timestamp): Likewise.
15624 (struct terminal.mouse_position_hook): Likewise.
15625 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15626 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15627 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
15628 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15629 what it was before.
15630 * menu.h, termhooks.h: Include "systime.h", for Time.
15631
15632 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15633 Don't assume that the difference between two unsigned long values
15634 can fit into an integer. At this point, we know button_down_time
15635 <= event->timestamp, so the difference must be nonnegative, so
15636 there's no need to cast the result if double-click-time is
15637 nonnegative, as it should be; check that it's nonnegative, just in
15638 case. This bug is triggered when events are more than 2**31 ms
15639 apart (about 25 days). (Bug#8664)
15640
15641 * xselect.c (last_event_timestamp): Remove duplicate decl.
15642 (x_own_selection): Remove needless cast to unsigned long.
15643
15644 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15645 that always fit in int. Use a sentinel instead of a counter, to
15646 avoid a temp and to allay GCC's concerns about possible int overflow.
15647 * frame.h (struct frame): Use int for menu_bar_items_used
15648 instead of EMACS_INT, since it always fits in int.
15649
15650 * menu.c (grow_menu_items): Check for int overflow.
15651
15652 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15653
15654 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15655 Before, the code was not consistent. These values cannot exceed
15656 2**31 - 1 so there's no need to make them unsigned.
15657 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15658 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15659 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15660 as modifiers.
15661 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15662
15663 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15664 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15665 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15666 presumably because the widths might not match.
15667
15668 * window.c (size_window): Avoid needless test at loop start.
15669
15670 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
15671
15672 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15673
15674 2011-05-12 Drew Adams <drew.adams@oracle.com>
15675
15676 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15677
15678 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15679
15680 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15681 `width' to `bar_area_x' and `bar_area_width', respectively.
15682 (x_scroll_run): Take account of fringe background extension.
15683
15684 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15685 Rename local vars `left' and `width' to `bar_area_x' and
15686 `bar_area_width', respectively.
15687 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15688 background extension.
15689
15690 2011-05-10 Jim Meyering <meyering@redhat.com>
15691
15692 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15693
15694 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
15695
15696 * image.c (Finit_image_library): Return t for built-in image types,
15697 like pbm and xbm. (Bug#8640)
15698
15699 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
15700
15701 * w32menu.c (set_frame_menubar): Fix submenu allocation.
15702
15703 2011-05-07 Eli Zaretskii <eliz@gnu.org>
15704
15705 * w32console.c (Fset_screen_color): Doc fix.
15706 (Fget_screen_color): New function.
15707 (syms_of_ntterm): Defsubr it.
15708
15709 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15710 unlink the temporary file if Fcall_process didn't create it in the
15711 first place.
15712 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15713 child process will be redirected to a file specified with `:file'.
15714 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
15715 cue to call_process_cleanup not to close that handle.
15716
15717 2011-05-07 Ben Key <bkey76@gmail.com>
15718
15719 * makefile.w32-in: The bootstrap-temacs rule now makes use of
15720 one of two shell specific rules, either bootstrap-temacs-CMD or
15721 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
15722 to the previous implementation of the bootstrap-temacs rule.
15723 The bootstrap-temacs-CMD rule is similar to the previous
15724 implementation of the bootstrap-temacs rule except that it
15725 makes use of the ESC_CFLAGS variable instead of the CFLAGS
15726 variable.
15727
15728 These changes, along with some changes to nt/configure.bat,
15729 nt/gmake.defs, and nt/nmake.defs, are required to extend my
15730 earlier fix to add support for --cflags and --ldflags options
15731 that include quotes so that it works whether make uses cmd or
15732 sh as the shell.
15733
15734 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
15735
15736 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
15737 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
15738 is a constant.
15739 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
15740 a string. Handle both cases.
15741 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
15742 (Fdbus_register_method): Use Qinvalid_function.
15743
15744 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
15745
15746 * makefile.w32-in: Update dependencies.
15747 (LISP_H): Add inttypes.h and stdin.h.
15748 (PROCESS_H): Add unistd.h.
15749
15750 2011-05-06 Eli Zaretskii <eliz@gnu.org>
15751
15752 * lread.c: Include limits.h (fixes the MS-Windows build broken by
15753 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15754
15755 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
15756
15757 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15758
15759 * term.c (vfatal): Remove stray call to va_end.
15760 It's not needed and the C Standard doesn't allow it here anyway.
15761
15762 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15763 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
15764
15765 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15766 bytes.
15767
15768 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15769
15770 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15771
15772 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15773
15774 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15775
15776 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15777
15778 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15779 * charset.c (Fdefine_charset_internal): Don't initialize
15780 charset.code_space[15]. The value was garbage, on hosts with
15781 32-bit int (Bug#8600).
15782
15783 * lread.c (read_integer): Be more consistent with string-to-number.
15784 Use string_to_number to do the actual conversion; this avoids
15785 rounding errors and fixes some other screwups. Without this fix,
15786 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15787 (digit_to_number): Move earlier, for benefit of read_integer.
15788 Return -1 if the digit is out of range for the base, -2 if it is
15789 not a digit in any supported base. (Bug#8602)
15790
15791 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15792
15793 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15794 to match comment at start of function. This also removes a
15795 GCC warning about overflow in a 32+64-bit port.
15796
15797 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15798
15799 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15800 Reported by Stefan Monnier in
15801 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
15802 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15803 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
15804
15805 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15806 (EMACS_UINTPTR): Likewise, with uintptr_t.
15807
15808 * lisp.h: Prefer 64-bit EMACS_INT if available.
15809 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15810 on 32-bit hosts that have 64-bit int, so that they can access
15811 large files.
15812 However, temporarily disable this change unless the temporary
15813 symbol WIDE_EMACS_INT is defined.
15814
15815 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15816
15817 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15818 This removes an assumption that EMACS_INT and long are the same
15819 width as pointers. The assumption is true for Emacs porting targets
15820 now, but we want to make other targets possible.
15821 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15822 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15823 In the rest of the code, change types of integers that hold casted
15824 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15825 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15826 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15827 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15828 No need to cast type when ORing.
15829 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15830 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15831 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15832 assume EMACS_INT is the same width as char *.
15833 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15834 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15835 Remove no-longer-needed casts.
15836 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15837 (xg_tool_bar_help_callback, xg_make_tool_item):
15838 Use EMACS_INTPTR to hold an integer
15839 that will be cast to void *; this can avoid a GCC warning
15840 if EMACS_INT is not the same width as void *.
15841 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15842 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15843 (current_message_1, set_message_1):
15844 Use a local to convert to proper width without a cast.
15845 * xmenu.c (dialog_selection_callback): Likewise.
15846
15847 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15848 Also, don't assume VALBITS / RAND_BITS is less than 5,
15849 and don't rely on undefined behavior when shifting a 1 left into
15850 the sign bit.
15851 * lisp.h (get_random): Change signature to match.
15852
15853 * lread.c (hash_string): Use size_t, not int, for hash computation.
15854 Normally we prefer signed values; but hashing is special, because
15855 it's better to use unsigned division on hash table sizes so that
15856 the remainder is nonnegative. Also, size_t is the natural width
15857 for hashing into memory. The previous code used 'int', which doesn't
15858 retain enough info to hash well into very large tables.
15859 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15860
15861 * dbusbind.c: Don't possibly lose pointer info when converting.
15862 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15863 Use XPNTR rather than XHASH, so that the high-order bits of
15864 the pointer aren't lost when converting through void *.
15865
15866 * eval.c (Fautoload): Don't double-shift a pointer.
15867
15868 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15869
15870 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
15871
15872 * gnutls.c (DEF_GNUTLS_FN):
15873 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15874
15875 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15876
15877 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15878 marker. (Bug#8610)
15879
15880 2011-05-05 Eli Zaretskii <eliz@gnu.org>
15881
15882 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15883 New version that can reserve upto 2GB of heap space.
15884
15885 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
15886
15887 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15888
15889 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15890
15891 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15892 `gnutls_certificate_set_x509_key_file'.
15893
15894 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
15895
15896 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15897 Update dependencies.
15898
15899 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15900
15901 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15902 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15903 Remove unused parameter `fildes'.
15904 * process.c (read_process_output, send_process): Don't pass it.
15905
15906 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15907
15908 Fix previous change: the library cache is defined in w32.c.
15909 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15910 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15911
15912 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15913
15914 Implement dynamic loading of GnuTLS on Windows.
15915
15916 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15917 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15918 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15919 Declare.
15920
15921 * gnutls.c (Qgnutls_dll): Define.
15922 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15923 (gnutls_*): Declare function pointers.
15924 (init_gnutls_functions): New function to initialize function pointers.
15925 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15926 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15927 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15928 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15929 (emacs_gnutls_write, emacs_gnutls_read)
15930 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15931 (Fgnutls_available_p): New function.
15932 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15933 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15934 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15935
15936 * image.c: Include w32.h.
15937 (Vimage_type_cache): Delete.
15938 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15939 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15940 (w32_delayed_load): Move to w32.c.
15941
15942 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15943
15944 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15945 (w32_delayed_load): Move from image.c. When loading a library, record
15946 its filename in the :loaded-from property of the library id.
15947 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15948 Initialize and staticpro them.
15949 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15950
15951 * process.c: Include lisp.h before w32.h, not after.
15952 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15953 instead of gnutls_record_check_pending.
15954
15955 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15956
15957 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15958
15959 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15960 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15961 as passed in.
15962
15963 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15964
15965 * xterm.c (x_set_frame_alpha): Do not set property on anything
15966 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15967
15968 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
15969
15970 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15971
15972 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
15973
15974 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15975 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15976 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15977 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15978 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15979 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15980 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15981 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15982 (Qgnutls_bootprop_callbacks_verify): Make static.
15983
15984 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15985
15986 * callproc.c: Indentation fixup.
15987
15988 * sysdep.c (wait_for_termination_1): Make static.
15989 (wait_for_termination, interruptible_wait_for_termination):
15990 Move after wait_for_termination_1.
15991
15992 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15993
15994 * sysdep.c (interruptible_wait_for_termination): New function
15995 which is like wait_for_termination, but allows keyboard
15996 interruptions.
15997
15998 * callproc.c (Fcall_process): Add (:file "file") as an option for
15999 the STDOUT buffer.
16000 (Fcall_process_region): Ditto.
16001
16002 2011-04-30 Eli Zaretskii <eliz@gnu.org>
16003
16004 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16005 rather than `XVECTOR (FOO)->size'.
16006
16007 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16008 inttypes.h, as a gnulib replacement is used if it not available in
16009 system headers.
16010
16011 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16012
16013 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16014 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16015 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16016
16017 * coding.c (coding_alloc_by_realloc): Error out if destination
16018 will grow beyond MOST_POSITIVE_FIXNUM.
16019 (decode_coding_emacs_mule): Abort if there isn't enough place in
16020 charbuf for the composition carryover bytes. Reserve an extra
16021 space for up to 2 characters produced in a loop.
16022 (decode_coding_iso_2022): Abort if there isn't enough place in
16023 charbuf for the composition carryover bytes.
16024
16025 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16026
16027 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16028 aborting when %lld or %lll format is passed.
16029 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16030 %llo or %llx format is passed. (Bug#8545)
16031
16032 * window.c (window_scroll_line_based): Use a marker instead of
16033 simple variables to record original value of point. (Bug#7952)
16034
16035 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16036 produced by %s or %c overflows available buffer space. (Bug#8545)
16037
16038 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16039
16040 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
16041 (SIZE_MAX): Move defn after all includes, as they might #define it.
16042
16043 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16044
16045 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16046
16047 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16048
16049 * keyboard.c (Qdelayed_warnings_hook): Define.
16050 (command_loop_1): Run `delayed-warnings-hook'
16051 if Vdelayed_warnings_list is non-nil.
16052 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16053 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16054
16055 2011-04-28 Eli Zaretskii <eliz@gnu.org>
16056
16057 * doprnt.c (doprnt): Don't return value smaller than the buffer
16058 size if the message was truncated. (Bug#8545).
16059
16060 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16061
16062 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16063 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16064
16065 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16066
16067 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16068
16069 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
16070
16071 * makefile.w32-in: Update dependencies.
16072
16073 2011-04-27 Eli Zaretskii <eliz@gnu.org>
16074
16075 Improve `doprnt' and its usage. (Bug#8545)
16076 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16077 `format_end'. Remove support for %l as a conversion specifier.
16078 Don't use xrealloc. Improve diagnostics when the %l size modifier
16079 is used. Update the commentary.
16080
16081 * eval.c (verror): Simplify calculation of size_t.
16082
16083 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16084 messages.
16085
16086 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16087
16088 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16089 change.
16090
16091 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16092
16093 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16094 This makes this file independent of the recent pseudovector change.
16095
16096 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
16097
16098 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16099
16100 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
16101 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
16102 Remove unused local.
16103 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
16104
16105 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
16106 GCC 4.6.0 optimizes based on type-based alias analysis.
16107 For example, if b is of type struct buffer * and v of type struct
16108 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16109 != &v->size, and therefore "v->size = 1; b->size = 2; return
16110 v->size;" must therefore return 1. This assumption is incorrect
16111 for Emacs, since it type-puns struct Lisp_Vector * with many other
16112 types. To fix this problem, this patch adds a new type struct
16113 vectorlike_header that documents the constraints on layout of vectors
16114 and pseudovectors, and helps optimizing compilers not get fooled
16115 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16116 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
16117 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16118 the size member.
16119 (XSETPVECTYPE): Rewrite in terms of new macro.
16120 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16121 This is a bit clearer, and further avoids the possibility of
16122 undesirable aliasing.
16123 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
16124 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
16125 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16126 since Lisp_Subr is a special case (no "next" field).
16127 (ASIZE): Now uses header.size rather than size.
16128 All previous uses of XVECTOR (foo)->size replaced to use this macro,
16129 to avoid the hassle of writing XVECTOR (foo)->header.size.
16130 (struct vectorlike_header): New type.
16131 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16132 object, to help avoid aliasing.
16133 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16134 (SUBRP): Likewise, since Lisp_Subr is a special case.
16135 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16136 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16137 (struct Lisp_Hash_Table): Combine first two members into a single
16138 struct vectorlike_header member. All uses of "size" and "next" members
16139 changed to be "header.size" and "header.next".
16140 * buffer.h (struct buffer): Likewise.
16141 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16142 * frame.h (struct frame): Likewise.
16143 * process.h (struct Lisp_Process): Likewise.
16144 * termhooks.h (struct terminal): Likewise.
16145 * window.c (struct save_window_data, struct saved_window): Likewise.
16146 * window.h (struct window): Likewise.
16147 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16148 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16149 * buffer.c (init_buffer_once): Likewise.
16150 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16151 special case.
16152 * process.c (Fformat_network_address): Use local var for size,
16153 for brevity.
16154
16155 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16156
16157 Make the Lisp reader and string-to-float more consistent (Bug#8525)
16158 * data.c (atof): Remove decl; no longer used or needed.
16159 (digit_to_number): Move to lread.c.
16160 (Fstring_to_number): Use new string_to_number function, to be
16161 consistent with how the Lisp reader treats infinities and NaNs.
16162 Do not assume that floating-point numbers represent EMACS_INT
16163 without losing information; this is not true on most 64-bit hosts.
16164 Avoid double-rounding errors, by insisting on integers when
16165 parsing non-base-10 numbers, as the documentation specifies.
16166 * lisp.h (string_to_number): New decl, replacing ...
16167 (isfloat_string): Remove.
16168 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
16169 (read1): Do not accept +. and -. as integers; this
16170 appears to have been a coding error. Similarly, do not accept
16171 strings like +-1e0 as floating point numbers. Do not report
16172 overflow for integer overflows unless the base is not 10 which
16173 means we have no simple and reliable way to continue.
16174 Break out the floating-point parsing into a new
16175 function string_to_number, so that Fstring_to_number parses
16176 floating point numbers consistently with the Lisp reader.
16177 (digit_to_number): Move here from data.c. Make it static inline.
16178 (E_CHAR, EXP_INT): Remove, replacing with ...
16179 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16180 (string_to_number): New function, replacing isfloat_string.
16181 This function checks for valid syntax and produces the resulting
16182 Lisp float number too. Rework it so that string-to-number
16183 no longer mishandles examples like "1.0e+". Use strtoumax,
16184 so that overflow for non-base-10 numbers is reported only when
16185 there's no portable and simple way to convert to floating point.
16186
16187 * textprop.c (set_text_properties_1): Rewrite for clarity,
16188 and to avoid GCC warning about integer overflow.
16189
16190 * intervals.h (struct interval): Use EMACS_INT for members
16191 where EMACS_UINT might cause problems. See
16192 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16193 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16194 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16195 All uses changed.
16196 (offset_intervals): Tell GCC not to worry about length overflow
16197 when negating a negative length.
16198
16199 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16200 (overrun_check_free): Likewise.
16201
16202 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16203 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16204 word size.
16205
16206 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16207 (gnutls_make_error): Rename local to avoid shadowing.
16208 (gnutls_emacs_global_deinit): ifdef out; not used.
16209 (Fgnutls_boot): Use const for pointer to readonly storage.
16210 Comment out unused local. Fix pointer signedness problems.
16211
16212 * lread.c (openp): Don't stuff size_t into an 'int'.
16213 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16214 about possible signed overflow.
16215
16216 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16217 (GDK_KEY_g): Don't define if already defined.
16218 (xg_prepare_tooltip): Avoid pointer signedness problem.
16219 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
16220
16221 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
16222 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
16223
16224 * xfns.c (Fx_window_property): Simplify a bit,
16225 to make a bit faster and to avoid GCC 4.6.0 warning.
16226 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
16227
16228 * fns.c (internal_equal): Don't assume size_t fits in int.
16229
16230 * alloc.c (compact_small_strings): Tighten assertion a little.
16231
16232 Replace pEd with more-general pI, and fix some printf arg casts.
16233 * lisp.h (pI): New macro, generalizing old pEd macro to other
16234 conversion specifiers. For example, use "...%"pI"d..." rather
16235 than "...%"pEd"...".
16236 (pEd): Remove. All uses replaced with similar uses of pI.
16237 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
16238 * alloc.c (check_pure_size): Don't overflow by converting size to int.
16239 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
16240 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
16241 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
16242 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
16243 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
16244 64-bit hosts.
16245 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
16246 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
16247 * print.c (safe_debug_print, print_object): Likewise.
16248 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
16249 to int.
16250 Use pI instead of if-then-else-abort. Use %p to avoid casts,
16251 avoiding the 0 flag, which is not portable.
16252 * process.c (Fmake_network_process): Use pI to avoid cast.
16253 * region-cache.c (pp_cache): Likewise.
16254 * xdisp.c (decode_mode_spec): Likewise.
16255 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
16256 behavior on 64-bit hosts with printf arg.
16257 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
16258 (x_stop_queuing_selection_requests): Likewise.
16259 (x_get_window_property): Don't truncate byte count to an 'int'
16260 when tracing.
16261
16262 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
16263 here, since it parses constructs like leading '-' and spaces,
16264 which are not wanted; and it overflows with large numbers.
16265 Instead, simply match F[0-9]+, which is what is wanted anyway.
16266
16267 * alloc.c: Remove unportable assumptions about struct layout.
16268 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
16269 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
16270 (allocate_vectorlike, make_pure_vector): Use the new macros,
16271 plus offsetof, to remove unportable assumptions about struct layout.
16272 These assumptions hold on all porting targets that I know of, but
16273 they are not guaranteed, they're easy to remove, and removing them
16274 makes further changes easier.
16275
16276 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
16277 This doesn't fix a bug but makes the code clearer.
16278 (string_overrun_cookie): Now const. Use initializers that
16279 don't formally overflow signed char, to avoid warnings.
16280 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
16281 can cause Emacs to crash when string overrun checking is enabled.
16282 (allocate_buffer): Don't assume sizeof (struct buffer) is a
16283 multiple of sizeof (EMACS_INT); it need not be, if
16284 alignof(EMACS_INT) < sizeof (EMACS_INT).
16285 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
16286
16287 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
16288
16289 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
16290
16291 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
16292
16293 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
16294 supposed to be handshaking. (Bug#8556)
16295 Reported by Paul Eggert <eggert@cs.ucla.edu>.
16296
16297 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
16298
16299 * lisp.h (Qdebug): List symbol.
16300 * eval.c (Qdebug): Restore global linkage.
16301 * keyboard.c (debug-on-event): New variable.
16302 (handle_user_signal): Break into debugger when debug-on-event
16303 matches the current signal symbol.
16304
16305 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
16306
16307 * alloc.c (check_sblock, check_string_bytes)
16308 (check_string_free_list): Convert to standard C.
16309
16310 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
16311
16312 * w32.c (emacs_gnutls_push): Fix typo.
16313
16314 2011-04-25 Eli Zaretskii <eliz@gnu.org>
16315
16316 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
16317 "cast to pointer from integer of different size".
16318
16319 Improve doprnt and its use in verror. (Bug#8545)
16320 * doprnt.c (doprnt): Document the set of format control sequences
16321 supported by the function. Use SAFE_ALLOCA instead of always
16322 using `alloca'.
16323
16324 * eval.c (verror): Don't limit the buffer size at size_max-1, that
16325 is one byte too soon. Don't use xrealloc; instead xfree and
16326 xmalloc anew.
16327
16328 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
16329
16330 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
16331 callbacks stage.
16332
16333 * gnutls.c: Renamed global_initialized to
16334 gnutls_global_initialized. Added internals for the
16335 :verify-hostname-error, :verify-error, and :verify-flags
16336 parameters of `gnutls-boot' and documented those parameters in the
16337 docstring. Start callback support.
16338 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
16339 unless a fatal error occurred. Call gnutls_alert_send_appropriate
16340 on error. Return error code.
16341 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
16342 (emacs_gnutls_read): Likewise.
16343 (Fgnutls_boot): Return handshake error code.
16344 (emacs_gnutls_handle_error): New function.
16345 (wsaerror_to_errno): Likewise.
16346
16347 * w32.h (emacs_gnutls_pull): Add prototype.
16348 (emacs_gnutls_push): Likewise.
16349
16350 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
16351 (emacs_gnutls_push): Likewise.
16352
16353 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
16354
16355 * process.c (wait_reading_process_output): Check if GnuTLS
16356 buffered some data internally if no FDs are set for TLS
16357 connections.
16358
16359 * makefile.w32-in (OBJ2): Add gnutls.$(O).
16360 (LIBS): Link to USER_LIBS.
16361 ($(BLD)/gnutls.$(0)): New target.
16362
16363 2011-04-24 Eli Zaretskii <eliz@gnu.org>
16364
16365 * xdisp.c (handle_single_display_spec): Rename the
16366 display_replaced_before_p argument into display_replaced_p, to
16367 make it consistent with the commentary. Fix typos in the
16368 commentary.
16369
16370 * textprop.c (syms_of_textprop): Remove dead code.
16371 (copy_text_properties): Delete obsolete commentary about an
16372 interface that was deleted long ago. Fix typos in the description
16373 of arguments.
16374
16375 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
16376 to changes in oldXMenu/XMenu.h from 2011-04-16.
16377 <menu_help_message, prev_menu_help_message>: Constify.
16378 (IT_menu_make_room): menu->help_text is now `const char **';
16379 adjust.
16380
16381 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
16382 to changes in oldXMenu/XMenu.h from 2011-04-16.
16383 (struct XMenu): Declare `help_text' `const char **'.
16384
16385 * xfaces.c <Qunspecified>: Make extern again.
16386
16387 * syntax.c: Include sys/types.h before including regex.h, as
16388 required by POSIX.
16389
16390 * doc.c (get_doc_string): Improve the format passed to `error'.
16391
16392 * doprnt.c (doprnt): Improve commentary.
16393
16394 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
16395
16396 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
16397 them with etags.
16398
16399 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
16400 changes in globals.h immediately force recompilation.
16401 (TAGS): Depend on $(CURDIR)/m/intel386.h and
16402 $(CURDIR)/s/ms-w32.h.
16403 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
16404
16405 * character.c (Fchar_direction): Function deleted.
16406 (syms_of_character): Don't defsubr it.
16407 <char-direction-table>: Deleted.
16408
16409 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16410
16411 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
16412 * doprnt.c: Include limits.h.
16413 (SIZE_MAX): New macro.
16414 (doprnt): Return a size_t value. 2nd arg is now size_t.
16415 Many local variables are now size_t instead of int or unsigned.
16416 Improve overflow protection. Support `l' modifier for integer
16417 conversions. Support %l conversion. Don't assume an EMACS_INT
16418 argument for integer conversions and for %c.
16419
16420 * lisp.h (doprnt): Restore prototype.
16421
16422 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16423 $(SRC)/character.h.
16424
16425 * Makefile.in (base_obj): Add back doprnt.o.
16426
16427 * deps.mk (doprnt.o): Add back prerequisites.
16428 (callint.o): Depend on character.h.
16429
16430 * eval.c (internal_lisp_condition_case): Include the handler
16431 representation in the error message.
16432 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
16433 when breaking from the loop.
16434
16435 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
16436
16437 * callint.c (Fcall_interactively): When displaying error message
16438 about invalid control letter, pass the character's codepoint, not
16439 a pointer to its multibyte form. Improve display of the character
16440 in octal and display also its hex code.
16441
16442 * character.c (char_string): Use %x to display the (unsigned)
16443 codepoint of an invalid character, to avoid displaying a bogus
16444 negative value.
16445
16446 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16447 `error', not SYMBOL_NAME itself.
16448
16449 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16450 character arguments to `error'.
16451
16452 * charset.c (check_iso_charset_parameter): Fix incorrect argument
16453 to `error' in error message about FINAL_CHAR argument. Make sure
16454 FINAL_CHAR is a character, and use %c when it is passed as
16455 argument to `error'.
16456
16457 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16458
16459 * s/ms-w32.h (localtime): Redirect to sys_localtime.
16460
16461 * w32.c: Include <time.h>.
16462 (sys_localtime): New function.
16463
16464 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
16465
16466 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16467
16468 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
16469
16470 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
16471
16472 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16473 zombies (Bug#8467).
16474
16475 2011-04-19 Eli Zaretskii <eliz@gnu.org>
16476
16477 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16478 gl_state.e_property when gl_state.object is Qt.
16479
16480 * insdel.c (make_gap_larger): Remove limitation of buffer size
16481 to <= INT_MAX.
16482
16483 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
16484
16485 * xdisp.c (lookup_glyphless_char_display)
16486 (produce_glyphless_glyph): Handle cons cell entry in
16487 glyphless-char-display.
16488 (Vglyphless_char_display): Document it.
16489
16490 * term.c (produce_glyphless_glyph): Handle cons cell entry in
16491 glyphless-char-display.
16492
16493 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
16494
16495 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16496
16497 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16498
16499 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16500 definition for no-X builds.
16501
16502 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
16503
16504 Static checks with GCC 4.6.0 and non-default toolkits.
16505
16506 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16507
16508 * process.c (keyboard_bit_set): Define only if SIGIO.
16509 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16510 (send_process): Repair possible setjmp clobbering.
16511
16512 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16513
16514 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16515
16516 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16517
16518 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16519 Define only if needed.
16520
16521 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16522 by pacifying GCC about it. Maybe it's time to retire it?
16523 * xfaces.c (USG, __TIMEVAL__): Likewise.
16524
16525 * dispextern.h (struct redisplay_interface): Rename param
16526 to avoid shadowing.
16527 * termhooks.h (struct terminal): Likewise.
16528 * xterm.c (xembed_send_message): Likewise.
16529
16530 * insdel.c (make_gap_smaller): Define only if
16531 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16532
16533 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16534 it.
16535
16536 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16537 so that we aren't warned about unused symbols.
16538
16539 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16540
16541 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
16542
16543 * xfns.c (x_real_positions): Mark locals as initialized.
16544
16545 * xmenu.c (xmenu_show): Don't use uninitialized vars.
16546
16547 * xterm.c: Fix problems found by static analysis with other toolkits.
16548 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
16549 (x_dispatch_event): Declare static if USE_GTK, and
16550 define if USE_GTK || USE_X_TOOLKIT.
16551 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
16552 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
16553 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16554 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
16555
16556 * xmenu.c (menu_help_callback): Pointer type fixes.
16557 Use const pointers when pointing at readonly data. Avoid pointer
16558 signedness clashes.
16559 (FALSE): Remove unused macro.
16560 (update_frame_menubar): Remove unused decl.
16561
16562 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
16563
16564 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
16565 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
16566 (single_menu_item): Rename local to avoid shadowing.
16567
16568 * keyboard.c (make_lispy_event): Remove unused local var.
16569
16570 * frame.c, frame.h (x_get_resource_string): Bring this back, but
16571 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
16572
16573 * bitmaps: Change bitmaps from unsigned char back to the X11
16574 compatible char. Avoid the old compiler warnings about
16575 out-of-range initializers by using, for example, '\xab' rather
16576 than 0xab.
16577
16578 * xgselect.c (xgselect_initialize): Check vs interface
16579 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
16580
16581 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
16582
16583 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
16584 to read-only memory.
16585
16586 * fns.c (vector): Remove; this old hack is no longer needed.
16587
16588 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
16589 Remove unused var.
16590 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
16591
16592 * xrdb.c (x_load_resources): Omit unused local.
16593
16594 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
16595 (x_window): Rename locals to avoid shadowing.
16596 (USG): Use the kludged USG macro, to pacify gcc.
16597
16598 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
16599 (x_term_init): Remove local to avoid shadowing.
16600
16601 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
16602
16603 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
16604 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
16605
16606 2011-04-16 Eli Zaretskii <eliz@gnu.org>
16607
16608 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
16609
16610 Fix regex.c, syntax.c and friends for buffers > 2GB.
16611 * syntax.h (struct gl_state_s): Declare character position members
16612 EMACS_INT.
16613
16614 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
16615
16616 * textprop.c (verify_interval_modification, interval_of):
16617 Declare arguments EMACS_INT.
16618
16619 * intervals.c (adjust_intervals_for_insertion): Declare arguments
16620 EMACS_INT.
16621
16622 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
16623
16624 * indent.c (Fvertical_motion): Local variable it_start is now
16625 EMACS_INT.
16626
16627 * regex.c (re_match, re_match_2, re_match_2_internal)
16628 (bcmp_translate, regcomp, regexec, print_double_string)
16629 (group_in_compile_stack, re_search, re_search_2, regex_compile)
16630 (re_compile_pattern, re_exec): Declare arguments and local
16631 variables `size_t' and `ssize_t' and return values `regoff_t', as
16632 appropriate.
16633 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16634 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16635 <compile_stack_type>: `size' and `avail' are now `size_t'.
16636
16637 * regex.h <regoff_t>: Use ssize_t, not int.
16638 (re_search, re_search_2, re_match, re_match_2): Arguments that
16639 specify buffer/string position and length are now ssize_t and
16640 size_t. Return type is regoff_t.
16641
16642 2011-04-16 Ben Key <bkey76@gmail.com>
16643
16644 * nsfont.m: Fixed bugs in ns_get_family and
16645 ns_descriptor_to_entity that were caused by using free to
16646 deallocate memory blocks that were allocated by xmalloc (via
16647 xstrdup). This caused Emacs to crash when compiled with
16648 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16649 --enable-checking=xmallocoverrun). xfree is now used to
16650 deallocate these memory blocks.
16651
16652 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
16653
16654 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16655
16656 emacs_write: Accept and return EMACS_INT for sizes.
16657 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16658 et seq.
16659 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16660 Accept and return EMACS_INT.
16661 (emacs_gnutls_write): Return the number of bytes written on
16662 partial writes.
16663 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
16664 (emacs_read, emacs_write): Remove check for negative size, as the
16665 Emacs source code has been audited now.
16666 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16667 (emacs_read, emacs_write): Use it.
16668 * process.c (send_process): Adjust to the new signatures of
16669 emacs_write and emacs_gnutls_write. Do not attempt to store
16670 a byte offset into an 'int'; it might overflow.
16671 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
16672
16673 * sound.c: Don't assume sizes fit in 'int'.
16674 (struct sound_device.period_size, alsa_period_size):
16675 Return EMACS_INT, not int.
16676 (struct sound_device.write, vox_write, alsa_write):
16677 Accept EMACS_INT, not int.
16678 (wav_play, au_play): Use EMACS_INT to store sizes and to
16679 record read return values.
16680
16681 2011-04-15 Ben Key <bkey76@gmail.com>
16682
16683 * keyboard.c (Qundefined): Don't declare static since it is used
16684 in nsfns.m.
16685 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16686 static since they are used in nsfont.m.
16687
16688 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
16689
16690 * process.c (Qprocessp): Don't declare static.
16691 * lisp.h (Qprocessp): Declare again.
16692
16693 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
16694
16695 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16696
16697 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
16698
16699 Improve C-level modularity by making more things 'static'.
16700
16701 Don't publish debugger-only interfaces to other modules.
16702 * lisp.h (safe_debug_print, debug_output_compilation_hack):
16703 (verify_bytepos, count_markers): Move decls to the only modules
16704 that need them.
16705 * region-cache.h (pp_cache): Likewise.
16706 * window.h (check_all_windows): Likewise.
16707 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16708
16709 * sysdep.c (croak): Now static, if
16710 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16711 * syssignal.h (croak): Declare only if not static.
16712
16713 * alloc.c (refill_memory_reserve): Now static if
16714 !defined REL_ALLOC || defined SYSTEM_MALLOC.
16715 * lisp.h (refill_memory_reserve): Declare only if not static.
16716
16717 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
16718 Define only if USE_LUCID.
16719
16720 * xrdb.c (x_customization_string, x_rm_string): Now static.
16721
16722 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
16723 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
16724
16725 * xdisp.c (draw_row_with_mouse_face): Now static.
16726 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
16727
16728 * window.h (check_all_windows): Mark externally visible.
16729
16730 * window.c (window_deletion_count): Now static.
16731
16732 * undo.c: Make symbols static if they're not exported.
16733 (last_undo_buffer, last_boundary_position, pending_boundary):
16734 Now static.
16735
16736 * textprop.c (interval_insert_behind_hooks): Now static.
16737 (interval_insert_in_front_hooks): Likewise.
16738
16739 * term.c: Make symbols static if they're not exported.
16740 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
16741 (max_frame_lines, tty_set_terminal_modes):
16742 (tty_reset_terminal_modes, tty_turn_off_highlight):
16743 (get_tty_terminal): Now static.
16744 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
16745 * termhooks.h (term_mouse_moveto): Do not declare if
16746 HAVE_WINDOW_SYSTEM.
16747 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16748 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16749
16750 * sysdep.c: Make symbols static if they're not exported.
16751 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16752 Now static.
16753 (sigprocmask_set, full_mask): Remove; unused.
16754 (wait_debugging): Mark as visible.
16755 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16756 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16757
16758 * syntax.c (syntax_temp): Define only if !__GNUC__.
16759
16760 * sound.c (current_sound_device, current_sound): Now static.
16761
16762 * search.c (searchbufs, searchbuf_head): Now static.
16763
16764 * scroll.c (scroll_cost): Remove; unused.
16765 * dispextern.h (scroll_cost): Remove decl.
16766
16767 * region-cache.h (pp_cache): Mark as externally visible.
16768
16769 * process.c: Make symbols static if they're not exported.
16770 (process_tick, update_tick, create_process, chan_process):
16771 (Vprocess_alist, proc_buffered_char, datagram_access):
16772 (fd_callback_data, send_process_frame, process_sent_to): Now static.
16773 (deactivate_process): Mark defn as static, as well as decl.
16774 * lisp.h (create_process): Remove decl.
16775 * process.h (chan_process, Vprocess_alist): Remove decls.
16776
16777 * print.c: Make symbols static if they're not exported.
16778 (print_depth, new_backquote_output, being_printed, print_buffer):
16779 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16780 (print_interval, print_number_index, initial_stderr_stream):
16781 Now static.
16782 * lisp.h (Fprinc): Remove decl.
16783 (debug_output_compilation_hack): Mark as externally visible.
16784
16785 * sysdep.c (croak): Move decl from here to syssignal.h.
16786 * syssignal.h (croak): Put it here, so the API can be checked when
16787 'croak' is called from dissociate_if_controlling_tty.
16788
16789 * minibuf.c: Make symbols static if they're not exported.
16790 (minibuf_save_list, choose_minibuf_frame): Now static.
16791 * lisp.h (choose_minibuf_frame): Remove decl.
16792
16793 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16794
16795 * lread.c: Make symbols static if they're not exported.
16796 (read_objects, initial_obarray, oblookup_last_bucket_number):
16797 Now static.
16798 (make_symbol): Remove; unused.
16799 * lisp.h (initial_obarray, make_symbol): Remove decls.
16800
16801 * keyboard.c: Make symbols static if they're not exported.
16802 (single_kboard, recent_keys_index, total_keys, recent_keys):
16803 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16804 (this_single_command_key_start, echoing, last_auto_save):
16805 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16806 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16807 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16808 (Vlispy_mouse_stem, double_click_count):
16809 Now static.
16810 (force_auto_save_soon): Define only if SIGDANGER.
16811 (ignore_mouse_drag_p): Now static if
16812 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16813 (print_help): Remove; unused.
16814 (stop_character, last_timer_event): Mark as externally visible.
16815 * keyboard.h (ignore_mouse_drag_p): Declare only if
16816 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16817 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16818 * lisp.h (echoing): Remove decl.
16819 (force_auto_save_soon): Declare only if SIGDANGER.
16820 * xdisp.c (redisplay_window): Simplify code, to make it more
16821 obvious that ignore_mouse_drag_p is not accessed if !defined
16822 USE_GTK && !defined HAVE_NS.
16823
16824 * intervals.c: Make symbols static if they're not exported.
16825 (merge_properties_sticky, merge_interval_right, delete_interval):
16826 Now static.
16827 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16828
16829 * insdel.c: Make symbols static if they're not exported.
16830 However, leave prepare_to_modify_buffer alone. It's never
16831 called from outside this function, but that appears to be a bug.
16832 (combine_after_change_list, combine_after_change_buffer):
16833 (adjust_after_replace, signal_before_change): Now static.
16834 (adjust_after_replace_noundo): Remove; unused.
16835 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
16836 (signal_before_change): Remove decls.
16837
16838 * indent.c (val_compute_motion, val_vmotion): Now static.
16839
16840 * image.c: Make symbols static if they're not exported.
16841 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16842 if USE_GTK.
16843 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16844 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16845
16846 * fringe.c (standard_bitmaps): Now static.
16847 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16848
16849 * frame.c: Make symbols static if they're not exported.
16850 (x_report_frame_params, make_terminal_frame): Now static.
16851 (get_frame_param): Now static, unless HAVE_NS.
16852 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16853 (x_get_resource_string): Remove; not used.
16854 * frame.h (make_terminal_frame, x_report_frame_params):
16855 (x_get_resource_string); Remove decls.
16856 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16857 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16858
16859 * font.c, fontset.c: Make symbols static if they're not exported.
16860 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16861 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16862 * font.c (font_close_object): Now static.
16863 * font.h (font_close_object): Remove.
16864 * fontset.c (FONTSET_OBJLIST): Remove.
16865 (free_realized_fontset) #if-0 the body, which does nothing.
16866 (face_suitable_for_char_p): #if-0, as it's never called.
16867 * fontset.h (face_suitable_for_char_p): Remove decl.
16868 * xfaces.c (face_at_string_position):
16869 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
16870 since 0 is always ASCII.
16871
16872 * fns.c (weak_hash_tables): Now static.
16873
16874 * fileio.c: Make symbols static if they're not exported.
16875 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16876 (Vwrite_region_annotation_buffers): Now static.
16877
16878 * eval.c: Make symbols static if they're not exported.
16879 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16880 * lisp.h (backtrace_list): Remove decl.
16881
16882 * emacs.c: Make symbols static if they're not exported.
16883 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16884 (fatal_error_code, fatal_error_signal_hook, standard_args):
16885 Now static.
16886 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16887 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16888 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16889 * lisp.h (fatal_error_signal_hook): Remove decl.
16890 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16891
16892 * editfns.c: Move a (normally-unused) function to its only use.
16893 * editfns.c, lisp.h (get_operating_system_release): Remove.
16894 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16895 worth the hassle of breaking this out.
16896
16897 * xterm.c: Make symbols static if they're not exported.
16898 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16899 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16900 (x_destroy_window, x_delete_display):
16901 Now static.
16902 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16903 (x_mouse_leave): Remove; unused.
16904 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16905 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16906 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16907 Remove decls.
16908 (x_mouse_leave): Declare only if WINDOWSNT.
16909 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16910 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16911 USE_X_TOOLKIT.
16912
16913 * ftxfont.c: Make symbols static if they're not exported.
16914 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16915 HAVE_FREETYPE.
16916 * font.h (ftxfont_driver): Likewise.
16917
16918 * xfns.c: Make symbols static if they're not exported.
16919 (x_last_font_name, x_display_info_for_name):
16920 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16921 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16922 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16923 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16924 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16925 (last_show_tip_args): Now static.
16926 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16927 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16928 (x_screen_planes): Remove; unused.
16929 * dispextern.h (x_screen_planes): Remove decl.
16930
16931 * dispnew.c: Make symbols static if they're not exported.
16932 * dispextern.h (redraw_garbaged_frames, scrolling):
16933 (increment_row_positions): Remove.
16934 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16935 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16936 Now static.
16937 (redraw_garbaged_frames): Remove; unused.
16938
16939 * xfaces.c: Make symbols static if they're not exported.
16940 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16941 Remove decls.
16942 * xterm.h (defined_color): Remove decls.
16943 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16944 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16945 (menu_face_changed_default, defined_color, free_realized_face):
16946 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16947 (ascii_face_of_lisp_face): Remove; unused.
16948
16949 * xdisp.c: Make symbols static if they're not exported.
16950 * dispextern.h (scratch_glyph_row, window_box_edges):
16951 (glyph_to_pixel_coords, set_cursor_from_row):
16952 (get_next_display_element, set_iterator_to_next):
16953 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16954 (show_mouse_face): Remove decls
16955 * frame.h (message_buf_print): Likewise.
16956 * lisp.h (pop_message, set_message, check_point_in_composition):
16957 Likewise.
16958 * xterm.h (set_vertical_scroll_bar): Likewise.
16959 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16960 (message_buf_print, scratch_glyph_row, displayed_buffer):
16961 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16962 (get_next_display_element, show_mouse_face, window_box_edges):
16963 (frame_to_window_pixel_xy, check_point_in_composition):
16964 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16965 (glyph_to_pixel_coords): Remove; unused.
16966
16967 * dired.c (file_name_completion): Now static.
16968
16969 * dbusbind.c (xd_in_read_queued_messages): Now static.
16970
16971 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16972 * data.c (circular_list_error): Remove.
16973
16974 * commands.h (last_point_position, last_point_position_buffer):
16975 (last_point_position_window): Remove decls.
16976 * keyboard.c: Make these variables static.
16977
16978 * coding.h (coding, code_convert_region, encode_coding_gap):
16979 Remove decls.
16980 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16981 (iso_code_class, detect_coding, code_convert_region): Now static.
16982 (encode_coding_gap): Remove; unused.
16983
16984 * chartab.c (chartab_chars, chartab_bits): Now static.
16985
16986 * charset.h (charset_iso_8859_1): Remove decl.
16987 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16988 Now static.
16989
16990 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16991 * ccl.c (Vccl_program_table): Now static.
16992 (check_ccl_update): Remove; unused.
16993
16994 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16995 * category.h: ... from here.
16996 * category.c (check_category_table, set_category_set): Now static.
16997
16998 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16999 * lisp.h: Remove these decls.
17000
17001 * buffer.c (buffer_count): Remove unused var.
17002
17003 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17004 so that it's not optimized away.
17005 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17006 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17007 exported only to the debugger.
17008
17009 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
17010 * atimer.h (run_all_atimers): Remove; not exported.
17011
17012 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17013 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17014 was inaccessible from Lisp.
17015 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17016 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17017
17018 alloc.c: Import and export fewer symbols, and remove unused items.
17019 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17020 is defined.
17021 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17022 it's not optimized away by whole-program optimization.
17023 (message_enable_multibyte, free_misc): Remove.
17024 (catchlist, handlerlist, mark_backtrace):
17025 Declare only if BYTE_MARK_STACK.
17026 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17027 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17028 (message_enable_multibyte): Remove decl.
17029 (free_misc, interval_free_list, float_block, float_block_index):
17030 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17031 (cons_free_list, last_marked_index):
17032 Now static.
17033 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17034 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17035 (mark_backtrace): Define only if BYTE_MARK_STACK.
17036 * xdisp.c (message_enable_multibyte): Now static.
17037
17038 Declare Lisp_Object Q* variables to be 'static' if not exported.
17039 This makes it easier for human readers (and static analyzers)
17040 to see whether these variables are used from other modules.
17041 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17042 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17043 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17044 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17045 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17046 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17047 * xmenu.c, xselect.c:
17048 Declare Q* vars static if they are not used in other modules.
17049 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17050 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17051 Remove decls of unexported vars.
17052 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17053
17054 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17055
17056 Make Emacs functions such as Fatom 'static' by default.
17057 This makes it easier for human readers (and static analyzers)
17058 to see whether these functions can be called from other modules.
17059 DEFUN now defines a static function. To make the function external
17060 so that it can be used in other C modules, use the new macro DEFUE.
17061 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17062 (Finit_image_library):
17063 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17064 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17065 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17066 Remove decls, since these functions are now static.
17067 (Funintern, Fget_internal_run_time): New decls, since these functions
17068 were already external.
17069
17070 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17071 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17072 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17073 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17074 * keyboard.c, keymap.c, lread.c:
17075 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17076 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17077 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17078 Mark functions with DEFUE instead of DEFUN,
17079 if they are used in other modules.
17080 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17081 decls for now-static functions.
17082 * buffer.h (Fdelete_overlay): Remove decl.
17083 * callproc.c (Fgetenv_internal): Mark as internal.
17084 * composite.c (Fremove_list_of_text_properties): Remove decl.
17085 (Fcomposition_get_gstring): New forward static decl.
17086 * composite.h (Fcomposite_get_gstring): Remove decl.
17087 * dired.c (Ffile_attributes): New forward static decl.
17088 * doc.c (Fdocumntation_property): New forward static decl.
17089 * eval.c (Ffetch_bytecode): New forward static decl.
17090 (Funintern): Remove extern decl; now in .h file where it belongs.
17091 * fileio.c (Fmake_symbolic_link): New forward static decl.
17092 * image.c (Finit_image_library): New forward static decl.
17093 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17094 * intervals.h (Fprevious_property_change):
17095 (Fremove_list_of_text_properties): Remove decls.
17096 * keyboard.c (Fthis_command_keys): Remove decl.
17097 (Fcommand_execute): New forward static decl.
17098 * keymap.c (Flookup_key): New forward static decl.
17099 (Fcopy_keymap): Now static.
17100 * keymap.h (Flookup_key): Remove decl.
17101 * process.c (Fget_process): New forward static decl.
17102 (Fprocess_datagram_address): Mark as internal.
17103 * syntax.c (Fsyntax_table_p): New forward static decl.
17104 (skip_chars): Remove duplicate decl.
17105 * textprop.c (Fprevious_property_change): New forward static decl.
17106 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17107 Now internal.
17108 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17109 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17110
17111 * editfns.c (Fformat): Remove unreachable code.
17112
17113 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17114
17115 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17116 change. (Bug#8496)
17117
17118 2011-04-13 Eli Zaretskii <eliz@gnu.org>
17119
17120 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17121 when at ZV. (Bug#8487)
17122
17123 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17124
17125 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17126 (Bug#8437)
17127 * keyboard.c (parse_tool_bar_item): Likewise.
17128 * sound.c (sound_cleanup, alsa_close): Likewise.
17129 * termcap.c (tgetent): Likewise.
17130 * xfns.c (x_default_font_parameter): Likewise.
17131 * xsettings.c (read_and_apply_settings): Likewise.
17132
17133 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17134 (overrun_check_free): Protoize.
17135
17136 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17137
17138 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17139 since callers should never pass a negative size.
17140 Change the signature to match that of plain 'read' and 'write'; see
17141 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17142 * lisp.h: Update prototypes of emacs_write and emacs_read.
17143
17144 2011-04-11 Eli Zaretskii <eliz@gnu.org>
17145
17146 * xdisp.c (redisplay_window): Don't try to determine the character
17147 position of the scroll margin if the window start point w->startp
17148 is outside the buffer's accessible region. (Bug#8468)
17149
17150 2011-04-10 Eli Zaretskii <eliz@gnu.org>
17151
17152 Fix write-region and its subroutines for buffers > 2GB.
17153 * fileio.c (a_write, e_write): Modify declaration of arguments and
17154 local variables to support buffers larger than 2GB.
17155 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17156
17157 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17158 argument, local variables, and return value.
17159
17160 * lisp.h: Update prototypes of emacs_write and emacs_read.
17161
17162 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17163
17164 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
17165
17166 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17167
17168 Fix more problems found by GCC 4.6.0's static checks.
17169
17170 * xdisp.c (vmessage): Use a better test for character truncation.
17171
17172 * charset.c (load_charset_map): <, not <=, for optimization,
17173 and to avoid potential problems with integer overflow.
17174 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
17175 * casetab.c (set_identity, shuffle): Likewise.
17176 * editfns.c (Fformat): Likewise.
17177 * syntax.c (skip_chars): Likewise.
17178
17179 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17180 This also lets GCC 4.6.0 generate slightly better loop code.
17181
17182 * callint.c (Fcall_interactively): <, not <=, for optimization.
17183 (Fcall_interactively): Count the number of arguments produced,
17184 not the number of arguments given. This is simpler and lets GCC
17185 4.6.0 generate slightly better code.
17186
17187 * ftfont.c: Distingish more carefully between FcChar8 and char.
17188 The previous code passed unsigned char * to a functions like
17189 strlen and xstrcasecmp that expect char *, which does not
17190 conform to the C standard.
17191 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17192 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17193 char * when the C standard requires it.
17194
17195 * keyboard.c (read_char): Remove unused var.
17196
17197 * eval.c: Port to Windows vsnprintf (Bug#8435).
17198 Include <limits.h>.
17199 (SIZE_MAX): Define if the headers do not.
17200 (verror): Do not give up if vsnprintf returns a negative count.
17201 Instead, grow the buffer. This ports to Windows vsnprintf, which
17202 does not conform to C99. Problem reported by Eli Zaretskii.
17203 Also, simplify the allocation scheme, by avoiding the need for
17204 calling realloc, and removing the ALLOCATED variable.
17205
17206 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17207
17208 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17209 But keep the doprint source code for now, as we might revamp it
17210 and use it again (Bug#8435).
17211 * lisp.h (doprnt): Remove.
17212 * Makefile.in (base_obj): Remove doprnt.o.
17213 * deps.mk (doprnt.o): Remove.
17214
17215 error: Print 32- and 64-bit integers portably (Bug#8435).
17216 Without this change, on typical 64-bit hosts error ("...%d...", N)
17217 was used to print both 32- and 64-bit integers N, which relied on
17218 undefined behavior.
17219 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
17220 * lisp.h (error, verror): Mark as printf-like functions.
17221 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
17222 Report overflow in size calculations when allocating printf buffer.
17223 Do not truncate output string at its first null byte.
17224 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
17225 Truncate the output at a character boundary, since vsnprintf does not
17226 do that.
17227 * charset.c (check_iso_charset_parameter): Convert internal
17228 character to string before calling 'error', since %c now has the
17229 printf meaning.
17230 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
17231 overflow when computing char to be passed to 'error'. Do not
17232 pass Lisp_Object to 'error'; pass the integer instead.
17233 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
17234 formatted with plain %d.
17235
17236 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
17237
17238 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
17239
17240 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
17241
17242 * xterm.c (x_catch_errors): Remove duplicate declaration.
17243
17244 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
17245
17246 * xdisp.c, lisp.h (message_nolog): Remove; unused.
17247
17248 2011-04-10 Jim Meyering <meyering@redhat.com>
17249
17250 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
17251 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
17252 return ssize_t not "int", and use size_t as the buffer length.
17253 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
17254 * gnutls.h: Update declarations.
17255 * process.c (read_process_output): Use ssize_t, to match.
17256 (send_process): Likewise.
17257
17258 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17259
17260 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
17261
17262 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17263
17264 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
17265 Use unsigned char, to match FcChar8 type definition.
17266
17267 * xterm.c (handle_one_xevent):
17268 * xmenu.c (create_and_show_popup_menu):
17269 * xselect.c (x_decline_selection_request)
17270 (x_reply_selection_request): Avoid type-punned deref of X events.
17271
17272 2011-04-09 Eli Zaretskii <eliz@gnu.org>
17273
17274 Fix some uses of `int' instead of EMACS_INT.
17275 * search.c (string_match_1, fast_string_match)
17276 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
17277 (scan_buffer, find_next_newline_no_quit)
17278 (find_before_next_newline, search_command, Freplace_match)
17279 (Fmatch_data): Make some `int' variables be EMACS_INT.
17280
17281 * xdisp.c (display_count_lines): 3rd argument and return value now
17282 EMACS_INT. All callers changed.
17283 (pint2hrstr): Last argument is now EMACS_INT.
17284
17285 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
17286 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
17287 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
17288 (decode_coding_utf_16, decode_coding_emacs_mule)
17289 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
17290 (decode_coding_ccl, decode_coding_charset)
17291 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
17292 (decode_coding_iso_2022, decode_coding_emacs_mule)
17293 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
17294 <char_offset, last_offset>: Declare EMACS_INT.
17295 (encode_coding_utf_8, encode_coding_utf_16)
17296 (encode_coding_emacs_mule, encode_invocation_designation)
17297 (encode_designation_at_bol, encode_coding_iso_2022)
17298 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
17299 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
17300 Declare EMACS_INT.
17301 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
17302 (encode_invocation_designation): Last argument P_NCHARS is now
17303 EMACS_INT.
17304 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
17305 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
17306
17307 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
17308 All users changed.
17309
17310 * ccl.c (Fccl_execute_on_string): Declare some variables
17311 EMACS_INT.
17312
17313 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
17314
17315 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
17316
17317 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
17318
17319 * process.c (Fformat_network_address): Doc fix.
17320
17321 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
17322
17323 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
17324
17325 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
17326
17327 * keyboard.c (read_char): Call Lisp function help-form-show,
17328 instead of using internal_with_output_to_temp_buffer.
17329 (Qhelp_form_show): New var.
17330 (syms_of_keyboard): Use DEFSYM macro.
17331
17332 * print.c (internal_with_output_to_temp_buffer): Function deleted.
17333
17334 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
17335
17336 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
17337
17338 * process.c (Flist_processes): Remove to Lisp.
17339 (list_processes_1): Delete.
17340
17341 2011-04-06 Eli Zaretskii <eliz@gnu.org>
17342
17343 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
17344
17345 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
17346
17347 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
17348
17349 Fix more problems found by GCC 4.6.0's static checks.
17350
17351 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
17352
17353 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
17354
17355 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
17356
17357 * xdisp.c (vmessage): Mark as a printf-like function.
17358
17359 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
17360
17361 * sound.c (sound_warning): Don't crash if arg contains a printf format.
17362
17363 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
17364 printf-like functions.
17365 (tiff_load): Add casts to remove these marks before passing them
17366 to system-supplied API.
17367
17368 * eval.c (Fsignal): Remove excess argument to 'fatal'.
17369
17370 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
17371 This avoids several warnings with gcc -Wstrict-overflow.
17372 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
17373 directly, rather than having caller test rule sign. This avoids
17374 some unnecessary tests.
17375 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
17376 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
17377 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
17378
17379 * xfont.c (xfont_text_extents): Remove var that was set but not used.
17380 (xfont_open): Avoid unnecessary tests.
17381
17382 * composite.c (composition_gstring_put_cache): Use unsigned integer.
17383
17384 * composite.h, composite.c (composition_gstring_put_cache):
17385 Use EMACS_INT, not int, for length.
17386
17387 * composite.h (COMPOSITION_DECODE_REFS): New macro,
17388 breaking out part of COMPOSITION_DECODE_RULE.
17389 (COMPOSITION_DECODE_RULE): Use it.
17390 * composite.c (get_composition_id): Remove unused local vars,
17391 by using the new macro.
17392
17393 * textprop.c (set_text_properties_1): Change while to do-while,
17394 since the condition is always true at first.
17395
17396 * intervals.c (graft_intervals_into_buffer): Mark var as used.
17397 (interval_deletion_adjustment): Return unsigned value.
17398 All uses changed.
17399
17400 * process.c (list_processes_1, create_pty, read_process_output):
17401 (exec_sentinel): Remove vars that were set but not used.
17402 (create_pty): Remove unnecessary "volatile"s.
17403 (Fnetwork_interface_info): Avoid possibility of int overflow.
17404 (read_process_output): Do adaptive read buffering even if carryover.
17405 (read_process_output): Simplify nbytes computation if buffered.
17406
17407 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
17408
17409 * syntax.c (scan_words): Remove var that was set but not used.
17410 (update_syntax_table): Use unsigned instead of int.
17411
17412 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
17413 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
17414 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
17415
17416 * print.c (print_error_message): Avoid int overflow.
17417
17418 * font.c (font_list_entities): Redo for clarity,
17419 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17420
17421 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
17422 (font_score): Avoid potential overflow in diff calculation.
17423
17424 * fns.c (substring_both): Remove var that is set but not used.
17425 (sxhash): Redo loop for clarity and to avoid wraparound warning.
17426
17427 * eval.c (funcall_lambda): Rename local to avoid shadowing.
17428
17429 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
17430 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
17431 can always succeed if overflow has undefined behavior.
17432
17433 * search.c (boyer_moore, wordify): Remove vars set but not used.
17434 (wordify): Omit three unnecessary tests.
17435
17436 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
17437 All callers changed. This avoids the need for an unused var.
17438
17439 * casefiddle.c (casify_region): Remove var that is set but not used.
17440
17441 * dired.c (file_name_completion): Remove var that is set but not used.
17442
17443 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17444
17445 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
17446 (Finsert_file_contents): Remove unnecessary code checking fd.
17447
17448 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17449 Check for integer overflow on size calculations.
17450
17451 * buffer.c (Fprevious_overlay_change): Remove var that is set
17452 but not used.
17453
17454 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17455 Remove vars that are set but not used.
17456 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
17457 (timer_check_2): Mark vars as initialized.
17458
17459 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17460
17461 * image.c (lookup_image): Remove var that is set but not used.
17462 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
17463
17464 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17465 that are set but not used.
17466
17467 * xfns.c (make_invisible_cursor): Don't return garbage
17468 if XCreateBitmapFromData fails (Bug#8410).
17469
17470 * xselect.c (x_get_local_selection, x_handle_property_notify):
17471 Remove vars that are set but not used.
17472
17473 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
17474 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
17475
17476 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17477 Remove var that is set but not used.
17478 (scroll_bar_windows_size): Now size_t, not int.
17479 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
17480 Check for overflow.
17481
17482 * xfaces.c (realize_named_face): Remove vars that are set but not used.
17483 (map_tty_color) [!defined MSDOS]: Likewise.
17484
17485 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17486
17487 * coding.c: Remove vars that are set but not used.
17488 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17489 All callers changed.
17490 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17491 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17492 (decode_coding_charset): Remove vars that are set but not used.
17493
17494 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17495 that is set but not used.
17496
17497 * print.c (print_object): Remove var that is set but not used.
17498
17499 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
17500 The gnulib version avoids calling malloc in the usual case,
17501 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17502 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17503 * filelock.c (current_lock_owner): Likewise.
17504 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17505 * sysdep.c: Include allocator.h, careadlinkat.h.
17506 (emacs_no_realloc_allocator): New static constant.
17507 (emacs_readlink): New function.
17508 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17509 ../lib/careadlinkat.h.
17510
17511 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
17512
17513 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17514 first non-nil return value).
17515
17516 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
17517
17518 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17519 if not defined (Bug#8403).
17520
17521 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17522
17523 * xdisp.c (display_count_lines): Remove parameter `start',
17524 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17525 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17526 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17527 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17528 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17529 and thereabouts. All callers changed.
17530 (get_per_char_metric): Remove parameter `f', unused since
17531 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17532
17533 2011-04-02 Jim Meyering <meyering@redhat.com>
17534
17535 do not dereference NULL upon failed strdup
17536 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17537 (ns_get_family): Likewise.
17538
17539 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17540
17541 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17542
17543 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
17544
17545 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17546 later (Bug#8403).
17547
17548 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
17549
17550 Add lexical binding.
17551
17552 * window.c (Ftemp_output_buffer_show): New fun.
17553 (Fsave_window_excursion):
17554 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17555
17556 * lread.c (lisp_file_lexically_bound_p): New function.
17557 (Fload): Bind Qlexical_binding.
17558 (readevalloop): Remove `evalfun' arg.
17559 Bind Qinternal_interpreter_environment.
17560 (Feval_buffer): Bind Qlexical_binding.
17561 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
17562 Mark as dynamic.
17563 (syms_of_lread): Declare `lexical-binding'.
17564
17565 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
17566
17567 * keyboard.c (eval_dyn): New fun.
17568 (menu_item_eval_property): Use it.
17569
17570 * image.c (parse_image_spec): Use Ffunctionp.
17571
17572 * fns.c (concat, mapcar1): Accept byte-code-functions.
17573
17574 * eval.c (Fsetq): Handle lexical vars.
17575 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
17576 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
17577 (FletX, Flet): Obey lexical binding.
17578 (Fcommandp): Handle closures.
17579 (Feval): New `lexical' arg.
17580 (eval_sub): New function extracted from Feval. Use it almost
17581 everywhere where Feval was used. Look up vars in lexical env.
17582 Handle closures.
17583 (Ffunctionp): Move from subr.el.
17584 (Ffuncall): Handle closures.
17585 (apply_lambda): Remove `eval_flags'.
17586 (funcall_lambda): Handle closures and new byte-code-functions.
17587 (Fspecial_variable_p): New function.
17588 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
17589 but without exporting it to Lisp.
17590
17591 * doc.c (Fdocumentation, store_function_docstring):
17592 * data.c (Finteractive_form): Handle closures.
17593
17594 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
17595 interactive spec.
17596
17597 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
17598 New byte-codes.
17599 (exec_byte_code): New function extracted from Fbyte_code to handle new
17600 calling convention for byte-code-functions. Add new byte-codes.
17601
17602 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
17603
17604 * alloc.c (Fmake_symbol): Init new `declared_special' field.
17605
17606 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
17607
17608 * xdisp.c (redisplay_internal): Fix prototype.
17609
17610 2011-03-31 Eli Zaretskii <eliz@gnu.org>
17611
17612 * xdisp.c (SCROLL_LIMIT): New macro.
17613 (try_scrolling): Use it when setting scroll_limit.
17614 Limit scrolling to 100 screen lines.
17615 (redisplay_window): Even when falling back on "recentering",
17616 position point in the window according to scroll-conservatively,
17617 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
17618
17619 (try_scrolling): When point is above the window, allow searching
17620 as far as scroll_max, or one screenful, to compute vertical
17621 distance from PT to the scroll margin position. This prevents
17622 try_scrolling from unnecessarily failing when
17623 scroll-conservatively is set to a value slightly larger than the
17624 window height. Clean up the case of PT below the margin at bottom
17625 of window: scroll_max can no longer be INT_MAX. When aggressive
17626 scrolling is in use, don't let point enter the opposite scroll
17627 margin as result of the scroll.
17628 (syms_of_xdisp) <scroll-conservatively>: Document the
17629 threshold of 100 lines for never-recentering scrolling.
17630
17631 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
17632
17633 * dispextern.h (move_it_by_lines):
17634 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17635 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
17636 (message_log_check_duplicate): Remove parameters `prev_bol' and
17637 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17638 (redisplay_internal): Remove parameter `preserve_echo_area',
17639 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
17640
17641 * indent.c (Fvertical_motion):
17642 * window.c (window_scroll_pixel_based, Frecenter):
17643 Don't pass `need_y_p' to `move_it_by_lines'.
17644
17645 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
17646
17647 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17648 steal a few bits to be more compact.
17649 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17650 Remove unneeded casts.
17651
17652 * bytecode.c (Fbyte_code): CAR and CDR can GC.
17653
17654 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
17655
17656 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17657 binding" message (bug#7967).
17658
17659 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
17660
17661 Fix more problems found by GCC 4.6.0's static checks.
17662
17663 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17664 Remove unused local var.
17665
17666 * editfns.c (Fmessage_box): Remove unused local var.
17667
17668 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17669 (note_mode_line_or_margin_highlight, note_mouse_highlight):
17670 Omit unused local vars.
17671 * window.c (shrink_windows): Omit unused local var.
17672 * menu.c (digest_single_submenu): Omit unused local var.
17673 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17674 Omit unused local var.
17675
17676 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17677 Don't assume string length fits in int.
17678 (keyremap_step, read_key_sequence): Use size_t for sizes.
17679 (read_key_sequence): Don't check last_real_key_start redundantly.
17680
17681 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17682 instead of alloca (Bug#8344).
17683
17684 * eval.c (Fbacktrace): Don't assume nargs fits in int.
17685 (Fbacktrace_frame): Don't assume nframes fits in int.
17686
17687 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17688
17689 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17690 concerns.
17691
17692 * term.c (produce_glyphless_glyph): Remove unnecessary test.
17693
17694 * cm.c (calccost): Turn while-do into do-while, for clarity.
17695
17696 * keyboard.c (syms_of_keyboard): Use the same style as later
17697 in this function when indexing through an array. This also
17698 works around GCC bug 48267.
17699
17700 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17701
17702 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17703
17704 * chartab.c (sub_char_table_ref_and_range): Redo for slight
17705 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17706
17707 * keyboard.c, keyboard.h (num_input_events): Now size_t.
17708 This avoids undefined behavior on integer overflow, and is a bit
17709 more convenient anyway since it is compared to a size_t variable.
17710
17711 Variadic C functions now count arguments with size_t, not int.
17712 This avoids an unnecessary limitation on 64-bit machines, which
17713 caused (substring ...) to crash on large vectors (Bug#8344).
17714 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
17715 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
17716 All variadic functions and their callers changed accordingly.
17717 (struct gcpro.nvars): Now size_t, not int. All uses changed.
17718 * data.c (arith_driver, float_arith_driver): Likewise.
17719 * editfns.c (general_insert_function): Likewise.
17720 * eval.c (struct backtrace.nargs, interactive_p)
17721 (internal_condition_case_n, run_hook_with_args, apply_lambda)
17722 (funcall_lambda, mark_backtrace): Likewise.
17723 * fns.c (concat): Likewise.
17724 * frame.c (x_set_frame_parameters): Likewise.
17725 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
17726 0 if not found, not -1. All callers changed.
17727
17728 * alloc.c (garbage_collect): Don't assume stack size fits in int.
17729 (stack_copy_size): Now size_t, not int.
17730 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
17731
17732 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
17733
17734 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
17735 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17736 All callers changed.
17737
17738 * lisp.h (multibyte_char_to_unibyte):
17739 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
17740 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17741 * character.h (CHAR_TO_BYTE8):
17742 * cmds.c (internal_self_insert):
17743 * editfns.c (general_insert_function):
17744 * keymap.c (push_key_description):
17745 * search.c (Freplace_match):
17746 * xdisp.c (message_dolog, set_message_1): All callers changed.
17747
17748 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
17749
17750 * keyboard.c (safe_run_hook_funcall): New function.
17751 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17752 don't set the hook to nil, but remove the offending function instead.
17753 (Qcommand_hook_internal): Remove, unused.
17754 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17755 Vcommand_hook_internal.
17756
17757 * eval.c (enum run_hooks_condition): Remove.
17758 (funcall_nil, funcall_not): New functions.
17759 (run_hook_with_args): Call each function through a `funcall' argument.
17760 Remove `cond' argument, now redundant.
17761 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17762 (Frun_hook_with_args_until_failure): Adjust accordingly.
17763 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17764
17765 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
17766
17767 * dispextern.h (string_buffer_position): Remove declaration.
17768
17769 * print.c (strout): Remove parameter `multibyte', unused since
17770 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
17771
17772 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17773 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17774 All callers changed.
17775
17776 * w32.c (_wsa_errlist): Use braces for struct initializers.
17777
17778 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17779 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17780 All callers changed.
17781 (string_buffer_position): Likewise. Also, make static (it's never
17782 used outside xdisp.c).
17783 (cursor_row_p): Remove parameter `w', unused since
17784 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
17785 (decode_mode_spec): Remove parameter `precision', introduced during
17786 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17787 All callers changed.
17788
17789 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17790
17791 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17792
17793 2011-03-27 Anders Lindgren <andlind@gmail.com>
17794
17795 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17796 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17797 (ns_update_auto_hide_menu_bar): New functions.
17798 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17799 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17800 ns_constrain_all_frames.
17801 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17802 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17803
17804 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17805
17806 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17807
17808 2011-03-27 Glenn Morris <rgm@gnu.org>
17809
17810 * syssignal.h: Replace RETSIGTYPE with void.
17811 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17812 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17813 Replace SIGTYPE with void everywhere.
17814 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17815 * s/template.h (SIGTYPE): Remove commented out definition.
17816
17817 2011-03-26 Eli Zaretskii <eliz@gnu.org>
17818
17819 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17820 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17821
17822 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
17823
17824 * w32.c (read_unc_volume): Use parameter `henum', instead of
17825 global variable `wget_enum_handle'.
17826
17827 * keymap.c (describe_vector): Remove parameters `indices' and
17828 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17829 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17830
17831 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17832
17833 * keyboard.c (timer_check): Remove parameter `do_it_now',
17834 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17835 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17836 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17837
17838 * keyboard.c (read_char):
17839 * w32menu.c (w32_menu_display_help):
17840 * xmenu.c (show_help_event, menu_help_callback):
17841 Adjust calls to `show_help_echo'.
17842
17843 * gtkutil.c (xg_maybe_add_timer):
17844 * keyboard.c (readable_events):
17845 * process.c (wait_reading_process_output):
17846 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17847
17848 * insdel.c (adjust_markers_gap_motion):
17849 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17850 (gap_left, gap_right): Don't call it.
17851
17852 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
17853
17854 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17855 incurred during fontification.
17856
17857 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17858
17859 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17860 (DEFVAR_PER_BUFFER): Don't pass it.
17861
17862 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17863 (scrolling_window): Don't pass it.
17864
17865 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17866
17867 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17868
17869 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17870 and `suffix'.
17871 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17872 of variables specific to SELinux and computation of `encoded_absname'.
17873
17874 * image.c (XPutPixel): Remove unused variable `height'.
17875
17876 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17877
17878 * unexw32.c (get_section_info): Remove unused variable `section'.
17879
17880 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17881 (system_process_attributes): Remove unused variable `sess'.
17882 (sys_read): Remove unused variable `err'.
17883
17884 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17885 (w32_wnd_proc): Remove unused variable `isdead'.
17886 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17887 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17888 (x_create_tip_frame): Remove unused variable `tem'.
17889
17890 * w32inevt.c (w32_console_read_socket):
17891 Remove unused variable `no_events'.
17892
17893 * w32term.c (x_draw_composite_glyph_string_foreground):
17894 Remove unused variable `width'.
17895
17896 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
17897
17898 * w32term.c (x_set_glyph_string_clipping):
17899 Don't pass uninitialized region to CombineRgn.
17900
17901 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
17902
17903 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17904 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17905 (Fx_close_connection): Remove unused variable `i'.
17906
17907 * w32font.c (w32font_draw): Return number of glyphs.
17908 (w32font_open_internal): Remove unused variable `i'.
17909 (w32font_driver): Add missing initializer.
17910
17911 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17912 (fill_in_menu): Remove unused variable `items_added'.
17913
17914 * w32term.c (last_mouse_press_frame): Remove static global variable.
17915 (w32_clip_to_row): Remove unused variable `f'.
17916 (x_delete_terminal): Remove unused variable `i'.
17917
17918 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17919 (NOTHING): Remove unused static global variable.
17920 (uniscribe_check_otf): Remove unused variable `table'.
17921 (uniscribe_font_driver): Add missing initializers.
17922
17923 2011-03-23 Julien Danjou <julien@danjou.info>
17924
17925 * term.c (Fsuspend_tty, Fresume_tty):
17926 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17927 * window.c (temp_output_buffer_show):
17928 * insdel.c (signal_before_change):
17929 * frame.c (Fhandle_switch_frame):
17930 * fileio.c (Fdo_auto_save):
17931 * emacs.c (Fkill_emacs):
17932 * editfns.c (save_excursion_restore):
17933 * cmds.c (internal_self_insert):
17934 * callint.c (Fcall_interactively):
17935 * buffer.c (Fkill_all_local_variables):
17936 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17937 Use Frun_hooks.
17938 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
17939 unconditionally since it does the check itself.
17940
17941 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
17942
17943 Fix more problems found by GCC 4.5.2's static checks.
17944
17945 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17946 the first time through the loop, since we know p0 < p1 then.
17947 This also avoids a gcc -Wstrict-overflow warning.
17948
17949 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17950 leading to a memory leak, possible in functions like
17951 load_charset_map_from_file that can allocate an unbounded number
17952 of objects (Bug#8318).
17953
17954 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17955 that could (at least in theory) be that large.
17956
17957 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17958 This is less likely to overflow, and avoids undefined behavior if
17959 overflow does occur. All callers changed. Use strtoul to scan
17960 for the unsigned long integer.
17961 (pint2hrstr): Simplify and tune code slightly.
17962 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
17963
17964 * scroll.c (do_scrolling): Work around GCC bug 48228.
17965 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17966
17967 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17968 This also avoids a warning with gcc -Wstrict-overflow.
17969 (validate_x_resource_name): Simplify count usage.
17970 This also avoids a warning with gcc -Wstrict-overflow.
17971
17972 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17973 fail (Bug#8306).
17974
17975 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
17976
17977 * process.c (Fmake_network_process): Use socklen_t, not int,
17978 where POSIX says socklen_t is required in portable programs.
17979 This fixes a porting bug on hosts like 64-bit HP-UX, where
17980 socklen_t is wider than int (Bug#8277).
17981 (Fmake_network_process, server_accept_connection):
17982 (wait_reading_process_output, read_process_output):
17983 Likewise.
17984
17985 * process.c: Rename or move locals to avoid shadowing.
17986 (list_processes_1, Fmake_network_process):
17987 (read_process_output_error_handler, exec_sentinel_error_handler):
17988 Rename or move locals.
17989 (Fmake_network_process): Define label "retry_connect" only if needed.
17990 (Fnetwork_interface_info): Fix pointer signedness.
17991 (process_send_signal): Add cast to avoid pointer signedness problem.
17992 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
17993 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
17994
17995 Make tparam.h and terminfo.c consistent.
17996 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17997 Include tparam.h instead, since it declares them.
17998 * cm.h (PC): Remove extern decl; tparam.h now does this.
17999 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18000 * terminfo.c: Include tparam.h, to check interfaces.
18001 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18002 (tparam): Adjust signature to match interface in tparam.h;
18003 this removes some undefined behavior. Check that outstring and len
18004 are zero, which they always are with Emacs.
18005 * tparam.h (PC, BC, UP): New extern decls.
18006
18007 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
18008 (xftfont_open): Rename locals to avoid shadowing.
18009
18010 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
18011 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18012 (OTF_TAG_SYM): Omit macro if not needed.
18013 (ftfont_list): Remove unused local.
18014 (get_adstyle_property, ftfont_pattern_entity):
18015 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18016 Rename locals to avoid shadowing.
18017
18018 * xfont.c (xfont_list_family): Mark var as initialized.
18019
18020 * xml.c (make_dom): Now static.
18021
18022 * composite.c (composition_compute_stop_pos): Rename local to
18023 avoid shadowing.
18024 (composition_reseat_it): Remove unused locals.
18025 (find_automatic_composition, composition_adjust_point): Likewise.
18026 (composition_update_it): Mark var as initialized.
18027 (find_automatic_composition): Mark vars as initialized,
18028 with a FIXME (Bug#8290).
18029
18030 character.h: Rename locals to avoid shadowing.
18031 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18032 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18033 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18034 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18035 to avoid shadowing.
18036
18037 * textprop.c (property_change_between_p): Remove; unused.
18038
18039 * intervals.c (interval_start_pos): Now static.
18040
18041 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18042
18043 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18044 Rename locals to avoid shadowing.
18045
18046 * sound.c (wav_play, au_play, Fplay_sound_internal):
18047 Fix pointer signedness.
18048 (alsa_choose_format): Remove unused local var.
18049 (wav_play): Initialize a variable to 0, to prevent undefined
18050 behavior (Bug#8278).
18051
18052 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18053
18054 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18055
18056 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18057 clobbering (Bug#8298).
18058 * sysdep.c (sys_subshell): Likewise.
18059 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
18060
18061 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18062 This should get cleaned up, so that child_setup has the
18063 same signature on all platforms.
18064
18065 * callproc.c (call_process_cleanup): Now static.
18066 (relocate_fd): Rename locals to avoid shadowing.
18067
18068 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
18069
18070 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18071 not to be necessary, and produces flickering.
18072
18073 2011-03-20 Glenn Morris <rgm@gnu.org>
18074
18075 * config.in: Remove file.
18076
18077 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
18078
18079 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18080 are now in src/globals.h.
18081 (syms_of_minibuf): Remove spurious & from previous change.
18082
18083 2011-03-20 Leo Liu <sdl.web@gmail.com>
18084
18085 * minibuf.c (completing-read-function): New variable.
18086 (completing-read-default): Rename from completing-read.
18087 (completing-read): Call completing-read-function.
18088
18089 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18090
18091 * xfaces.c (Fx_load_color_file):
18092 Read color file from absolute filename (bug#8250).
18093
18094 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18095
18096 * makefile.w32-in: Update dependencies.
18097
18098 2011-03-17 Eli Zaretskii <eliz@gnu.org>
18099
18100 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18101
18102 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18103
18104 Fix more problems found by GCC 4.5.2's static checks.
18105
18106 * process.c (make_serial_process_unwind, send_process_trap):
18107 (sigchld_handler): Now static.
18108
18109 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18110 That way, the code declares only the vars that it needs.
18111 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18112 * s/cygwin.h (PTY_ITERATION): Likewise.
18113 * s/darwin.h (PTY_ITERATION): Likewise.
18114 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18115
18116 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18117 * process.c (allocate_pty): Don't declare stb unless it's needed.
18118
18119 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
18120 (CONSTANTLIM): Remove; unused.
18121 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18122 Define only if needed.
18123
18124 * unexelf.c (unexec): Name an expression,
18125 to avoid gcc -Wbad-function-cast warning.
18126 Use a different way to cause a compilation error if anyone uses
18127 n rather than nn, a way that does not involve shadowing.
18128 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
18129
18130 * deps.mk (unexalpha.o): Remove; unused.
18131
18132 New file unexec.h, the (simple) interface for unexec (Bug#8267).
18133 * unexec.h: New file.
18134 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18135 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18136 Depend on unexec.h.
18137 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18138 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18139 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
18140 Change as necessary to match prototype in unexec.h.
18141
18142 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18143 shadowing.
18144 (back_comment, skip_chars): Mark vars as initialized.
18145
18146 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18147 Rename locals to avoid shadowing.
18148
18149 * lread.c (read1): Rewrite so as not to use empty "else".
18150 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
18151
18152 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18153
18154 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18155 warning when compiling print.c.
18156
18157 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18158 instead of using an uninitialized var.
18159 (font_sort_entities): Mark var as initialized.
18160
18161 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18162
18163 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18164 pointers to constants.
18165 (font_parse_fcname): Remove unused vars.
18166 (font_delete_unmatched): Now static.
18167 (font_get_spec): Remove; unused.
18168 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18169 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18170 Rename or move locals to avoid shadowing.
18171
18172 * fns.c (require_nesting_list, require_unwind): Now static.
18173 (Ffillarray): Rename locals to avoid shadowing.
18174
18175 * floatfns.c (domain_error2): Define only if needed.
18176 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
18177
18178 * alloc.c (mark_backtrace): Move decl from here ...
18179 * lisp.h: ... to here, so that it can be checked.
18180
18181 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
18182 (Fdefvar): Rewrite so as not to use empty "else".
18183 (lisp_indirect_variable): Name an expression,
18184 to avoid gcc -Wbad-function-cast warning.
18185 (Fdefvar): Rename locals to avoid shadowing.
18186
18187 * callint.c (quotify_arg, quotify_args): Now static.
18188 (Fcall_interactively): Rename locals to avoid shadowing.
18189 Use const pointer when appropriate.
18190
18191 * lisp.h (get_system_name, get_operating_system_release):
18192 Move decls here, to check interfaces.
18193 * process.c (get_operating_system_release): Move decl to lisp.h.
18194 * xrdb.c (get_system_name): Likewise.
18195 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18196 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18197 some of which prompt warnings from gcc -Wbad-function-cast.
18198 (Fformat_time_string, Fencode_time, Finsert_char):
18199 (Ftranslate_region_internal, Fformat):
18200 Rename or remove local vars to avoid shadowing.
18201 (Ftranslate_region_internal): Mark var as initialized.
18202
18203 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18204 avoid shadowing.
18205
18206 * lisp.h (eassert): Check that the argument compiles, even if
18207 ENABLE_CHECKING is not defined.
18208
18209 * data.c (Findirect_variable): Name an expression, to avoid
18210 gcc -Wbad-function-cast warning.
18211 (default_value, arithcompare, arith_driver, arith_error): Now static.
18212 (store_symval_forwarding): Rename local to avoid shadowing.
18213 (Fmake_variable_buffer_local, Fmake_local_variable):
18214 Mark variables as initialized.
18215 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
18216
18217 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
18218 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
18219 Rename locals to avoid shadowing.
18220 (mark_stack): Move local variables into the #ifdef region where
18221 they're used.
18222 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
18223 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
18224 needed otherwise.
18225 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
18226 (GC_STRING_CHARS): Remove; not used.
18227 (Fmemory_limit): Cast sbrk's returned value to char *.
18228
18229 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
18230 avoids undefined behavior in theory.
18231
18232 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
18233
18234 Use functions, not macros, for up- and down-casing (Bug#8254).
18235 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18236 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
18237 to use the following functions instead of these macros.
18238 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
18239 EMACS_INT, since callers assume the returned value fits in int.
18240 (upcase1): Likewise, for UPCASE_TABLE.
18241 (uppercasep, lowercasep, upcase): New static inline functions.
18242 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
18243 the race-condition problem in the old DOWNCASE.
18244
18245 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
18246 Rename locals to avoid shadowing.
18247 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
18248 (regex_compile, re_search_2, re_match_2_internal):
18249 Remove unused local vars.
18250 (FREE_VAR): Rewrite so as not to use empty "else",
18251 which gcc can warn about.
18252 (regex_compile, re_match_2_internal): Mark locals as initialized.
18253 (RETALLOC_IF): Define only if needed.
18254 (WORDCHAR_P): Likewise. This one is never needed, but is used
18255 only in a comment talking about a compiler bug, so put inside
18256 the #if 0 of that comment.
18257 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
18258 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
18259 Remove; unused.
18260
18261 * search.c (boyer_moore): Rename locals to avoid shadowing.
18262 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
18263 (PREV_CHAR_BOUNDARY): Likewise.
18264
18265 * search.c (simple_search): Remove unused var.
18266
18267 * dired.c (compile_pattern): Move decl from here ...
18268 * lisp.h: ... to here, so that it can be checked.
18269 (struct re_registers): New forward decl.
18270
18271 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
18272
18273 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
18274 All uses changed.
18275 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
18276 Rename locals to avoid shadowing.
18277 (Fvertical_motion): Mark locals as initialized.
18278
18279 * casefiddle.c (casify_object, casify_region): Now static.
18280 (casify_region): Mark local as initialized.
18281
18282 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
18283
18284 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
18285 New macros, so that the caller can use some names other than
18286 gcpro1, gcpro2, etc.
18287 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
18288 of the new macros.
18289 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
18290 argument, for consistency with GCPRO2_VAR, etc: it is now the
18291 prefix of the variable, not the variable itself. All uses
18292 changed.
18293 * dired.c (directory_files_internal, file_name_completion):
18294 Rename locals to avoid shadowing.
18295
18296 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
18297 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
18298 dired.c's scmp function, had undefined behavior.
18299 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18300 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
18301 * buffer.h: ... to here, because these macros use current_buffer,
18302 and the new implementation with inline functions needs to have
18303 current_buffer in scope now, rather than later when the macros
18304 are used.
18305 (downcase, upcase1): New static inline functions.
18306 (DOWNCASE, UPCASE1): Reimplement using these functions.
18307 This avoids undefined behavior in expressions like
18308 DOWNCASE (x) == DOWNCASE (y), which previously suffered
18309 from race conditions in accessing the global variables
18310 case_temp1 and case_temp2.
18311 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
18312 * lisp.h (case_temp1, case_temp2): Remove their decls.
18313 * character.h (ASCII_CHAR_P): Move from here ...
18314 * lisp.h: ... to here, so that the inline functions mentioned
18315 above can use them.
18316
18317 * dired.c (directory_files_internal_unwind): Now static.
18318
18319 * fileio.c (file_name_as_directory, directory_file_name):
18320 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
18321 Now static.
18322 (file_name_as_directory): Use const pointers when appropriate.
18323 (Fexpand_file_name): Likewise. In particular, newdir might
18324 point at constant storage, so make it a const pointer.
18325 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
18326 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
18327 signedness issues.
18328 (Fset_file_times, Finsert_file_contents, auto_save_error):
18329 Rename locals to avoid shadowing.
18330
18331 * minibuf.c (choose_minibuf_frame_1): Now static.
18332 (Ftry_completion, Fall_completions): Rename or remove locals
18333 to avoid shadowing.
18334
18335 * marker.c (bytepos_to_charpos): Remove; unused.
18336
18337 * lisp.h (verify_bytepos, count_markers): New decls,
18338 so that gcc does not warn that these functions aren't declared.
18339
18340 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
18341 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
18342 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
18343 (copy_text): Remove unused local var.
18344
18345 * filelock.c (within_one_second): Now static.
18346 (lock_file_1): Rename local to avoid shadowing.
18347
18348 * buffer.c (fix_overlays_before): Mark locals as initialized.
18349 (fix_start_end_in_overlays): Likewise. This function should be
18350 simplified by using pointers-to-pointers, but that's a different
18351 matter.
18352 (switch_to_buffer_1): Now static.
18353 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
18354 (report_overlay_modification): Rename locals to avoid shadowing.
18355
18356 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
18357 Fix pointer signedness issue.
18358 (sys_subshell): Mark local as volatile if checking for lint,
18359 to suppress a gcc -Wclobbered warning that does not seem to be right.
18360 (MAXPATHLEN): Define only if needed.
18361
18362 * process.c (serial_open, serial_configure): Move decls from here ...
18363 * systty.h: ... to here, so that they can be checked.
18364
18365 * fns.c (get_random, seed_random): Move extern decls from here ...
18366 * lisp.h: ... to here, so that they can be checked.
18367
18368 * sysdep.c (reset_io): Now static.
18369 (wait_for_termination_signal): Remove; unused.
18370
18371 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
18372 (copy_keymap_item, append_key, push_text_char_description):
18373 Now static.
18374 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
18375 (DENSE_TABLE_SIZE): Remove; unused.
18376 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
18377 (describe_map_tree):
18378 Rename locals to avoid shadowing.
18379
18380 * keyboard.c: Declare functions static if they are not used elsewhere.
18381 (echo_char, echo_dash, cmd_error, top_level_2):
18382 (poll_for_input, handle_async_input): Now static.
18383 (read_char, kbd_buffer_get_event, make_lispy_position):
18384 (make_lispy_event, make_lispy_movement, apply_modifiers):
18385 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
18386 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
18387 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
18388 (read_key_sequence, read_char): Mark locals as initialized.
18389 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
18390
18391 * keyboard.h (make_ctrl_char): New decl.
18392 (mark_kboards): Move decl here ...
18393 * alloc.c (mark_kboards): ... from here.
18394
18395 * lisp.h (force_auto_save_soon): New decl.
18396
18397 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
18398 (DEFINE_DUMMY_FUNCTION): New macro.
18399 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
18400 Use it.
18401 (main): Add casts to avoid warnings
18402 if GCC considers string literals to be constants.
18403
18404 * lisp.h (fatal_error_signal): Add decl, since it's exported.
18405
18406 * dbusbind.c: Pointer signedness fixes.
18407 (xd_signature, xd_append_arg, xd_initialize):
18408 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18409 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18410 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
18411 (Fdbus_register_signal): Use SSDATA when the context wants char *.
18412
18413 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
18414 if GCC considers string literals to be constants.
18415 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
18416
18417 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
18418
18419 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18420 (print_preprocess, print_object): New macro to fix last change.
18421
18422 * print.c (print_preprocess): Don't forget font objects.
18423
18424 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
18425
18426 * emacs.c (USAGE3): Doc fixes.
18427
18428 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
18429
18430 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
18431 structure.
18432
18433 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
18434
18435 * lisp.h (VWindow_system, Qfile_name_history):
18436 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
18437 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
18438 (w32_system_caret_x, w32_system_caret_y): Declare extern.
18439
18440 * w32select.c: Don't #include "keyboard.h".
18441 (run_protected): Add extern declaration for waiting_for_input.
18442
18443 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18444 * w32console.c (detect_input_pending, read_input_pending)
18445 (encode_terminal_code):
18446 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18447 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18448 (w32_system_caret_y, Qfile_name_history):
18449 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18450 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18451 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18452 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18453 * w32proc.c (Qlocal, report_file_error):
18454 * w32term.c (Vwindow_system, updating_frame):
18455 * w32uniscribe.c (initialized, uniscribe_font_driver):
18456 Remove unneeded extern declarations.
18457
18458 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
18459
18460 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
18461
18462 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
18463
18464 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18465 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18466 These macros can no longer be used for assignment.
18467
18468 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18469 Assign struct members directly, instead of using BUF_BEGV etc.
18470 (record_buffer_markers, fetch_buffer_markers): New functions for
18471 recording and fetching special buffer markers.
18472 (set_buffer_internal_1, set_buffer_temp): Use them.
18473
18474 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18475
18476 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18477
18478 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18479 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
18480
18481 * xdisp.c (hscroll_window_tree):
18482 (reconsider_clip_changes): Use PT instead of BUF_PT.
18483
18484 2011-03-13 Eli Zaretskii <eliz@gnu.org>
18485
18486 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18487 $(EMACS_ROOT)/lib/intprops.h.
18488
18489 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
18490
18491 Fix more problems found by GCC 4.5.2's static checks.
18492
18493 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18494 to unsigned char * to avoid compiler diagnostic.
18495 (xg_free_frame_widgets): Make it clear that a local variable is
18496 needed only if USE_GTK_TOOLTIP.
18497 (gdk_window_get_screen): Make it clear that this macro is needed
18498 only if USE_GTK_TOOLTIP.
18499 (int_gtk_range_get_value): New function, which avoids a diagnostic
18500 from gcc -Wbad-function-cast.
18501 (xg_set_toolkit_scroll_bar_thumb): Use it.
18502 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18503 diagnostic from gcc -Wbad-function-cast.
18504 (get_utf8_string, xg_get_file_with_chooser):
18505 Rename locals to avoid shadowing.
18506 (create_dialog): Move locals to avoid shadowing.
18507
18508 * xgselect.c (xg_select): Remove unused var.
18509
18510 * image.c (four_corners_best): Mark locals as initialized.
18511 (gif_load): Initialize transparent_p to zero (Bug#8238).
18512 Mark another local as initialized.
18513 (my_png_error, my_error_exit): Mark with NO_RETURN.
18514
18515 * image.c (clear_image_cache): Now static.
18516 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
18517 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
18518 (x_edge_detection): Remove unnecessary cast that
18519 gcc -Wbad-function-cast diagnoses.
18520 (gif_load): Fix pointer signedness.
18521 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18522 (jpeg_load, gif_load): Rename locals to avoid shadowing.
18523
18524 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
18525
18526 Improve quality of tests for time stamp overflow.
18527 For example, without this patch (encode-time 0 0 0 1 1
18528 1152921504606846976) returns the obviously-bogus value (-948597
18529 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18530 reports time overflow. See
18531 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
18532 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18533 * editfns.c: Include limits.h and intprops.h.
18534 (TIME_T_MIN, TIME_T_MAX): New macros.
18535 (time_overflow): Move earlier, to before first use.
18536 (hi_time, lo_time): New functions, for an accurate test for
18537 out-of-range times.
18538 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18539 (Fget_internal_run_time): Don't assume time_t fits in int.
18540 (make_time): Use list2 instead of Fcons twice.
18541 (Fdecode_time): More accurate test for out-of-range times.
18542 (check_tm_member): New function.
18543 (Fencode_time): Use it, to test for out-of-range times.
18544 (lisp_time_argument): Don't rely on undefined left-shift and
18545 right-shift behavior when checking for time stamp overflow.
18546
18547 * editfns.c (time_overflow): New function, refactoring common code.
18548 (Fformat_time_string, Fdecode_time, Fencode_time):
18549 (Fcurrent_time_string): Use it.
18550
18551 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18552 * dired.c (make_time): Move to ...
18553 * editfns.c (make_time): ... here.
18554 * systime.h: Note the move.
18555
18556 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18557
18558 * fringe.c (update_window_fringes): Remove unused variables.
18559
18560 * unexmacosx.c (copy_data_segment): Also copy __got section.
18561 (Bug#8223)
18562
18563 2011-03-12 Eli Zaretskii <eliz@gnu.org>
18564
18565 * termcap.c [MSDOS]: Include "msdos.h".
18566 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
18567 Constify `char *' arguments and their references according to
18568 prototypes in tparam.h.
18569
18570 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
18571
18572 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
18573 Adapt all references accordingly.
18574
18575 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
18576
18577 2011-03-11 Tom Tromey <tromey@redhat.com>
18578
18579 * buffer.c (syms_of_buffer): Remove obsolete comment.
18580
18581 2011-03-11 Eli Zaretskii <eliz@gnu.org>
18582
18583 * termhooks.h (encode_terminal_code): Declare prototype.
18584
18585 * msdos.c (encode_terminal_code): Don't declare prototype.
18586
18587 * term.c (encode_terminal_code): Now external again, used by
18588 w32console.c and msdos.c.
18589
18590 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
18591 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
18592
18593 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
18594
18595 Fix some minor problems found by GCC 4.5.2's static checks.
18596
18597 * fringe.c (update_window_fringes): Mark locals as initialized
18598 (Bug#8227).
18599 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
18600
18601 * alloc.c (mark_fringe_data): Move decl from here ...
18602 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
18603 to check its interface.
18604 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
18605
18606 * fontset.c (free_realized_fontset): Now static.
18607 (Fset_fontset_font): Rename local to avoid shadowing.
18608 (fontset_font): Mark local as initialized.
18609 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
18610
18611 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
18612
18613 * xselect.c (x_disown_buffer_selections): Remove; not used.
18614 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
18615 (x_own_selection, Fx_disown_selection_internal): Rename locals
18616 to avoid shadowing.
18617 (x_handle_dnd_message): Remove local to avoid shadowing.
18618
18619 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
18620 so that the caller can use some name other than gcpro1.
18621 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
18622 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18623 (Fx_backspace_delete_keys_p):
18624 Use them to avoid shadowing, and rename vars to avoid shadowing.
18625 (x_decode_color, x_set_name, x_window): Now static.
18626 (Fx_create_frame): Add braces to silence GCC warning.
18627 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
18628 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18629 Remove unused locals.
18630 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18631 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18632 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18633 macros.
18634
18635 * xterm.h (x_mouse_leave): New decl.
18636
18637 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18638 Remove unused functions.
18639 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18640 (x_calc_absolute_position): Now static.
18641 (XTread_socket): Don't define label "out" unless it's used.
18642 Don't declare local "event" unless it's used.
18643 (x_iconify_frame, x_free_frame_resources): Don't declare locals
18644 unless they are used.
18645 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18646 (x_fatal_error_signal): Remove; not used.
18647 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18648 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18649 (x_error_catcher, x_connection_closed, x_error_handler):
18650 (x_error_quitter, xembed_send_message, x_iconify_frame):
18651 (my_log_handler): Rename locals to avoid shadowing.
18652 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
18653 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
18654
18655 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18656 Rename or move locals to avoid shadowing.
18657 (tty_defined_color, merge_face_heights): Now static.
18658 (free_realized_faces_for_fontset): Remove; not used.
18659 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18660 does not deduce is never used uninitialized.
18661 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18662 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
18663
18664 * terminal.c (store_terminal_param): Now static.
18665
18666 * xmenu.c (menu_highlight_callback): Now static.
18667 (set_frame_menubar): Remove unused local.
18668 (xmenu_show): Rename parameter to avoid shadowing.
18669 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18670 since they might point to immutable storage.
18671 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18672 since it's unused otherwise.
18673
18674 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
18675 Add a FIXME, since the code still doesn't look right. (Bug#8215)
18676 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18677 avoids a gcc -Wuninitialized diagnostic.
18678 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
18679 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18680 does not deduce are never used uninitialized.
18681
18682 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18683
18684 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
18685 * window.c (window_loop, size_window):
18686 (run_window_configuration_change_hook, enlarge_window): Likewise.
18687
18688 * window.c (display_buffer): Now static.
18689 (size_window): Mark variables that gcc -Wuninitialized
18690 does not deduce are never used uninitialized.
18691 * window.h (check_all_windows): New decl, to forestall
18692 gcc -Wmissing-prototypes diagnostic.
18693 * dispextern.h (bidi_dump_cached_states): Likewise.
18694
18695 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18696 shadowing.
18697 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
18698 Include <limits.h>.
18699 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18700 and to avoid gcc -Wuninitialized warning.
18701 (load_charset_map): Mark variables that gcc -Wuninitialized
18702 does not deduce are never used uninitialized.
18703 (load_charset): Abort instead of using uninitialized var (Bug#8229).
18704
18705 * coding.c (coding_set_source, coding_set_destination):
18706 Use "else { /* comment */ }" rather than "else /* comment */;"
18707 for clarity, and to avoid gcc -Wempty-body warning.
18708 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18709 a block, when the outer 'i' will do.
18710 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18711 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18712 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18713 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
18714 (Fdecode_sjis_char, Fdefine_coding_system_internal):
18715 Rename locals to avoid shadowing.
18716 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
18717 * coding.c (emacs_mule_char, encode_invocation_designation):
18718 Now static, since they're not used elsewhere.
18719 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
18720 (decode_coding_object, encode_coding_object, detect_coding_system):
18721 (decode_coding_emacs_mule): Mark variables that gcc
18722 -Wuninitialized does not deduce are never used uninitialized.
18723 (detect_coding_iso_2022): Initialize a local variable that might
18724 be used uninitialized. Leave a FIXME because it's not clear that
18725 this initialization is needed. (Bug#8211)
18726 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
18727 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
18728 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
18729 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
18730 Remove unused macros.
18731
18732 * category.c (hash_get_category_set): Remove unused local var.
18733 (copy_category_table): Now static, since it's not used elsewhere.
18734 * character.c (string_count_byte8): Likewise.
18735
18736 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
18737 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
18738
18739 * chartab.c (copy_sub_char_table): Now static, since it's not used
18740 elsewhere.
18741 (sub_char_table_ref_and_range, char_table_ref_and_range):
18742 Rename locals to avoid shadowing.
18743 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
18744
18745 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
18746 (BIDI_BOB): Remove unused macro.
18747
18748 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18749 deduce are never used uninitialized.
18750 * term.c (encode_terminal_code): Likewise.
18751
18752 * term.c (encode_terminal_code): Now static. Remove unused local.
18753
18754 * tparam.h: New file.
18755 * term.c, tparam.h: Include it.
18756 * deps.mk (term.o, tparam.o): Depend on tparam.h.
18757 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18758 Move these decls to tparam.h, and make them agree with what
18759 is actually in tparam.c. The previous trick of using incompatible
18760 decls in different modules does not conform to the C standard.
18761 All callers of tparam changed to use tparam's actual API.
18762 * tparam.c (tparam1, tparam, tgoto):
18763 Use const pointers where appropriate.
18764
18765 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18766 * cm.h (struct cm): Likewise.
18767 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18768 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18769 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18770 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18771 (turn_on_face, init_tty): Likewise.
18772 * termchar.h (struct tty_display_info): Likewise.
18773
18774 * term.c (term_mouse_position): Rename local to avoid shadowing.
18775
18776 * alloc.c (mark_ttys): Move decl from here ...
18777 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18778
18779 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
18780
18781 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18782
18783 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
18784
18785 * search.c (compile_pattern_1): Remove argument regp, unused since
18786 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18787 (compile_pattern): Don't pass it.
18788
18789 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18790
18791 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18792 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18793 for ! HAVE_GTK3.
18794 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18795
18796 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18797
18798 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18799 gdk_window_get_screen, gdk_window_get_geometry,
18800 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18801 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18802 (xg_get_pixbuf_from_pixmap): New function.
18803 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18804 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18805 Call xg_get_pixbuf_from_pixmap instead of
18806 gdk_pixbuf_get_from_drawable.
18807 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18808 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18809 (xg_check_special_colors): Use GtkStyleContext and its functions
18810 for HAVE_GTK3.
18811 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18812 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18813 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
18814 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18815 Call gtk_widget_get_preferred_size.
18816 (xg_frame_resized): gdk_window_get_geometry only takes 5
18817 parameters.
18818 (xg_win_to_widget, xg_event_is_for_menubar):
18819 Call gdk_x11_window_lookup_for_display.
18820 (xg_set_widget_bg): New function.
18821 (delete_cb): New function.
18822 (xg_create_frame_widgets): Connect delete-event to delete_cb.
18823 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
18824 (xg_set_background_color): Call xg_set_widget_bg.
18825 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18826 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18827 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18828 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18829 if ! HAVE_GTK3.
18830 (update_frame_tool_bar): Call gtk_widget_hide.
18831 (xg_initialize): Use GDK_KEY_g.
18832
18833 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18834 if ! HAVE_GTK3
18835 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18836
18837 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18838 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18839 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18840
18841 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
18842
18843 * w32xfns.c (select_palette): Check success of RealizePalette against
18844 GDI_ERROR, not zero.
18845
18846 See ChangeLog.11 for earlier changes.
18847
18848 ;; Local Variables:
18849 ;; coding: utf-8
18850 ;; End:
18851
18852 Copyright (C) 2011-2012 Free Software Foundation, Inc.
18853
18854 This file is part of GNU Emacs.
18855
18856 GNU Emacs is free software: you can redistribute it and/or modify
18857 it under the terms of the GNU General Public License as published by
18858 the Free Software Foundation, either version 3 of the License, or
18859 (at your option) any later version.
18860
18861 GNU Emacs is distributed in the hope that it will be useful,
18862 but WITHOUT ANY WARRANTY; without even the implied warranty of
18863 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18864 GNU General Public License for more details.
18865
18866 You should have received a copy of the GNU General Public License
18867 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.